UNPKG

@backland/schema

Version:

TypeScript schema declaration and validation library with static type inference

13 lines (12 loc) 652 B
import { Infer } from '../Infer'; import type { FieldDefinitionConfig } from '../TObjectConfig'; import { FieldType, FieldTypeParser, TAnyFieldType } from './FieldType'; export declare class UnionField<U extends FieldDefinitionConfig, T extends Readonly<[U, ...U[]]>> extends FieldType<Infer<T[number]>, 'union', T> { parse: FieldTypeParser<Infer<T[number]>>; utils: { fieldTypes: TAnyFieldType[]; }; static is(item: any): item is UnionField<any, any>; constructor(def: T); static create: <U_1 extends import("./_parseFields").ObjectFieldInput, T_1 extends readonly [U_1, ...U_1[]]>(def: T_1) => UnionField<U_1, T_1>; }