UNPKG

@vtaits/form-schema

Version:

Serialization and parsing form values by schema

23 lines (20 loc) 804 B
import { F as FieldSchemaBase } from './types-DafXrhi5.js'; type ErrorMessages = { invalidNumber: string; required: string; minLength: (value: number) => string; minLengthStr: (value: number) => string; minLengthFile: (value: number) => string; maxLength: (value: number) => string; maxLengthStr: (value: number) => string; maxLengthFile: (value: number) => string; regexp: (regexp: string) => string; }; type OnChange<FormApi, Value> = (form: FormApi, nextValue: Value, prevValue: Value) => void; type BaseFieldSchema<FormApi, Value> = FieldSchemaBase & { disabled?: boolean; required?: boolean; errorMessages?: Partial<ErrorMessages>; onChange?: OnChange<FormApi, Value>; }; export type { BaseFieldSchema as B, ErrorMessages as E, OnChange as O };