import type FeatureItem from "./FeatureItem.js"; import type GroupLayerItem from "./GroupLayerItem.js"; import type ItemBase from "./ItemBase.js"; import type { ObjectId } from "../../../views/types.js"; import type { SelectableLayer, SelectionIdentifier } from "../../../views/selection/types.js"; import type { ItemBaseProperties } from "./ItemBase.js"; import type { SyncOptions } from "./types.js"; export interface LayerItemProperties extends ItemBaseProperties, Partial> { /** The companion [layer view](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) of the associated layer. */ layer?: SelectableLayer; } export type RequiredConstructProperties = Pick; /** * An item representing a layer with selected features in the [selection list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-selection-list/). It is used by the [selection list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-selection-list/) to group the layer's [FeatureItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/FeatureItem/) instances and manage their selection state. * * @since 5.2 */ export default class LayerItem extends ItemBase { constructor(properties: LayerItemProperties); /** Set of Object IDs for selected features. This includes filtered features. */ get effectiveObjectIds(): ObjectId[]; /** * The effective selection for this layer item, which is a subset of the full * selection based on the value of [maxVisibleFeatureCountPerLayer](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/#maxVisibleFeatureCountPerLayer). */ get effectiveSelection(): SelectionIdentifier[]; /** * Indicates whether the item is expanded in the [selection list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-selection-list/). * * @default true */ accessor expanded: boolean; /** * Set of items representing individual selected features. * This will only contain a maximum number of * features based on the value of [maxVisibleFeatureCountPerLayer](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/#maxVisibleFeatureCountPerLayer). */ accessor featureItems: FeatureItem[]; /** A reference to the parent [group layer item](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/GroupLayerItem/), if one exists. */ accessor groupLayerItem: GroupLayerItem | null | undefined; /** The companion [layer view](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) of the associated layer. */ get layer(): SelectableLayer; /** Indicates whether the maximum number of visible [feature items](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/FeatureItem/) has been exceeded. This is based on the value of [maxVisibleFeatureCountPerLayer](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/#maxVisibleFeatureCountPerLayer) and the current selection. */ get maxVisibleFeatureCountExceeded(): boolean; /** * Maximum number of selected features visible for each [layer item](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/). * This does not prevent selection or affect bulk actions on the selection set. */ get maxVisibleFeatureCountPerLayer(): number; /** Array of selected features represented by their object IDs. */ get objectIds(): ObjectId[]; /** Array of selected features. */ get selection(): SelectionIdentifier[]; /** * Count representing the number of selected features. This value includes features hidden by * local filters, but are still selected according to the associated [selection manager](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/). */ get total(): number; /** Indicates whether this item is visible in the list, due to one or more child items being visible. */ get visible(): boolean; /** Total number of visible features accounting for any filters and [maxVisibleFeatureCountPerLayer](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/#maxVisibleFeatureCountPerLayer). */ get visibleTotal(): number; /** * Cancels any active operation. * * @internal */ cancel(): void; /** * Empties current feature item cache. * * @internal */ reset(): void; /** * Method used to load or resync relevant item data. * * @param options - Options used to control the sync operation. * @returns Promise resolving when the sync operation is complete. * @internal */ sync(options: SyncOptions): Promise; /** * Method used to fetch up-to-date titles for all feature items. * Syncs titles for all feature items if no parameter is provided. * * @param items - Optional array of feature items to sync titles for. If not provided, all feature items will be synced. * @returns Promise resolving when the title sync operation is complete. * @internal */ syncTitles(items?: FeatureItem[]): Promise; }