import type Accessor from "../../core/Accessor.js";
import type Collection from "../../core/Collection.js";
import type UtilityNetwork from "../../networks/UtilityNetwork.js";
import type MapView from "../../views/MapView.js";
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";

export interface UtilityNetworkValidateTopologyViewModelProperties extends Partial<Pick<UtilityNetworkValidateTopologyViewModel, "extentToValidate" | "utilityNetwork" | "view">> {
  /**
   * If an error occurs during during validation a loadError wil be displayed.
   *
   * @since 4.27
   */
  loadErrors?: ReadonlyArrayOrCollection<string>;
}

export type UtilityNetworkValidateTopologyViewModelExtentOption = "current" | "entire";

export type UtilityNetworkValidateTopologyViewModelState = "loading" | "ready" | "executing" | "success" | "failed" | "disabled";

/**
 * Provides the logic for the [UtilityNetworkValidateTopology](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkValidateTopology.html) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-utility-network-validate-topology/).
 *
 * @deprecated since version 5.0. Use [UtilityNetwork#validateTopology()](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html#validateTopology) instead.
 * @since 4.27
 * @see [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html)
 * @see [UtilityNetworkValidateTopology](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkValidateTopology.html) widget
 * @see [Utility Network Validate Topology component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-utility-network-validate-topology/)
 */
export default class UtilityNetworkValidateTopologyViewModel extends Accessor {
  constructor(properties?: UtilityNetworkValidateTopologyViewModelProperties);
  /**
   * If the validation process fails, this property returns an error message. Otherwise, it is empty.
   *
   * @default ""
   */
  get executionError(): string;
  /**
   * Specifies the extent of the validation.
   *
   * @default "current"
   */
  accessor extentToValidate: UtilityNetworkValidateTopologyViewModelExtentOption;
  /**
   * If an error occurs during during validation a loadError wil be displayed.
   *
   * @since 4.27
   */
  get loadErrors(): Collection<string>;
  set loadErrors(value: ReadonlyArrayOrCollection<string>);
  /**
   * The view model's state.
   *
   * @default "ready"
   * @since 4.27
   */
  get state(): UtilityNetworkValidateTopologyViewModelState;
  /**
   * Determines the utility network to use.
   *
   * @since 4.27
   */
  accessor utilityNetwork: UtilityNetwork | null | undefined;
  /** The view from which the widget will operate. */
  accessor view: MapView | null | undefined;
  /**
   * Validates the network topology of the [utility network](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkValidateTopology-UtilityNetworkValidateTopologyViewModel.html#utilityNetwork).
   *
   * @since 4.27
   * @see [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html)
   */
  validateTopology(): Promise<void>;
}