UNPKG

@tuentyfaiv/svelte-form

Version:

A form library for Svelte. It is built on top of Svelte and Typescript. Inspired by Formik and React Hook Form.

17 lines (16 loc) 451 B
import type { ArraySchema, FieldPropSchema, FieldsSchema, Schema } from "../stores/form.js"; export type Errors<T> = { [key in keyof T]: string | null; }; export interface FormErrorConfig { title?: string; message: string; reason: string; } export interface SchemaErrorConfig { field: string; reason: string; message: string; schema: FieldPropSchema<Schema> | FieldsSchema | ArraySchema | Schema; value: unknown; }