@xiongtao.xt/tau-plugins 0.44.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/docs/README.md +2 -2
  3. package/docs/api-support.md +53 -40
  4. package/docs/editor-collaboration.md +187 -0
  5. package/docs/editor.md +30 -27
  6. package/docs/getting-started.md +3 -3
  7. package/docs/portability.md +8 -6
  8. package/docs/providers/README.md +13 -13
  9. package/docs/providers/asr.md +3 -1
  10. package/docs/providers/sync.md +41 -2
  11. package/docs/providers/tts.md +15 -0
  12. package/docs/providers/upload.md +43 -4
  13. package/docs/release.md +1 -1
  14. package/docs/whiteboard-collaboration.md +67 -0
  15. package/docs/whiteboard.md +79 -29
  16. package/package.json +5 -4
  17. package/publish-artifacts.js +9348 -73
  18. package/types/packages/collaboration/src/protocol.d.ts +144 -0
  19. package/types/packages/collaboration/src/whiteboard-contract.d.ts +6 -0
  20. package/types/packages/collaboration/src/whiteboard-types.d.ts +181 -0
  21. package/types/packages/collaboration/whiteboard-types.d.ts +1 -0
  22. package/types/packages/db-schema/content-contracts.d.ts +4 -1
  23. package/types/packages/db-schema/content-identities.d.ts +19 -0
  24. package/types/packages/db-schema/data-versions.d.ts +16 -0
  25. package/types/packages/editor/source-contracts.d.ts +13 -41
  26. package/types/packages/editor/src/Editor.d.ts +7 -0
  27. package/types/packages/editor/src/builtin-types.d.ts +22 -0
  28. package/types/packages/editor/src/core/CoreEditor.d.ts +44 -0
  29. package/types/packages/editor/src/core/api/elementView.d.ts +14 -0
  30. package/types/packages/editor/src/core/api/extension.d.ts +3 -8
  31. package/types/packages/editor/src/core/api/index.d.ts +6 -1
  32. package/types/packages/editor/src/core/api/slateTextFields.d.ts +6 -0
  33. package/types/packages/editor/src/core/api/textFieldInput.d.ts +14 -0
  34. package/types/packages/editor/src/core/document/EditorDocument.d.ts +74 -0
  35. package/types/packages/editor/src/core/extensions/markdown-paste-import/index.d.ts +10 -0
  36. package/types/packages/editor/src/core/hooks/useTouchVoidSelection.d.ts +10 -0
  37. package/types/packages/editor/src/core/index.d.ts +36 -0
  38. package/types/packages/editor/src/core/menu/defaultMenu.d.ts +2 -0
  39. package/types/packages/editor/src/core/plugins/withMarkdownPasteImport.d.ts +17 -0
  40. package/types/packages/editor/src/core/services/elementEditingPolicy.d.ts +0 -1
  41. package/types/packages/editor/src/core/utils/blockNavigation.d.ts +1 -1
  42. package/types/packages/editor/src/core/utils/editor.d.ts +2 -2
  43. package/types/packages/editor/src/core/utils/hotkey.d.ts +17 -0
  44. package/types/packages/editor/src/core/utils/index.d.ts +9 -0
  45. package/types/packages/editor/src/core/utils/normalizeEditorContent.d.ts +2 -0
  46. package/types/packages/editor/src/core/utils/plugin.d.ts +1 -1
  47. package/types/packages/editor/src/extensions/annotation/src/augmentations.d.ts +9 -0
  48. package/types/packages/editor/src/extensions/annotation/src/types.d.ts +6 -0
  49. package/types/packages/editor/src/extensions/blockquote/src/augmentations.d.ts +6 -0
  50. package/types/packages/editor/src/extensions/blockquote/src/types.d.ts +7 -0
  51. package/types/packages/editor/src/extensions/callout/src/augmentations.d.ts +6 -0
  52. package/types/packages/editor/src/extensions/callout/src/types.d.ts +11 -0
  53. package/types/packages/editor/src/extensions/callout/src/variants.d.ts +1 -0
  54. package/types/packages/editor/src/extensions/code-block/src/augmentations.d.ts +7 -0
  55. package/types/packages/editor/src/extensions/code-block/src/types/code-block.d.ts +40 -0
  56. package/types/packages/editor/src/extensions/code-block/src/types/index.d.ts +1 -0
  57. package/types/packages/editor/src/extensions/comment/src/augmentations.d.ts +9 -0
  58. package/types/packages/editor/src/extensions/comment/src/types.d.ts +15 -0
  59. package/types/packages/editor/src/extensions/detail/src/augmentations.d.ts +6 -0
  60. package/types/packages/editor/src/extensions/detail/src/types.d.ts +9 -0
  61. package/types/packages/editor/src/extensions/diagram/src/augmentations.d.ts +7 -0
  62. package/types/packages/editor/src/extensions/diagram/src/types/index.d.ts +4 -0
  63. package/types/packages/editor/src/extensions/diagram/src/types/mermaid.d.ts +12 -0
  64. package/types/packages/editor/src/extensions/diagram/src/types/plantuml.d.ts +6 -0
  65. package/types/packages/editor/src/extensions/diagram/src/types/typst.d.ts +9 -0
  66. package/types/packages/editor/src/extensions/divide-line/src/augmentations.d.ts +6 -0
  67. package/types/packages/editor/src/extensions/divide-line/src/types.d.ts +5 -0
  68. package/types/packages/editor/src/extensions/emoji/src/augmentations.d.ts +9 -0
  69. package/types/packages/editor/src/extensions/emoji/src/types.d.ts +9 -0
  70. package/types/packages/editor/src/extensions/front-matter/src/augmentations.d.ts +6 -0
  71. package/types/packages/editor/src/extensions/front-matter/src/types.d.ts +6 -0
  72. package/types/packages/editor/src/extensions/header/src/augmentations.d.ts +6 -0
  73. package/types/packages/editor/src/extensions/header/src/types.d.ts +8 -0
  74. package/types/packages/editor/src/extensions/highlight-block/src/augmentations.d.ts +6 -0
  75. package/types/packages/editor/src/extensions/highlight-block/src/types.d.ts +10 -0
  76. package/types/packages/editor/src/extensions/highlight-block/src/variants.d.ts +1 -0
  77. package/types/packages/editor/src/extensions/kbd/src/augmentations.d.ts +9 -0
  78. package/types/packages/editor/src/extensions/kbd/src/types.d.ts +5 -0
  79. package/types/packages/editor/src/extensions/link/src/augmentations.d.ts +9 -0
  80. package/types/packages/editor/src/extensions/link/src/types.d.ts +6 -0
  81. package/types/packages/editor/src/extensions/list/src/augmentations.d.ts +10 -0
  82. package/types/packages/editor/src/extensions/list/src/types/check-list.d.ts +25 -0
  83. package/types/packages/editor/src/extensions/list/src/types/list.d.ts +18 -0
  84. package/types/packages/editor/src/extensions/list/src/types.d.ts +3 -0
  85. package/types/packages/editor/src/extensions/math/src/augmentations.d.ts +10 -0
  86. package/types/packages/editor/src/extensions/math/src/types.d.ts +11 -0
  87. package/types/packages/editor/src/extensions/media/src/augmentations.d.ts +15 -0
  88. package/types/packages/editor/src/extensions/media/src/components/ImageCropEditor/geometry.d.ts +119 -0
  89. package/types/packages/editor/src/extensions/media/src/types/element/audio.d.ts +13 -0
  90. package/types/packages/editor/src/extensions/media/src/types/element/image-appearance.d.ts +2 -0
  91. package/types/packages/editor/src/extensions/media/src/types/element/image.d.ts +31 -0
  92. package/types/packages/editor/src/extensions/media/src/types/element/inline-image.d.ts +10 -0
  93. package/types/packages/editor/src/extensions/media/src/types/element/video.d.ts +21 -0
  94. package/types/packages/editor/src/extensions/styled-text/src/augmentations.d.ts +9 -0
  95. package/types/packages/editor/src/extensions/styled-text/src/colors.d.ts +75 -0
  96. package/types/packages/editor/src/extensions/styled-text/src/types.d.ts +7 -0
  97. package/types/packages/editor/src/extensions/table/src/align.d.ts +2 -0
  98. package/types/packages/editor/src/extensions/table/src/augmentations.d.ts +8 -0
  99. package/types/packages/editor/src/extensions/table/src/types.d.ts +19 -0
  100. package/types/packages/editor/src/extensions/tabs/src/augmentations.d.ts +7 -0
  101. package/types/packages/editor/src/extensions/tabs/src/types.d.ts +29 -0
  102. package/types/packages/editor/src/extensions/underline/src/augmentations.d.ts +9 -0
  103. package/types/packages/editor/src/extensions/underline/src/types.d.ts +8 -0
  104. package/types/packages/editor/src/extensions/webview/src/augmentations.d.ts +6 -0
  105. package/types/packages/editor/src/extensions/webview/src/types.d.ts +14 -0
  106. package/types/packages/editor/src/index.d.ts +4 -0
  107. package/types/packages/editor/src/presets/default.d.ts +2 -0
  108. package/types/packages/editor/text-field-contract.d.ts +36 -0
  109. package/types/packages/plugins/src/content-input.d.ts +1 -0
  110. package/types/packages/plugins/src/data.d.ts +1 -0
  111. package/types/packages/plugins/src/flashcards.d.ts +2 -0
  112. package/types/packages/plugins/src/index.d.ts +3 -2
  113. package/types/packages/plugins/src/provider-form.d.ts +57 -0
  114. package/types/packages/plugins/src/settings.d.ts +14 -10
  115. package/types/packages/plugins/src/whiteboard.d.ts +3 -2
  116. package/types/packages/shared/color-utils.d.ts +19 -0
  117. package/types/packages/shared/media-services.d.ts +18 -0
  118. package/types/packages/shared/media-types.d.ts +1 -0
  119. package/types/packages/shared/src/chat-core/askQuestion.d.ts +54 -0
  120. package/types/packages/shared/src/chat-core/index.d.ts +1 -0
  121. package/types/packages/shared/src/task-assistant/contracts.d.ts +119 -0
  122. package/types/packages/shared/src/task-assistant/document-state.d.ts +14 -0
  123. package/types/packages/shared/src/task-assistant/schema.d.ts +42 -0
  124. package/types/packages/shared/task-assistant.d.ts +3 -0
  125. package/types/packages/whiteboard/src/Board.d.ts +180 -0
  126. package/types/packages/whiteboard/src/WhiteBoard.d.ts +55 -0
  127. package/types/packages/whiteboard/src/author.d.ts +5 -3
  128. package/types/packages/whiteboard/src/components/ArrowConnectPointGroup/index.d.ts +13 -0
  129. package/types/packages/whiteboard/src/components/ArrowDropConnectPoint/index.d.ts +7 -0
  130. package/types/packages/whiteboard/src/components/DocumentElement/index.d.ts +13 -0
  131. package/types/packages/whiteboard/src/components/ResizeCircle/index.d.ts +15 -0
  132. package/types/packages/whiteboard/src/components/SketchPaths/SketchRect.d.ts +21 -0
  133. package/types/packages/whiteboard/src/components/Toolbar/ToolMenu.d.ts +15 -0
  134. package/types/packages/whiteboard/src/constants/arrow.d.ts +19 -0
  135. package/types/packages/whiteboard/src/constants/boardIdentity.d.ts +2 -0
  136. package/types/packages/whiteboard/src/constants/geometry.d.ts +7 -0
  137. package/types/packages/whiteboard/src/constants/grid.d.ts +4 -0
  138. package/types/packages/whiteboard/src/constants/image.d.ts +21 -0
  139. package/types/packages/whiteboard/src/constants/index.d.ts +13 -0
  140. package/types/packages/whiteboard/src/constants/map.d.ts +2 -0
  141. package/types/packages/whiteboard/src/constants/mind-themes.d.ts +30 -0
  142. package/types/packages/whiteboard/src/constants/mind.d.ts +14 -0
  143. package/types/packages/whiteboard/src/constants/resize.d.ts +2 -0
  144. package/types/packages/whiteboard/src/constants/select.d.ts +4 -0
  145. package/types/packages/whiteboard/src/constants/shadow.d.ts +12 -0
  146. package/types/packages/whiteboard/src/constants/sketch.d.ts +16 -0
  147. package/types/packages/whiteboard/src/constants/text-style.d.ts +68 -0
  148. package/types/packages/whiteboard/src/constants/tools.d.ts +11 -0
  149. package/types/packages/whiteboard/src/constants/viewport.d.ts +3 -0
  150. package/types/packages/whiteboard/src/document-version.d.ts +9 -0
  151. package/types/packages/whiteboard/src/document.d.ts +47 -0
  152. package/types/packages/whiteboard/src/extensions/api.d.ts +9 -0
  153. package/types/packages/whiteboard/src/extensions/authorApi.d.ts +10 -0
  154. package/types/packages/whiteboard/src/extensions/authorHooks.d.ts +2 -2
  155. package/types/packages/whiteboard/src/extensions/authorTypes.d.ts +150 -0
  156. package/types/packages/whiteboard/src/extensions/media.d.ts +50 -0
  157. package/types/packages/whiteboard/src/extensions/publicHooks.d.ts +2 -0
  158. package/types/packages/whiteboard/src/extensions/runtime.d.ts +95 -0
  159. package/types/packages/whiteboard/src/extensions/text.d.ts +58 -0
  160. package/types/packages/whiteboard/src/extensions/versions.d.ts +2 -0
  161. package/types/packages/whiteboard/src/hooks/useBoardState.d.ts +6 -0
  162. package/types/packages/whiteboard/src/hooks/useDropArrow.d.ts +76 -0
  163. package/types/packages/whiteboard/src/hooks/useElementsMoving.d.ts +10 -0
  164. package/types/packages/whiteboard/src/hooks/useMindTheme.d.ts +8 -0
  165. package/types/packages/whiteboard/src/hooks/useSelectState.d.ts +10 -0
  166. package/types/packages/whiteboard/src/hooks/useSketch.d.ts +15 -0
  167. package/types/packages/whiteboard/src/index.d.ts +54 -0
  168. package/types/packages/whiteboard/src/interactions/InteractionManager.d.ts +68 -0
  169. package/types/packages/whiteboard/src/interactions/InteractionState.d.ts +28 -0
  170. package/types/packages/whiteboard/src/interactions/states/ResizingState.d.ts +40 -0
  171. package/types/packages/whiteboard/src/plugins/ArrowPlugin.d.ts +48 -0
  172. package/types/packages/whiteboard/src/plugins/AudioPlugin.d.ts +15 -0
  173. package/types/packages/whiteboard/src/plugins/ColumnPlugin.d.ts +81 -0
  174. package/types/packages/whiteboard/src/plugins/CommonPlugin.d.ts +104 -0
  175. package/types/packages/whiteboard/src/plugins/CopyPastePlugin.d.ts +38 -0
  176. package/types/packages/whiteboard/src/plugins/DocumentPlugin.d.ts +41 -0
  177. package/types/packages/whiteboard/src/plugins/ExportImagePlugin.d.ts +6 -0
  178. package/types/packages/whiteboard/src/plugins/FileDragDropPlugin.d.ts +15 -0
  179. package/types/packages/whiteboard/src/plugins/FramePlugin.d.ts +14 -0
  180. package/types/packages/whiteboard/src/plugins/GeometryPlugin.d.ts +31 -0
  181. package/types/packages/whiteboard/src/plugins/HandwritePlugin.d.ts +22 -0
  182. package/types/packages/whiteboard/src/plugins/ImagePlugin.d.ts +21 -0
  183. package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +72 -0
  184. package/types/packages/whiteboard/src/plugins/PresentationPlugin.d.ts +13 -0
  185. package/types/packages/whiteboard/src/plugins/RichTextPlugin.d.ts +44 -0
  186. package/types/packages/whiteboard/src/plugins/VideoPlugin.d.ts +14 -0
  187. package/types/packages/whiteboard/src/plugins/ViewPortPlugin.d.ts +13 -0
  188. package/types/packages/whiteboard/src/plugins/WebviewPlugin.d.ts +11 -0
  189. package/types/packages/whiteboard/src/plugins/WhiteBoardPlugin.d.ts +31 -0
  190. package/types/packages/whiteboard/src/plugins/index.d.ts +19 -0
  191. package/types/packages/whiteboard/src/public.d.ts +54 -0
  192. package/types/packages/whiteboard/src/schematic/PageSchematic.d.ts +13 -0
  193. package/types/packages/whiteboard/src/services/CapabilityService.d.ts +186 -0
  194. package/types/packages/whiteboard/src/transforms/SelectTransforms.d.ts +4 -0
  195. package/types/packages/whiteboard/src/transforms/SketchTransforms.d.ts +5 -0
  196. package/types/packages/whiteboard/src/transforms/ViewPortTransforms.d.ts +26 -0
  197. package/types/packages/whiteboard/src/transforms/index.d.ts +3 -0
  198. package/types/packages/whiteboard/src/types/arrow.d.ts +52 -0
  199. package/types/packages/whiteboard/src/types/audio.d.ts +8 -0
  200. package/types/packages/whiteboard/src/types/board.d.ts +79 -0
  201. package/types/packages/whiteboard/src/types/capabilities.d.ts +267 -0
  202. package/types/packages/whiteboard/src/types/column.d.ts +71 -0
  203. package/types/packages/whiteboard/src/types/element.d.ts +1 -0
  204. package/types/packages/whiteboard/src/types/frame.d.ts +35 -0
  205. package/types/packages/whiteboard/src/types/image.d.ts +19 -0
  206. package/types/packages/whiteboard/src/types/index.d.ts +33 -0
  207. package/types/packages/whiteboard/src/types/mind.d.ts +54 -0
  208. package/types/packages/whiteboard/src/types/resize.d.ts +16 -0
  209. package/types/packages/whiteboard/src/types/video.d.ts +20 -0
  210. package/types/packages/whiteboard/src/types/webview.d.ts +7 -0
  211. package/types/packages/whiteboard/src/utils/ArrowConnectTracker.d.ts +50 -0
  212. package/types/packages/whiteboard/src/utils/ArrowStyleUtil.d.ts +15 -0
  213. package/types/packages/whiteboard/src/utils/ArrowUtil.d.ts +11 -0
  214. package/types/packages/whiteboard/src/utils/AudioUtil.d.ts +20 -0
  215. package/types/packages/whiteboard/src/utils/BoardUtil.d.ts +101 -0
  216. package/types/packages/whiteboard/src/utils/CanvasUtil.d.ts +5 -0
  217. package/types/packages/whiteboard/src/utils/ClipboardUtil.d.ts +8 -0
  218. package/types/packages/whiteboard/src/utils/ColumnUtil.d.ts +125 -0
  219. package/types/packages/whiteboard/src/utils/ConnectPointOwner.d.ts +36 -0
  220. package/types/packages/whiteboard/src/utils/ConnectPointUtil.d.ts +66 -0
  221. package/types/packages/whiteboard/src/utils/Constraints.d.ts +6 -0
  222. package/types/packages/whiteboard/src/utils/ExportImageUtil.d.ts +14 -0
  223. package/types/packages/whiteboard/src/utils/FrameUtil.d.ts +90 -0
  224. package/types/packages/whiteboard/src/utils/GeometryUtil.d.ts +18 -0
  225. package/types/packages/whiteboard/src/utils/HandwriteGroupUtil.d.ts +25 -0
  226. package/types/packages/whiteboard/src/utils/HandwriteUtil.d.ts +39 -0
  227. package/types/packages/whiteboard/src/utils/ImageUtil.d.ts +13 -0
  228. package/types/packages/whiteboard/src/utils/LayerOrderUtil.d.ts +16 -0
  229. package/types/packages/whiteboard/src/utils/MindThemePreviewStore.d.ts +11 -0
  230. package/types/packages/whiteboard/src/utils/MindThemeUtil.d.ts +54 -0
  231. package/types/packages/whiteboard/src/utils/MindUtil.d.ts +65 -0
  232. package/types/packages/whiteboard/src/utils/PathUtil.d.ts +80 -0
  233. package/types/packages/whiteboard/src/utils/PointUtil.d.ts +50 -0
  234. package/types/packages/whiteboard/src/utils/PresentationManager.d.ts +53 -0
  235. package/types/packages/whiteboard/src/utils/RichTextContentUtil.d.ts +17 -0
  236. package/types/packages/whiteboard/src/utils/SelectionActionUtil.d.ts +9 -0
  237. package/types/packages/whiteboard/src/utils/TextStyleStore.d.ts +10 -0
  238. package/types/packages/whiteboard/src/utils/VideoUtil.d.ts +11 -0
  239. package/types/packages/whiteboard/src/utils/ViewportUtil.d.ts +10 -0
  240. package/types/packages/whiteboard/src/utils/common.d.ts +18 -0
  241. package/types/packages/whiteboard/src/utils/events.d.ts +13 -0
  242. package/types/packages/whiteboard/src/utils/index.d.ts +28 -0
  243. package/types/packages/whiteboard/src/utils/sketch/arrow.d.ts +29 -0
  244. package/types/packages/whiteboard/src/utils/sketch/batch.d.ts +10 -0
  245. package/types/packages/whiteboard/src/utils/sketch/index.d.ts +9 -0
  246. package/types/packages/whiteboard/src/utils/sketch/patch.d.ts +5 -0
  247. package/types/packages/whiteboard/src/utils/sketch/resolve.d.ts +14 -0
  248. package/types/packages/whiteboard/src/utils/snap/SnapGeometry.d.ts +52 -0
  249. package/types/packages/whiteboard/src/utils/snap/SnapManager.d.ts +57 -0
