UNPKG

@typed/io

Version:

Runtime IO type system

12 lines 939 B
import { Flatten, UnNest } from '@typed/common'; import * as D from '../decoder'; import * as E from '../encoder'; import { Any, Type } from './Type'; export interface IntersectionType<A extends ReadonlyArray<Any>> extends Type<UnNest<Flatten<DecoderInputConsList<A>, unknown>>, UnNest<Flatten<EncoderOutputConsList<A>, unknown>>> { readonly members: A; } export declare function intersection<A extends ReadonlyArray<Any>>(types: A, name?: string): IntersectionType<A>; declare type DecoderInputConsList<A extends readonly any[]> = [] extends A ? unknown : ((...a: A) => any) extends (t: infer T, ...ts: infer TS) => any ? [D.TypeOf<T>, DecoderInputConsList<TS>] : unknown; declare type EncoderOutputConsList<A extends readonly any[]> = [] extends A ? unknown : ((...a: A) => any) extends (t: infer T, ...ts: infer TS) => any ? [E.OutputOf<T>, EncoderOutputConsList<TS>] : unknown; export {}; //# sourceMappingURL=Intersection.d.ts.map