import type Graphic from "../../../Graphic.js"; import type ItemBase from "./ItemBase.js"; import type LayerItem from "./LayerItem.js"; import type { Icon } from "@esri/calcite-components/components/calcite-icon"; import type { ObjectId } from "../../../views/types.js"; import type { SelectableLayer, SelectionIdentifier } from "../../../views/selection/types.js"; import type { ItemBaseProperties } from "./ItemBase.js"; /** Properties used to construct a FeatureItem instance. */ export interface FeatureItemProperties extends ItemBaseProperties, Partial> { /** Reference to the feature this item represents. */ graphic?: Graphic; } /** Required properties used to construct a FeatureItem instance. */ export type RequiredConstructProperties = Pick; /** * An item representing a feature in the [selection list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-selection-list/). * * @since 5.2 */ export default class FeatureItem extends ItemBase { constructor(properties: FeatureItemProperties); /** Reference to the feature this item represents. */ get graphic(): Graphic; /** * Icon used to represent the item. * * @internal */ get iconName(): Icon["icon"]; /** Identifier for the feature represented by this item. It uses the feature's object ID when available. Otherwise, it uses the feature's graphic. */ get identifier(): SelectionIdentifier; /** * Unique identifier used for this item. * It combines the layer ID with the object ID or graphic UID to create a unique key for this feature item. */ get key(): string; /** Layer associated with the item. */ get layer(): SelectableLayer; /** Reference to the [layer item](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/) containing this feature item. */ get layerItem(): LayerItem; /** * Reference to the object ID for the associated feature. * This value may be null or undefined when viewing selections from layers that do not support object IDs. * In that case, [identifier](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/FeatureItem/#identifier) is typically used to track the selection. */ get objectId(): ObjectId | null | undefined; /** * Indicates if the feature item supports generating a thumbnail preview. * In cases where thumbnails are not supported, a generic icon is used instead. * * @internal */ get supportsThumbnail(): boolean; /** * Reference to the thumbnail element icon used to represent this feature. * * @internal */ get thumbnail(): HTMLElement | null | undefined; /** * Unique identifier for a thumbnail representing the feature. * It combines the feature item's key with the graphic UID to create a unique identifier. * It is used by the list to request a new thumbnail when the `graphic` property changes * to a newer version of the feature. This is usually after the associated layer has been * edited. * * @internal */ get thumbnailKey(): string; /** * Max size of the thumbnail in pixels. * * @default 24 * @internal */ accessor thumbnailSize: number; /** * The display name for the feature within the [selection list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-selection-list/). * If no title is available, the object ID is used as a fallback. * If neither a title nor an object ID is available, it will display 'Untitled feature'. */ get title(): string | null | undefined; /** Indicates whether the list item is visible. */ get visible(): boolean; /** * Method used to lazily load the associated feature thumbnail. * * @param options - Optional parameters for fetching the thumbnail. * @returns Promise resolving to the thumbnail element or null if no thumbnail could be generated. * @internal */ fetchThumbnail(options?: { ariaLabel?: string; }): Promise; }