import type Graphic from "../../Graphic.js";
import type EsriMap from "../../Map.js";
import type Accessor from "../../core/Accessor.js";
import type Point from "../../geometry/Point.js";
import type SpatialReference from "../../geometry/SpatialReference.js";
import type Content from "../../popup/content/Content.js";
import type Widget from "../Widget.js";
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
import type { SpatialReferenceProperties } from "../../geometry/SpatialReference.js";
import type { TimeZone } from "../../time/types.js";
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
import type { Abilities, FeatureFormattedAttributes, LastEditInfo, RelatedInfo, State } from "./types.js";
import type { GraphicProperties } from "../../Graphic.js";
import type { PointProperties } from "../../geometry/Point.js";

export interface FeatureViewModelProperties extends IdentifiableMixinProperties, Partial<Pick<FeatureViewModel, "abilities" | "defaultPopupTemplateEnabled" | "map" | "view">> {
  /**
   * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature.
   *
   * @see [PopupTemplate#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content)
   * @example
   * let graphic = new Graphic({
   *   geometry: view.center,
   *   attributes: {
   *     "name": "Spruce",
   *     "family": "Pinaceae",
   *     "count": 126
   *   },
   *   symbol: new SimpleMarkerSymbol({
   *     style: "square",
   *     color: "blue",
   *     size: "8px"
   *   }),
   *   popupTemplate: {
   *     content: [
   *       {
   *         // Set popup template content
   *       }
   *     ]
   *   }
   * });
   */
  graphic?: GraphicProperties | null;
  /**
   * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing the location of the
   * [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) interaction used to trigger the opening of the widget.
   *
   * This value should be set when executing Arcade expressions in the Feature widget that
   * expect the `$userInput` profile variable to have a value.
   *
   * @since 4.29
   * @see [PopupTemplate#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content)
   * @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
   * @example
   * view.on("click", (event) => {
   *   const { mapPoint } = event;
   *   feature.viewModel.location = mapPoint;
   * });
   */
  location?: PointProperties | null;
  /**
   * The spatial reference used for [Arcade](https://developers.arcgis.com/arcade) operations.
   * This property should be set if executing Arcade expressions that contain [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/).
   *
   * @since 4.11
   * @see [Type system](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection)
   * @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
   */
  spatialReference?: SpatialReferenceProperties | null;
  /**
   * Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
   * inherited from [MapView#timeZone](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#timeZone). When a MapView is not associated with the widget
   * then the property will fallback to the `system` time zone.
   *
   * **Possible Values**
   *
   * Value | Description |
   * ----- | ----------- |
   * system  | Dates and times will be displayed in the timezone of the device or browser.
   * unknown | Dates and time are not adjusted for any timezone.
   * Specified IANA timezone | Dates and times will be displayed in the specified IANA time zone. See [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
   *
   * @since 4.29
   */
  timeZone?: TimeZone | null;
}

export type PopupViewModelContent = Content[] | string | HTMLElement | Widget;

/**
 * Provides the logic for the [Feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-feature/).
 *
 * @since 4.7
 * @see [Feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html) widget- _Deprecated since 4.34. Use the [Feature component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-feature/) instead._
 * @see [Feature component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-feature/)
 * @see [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html)
 * @see [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html)
 * @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
 * @see [Arcade - expression language](https://developers.arcgis.com/javascript/latest/arcade/)
 */
