Basarat Ali Syed

Results 54 issues of Basarat Ali Syed

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]...

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 }`

Server gives you `{foo: string}` and you want `{foo: string, expanded: boolean}` etc. I need to document the guidance for this. Anybody got a nice heading for this? :rose:

https://github.com/Microsoft/TypeScript/pull/18654 `strictFunctionTypes` :rose:

https://github.com/Microsoft/TypeScript/pull/15486#issuecomment-303764673 :rose: * Add example here : https://github.com/basarat/typescript-book/blob/master/docs/enums.md * Link to `enums` from here : https://github.com/basarat/typescript-book/blob/master/docs/tips/stringEnums.md

Some examples from here : https://github.com/basarat/conf-ndc-2017/tree/master/ts :rose:

Need at least a whole page on it. Someone just asked on Stackoverflow : https://stackoverflow.com/a/44957356/390330 :rose:

> It will be good if you could provide us an example for abstract class and properties here. Made here https://www.gitbook.com/book/basarat/typescript/discussions/64