import type Accessor from "../../core/Accessor.js";
import type UtilityNetwork from "../../networks/UtilityNetwork.js";
import type SimpleLineSymbol from "../../symbols/SimpleLineSymbol.js";
import type MapView from "../../views/MapView.js";
import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.js";

export interface UtilityNetworkAssociationsViewModelProperties extends Partial<Pick<UtilityNetworkAssociationsViewModel, "includeConnectivityAssociations" | "includeStructuralAttachmentAssociations" | "maxAllowableAssociations" | "showArrowsConnectivity" | "showArrowsStructuralAttachment" | "utilityNetwork" | "view">> {
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the polyline geometry that is being drawn for connectivity associations.
   *
   * The default value is the following:
   * ```js
   * {
   *   type: "simple-line",
   *   color: [190, 159, 159, 1],
   *   style: "short-dash",
   *   width: 2
   * }
   * ```
   */
  connectivityAssociationsLineSymbol?: SimpleLineSymbolProperties;
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the polyline geometry that is being drawn for structural attachment associations.   *
   *
   * The default value is the following:
   * ```js
   * {
   *   type: "simple-line",
   *   color: [159, 190, 159, 1],
   *   style: "short-dash",
   *   width: 2
   * }
   * ```
   */
  structuralAttachmentAssociationsLineSymbol?: SimpleLineSymbolProperties;
}

export type UtilityNetworkAssociationsViewModelState = "disabled" | "loading" | "ready" | "executing" | "warning";

/**
 * Provides the logic for the [UtilityNetworkAssociations](https://developers.arcgis.com/javascript/latest/references/core/widgets/UtilityNetworkAssociations/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-associations/).
 *
 * @deprecated since version 5.0. Use [UtilityNetwork.synthesizeAssociationGeometries()](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#synthesizeAssociationGeometries) instead.
 * @since 4.26
 * @see [UtilityNetworkAssociations](https://developers.arcgis.com/javascript/latest/references/core/widgets/UtilityNetworkAssociations/) widget
 * @see [Utility Network Associations component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-associations/)
 * @see [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/)
 * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
 */
export default class UtilityNetworkAssociationsViewModel extends Accessor {
  constructor(properties?: UtilityNetworkAssociationsViewModelProperties);
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the polyline geometry that is being drawn for connectivity associations.
   *
   * The default value is the following:
   * ```js
   * {
   *   type: "simple-line",
   *   color: [190, 159, 159, 1],
   *   style: "short-dash",
   *   width: 2
   * }
   * ```
   */
  get connectivityAssociationsLineSymbol(): SimpleLineSymbol;
  set connectivityAssociationsLineSymbol(value: SimpleLineSymbolProperties);
  /**
   * Indicates whether to query and display connectivity associations.
   *
   * @default true
   */
  accessor includeConnectivityAssociations: boolean;
  /**
   * Indicates whether to query and display structural attachment associations.
   *
   * @default true
   */
  accessor includeStructuralAttachmentAssociations: boolean;
  /**
   * The maximum number of associations that can be returned from the server.
   *
   * @default 250
   */
  accessor maxAllowableAssociations: number;
  /**
   * Indicates whether to show arrows for connectivity associations.
   *
   * @default false
   */
  accessor showArrowsConnectivity: boolean;
  /**
   * Indicates whether to show arrows for structural attachment associations.
   *
   * @default false
   */
  accessor showArrowsStructuralAttachment: boolean;
  /**
   * The view model's state.
   *
   * @default "disabled"
   */
  get state(): UtilityNetworkAssociationsViewModelState;
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the polyline geometry that is being drawn for structural attachment associations.   *
   *
   * The default value is the following:
   * ```js
   * {
   *   type: "simple-line",
   *   color: [159, 190, 159, 1],
   *   style: "short-dash",
   *   width: 2
   * }
   * ```
   */
  get structuralAttachmentAssociationsLineSymbol(): SimpleLineSymbol;
  set structuralAttachmentAssociationsLineSymbol(value: SimpleLineSymbolProperties);
  /**
   * Determines the utility network to use.
   *
   * @since 4.26
   */
  accessor utilityNetwork: UtilityNetwork | null | undefined;
  /** The view associated with the UtilityNetworkAssociations widget instance. */
  accessor view: MapView | null | undefined;
  /** Removes all associations from the map. */
  removeAssociations(): void;
  /** Queries associations within the current map extent. */
  showAssociations(): Promise<void>;
}