import { SelectionMode } from '@zag-js/collection'; import { CollectionItem, ListCollection } from './list-collection'; export interface UseListSelectionProps { /** * The selection mode. */ selectionMode?: SelectionMode; /** * Whether the selection is deselectable. */ deselectable?: boolean; /** * The initial selected values. */ initialSelectedValues?: string[]; /** * Whether to reset the selection when the collection changes. */ resetOnCollectionChange?: boolean; /** * The collection to use. */ collection: ListCollection; } export declare function useListSelection(props: UseListSelectionProps): UseListSelectionReturn; export interface UseListSelectionReturn { /** * The selected values as an array. */ selectedValues: string[]; /** * Whether the selection is empty. */ isEmpty: boolean; /** * The first selected value. */ firstSelectedValue: string | null; /** * The last selected value. */ lastSelectedValue: string | null; /** * Check if a value is selected. */ isSelected: (value: string | null) => boolean; /** * Check if a value can be selected. */ canSelect: (value: string) => boolean; /** * Select a value. */ select: (value: string, forceToggle?: boolean) => void; /** * Deselect a value. */ deselect: (value: string) => void; /** * Toggle selection of a value. */ toggle: (value: string) => void; /** * Replace the selection with a single value. */ replace: (value: string | null) => void; /** * Extend the selection from anchor to target. */ extend: (anchorValue: string, targetValue: string) => void; /** * Set the selected values. */ setSelectedValues: (values: string[]) => void; /** * Clear the selection. */ clear: () => void; /** * Clear all selections. */ resetSelection: () => void; /** * Returns true if all items from the collection are selected. */ isAllSelected: () => boolean; /** * Returns true if at least one item from the collection is selected. */ isSomeSelected: () => boolean; }