import * as React from 'react'; export interface UseFieldControlRegistrationParameters { /** * The control's value at mount. `dirty` is whether the current value still * equals this one. */ initialValue?: unknown; /** * Whether a value counts as filled. Defaults to "not null, empty, or false". */ isFilled?: ((value: unknown) => boolean) | undefined; /** * Something with a `focus()` method, so a surrounding `Form` can put the user * in front of this control when submission stops here. Most of these controls * are `Pressable`s with nothing to focus, and leave it out. */ focusRef?: React.RefObject<{ focus?: () => void; } | null> | undefined; /** * Whether this is the call that owns the control's value, and so the one a * surrounding `Form` should revalidate and focus on submit. * * A component often calls this hook twice: once where the value lives (the * root) and once where the element is, only for the accessibility props (the * trigger, the thumb, the input). Only the first may register — otherwise the * form validates the control twice, the second time against a value that call * does not have. * * @default false */ ownsValue?: boolean | undefined; } /** * Wires a non-text form control (Checkbox, Switch, RadioGroup, NumberField, * Slider, Select, OTPField) into a surrounding `Field.Root`, when there is one. * * A field-aware control: * - is labelled by `Field.Label` and described by `Field.Description`/`Error` * (through `accessibilityLabelledBy`/`accessibilityDescribedBy`); * - inherits the field's (and its fieldset's) `disabled`; * - runs the field's `validate` when its value changes; * - reports `dirty`/`filled`/`touched`/`focused` back to the field, which is * what `Field.Validity` and `Field.Error` branch on. * * Outside a `Field.Root` everything is `undefined`/no-op, so a standalone * control is unaffected. */ export declare function useFieldControlRegistration(parameters?: UseFieldControlRegistrationParameters): { /** * `true` when a surrounding field (or fieldset) is disabled. */ fieldDisabled: boolean; /** * Accessibility props associating the control with the field's label and * messages, and reporting its validity. Spread into the control's props * before `elementProps`. */ fieldProps: { accessibilityLabelledBy: string | undefined; accessibilityDescribedBy: string | undefined; 'aria-labelledby': string | undefined; 'aria-describedby': string | undefined; 'aria-invalid': true | undefined; }; /** * Runs the field's validation for a new control value, regardless of * `validationMode`. No-op without a field. */ validateField: (value: unknown) => void; markChanged: (value: unknown) => void; markTouched: (value: unknown) => void; markFocused: (focused: boolean) => void; /** * Whether a surrounding field is present at all. */ hasField: boolean; }; //# sourceMappingURL=useFieldControlRegistration.d.ts.map