示例工程 05-function-types-overloads
05-function-types-overloads/01-function-type-assignment/README.md
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
# 01 · function-type-assignment
**演示**:参数更少的函数可以赋给参数更多的函数类型;返回值可被忽略(`void` 特例)。
**运行**:在 `tutorials/typescript` 下执行 `npm run build`,再执行 `npm run serve`,打开
`http://localhost:8080/examples/05-function-types-overloads/01-function-type-assignment/`;开 Console。
**预期控制台输出**:
```text
evt:open:1
short:tick
one:single
```
**类型检查**:`node node_modules/typescript/bin/tsc -p examples/05-function-types-overloads/01-function-type-assignment/tsconfig.types.json`
**注意**:`run()` 返回的两行与 `evt:open:1` 分开记录;handle 通过注入的 `log` 输出,避免顶层副作用。