@@ -0,0 +1,18 @@
1
+ import type { BlockElement } from "../../../../../api";
2
+ export interface ListItemElement {
3
+ type: "list-item";
4
+ children: BlockElement[];
5
+ isFold?: boolean;
6
+ allContent?: BlockElement[];
7
+ icon?: string;
8
+ iconType?: "emoji" | "image";
9
+ iconUrl?: string;
10
+ }
11
+ export interface BulletedListElement {
12
+ type: "bulleted-list";
13
+ children: ListItemElement[];
14
+ }
15
+ export interface NumberedListElement {
16
+ type: "numbered-list";
17
+ children: ListItemElement[];
18
+ }
@@ -0,0 +1,3 @@
1
+ export type * from "./types/list";
2
+ export type * from "./types/check-list";
3
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
@@ -0,0 +1,10 @@
1
+ import type { InlineMathElement, BlockMathElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "inline-math": InlineMathElement;
5
+ "block-math": BlockMathElement;
6
+ }
7
+ interface ExtensionInlineElementMap {
8
+ "inline-math": InlineMathElement;
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ import type { Descendant } from "slate";
2
+ export interface InlineMathElement {
3
+ type: "inline-math";
4
+ tex: string;
5
+ children: Descendant[];
6
+ }
7
+ export interface BlockMathElement {
8
+ type: "block-math";
9
+ tex: string;
10
+ children: Descendant[];
11
+ }
@@ -0,0 +1,15 @@
1
+ import type { ImageElement } from "./types/element/image";
2
+ import type { InlineImageElement } from "./types/element/inline-image";
3
+ import type { AudioElement } from "./types/element/audio";
4
+ import type { VideoElement } from "./types/element/video";
5
+ declare module "../../../../api" {
6
+ interface ExtensionElementMap {
7
+ image: ImageElement;
8
+ "inline-image": InlineImageElement;
9
+ audio: AudioElement;
10
+ video: VideoElement;
11
+ }
12
+ interface ExtensionInlineElementMap {
13
+ "inline-image": InlineImageElement;
14
+ }
15
+ }
@@ -0,0 +1,119 @@
1
+ /**
2
+ * 裁剪编辑器的纯几何:视图态(舞台上的裁剪框 + 图片缩放 / 平移 / 旋转)
3
+ * 与持久化的裁剪参数(图片像素坐标,与视图无关)之间的换算与约束。
4
+ *
5
+ * 坐标约定:视图坐标以舞台左上为原点、向右向下为正;图片的旋转 = 90° 步进 + 微调角度,
6
+ * 翻转作用在图片自身坐标上(先翻转再旋转)。
7
+ * 纯计算、不依赖 DOM:图片节点类型引用这里的 ImageCropTransform,headless 的 @tau/markdown 也会检查到。
8
+ */
9
+ export interface Vec {
10
+ x: number;
11
+ y: number;
12
+ }
13
+ export interface Rect {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ }
19
+ export interface Size {
20
+ width: number;
21
+ height: number;
22
+ }
23
+ /** 持久化的裁剪参数(写进图片节点,再次打开据此恢复) */
24
+ export interface ImageCropTransform {
25
+ version: 2;
26
+ /** 90° 步进旋转次数(0-3,逆时针为正) */
27
+ quarterTurns: number;
28
+ /** 微调角度(度,-45 ~ 45,顺时针为正) */
29
+ straighten: number;
30
+ flipX: boolean;
31
+ /** 锁定的宽高比;null 为自由 */
32
+ aspect: number | null;
33
+ /** 裁剪结果的尺寸,图片像素 */
34
+ cropWidth: number;
35
+ cropHeight: number;
36
+ /** 图片中心相对裁剪框中心的偏移,图片像素(按输出方向,不随图片旋转) */
37
+ offsetX: number;
38
+ offsetY: number;
39
+ }
40
+ /** 编辑中的视图态 */
41
+ export interface CropViewState {
42
+ quarterTurns: number;
43
+ straighten: number;
44
+ flipX: boolean;
45
+ aspect: number | null;
46
+ /** 视图像素 / 图片像素 */
47
+ scale: number;
48
+ /** 图片中心(视图坐标) */
49
+ center: Vec;
50
+ /** 裁剪框(视图坐标) */
51
+ frame: Rect;
52
+ }
53
+ export declare const MAX_STRAIGHTEN = 45;
54
+ /** 裁剪框在舞台内留出的边距(视图像素) */
55
+ export declare const STAGE_PADDING = 32;
56
+ export declare const MIN_FRAME_SIZE = 40;
57
+ /** 最大放大到原图 4 倍像素 */
58
+ export declare const MAX_SCALE = 4;
59
+ export declare const normalizeTurns: (turns: number) => number;
60
+ export declare const rotationOf: (state: Pick<CropViewState, "quarterTurns" | "straighten">) => number;
61
+ export declare const frameCenter: (frame: Rect) => Vec;
62
+ /**
63
+ * 旋转后的图片要完整覆盖裁剪框所需的最小缩放:
64
+ * 把框的四角转到图片自身坐标,取各角到图片中心的最大半宽 / 半高占比。
65
+ */
66
+ export declare function minCoverScale(frame: Rect, image: Size, center: Vec, radians: number): number;
67
+ /** 平移图片:越界时沿「当前位置 → 目标位置」二分,停在仍能覆盖裁剪框的最远处 */
68
+ export declare function clampCenter(state: CropViewState, image: Size, target: Vec): Vec;
69
+ /**
70
+ * 保证覆盖:缩放不足时以裁剪框中心为锚点放大(框内画面位置不漂移)。
71
+ * 放大会让图片中心离框心更远,所以迭代到满足为止(几次即收敛)。
72
+ */
73
+ export declare function ensureCover(state: CropViewState, image: Size): CropViewState;
74
+ /** 以 anchor(通常是指针位置)为不动点缩放;缩到覆盖不住时退回刚好覆盖 */
75
+ export declare function zoomAround(state: CropViewState, factor: number, anchor: Vec, image: Size): CropViewState;
76
+ /** 当前 90° 步进下的「原始」宽高比 */
77
+ export declare const naturalAspect: (image: Size, quarterTurns: number) => number;
78
+ /** 按宽高比在可用区域内取最大、居中的矩形 */
79
+ export declare function fitRect(area: Rect, aspect: number): Rect;
80
+ /** 视图态 → 持久化参数 */
81
+ export declare function toTransform(state: CropViewState): ImageCropTransform;
82
+ /** 持久化参数 → 视图态:裁剪框按比例铺满舞台居中 */
83
+ export declare function fromTransform(transform: ImageCropTransform, stage: Size): CropViewState;
84
+ /** 未裁剪过的初始参数:整张原图 */
85
+ export declare const identityTransform: (image: Size) => ImageCropTransform;
86
+ /** 节点里存的参数是否是本编辑器能恢复的版本(旧版 cropperjs 参数不认,按原图重新开始) */
87
+ export declare const isCropTransform: (value: unknown) => value is ImageCropTransform;
88
+ /** 重新铺满舞台(裁剪框改变或旋转后调用),画面内容不变 */
89
+ export declare const refit: (state: CropViewState, stage: Size) => CropViewState;
90
+ /** 逆时针旋转 90°:整幅构图一起转,裁剪框宽高互换 */
91
+ export declare function rotateQuarter(state: CropViewState, stage: Size): CropViewState;
92
+ /**
93
+ * 水平翻转:整幅构图沿裁剪框竖直中线镜像。
94
+ * 镜像 M·R(θ)·F = R(-θ)·(M·F),因此旋转取反、翻转取反、偏移 x 取反。
95
+ */
96
+ export declare function flipHorizontal(state: CropViewState): CropViewState;
97
+ /** 切换宽高比:在当前裁剪框内取该比例的最大框,再铺满舞台 */
98
+ /** 以 aspect 为比例、在整张图里能取到的最大裁剪尺寸(裁剪中心相对图片中心的偏移保持不变),图片像素 */
99
+ export declare function maxCropSize(image: Size, aspect: number, radians: number, offset: Vec): Size;
100
+ /**
101
+ * 切换宽高比:取该比例在整张图里的最大框,裁剪中心不变。
102
+ * 结果只取决于比例本身,与之前选过什么无关(来回切换不会越裁越小)。
103
+ */
104
+ export declare function applyAspect(state: CropViewState, aspect: number | null, image: Size, stage: Size): CropViewState;
105
+ /**
106
+ * 设定微调角度:以裁剪框中心为轴旋转(框心下的画面点不动),
107
+ * 缩放保持相对「刚好覆盖」的倍数;覆盖不住时把图片推回而不是放大,
108
+ * 所以角度回到原值时缩放也回到原值,来回拖动不会越转越大。
109
+ */
110
+ export declare function setStraighten(base: CropViewState, angle: number, image: Size): CropViewState;
111
+ export type FrameHandle = "n" | "s" | "e" | "w" | "ne" | "nw" | "se" | "sw";
112
+ /** 拖动裁剪框把手:对边保持不动,框被限制在舞台可用区内;锁定比例时以拖动边为主轴 */
113
+ export declare function resizeFrame(start: Rect, handle: FrameHandle, delta: Vec, aspect: number | null, stage: Size): Rect;
114
+ /**
115
+ * 拖动裁剪框把手(整体效果):框在舞台内时直接伸缩;拉到舞台边缘继续往外拖时,
116
+ * 框贴边不动、画面以对边为锚点缩小,框里就框进更多内容。
117
+ * 框永远不超出图片——拖到图片边缘即停,不会为了覆盖而放大图片。
118
+ */
119
+ export declare function dragFrameHandle(start: CropViewState, handle: FrameHandle, delta: Vec, image: Size, stage: Size): CropViewState;
@@ -0,0 +1,13 @@
1
+ import type { Descendant } from "slate";
2
+ export interface AudioElement {
3
+ type: "audio";
4
+ src: string;
5
+ /** 播放卡标题,上传时默认取文件名 */
6
+ title?: string;
7
+ uploading?: boolean;
8
+ /** 上传占位期间用于跨编辑定位的稳定标识 */
9
+ uuid?: string;
10
+ isFromGenerate?: boolean;
11
+ audioText?: string;
12
+ children: Descendant[];
13
+ }
@@ -0,0 +1,2 @@
1
+ export type ImageBorderRadiusPreset = "none" | "sm" | "md" | "lg";
2
+ export type ImageShadowPreset = "none" | "sm" | "md" | "lg";
@@ -0,0 +1,31 @@
1
+ import type { Descendant } from "slate";
2
+ import type { ImageCropTransform } from "../../components/ImageCropEditor/geometry";
3
+ import type { ImageBorderRadiusPreset, ImageShadowPreset } from "./image-appearance";
4
+ /** 旧版 cropperjs 的裁剪参数:保留在存量文档里,不再解读(再次裁剪从原图开始) */
5
+ export interface LegacyCropTransform {
6
+ version: "1.0";
7
+ [key: string]: unknown;
8
+ }
9
+ export interface ImageElement {
10
+ type: "image";
11
+ /** 原图地址(裁剪不改它) */
12
+ url: string;
13
+ alt?: string;
14
+ uuid?: string;
15
+ pasteUploading?: boolean;
16
+ /** 裁剪参数:再次裁剪时据此恢复 */
17
+ cropTransform?: ImageCropTransform | LegacyCropTransform;
18
+ /** @deprecated 使用 cropTransform 代替 */
19
+ crop?: any;
20
+ /** 显示用地址:未裁剪时等于 url,裁剪后为裁剪结果;导出链路同样取它 */
21
+ previewUrl?: string;
22
+ /** 显示图(previewUrl)的像素尺寸,首次加载后写入,用于加载前按比例占位 */
23
+ naturalWidth?: number;
24
+ naturalHeight?: number;
25
+ width?: number;
26
+ description?: string;
27
+ align?: "left" | "center" | "right";
28
+ borderRadius?: ImageBorderRadiusPreset;
29
+ shadow?: ImageShadowPreset | boolean;
30
+ children: Descendant[];
31
+ }
@@ -0,0 +1,10 @@
1
+ import { type FormattedText } from "../../../../../../../markdown/src/model";
2
+ export interface InlineImageElement {
3
+ type: "inline-image";
4
+ url: string;
5
+ alt?: string;
6
+ uuid: string;
7
+ width?: number;
8
+ height?: number;
9
+ children: FormattedText[];
10
+ }
@@ -0,0 +1,21 @@
1
+ import type { Descendant } from "slate";
2
+ /**
3
+ * 视频元素的业务元数据:编辑器不理解其内部结构,仅透传保存。
4
+ * `type` 字段作为内容源判别标识,
5
+ * 由宿主注册的 VideoContentProvider 依据它匹配渲染。
6
+ */
7
+ export type VideoElementMeta = {
8
+ type?: string;
9
+ } & Record<string, unknown>;
10
+ export interface VideoElement {
11
+ type: "video";
12
+ src: string;
13
+ playbackRate?: number;
14
+ uploading?: boolean;
15
+ /** 上传占位期间用于跨编辑定位的稳定标识 */
16
+ uuid?: string;
17
+ width?: number;
18
+ align?: "left" | "center" | "right";
19
+ metaInfo?: VideoElementMeta;
20
+ children: Descendant[];
21
+ }
@@ -0,0 +1,9 @@
1
+ import type { StyledTextElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "styled-text": StyledTextElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ "styled-text": StyledTextElement;
8
+ }
9
+ }
@@ -0,0 +1,75 @@
1
+ export declare const EStyledColor: {
2
+ readonly Red: "red";
3
+ readonly Green: "green";
4
+ readonly Yellow: "yellow";
5
+ readonly Blue: "blue";
6
+ readonly Purple: "purple";
7
+ readonly Gray: "gray";
8
+ };
9
+ export type EStyledColor = (typeof EStyledColor)[keyof typeof EStyledColor];
10
+ export declare const StyledTextColorStyle: {
11
+ light: {
12
+ red: {
13
+ label: "red";
14
+ color: string;
15
+ backgroundColor: string;
16
+ };
17
+ green: {
18
+ label: "green";
19
+ color: string;
20
+ backgroundColor: string;
21
+ };
22
+ yellow: {
23
+ label: "yellow";
24
+ color: string;
25
+ backgroundColor: string;
26
+ };
27
+ blue: {
28
+ label: "blue";
29
+ color: string;
30
+ backgroundColor: string;
31
+ };
32
+ purple: {
33
+ label: "purple";
34
+ color: string;
35
+ backgroundColor: string;
36
+ };
37
+ gray: {
38
+ label: "gray";
39
+ color: string;
40
+ backgroundColor: string;
41
+ };
42
+ };
43
+ dark: {
44
+ red: {
45
+ label: "red";
46
+ color: string;
47
+ backgroundColor: string;
48
+ };
49
+ green: {
50
+ label: "green";
51
+ color: string;
52
+ backgroundColor: string;
53
+ };
54
+ yellow: {
55
+ label: "yellow";
56
+ color: string;
57
+ backgroundColor: string;
58
+ };
59
+ blue: {
60
+ label: "blue";
61
+ color: string;
62
+ backgroundColor: string;
63
+ };
64
+ purple: {
65
+ label: "purple";
66
+ color: string;
67
+ backgroundColor: string;
68
+ };
69
+ gray: {
70
+ label: "gray";
71
+ color: string;
72
+ backgroundColor: string;
73
+ };
74
+ };
75
+ };
@@ -0,0 +1,7 @@
1
+ import { type FormattedText } from "../../../../../markdown/src/model";
2
+ import type { EStyledColor } from "./colors";
3
+ export interface StyledTextElement {
4
+ type: "styled-text";
5
+ color: EStyledColor;
6
+ children: FormattedText[];
7
+ }
@@ -0,0 +1,2 @@
1
+ /** GFM 列对齐;null 为未指定(按左对齐渲染)。纯类型文件,供无 DOM 的 codec 入口使用 */
2
+ export type TableAlign = "left" | "center" | "right" | null;
@@ -0,0 +1,8 @@
1
+ import type { TableElement, TableRowElement, TableCellElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ table: TableElement;
5
+ "table-row": TableRowElement;
6
+ "table-cell": TableCellElement;
7
+ }
8
+ }
@@ -0,0 +1,19 @@
1
+ import type { InlineElement } from "../../../../api";
2
+ import type { FormattedText } from "../../../../../markdown/src/model";
3
+ import type { TableAlign } from "./align";
4
+ export type { TableAlign };
5
+ export interface TableCellElement {
6
+ type: "table-cell";
7
+ children: Array<InlineElement | FormattedText>;
8
+ }
9
+ export interface TableRowElement {
10
+ type: "table-row";
11
+ children: TableCellElement[];
12
+ }
13
+ export interface TableElement {
14
+ type: "table";
15
+ children: TableRowElement[];
16
+ /** 每列一项,长度与列数一致;全部未指定时省略 */
17
+ align?: TableAlign[];
18
+ }
19
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
@@ -0,0 +1,7 @@
1
+ import type { TabsElement, TabPaneElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ tabs: TabsElement;
5
+ "tab-pane": TabPaneElement;
6
+ }
7
+ }
@@ -0,0 +1,29 @@
1
+ import type { BlockElement } from "../../../../api";
2
+ /**
3
+ * 旧数据形态:Tab 内容整体存于 tabs 属性中,仅作存量数据读取兼容,
4
+ * 由迁移逻辑转换为 tab-pane 子节点后不再产生。
5
+ */
6
+ export interface ITabsContent {
7
+ key: string;
8
+ title: string;
9
+ content: BlockElement[];
10
+ }
11
+ /** 单个 Tab 容器节点:Tab 的真实内容作为其 children 留在文档树内 */
12
+ export interface TabPaneElement {
13
+ type: "tab-pane";
14
+ tabKey: string;
15
+ title: string;
16
+ children: BlockElement[];
17
+ }
18
+ export interface TabsElement {
19
+ type: "tabs";
20
+ activeKey?: string;
21
+ /** @deprecated 旧数据形态,仅迁移读取兼容 */
22
+ tabsContent?: ITabsContent[];
23
+ children: TabPaneElement[];
24
+ }
25
+ export interface ITabItem {
26
+ key: string;
27
+ title: string;
28
+ }
29
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
@@ -0,0 +1,9 @@
1
+ import type { UnderlineElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ underline: UnderlineElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ underline: UnderlineElement;
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ import { type FormattedText } from "../../../../../markdown/src/model";
2
+ export interface UnderlineElement {
3
+ type: "underline";
4
+ color: string;
5
+ lineType: string;
6
+ colorSelectOpen: boolean;
7
+ children: FormattedText[];
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { WebviewElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ webview: WebviewElement;
5
+ }
6
+ }
@@ -0,0 +1,14 @@
1
+ import type { Descendant } from "slate";
2
+ /** Webview 外部扩展的节点类型,浏览器使用 iframe,Electron 使用 webview。 */
3
+ export declare enum WebLinkSourceType {
4
+ URL = "url",
5
+ REMOTE = "remote",
6
+ LOCAL = "local"
7
+ }
8
+ export interface WebviewElement {
9
+ type: "webview";
10
+ url: string;
11
+ height?: number;
12
+ sourceType?: WebLinkSourceType;
13
+ children: Descendant[];
14
+ }
@@ -0,0 +1,4 @@
1
+ import "./builtin-types";
2
+ export * from "./core/index";
3
+ export { Editor, type EditorProps } from "./Editor";
4
+ export { defaultExtensions } from "./presets/default";
@@ -0,0 +1,2 @@
1
+ import type { AnyExtension } from "../core/api/legacy";
2
+ export declare const defaultExtensions: readonly AnyExtension[];
@@ -0,0 +1,36 @@
1
+ export interface TextFieldSnapshot {
2
+ readonly value: string;
3
+ readonly revision: string;
4
+ }
5
+ export interface TextFieldDelta {
6
+ retain?: number;
7
+ delete?: number;
8
+ insert?: string;
9
+ }
10
+ export interface EditorTextField {
11
+ getSnapshot(): TextFieldSnapshot;
12
+ subscribe(listener: (event: {
13
+ delta: readonly TextFieldDelta[];
14
+ local: boolean;
15
+ }) => void): () => void;
16
+ edit(change: {
17
+ offset: number;
18
+ remove: number;
19
+ text: string;
20
+ revision: string;
21
+ }): void;
22
+ editBatch(changes: readonly {
23
+ offset: number;
24
+ remove: number;
25
+ text: string;
26
+ }[], revision: string): void;
27
+ /** 本机观察版本保护;共享文档的异步整段替换须经宿主条件提交,不能据此声称服务端 CAS。 */
28
+ replace(value: string, revision: string): void;
29
+ undo(): void;
30
+ redo(): void;
31
+ /** 宿主输入适配器登记尚未提交的组合输入,不属于插件业务状态。 */
32
+ preserveDraft?(snapshot: TextFieldSnapshot): void;
33
+ registerInput?(flush: () => void): () => void;
34
+ flushInputs?(): void;
35
+ dispose(): void;
36
+ }
@@ -14,6 +14,7 @@ export type PluginContentInput =
14
14
  /** 编辑器节点,原样写入,与 content.read 的 nodes 格式相同 */
15
15
  | {
16
16
  nodes: Descendant[];
17
+ contracts?: import("../../db-schema/content-contracts").ContentContractDictionary;
17
18
  }
18
19
  /** 整份复制一份已有正文:只需要目标的写入权限,插件拿不到正文 */
19
20
  | {
@@ -349,6 +349,7 @@ export interface PluginContentSnapshot {
349
349
  markdown?: string;
350
350
  /** format 为 nodes 时给出编辑器节点,可原样作为 PluginContentInput 的 nodes 写回 */
351
351
  nodes?: Descendant[];
352
+ contracts?: import("../../db-schema/content-contracts").ContentContractDictionary;
352
353
  /** format 为 nodes 时给出节点结构版本,见 EDITOR_NODE_SCHEMA_VERSION */
353
354
  schemaVersion?: number;
354
355
  wordCount: number;
@@ -1,3 +1,4 @@
1
+ import type { ContentContractDictionary } from "../../db-schema/content-contracts";
1
2
  import type { Descendant } from "slate";
2
3
  import type { PluginContentRef } from "./data";
3
4
  export type PluginFlashcardType = "single-choice" | "multiple-choice" | "cloze" | "qa" | "boolean";
@@ -27,6 +28,7 @@ export type PluginFlashcardReference = {
27
28
  } | {
28
29
  refType: "custom";
29
30
  customContent: Descendant[];
31
+ contracts?: ContentContractDictionary;
30
32
  title: string;
31
33
  };
32
34
  export interface PluginFlashcardDraft {
@@ -9,10 +9,11 @@ export type * from "./images";
9
9
  export type * from "./video";
10
10
  export type * from "./publish";
11
11
  export type { JsonValue, Disposable, PluginStorage, PluginCommand, PluginContext, PluginInstance, PluginDefinition, } from "./contract";
12
- export type { PluginSettings, PluginSettingsDefinition, PluginSettingsProps, PluginSettingsHandle, } from "./settings";
12
+ export type { PluginSettings, PluginSettingsDefinition, PluginProviderSettingsDefinition, PluginComponentSettingsDefinition, PluginSettingsProps, PluginSettingsHandle, } from "./settings";
13
+ export * from "./provider-form";
13
14
  export * from "./editor";
14
15
  export { SourceBlockEditor, useSourceBlock, useTextField, useReportPreviewError, insertSourceBlock, sourceBlockParagraphBehavior, } from "./source-editor";
15
- export type { SourceBlockEditorProps, PluginRuntimeStyleCompiler, TextFieldEditor } from "./source-editor";
16
+ export type { SourceBlockEditorProps, PluginRuntimeStyleCompiler, TextFieldEditor, } from "./source-editor";
16
17
  export { useInlineSource, insertInlineSource, InlineSourceBoundary } from "./inline-source";
17
18
  export { ContentEditor, ContentPreview, EntityRef } from "./components";
18
19
  export { useElement, useMediaViewer, BlockToolbar, BlockToolbarButton, BlockToolbarGap, } from "./element";
@@ -0,0 +1,57 @@
1
+ import type { JsonValue } from "./json";
2
+ /** 存储提供方配置表单:插件只声明字段,桌面与移动宿主各自渲染、保存与校验。 */
3
+ export type ProviderFormValues = Readonly<Record<string, string>>;
4
+ interface ProviderFieldBase {
5
+ key: string;
6
+ label: string;
7
+ description?: string;
8
+ placeholder?: string;
9
+ /** 未标注的字段为必填,空值时宿主拒绝保存 */
10
+ optional?: boolean;
11
+ /** 按声明顺序拼成服务列表里的配置摘要;secret 字段不能作摘要 */
12
+ summary?: boolean;
13
+ }
14
+ export interface ProviderTextField extends ProviderFieldBase {
15
+ type: "text" | "secret" | "url";
16
+ }
17
+ export interface ProviderChoiceOption {
18
+ value: string;
19
+ label?: string;
20
+ description?: string;
21
+ }
22
+ export interface ProviderChoiceField extends ProviderFieldBase {
23
+ type: "choice";
24
+ options: readonly ProviderChoiceOption[];
25
+ default?: string;
26
+ }
27
+ export interface ProviderRemoteChoiceField extends ProviderFieldBase {
28
+ type: "remote-choice";
29
+ /** 按当前填写的值加载可选项;失败时抛出可读的错误 */
30
+ load(values: ProviderFormValues, signal: AbortSignal): Promise<readonly ProviderChoiceOption[]>;
31
+ /** 其中任一字段变化时清空本字段 */
32
+ dependsOn?: readonly string[];
33
+ }
34
+ export type ProviderField = ProviderTextField | ProviderChoiceField | ProviderRemoteChoiceField;
35
+ export interface ProviderFieldGroup {
36
+ title: string;
37
+ description?: string;
38
+ fields: readonly ProviderField[];
39
+ }
40
+ export interface ProviderForm {
41
+ groups: readonly ProviderFieldGroup[];
42
+ /** 保存前调用:可补全字段(如按令牌取用户名)或抛错拒绝保存 */
43
+ beforeSave?(values: ProviderFormValues, signal: AbortSignal): Promise<ProviderFormValues>;
44
+ }
45
+ export declare function providerFormFields(form: ProviderForm): readonly ProviderField[];
46
+ export declare function assertProviderForm(form: ProviderForm): void;
47
+ /** 从已存配置读出表单初值:只取声明字段的字符串值,choice 缺省时取 default。 */
48
+ export declare function readProviderFormValues(form: ProviderForm, stored: JsonValue | undefined): Record<string, string>;
49
+ /** 改一个字段并清空依赖它的远程选择字段。 */
50
+ export declare function patchProviderFormValues(form: ProviderForm, values: ProviderFormValues, key: string, value: string): Record<string, string>;
51
+ /** 必填字段空值时返回 key → 错误文案;为空对象表示可保存。 */
52
+ export declare function validateProviderFormValues(form: ProviderForm, values: ProviderFormValues): Record<string, string>;
53
+ export declare function isProviderFormComplete(form: ProviderForm, stored: JsonValue | undefined): boolean;
54
+ export declare function providerFormSummary(form: ProviderForm, stored: JsonValue | undefined): string;
55
+ /** 写回配置:字段值覆盖已存配置的同名键,未声明的键原样保留。 */
56
+ export declare function mergeProviderFormValues(stored: JsonValue | undefined, values: ProviderFormValues): JsonValue;
57
+ export {};