import type LinkChartView from "../../views/LinkChartView.js";
import type { EventedAccessor, EventedMixinProperties } from "../../core/Evented.js";
import type { LayoutMode } from "../../layers/knowledgeGraph/LayoutMode.js";

export interface LinkChartLayoutSwitcherViewModelProperties extends EventedMixinProperties, Partial<Pick<LinkChartLayoutSwitcherViewModel, "view">> {
  /**
   * The current selected link chart layout.
   *
   * @default "organic-standard"
   */
  layout?: LayoutMode | null;
  /**
   * Prevents extent from updating on changes to the layout.
   *
   * @default false
   */
  preventExtentUpdate?: boolean | null;
}

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

export interface LinkChartLayoutSwitcherViewModelEvents {
  /**
   * Fires when the [switchLayout()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LinkChartLayoutSwitcher-LinkChartLayoutSwitcherViewModel.html#switchLayout) method is called.
   *
   * @see [switchLayout()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LinkChartLayoutSwitcher-LinkChartLayoutSwitcherViewModel.html#switchLayout)
   * @example
   * layoutSwitcher.viewModel.on("switchLayout", function(event){
   *   console.log("Layout Switched");
   * });
   */
  switchLayout: {
      layout: LayoutMode;
  };
}

/**
 * Provides the logic for the [Link Chart Layout Switcher component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-link-chart-layout-switcher/) that
 * switches the layout of a [LinkChartView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-LinkChartView.html).
 *
 * @beta
 * @since 4.32
 * @see [Link Chart Layout Switcher component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-link-chart-layout-switcher/)
 * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
 */
export default class LinkChartLayoutSwitcherViewModel extends EventedAccessor {
  /**
   * @deprecated
   * Do not directly reference this property.
   * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
   */
  "@eventTypes": LinkChartLayoutSwitcherViewModelEvents;
  constructor(properties?: LinkChartLayoutSwitcherViewModelProperties);
  /**
   * The current selected link chart layout.
   *
   * @default "organic-standard"
   */
  get layout(): LayoutMode;
  set layout(value: LayoutMode | null | undefined);
  /**
   * Prevents extent from updating on changes to the layout.
   *
   * @default false
   */
  get preventExtentUpdate(): boolean;
  set preventExtentUpdate(value: boolean | null | undefined);
  /**
   * The current state of the widget.
   *
   * @default "loading"
   */
  get state(): LinkChartLayoutSwitcherViewModelState;
  /** The view associated with the widget instance. */
  accessor view: LinkChartView | null | undefined;
  /**
   * Switches the layout of the link chart.
   *
   * @param newLayout - List of specific entities and relationships to update.
   * @returns Resolves when the data in the link chart has been updated.
   * @since 4.32
   */
  switchLayout(newLayout: LayoutMode): Promise<void>;
}