UNPKG

646 BTypeScriptView Raw
1import { Curry } from './Curry';
2/**
3 * Undoes the work that was done by [[Curry]]
4 * @param F to uncurry
5 * @returns [[Function]]
6 * @example
7 * ```ts
8 * import {F} from 'ts-toolbelt'
9 *
10 * type test0 = F.Curry<(a: string, b: number) => boolean>
11 * declare const foo: test0
12 * const res0 = foo('a') // F.Curry<(b: number) => boolean> & ((b: number) => boolean)
13 *
14 * type test1 = F.UnCurry<test0> // (a: string, b: number) => boolean
15 * declare const bar: test1
16 * const res1 = bar('a') // TS2554: Expected 2 arguments, but got 1.
17 * ```
18 * @ignore
19 */
20export declare type UnCurry<F extends Curry<any>> = F extends Curry<infer UF> ? UF : never;