16 lines
603 B
TypeScript
16 lines
603 B
TypeScript
import { Type } from './type';
|
|
import { OutputOf, InputOf, FromFn, From } from './from';
|
|
declare type Any<A = any> = FromFn<A, any> | From<A, any>;
|
|
/**
|
|
* Take one of the types. Merge the metadata from left to right.
|
|
* If nothing matches, prints all the errors.
|
|
*/
|
|
export declare function union<T1 extends Any, T2s extends Any<InputOf<T1>>>(ts: [T1, ...T2s[]], { combineErrors, }?: {
|
|
/**
|
|
* Combine all the errors produced by the types.
|
|
* Defaults to joining them with a newline.
|
|
*/
|
|
combineErrors?(errors: string[]): string;
|
|
}): Type<InputOf<T1>, OutputOf<T1 | T2s>>;
|
|
export {};
|