main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
524 bytes
|
Line | |
---|
1 | import { 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 | */
|
---|
17 | export declare type Parameters<F extends Function> = F extends ((...args: infer L) => any) ? L : never;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.