/**
 * A module for importing types used in Layer modules.
 *
 * @since 5.0
 */
import type Graphic from "../Graphic.js";
import type Collection from "../core/Collection.js";
import type BaseElevationLayer from "./BaseElevationLayer.js";
import type ElevationLayer from "./ElevationLayer.js";
import type FeatureLayer from "./FeatureLayer.js";
import type GeoJSONLayer from "./GeoJSONLayer.js";
import type OrientedImageryLayer from "./OrientedImageryLayer.js";
import type SceneLayer from "./SceneLayer.js";
import type SubtypeGroupLayer from "./SubtypeGroupLayer.js";
import type KnowledgeGraphSublayer from "./knowledgeGraph/KnowledgeGraphSublayer.js";
import type SubtypeSublayer from "./support/SubtypeSublayer.js";
import type PortalFolder from "../portal/PortalFolder.js";
import type DirectionLine from "../rest/support/DirectionLine.js";
import type DirectionPoint from "../rest/support/DirectionPoint.js";
import type PointBarrier from "../rest/support/PointBarrier.js";
import type PolygonBarrier from "../rest/support/PolygonBarrier.js";
import type PolylineBarrier from "../rest/support/PolylineBarrier.js";
import type RouteInfo from "../rest/support/RouteInfo.js";
import type Stop from "../rest/support/Stop.js";
import type TimeExtent from "../time/TimeExtent.js";
import type { AbortOptions } from "../core/promiseUtils.js";
import type { CurveType } from "../geometry/types.js";
import type { TimeZone } from "../time/types.js";

/**
 * The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules.
 *
 * @see [Layer.type](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#type)
 * @since 5.0
 */
export type LayerType = "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";

/**
 * Indicates how the layer should display in the [Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/) component.
 * The possible values are listed below.
 *
 * Value | Description
 * -----|------------
 * show | The layer is visible in the table of contents.
 * hide | The layer is hidden in the table of contents.
 * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GroupLayer/), [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/), [KMLLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/KMLLayer/), [MapImageLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/), [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer/), [TileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/TileLayer/), or [WMSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WMSLayer/), hide the children layers from the table of contents.
 * 
 *
 * @see [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode)
 * @since 5.0
 */
export type LayerListMode = "show" | "hide" | "hide-children";

/**
 * 
 * A collection of editable layers. Layers are considered editable if they have editing capabilities, and if the authenticated user has the
 * necessary privileges needed to edit the layers.
 *
 * @see [Map.editableLayers](https://developers.arcgis.com/javascript/latest/references/core/Map/#editableLayers)
 * @since 5.0
 */
export type EditableLayerUnion = FeatureLayer | GeoJSONLayer | OrientedImageryLayer | SceneLayer | SubtypeGroupLayer | KnowledgeGraphSublayer;

/**
 * Union of layer types that support feature templates.
 *
 * @since 5.0
 */
export type LayerWithFeatureTemplatesUnion = Exclude<EditableLayerUnion, SubtypeGroupLayer> | SubtypeSublayer | KnowledgeGraphSublayer;

/**
 * Specifies information about editing.
 *
 * @since 4.12
 */
export interface EditingInfo {
  /**
   * Indicates the last time the layer was edited. This value gets updated every time the layer's data is edited or when any of its properties change.
   *
   * @since 5.0
   */
  lastEditDate?: Date | null;
}

/**
 * Indicates which spatial aggregation statistic geometries are supported.
 *
 * @since 5.0
 */
export interface SupportedSpatialAggregationStatistics {
  /**
   * Indicates if the layer can return extent for each distinct group for [Query.groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#groupByFieldsForStatistics).
   *
   * @since 5.0
   */
  envelope: boolean;
  /**
   * Indicates if the layer can return centroid for each distinct group for [Query.groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#groupByFieldsForStatistics).
   *
   * @since 5.0
   */
  centroid: boolean;
  /**
   * Indicates if the layer can return convex hull for each distinct group for [Query.groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#groupByFieldsForStatistics).
   *
   * @since 5.0
   */
  convexHull: boolean;
}

/**
 * Indicates which statistics are supported for [attribute binning queries](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#outStatistics).
 *
 * @see [AttributeBinsQuery.outStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#outStatistics)
 * @since 5.0
 */