export default class FeatureViewModel extends FeatureViewModelSuperclass {
  constructor(properties?: FeatureViewModelProperties);
  /**
   * Defines the specific [Abilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-types.html#Abilities) that the [Feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html) and [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) widgets should use when querying and displaying its content.
   *
   * @since 4.21
   */
  accessor abilities: Abilities;
  /** The [PopupTemplate#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) of the feature. */
  get content(): PopupViewModelContent | null | undefined;
  /**
   * Enables automatic creation of a popup template for layers that have popups enabled but no
   * popupTemplate defined. Automatic popup templates are supported for layers that
   * support the `createPopupTemplate` method. (Supported for
   * [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html),
   * [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html),
   * [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OGCFeatureLayer.html),
   * [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html),
   * [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html),
   * [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html),
   * [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), and
   * [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)).
   *
   * @default false
   * @since 4.11
   */
  accessor defaultPopupTemplateEnabled: boolean;
  /**
   * The formatted attributes calculated from `fieldInfo` [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html)
   * content. They are obtained from the feature's [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) attribute values
   * and can be read:
   *  * globally using the [PopupTemplate#fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property
   *    directly at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), or
   *  * per an individual content element. This element is defined with a [FieldsContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.html)
   *    popup element set on the PopupTemplate [PopupTemplate#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property.
   */
  get formattedAttributes(): FeatureFormattedAttributes | null | undefined;
  /**
   * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature.
   *
   * @see [PopupTemplate#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content)
   * @example
   * let graphic = new Graphic({
   *   geometry: view.center,
   *   attributes: {
   *     "name": "Spruce",
   *     "family": "Pinaceae",
   *     "count": 126
   *   },
   *   symbol: new SimpleMarkerSymbol({
   *     style: "square",
   *     color: "blue",
   *     size: "8px"
   *   }),
   *   popupTemplate: {
   *     content: [
   *       {
   *         // Set popup template content
   *       }
   *     ]
   *   }
   * });
   */
  get graphic(): Graphic | null | undefined;
  set graphic(value: GraphicProperties | null | undefined);
  /**
   * Indicates whether the current FeatureViewModel's [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) resides in a non-spatial table.
   *
   * @since 4.33
   */
  get isFeatureFromTable(): boolean;
  /**
   * A read-only property containing metadata regarding the last edit performed on a feature.
   * This object has the following properties:
   */
  get lastEditInfo(): LastEditInfo | null | undefined;
  /**
   * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing the location of the
   * [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) interaction used to trigger the opening of the widget.
   *
   * This value should be set when executing Arcade expressions in the Feature widget that
   * expect the `$userInput` profile variable to have a value.
   *
   * @since 4.29
   * @see [PopupTemplate#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content)
   * @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
   * @example
   * view.on("click", (event) => {
   *   const { mapPoint } = event;
   *   feature.viewModel.location = mapPoint;
   * });
   */
  get location(): Point | null | undefined;
  set location(value: PointProperties | null | undefined);
  /**
   * A map is required when the input [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) has a popupTemplate that contains [Arcade](https://developers.arcgis.com/arcade) expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-ExpressionInfo.html) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ExpressionContent.html) that may use the `$map` profile variable to access data from layers within a map. Without a map, expressions that use `$map` will throw an error.
   *
   * Alternatively, the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#view) property can be used to provide the map instance for this property.
   *
   * @since 4.11
   * @see [Type system](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection)
   * @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
   * @example
   * // The building footprints represent the buildings that intersect a clicked parcel
   * let buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));
   */
  accessor map: EsriMap | null | undefined;
  /**
   * A read-only map containing information about related features for the current feature.
   * The keys are related layer IDs as strings, and the values are [RelatedInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-types.html#RelatedInfo) objects.
   * This property is populated when the feature has related fields and is used to manage and display related feature information in the widget.
   *
   * @since 4.34
   */
  get relatedInfos(): Map<string, RelatedInfo>;
  /**
   * The spatial reference used for [Arcade](https://developers.arcgis.com/arcade) operations.
   * This property should be set if executing Arcade expressions that contain [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/).
   *
   * @since 4.11
   * @see [Type system](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection)
   * @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
   */
  get spatialReference(): SpatialReference | null | undefined;
  set spatialReference(value: SpatialReferenceProperties | null | undefined);
  /**
   * The view model's state.
   *
   * @default "disabled"
   * @since 4.21
   */
  get state(): State;
  /**
   * Dates and times displayed in the widget will be displayed in this time zone. By default this time zone is
   * inherited from [MapView#timeZone](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#timeZone). When a MapView is not associated with the widget
   * then the property will fallback to the `system` time zone.
   *
   * **Possible Values**
   *
   * Value | Description |
   * ----- | ----------- |
   * system  | Dates and times will be displayed in the timezone of the device or browser.
   * unknown | Dates and time are not adjusted for any timezone.
   * Specified IANA timezone | Dates and times will be displayed in the specified IANA time zone. See [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
   *
   * @since 4.29
   */
  get timeZone(): TimeZone;
  set timeZone(value: TimeZone | null | undefined);
  /**
   * The title for the feature.
   *
   * @default ""
   */
  get title(): string;
  /**
   * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view.
   *
   * > [!WARNING]
   * >
   * > The FeatureViewModel requires a view if the user expects it to display content in any of the following situations:
   * > - The [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) has a popupTemplate containing Arcade expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-ExpressionInfo.html) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ExpressionContent.html) that may use [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/) or reference the `$map` profile variable (i.e. access data from layers within a map).
   * > - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureReductionCluster.html) or [bin](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureReductionBinning.html)).
   * > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) should respect the view's [time zone](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#timeZone).
   */
  accessor view: MapViewOrSceneView | null | undefined;
  /** Indicates whether the feature is currently waiting for all of its content to finish loading. */
  get waitingForContent(): boolean;
  /**
   * Paginates to the next [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) info.
   *
   * @param contentElementIndex - The index position of the [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) content element.
   */
  nextMedia(contentElementIndex: number): void;
  /**
   * Paginates to the previous [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) info in the specified
   * [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) content element.
   *
   * @param contentElementIndex - The index position of the [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) content element.
   */
  previousMedia(contentElementIndex: number): void;
  /**
   * Paginates to a specified [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) info object. For example,
   * you may have [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) content which contains
   * multiple `mediaInfos`. This method allows you to specify the index of the `mediaInfos`
   * you wish to display.
   *
   * > [!WARNING]
   * >
   * > Prior to   version 4.17, this method was named `goToMedia`.
   *
   * @param contentElementIndex - The index position of the [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) content element to be updated.
   * @param mediaInfoIndex - The index position of the [media](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) info object you wish to display.
   */
  setActiveMedia(contentElementIndex: number, mediaInfoIndex: number): void;
  /**
   * Fetches the geometry of the [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) if the geometry does not exist.
   * This method can be called to ensure the [graphic's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) geometry is available when the geometry is necessary
   * to take action such as calling [View2D#goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#goTo) with the graphic as the `target`.
   *
   * @returns A promise that resolves when the geometry has been updated.
   * @since 4.33
   */
  updateGeometry(): Promise<void>;
}
declare const FeatureViewModelSuperclass: typeof Accessor & typeof IdentifiableMixin