interface UseControllableStateParams { /** Controlled value. When defined, the component is controlled. */ value?: T; /** Initial value for uncontrolled mode. */ defaultValue: T; /** Called on every state change (controlled and uncontrolled). */ onChange?: (value: T) => void; } /** * Manages the controlled / uncontrolled duality for any component prop. * Mirrors the pattern used by Radix, Headless UI, and React Aria. * * @example * // Uncontrolled — works out of the box: * * * // Controlled — consumer owns the state: * const [value, setValue] = useState('item-1'); * * * // Inside the component: * function Accordion({ value, defaultValue = '', onChange }: Props) { * const [state, setState] = useControllableState({ * value, defaultValue, onChange, * }); * // `state` is always current; `setState` handles both modes. * } */ export declare function useControllableState({ value, defaultValue, onChange, }: UseControllableStateParams): readonly [T, (next: T | ((prev: T) => T)) => void]; /** * Returns a stable callback ref that always calls the latest handler. * Avoids stale-closure issues in effects that depend on callback identity. * * @example * const handleResize = useCallbackRef((entry: ResizeObserverEntry) => { * // always has fresh closure over props/state * }); */ export declare function useCallbackRef unknown>(callback: T | undefined): T; export {};