上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 496 下一页
摘要: A memory pool, also known as a memory buffer pool, is a method used in software development for managing memory allocation. Instead of allocating and 阅读全文
posted @ 2024-02-05 16:00 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: Covariance - producer - out - function return position - same arrow direction Contravariance - packager - in - function param position - different arr 阅读全文
posted @ 2024-02-01 16:03 Zhentiw 阅读(118) 评论(0) 推荐(0)
摘要: Our project might have a file structure like Our project might have a file structure like data/ book.ts // A model for Book records magazine.ts // A m 阅读全文
posted @ 2024-01-31 16:02 Zhentiw 阅读(47) 评论(0) 推荐(0)
摘要: type AnyProppertyKey = keyof any Example: type Example = Record<AnyProertyKey, any> 阅读全文
posted @ 2024-01-31 15:10 Zhentiw 阅读(13) 评论(0) 推荐(0)
摘要: Since typescript 5, we are able to add constraints over infer. Following code doesn't apply constraints, so the inferred element could be stringand nu 阅读全文
posted @ 2024-01-29 23:44 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: type OneArgFn<A = any> = (firstArg: A, ..._args: any[]) => void type GetFirstArg<T> = T extends OneArgFn<infer R> ? R : never; // Test case function f 阅读全文
posted @ 2024-01-29 23:39 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要: Particularly if you use a bundler like webpack, parcel or snowpack, you may end up importing things that aren’t .js or .ts files For example, maybe yo 阅读全文
posted @ 2024-01-29 14:58 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要: Node.js 13.2.0 introduced support for native ES modules. This means you can natively run code containing thing like import { Foo } from 'bar', use top 阅读全文
posted @ 2024-01-29 14:47 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: Let's say we need to use a library with commonJS code. class Melon { cutIntoSlices() { } } module.exports = Melon Then we want to import this inside o 阅读全文
posted @ 2024-01-28 20:36 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: //////////////////////////////////////////////////////// // @filename: berries/raspberry.ts export class Raspberry { constructor(public color: 'red' | 阅读全文
posted @ 2024-01-28 20:14 Zhentiw 阅读(20) 评论(0) 推荐(0)
上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 496 下一页