摘要: type Statistics = { [K in `${"median" | "mean"}Value`]?: number } Mappiing a sub type: // let winFns: "setInterval" | "setTimeout" type winFns = Extra 阅读全文
posted @ 2022-07-12 14:53 Zhentiw 阅读(27) 评论(0) 推荐(0) 编辑
摘要: Main idea is enforce you to do type checking in catch block, because if you want to get Error stacktrace, the throw value should be an Error type, if 阅读全文
posted @ 2022-07-12 14:09 Zhentiw 阅读(19) 评论(0) 推荐(0) 编辑
摘要: This major convenience feature reduces the need for class field type annotations by inferring their types from assignments in the constructor. It’s im 阅读全文
posted @ 2022-07-12 14:04 Zhentiw 阅读(26) 评论(0) 推荐(0) 编辑