# Types

This section documents the TypeScript types exported from the [`src/types`](../../src/types/) folder, which is split into two files:

### `IItem`

Represents an ArcGIS Online Portal item.

> See also: [ArcGIS REST API – Item](https://developers.arcgis.com/rest/users-groups-and-items/item.htm)

```ts
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;
};
```

---

### `IUser`

Represents an ArcGIS Online or Enterprise user account.

> See also: [ArcGIS REST API – User](https://developers.arcgis.com/rest/users-groups-and-items/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;
}
```

---

### `ValidationResult`

The `ValidationResult` type represents the output of the [`validate`](../core-functions/validate.md) function, providing detailed assessments for both the ArcGIS Online item and its owner's profile. It helps determine whether an item meets the necessary criteria for nomination to the ArcGIS Living Atlas. Each validation rule is represented as a [`ValidationInfo`](#validationinfo) object, which includes the rule's status, score, and messages to guide users on how to improve their item or profile. The `ValidationResult` also includes an overall score and a flag indicating nomination eligibility based on predefined thresholds and criteria.

```ts
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 of 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.
     * - For Web Maps: all layers are accessible and not deprecated.
     */
    canBeNominated: boolean;
};
```

---

### `ValidationInfo`

The `ValidationInfo` type provides detailed information about a specific validation rule, including its purpose, scoring criteria, and status.

```ts
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;
};
```

---

### `ValidationMessage`

A message object attached to a validation result, optionally identified by a code.

```ts
export type ValidationMessage = {
    code?: string;
    message: string;
};
```

---

### `ValidationResultStatus`

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.

- `pass`: The item meets the criteria for this validation rule.
- `warning`: The item meets the criteria but there are some suggestions for improvement or potential issues to address.
- `error`: The item does not meet the criteria for this validation rule and requires correction.
- `not-applicable`: Indicates that the validation rule is not applicable to the item being validated. This can happen if the rule does not apply to the type of item or if certain conditions are not met for the validation to be relevant.
- `unknown`: This is the default status when a `ValidationInfo` object is created but the validation process has not yet been executed. It indicates that the validation status is yet to be determined.

```ts
export type ValidationResultStatus =
    | 'pass'
    | 'warning'
    | 'error'
    | 'not-applicable'
    | 'unknown';
```

---

### `FeatureServiceJSON`

Represents a Feature Service in JSON format.

> See also: [ArcGIS REST API – Feature Service](https://developers.arcgis.com/rest/services-reference/enterprise/feature-service/)

```ts
export type FeatureServiceJSON = {
    /** Service capabilities string (e.g., "Create,Delete,Query,Update,Sync,Extract"). */
    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;
    }[];
};
```

---

### `FeatureServiceAdminJSON`

Represents the administrative feature service resource that maintains operations managing the state and contents of the service.

> See also: [ArcGIS REST API – Hosted Feature Service](https://developers.arcgis.com/rest/services-reference/enterprise/hosted-feature-service/)

```ts
export type FeatureServiceAdminJSON = {
    adminServiceInfo: {
        /**
         * Maximum time, in seconds, 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/
         */
        cacheMaxAge: number;
        /** Name of the feature service. */
        name: string;
        /** Status of the feature service. */
        status: string;
        /** Type of the feature service. */
        type: string;
    };
    /** Service capabilities string (e.g., "Create,Delete,Query,Update,Sync,Extract"). */
    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;
    }[];
};
```

---

### `FeatureLayerFieldValueType`

Represents the field value type of a feature layer field. These keywords categorize the type of values in a field to help ArcGIS Online make smarter suggestions.

> See also: [Describe fields](https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm)

```ts
export type FeatureLayerFieldValueType =
    | 'nameOrTitle'
    | 'description'
    | 'typeOrCategory'
    | 'countOrAmount'
    | 'percentageOrRatio'
    | 'measurement'
    | 'currency'
    | 'uniqueIdentifier'
    | 'phoneNumber'
    | 'emailAddress'
    | 'orderedOrRanked'
    | 'binary'
    | 'locationOrPlaceName'
    | 'coordinate'
    | 'dateAndTime';
