UNPKG

pivots

Version:

## Readable [discriminated unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions) for TypeScript

6 lines (5 loc) 317 B
export declare function applyType<Type extends string, Params extends {}, Args extends Array<any>, Result extends any, Receivers extends Record<Type, (this: null, params: { type: Type; } & Params, ...args: Args) => Result>>(receivers: Receivers, action: { type: Type; } & Params, ...args: Args): Result;