-
Notifications
You must be signed in to change notification settings - Fork 531
refactor: 重构链接属性配置类型和工具栏选项 #1592
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
Draft
RSS1102
wants to merge
4
commits into
dev
Choose a base branch
from
rss1102/refactor/type-d-ts
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: a7ebf72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Collaborator
【预览链接】
|
Contributor
|
Size Change: +3.4 kB (+0.05%) Total Size: 6.59 MB
ℹ️ View Unchanged
|
Collaborator
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Cherry Markdown 类型定义修复日志
本次修改总结
1. 类型定义修复 (
cherry.d.ts)enableShortLink注释默认:true→默认:false(与实际默认值一致)loaing拼写错误loadingCherryFileUploadMultiHandler(url, params)改为(results: Array<{url, params}>)FormulaMenu导入@/别名导入,改为本地定义接口toolbarRight/hiddenToolbar/sidebar/bubble/floatany[]→ 精确类型定义showToolbar注释2. 新增 API (
registerHeadlessToolbars)hiddenToolbar@deprecatedregisterHeadlessToolbarsregisterHeadlessToolbars优先于hiddenToolbar3. 注释修复 (
Cherry.config.js)showToolbar注释🔴 高风险改动
CherryFileUploadMultiHandler类型变更之前(错误的类型):
现在(正确的类型):
影响:如果用户的 TypeScript 项目使用了
fileUploadMulti回调,类型检查可能会报错。但这是修复,之前的类型定义本身就是错误的,与实际运行时行为不符。🟡 中等风险改动
1.
any[]→ 精确类型如果用户之前传入了不在
CherryDefaultToolbar联合类型中的自定义字符串,现在会报类型错误。需要使用customMenu配合泛型参数来声明自定义菜单。2.
hiddenToolbar废弃现有使用
hiddenToolbar的代码仍然可以正常工作(向后兼容),但 IDE 会显示废弃警告,建议迁移到registerHeadlessToolbars。修改的文件列表
packages/cherry-markdown/types/cherry.d.tspackages/cherry-markdown/types/previewer.d.tspackages/cherry-markdown/src/Cherry.jspackages/cherry-markdown/src/Cherry.config.js