示例工程 01-orientation
01-orientation/03-type-erasure/README.md
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
# 03 · type-erasure
**演示**:`interface`、`type`、泛型参数、重载签名都不进入产物,`dist/main.js` 里只剩实现。
**运行**:在 `tutorials/typescript` 下执行 `npm run build`,再执行 `npm run serve`,打开
`http://localhost:8080/examples/01-orientation/03-type-erasure/`;开 Console。
**预期控制台输出**:
```text
3|4
7
ok
```
**类型检查**:`node node_modules/typescript/bin/tsc -p examples/01-orientation/03-type-erasure/tsconfig.json --noEmit`
**注意**:测试会读取 `dist/main.js`,断言其中不存在类型语法;需先 `npm run build`。