import type Accessor from "../../core/Accessor.js";
import type Collection from "../../core/Collection.js";
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
import type { AttributionItem } from "../types.js";

export interface AttributionViewModelProperties extends Partial<Pick<AttributionViewModel, "view">> {}

export type AttributionViewModelState = "disabled" | "ready" | "loading";

/**
 * Provides the logic for the [Attribution](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attribution/) widget.
 * Displays attribution text for the layers in a map.
 * The text displayed for the layers is either a list of data providers or
 * sources as defined in the layer's custom attribution data, or the copyright text.
 * The attribution is automatically updated based on layer visibility and map extent.
 *
 * > [!WARNING]
 * >
 * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content.
 * > For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation.
 * > For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/).
 *
 * @since 4.0
 * @see [Attribution](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attribution/)
 * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
 */
export default class AttributionViewModel extends Accessor {
  constructor(properties?: AttributionViewModelProperties);
  /** A collection of [AttributionItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/types/#AttributionItem)s. */
  get items(): Collection<AttributionItem>;
  /**
   * The view model's state.
   *
   * @default "disabled"
   */
  get state(): AttributionViewModelState;
  /** The view from which the view model will operate. */
  accessor view: MapViewOrSceneView | null | undefined;
}