import type Accessor from "../core/Accessor.js"; import type Collection from "../core/Collection.js"; import type EsriError from "../core/Error.js"; import type ItemPanel from "./ItemPanel.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 LayerView from "../views/layers/LayerView.js"; import type { IdentifiableMixin } from "../core/Identifiable.js"; import type { Action, ConnectedLayerView, ItemContent, ItemModifier, ItemProperties, ItemVisibilityMode, SpatiallyReferencedLayerView, State, ItemPanelProperties } from "./types.js"; import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js"; import type { ActionToggleProperties } from "../support/actions/ActionToggle.js"; import type { ActionButtonProperties } from "../support/actions/ActionButton.js"; import type { ReadonlyArrayOrCollection } from "../core/Collection.js"; /** * Represents the state of one entry in a layer-list workflow. * * An item can represent a layer, a track-info part, or a video telemetry-display element. * It exposes associated layer and layer-view state, supports nested child items, and stores * action and panel state for consumer UIs. * * To hide a layer entry based on layer configuration, set [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode) * to `hide` on the corresponding layer. * * @beta * @since 5.2 * @see [ItemPanel](https://developers.arcgis.com/javascript/latest/references/core/layerList/ItemPanel/) */ export default class Item extends ItemSuperclass { constructor(properties?: ItemProperties); /** * Indicates whether the item's action sections are expanded in a consumer UI. * * @default false */ accessor actionsExpanded: boolean; /** Backward-compatible alias of [actionsExpanded](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#actionsExpanded). */ accessor actionsOpen: boolean; /** * A collection of action sections that can be triggered on the item. * Each section is rendered as a separate group by consumer UIs. */ get actionsSections(): Collection>; set actionsSections(value: ReadonlyArrayOrCollection>); /** * Enables publish-status checks used by [publishing](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#publishing). * When enabled, the item observes the associated layer's publishing status. * * @default false */ accessor checkPublishStatusEnabled: boolean; /** * The child items belonging to this item. * Children can represent nested layers, track-info parts, or telemetry-display elements. */ get children(): Collection; set children(value: ReadonlyArrayOrCollection); /** * Indicates whether the item's child layers can be sorted or moved within their parent collection. * This does not affect track-info or telemetry-display children. * * @default true * @example * // disables the children of a parent list item from being sorted * listItem.childrenSortable = false; */ accessor childrenSortable: boolean; /** * The connection status of the associated [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/) when its layer view exposes * [StreamLayerView.connectionStatus](https://developers.arcgis.com/javascript/latest/references/core/views/layers/StreamLayerView/#connectionStatus). This status takes precedence over * [updating](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#updating) for stream layers. */ get connectionStatus(): ConnectedLayerView["connectionStatus"] | null | undefined; /** Identifies the content represented by this item: a layer, a track-info part, or a telemetry-display element. */ accessor content: ItemContent; /** The error reported while loading the associated layer, if any. */ get error(): EsriError | null | undefined; /** * Indicates whether this item's details are expanded in a consumer UI. * * @default false */ accessor expanded: boolean; /** * Indicates whether consumer UIs should hide this item. * * This is an alternative to [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode), which hides a layer * based on layer configuration. * * @default false */ accessor hidden: boolean; /** * Indicates whether the associated layer view does not support the current view's spatial reference. * * @default false */ get incompatible(): boolean; /** The layer represented by this item. */ accessor layer: Layer | Sublayer | SubtypeSublayer | SubtypeGroupLayer | null; /** * The [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) displaying the associated [layer](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#layer), if available. * Subtype and sublayer items resolve to the layer view of their root layer where applicable. */ get layerView(): LayerView | SpatiallyReferencedLayerView | ConnectedLayerView | null | undefined; /** * A function called when the item is created. * Use the callback to customize supported item properties or add actions and panel state. * * @param event - The event containing the item being created. */ accessor listItemCreatedFunction: ItemModifier | null | undefined; /** * Indicates whether to ignore the [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode) property of child layers. * When `true`, child inclusion is controlled externally instead of by each child's `listMode` value. * * @default false * @see [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode) */ accessor listModeDisabled: boolean; /** Backward-compatible alias of [expanded](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#expanded). */ accessor open: boolean; /** * Additional panel state associated with this item. * The panel is stored as state and can be rendered by a separate consumer UI. */ get panel(): ItemPanel; set panel(value: ItemPanelProperties); /** The parent item, if this item is nested. */ accessor parent: Item | null | undefined; /** * Indicates whether [layer](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#layer) is being published. * The value is `false` when the layer is not publishing or * [checkPublishStatusEnabled](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#checkPublishStatusEnabled) is `false`. * * @default false */ get publishing(): boolean; /** * Indicates whether this item can be sorted or moved within its parent collection. * Items that represent track-info or telemetry-display content are not sortable. * * @default true * @example * // disables the list item from being sorted * listItem.sortable = false; */ accessor sortable: boolean; /** * The overall state of this item for consumer UIs. * Returns `disabled` when the item has no layer, is hidden, or is incompatible with the view; * `loading` while the layer or layer view is updating; and `ready` otherwise. */ get state(): State; /** * The title displayed for this item. * Layer items use the associated layer title, while display items use a consumer-defined title. */ get title(): string; set title(value: string | null | undefined); /** * Indicates whether the layer or its layer view is updating, for example while data is being fetched. * Publishing and stream connection status take precedence over the layer's updating state. * * @default false */ get updating(): boolean; /** The map or scene view that provides context for this item and its layer view. */ accessor view: MapViewOrSceneView | null | undefined; /** Specifies how visibility is managed for this item's child layers. */ get visibilityMode(): ItemVisibilityMode; /** * Indicates whether this item is visible. * For layer items, this controls the associated layer. For track-info and telemetry-display items, * it controls the represented display element. * * @default true */ accessor visible: boolean; /** * Indicates whether the associated layer is visible at the current view scale. * * @default true */ get visibleAtCurrentScale(): boolean; /** * Indicates whether the associated layer is visible at the current time extent. * * @default true */ get visibleAtCurrentTimeExtent(): boolean; /** * Creates a deep clone of this item, including its child items and action sections. * * @returns A clone of the new [Item](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/) instance. */ clone(): Item; /** * Sets or toggles the visibility of the represented content. * For layer items, this updates the associated layer. For track-info and telemetry-display items, * it updates the represented display element. * * If `value` is provided, visibility is set to that value. * Otherwise, visibility is inverted. * * @param value - Optional target visibility value. * @returns The resulting visibility value. */ toggleVisibility(value?: boolean): boolean; } declare const ItemSuperclass: typeof Accessor & typeof IdentifiableMixin