import { NamePath } from "../types.js"; import { FormInstance } from "../Form.js"; import { InjectionKey, ShallowRef } from "vue"; //#region src/form/hooks/useForm.d.ts declare function toNamePathStr(name: NamePath): string; interface FormHookEntry { name?: string; instanceRef: ShallowRef; /** Current owner of this entry: a Form component uid, or 'explicit' for template ref binding */ boundBy?: number | 'explicit'; } interface FormHookRegistry { entries: FormHookEntry[]; } declare const FormHookRegistryKey: InjectionKey; declare const FormInstanceContextKey: InjectionKey; type FormHookInstance = FormInstance & ((instance: any) => void); /** * Create a form instance proxy before the Form component mounts. * * Binding (priority order): * 1. Explicit: pass it as a template ref — `
`. * 2. By name: `useForm('login')` connects to ``. * 3. Single/ordered fallback: unnamed instances connect to descendant Forms in declaration order. */ declare function useForm(name?: string): FormHookInstance; /** * Get the closest Form instance from context. Only usable inside a Form. */ declare function useFormInstance(): FormInstance; //#endregion export { FormHookEntry, FormHookInstance, FormHookRegistry, FormHookRegistryKey, FormInstanceContextKey, toNamePathStr, useForm, useFormInstance };