```

---

### `FeatureLayerFieldRaw`

Represents a Feature Layer field as returned directly by the Feature Layer JSON endpoint. The `description` property is the raw stringified JSON object from the server (e.g., `"{\"value\":\"\",\"fieldValueType\":\"dateAndTime\"}"`).

```ts
export type FeatureLayerFieldRaw = {
    name: string;
    type: string;
    alias: string;
    length?: number;
    domain?: any;
    defaultValue?: any;
    sqlType?: string;
    nullable?: boolean;
    editable?: boolean;
    /** The field description as a stringified JSON object, if present. */
    description?: string;
};
```

---

### `FeatureLayerFieldFormatted`

Represents a Feature Layer field with its `description` property parsed from its raw stringified JSON into a structured object. The description is `null` if not present or not properly formatted.

```ts
export type FeatureLayerFieldFormatted = {
    name: string;
    type: string;
    alias: string;
    length?: number;
    domain?: any;
    defaultValue?: any;
    sqlType?: string;
    nullable?: boolean;
    editable?: boolean;
    description?: {
        /** A brief description of the field, up to 500 characters. */
        value: string;
        /** A keyword categorizing the type of values in the field. */
        fieldValueType: FeatureLayerFieldValueType;
    } | null;
};
```

---

### `FeatureLayerFieldIndex`

Represents a field index on a Feature Layer.

```ts
export type FeatureLayerFieldIndex = {
    /** Name of the index. */
    name: string;
    /** Comma-separated list of fields included in the index. */
    fields: string;
    /** If true, the index is in ascending order; otherwise, descending. */
    isAscending: boolean;
    /** If true, the index enforces uniqueness for the indexed fields. */
    isUnique: boolean;
    /** Type of the index. */
    indexType: 'Attribute' | 'Spatial' | 'FullText';
};
```

---

### `FeatureLayerJSON`

Represents a Feature Layer in JSON format as returned by the Feature Layer REST endpoint. Covers both spatial feature layers and non-spatial tables.

> See also: [ArcGIS REST API – Feature Layer](https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer/)

```ts
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;
};
```

---

### `FeatureServiceLayersResponse`

Represents the response from the Feature Service layers endpoint, containing both feature layers and tables, and an optional error.

> See also: [ArcGIS REST API – Feature Service](https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm)

```ts
export type FeatureServiceLayersResponse = {
    layers: FeatureLayerJSON[];
    tables: FeatureLayerJSON[];
    error?: Error;
};
```

---

### `PopupExpressionInfo`

An Arcade expression added to a popup.

```ts
export type PopupExpressionInfo = {
    /** The Arcade expression. */
    expression: string;
    /** Unique identifier for the expression. */
    name: string;
    /** Return type of the Arcade expression. */
    returnType: 'number' | 'string';
    /** Title of the expression. */
    title: string;
};
```

---

### `PopupFieldInfo`

Describes a field/value pair displayed in a popup window.

```ts
export type PopupFieldInfo = {
    /** A string containing the field alias. */
    label: string;
    /** A string containing the field name as defined by the service. */
    fieldName: string;
    /** A Boolean determining whether the field is visible in the popup window. */
    visible: boolean;
    /**
     * Determines what type of input box editors see when editing the field.
     * Applies only to string fields.
     */
    stringFieldOption: 'richtext' | 'textarea' | 'textbox';
    /** Used in a 1:many or many:many relationship to compute statistics on the field. */
    statisticType: 'avg' | 'count' | 'max' | 'min' | 'sum' | 'stddev' | 'var';
};
```

---

### `PopupMediaInfo`

Defines an image or chart to be displayed in a popup window.

> See also: [Web Map Specification – mediaInfo](https://developers.arcgis.com/web-map-specification/objects/mediaInfo/)

```ts
export type PopupMediaInfo = {
    /** Alternate text for the media. */
    altText?: string;
    /** A caption describing the media. */
    caption?: string;
    /**
     * Refresh interval of the layer in minutes. Only applicable when type is `image`.
     * A value of 0 means auto refresh is disabled.
     */
    refreshInterval?: number;
    /** Title for the media. */
    title?: string;
    /** Type of media to display. */
    type: 'image' | 'piechart' | 'barchart' | 'columnchart' | 'linechart';
    value: {
        /** (Charts) Array of colors, each color corresponding to a field in the `fields` array. */
        colors?: number[][];
        /** (Charts) Array of field names to display in the chart. */
        fields?: string[];
        /** (Images) URL to launch in a browser when the user clicks the image. */
        linkURL?: string;
        /** (Charts) Name of a field to normalize (divide) all other chart field values by. */
        normalizeField?: string;
        /** (Images) URL to the image. */
        sourceURL?: string;
        /** (Charts) Field name used for chart tooltips. */
        tooltipField?: string;
    };
};
```

---

### `PopupElementAttachments`

A popup element that displays attachments.

> See also: [Web Map Specification – popupElement_attachments](https://developers.arcgis.com/web-map-specification/objects/popupElement_attachments/)

```ts
export type PopupElementAttachments = {
    type: 'attachments';
    title?: string;
    description?: string;
    /**
     * Used to query attachments by keyword using an exact match.
     */
    attachmentKeywords?: string[];
    /**
     * Used to filter attachments by MIME type.
     * Valid values: `application`, `audio`, `image`, `model`, `text`, `video`.
     */
    attachmentTypes?: string[];
    /**
     * Controls how attachments are displayed.
     * - `list` — Attachments shown as links.
     * - `preview` — Attachments expand to the width of the popup.
     * - `auto` — Applications choose the most suitable default.
     */
    displayType?: 'list' | 'auto' | 'preview';
    orderByFields?: { field: string; order: 'asc' | 'desc' }[];
};
```

---

### `PopupElementExpression`

A popup element defined by an Arcade expression that returns a dictionary.

> See also: [Web Map Specification – popupElement_expression](https://developers.arcgis.com/web-map-specification/objects/popupElement_expression/)

```ts
export type PopupElementExpression = {
    type: 'expression';
    expressionInfo: {
        /** The Arcade expression. */
        expression: string;
        /** Return type is always `dictionary` for this popup element type. */
        returnType: 'dictionary';
        title?: string;
    };
};
```

---

### `PopupElementFields`

A popup element that displays field/value pairs in a table format.

> See also: [Web Map Specification – popupElement_fields](https://developers.arcgis.com/web-map-specification/objects/popupElement_fields/)

```ts
export type PopupElementFields = {
    type: 'fields';
    title?: string;
    description?: string;
    fieldInfos?: PopupFieldInfo[];
};
```

---

### `PopupElementMedia`

A popup element that displays images or charts.

> See also: [Web Map Specification – popupElement_media](https://developers.arcgis.com/web-map-specification/objects/popupElement_media/)

```ts
export type PopupElementMedia = {
    type: 'media';
    title?: string;
    description?: string;
    mediaInfos: PopupMediaInfo[];
};
```

---

### `PopupElementText`

A popup element that displays rich text (HTML).

> See also: [Web Map Specification – popupElement_text](https://developers.arcgis.com/web-map-specification/objects/popupElement_text/)

```ts
export type PopupElementText = {
    type: 'text';
    /** The text content to display. Falls back to `popupInfo.description` if not provided. */
    text: string;
};
```

---

### `PopupElementRelationship`

A popup element that navigates to related records via a defined relationship.

> See also: [Web Map Specification – popupElement_relationship](https://developers.arcgis.com/web-map-specification/objects/popupElement_relationship/)

```ts
export type PopupElementRelationship = {
    type: 'relationship';
    title?: string;
    description?: string;
    /** Identifier of the relationship as defined in the service layer's `relationshipDefinitions`. */
    relationshipId: string;
    /** Maximum number of related records to display. */
    displayCount?: number;
    displayType?: 'list';
    orderByFields?: { field: string; order: 'asc' | 'desc' }[];
};
```

---

### `PopupElementUtilityNetworkAssociations`

A popup element that displays utility network associations.

> See also: [Web Map Specification – popupElement_utilityNetworkAssociations](https://developers.arcgis.com/web-map-specification/objects/popupElement_utilityNetworkAssociations/)

```ts
export type PopupElementUtilityNetworkAssociations = {
    type: 'utilityNetworkAssociations';
    title?: string;
    description?: string;
    /** Maximum number of features to display per layer. */
    displayCount?: number;
    associationTypes?: {
        type: 'attachment' | 'connectivity' | 'container' | 'structural' | 'content';
        /** Asset group ID to filter associations. */
        associatedAssetGroup: number;
        /** Asset type ID to filter associations. */
        associatedAssetType: number;
        /** Network source ID to filter associations. */
        associatedNetworkSourceId: number;
    }[];
};
```

---

### `PopupInfo`

Defines the look and feel of popup windows when a user clicks or queries a feature.

> See also: [Web Map Specification – popupInfo](https://developers.arcgis.com/web-map-specification/objects/popupInfo/)

```ts
export type PopupInfo = {
    /** Title displayed at the top of the popup window. */
    title?: string;
    /** Description displayed in the body of the popup window. Supports a subset of HTML. */
    description?: string;
    /** List of Arcade expressions added to the popup. */
    expressionInfos?: PopupExpressionInfo[];
    /** Array of field/value pair info objects for the popup. */
    fieldInfos?: PopupFieldInfo[];
    /** Array of media items (images and charts) to display. */
    mediaInfo?: PopupMediaInfo[];
    /**
     * Ordered array of popup elements (fields tables, text blocks, media, attachments,
     * relationships, Arcade expressions, or utility network associations).
     */
    popupElements?:
        | PopupElementAttachments[]
        | PopupElementExpression[]
        | PopupElementFields[]
        | PopupElementMedia[]
        | PopupElementRelationship[]
        | PopupElementText[]
        | PopupElementUtilityNetworkAssociations[];
    /** Indicates whether attachments will be loaded for feature layers that have attachments. */
    showAttachments?: boolean;
    /**
     * Indicates whether the popup will display last-edited-by information.
     * Applicable only to layers configured to track edit info.
     */
    showLastEditInfo?: boolean;
    layerOptions?: {
        /** Indicates whether to display only the topmost raster. */
        returnTopmostRaster?: boolean;
        /** Indicates whether to display NoData records. */
        showNoDataRecords?: boolean;
    };
};
```

---

### `FeatureReduction`

Options for reducing the number of features in the view by aggregating them into clusters or bins. This is a visualization-only feature.

> See also: [Web Map Specification – featureReduction](https://developers.arcgis.com/web-map-specification/objects/featureReduction/)

```ts
export type FeatureReduction = {
    /** Type of feature reduction. */
    type: 'cluster' | 'bin';
    /** Indicates whether to disable viewing popups defined for the clusters. */
    disablePopup?: boolean;
    /** Defines the popup used to describe aggregate data in the selected cluster or bin. */
    popupInfo?: PopupInfo;
};
```

---

### `FeatureLayerData`

Represents the configuration data of an individual feature layer stored in a Feature Layer item in ArcGIS Online.

> See also: [Web Map Specification – featureLayer](https://developers.arcgis.com/web-map-specification/objects/featureLayer/)

```ts
export type FeatureLayerData = {
    /** Unique identifier of the feature layer within the feature service. */
    id: number;
    /** User-friendly title for the layer. */
    title: string;
    /** Transparency of the layer (0 = fully transparent, 1 = fully opaque). */
    opacity?: number;
    /** Whether the layer is initially visible. */
    visibility?: boolean;
    /** Whether labels are displayed (requires a labelingInfo property). */
    showLabels?: boolean;
    /** Auto-refresh interval in minutes. 0 means disabled. */
    refreshInterval?: number;
    /** Popup configuration for this layer. */
    popupInfo?: PopupInfo;
    /** If true, popups are disabled for this layer. */
    disablePopup?: boolean;
    layerDefinition?: {
        /** Feature reduction configuration (clustering or binning). */
        featureReduction?: FeatureReduction;
        [key: string]: any;
    };
};
```

---

### `FeatureLayerItemData`

Represents the item data of a Feature Layer item in ArcGIS Online, containing the configurations for its layers and tables.

```ts
export type FeatureLayerItemData = {
    layers: FeatureLayerData[];
    tables: FeatureLayerData[];
};
```

---

### `ImageryLayerItemData`

Represents the item data of an Imagery Service Layer item in ArcGIS Online.

> See also: [Web Map Specification – imageServiceLayer](https://developers.arcgis.com/web-map-specification/objects/imageServiceLayer/)

```ts
export type ImageryLayerItemData = {
    id: string;
    layerType: 'ArcGISImageServiceLayer';
    opacity?: number;
    visibility?: boolean;
    /** Auto-refresh interval in minutes. 0 means disabled. */
    refreshInterval?: number;
    interpolation?:
        | 'RSP_BilinearInterpolation'
        | 'RSP_CubicConvolution'
        | 'RSP_Majority'
        | 'RSP_NearestNeighbor';
    url: string;
    title: string;
    popupInfo?: PopupInfo;
    disablePopup?: boolean;
};
```

---

### `MapServiceLayerItemData`

Represents the item data of a Map Service Layer item in ArcGIS Online.

> See also: [Web Map Specification – mapServiceLayer](https://developers.arcgis.com/web-map-specification/objects/mapServiceLayer/)

```ts
export type MapServiceLayerItemData = {
    id: string;
    url: string;
    title: string;
    opacity?: number;
    visibility?: boolean;
    refreshInterval?: number;
    layerType: 'ArcGISMapServiceLayer';
    /** Array of sub-layer configurations within the map service. */
    layers: {
        id: number;
        name?: string;
        disablePopup?: boolean;
        popupInfo?: PopupInfo;
    }[];
};
```

---

### `MapServiceLayerData`

Represents an individual sub-layer within a `MapServiceLayerItemData`. Equivalent to `MapServiceLayerItemData['layers'][number]`.

```ts
export type MapServiceLayerData = MapServiceLayerItemData['layers'][number];
```

---

### `WebmapOperationalLayerType`

A union type of all supported operational layer types in a web map.

> See also: [Web Map Specification – operationalLayers](https://developers.arcgis.com/web-map-specification/objects/operationalLayers/)

```ts
export type WebmapOperationalLayerType =
    | 'ArcGISFeatureLayer'
    | 'GeoJSON'
    | 'GroupLayer'
    | 'ArcGISImageServiceLayer'
    | 'ArcGISImageServiceVectorLayer'
    | 'ArcGISMapServiceLayer'
    | 'MediaLayer'
    | 'ArcGISTiledImageServiceLayer'
    | 'ArcGISTiledMapServiceLayer'
    | 'VectorTileLayer'
    | 'WebTiledLayer'
    | 'WMS'
    | 'WFS';
