/** * # Why using `index.ts` instead of `index.d.ts`? * * The `index.d.ts` dose't get moved to `dist` by `tsc`. Here is an explanation why `index.d.ts` don't get moved to `dist`: * * Basically `.d.ts` files are seen as untouchable input for the compiler to do type checks. * They are not used for any output generation, which also means, they do not get copied over to build. * You can read more [here](https://github.com/Microsoft/TypeScript/issues/5112) about the maintainers' standpoint: * * Solution #1: Copy d.ts files via manual build step * Solution #2: Reword `d.ts` files to `.ts` extension * @see https://stackoverflow.com/questions/56018167/typescript-does-not-copy-d-ts-files-to-build */ /** * ArcGIS Online Portal Item * * @see https://developers.arcgis.com/rest/users-groups-and-items/item.htm * @see https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-portal/IItem */ export type IItem = { id: string; title: string; type: string; typeKeywords?: string[]; description?: string; snippet?: string; documentation?: string; extent?: number[][]; categories?: string[]; spatialReference?: any; culture?: string; properties?: any; url?: string; owner: string; tags: string[]; created: number; modified: number; numViews: number; size: number; /** * indicates whether the item is protected or not. */ protected?: boolean; /** * sharing level of the item: public, org, shared, private */ access?: string; [key: string]: any; }; /** * An ArcGIS Online or Enterprise user * * @see https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-portal/IUser * @see https://github.com/Esri/arcgis-rest-js/blob/main/packages/arcgis-rest-request/src/types/user.ts */ export interface IUser { username?: string; fullName?: string; availableCredits?: number; assignedCredits?: number; firstName?: string; lastName?: string; preferredView?: any; description?: string; email?: string; idpUsername?: string; favGroupId?: string; lastLogin?: number; mfaEnabled?: boolean; access?: string; storageUsage?: number; storageQuota?: number; orgId?: string; cOrgId?: string; role?: 'org_admin' | 'org_publisher' | 'org_user'; privileges?: string[]; roleId?: string; level?: string; disabled?: boolean; units?: string; tags?: string[]; culture?: string; region?: string; thumbnail?: string; created?: number; modified?: number; groups?: any[]; provider?: 'arcgis' | 'enterprise' | 'facebook' | 'google' | 'apple' | 'github'; id?: string; } export type ValidationMessage = { code?: string; message: string; }; /** * Represents the status of a validation result for a specific rule. * This type indicates the outcome of the validation process for * each rule and helps in understanding how well the item meets the * criteria defined by the validation rules. * * The possible values for this type include: * - `pass`: The validation rule has been passed successfully. * - `warning`: The validation rule has been passed but with some warnings. * - `error`: The validation rule has failed and requires attention or correction. * - `not-applicable`: The validation rule is not applicable to the item being validated. * - `unknown`: The validation status is unknown, which is the default status when a ValidationInfo object is created but the validation process has not yet been executed. */ export type ValidationResultStatus = 'pass' | 'warning' | 'error' | 'not-applicable' | 'unknown'; export declare const ValidationRuleIds: readonly ["item-sharing-level", "item-credits-attribution-info", "item-description", "item-license-info", "item-snippet", "item-ssl", "item-tags", "item-thumbnail", "item-title", "item-deprecated", "item-delete-protection", "item-title-and-summary-searchability", "user-profile-description", "user-profile-full-name", "user-profile-thumbnail", "feature-service-field-value-types", "feature-service-field-aliases", "feature-service-field-descriptions", "item-extent", "feature-service-cdn-setting", "feature-service-field-indexes", "feature-service-export-data-setting", "feature-service-extents", "webmap-layers", "item-popup", "item-description-recommended-info"]; /** * Validation rule identifier */ export type ValidationRuleId = (typeof ValidationRuleIds)[number]; export type ValidationInfo = { /** * The identifier of the validation rule, e.g., "item-sharing-level" or "item-description". * It serves as a unique, human-readable identifier for each rule. */ validationRuleId: ValidationRuleId; /** * The title string tells the user what this validation rule checks, e.g., "Check Thumbnail" or "Check Number of Layers". */ title: string; /** * The label text will be used to instruct the user what they should do, e.g., "Improve Thumbnail" or "Reduce Number of Layers". */ label: string; /** * array of validation messages */ messages: ValidationMessage[]; /** * Maximum score this validation rule can receive. */ maxScore: number; /** * Final score that the item received for this validation rule. */ score: number; /** * Weight assigned to this validation rule. */ weight: number; /** * A scoring factor ranging between 0 and 1 used to calculate the final score by multiplying it with the weight number. * 0 means the validation rule received no points, while 1 means it received the maximum score. */ scoringFactor: number; /** * Status of the validation result */ status: ValidationResultStatus; /** * if true, this validation rule is a binary check, i.e., it can only pass or fail. */ isBinaryCheck: boolean; /** * if true, this validation rule is considered an advisory check and does not impact the overall score. */ isAdvisory: boolean; }; /** * Represents the result of validating an ArcGIS Online item and its owner's profile. * * This type is returned by the `validate` function and contains detailed validation results * for both the item and its owner's profile, as well as overall scoring and nomination eligibility. */ export type ValidationResult = { /** * Validation results for the ArcGIS Online item. * Each property corresponds to a specific validation rule applied to the item. */ validatedItem: { /** * Validation result for the item's sharing level (access). */ access: ValidationInfo; /** * Validation result for the item's credits/attribution information. */ accessInformation: ValidationInfo; /** * Validation result for the item's description text. */ description: ValidationInfo; /** * Validation result for the item's license information. */ licenseInfo: ValidationInfo; /** * Validation result for the item's snippet (summary text). */ snippet: ValidationInfo; /** * Validation result for the item's HTTPS URL. */ ssl: ValidationInfo; /** * Validation result for the item's tags. */ tags: ValidationInfo; /** * Validation result for the item's thumbnail image. */ thumbnail: ValidationInfo; /** * Validation result for the item's title. */ title: ValidationInfo; /** * Validation result for the item's deprecated/content status. */ deprecated: ValidationInfo; /** * Validation result for the item's delete protection property. */ deleteProtection: ValidationInfo; /** * Validation result for searchability the item's title and summary. * Applicable only to English layer items. */ recommendedTextInTitleAndSummary: ValidationInfo; /** * Validation result for field aliases in feature layers of a feature service item. * Applicable only to feature service items. */ featureServiceFieldAliases: ValidationInfo; /** * Validation result for field descriptions in feature layers of a feature service item. * Applicable only to feature service items. */ featureServiceFieldDescriptions: ValidationInfo; /** * Validation result for field value types in feature layers of a feature service item. * Applicable only to feature service items. */ featureServiceFieldValueTypes: ValidationInfo; /** * Validation result for the item's extent. */ itemExtent: ValidationInfo; /** * Validation result for layers in the web map. It checks for deprecated and inaccessible layers. * It also checks if the web map contains any layers and whether the layer count exceeds the recommended maximum. */ webmapLayers: ValidationInfo; /** * Validation result for the item's popup configuration. */ itemPopup: ValidationInfo; }; /** * Validation results for the item owner's profile. * Each property corresponds to a specific validation rule applied to the user profile. */ validatedProfile: { /** * Validation result for the owner's profile description. */ userProfileDescription: ValidationInfo; /** * Validation result for the owner's full name. */ userProfileFullName: ValidationInfo; /** * Validation result for the owner's thumbnail image. */ userProfileThumbnail: ValidationInfo; }; /** * Validation results for advisory checks that do not impact the overall score. */ advisories: { /** * Validation result for the feature service CDN setting. */ featureServiceCdnSetting: ValidationInfo; /** * Validation result for the feature service field indexes. */ featureServiceFieldIndexes: ValidationInfo; /** * Validation result for the feature service export data setting. */ featureServiceExportDataSetting: ValidationInfo; /** * Validation result for the feature service extents. */ featureServiceExtents: ValidationInfo; /** * Validation result for the recommended information to include in the item description. */ itemDescriptionRecommendedInfo: ValidationInfo; }; /** * The ArcGIS Online Item ID. */ id: string; /** * The total score calculated from all validation rules. */ totalScore: number; /** * Indicates if the item meets all minimum requirements and can be nominated to Living Atlas. * * An item is eligible for nomination if: * - The total score meets the minimum threshold (e.g., 80). * - It is shared with the public. * - The thumbnail image meets required dimensions. * - It has a snippet (summary) text. * - It has a description text. * - The item owner has a user profile description. */ canBeNominated: boolean; }; /** * Represents a Feature Service in JSON format. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service/ */ export type FeatureServiceJSON = { /** * The capabilities property returns Create, Delete, Extract, Query, Update, Sync, Uploads, and SharedTemplateEditing (added at ArcGIS Enterprise 11.4) capabilities. * * - The `Uploads` capability is included if Create, Delete, or Update is enabled for a feature service. * - The `Editing` capability is included if Create, Delete, and Update is enabled and allowGeometryUpdates is true. * - The `Sync` capability allows editors to make local edits and periodically sync with the feature service. * - The `Extract` capability allows editors to create a local copy of data without the ability to sync with the feature service. * - The `SharedTemplateEditing` capability allows users to add shared templates as well as update and delete the shared template they have created. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service/ */ capabilities: string; /** * initial extent of the feature service */ initialExtent: { xmin: number; ymin: number; xmax: number; ymax: number; spatialReference: { wkid: number; latestWkid: number; }; }; /** * full extent of the feature service */ fullExtent: { xmin: number; ymin: number; xmax: number; ymax: number; spatialReference: { wkid: number; latestWkid: number; }; }; /** * the feature layers published by this service */ layers: { id: number; name: string; type: string; geometryType: string; }[]; /** * the tables published by this service */ tables: { id: number; name: string; }[]; }; /** * Represents the administrative feature service resource that maintains a set of operations that manage the state and contents of the service. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/hosted-feature-service/ */ export type FeatureServiceAdminJSON = { adminServiceInfo: { /** * cacheMaxAge is the maximum time, in second, that a CDN will cache the feature service's data. * * @see https://developers.arcgis.com/documentation/portal-and-data-services/data-services/feature-services/cdn-caching/#how-the-cdn-cache-works */ cacheMaxAge: number; /** * serviceName is the name of the feature service */ name: string; /** * status of the feature service */ status: string; /** * type of the feature service */ type: string; }; /** * The capabilities property returns Create, Delete, Extract, Query, Update, Sync, Uploads, and SharedTemplateEditing (added at ArcGIS Enterprise 11.4) capabilities. * * - The `Uploads` capability is included if Create, Delete, or Update is enabled for a feature service. * - The `Editing` capability is included if Create, Delete, and Update is enabled and allowGeometryUpdates is true. * - The `Sync` capability allows editors to make local edits and periodically sync with the feature service. * - The `Extract` capability allows editors to create a local copy of data without the ability to sync with the feature service. * - The `SharedTemplateEditing` capability allows users to add shared templates as well as update and delete the shared template they have created. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service/ */ capabilities: string; /** * initial extent of the feature service */ initialExtent: { xmin: number; ymin: number; xmax: number; ymax: number; spatialReference: { wkid: number; latestWkid: number; }; }; /** * full extent of the feature service */ fullExtent: { xmin: number; ymin: number; xmax: number; ymax: number; spatialReference: { wkid: number; latestWkid: number; }; }; /** * the feature layers published by this service */ layers: { id: number; name: string; type: string; geometryType: string; }[]; /** * the tables published by this service */ tables: { id: number; name: string; }[]; }; /** * Represents a Feature Layer field in JSON format. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer.htm */ type FeatureLayerField = { name: string; type: string; alias: string; length?: number; domain?: any; defaultValue?: any; sqlType?: string; nullable?: boolean; editable?: boolean; }; /** * Represents a raw Feature Layer field as returned by the Feature Layer JSON. * * The `description` property is typically returned by the server as a stringified JSON object, * for example: `"{\"value\":\"\",\"fieldValueType\":\"dateAndTime\"}"`. */ export type FeatureLayerFieldRaw = FeatureLayerField & { /** * The field description as a stringified JSON object, if present. */ description?: string; }; /** * Represents a Feature Layer field with a parsed and formatted description. * * The `description` property is an object containing the description text and the field value type, * or `null` if not present or not properly formatted. */ export type FeatureLayerFieldFormatted = FeatureLayerField & { description?: { /** * A brief description of the field, up to 500 characters. */ value: string; /** * A keyword categorizing the type of values in the field, used for smarter suggestions in ArcGIS Online. */ fieldValueType: FeatureLayerFieldValueType; } | null; }; /** * Represents the field value type of a feature layer. * * @see https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm * @see https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/describing-layer-attributes-with-field-descriptions-march-2019 */ export declare const FeatureLayerFieldValueTypes: readonly ["nameOrTitle", "description", "typeOrCategory", "countOrAmount", "percentageOrRatio", "measurement", "currency", "uniqueIdentifier", "phoneNumber", "emailAddress", "orderedOrRanked", "binary", "locationOrPlaceName", "coordinate", "dateAndTime"]; /** * Represents the field value type of a feature layer. * * @see https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm * @see https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/describing-layer-attributes-with-field-descriptions-march-2019 */ export type FeatureLayerFieldValueType = (typeof FeatureLayerFieldValueTypes)[number]; /** * Represents a Feature Layer field index in JSON format. */ export type FeatureLayerFieldIndex = { /** * Name of the index */ name: string; /** * Fields included in the index */ fields: string; /** * If true, the index is in ascending order; otherwise, it is in descending order. */ isAscending: boolean; /** * If true, the index enforces uniqueness for the indexed fields. */ isUnique: boolean; /** * Type of the index */ indexType: 'Attribute' | 'Spatial' | 'FullText'; }; /** * Represents a Feature Layer in JSON format. * * An individual Feature Layer resource represents a single feature layer or a non-spatial table in a feature service. * - For tables, it provides basic information about the table such as its ID, name, fields, types and templates. * - For feature layers, in addition to the table information above, it provides information such as its geometry type, min and max scales, and spatial reference. A feature layer is a table or view with at least one spatial column. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer/ */ export type FeatureLayerJSON = { id: number; name: string; type: string; description: string; copyrightText: string; supportsRollbackOnFailures: boolean; geometryType?: string; minScale?: number; maxScale?: number; extent?: { xmin: number; ymin: number; xmax: number; ymax: number; spatialReference: { wkid: number; latestWkid: number; }; }; /** * the feature layer's fields */ fields: FeatureLayerFieldRaw[]; /** * the feature layer's indexes */ indexes: FeatureLayerFieldIndex[]; /** * indicates whether the feature layer supports the field description property */ supportsFieldDescriptionProperty?: boolean; }; /** * Represents the response from the Feature Service layers endpoint. * * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm */ export type FeatureServiceLayersResponse = { layers: FeatureLayerJSON[]; tables: FeatureLayerJSON[]; error?: Error; }; export {};