typescript-book icon indicating copy to clipboard operation
typescript-book copied to clipboard

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹

Results 117 typescript-book issues
Sort by recently updated
recently updated
newest added

the code before did not correctly check for the presence of a flag

In type space using `type` e.g. ```ts type Foo = {foo: T} type Bar = Foo; ``` In variables space (investigating): ```ts // A function that takes argument of type...

The code example for exhaustive checks wasn't correct as it wasn't a type error to forget to handle one of the cases for x. The code is correct now but...

try to use [a elegant plugin](https://github.com/aleen42/gitbook-treeview) to build tree view of each site to enhace reading

Hello - Thank to everyone for all your effort in putting this together. It has been incredibly useful in spinning up and learning Typescript for me recently. I wanted to...

Using a clever combination of `Pick` to create an `Omit`: (Source: https://github.com/Microsoft/TypeScript/issues/19569) ``` export type Diff = ({[P in T]: P} & {[P in U]: never} & {[x: string]: never})[T]...

I'm hoping to start a discussion on what is "best practice" when extending a type definition (d.ts). A good example of where this is needed is with mixins. For example...

Document the definite assignment operator for class properties and variables in general : ```js class C { foo!: number; // ^ // Notice this exclamation point! // This is the...

tsconfig needs module specification: ``` "moduleResolution": "node", "module": "esnext", ``` webpack.config.js needs chunkFilename specificaiton: ``` output: { path: path.join(__dirname, "dist"), filename: "[name].bundle.js", chunkFilename: "[name].chunk.js" }, ``` # More You can...

Reader comment https://www.gitbook.com/book/basarat/typescript/discussions/72 :rose: Quote: > If you want a tuple type like `[string, boolean, ...number]`, you can use `interface YourName extends Array { 0: string, 1: number }`