export interface SupportedBinStatistics extends SupportedSpatialAggregationStatistics {
  /**
   * Indicates if the layer supports `count` statistics function.
   *
   * @since 5.0
   */
  count?: boolean;
  /**
   * Indicates if the layer supports `sum` statistics function.
   *
   * @since 5.0
   */
  sum?: boolean;
  /**
   * Indicates if the layer supports `avg` statistics function.
   *
   * @since 5.0
   */
  avg?: boolean;
  /**
   * Indicates if the layer supports `var` statistics function.
   *
   * @since 5.0
   */
  var?: boolean;
  /**
   * Indicates if the layer supports `stddev` statistics function.
   *
   * @since 5.0
   */
  stddev?: boolean;
  /**
   * Indicates if the layer supports `min` statistics function.
   *
   * @since 5.0
   */
  min?: boolean;
  /**
   * Indicates if the layer supports `max` statistics function.
   *
   * @since 5.0
   */
  max?: boolean;
  /**
   * Indicates if the layer supports `percentileContinuous` statistics function.
   *
   * @since 5.0
   */
  percentileContinuous?: boolean;
  /**
   * Indicates if the layer supports `percentileDiscrete` statistics function.
   *
   * @since 5.0
   */
  percentileDiscrete?: boolean;
}

/**
 * Indicates which normalization types are supported for attribute [binning queries](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/).
 *
 * @since 5.0
 */
export interface SupportedBinNormalizationTypes {
  /**
   * Indicates if the queryAttributeBins supports field normalization.
   *
   * @since 5.0
   */
  field?: boolean;
  /**
   * Indicates if the queryAttributeBins supports log normalization.
   *
   * @since 5.0
   */
  log?: boolean;
  /**
   * Indicates if the queryAttributeBins supports natural log normalization.
   *
   * @since 5.0
   */
  naturalLog?: boolean;
  /**
   * Indicates if the queryAttributeBins supports percent of total normalization.
   *
   * @since 5.0
   */
  percentOfTotal?: boolean;
  /**
   * Indicates if the queryAttributeBins supports square root normalization.
   *
   * @since 5.0
   */
  squareRoot?: boolean;
}

/**
 * Describes characteristics of the data in the layer as part of its [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities).
 *
 * @see [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities)
 * @since 5.0
 */
export interface DataCapabilities {
  /**
   * Indicates if the feature service is versioned.
   *
   * @since 5.0
   */
  isVersioned: boolean;
  /**
   * Indicates if the feature service is branch versioned.
   *
   * @since 5.0
   */
  isBranchVersioned: boolean;
  /**
   * The types of true curves the layer supports.
   *
   * @since 5.0
   */
  supportedCurveTypes: readonly CurveType[];
  /**
   * Indicates if the attachment is enabled on the layer.
   *
   * @since 5.0
   */
  supportsAttachment: boolean;
  /**
   * Indicates if the features in the layer support m-values.
   *
   * @since 5.0
   */
  supportsM: boolean;
  /**
   * Indicates if the layer supports geometries with true curves.
   *
   * @since 5.0
   */
  supportsTrueCurve: boolean;
  /**
   * Indicates if the features in the layer support z-values.
   * See [FeatureLayer.elevationInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#elevationInfo) for details regarding placement and rendering of features with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @since 5.0
   */
  supportsZ: boolean;
}

/**
 * Describes the metadata contained on features in the layer as part of its [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities).
 *
 * @since 5.0
 */
export interface MetadataCapabilities {
  /**
   * Indicates whether to provide a user-defined field description.
   * See [Describe attribute fields](https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm) for additional information.
   *
   * @since 5.0
   */
  supportsAdvancedFieldProperties: boolean;
}

/**
 * Describes operations that can be performed on features in the layer as part of its [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities).
 *
 * @since 5.0
 */
