UNPKG

@backland/schema

Version:

TypeScript schema declaration and validation library with static type inference

11 lines (10 loc) 626 B
export declare const FieldTypeErrorCodes: ["minSize", "maxSize", "regexMismatch", "sizeMismatch", "unexpected", "unexpectedType", "custom", "invalidPhone", "requiredField"]; export type FieldTypeErrorCode = typeof FieldTypeErrorCodes[number]; export declare class FieldTypeError extends Error { __isFieldTypeError: boolean; code: FieldTypeErrorCode; static is: typeof isFieldError; constructor(code: FieldTypeErrorCode, details?: any); } export declare function createFieldTypeError(code: FieldTypeErrorCode, details?: any): FieldTypeError; export declare function isFieldError(el: any): el is FieldTypeError;