@steveesamson/microform
Version:
`microform` is a tiny library for managing forms in `svelte/sveltekit`.
17 lines (16 loc) • 507 B
TypeScript
import type { FormValues, FormErrors, FormSanity } from "./types.js";
export type Params<T = any> = {
[key: string | number | symbol]: T;
};
export type Primitive = string | number | boolean | string[] | number[] | boolean[];
export type FormState = {
values: FormValues;
errors: FormErrors;
sanity: FormSanity;
unfits: FormErrors;
};
export type FormStore = FormState & {
validationMap: Params;
reset: () => void;
};
export declare const formStore: (data: Params) => FormStore;