export interface OperationCapabilities {
  /**
   * Indicates if new features can be [added](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits) to the layer.
   *
   * @since 5.0
   */
  supportsAdd: boolean;
  /**
   * Indicates if values of one or more field values in the layer can be updated.
   * See the [Calculate REST operation](https://developers.arcgis.com/rest/services-reference/calculate-feature-service-layer-.htm) document for more information.
   *
   * @since 5.0
   */
  supportsCalculate: boolean;
  /**
   * Indicates if features can be [deleted](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits) from the layer.
   *
   * @since 5.0
   */
  supportsDelete: boolean;
  /**
   * Indicates if features in the layer can be [edited](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits).
   *  Use `supportsAdd`, `supportsUpdate` and `supportsDelete` to determine which editing operations are supported.
   *
   * @since 5.0
   */
  supportsEditing: boolean;
  /**
   * Indicates if features in the layer can be [queried](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#queryFeatures).
   *
   * @since 5.0
   */
  supportsQuery: boolean;
  /**
   * Indicates if the layer supports
   * [REST API queryAttachments](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) operation.
   * If `false`, [queryAttachments() method](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/#queryAttachments) can only return attachments for one feature at a time.
   * If `true`, `queryAttachments()` can return attachments for array of [AttachmentQuery.objectIds](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/#objectIds).
   *
   * @since 5.0
   */
  supportsQueryAttachments: boolean;
  /**
   * Indicates if the layer supports
   * [REST API queryTopFeatures](https://developers.arcgis.com/rest/services-reference/enterprise/query-top-features-feature-service-layer-.htm) operation.
   *
   * @since 5.0
   */
  supportsQueryTopFeatures: boolean;
  /**
   * Deprecated since 4.24. Use `attachment.supportsResize` instead. Indicates if resized attachments are supported in the feature layer.
   * This is useful for showing thumbnails in [Popups](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/).
   *
   * @since 5.0
   */
  supportsResizeAttachments: boolean;
  /**
   * Indicates if features in the layer can be [updated](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits).
   *
   * @since 5.0
   */
  supportsUpdate: boolean;
  /**
   * Indicates if the layer supports a SQL-92 expression or where clause.
   *
   * @since 5.0
   */
  supportsValidateSql: boolean;
}

/**
 * Describes [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) operations that can be performed on features in the layer.
 *
 * @since 5.0
 */
