typescript-book
typescript-book copied to clipboard
:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹
`null` and `undefined` are not bottom types. They are "unit" or null types. The only bottom type in typescript is `never`.
Maybe you like this little improvement we use in certain projects. P.S.: Thanks for typescript-book :-)
The example in https://basarat.gitbook.io/typescript/type-system/type-compatibility#types-of-arguments > This can be confusing for people coming from other languages who would expect the following to error but will not in TypeScript: ```ts /** Type...
If this React `React.lazy` RFC lands will change the naming convention to be `Buttons.tsx` (instead of `buttons.tsx`) and sunset the default exports issues, probably move into a blog post with...
The section [where the global module declaration explained](https://basarat.gitbook.io/typescript/project/modules/external-modules#overturning-dynamic-lookup-just-for-types) there is an example like that: ``` // global.d.ts declare module 'foo' { // Some variable declarations export var bar: number; /*sample*/...
## File: Utilities In book:  But in [source code](https://github.com/microsoft/TypeScript/blob/master/src/compiler/utilities.ts#L5249):   Is that a misunderstanding or is the book outdated?
Because you can use it on the command line to `--init`: ```ts npx tsc --init --rootDir src outDir lib ```
Again cover the basic: - `keyof` - Lookup `T[K]` - Mapped - Conditional (and infer) And then cover the ones in `lib.d.ts` Pick / Readonly / Exclude / Return type...
In [this article](https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/), as a introduction to another thing, the author shows another kind of patch to use nominal types: ```ts interface PersonIdBrand { _type: "Person"; } type PersonId =...