【TS】如何在 typescript 中合并一个 interface union?
2024-10-28这玩意利用了 union type 在 conditional type 中的 distributive 的特性,将 union 在第一个 condition 中 map 到多个具有单独类型参数 function,然后再 infer 到函数的参数上,就从 union 变成了 intersection。对上面这个合并的函数来说,我们要求他的参数类型一定是同时满足 union 中所有函数的参数类型的,所以一定是取交。函数中的参数,在上面的例子中,这个函数实际上是将 union 中的两个函数合在了一起。_ts interface合并
rollup打包时配置文件参数
2024-05-050. rollup.config.js配置文件概要// rollup.config.js// can be an array (for multiple inputs)export default [ configObj];var configObj = { // core input options external, input, // conditionall..._rollup inlinedynamicimports