export interface QueryCapabilities {
  /**
   * The maximum number of records that will be returned for a given query.
   *
   * @since 5.0
   */
  maxRecordCount?: number | null;
  /**
   * The maximum number of unique-ids that will be returned for a given query.
   *
   * @since 5.0
   */
  maxUniqueIDCount?: number | null;
  /**
   * List of supported aggregated geometries returned for each distinct group when [Query.groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#groupByFieldsForStatistics) is used.
   *
   * @since 5.0
   */
  supportedSpatialAggregationStatistics: SupportedSpatialAggregationStatistics;
  /**
   * Indicates if the query operation supports a [cache hint](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#cacheHint). This is valid only for
   * [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm).
   *
   * @since 5.0
   */
  supportsCacheHint: boolean;
  /**
   * Indicates if the geometry centroid associated with each polygon feature can be returned. This operation is
   * only supported in ArcGIS Online hosted feature services.
   *
   * @since 5.0
   */
  supportsCentroid: boolean;
  /**
   * Indicates if the query operation supports `disjoint` [spatial relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#spatialRelationship). This is valid only for
   * [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm).
   *
   * @since 5.0
   */
  supportsDisjointSpatialRelationship: boolean;
  /**
   * Indicates if the layer's query operation supports a buffer distance for input geometries.
   *
   * @since 5.0
   */
  supportsDistance: boolean;
  /**
   * Indicates if the layer supports queries for distinct values based on fields specified in the [FeatureLayer.outFields](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#outFields).
   *
   * @since 5.0
   */
  supportsDistinct: boolean;
  /**
   * Indicates if the layer's query response includes the extent of features.
   * At 10.3, this option is only available for hosted feature services. At 10.3.1, it is available for hosted and non-hosted feature services.
   *
   * @since 5.0
   */
  supportsExtent: boolean;
  /**
   * Indicates if the layer's query response contains geometry attributes, including shape area and length attributes.
   * This operation is supported in ArcGIS Online hosted feature services created since December 2016 and ArcGIS Enterprise feature services since version 10.7.
   *
   * @since 5.0
   */
  supportsGeometryProperties: boolean;
  /**
   * Indicates if the layer supports the [Query.having](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#having) clause on the service. Requires an ArcGIS Server service 10.6.1 or greater.
   *
   * @since 5.0
   */
  supportsHavingClause: boolean;
  /**
   * Indicates if the layer supports historic moment query. Requires ArcGIS Server service 10.5 or greater.
   *
   * @since 5.0
   */
  supportsHistoricMoment: boolean;
  /**
   * Indicates if the layer supports [Query.maxRecordCountFactor](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#maxRecordCountFactor) on the service.
   *
   * @since 5.0
   */
  supportsMaxRecordCountFactor: boolean;
  /**
   * Indicates if the query response can be ordered by one or more fields. Requires an ArcGIS Server service 10.3 or greater.
   *
   * @since 5.0
   */
  supportsOrderBy: boolean;
  /**
   * Indicates if the query response supports pagination. Requires an ArcGIS Server service 10.3 or greater.
   *
   * @since 5.0
   */
  supportsPagination: boolean;
  /**
   * Indicates if the layer supports [percentile statisticType](https://developers.arcgis.com/javascript/latest/references/core/rest/support/StatisticDefinition/#statisticType). Requires an ArcGIS Server service 10.7 or greater.
   *
   * @since 5.0
   */
  supportsPercentileStatistics: boolean;
  /**
   * Indicates if the query operation supports the projection of geometries onto a virtual grid. Requires an ArcGIS Server service 10.6.1 or greater.
   *
   * @since 5.0
   */
  supportsQuantization: boolean;
  /**
   * Indicates if the query operation supports quantization designed to be used in edit mode (highest resolution at the given spatial reference). Requires an ArcGIS Server service 10.6.1 or greater.
   *
   * @since 5.0
   */
  supportsQuantizationEditMode: boolean;
  /**
   * Indicates if the query response includes the [query geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/#queryGeometry). This is valid only for
   * [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm).
   *
   * @since 5.0
   */
  supportsQueryGeometry: boolean;
  /**
   * Indicates if the number of features returned by the query operation can be controlled.
   *
   * @since 5.0
   */
  supportsResultType: boolean;
  /**
   * Indicates if queries support returning [Mesh](https://developers.arcgis.com/javascript/latest/references/core/geometry/Mesh/) geometries. This is true for scene layers backed by a 3D Object feature layer.
   *
   * @since 5.0
   */
  supportsReturnMesh: boolean;
  /**
   * Indicates if the layer supports spatial extent, center or convex hull to be returned for each distinct group when
   * [Query.groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#groupByFieldsForStatistics) is used. Supported with ArcGIS Online hosted features services only.
   *
   * @since 5.0
   */
  supportsSpatialAggregationStatistics: boolean;
  /**
   * Indicates if the query operation supports SQL expressions.
   *
   * @since 5.0
   */
  supportsSqlExpression: boolean;
  /**
   * Indicates if the query operation supports using standardized queries.
   * Learn more about [standardized queries here](https://enterprise.arcgis.com/en/server/latest/administer/linux/about-standardized-queries.htm).
   *
   * @since 5.0
   */
  supportsStandardizedQueriesOnly: boolean;
  /**
   * Indicates if the layer supports field-based statistical functions. Requires ArcGIS Server service 10.1 or greater.
   *
   * @since 5.0
   */
  supportsStatistics: boolean;
  /**
   * Indicates if the layer supports geometries with true curves.
   *
   * @deprecated since version 5.0. Use [DataCapabilities.supportsTrueCurve](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#DataCapabilities) instead.
   * @since 5.0
   */
  supportsTrueCurve: boolean;
}

/**
 * Indicates if the layer's query operation supports querying features or records related to features in the layer.
 *
 * @since 5.0
 */
export interface QueryRelatedCapabilities {
  /**
   * Indicates if the [relationship query operation](https://developers.arcgis.com/javascript/latest/references/core/rest/support/RelationshipQuery/) supports a cache hint. This is valid only for
   * [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm).
   *
   * @since 5.0
   */
  supportsCacheHint: boolean;
  /**
   * Indicates if the layer's query response includes the number of features or records related to features in the layer.
   *
   * @since 5.0
   */
  supportsCount: boolean;
  /**
   * Indicates if the related features or records returned in the query response can be ordered by one or more fields.
   *
   * @since 5.0
   */
  supportsOrderBy: boolean;
  /**
   * Indicates if the query response supports pagination for related features or records.
   *
   * @since 5.0
   */
  supportsPagination: boolean;
}

/**
 * Describes editing capabilities that can be performed on the features in the layer via `applyEdits()`.
 *
 * @since 5.0
 */
