import { Collection, Key, Node, CollectionStateBase, LayoutDelegate, SingleSelection } from "@react-types/shared"; import { MultipleSelectionStateProps, SelectionManager } from "@react-stately/selection"; export class ListCollection implements Collection> { constructor(nodes: Iterable>); [Symbol.iterator](): Generator, void, undefined>; get size(): number; getKeys(): IterableIterator; getKeyBefore(key: Key): Key | null; getKeyAfter(key: Key): Key | null; getFirstKey(): Key | null; getLastKey(): Key | null; getItem(key: Key): Node | null; at(idx: number): Node | null; getChildren(key: Key): Iterable>; } export interface ListProps extends CollectionStateBase, MultipleSelectionStateProps { /** Filter function to generate a filtered list of nodes. */ filter?: (nodes: Iterable>) => Iterable>; /** @private */ suppressTextValueWarning?: boolean; /** * A delegate object that provides layout information for items in the collection. * This can be used to override the behavior of shift selection. */ layoutDelegate?: LayoutDelegate; } export interface ListState { /** A collection of items in the list. */ collection: Collection>; /** A set of items that are disabled. */ disabledKeys: Set; /** A selection manager to read and update multiple selection state. */ selectionManager: SelectionManager; } /** * Provides state management for list-like components. Handles building a collection * of items from props, and manages multiple selection state. */ export function useListState(props: ListProps): ListState; export interface SingleSelectListProps extends CollectionStateBase, Omit { /** Filter function to generate a filtered list of nodes. */ filter?: (nodes: Iterable>) => Iterable>; /** @private */ suppressTextValueWarning?: boolean; } export interface SingleSelectListState extends ListState { /** The key for the currently selected item. */ readonly selectedKey: Key | null; /** Sets the selected key. */ setSelectedKey(key: Key | null): void; /** The value of the currently selected item. */ readonly selectedItem: Node | null; } /** * Provides state management for list-like components with single selection. * Handles building a collection of items from props, and manages selection state. */ export function useSingleSelectListState(props: SingleSelectListProps): SingleSelectListState; //# sourceMappingURL=types.d.ts.map