Open shfshanyue opened 2 years ago
和returnType有点关联,做返回值推断的
infer 表示在 extends 条件语句中待推断的类型变量。
infer
extends
例子:
/** * Obtain the parameters of a function type in a tuple */ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
和returnType有点关联,做返回值推断的