export interface EditingCapabilities {
  /**
   * Indicates if anonymous users can delete features created by others.
   *
   * @since 5.0
   */
  supportsDeleteByAnonymous: boolean;
  /**
   * Indicates if logged in users can delete features created by others.
   *
   * @since 5.0
   */
  supportsDeleteByOthers: boolean;
  /**
   * Indicates if the geometry of the features in the layer can be edited.
   *
   * @since 5.0
   */
  supportsGeometryUpdate: boolean;
  /**
   * Indicates if the `globalId` values provided by the client are used in [FeatureLayer.applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits).
   *
   * @since 5.0
   */
  supportsGlobalId: boolean;
  /**
   * Indicates if the `rollbackOnFailureEnabled` parameter can be set to `true` or `false` when editing features.
   *
   * @since 5.0
   */
  supportsRollbackOnFailure: boolean;
  /**
   * Indicates if feature geometries containing true curves can be updated.
   *
   * @since 5.0
   */
  supportsTrueCurveUpdate: boolean;
  /**
   * Indicates whether updates to true curves should be restricted to clients
   * that support true editing. If `true`, `applyEdits` calls that update true
   * curves must have the `trueCurveClient` parameter set to `true`.
   *
   * @since 5.0
   */
  supportsTrueCurveUpdateByTrueCurveClientsOnly: boolean;
  /**
   * Indicates if anonymous users can update features created by others.
   *
   * @since 5.0
   */
  supportsUpdateByAnonymous: boolean;
  /**
   * Indicates if logged in users can update features created by others.
   *
   * @since 5.0
   */
  supportsUpdateByOthers: boolean;
  /**
   * Indicates if `m-values` must be provided when updating features.
   *
   * @since 5.0
   */
  supportsUpdateWithoutM: boolean;
  /**
   * Indicates if the layer supports uploading attachments by [UploadId](https://developers.arcgis.com/rest/services-reference/item.htm).
   *
   * @since 5.0
   */
  supportsUploadWithItemId: boolean;
}

/**
 * Describes what attachment capabilities are enabled on the layer as part of its [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities).
 *
 * @since 5.0
 */
export interface AttachmentCapabilities {
  /**
   * Indicates if the [attachment operations](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) support a cache hint. This is valid only for
   * [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm).
   *
   * @since 5.0
   */
  supportsCacheHint: boolean;
  /**
   * Indicates if the attachments can be [queried](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) by their content types.
   *
   * @since 5.0
   */
  supportsContentType: boolean;
  /**
   * Indicates if the attachment [queries](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) support `exifInfo`.
   *
   * @since 5.0
   */
  supportsExifInfo: boolean;
  /**
   * Indicates if the attachments can be [queried](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) by their keywords.
   *
   * @since 5.0
   */
  supportsKeywords: boolean;
  /**
   * Indicates if the attachments can be [queried](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) by their names.
   *
   * @since 5.0
   */
  supportsName: boolean;
  /**
   * Indicates if the [queried](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) attachments can be returned in [order](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/#orderByFields) based on the specified `attachmentInfo` fields.
   *
   * @since 5.0
   */
  supportsOrderByFields: boolean;
  /**
   * Indicates if resized attachments are supported in the feature layer.
   * This is useful for showing thumbnails in [Popups](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/). See the feature service [Attachment](https://developers.arcgis.com/rest/services-reference/enterprise/attachment-feature-service/) documentation for information on services that support resizing.
   *
   * @since 5.0
   */
  supportsResize: boolean;
  /**
   * Indicates if the attachments can be [queried](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) by their sizes.
   *
   * @since 5.0
   */
  supportsSize: boolean;
  /**
   * Indicates if the attachments can be [queried](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttachmentQuery/) by using a wildcard character for attachment types.
   *
   * @since 5.0
   */
  supportsTypeWildcard: boolean;
}

/**
 * Describes what analytics capabilities are enabled on the layer as part of its [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities).
 *
 * @since 5.0
 */
export interface AnalyticsCapabilities {
  /**
   * Indicates if the feature service supports cache hint.
   *
   * @since 5.0
   */
  supportsCacheHint: boolean;
}

/**
 * Describes [top features query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/TopFeaturesQuery/) operations that can be performed on features in the layer
 * as part of its [FeatureLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#FeatureLayerCapabilities).
 *
 * @since 5.0
 */
export interface QueryTopFeaturesCapabilities {
  /**
   * Indicates if the [top query operation](https://developers.arcgis.com/javascript/latest/references/core/rest/support/TopFeaturesQuery/) supports a cache hint. This is valid only for
   * [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm).
   *
   * @since 5.0
   */
  supportsCacheHint: boolean;
}

/**
 * Describes [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) operations that can be performed on features in the layer.
 *
 * @since 5.0
 */
