typescript-tutorial
typescript-tutorial copied to clipboard
TypeScript 入门教程
环境:macOS Catalina 10.15.7 IDE 环境:VSCode node v12.18.0 typescript 4.0.3 
声明合并
https://ts.xcatliu.com/advanced/declaration-merging.html
> 106 | let num: number = undefined; | ^^^ 经过测试已经开始报错了,可能版本升级原因 https://ts.xcatliu.com/basics/primitive-data-types.html
我看一些文章说namespace中的成员要加上`export`关键字才能被外界访问到,好像这个教程中没有加,也没有提到这一点。是否是错误呢? ```javascript export namespace foo { const name: string; namespace bar { function baz(): string; } } ```
在範例 examples/declaration-files 的第三個範例 03-jquery-d-ts 中,在 tsconfig.json 內的 files option 無法讓 TypeScript compiler 知道全域的 jQuery 方法的宣告。 ``` // tsconfig.json { "files": ["src/index.ts", "src/jQuery.d.ts"] } ``` 錯誤訊息: ``` index.ts:1:1 - error TS2304:...
我在[這頁](https://github.com/xcatliu/typescript-tutorial/blob/master/advanced/declaration-merging.md)發現以下描述,覺得應該是錯誤的,因為类無法重複宣告,也無法像 interface 那樣自動合併。 
Fixes #177 任意属性报错更新 文字说明更新 完善联合类型解决报错代码