import type PopupTemplate from "../PopupTemplate.js";
import type Extent from "../geometry/Extent.js";
import type Layer from "./Layer.js";
import type Field from "./support/Field.js";
import type FeatureSet from "../rest/support/FeatureSet.js";
import type Query from "../rest/support/Query.js";
import type { ClonableMixin } from "../core/Clonable.js";
import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js";
import type { LayerEvents, LayerProperties } from "./Layer.js";
import type { APIKeyMixin, APIKeyMixinProperties } from "./mixins/APIKeyMixin.js";
import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
import type { EditBusLayerEvents } from "./mixins/EditBusLayer.js";
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
import type { RequestOptions } from "../request/types.js";
import type { QueryProperties } from "../rest/support/Query.js";
import type { CreatePopupTemplateOptions } from "../support/popupUtils.js";
import type { ObjectId } from "../views/types.js";
import type { PopupTemplateProperties } from "../PopupTemplate.js";

export interface DimensionFeatureLayerProperties extends LayerProperties, APIKeyMixinProperties, CustomParametersMixinProperties, PortalLayerProperties, OperationalLayerProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties, BlendLayerProperties, FeatureLayerBaseProperties, Partial<Pick<DimensionFeatureLayer, "outFields" | "popupEnabled">> {
  /**
   * The popup template for the layer. When set on the layer, the `popupTemplate`
   * allows users to access attributes and display their values in the
   * view's Popup when a feature is selected
   * using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/)
   * for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) interacts with a
   * [DimensionFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/).
   *
   * A default popup template is automatically used if no `popupTemplate` has been defined when
   * [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#defaultPopupTemplateEnabled)
   * is set to `true`.
   *
   * @see [createPopupTemplate()](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#createPopupTemplate)
   * @see [SceneView.popup](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#popup)
   * @see [View2D.popup](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#popup)
   */
  popupTemplate?: PopupTemplateProperties | null;
}

export interface DimensionFeatureLayerEvents extends EditBusLayerEvents, RefreshableLayerEvents, LayerEvents {}

/**
 * DimensionFeatureLayer is 2D-only, and is not supported in [3D SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). This layer is used for showing specific lengths or distances on a map. A dimension may indicate the length of a side of a building or land parcel, or the distance between two features,
 * such as a fire hydrant and the corner of a building. A dimension feature is composed of several parts that may or may not be displayed, depending on the application. These parts are each represented differently
 * using different symbology and placement rules. Dimension features are not supported by the Legend component and the printed legend (it does print, but will not display in the printed legend).
 * Example of a dimension feature:
 *
 * <figure>
 *   <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/layers/dimensionfeaturelayer.avif" alt="dimension"/>
 *   <figcaption> This image shows a DimensionFeatureLayer visualizing distances.</figcaption>
 * </figure>
 *
 * DimensionFeatureLayer may be created from a [url](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#url).
 * In the geodatabase, dimensions are stored in dimension feature classes. As with other feature classes in the geodatabase, all features in a dimension feature class have a geographic location and attributes and
 * can either be inside or outside a feature dataset. Like annotation features, dimension features are graphic features, and their symbology is stored in the geodatabase.
 *
 *  ```js
 * // get a reference to arcgis-map
 * const viewElement = document.querySelector("arcgis-map");
 * // Create a dimension feature layer from a feature service layer URL
 * const layer = new DimensionFeatureLayer({
 *   url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/LakeDimensions/FeatureServer/0"
 * });
 * // add the layer to the map
 * viewElement.map.add(layer);
 * ```
 *
 * > [!WARNING]
 * >
 * > **Known Limitations**
 * > The following features are not currently supported at this release. Future releases will see increased functionality and support for additional features.
 * > * Editing
 * > * [DimensionFeatureLayerView.featureEffect](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#featureEffect)
 * > * [DimensionFeatureLayerView.filter](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#filter)
 *
 * @beta
 * @since 5.1
 * @see [Dimensions in ArcGIS Pro](https://doc.esri.com/en/arcgis-pro/latest/help/data/dimensions/dimensions-in-arcgis-pro.html)
 * @see [3D DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/)
 * @see [AnnotationFeatureLayer (beta)](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/)
 */
