import { CreateStatePersistentConfigInterface, EnhancedState, StateKey, StateRuntimeJobConfigInterface } from '../../state'; import type { Collection, DefaultItem } from '../collection'; import type { SelectorKey } from '../selector'; export declare class Item extends EnhancedState { collection: () => Collection; static updateGroupSideEffectKey: string; selectedBy: Set; /** * An extension of the State Class that represents a single data object of a Collection. * * It can be used independently, but is always synchronized with the Collection. * * @public * @param collection - Collection to which the Item belongs. * @param data - Data object to be represented by the Item. * @param config - Configuration object */ constructor(collection: Collection, data: DataType, config?: ItemConfigInterface); /** * Updates the key/name identifier of Item. * * @internal * @param value - New key/name identifier. * @param config - Configuration object */ setKey(value: StateKey | undefined, config?: StateRuntimeJobConfigInterface): this; /** * Preserves the Item `value` in the corresponding external Storage. * * The Item key/name is used as the unique identifier for the Persistent. * If that is not desired or the Item has no unique identifier, * please specify a separate unique identifier for the Persistent. * * [Learn more..](https://agile-ts.org/docs/core/state/methods/#persist) * * @public * @param config - Configuration object */ persist(config?: ItemPersistConfigInterface): this; /** * Adds side effect to Item * that rebuilds all Groups containing the specified Item identifier * whenever the Item changes. * * @internal * @param itemKey - Item identifier that has to be contained in Groups. */ addRebuildGroupThatIncludeItemKeySideEffect(itemKey: StateKey): void; } export interface ItemConfigInterface { /** * Whether the Item should be a placeholder * and therefore should only exist in the background. * @default false */ isPlaceholder?: boolean; } export interface ItemPersistConfigInterface extends CreateStatePersistentConfigInterface { /** * Whether to format the specified Storage key following the Collection Item Storage key pattern. * `_${collectionKey}_item_${itemKey}` * @default true */ followCollectionPersistKeyPattern?: boolean; }