import type Accessor from "../../core/Accessor.js";
import type Collection from "../../core/Collection.js";
import type EsriError from "../../core/Error.js";
import type Layer from "../../layers/Layer.js";
import type SubtypeGroupLayer from "../../layers/SubtypeGroupLayer.js";
import type Sublayer from "../../layers/support/Sublayer.js";
import type SubtypeSublayer from "../../layers/support/SubtypeSublayer.js";
import type ListItemPanel from "./ListItemPanel.js";
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
import type { Action } from "../LayerList/types.js";
import type { ActionToggleProperties } from "../../support/actions/ActionToggle.js";
import type { ActionButtonProperties } from "../../support/actions/ActionButton.js";
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
import type { ListItemPanelProperties } from "./ListItemPanel.js";

export interface ListItemProperties extends IdentifiableMixinProperties, Partial<Pick<ListItem, "actionsOpen" | "hidden" | "layer" | "listModeDisabled" | "open" | "parent">> {
  /** A nested 2-dimensional collection of actions that could be triggered on the item. */
  actionsSections?: ReadonlyArrayOrCollection<ReadonlyArrayOrCollection<((ActionButtonProperties & { type: "button" }) | (ActionToggleProperties & { type: "toggle" }))>>;
  /**
   * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer.
   *
   * @since 4.32
   */
  children?: ReadonlyArrayOrCollection<ListItemProperties>;
  /**
   * Allows you to display custom content for each ListItem
   * in the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html) widget.
   *
   * @since 4.29
   * @example
   * // displays content from the DOM in the LayerList
   * const tableList = new TableList({
   *   view: view,
   *   listItemCreatedFunction: (event) =>{
   *     const { item } = event;
   *     item.panel = {
   *       content: document.getElementById("myDiv"),
   *       icon: "graph-bar"
   *     };
   *   }
   * });
   */
  panel?: ListItemPanelProperties;
  /** The title of the table. */
  title?: string | null;
}

/**
 * In the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html)
 * widget UI, the ListItem represents a layer's table added to the widget. It provides access to the
 * associated properties and allows the developer to configure actions related to the table,
 * and allows the developer to add content to the item related to the table.
 *
 * @since 4.17
 * @see [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html)
 * @see [TableListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-TableListViewModel.html)
 */
export default abstract class ListItem extends ListItemSuperclass {
  /**
   * Indicates whether the actions panel is open in the TableList.
   *
   * @default false
   */
  accessor actionsOpen: boolean;
  /** A nested 2-dimensional collection of actions that could be triggered on the item. */
  get actionsSections(): Collection<Collection<Action>>;
  set actionsSections(value: ReadonlyArrayOrCollection<ReadonlyArrayOrCollection<((ActionButtonProperties & { type: "button" }) | (ActionToggleProperties & { type: "toggle" }))>>);
  /**
   * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer.
   *
   * @since 4.32
   */
  get children(): Collection<ListItem>;
  set children(value: ReadonlyArrayOrCollection<ListItemProperties>);
  /** The Error object returned if an error occurred. */
  get error(): EsriError | null | undefined;
  /**
   * When `true`, hides the layer from the TableList instance. This is an alternative to
   * [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode), which hides
   * a layer from all instances of TableList that include the layer.
   *
   * @default false
   * @since 4.24
   * @example listItem.hidden = true;
   */
  accessor hidden: boolean;
  /**
   * The layer associated with the triggered action. This must be a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)
   * whose [FeatureLayer#isTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#isTable) property returns `true`. For more information
   * regarding working with tables, please refer to [Map#tables](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#tables).
   *
   * @see [FeatureLayer#isTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#isTable)
   * @see [Map#tables](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#tables)
   */
  accessor layer: Layer | Sublayer | SubtypeSublayer | SubtypeGroupLayer;
  /**
   * Specifies whether to ignore the [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property of the child layers in the list item.
   * A common use case for `listModeDisabled` is when you want to use the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html) to manage and configure a layer's `listMode` value.
   *
   * @default false
   * @since 4.32
   * @see [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode)
   */
  accessor listModeDisabled: boolean;
  /**
   * Whether the layer is open in the TableList.
   *
   * @default false
   * @since 4.32
   */
  accessor open: boolean;
  /**
   * Allows you to display custom content for each ListItem
   * in the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html) widget.
   *
   * @since 4.29
   * @example
   * // displays content from the DOM in the LayerList
   * const tableList = new TableList({
   *   view: view,
   *   listItemCreatedFunction: (event) =>{
   *     const { item } = event;
   *     item.panel = {
   *       content: document.getElementById("myDiv"),
   *       icon: "graph-bar"
   *     };
   *   }
   * });
   */
  get panel(): ListItemPanel;
  set panel(value: ListItemPanelProperties);
  /**
   * The parent of this item
   *
   * @since 4.32
   */
  accessor parent: ListItem | null | undefined;
  /**
   * Value is `true` when the [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-ListItem.html#layer) is being published.
   * Value will be `false` if the [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-ListItem.html#layer) is not being published or
   * [TableListViewModel#checkPublishStatusEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-TableListViewModel.html#checkPublishStatusEnabled)
   * is `false`.
   *
   * @default false
   * @since 4.25
   */
  get publishing(): boolean;
  /** The title of the table. */
  get title(): string;
  set title(value: string | null | undefined);
  /**
   * Creates a deep clone of this object.
   *
   * @returns A clone of the new [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-ListItem.html) instance.
   */
  clone(): ListItem;
}
declare const ListItemSuperclass: typeof Accessor & typeof IdentifiableMixin