import * as React from 'react'; interface UseControllableStateParams { /** The controlled value. When defined, the hook is controlled and only ever reflects this prop. */ prop?: T | undefined; /** Initial value for uncontrolled usage; ignored once `prop` is defined. */ defaultProp?: T | undefined; /** Called with the next value whenever it changes, in both controlled and uncontrolled modes. */ onChange?: ((state: T) => void) | undefined; } /** * Controlled/uncontrolled pattern that behaves like `useState` when `prop` is undefined, mirroring it once defined with `setValue` calling `onChange` instead. * * @returns `[value, setValue]` tuple like `useState`. * @example * ```tsx * function MyCheckbox({ checked: checkedProp, defaultChecked, onCheckedChange }: Props) { * const [checked, setChecked] = useControllableState({ * prop: checkedProp, * defaultProp: defaultChecked, * onChange: onCheckedChange, * }); * } * ``` * * @internal Not part of the public API; import it inside the package only. */ export declare function useControllableState({ prop, defaultProp, onChange, }: UseControllableStateParams): readonly [ T | undefined, React.Dispatch> ]; export {};