3

有人知道 typescript 这种语法吗?

 3 years ago
source link: https://www.v2ex.com/t/798023
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

有人知道 typescript 这种语法吗?

  huiyanpohundh123 · 16 小时 44 分钟前 · 1036 次点击

Meta<T>这个类型最下面的属性,即 (container:Container,resetValue?:T):Context<T> 是啥?一个函数形状的匿名类型(因为它没有名字)?

下面的factory怎么理解 他到底代表一个函数 还是鸭子辫型为Meta<T>类型

这语法搞得我非常疑惑,google 查了一大堆关于 ts 类型别名和鸭子辫型的东西但很遗憾都是天下文章一大抄 没看到有讲到点子上的 有没有懂的大佬解释解释!

这个是 milkdown 的源码 学习下


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK