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

/**
 * Function definition for the [LayerList#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction), {@link widgets/LayerList/interfaces#baseListItemCreatedFunction},
 * and {@link widgets/LayerList/interfaces#referenceListItemCreatedFunction} properties.
 * See the example snippets in the documentations for those properties 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";