export default class DimensionFeatureLayer extends DimensionFeatureLayerSuperclass {
  /**
   * @deprecated
   * Do not directly reference this property.
   * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
   */
  "@eventTypes": DimensionFeatureLayerEvents;
  /**
   * @example
   * // Create a dimension feature layer from a feature service layer URL.
   * ```js
   * const layer = new DimensionFeatureLayer({
   *   url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Dimensions/FeatureServer/0"
   * });
   * ```
   */
  constructor(properties?: DimensionFeatureLayerProperties);
  /**
   * An array of fields in the layer.
   *
   * @see [objectIdField](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#objectIdField)
   */
  get fields(): Field[];
  /**
   * An array of field names from the service to include with each feature.
   * To fetch the values from all fields in the layer, use `["*"]`.
   * Set this property to include the fields that will be used for client-side
   * [queries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#queryFeatures)
   * if the fields are not part of required fields.
   *
   * @see [DimensionFeatureLayerView.availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#availableFields)
   * @see [fieldUtils](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/)
   * @example
   * // Includes all fields from the service in the layer
   * layer.outFields = ["*"];
   * @example
   * // Get the specified fields from the service in the layer.
   * // These fields will be added to DimensionFeatureLayerView.availableFields.
   * // Use these fields for client-side filtering and querying.
   * layer.outFields = ["NAME", "POP_2010", "FIPS", "AREA"];
   */
  accessor outFields: string[] | null | undefined;
  /**
   * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#popupTemplate) to define what
   * information should be displayed in the popup. Alternatively, a default popup template may be automatically used if
   * [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#defaultPopupTemplateEnabled) is set to `true`.
   *
   * @default true
   * @see [createPopupTemplate()](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#createPopupTemplate)
   * @see [SceneView.popup](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#popup)
   * @see [View2D.popup](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#popup)
   */
  accessor popupEnabled: boolean;
  /**
   * The popup template for the layer. When set on the layer, the `popupTemplate`
   * allows users to access attributes and display their values in the
   * view's Popup when a feature is selected
   * using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/)
   * for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) interacts with a
   * [DimensionFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/).
   *
   * A default popup template is automatically used if no `popupTemplate` has been defined when
   * [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#defaultPopupTemplateEnabled)
   * is set to `true`.
   *
   * @see [createPopupTemplate()](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#createPopupTemplate)
   * @see [SceneView.popup](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#popup)
   * @see [View2D.popup](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#popup)
   */
  get popupTemplate(): PopupTemplate | null | undefined;
  set popupTemplate(value: PopupTemplateProperties | null | undefined);
  /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */
  get type(): "dimension-feature";
  /**
   * Creates a popup template for the layer, populated with all the fields of the layer.
   *
   * @param options - Options for creating the popup template.
   * @returns The popup template, or `null` if the layer does not
   * have any fields.
   */
  createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
  /**
   * Creates a query object that respects the layer's current filters.
   *
   * @returns A query object initialized from the layer configuration.
   */
  createQuery(): Query;
  /**
   * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and
   * returns the [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/) of features that satisfy the query. If no
   * parameters are specified, then the extent and count of all features
   * satisfying the layer's configuration/filters are returned.
   *
   * > [!WARNING]
   * >
   * > To query for the extent of features/graphics available to or visible in the
   * > [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/) on the client rather than making a server-side query, you must use the
   * > [DimensionFeatureLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#queryExtent) method.
   *
   * @param query - Specifies the attributes and spatial
   * filter of the query. If no parameters are specified, then the extent and count of all features
   * satisfying the layer's configuration/filters are returned.
   * @param options - An object with the following properties.
   * @returns When resolved, returns the extent and count of the features
   * that satisfy the input query. See the object specification table below for details.
   * Property | Type | Description
   * ---------|------|-------------
   * count | Number | The number of features that satisfy the input query.
   * extent | [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/) \| null | The extent of the features that satisfy the query.
   * @see [Sample - Zoom to extent of all features](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-queryextent/)
   * @example
   * // Queries for the extent of all features matching the layer's configurations
   * // e.g. definitionExpression
   * layer.queryExtent().then((results) => {
   *   // go to the extent of the results satisfying the query
   *   view.goTo(results.extent);
   * });
   */
  queryExtent(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<{
      count: number;
      extent: Extent | null;
  }>;
  /**
   * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and
   * returns the number of features that satisfy the query. If no parameters are specified,
   * the total number of features satisfying the layer's configuration/filters is returned.
   *
   * > [!WARNING]
   * >
   * > To query for the count of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/)
   * > on the client rather than making a server-side query, you must use the
   * > [DimensionFeatureLayerView.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#queryFeatureCount) method.
   *
   * @param query - Specifies the attributes and
   * spatial filter of the query. If no parameters are specified, the total number of features
   * satisfying the layer's configuration/filters is returned.
   * @param options - An object with the following properties.
   * @returns When resolved, returns the number of features that satisfy the query.
   * @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
   * @example
   * // Queries for the count of all features matching the layer's configurations
   * // e.g. definitionExpression
   * layer.queryFeatureCount().then((numFeatures) => {
   *   // prints the total count to the console
   *   console.log(numFeatures);
   * });
   */
  queryFeatureCount(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<number>;
  /**
   * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and returns a
   * [FeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/) once the promise resolves.
   * A [FeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/) contains an array of [features](https://developers.arcgis.com/javascript/latest/references/core/Graphic/).
   * See the [querying](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#querying)
   * section for more information on how to query features from a layer.
   *
   * > [!WARNING]
   * >
   * > **Notes**
   * >
   * > To query features available to or visible in the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/) on the client rather than making a server-side query, you must
   * > use the [DimensionFeatureLayerView.queryFeatures()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#queryFeatures) method.
   * >
   * > When querying a service with z-values and no [vertical coordinate system](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/properties/vertical-coordinate-systems.html) information,
   * > the z-values will automatically be converted to match the [Query.outSpatialReference](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outSpatialReference) units.
   * > Example: The service has a horizontal spatial reference using `feet` units and the query is made with `outSpatialReference`
   * > based on `meter` units, then [queryFeatures()](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#queryFeatures) automatically converts the values from `feet` to `meter` units.
   *
   * @param query - Specifies the attributes and spatial
   * filter of the query. If no parameters are specified, then all features satisfying the layer's
   * configuration/filters are returned.
   * @param options - An object with the following properties.
   * @returns When resolved, a [FeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/) containing
   * an array of graphic features is returned.
   * @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/)
   * @see [Query and filter guide](https://developers.arcgis.com/javascript/latest/query-filter/)
   * @example
   * // Queries for all the features matching the layer's configurations
   * // e.g. definitionExpression
   * layer.queryFeatures().then((results) => {
   *   // prints the array of result graphics to the console
   *   console.log(results.features);
   * });
   * @example
   * const layer = new DimensionFeatureLayer({
   *   url: fsUrl  // points to a Feature Service layer url
   * });
   *
   * const query = new Query();
   * query.where = "STATE_NAME = 'Washington'";
   * query.outSpatialReference = { wkid: 102100 };
   * query.returnGeometry = true;
   * query.outFields = [ "CITY_NAME" ];
   *
   * layer.queryFeatures(query).then((results) => {
   *   console.log(results.features);  // prints the array of features to the console
   * });
   */
  queryFeatures(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<FeatureSet>;
  /**
   * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and returns an
   * array of Object IDs for features that satisfy the input query. If no parameters are specified,
   * then the Object IDs of all features satisfying the layer's configuration/filters are returned.
   *
   * > [!WARNING]
   * >
   * > To query for ObjectIDs of features available to or visible in the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/) on the client rather
   * > than making a server-side query, you must use the
   * > [DimensionFeatureLayerView.queryObjectIds()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/DimensionFeatureLayerView/#queryObjectIds) method.
   *
   * @param query - Specifies the attributes and spatial
   * filter of the query. If no parameters are specified, then the Object IDs of all features
   * satisfying the layer's configuration/filters are returned.
   * @param options - An object with the following properties.
   * @returns When resolved, returns an array of numbers representing the object IDs of the features satisfying the query.
   * @see [Sample - Query Related Features](https://developers.arcgis.com/javascript/latest/sample-code/query-related-features/)
   * @example
   * // Queries for all the Object IDs of features matching the layer's configurations
   * // e.g. definitionExpression
   * layer.queryObjectIds().then((results) => {
   *   // prints the array of Object IDs to the console
   *   console.log(results);
   * });
   */
  queryObjectIds(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<ObjectId[]>;
}
declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase