UNPKG

@rbxts/rotype

Version:

Advanced runtime type checking library

10 lines (9 loc) 632 B
import type { InferInput, InferOutput, Schema } from "../schema"; export declare function Array<T extends Schema<any, any>>(item: T): Schema<Array<InferInput<T>>, Array<InferOutput<T>>>; export declare function Tuple<T extends Schema<any, any>[]>(...items: T): Schema<{ [K in keyof T]: InferInput<T[K]>; }, { [K in keyof T]: InferOutput<T[K]>; }>; export declare function Union<T extends readonly Schema<any, any>[]>(...members: T): Schema<InferInput<T[number]>, InferOutput<T[number]>>; export declare function Optional<S extends Schema<any, any>>(schema: S): Schema<InferInput<S> | undefined, InferOutput<S> | undefined>;