import { Collection, Key, Node, CollectionStateBase, DisabledBehavior, Expandable, MultipleSelection } from "@react-types/shared"; import { SelectionManager } from "@react-stately/selection"; export class TreeCollection implements Collection> { constructor(nodes: Iterable>, { expandedKeys }?: { expandedKeys?: Set; }); [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; } export interface TreeProps extends CollectionStateBase, Expandable, MultipleSelection { /** Whether `disabledKeys` applies to all interactions, or only selection. */ disabledBehavior?: DisabledBehavior; } export interface TreeState { /** A collection of items in the tree. */ readonly collection: Collection>; /** A set of keys for items that are disabled. */ readonly disabledKeys: Set; /** A set of keys for items that are expanded. */ readonly expandedKeys: Set; /** Toggles the expanded state for an item by its key. */ toggleKey(key: Key): void; /** Replaces the set of expanded keys. */ setExpandedKeys(keys: Set): void; /** A selection manager to read and update multiple selection state. */ readonly selectionManager: SelectionManager; } /** * Provides state management for tree-like components. Handles building a collection * of items from props, item expanded state, and manages multiple selection state. */ export function useTreeState(props: TreeProps): TreeState; //# sourceMappingURL=types.d.ts.map