示例工程 13-declaration-files

13-declaration-files/03-module-augmentation/README.md

markdown · 0.4 KB

运行:13 · module-augmentation

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

# 03 · module-augmentation
 
**演示**:`import 'analytics'` 后用 `declare module 'analytics'` 给 `Tracker` 增加 `trackPage`。
**运行**:无运行时输出;Console 为空。
**类型检查**:`node node_modules/typescript/bin/tsc -p examples/13-declaration-files/03-module-augmentation/tsconfig.types.json`
**注意**:模块增强必须先 import 目标模块;相对路径不能用于 `declare module`。