typescript - 为什么将“参数”实用程序应用于函数交集类型会产生与应用于最后一项相同的结果
问题描述
为什么Params
推断为3?
type IntersectionOfFunctions = ((a: 1) => void) & ((a: 2) => void) & ((a: 3) => void);
type Params = Parameters<IntersectionOfFunctions>; // why is this infered as 3 ???
它是如何在引擎盖下工作的?
解决方案
推荐阅读
- django - 如何在 django 模板中显示 beautifulsoup4 解析器的结果?
- amazon-web-services - 当我在 Cloudformation 上更改实例类型时,ECS 有没有办法避免停机?
- django - Django 2.x:在 URL 模式中使用模型的主键是否存在安全问题?
- wordpress - Wordpress 管理员管理员更改按钮文本添加新
- html - CSS 图像和伪元素过渡不同步
- r - 如何修复 bsts 包 R 中的“.ValidateHolidayList(holiday.list) 中的错误”?
- apache-kafka-streams - Kafka Streams:使用 at_least_once 时,为状态存储更改日志主题提供了哪些排序保证?
- sql - 使用 Vertica 插入 SQL 表时出现资源不足错误
- typescript - Typescript - 将接口属性转换为通用
- c# - 如何一起创建平移和倾斜控件?