import type { Ref } from 'vue'; import type { KottiField } from '../kotti-field/types'; export declare namespace KottiForm { interface Context { fieldInheritableProps: Ref; formPath: Ref>; onAddField: (toAdd: KottiField.Hook.Returns) => void; onRemoveField: (toRemove: KottiField.Hook.Returns) => void; setValue: (formKey: T, newValue: CONTEXT_TYPE[T]) => void; validators: Ref>; values: Ref; } interface SubmitContext { isLoading: Ref; isValid: Ref; validationSummary: Ref; } type ContextType = Record; type Props = KottiField.InheritablePropsInternal & { /** * Form Identifier * defaults to sequential identifier * can otherwise be provided * current use-case: for computed dataTest prop * can be useful otherwise */ formId: string; modelValue: ContextType; /** * @default warning * error: prevent if errors.length > 0 * warning: prevent if [...errors, ...warnings].length > 0 * NEVER: allow submission, regardless of validation status */ preventSubmissionOn: 'error' | 'NEVER' | 'warning'; validators: Record; }; interface AdditionalContext { } interface ValidationSummary { errors: Array; successes: Array; warnings: Array; } namespace Events { interface Submit { validationSummary: KottiForm.ValidationSummary; values: CONTEXT_TYPE; } } }