import type { UseSafeStateOptions } from "../use-safe-state/index.cjs"; export interface UseControlledComponentOptions extends UseSafeStateOptions { /** * The callback that is called when the value of the controlled component changes */ onChange?: (value: T, preValue?: T) => void; /** * The callback that is called when the value of the controlled component is reset */ onReset?: (initialValue: T) => void; /** * The props of the controlled component */ props?: P | ((value: T) => P); /** * The fallback value of the controlled component */ fallbackValue?: T; } export interface ControlledComponentProps { /** * The value of the controlled component */ value: T; /** * The callback that is called when the value of the controlled component changes */ onChange: (eventOrValue?: T | { target: { value: T; }; }) => void; } export interface UseControlledComponentReturns { /** * The value of the controlled component */ value: T; /** * The props that should be passed to the controlled component */ props: ControlledComponentProps & P; /** * Reset the value of the controlled component to the initial value */ reset(): void; /** * Set the value of the controlled component */ setValue: (value: T) => void; } /** * A React Hook that helps you to manage controlled components that receive `value` and `onChange` props meeting the following type. */ export declare function useControlledComponent(initialValue?: T, options?: UseControlledComponentOptions): UseControlledComponentReturns;