feat: index.d.ts
Checklist
- [ ]
npm testpasses - [x] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [x] commit message follows commit guidelines
Affected core subsystem(s)
Description of change
Codecov Report
Merging #19 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #19 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 37 37
=====================================
Hits 37 37
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 4d7de4f...b26efa3. Read the comment docs.
建议这么写,这样当引入该声明的时候,就会自动合并声明到 egg 中了
请参考:https://github.com/eggjs/egg-view/blob/master/index.d.ts
同时记得补一下单测,参考:https://eggjs.org/zh-cn/tutorials/typescript.html#%E7%BB%99-egg-%E6%8F%92%E4%BB%B6%E6%8F%90%E4%BA%A4%E5%A3%B0%E6%98%8E%E7%9A%84%E6%97%B6%E5%80%99%E5%A6%82%E4%BD%95%E7%BC%96%E5%86%99%E5%8D%95%E6%B5%8B
egg-static的.d.ts单测依赖egg/index.d.ts的,egg要先发版 @whxaxes
你可以在 fixtures 里加个 d.ts 手动写一下 import 'egg-static' ,只要这个声明文件加载进来就可以合并进去
https://github.com/eggjs/egg/pull/4012
其他 LGTM ,不过该更改需要跟 egg 同时发版本