首页 > 解决方案 > 为什么将“参数”实用程序应用于函数交集类型会产生与应用于最后一项相同的结果

问题描述

为什么Params推断为3?

type IntersectionOfFunctions = ((a: 1) => void) & ((a: 2) => void) & ((a: 3) => void);

type Params = Parameters<IntersectionOfFunctions>; // why is this infered as 3 ???

它是如何在引擎盖下工作的?

标签: typescript

解决方案


推荐阅读