export interface QueryBinsCapabilities {
  /**
   * Indicates if the layer supports [date field-based](https://developers.arcgis.com/javascript/latest/references/core/rest/support/DateBinParameters/) attribute bins query functions.
   *
   * @since 5.0
   */
  supportsDate: boolean;
  /**
   * Indicates if the layer supports [fixed interval](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FixedIntervalBinParameters/) attribute bins query functions.
   *
   * @since 5.0
   */
  supportsFixedInterval: boolean;
  /**
   * Indicates if the layer supports [auto interval](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AutoIntervalBinParameters/) attribute bins query functions.
   *
   * @since 5.0
   */
  supportsAutoInterval: boolean;
  /**
   * Indicates if the layer supports [fixed boundaries](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FixedBoundariesBinParameters/) attribute bins query functions.
   *
   * @since 5.0
   */
  supportsFixedBoundaries: boolean;
  /**
   * Indicates if the layer supports the `stackBy` parameter in attribute bins query functions.
   *
   * @since 5.0
   */
  supportsStackBy: boolean;
  /**
   * Indicates if the layer supports the `splitBy` parameter in attribute bins query functions.
   *
   * @since 5.0
   */
  supportsSplitBy: boolean;
  /**
   * Indicates if the layer's [date field-based](https://developers.arcgis.com/javascript/latest/references/core/rest/support/DateBinParameters/) binning supports snapping data to either the first or last date point.
   *
   * @since 5.0
   */
  supportsSnapToData: boolean;
  /**
   * When `true` all bins have equal intervals. When `false` the last bin's upper boundary maybe adjusted to the maximum value in the dataset.
   *
   * @since 5.0
   */
  supportsReturnFullIntervalBin: boolean;
  /**
   * Indicates if the first day of the week can be set for date binning.
   *
   * @since 5.0
   */
  supportsFirstDayOfWeek: boolean;
  /**
   * Indicates if data can be transformed.
   *
   * @since 5.0
   */
  supportsNormalization: boolean;
  /**
   * Indicates if the layer supports [statistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#outStatistics) attribute bins query functions.
   *
   * @since 5.0
   */
  supportedStatistics?: SupportedBinStatistics | null;
  /**
   * Normalization types supported by the queryBins operation.
   *
   * @since 5.0
   */
  supportedNormalizationTypes?: SupportedBinNormalizationTypes | null;
}

/**
 * Describes the layer's supported capabilities.
 *
 * @since 5.0
 */
export interface FeatureLayerCapabilities {
  /**
   * Describes what analytics capabilities are enabled on the layer.
   *
   * @since 5.0
   */
  analytics: AnalyticsCapabilities;
  /**
   * Describes what attachment capabilities are enabled on the layer.
   *
   * @since 5.0
   */
  attachment?: AttachmentCapabilities | null;
  /**
   * Describes characteristics of the data in the layer.
   *
   * @since 5.0
   */
  data: DataCapabilities;
  /**
   * Describes the metadata contained on features in the layer.
   *
   * @since 5.0
   */
  metadata: MetadataCapabilities;
  /**
   * Describes operations that can be performed on features in the layer.
   *
   * @since 5.0
   */
  operations: OperationCapabilities;
  /**
   * Describes [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/)
   * operations that can be performed on features in the layer.
   *
   * @since 5.0
   */
  query: QueryCapabilities;
  /**
   * Describes [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) operations that can be performed on features in the layer.
   *
   * @since 5.0
   */
  queryAttributeBins: QueryBinsCapabilities;
  /**
   * Indicates if the layer's query operation supports querying features or records related to features in the layer.
   *
   * @since 5.0
   */
  queryRelated: QueryRelatedCapabilities;
  /**
   * Describes [top features query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/TopFeaturesQuery/) operations that can be performed on features in the layer.
   *
   * @since 5.0
   */
  queryTopFeatures: QueryTopFeaturesCapabilities;
  /**
   * Describes editing capabilities that can be performed on the features in the layer via [FeatureLayer.applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits).
   *
   * @since 5.0
   */
  editing: EditingCapabilities;
}

/**
 * The capabilities of the [VideoLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#capabilities). The capabilities describe the operations the video layer supports and are defined by the video service.
 *
 * @since 5.0
 */
export interface VideoLayerCapabilities {
  /**
   * The operations capabilities of the video layer.
   *
   * @since 5.0
   */
  operations: VideoLayerCapabilitiesOperations;
}

/**
 * Describes the video layer's supported capabilities.
 *
 * @since 5.0
 */
