import { PropsWithKnownKeys, State } from 'vanjs-core'; import { ObjectSchema } from 'yup'; type KeyOf = keyof T; type Validator = (values: T) => Promise>>; type FieldProps> = Pick & { value?: State; checked?: State; }; declare class Form> { private readonly initialValues; private readonly fields; private readonly validator; private readonly validationMode; constructor(args: { initialValues: T; validator?: Validator; validationMode?: "oninput" | "onsubmit"; }); register>(name: K, additionalProps?: PropsWithKnownKeys>): FieldProps & typeof additionalProps; get>(name: K): T[typeof name]; set>(name: K, value: T[typeof name]): void; error>(name: K): string; watch>(...names: K[]): typeof names extends K[] ? State<{ [I in (typeof names)[number]]: T[I]; }> : State; errors>(...names: K[]): typeof names extends K[] ? State<{ [I in (typeof names)[number]]: string; }> : State, string>>; reset(...names: K[]): void; handleSubmit(handler: (values: T) => void): (e: SubmitEvent) => void; private validateField; } declare class FormError> { errors: Record, string>; constructor(errors: Record, string>); } declare const yupValidator: >(schema: ObjectSchema) => Validator; export { Form, yupValidator };