import type { ComputedRef, Ref } from 'vue'; import type eponymeConfig from '#eponyme/config'; import type { EponymeFormDataByName, EponymeFormFieldDefinition, EponymeFormName } from '../types/index.js'; import type { ValidationErrors } from '../utils/validate-eponyme-data.js'; type ConfigFormName = EponymeFormName; export interface UseEponymeFormField { name: string; definition: EponymeFormFieldDefinition; label: string; required: boolean; value: unknown; errors: string[]; update: (value: unknown) => void; } export interface UseEponymeFormOptions> { /** Required for a `custom` form: receives the validated data. */ onSubmit?: (data: Data) => unknown | Promise; } export interface UseEponymeFormResult> { fields: ComputedRef; values: Ref; errors: ComputedRef; pending: Ref; submitted: Ref; /** Name of the trap field to render hidden, or `false` when disabled. */ honeypot: string | false; submit: () => Promise; reset: () => void; } /** * Renders nothing: the host application owns the markup, so a public page never inherits the dashboard's * styling or its editor dependencies. */ export declare function useEponymeForm(name: Name, options?: UseEponymeFormOptions>): UseEponymeFormResult>; export {};