上一页 1 ··· 112 113 114 115 116 117 118 119 120 ··· 492 下一页
摘要: List all the props with begin with "query" key in Document type queryTypes = Extract<keyof Document, `query${string}`> type queryyPoprDoc = { [Key in 阅读全文
posted @ 2022-08-21 00:21 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要: Yarn workspace Add following lines to the package.json file "workspaces": [ "packages/*" ] And create folder call packages in the root folder. Somethi 阅读全文
posted @ 2022-08-19 18:56 Zhentiw 阅读(125) 评论(0) 推荐(0)
摘要: type PartOfWindow = { [Key in | "document" | "navigator" | "setTimeout"]: Window[Key] } /* type PartOfWindow = { document: Document; navigator: Naviga 阅读全文
posted @ 2022-08-18 19:16 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-08-18 15:05 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要: Blog: https://www.geeksforgeeks.org/es6-trampoline-function/ Stackoverflow problem for recursion: const sumBelow = (number, sum = 0) => ( number 0 ? s 阅读全文
posted @ 2022-08-18 14:32 Zhentiw 阅读(51) 评论(0) 推荐(0)
摘要: Index Signature type Fruit = { name: string color: string mass: number } type Dict<T> = { [k: string]: T } // <- index signature const fruitCatalog: D 阅读全文
posted @ 2022-08-17 15:08 Zhentiw 阅读(40) 评论(0) 推荐(0)
摘要: Indexed Access types provide a mechanism for retrieving part(s) of an array or object type via indices. We’ll look at how this kind of type works, and 阅读全文
posted @ 2022-08-16 21:18 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: For example we have a Webpack class: class WebpackCompiler { constructor(options: { amd?: false | { [index: string]: any } bail?: boolean cache?: | bo 阅读全文
posted @ 2022-08-16 21:07 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: function lotteryNum() { return (Math.round(Math.random() * 100) % 58) + 1; } function recordNumber(luckLotteryNumbers: readonly number[], num: number) 阅读全文
posted @ 2022-08-15 19:13 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: Extract is useful for obtaining some sub-part of a type that is assignable to some other type. type FavoriteColors = | "dark sienna" | "van dyke brown 阅读全文
posted @ 2022-08-15 18:53 Zhentiw 阅读(85) 评论(0) 推荐(0)
上一页 1 ··· 112 113 114 115 116 117 118 119 120 ··· 492 下一页