import type ListItem from "./ListItem.js";

/**
 * Function definition for the [TableListViewModel#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-TableListViewModel.html#listItemCreatedFunction) property.
 * See the example snippets in the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html) documentation for more details.
 *
 * @param event - An object containing a list item created by the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html).
 */
export type ListItemModifier = (event: ListItemModifierEvent) => void;

export interface ListItemModifierEvent {
  /**
   * A list item
   *   created by the LayerList. You can modify the properties of this item to customize
   *   the text, actions, panel content, and visibility of the list item. See the
   *   documentation for the [LayerListViewModel#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) for more details.
   */
  item: ListItem;
}

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