UNPKG

470 BTypeScriptView Raw
1import { Function } from './Function';
2import { List } from '../List/List';
3/**
4 * Extract the return type of a [[Function]]
5 * @param F to extract from
6 * @returns [[Any]]
7 * @example
8 * ```ts
9 * import {F} from 'ts-toolbelt'
10 *
11 * const fn = () => true
12 *
13 * type test0 = F.ReturnOf<typeof fn> // boolean
14 *
15 * type test1 = F.ReturnOf<() => true> // true
16 * ```
17 */
18export declare type Return<F extends Function> = F extends ((...args: List) => infer R) ? R : never;