vtils

Home > types > FirstParameter

FirstParameter type

返回函数 T 第一个参数的类型。

Signature:

export declare type FirstParameter<T extends (...args: any[]) => any> = Head<Parameters<T>>;

References: Head

Example

type F = (x: string, y: number) => any
type X = FirstParameter<F> // => string