```

---

### `WebmapBaseMapLayerType`

A union type of all supported basemap layer types in a web map.

> See also: [Web Map Specification – baseMapLayer](https://developers.arcgis.com/web-map-specification/objects/baseMapLayer/)

```ts
export type WebmapBaseMapLayerType =
    | 'ArcGISImageServiceLayer'
    | 'ArcGISImageServiceVectorLayer'
    | 'ArcGISTiledMapServiceLayer'
    | 'OpenStreetMap'
    | 'ArcGISTiledImageServiceLayer'
    | 'VectorTileLayer'
    | 'WebTiledLayer'
    | 'WMS'
    | 'BingMapsAerial'
    | 'BingMapsHybrid'
    | 'BingMapsRoad';
```

---

### `WebmapOperationalLayer`

Represents an operational layer in a web map. For `GroupLayer` types, the `layers` property contains nested operational layers.

> See also: [Web Map Specification – operationalLayers](https://developers.arcgis.com/web-map-specification/objects/operationalLayers/)

```ts
export type WebmapOperationalLayer = {
    /** Unique string identifier for the layer within the web map. */
    id: string;
    layerType: WebmapOperationalLayerType;
    url?: string;
    visibility?: boolean;
    opacity?: number;
    title?: string;
    /** Item ID of the layer's source item in ArcGIS Online or Enterprise. */
    itemId?: string;
    styleUrl?: string;
    layerDefinition?: {
        featureReduction?: FeatureReduction;
        [key: string]: any;
    };
    popupInfo?: PopupInfo;
    disablePopup?: boolean;
    /** For GroupLayer: nested operational layers contained within the group. */
    layers: WebmapOperationalLayer[];
};
```

---

### `WebmapBaseMapLayer`

Represents a basemap layer in a web map.

> See also: [Web Map Specification – baseMapLayer](https://developers.arcgis.com/web-map-specification/objects/baseMapLayer/)

```ts
export type WebmapBaseMapLayer = {
    /** Unique string identifier for the basemap layer within the web map. */
    id: string;
    layerType?: WebmapBaseMapLayerType;
    url?: string;
    visibility?: boolean;
    opacity?: number;
    title?: string;
    /** Item ID of the basemap layer's source item in ArcGIS Online or Enterprise. */
    itemId?: string;
    styleUrl?: string;
};
```

---

### `WebmapData`

Represents the top-level web map data structure in JSON format. Contains the operational layers and basemap configuration.

> See also: [Web Map Specification – webmap](https://developers.arcgis.com/web-map-specification/objects/webmap/)

```ts
export type WebmapData = {
    /** Operational (business data) layers in the web map. */
    operationalLayers: WebmapOperationalLayer[];
    baseMap: {
        /** Array of basemap layers used in the web map. */
        baseMapLayers: WebmapBaseMapLayer[];
        /** Title for the basemap, used in a table of contents. */
        title?: string;
    };
};
```

---

### `WebmapLayerDataByItemId`

A map from item ID to item data returned from the REST API for layers in a web map. Note that not all layers in the web map will have an associated item, so this object may contain fewer entries than the total number of layers.

```ts
export type WebmapLayerDataByItemId = {
    [itemId: string]: any;
};
```