export interface VideoLayerCapabilitiesOperations {
  /**
   * Indicates if the video layer supports appending data.
   *
   * @since 5.0
   */
  supportsAppend: boolean;
  /**
   * Indicates if the video layer supports coverage queries.
   *
   * @since 5.0
   */
  supportsCoverageQuery: boolean;
  /**
   * Indicates if the video layer supports exporting clips.
   *
   * @since 5.0
   */
  supportsExportClip: boolean;
  /**
   * Indicates if the video layer supports exporting frames.
   *
   * @since 5.0
   */
  supportsExportFrameset: boolean;
  /**
   * Indicates if the video layer supports mensuration.
   *
   * @since 5.0
   */
  supportsMensuration: boolean;
  /**
   * Indicates if the video layer supports display of frame previews.
   *
   * @since 5.0
   */
  supportsPreviews: boolean;
  /**
   * Indicates if the video layer supports updating data.
   *
   * @since 5.0
   */
  supportsUpdate: boolean;
}

/**
 * Capabilities of the [VectorTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VectorTileLayer/#capabilities). The capabilities describe the operations the vector tile layer supports and are defined by the vector tile service.
 *
 * @since 5.0
 */
export interface VectorTileLayerCapabilities {
  /**
   * Indicates operations that can be performed on the service.
   *
   * @since 5.0
   */
  operations: VectorTileLayerCapabilitiesOperations;
  /**
   * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`.
   *
   * @since 5.0
   */
  exportTiles?: VectorTileLayerCapabilitiesExportTiles | null;
}

/**
 * Describes the VectorTileLayer's supported operations as part of its [VectorTileLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#VectorTileLayerCapabilities).
 *
 * @since 5.0
 */
export interface VectorTileLayerCapabilitiesOperations {
  /**
   * Indicates if the tiles from the service can be exported.
   *
   * @since 5.0
   */
  supportsExportTiles: boolean;
  /**
   * Indicates if the service exposes a tile map that describes the presence of tiles.
   *
   * @since 5.0
   */
  supportsTileMap: boolean;
}

/**
 * Describes the export tiles options supported by the VectorTileLayer as part of its [VectorTileLayerCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#VectorTileLayerCapabilities).
 *
 * @since 5.0
 */
export interface VectorTileLayerCapabilitiesExportTiles {
  /**
   * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package.
   *
   * @since 5.0
   */
  maxExportTilesCount: number;
}

/**
 * Options for fetching exported images from a map image service.
 *
 * @since 5.0
 * @see [MapImageLayer.fetchImage()](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/#fetchImage)
 */
export interface FetchImageOptions extends AbortOptions {
  /**
   * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3.
   *
   * @since 5.0
   */
  rotation?: number | null;
  /**
   * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at.
   *
   * @since 5.0
   */
  pixelRatio?: number | null;
  /**
   * The time instant or time extent of content to render.
   *
   * @since 5.0
   */
  timeExtent?: TimeExtent | null;
}

/**
 * Describes the layer's supported capabilities.
 *
 * @since 5.0
 */
export interface SceneLayerCapabilities {
  /**
   * Describes [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/)
   * operations that can be performed on features in the layer.
   *
   * @since 5.0
   */
  query: FeatureLayerCapabilities["query"];
  /**
   * Indicates if the layer's query operation supports querying features or records related to features in the layer.
   *
   * @since 5.0
   */
  queryRelated: FeatureLayerCapabilities["queryRelated"];
  /**
   * Describes characteristics of the data in the layer.
   *
   * @since 5.0
   */
  data: SceneLayerCapabilitiesData;
  /**
   * Describes operations that can be performed on features in the layer.
   *
   * @since 5.0
   */
  operations: SceneLayerCapabilitiesOperations;
  /**
   * Describes editing capabilities that can be performed on the features in the layer via [SceneLayer.applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/#applyEdits).
   *
   * @since 5.0
   */
  editing: SceneLayerCapabilitiesEditing;
}

/**
 * Subset of FeatureLayer data capabilities exposed for SceneLayers.
 *
 * @since 5.0
 */
export type SceneLayerCapabilitiesData = Pick<FeatureLayerCapabilities["data"], "supportsZ" | "supportsM" | "isVersioned" | "supportsAttachment">;

/**
 * Subset of FeatureLayer editing capabilities exposed for SceneLayers.
 *
 * @since 5.0
 */
