UNPKG

@backland/schema

Version:

TypeScript schema declaration and validation library with static type inference

12 lines (11 loc) 443 B
import { FieldType, FieldTypeParser } from './FieldType'; export type StringFieldDef = { max?: number; min?: number; regex?: [string] | [string, string] | Readonly<[string, string] | [string]>; }; export declare class StringField extends FieldType<string, 'string', StringFieldDef | undefined> { parse: FieldTypeParser<string>; constructor(def?: StringFieldDef); static create: (def?: StringFieldDef) => StringField; }