fix(chat): standardize public types and docs - #409
Draft
RSS1102 wants to merge 12 commits into
Draft
Conversation
Contributor
|
Size Change: +689 B (+0.14%) Total Size: 480 kB 📦 View Changed
ℹ️ View Unchanged
|
@tdesign/web-components
@tdesign/web-components-chat
commit: |
Contributor
|
Size Change: +1.04 kB (+0.12%) Total Size: 881 kB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
TDesign Component Site Preview Open
|
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
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.

结论
本 PR 继续只处理 Web Components 内可以直接确认的类型、文档、重复实现和声明发布边界。Vue Next、React、tdesign-common 的后续修改仍只列出方案,不在本 PR 跨仓库改代码。
影响图例:🔴 需要迁移 / 类型收紧 🟠 重点复核 🟢 兼容优化 🧪 自动校验
完整改动:next...rss1102/standardize-chat-types-docs
1. 本 PR 已完成的重点修改
TdChatContentProps允许任意键和模糊扩展接口markdown、search、thinking、reasoning、suggestion、attachmentsactions类型错误地允许searchResult、searchItem、suggestion、codeCopy作为预设按钮字符串actions只接受TdChatActionsName或{ name, render };上述名称只用于handleActions内容事件handleActions使用(data?: any)TdChatMessageActionDataMap和TdChatMessageActionHandlers,按 action 名称推导content、event、code等字段any,同时保留 Search、Suggestion、Code Copy 的实际 payloadDatePickerTableCell在两个面板重复声明,并从面板文件转发panel/internal-type.ts,面板只内部 import,不再 re-exportexport * from './type'check:pack对每个公共type.ts执行声明白名单检查chatMessageAction的 detail 数据为unknown,内部调用仍为anyTdChatMessageActionDataTdChatActionProps等公共接口继承关系,并校验 Action、DatePicker、common Upload 类型边界2. 有意的兼容性变化
actions: ['searchResult']等写法不再通过 TypeScript;应改为handleActions.searchResult,或使用带render的自定义 action 项。CheckboxProps/CheckboxGroupProps名称,没有保留无必要的ComponentProps改名。fallback、referrerpolicy、src: File不再出现在真实ImageProps中,这是有意的类型纠正。DatePickerTableCell不再作为面板深层模块的公共类型导出;正式包exports本来也不承诺面板深路径。.d.ts,不生成无法解析到包内源码的 declaration map;类型跳转目标是发布声明,而不是未发布源码。3. 其他仓库仍需处理
export type *UploadFiletree与tree-v1有同名类型验证结果
pnpm run check:types:通过,包含check:chat-contractspnpm test:1 个测试文件、2 个测试通过pnpm run check:pack:通过;UI 1004 files / 216 declarations,Chat 186 files / 41 declarationsgit diff --check:通过650820c的远端 build、build-lib、unit test、UI/Chat preview、pkg preview、Typos 全部通过;条件任务site为 skipped;Checkbox 回退提交925a15a已推送并重新触发 CI925a15a