export declare const STATE_CONTEXT_KEY: unique symbol; /** @inline */ export type NodeState = { collapsed: boolean; }; /** @inline */ export type CollapseState = Record; export declare function createState(init: CollapseState, onChange?: (value: CollapseState) => void): { value: CollapseState; setCollapse: (keyOrPath: string | PropertyKey[], newValues: NodeState) => void; setCollapseStartsWith: (keyOrPath: string | PropertyKey[], newValues: NodeState) => void; setCollapseWhere: (test: (path: string) => boolean, newValues: NodeState) => void; getCollapse(keyOrPath: string | PropertyKey[]): NodeState; collapseChildren: (level: number, path: PropertyKey[]) => void; expandChildren: (currentLevel: number, currentPath: string | PropertyKey[]) => void; }; export type StateContext = ReturnType; export declare function useState(): StateContext;