export interface OnChangeContext { isControlled: boolean; isInitial: boolean; } export interface ControllableStateOptions { onChange?: (newState: T, context?: OnChangeContext) => T | undefined; } /** * The goal of this hook is to seemlessly support "controlled" and "uncontrolled" component behaviors. * This is achieved by abstracting the state and updating a state value only when a prop is considered "uncontrolled". */ export declare function useControllableState(controlledValue: T | undefined, initialValue: T | undefined, defaultValue: T | undefined, { onChange }?: ControllableStateOptions): [T, (maybeState: T) => void, boolean];