/** * Whether two values are indistinguishable to a consumer, so no event is owed: `Object.is` for scalars, element-wise for the string arrays a selection carries. * * @param a the value now * @param b the value proposed */ export declare function sameControlledValue(a: unknown, b: unknown): boolean; /** What the adapter currently holds on both sides of the controlled/uncontrolled split. */ export interface ControllableState { /** The consumer's controlled value; `undefined` means the control owns its own value. */ controlled: T | undefined; /** The value the adapter holds while uncontrolled; ignored once `controlled` is defined. */ uncontrolled: T | undefined; } /** What the adapter should do about a proposed change. */ export interface ControllableDecision { /** The value in force after this decision — the proposal, or the current value when nothing changed. */ value: T | undefined; /** Whether the adapter writes its own state; always `false` while controlled, since the consumer owns the value. */ write: boolean; /** Whether the change event fires; only on an actual change, in both modes. */ emit: boolean; } /** The value in force: the controlled one when there is one, the adapter's own otherwise. */ export declare function controllableValue({ controlled, uncontrolled, }: ControllableState): T | undefined; /** Whether the consumer owns the value, which is exactly "a controlled value was supplied". */ export declare function isControlled({ controlled }: ControllableState): boolean; /** * The decision for one proposed change. * * @param state what the adapter holds on both sides * @param next the proposed value * @returns the value in force, whether to write it, and whether to emit */ export declare function decideControllable(state: ControllableState, next: T | undefined): ControllableDecision; /** * The decision for a form reset, which restores `defaultValue` as it reads *now* — a consumer that changed the prop after mount expects the new default back, not the one the control was born with. * * @param state what the adapter holds on both sides * @param liveDefault the `defaultValue` prop read at reset time */ export declare function decideReset(state: ControllableState, liveDefault: T | undefined): ControllableDecision;