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.

24 lines (23 loc) 882 B
import type { FormErrorConfig, SchemaErrorConfig } from "../typing/utils/errors.js"; export declare class FormError extends Error { title: FormErrorConfig["title"]; reason: FormErrorConfig["reason"]; message: FormErrorConfig["message"]; date: Date; constructor({ title, message, reason, }: FormErrorConfig, ...params: (string | undefined)[]); } export declare class SchemaError extends Error { title: string; field: SchemaErrorConfig["field"]; reason: SchemaErrorConfig["reason"]; schema: SchemaErrorConfig["schema"]; value: SchemaErrorConfig["value"]; date: Date; constructor(config: SchemaErrorConfig, ...params: (string | undefined)[]); } export declare class SchemaErrorList extends Error { title: string; errors: SchemaError[]; date: Date; constructor(errors: SchemaError[], ...params: (string | undefined)[]); }