摘要:
Globals in TypeScript?! 🤯 declare global is a super useful tool for when you want to allow types to cross module boundaries. Here, we create a Global 阅读全文
摘要:
Given a tuple type T that only contains string type, and a type U, build an object recursively. type a = TupleToNestedObject<['a'], string> // {a: str 阅读全文
摘要:
Implement the type version of Array.shift For example type Result = Shift<[3, 2, 1]> // [2, 1] /* _____________ Your Code Here _____________ */ type S 阅读全文
摘要:
Implement the type version of Object.entries For example interface Model { name: string; age: number; locations: string[] | null; } type modelEntries 阅读全文
摘要:
Implement the generic Mutable<T> which makes all properties in T mutable (not readonly). For example interface Todo { readonly title: string readonly 阅读全文
摘要:
Want to turn a module into a type? You can use typeof import('./') to grab the type of any module, even third-party ones. Here, we create a type from 阅读全文
摘要:
For example we have a search input: const input$ = fromEvent(document.getElementById("#input"), "input"); input$ .pipe( debounceTime(200), pluck("targ 阅读全文