UNPKG

@sinclair/typebox

Version:

Json Schema Type Builder with Static Type Resolution for TypeScript

7 lines (6 loc) 407 B
import type { TSchema, SchemaOptions } from '../schema/index.mjs'; import { type TNever } from '../never/index.mjs'; import type { TUnion } from './union-type.mjs'; export type Union<T extends TSchema[]> = (T extends [] ? TNever : T extends [TSchema] ? T[0] : TUnion<T>); /** `[Json]` Creates a Union type */ export declare function Union<T extends TSchema[]>(T: [...T], options?: SchemaOptions): Union<T>;