import { StateTuple } from '../../core.js'; /** Whether `value` represents controlled mode (not `undefined`). */ declare function isControlled(value: T | undefined): value is T; /** Resolve the effective value and controlled-ness for a controllable prop. */ declare function resolveControllable( value: T | undefined, defaultValue: T ): { value: T; isControlled: boolean; }; /** * Build a `set` function that calls `onChange` in controlled mode, or * updates internal state and then calls `onChange` in uncontrolled mode. */ declare function makeControllable(options: { value: T | undefined; defaultValue: T; onChange?: (next: T) => void; setInternal?: (next: T) => void; }): { set: (next: T) => void; isControlled: boolean; }; /** A {@link StateTuple} accessor that also reports whether it is controlled. */ type ControllableState = StateTuple & { isControlled: boolean; }; /** * controllableState * * Hook-like primitive that mirrors `state()` semantics while supporting * controlled/uncontrolled behavior. */ declare function controllableState(options: { value: T | undefined; defaultValue: T; onChange?: (next: T) => void; }): ControllableState; export { type ControllableState, controllableState };