UNPKG

524 BTypeScriptView Raw
1import { Function } from './Function';
2/**
3 * Extract parameters from a [[Function]]
4 * @param F to extract from
5 * @returns [[List]]
6 * @example
7 * ```ts
8 * import {F} from 'ts-toolbelt'
9 *
10 * const fn = (name: string, age: number) => {}
11 *
12 * type test0 = F.ParamsOf<typeof fn> // [string, number]
13 *
14 * type test1 = F.ParamsOf<(name: string, age: number) => {}> // [string, number]
15 * ```
16 */
17export declare type Parameters<F extends Function> = F extends ((...args: infer L) => any) ? L : never;