import { type SetStateAction } from 'react'; /** Options for {@link useControllableState}. @public */ export interface UseControllableStateOptions { /** Controlled value. Presence on the first render enables controlled mode. */ readonly value?: T; /** Initial value or lazy initializer for uncontrolled mode. */ readonly defaultValue?: T | (() => T); /** Called when the stable setter resolves to a changed value. */ readonly onChange?: (value: T) => void; } /** @public */ export type UseControllableStateResult = readonly [ value: T, setValue: (next: SetStateAction) => void ]; /** * Controlled/uncontrolled state primitive. The setter remains referentially * stable and invokes onChange for both controlled and uncontrolled updates. * The ownership mode is fixed on the first render. * * @param options - Controlled value, uncontrolled default, and change handler. * @returns The current value and a stable setter. * @public */ export declare function useControllableState(options: UseControllableStateOptions & { readonly defaultValue: T | (() => T); }): UseControllableStateResult; /** @public */ export declare function useControllableState(options?: UseControllableStateOptions): UseControllableStateResult;