import type { InjectionKey, Ref, ComputedRef } from 'vue'; import type { UseEventBusReturn } from '@vueuse/core'; import type { FormFieldProps } from '../components/FormField.vue'; import type { FormErrorWithId, FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form'; import type { GetObjectField } from '../types/utils'; type Props = { id?: string; name?: string; size?: GetObjectField; color?: GetObjectField; highlight?: boolean; disabled?: boolean; }; export declare const formOptionsInjectionKey: InjectionKey>; export declare const formBusInjectionKey: InjectionKey, string>>; export declare const formStateInjectionKey: InjectionKey | undefined>>; export declare const formFieldInjectionKey: InjectionKey> | undefined>; export declare const inputIdInjectionKey: InjectionKey>; export declare const formInputsInjectionKey: InjectionKey>>; export declare const formLoadingInjectionKey: InjectionKey>>; export declare const formErrorsInjectionKey: InjectionKey>>; /** * Wires an input to its wrapping `` (id/name/aria, validation events, error-driven color). * * **Always pass the raw `_props`, never the `useComponentProps` proxy.** * The internal fallback `props?.x ?? formField?.value.x` must distinguish * "explicit prop" from "theme default" — passing the proxy would leak * `` defaults into the explicit slot and let theme size/color * silently override the wrapping field (regression-tested in `Theme.spec.ts`). * * To get `` to apply when no `` wraps the input, * fall back to the proxy at the `tv()` call site: * * ```ts * size: size.value ?? props.size, * color: color.value ?? props.color, * highlight: highlight.value ?? props.highlight, * disabled: disabled.value ?? props.disabled * ``` * * `highlight` and `disabled` are Boolean props, which Vue auto-casts to `false` * when unset, so they are normalized back to `undefined` here. Otherwise the * `??` above would short-circuit on `false` and the proxy would never be read. * * Final precedence: `explicit > FormField > > app.config > withDefaults > tv defaults`, * matching what `useComponentProps` resolves. * * `bitrix24-ui/no-unresolved-form-field-refs` (see `eslint.config.mjs`) enforces * the fallback at every read site, in script and in template — in a template a * ref auto-unwraps, so an unresolved binding is indistinguishable from a * resolved one by eye. */ export declare function useFormField(props?: Props, opts?: { bind?: boolean; deferInputValidation?: boolean; }): { id: ComputedRef; name: ComputedRef; size: ComputedRef<"xs" | "sm" | "md" | "lg" | NonNullable> | undefined>; color: ComputedRef<"air-primary-alert" | GetObjectField | undefined>; highlight: ComputedRef; disabled: ComputedRef; emitFormBlur: () => void; emitFormInput: import("@vueuse/shared").UseDebounceFnReturn<() => void>; emitFormChange: () => void; emitFormFocus: () => void; ariaAttrs: ComputedRef | undefined>; }; export {};