-
-
Notifications
You must be signed in to change notification settings - Fork 930
docs: add jsdoc #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add jsdoc #227
Conversation
@@ -17,7 +17,7 @@ | |||
"dependencies": { | |||
"diff-match-patch": "^1.0.4" | |||
}, | |||
"types": "src/ts/types/index.d.ts", | |||
"types": "dist/index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
必须要放到 dist 下面么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack 打包默认输出在 index.js 旁边
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src 里面的这个不是完整类型定义啊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我把2个合并了,要不要维护2份,webpack 打包那个我删了,我看你又加上了。。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
源码就是typescript的部分为啥还要手动维护一个.d.ts 直接webpack生成的就是最新的类型定义啊
我做完之后rebase的dev分支 没注意到这个更改
src/ts/types/index.d.ts 里面不需要写 Vditor 的定义的 因为tsc会自动生成
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要怎么配置才会生成?我的这个上次配置了下,不会自动生成。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要怎么配置才会生成?我的这个上次配置了下,不会自动生成。
https://github.com/TypeStrong/ts-loader#declarations-dts
tsconfig.json 加 declaration: true 就行
@@ -5,17 +5,7 @@ import {Hint} from "./ts/hint/index"; | |||
import {IR} from "./ts/ir"; | |||
import {input as irInput} from "./ts/ir/input"; | |||
import {processAfterRender} from "./ts/ir/process"; | |||
import {abcRender} from "./ts/markdown/abcRender"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些删除了的目的是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和 method.ts 代码重复 直接复用避免维护2份文档
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档可以写在 type 上么?
method 是提供给不需要编辑器,只渲染 UI 时使用的。
使用编辑器只引用一个,2 个引入的话不使用 import ,变量会冲突。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档写在type上指什么
要是写在函数上是看不到的 因为class里面是赋值 赋值看到的文档是字段的文档不是值的文档
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要是不删就是重复代码一边有文档一边没文档
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface的文档我都是这么写的啊
但是class不删重复的就要写两遍
好像没法在不重构类型定义的情况下实现完美的.d.ts构建 我下周再研究下 |
这样可以直接在 IDE 里面看文档