export type SceneLayerCapabilitiesEditing = Pick<FeatureLayerCapabilities["editing"], "supportsGlobalId" | "supportsGeometryUpdate" | "supportsRollbackOnFailure" | "supportsUploadWithItemId">;

/**
 * Subset of FeatureLayer operation capabilities exposed for SceneLayers.
 *
 * @since 5.0
 */
export type SceneLayerCapabilitiesOperations = Pick<FeatureLayerCapabilities["operations"], "supportsQuery" | "supportsQueryAttachments" | "supportsAdd" | "supportsDelete" | "supportsEditing" | "supportsUpdate">;

/**
 * The results of computing a route and directions.
 *
 * @since 5.0
 */
export interface RouteLayerSolveResult {
  /**
   * Collection of direction polylines associated with line segments between turns.
   *
   * @since 5.0
   */
  directionLines: Collection<DirectionLine>;
  /**
   * Collection of direction items as points with various display information.
   *
   * @since 5.0
   */
  directionPoints: Collection<DirectionPoint>;
  /**
   * Point barrier(s) to restrict travel along a street network when using a [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/).
   *
   * @since 5.0
   */
  pointBarriers: Collection<PointBarrier>;
  /**
   * Polygon barrier(s) to restrict travel along a street network when using a [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/).
   *
   * @since 5.0
   */
  polygonBarriers: Collection<PolygonBarrier>;
  /**
   * Polyline barrier(s) to restrict travel along a street network when using a [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/).
   *
   * @since 5.0
   */
  polylineBarriers: Collection<PolylineBarrier>;
  /**
   * Information about a solved route including the route's geometry and overall distance and time.
   *
   * @since 5.0
   */
  routeInfo: RouteInfo;
  /**
   * Represents the start, end, or midpoint of a route created using the [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/).
   *
   * @since 5.0
   */
  stops: Collection<Stop>;
}

/**
 * Blend modes are used to blend layers together to create an interesting effect in a layer, or even to produce what seems like a new layer.
 * Blend modes can create a variety of very vibrant and intriguing results by blending a layer with the layer(s) below it.
 *
 * @since 5.0
 * @see [Layer blendMode](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#blendMode)
 */
export type BlendMode = "average" | "color-burn" | "color-dodge" | "color" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "invert" | "lighten" | "lighter" | "luminosity" | "minus" | "multiply" | "normal" | "overlay" | "plus" | "reflect" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "vivid-light" | "xor";

/**
 * Union of supported ground elevation layer types.
 *
 * @since 5.0
 */
export type ElevationLayerUnion = ElevationLayer | BaseElevationLayer;

/**
 * Options for saving a layer as a portal item.
 *
 * @since 5.0
 */
export interface LayerSaveOptions {
  /**
   * Indicates whether to ignore saving unsupported layers or layers with unsupported content, such as unsupported symbology.
   *
   * @since 5.0
   */
  ignoreUnsupported?: boolean;
}

/**
 * Options for saving a layer as a new portal item.
 *
 * @since 5.0
 */
export interface LayerSaveAsOptions extends LayerSaveOptions {
  /**
   * The portal folder where the layer's portal item will be saved.
   *
   * @since 5.0
   */
  folder?: PortalFolder;
}

/**
 * Describes a scale range with a minimum and maximum scale.
 *
 * @see [ScaleRanges.fromScaleRange()](https://developers.arcgis.com/javascript/latest/references/core/widgets/ScaleRangeSlider/ScaleRanges/#fromScaleRange)
 * @since 5.0
 */
export interface ScaleRange {
  /**
   * The minimum scale at a given range.
   *
   * @since 5.0
   */
  minScale: number;
  /**
   * The maximum scale at a given range.
   *
   * @since 5.0
   */
  maxScale: number;
}

/** @since 5.0 */
export interface FieldDomainOptions {
  /**
   * The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Domain/) is assigned.
   *
   * @since 5.0
   */
  feature?: Graphic;
}

/**
 * Options for generating a feature title.
 *
 * @see [SubtypeSublayer.getFeatureTitle()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/#getFeatureTitle)
 * @since 5.0
 */
export interface FeatureTitleOptions {
  /**
   * The time zone to use when formatting date fields in the title. If `null`, the default time zone is used.
   *
   * @since 5.0
   */
  timeZone?: TimeZone | null;
  /**
   * Indicates whether to fetch missing fields from the service if they are not already present in the graphic.
   *
   * @default false
   * @since 5.0
   */
  fetchMissingFields?: boolean;
}