@officesdk/editor-sdk-core 0.0.0-22 → 0.0.0-23

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 (259) hide show
  1. package/cjs/docs/sdk.js +1 -1
  2. package/cjs/docx/index.js +1 -1
  3. package/cjs/docx/menu.js +1 -1
  4. package/cjs/docx/outline.js +1 -1
  5. package/cjs/docx/pages.js +17 -1
  6. package/cjs/docx/paragraphs.js +3 -0
  7. package/cjs/docx/revisions.js +3 -0
  8. package/cjs/docx/sdk.js +1 -1
  9. package/cjs/docx/signature.js +3 -0
  10. package/cjs/docx/statistic.js +3 -0
  11. package/cjs/docx/theme.js +1 -1
  12. package/cjs/docx/ui.js +3 -0
  13. package/cjs/form/feature.js +3 -0
  14. package/cjs/form/index.js +21 -0
  15. package/cjs/form/link.js +3 -0
  16. package/cjs/form/publish.js +3 -0
  17. package/cjs/form/sdk.js +28 -0
  18. package/cjs/form/sheet.js +3 -0
  19. package/cjs/form/table.js +3 -0
  20. package/cjs/form/ui.js +3 -0
  21. package/cjs/pdf/pages.js +1 -1
  22. package/cjs/presentation/anonymous.js +3 -0
  23. package/cjs/presentation/assistant.js +3 -0
  24. package/cjs/presentation/chart.js +3 -0
  25. package/cjs/presentation/comments.js +3 -0
  26. package/cjs/presentation/diagram.js +3 -0
  27. package/cjs/presentation/event-subscription.js +3 -0
  28. package/cjs/presentation/export.js +1 -1
  29. package/cjs/presentation/fonts.js +1 -1
  30. package/cjs/presentation/index.js +1 -1
  31. package/cjs/presentation/presentation.js +3 -0
  32. package/cjs/presentation/remote-live.js +3 -0
  33. package/cjs/presentation/sdk.js +1 -1
  34. package/cjs/presentation/slides-pane.js +3 -0
  35. package/cjs/presentation/theme.js +3 -0
  36. package/cjs/shared/assets.js +1 -1
  37. package/cjs/shared/attachment.js +1 -1
  38. package/cjs/shared/brand.js +1 -1
  39. package/cjs/shared/collaborators.js +1 -1
  40. package/cjs/shared/comments.js +1 -1
  41. package/cjs/shared/copy.js +3 -0
  42. package/cjs/shared/device.js +3 -0
  43. package/cjs/shared/download.js +1 -2
  44. package/cjs/shared/drag-n-drop.js +6 -0
  45. package/cjs/shared/duplicate.js +6 -0
  46. package/cjs/shared/edit.js +2 -0
  47. package/cjs/shared/editor.js +1 -1
  48. package/cjs/shared/export.js +1 -1
  49. package/cjs/shared/feature.js +1 -1
  50. package/cjs/shared/file.js +1 -1
  51. package/cjs/shared/follow-mode.js +1 -1
  52. package/cjs/shared/fonts.js +1 -1
  53. package/cjs/shared/guides.js +3 -0
  54. package/cjs/shared/history.js +1 -1
  55. package/cjs/shared/import.js +1 -1
  56. package/cjs/shared/index.js +1 -1
  57. package/cjs/shared/link.js +1 -1
  58. package/cjs/shared/logs.js +3 -0
  59. package/cjs/shared/mention.js +1 -1
  60. package/cjs/shared/menu.js +1 -1
  61. package/cjs/shared/mode.js +1 -1
  62. package/cjs/shared/outline.js +1 -1
  63. package/cjs/shared/paste.js +3 -0
  64. package/cjs/shared/presentation.js +3 -0
  65. package/cjs/shared/render.js +3 -0
  66. package/cjs/shared/share.js +3 -0
  67. package/cjs/shared/shortcut.js +3 -0
  68. package/cjs/shared/socket.js +3 -0
  69. package/cjs/shared/toolbar.js +1 -1
  70. package/cjs/shared/ui.js +1 -1
  71. package/cjs/shared/uploader.js +1 -1
  72. package/cjs/shared/version.js +1 -1
  73. package/cjs/shared/watermark.js +1 -1
  74. package/cjs/sheet/combine-sheets.js +1 -1
  75. package/cjs/sheet/date-mention.js +3 -0
  76. package/cjs/sheet/event-subscription.js +3 -0
  77. package/cjs/sheet/export.js +1 -1
  78. package/cjs/sheet/follow-selection.js +3 -0
  79. package/cjs/sheet/form.js +1 -1
  80. package/cjs/sheet/formula.js +1 -1
  81. package/cjs/sheet/import-range.js +1 -1
  82. package/cjs/sheet/import.js +3 -0
  83. package/cjs/sheet/independent-viewport.js +3 -0
  84. package/cjs/sheet/index.js +1 -1
  85. package/cjs/sheet/lock.js +1 -1
  86. package/cjs/sheet/ole.js +3 -0
  87. package/cjs/sheet/paste.js +3 -0
  88. package/cjs/sheet/render.js +1 -1
  89. package/cjs/sheet/sdk.js +1 -1
  90. package/cjs/sheet/sheet-tab.js +3 -0
  91. package/cjs/sheet/ui.js +3 -0
  92. package/cjs/sheet/worksheet.js +1 -1
  93. package/cjs/table/combine-tables.js +3 -0
  94. package/cjs/table/copy.js +3 -0
  95. package/cjs/table/dashboard.js +3 -0
  96. package/cjs/table/explain-page.js +3 -0
  97. package/cjs/table/export.js +3 -0
  98. package/cjs/table/field.js +3 -0
  99. package/cjs/table/form.js +3 -0
  100. package/cjs/table/formula.js +3 -0
  101. package/cjs/table/history.js +3 -0
  102. package/cjs/table/import.js +3 -0
  103. package/cjs/table/index.js +6 -2
  104. package/cjs/table/list-bar-context-menu.js +3 -0
  105. package/cjs/table/mention.js +3 -0
  106. package/cjs/table/motable.js +16 -0
  107. package/cjs/table/paste.js +3 -0
  108. package/cjs/table/render.js +3 -0
  109. package/cjs/table/resource.js +1 -1
  110. package/cjs/table/sdk.js +1 -1
  111. package/cjs/table/shortcuts.js +3 -0
  112. package/cjs/table/snapshot.js +3 -0
  113. package/cjs/table/subscription.js +25 -0
  114. package/cjs/table/table.js +1 -1
  115. package/cjs/table/template.js +3 -0
  116. package/cjs/table/toolbar.js +1 -1
  117. package/cjs/table/toolbox.js +3 -0
  118. package/cjs/table/ui.js +3 -0
  119. package/cjs/table/version.js +3 -0
  120. package/cjs/table/view.js +26 -0
  121. package/cjs/table/window.js +3 -0
  122. package/esm/docs/sdk.js +1 -1
  123. package/esm/docx/index.js +1 -1
  124. package/esm/docx/menu.js +1 -1
  125. package/esm/docx/outline.js +1 -1
  126. package/esm/docx/pages.js +15 -2
  127. package/esm/docx/paragraphs.js +2 -0
  128. package/esm/docx/revisions.js +2 -0
  129. package/esm/docx/sdk.js +1 -1
  130. package/esm/docx/signature.js +2 -0
  131. package/esm/docx/statistic.js +2 -0
  132. package/esm/docx/theme.js +1 -1
  133. package/esm/docx/ui.js +2 -0
  134. package/esm/form/feature.js +2 -0
  135. package/esm/form/index.js +3 -0
  136. package/esm/form/link.js +2 -0
  137. package/esm/form/publish.js +2 -0
  138. package/esm/form/sdk.js +25 -0
  139. package/esm/form/sheet.js +2 -0
  140. package/esm/form/table.js +2 -0
  141. package/esm/form/ui.js +2 -0
  142. package/esm/pdf/pages.js +1 -1
  143. package/esm/presentation/anonymous.js +2 -0
  144. package/esm/presentation/assistant.js +2 -0
  145. package/esm/presentation/chart.js +2 -0
  146. package/esm/presentation/comments.js +2 -0
  147. package/esm/presentation/diagram.js +2 -0
  148. package/esm/presentation/event-subscription.js +2 -0
  149. package/esm/presentation/export.js +1 -1
  150. package/esm/presentation/fonts.js +1 -1
  151. package/esm/presentation/index.js +1 -1
  152. package/esm/presentation/presentation.js +2 -0
  153. package/esm/presentation/remote-live.js +2 -0
  154. package/esm/presentation/sdk.js +1 -1
  155. package/esm/presentation/slides-pane.js +2 -0
  156. package/esm/presentation/theme.js +2 -0
  157. package/esm/shared/assets.js +1 -1
  158. package/esm/shared/attachment.js +1 -1
  159. package/esm/shared/brand.js +1 -1
  160. package/esm/shared/collaborators.js +1 -1
  161. package/esm/shared/comments.js +1 -1
  162. package/esm/shared/copy.js +2 -0
  163. package/esm/shared/device.js +2 -0
  164. package/esm/shared/download.js +2 -2
  165. package/esm/shared/drag-n-drop.js +5 -0
  166. package/esm/shared/duplicate.js +5 -0
  167. package/esm/shared/edit.js +2 -0
  168. package/esm/shared/editor.js +1 -1
  169. package/esm/shared/export.js +1 -1
  170. package/esm/shared/feature.js +1 -1
  171. package/esm/shared/file.js +1 -1
  172. package/esm/shared/follow-mode.js +1 -1
  173. package/esm/shared/fonts.js +1 -1
  174. package/esm/shared/guides.js +2 -0
  175. package/esm/shared/history.js +1 -1
  176. package/esm/shared/import.js +1 -1
  177. package/esm/shared/index.js +1 -1
  178. package/esm/shared/link.js +1 -1
  179. package/esm/shared/logs.js +2 -0
  180. package/esm/shared/mention.js +1 -1
  181. package/esm/shared/menu.js +1 -1
  182. package/esm/shared/mode.js +1 -1
  183. package/esm/shared/outline.js +1 -1
  184. package/esm/shared/paste.js +2 -0
  185. package/esm/shared/presentation.js +2 -0
  186. package/esm/shared/render.js +2 -0
  187. package/esm/shared/share.js +2 -0
  188. package/esm/shared/shortcut.js +2 -0
  189. package/esm/shared/socket.js +2 -0
  190. package/esm/shared/toolbar.js +1 -1
  191. package/esm/shared/ui.js +1 -1
  192. package/esm/shared/uploader.js +1 -1
  193. package/esm/shared/version.js +1 -1
  194. package/esm/shared/watermark.js +1 -1
  195. package/esm/sheet/combine-sheets.js +1 -1
  196. package/esm/sheet/date-mention.js +2 -0
  197. package/esm/sheet/event-subscription.js +2 -0
  198. package/esm/sheet/export.js +1 -1
  199. package/esm/sheet/follow-selection.js +2 -0
  200. package/esm/sheet/form.js +1 -1
  201. package/esm/sheet/formula.js +1 -1
  202. package/esm/sheet/import-range.js +1 -1
  203. package/esm/sheet/import.js +2 -0
  204. package/esm/sheet/independent-viewport.js +2 -0
  205. package/esm/sheet/index.js +1 -1
  206. package/esm/sheet/lock.js +1 -1
  207. package/esm/sheet/ole.js +2 -0
  208. package/esm/sheet/paste.js +2 -0
  209. package/esm/sheet/render.js +1 -1
  210. package/esm/sheet/sdk.js +1 -1
  211. package/esm/sheet/sheet-tab.js +2 -0
  212. package/esm/sheet/ui.js +2 -0
  213. package/esm/sheet/worksheet.js +1 -1
  214. package/esm/table/combine-tables.js +2 -0
  215. package/esm/table/copy.js +2 -0
  216. package/esm/table/dashboard.js +2 -0
  217. package/esm/table/explain-page.js +2 -0
  218. package/esm/table/export.js +2 -0
  219. package/esm/table/field.js +2 -0
  220. package/esm/table/form.js +2 -0
  221. package/esm/table/formula.js +2 -0
  222. package/esm/table/history.js +2 -0
  223. package/esm/table/import.js +2 -0
  224. package/esm/table/index.js +3 -1
  225. package/esm/table/list-bar-context-menu.js +2 -0
  226. package/esm/table/mention.js +2 -0
  227. package/esm/table/motable.js +13 -0
  228. package/esm/table/paste.js +2 -0
  229. package/esm/table/render.js +2 -0
  230. package/esm/table/resource.js +1 -1
  231. package/esm/table/sdk.js +1 -1
  232. package/esm/table/shortcuts.js +2 -0
  233. package/esm/table/snapshot.js +2 -0
  234. package/esm/table/subscription.js +22 -0
  235. package/esm/table/table.js +1 -1
  236. package/esm/table/template.js +2 -0
  237. package/esm/table/toolbar.js +1 -1
  238. package/esm/table/toolbox.js +2 -0
  239. package/esm/table/ui.js +2 -0
  240. package/esm/table/version.js +2 -0
  241. package/esm/table/view.js +23 -0
  242. package/esm/table/window.js +2 -0
  243. package/package.json +1 -1
  244. package/types/combine.d.ts +2985 -265
  245. package/types/diagram.d.ts +823 -115
  246. package/types/docs.d.ts +850 -115
  247. package/types/docx.d.ts +1096 -119
  248. package/types/form.d.ts +3027 -0
  249. package/types/pdf.d.ts +829 -115
  250. package/types/presentation.d.ts +1088 -129
  251. package/types/shared.d.ts +823 -115
  252. package/types/sheet.d.ts +1112 -161
  253. package/types/table.d.ts +2097 -173
  254. package/cjs/shared/checkpoints.js +0 -19
  255. package/cjs/sheet/comments.js +0 -3
  256. package/cjs/sheet/font.js +0 -3
  257. package/esm/shared/checkpoints.js +0 -16
  258. package/esm/sheet/comments.js +0 -2
  259. package/esm/sheet/font.js +0 -2
package/types/shared.d.ts CHANGED
@@ -21,16 +21,6 @@ export declare abstract class AbstractedEditorFileUploader {
21
21
  abstract resume(taskIds?: string[]): void;
22
22
  }
23
23
 
24
- export declare type CheckLimitationResult = {
25
- status: 'limited';
26
- /**
27
- * 被限制原因
28
- */
29
- reason?: string;
30
- } | {
31
- status: 'unlimited';
32
- };
33
-
34
24
  /**
35
25
  * 协作者信息接口
36
26
  */
@@ -106,7 +96,7 @@ export declare interface EditorAssetsOssImageProcessing {
106
96
  quality?: number;
107
97
  maxWidth?: number;
108
98
  maxHeight?: number;
109
- }) => Promise<string>;
99
+ }) => string;
110
100
  /**
111
101
  * 裁切图片的方法
112
102
  * @param imageUrl 图片的 URL
@@ -114,12 +104,12 @@ export declare interface EditorAssetsOssImageProcessing {
114
104
  * @returns 裁切后的图片 URL
115
105
  */
116
106
  crop: (imageUrl: string, cropOptions: {
117
- x?: number;
118
- y?: number;
107
+ x: number;
108
+ y: number;
119
109
  w: number;
120
110
  h: number;
121
- g?: EditorImageCropPoint;
122
- }) => Promise<string>;
111
+ g: EditorImageCropPoint;
112
+ }) => string;
123
113
  }
124
114
 
125
115
  export declare interface EditorAssetsResolver {
@@ -128,13 +118,13 @@ export declare interface EditorAssetsResolver {
128
118
  * @param assetId 资源文件 ID
129
119
  * @returns 转换后的资源 URL ,如果无法转换则返回 null
130
120
  */
131
- resolveUrl: (assetId: string) => Promise<string | null>;
121
+ resolveUrl: (assetId: string) => string | null;
132
122
  /**
133
123
  * 从 URL 中解析资源文件 ID 的方法
134
124
  * @param url 资源 URL
135
125
  * @returns 解析出的资源文件 ID
136
126
  */
137
- parseId: (url: string) => Promise<string | null>;
127
+ parseId: (url: string) => string | null;
138
128
  /**
139
129
  * 检查资源文件 ID 对应的文件是否准备就绪,
140
130
  * 在部分环境中,资源文件需要异步导入,在编辑器加载的时候可能还未准备就绪
@@ -144,6 +134,28 @@ export declare interface EditorAssetsResolver {
144
134
  checkAssetReady: (assetId: string) => Promise<boolean> | boolean;
145
135
  }
146
136
 
137
+ /**
138
+ * 编辑器附件下载配置
139
+ */
140
+ export declare interface EditorAttachmentDownloadOptions {
141
+ /**
142
+ * 是否禁用下载
143
+ */
144
+ disabled?: boolean;
145
+ /**
146
+ * 是否跳过验证
147
+ */
148
+ skipValidate?: boolean;
149
+ /**
150
+ * 下载附件
151
+ */
152
+ download?: (url: string) => void;
153
+ /**
154
+ * 获取附件下载地址
155
+ */
156
+ getDownloadUrl?: (url: string) => Promise<string>;
157
+ }
158
+
147
159
  /**
148
160
  * 编辑器附件限制配置,sdk中会使用在不同的场景下使用不同的限制规则组合
149
161
  */
@@ -153,9 +165,9 @@ export declare interface EditorAttachmentLimitationOptions {
153
165
  * @param file
154
166
  * @returns
155
167
  */
156
- checkFile: (params: EditorAttachmentLimitationOptionsCheckFunctionParams) => Promise<{
168
+ checkFile?: (params: EditorAttachmentLimitationOptionsCheckFunctionParams) => Promise<{
157
169
  limited: true;
158
- message: string;
170
+ message?: string;
159
171
  } | {
160
172
  limited: false;
161
173
  }>;
@@ -204,9 +216,24 @@ export declare interface EditorAttachmentMaxSizeOptions {
204
216
  * 编辑器附件信息
205
217
  */
206
218
  export declare interface EditorAttachmentOptions {
219
+ /**
220
+ * 附件选择器
221
+ */
207
222
  picker?: EditorFilePicker;
223
+ /**
224
+ * 附件上传器
225
+ */
208
226
  uploader?: AbstractedEditorFileUploader;
227
+ /**
228
+ * 下载
229
+ * @deprecated, 使用不同类型附件的download配置
230
+ */
209
231
  download?: (url: string) => void;
232
+ /**
233
+ * 预览
234
+ * @deprecated, 使用不同类型附件的preview配置
235
+ */
236
+ preview?: (url: string) => void;
210
237
  /**
211
238
  * 图片附件相关配置
212
239
  */
@@ -224,9 +251,27 @@ export declare interface EditorAttachmentOptions {
224
251
  * 图片附件的限制配置
225
252
  */
226
253
  limitations?: EditorAttachmentLimitationOptions;
254
+ /**
255
+ * 禁止预览
256
+ * @deprecated 使用preview.disabled代替
257
+ */
258
+ disablePreview?: boolean;
259
+ /**
260
+ * 预览
261
+ */
262
+ preview?: EditorAttachmentPreviewOptions;
263
+ /**
264
+ * 下载
265
+ */
266
+ download?: EditorAttachmentDownloadOptions;
267
+ /**
268
+ * 是否禁用缩略图
269
+ * 桌面客户端/极速sdk需要禁用
270
+ */
271
+ disableThumbnail?: boolean;
227
272
  };
228
273
  /**
229
- * 其他附件相关配置
274
+ * 附件相关配置
230
275
  */
231
276
  attachment?: {
232
277
  /**
@@ -242,9 +287,94 @@ export declare interface EditorAttachmentOptions {
242
287
  * 附件的限制配置
243
288
  */
244
289
  limitations?: EditorAttachmentLimitationOptions;
290
+ /**
291
+ * 禁止预览
292
+ * @deprecated 使用preview.disabled代替
293
+ */
294
+ disablePreview?: boolean;
295
+ /**
296
+ * 预览
297
+ */
298
+ preview?: EditorAttachmentPreviewOptions;
299
+ /**
300
+ * 下载
301
+ */
302
+ download?: EditorAttachmentDownloadOptions;
303
+ };
304
+ /**
305
+ * 视频相关配置
306
+ */
307
+ video?: {
308
+ /**
309
+ * 支持的视频格式
310
+ */
311
+ supportTypes?: string[];
312
+ /**
313
+ * 视频的限制配置
314
+ */
315
+ limitations?: EditorAttachmentLimitationOptions;
316
+ /**
317
+ * 预览
318
+ */
319
+ preview?: EditorAttachmentPreviewOptions;
320
+ /**
321
+ * 下载
322
+ */
323
+ download?: EditorAttachmentDownloadOptions;
324
+ };
325
+ /**
326
+ * 音频相关配置
327
+ */
328
+ audio?: {
329
+ /**
330
+ * 支持的音频
331
+ */
332
+ supportTypes?: string[];
333
+ /**
334
+ * 音频的限制配置
335
+ */
336
+ limitations?: EditorAttachmentLimitationOptions;
337
+ /**
338
+ * 预览
339
+ */
340
+ preview?: EditorAttachmentPreviewOptions;
341
+ /**
342
+ * 下载
343
+ */
344
+ download?: EditorAttachmentDownloadOptions;
345
+ };
346
+ /**
347
+ * 云文件附件相关配置
348
+ */
349
+ cloudFile?: {
350
+ /**
351
+ * 是否禁用云文件
352
+ */
353
+ disabled?: boolean;
245
354
  };
246
355
  }
247
356
 
357
+ /**
358
+ * 编辑器附件预览配置
359
+ */
360
+ export declare interface EditorAttachmentPreviewOptions {
361
+ /**
362
+ * 预览附件
363
+ * app, 桌面客户端需提供
364
+ */
365
+ preview?: (url: string) => void;
366
+ /**
367
+ * 获取附件预览url,saas、sdk、极速sdk需要提供
368
+ * @param id 文件url
369
+ * @returns 预览url
370
+ */
371
+ getPreviewUrl?: (url: string) => Promise<string>;
372
+ /**
373
+ * 是否禁用预览
374
+ */
375
+ disabled?: boolean;
376
+ }
377
+
248
378
  /**
249
379
  * 基础文件属性
250
380
  */
@@ -255,11 +385,19 @@ export declare interface EditorBaseUploadableFile {
255
385
  fileGuid: string;
256
386
  }
257
387
 
388
+ /**
389
+ * 品牌设置
390
+ */
391
+ export declare interface EditorBrandOptions {
392
+ enable: boolean;
393
+ getSettings: () => Promise<EditorBrandSetting | null>;
394
+ }
395
+
258
396
  /**
259
397
  * 品牌相关设置,
260
398
  * 用于在套件中展示品牌外露信息
261
399
  */
262
- export declare interface EditorBrandOptions {
400
+ export declare interface EditorBrandSetting {
263
401
  /**
264
402
  * 需要显示在品牌展示位的内容,按数组顺序显示
265
403
  */
@@ -280,24 +418,6 @@ export declare interface EditorBrandOptions {
280
418
  };
281
419
  }
282
420
 
283
- export declare interface EditorCheckpointsOptions {
284
- /**
285
- * 获取功能卡点限制
286
- * undefined代表无限制
287
- */
288
- getFeatureLimitation?: (key: string) => Limitation | undefined;
289
- /**
290
- * 检查是否超限
291
- * @param key 功能卡点key
292
- * @param value 功能卡点检查值,如文件大小/行列数量等
293
- */
294
- checkFeatureLimitation?: (key: string, value: number) => CheckLimitationResult;
295
- /**
296
- * 获取功能卡点状态,如某功能入口是否开启
297
- */
298
- getFeatureStatus?: (key: string) => FeatureStatus;
299
- }
300
-
301
421
  export declare interface EditorCollaborationOptions {
302
422
  /**
303
423
  * 是否允许离线编辑
@@ -339,23 +459,36 @@ export declare interface EditorCollaborators {
339
459
  * 停止监听协作者状态变化
340
460
  * 调用此方法后,将不再接收协作者进入/离开的事件
341
461
  */
342
- stop: () => void;
462
+ quit: () => void;
463
+ /**
464
+ * 监听事件
465
+ */
466
+ on: (event: string, callback: (...args: unknown[]) => void) => unknown;
343
467
  /**
344
- * 添加协作者进入事件监听器
345
- * @param listener - 监听器回调函数,参数如下:
346
- * - allUsers: 当前所有协作者列表
347
- * - enteredUsers: 新进入的协作者列表
348
- * @returns 返回一个函数,调用该函数可以移除监听器
468
+ * 监听事件, 只监听一次
349
469
  */
350
- addUserEnterListener: (listener: (allUsers: CollaboratorInfo[], enteredUsers: CollaboratorInfo[]) => void) => () => void;
470
+ once: (event: string, callback: (...args: unknown[]) => void) => unknown;
351
471
  /**
352
- * 添加协作者离开事件监听器
353
- * @param listener - 监听器回调函数
354
- * - allUsers: 当前所有协作者列表
355
- * - leftUsers: 离开的协作者列表
356
- * @returns 返回一个函数,调用该函数可以移除监听器
472
+ * 移除事件
357
473
  */
358
- addUserLeaveListener: (listener: (allUsers: CollaboratorInfo[], leftUsers: CollaboratorInfo[]) => void) => () => void;
474
+ off: (event: string, callback: (...args: unknown[]) => void) => unknown;
475
+ /**
476
+ * 发送事件
477
+ */
478
+ emit: (event: string, ...args: unknown[]) => unknown;
479
+ }
480
+
481
+ export declare interface EditorCollaboratorsOptions {
482
+ /**
483
+ * 是否禁用
484
+ */
485
+ disabled?: boolean;
486
+ /**
487
+ * 推送协作者socket 对象
488
+ * 实际类型为socketIO.client
489
+ * TODO: 抽象为接口
490
+ */
491
+ socket?: EditorSocket;
359
492
  }
360
493
 
361
494
  /**
@@ -419,6 +552,14 @@ export declare interface EditorComments {
419
552
  * 删除单条评论
420
553
  */
421
554
  deleteOne: (commentId: string) => Promise<boolean>;
555
+ /**
556
+ * 显示评论(侧边栏或其他形式)
557
+ */
558
+ show?: () => void;
559
+ /**
560
+ * 隐藏评论(侧边栏或其他形式)
561
+ */
562
+ hide?: () => void;
422
563
  }
423
564
 
424
565
  /**
@@ -454,11 +595,22 @@ export declare interface EditorCommentsOptions extends EditorFeatureConfig {
454
595
  mode: 'none' | 'card';
455
596
  };
456
597
  /**
457
- * 评论变化监听
458
- * @param listener
459
- * @returns 返回一个函数,调用该函数可以移除监听器
598
+ * 推送评论的 socket 对象
599
+ */
600
+ socket?: EditorSocket;
601
+ /**
602
+ * 评论相关功能配置
460
603
  */
461
- addChangedListener?: (listener: (type: 'create' | 'update' | 'close', data: EditorCommentItem) => void) => () => void;
604
+ features?: {
605
+ /**
606
+ * 添加评论
607
+ */
608
+ addComment?: EditorFeatureConfig;
609
+ /**
610
+ * 评论列表
611
+ */
612
+ commentList?: EditorFeatureConfig;
613
+ };
462
614
  }
463
615
 
464
616
  export declare interface EditorContent<Delta = EditorDelta> {
@@ -484,6 +636,11 @@ export declare interface EditorContent<Delta = EditorDelta> {
484
636
  */
485
637
  export declare type EditorContextMenuOptions<TName extends string> = EditorMenuOptions<TName>;
486
638
 
639
+ /**
640
+ * 粘贴相关设置
641
+ */
642
+ export declare type EditorCopyOptions = EditorLogicFeatureConfig;
643
+
487
644
  /**
488
645
  * 编辑器解密选项接口
489
646
  * 用于配置编辑器中需要解密的内容的相关选项
@@ -504,6 +661,28 @@ export declare interface EditorDelta {
504
661
  length: number;
505
662
  }
506
663
 
664
+ export declare type EditorDeviceMode = 'desktop' | 'mobile' | 'tablet';
665
+
666
+ /**
667
+ * 编辑器设备相关设置
668
+ */
669
+ export declare interface EditorDeviceOptions {
670
+ /**
671
+ * 设备模式
672
+ */
673
+ mode?: EditorDeviceMode;
674
+ }
675
+
676
+ /**
677
+ * 编辑器拖放配置
678
+ */
679
+ export declare type EditorDragNDropOptions = EditorFeatureConfig;
680
+
681
+ /**
682
+ * 编辑器创建副本配置
683
+ */
684
+ export declare type EditorDuplicateOptions = EditorFeatureConfig;
685
+
507
686
  /**
508
687
  * 编辑器嵌入对象
509
688
  */
@@ -553,15 +732,20 @@ export declare interface EditorEmbeddedObjectOptions {
553
732
  };
554
733
  }
555
734
 
556
- export declare interface EditorExportOptions {
735
+ export declare interface EditorExportOptions extends EditorFeatureConfig {
736
+ /**
737
+ * 可导出类型, undefined 表示对可导出类型无限制
738
+ * 导出由接口 + 本地实现
739
+ */
740
+ types?: string[];
557
741
  /**
558
- * 可导出类型
742
+ * 接口支持的导出类型
559
743
  */
560
744
  supportedTypes?: string[];
561
745
  /**
562
- * 导出文件
746
+ * 导出文件,调用接口实现
563
747
  */
564
- exportFile: (type: string) => Promise<void>;
748
+ exportFile?: (type: string) => Promise<void>;
565
749
  }
566
750
 
567
751
  export declare interface EditorFeatureConfig {
@@ -575,6 +759,28 @@ export declare interface EditorFeatureConfig {
575
759
  hidden?: boolean;
576
760
  }
577
761
 
762
+ export declare interface EditorFeaturesOptions {
763
+ /**
764
+ * 禁用特性入口
765
+ */
766
+ disabled?: boolean;
767
+ /**
768
+ * 对应/features接口,返回所有功能key
769
+ */
770
+ getFeatures?: () => Promise<string[]>;
771
+ }
772
+
773
+ /**
774
+ * 文件限制
775
+ */
776
+ export declare interface EditorFileLimitationOptions {
777
+ /**
778
+ * 获取最大文件大小,单位为MB
779
+ * 超过该上限后禁止编辑
780
+ */
781
+ getMaxFileSize?: () => number | undefined;
782
+ }
783
+
578
784
  export declare interface EditorFileOptions {
579
785
  /**
580
786
  * 文件guid
@@ -584,6 +790,18 @@ export declare interface EditorFileOptions {
584
790
  * 文件名
585
791
  */
586
792
  name?: string;
793
+ /**
794
+ * 创建者,以id标识
795
+ */
796
+ creator?: number;
797
+ /**
798
+ * 创建时间, 毫秒级时间戳
799
+ */
800
+ createdAt?: number;
801
+ /**
802
+ * 文件限制
803
+ */
804
+ limitations?: EditorFileLimitationOptions;
587
805
  }
588
806
 
589
807
  export declare interface EditorFilePicker {
@@ -613,7 +831,7 @@ export declare interface EditorFollowMode {
613
831
  * 获取当前演讲者信息
614
832
  * @returns 返回包含演讲者ID、姓名和头像信息的对象
615
833
  */
616
- getSpeaker: () => Speaker;
834
+ getSpeaker: () => Speaker | undefined;
617
835
  /**
618
836
  * 添加跟随状态变化的监听器
619
837
  * @param listener 状态变化时的回调函数
@@ -628,7 +846,7 @@ export declare interface EditorFollowModeOptions extends EditorFeatureConfig {
628
846
  * 实际类型为socketIO.client
629
847
  * TODO: 抽象为接口
630
848
  */
631
- socket?: unknown;
849
+ socket?: EditorSocket;
632
850
  }
633
851
 
634
852
  export declare interface EditorFontFace {
@@ -707,17 +925,35 @@ export declare interface EditorFontsOptions {
707
925
  * 并提供可用于字体的加载 URL 和字体元数据。
708
926
  */
709
927
  list: EditorFontsList;
928
+ /**
929
+ * 是否只使用本地字体,如果为 true,则不会从服务器获取字体列表。
930
+ */
931
+ useLocalFontsOnly?: boolean;
932
+ }
933
+
934
+ /**
935
+ * 功能引导设置
936
+ */
937
+ export declare interface EditorGuidesOptions {
938
+ /**
939
+ * 是否禁用
940
+ */
941
+ disabled?: boolean;
942
+ /**
943
+ * 获取引导数据
944
+ */
945
+ data?: <T = GuideData>() => Promise<T>;
710
946
  }
711
947
 
712
948
  export declare interface EditorHistory {
713
949
  /**
714
- * 显示历史记录侧边栏
950
+ * 显示历史记录(侧边栏或其他形式)
715
951
  */
716
- showSidebar: () => void;
952
+ show: () => void;
717
953
  /**
718
- * 隐藏历史记录侧边栏
954
+ * 隐藏历史记录(侧边栏或其他形式)
719
955
  */
720
- hideSidebar: () => void;
956
+ hide: () => void;
721
957
  }
722
958
 
723
959
  export declare type EditorHistoryOptions = EditorFeatureConfig;
@@ -740,7 +976,12 @@ export declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'cen
740
976
 
741
977
  export declare interface EditorImportOptions {
742
978
  /**
743
- * 获取导入状态,没有contentUrl时需要显示导入进度
979
+ * 当前文件是否正在导入中
980
+ * 用于初始化时判断是否需要显示导入进度
981
+ */
982
+ isImporting?: boolean;
983
+ /**
984
+ * 获取当前文件导入状态,没有contentUrl时需要显示导入进度
744
985
  * 待导入完成后再渲染
745
986
  */
746
987
  getImportStatus?: () => Promise<{
@@ -757,15 +998,19 @@ export declare interface EditorImportOptions {
757
998
  * 导入完成
758
999
  */
759
1000
  status: 'completed';
1001
+ /**
1002
+ * 导入完成后的内容URL
1003
+ */
1004
+ contentUrl: string;
760
1005
  } | {
761
1006
  /**
762
1007
  * 导入失败
763
1008
  */
764
1009
  status: 'failed';
765
1010
  /**
766
- * 导入失败错误信息
1011
+ * 导入失败报错
767
1012
  */
768
- errorMessage?: string;
1013
+ error?: unknown;
769
1014
  }>;
770
1015
  }
771
1016
 
@@ -818,6 +1063,74 @@ export declare interface EditorLocalUploadableFile extends EditorBaseUploadableF
818
1063
  raw: File;
819
1064
  }
820
1065
 
1066
+ /**
1067
+ * 纯逻辑功能配置。
1068
+ * 不包含 UI 相关配置,仅用于逻辑判断。
1069
+ * 如:权限判断、功能开关等。
1070
+ * 所以不需要hidden,只使用disabled来判断
1071
+ */
1072
+ export declare type EditorLogicFeatureConfig = Omit<EditorFeatureConfig, 'hidden'>;
1073
+
1074
+ export declare interface EditorLogsOptions {
1075
+ /**
1076
+ * 是否禁用审计日志
1077
+ * sdk2.0需要禁用
1078
+ */
1079
+ isAuditLogDisabled?: boolean;
1080
+ /**
1081
+ * 是否禁用日志
1082
+ */
1083
+ disabled?: boolean;
1084
+ }
1085
+
1086
+ export declare interface EditorMentionOptions extends EditorFeatureConfig {
1087
+ /**
1088
+ * mention api url前缀
1089
+ * @shimo/mention-suggestion 需要用到
1090
+ * 对应环境变量 SDK_V2_PATH_PREFIX
1091
+ */
1092
+ apiUrlPrefix?: string;
1093
+ /**
1094
+ * mention文件卡片禁用设置
1095
+ */
1096
+ disableFileCard?: boolean;
1097
+ /**
1098
+ * mention日期卡片禁用设置
1099
+ */
1100
+ disableDateCard?: boolean;
1101
+ /**
1102
+ * mention用户卡片禁用设置
1103
+ */
1104
+ disableUserCard?: boolean;
1105
+ /**
1106
+ * mention点击回调
1107
+ */
1108
+ onMentionClick?: (payload: MentionEventPayload) => void;
1109
+ /**
1110
+ * mention文件选择弹窗支持的tab类型
1111
+ */
1112
+ mentionFilePanelTabs?: ('mine' | 'recent' | 'space')[];
1113
+ /**
1114
+ * mention弹窗底部支持的tab类型
1115
+ */
1116
+ mentionPopoverTabs?: ('contacts' | 'file' | 'calendar')[];
1117
+ /**
1118
+ * 是否禁止检查组织架构成员可见性
1119
+ * 该属性需要各套件对接最新版本@shimo/mention-suggestion(没用到的话可忽略)
1120
+ */
1121
+ disableCheckStaffVisibility?: boolean;
1122
+ }
1123
+
1124
+ /**
1125
+ * 编辑器菜单api
1126
+ */
1127
+ export declare interface EditorMenu {
1128
+ /**
1129
+ * 菜单功能api
1130
+ */
1131
+ features: EditorMenuFeatures;
1132
+ }
1133
+
821
1134
  /**
822
1135
  * 基础菜单项配置,所有菜单项类型都包含这些属性
823
1136
  */
@@ -918,6 +1231,38 @@ export declare interface EditorMenuFeatureConfig extends EditorFeatureConfig {
918
1231
  index?: number;
919
1232
  }
920
1233
 
1234
+ /**
1235
+ * 编辑器菜单功能api
1236
+ *
1237
+ * 提供对菜单项的显示、隐藏、启用和禁用等操作
1238
+ */
1239
+ export declare interface EditorMenuFeatures {
1240
+ /**
1241
+ * 显示菜单项
1242
+ * @param name 菜单项名称
1243
+ */
1244
+ showFeature: (name: string) => void;
1245
+ /**
1246
+ * 隐藏菜单项
1247
+ * @param name 菜单项名称
1248
+ */
1249
+ hideFeature: (name: string) => void;
1250
+ /**
1251
+ * 启用菜单项
1252
+ * @param name 菜单项名称
1253
+ */
1254
+ enableFeature: (name: string) => void;
1255
+ /**
1256
+ * 禁用菜单项
1257
+ * @param name 菜单项名称
1258
+ */
1259
+ disableFeature: (name: string) => void;
1260
+ /**
1261
+ * 恢复菜单项到默认状态,即根据配置项确定如何渲染菜单项。
1262
+ */
1263
+ resetFeature: (name: string) => void;
1264
+ }
1265
+
921
1266
  /**
922
1267
  * 隐藏菜单项配置
923
1268
  */
@@ -984,7 +1329,7 @@ export declare interface EditorMenuOptions<TName extends EditorMenuName> {
984
1329
  * 更加间接的配置项
985
1330
  * 仅在 TName 为字符串类型时有效
986
1331
  */
987
- features?: TName extends string ? Partial<Record<TName, EditorMenuFeatureConfig>> : never;
1332
+ features?: [TName] extends [string] ? Partial<Record<TName, EditorMenuFeatureConfig>> : never;
988
1333
  /**
989
1334
  * 自定义按钮配置
990
1335
  */
@@ -1020,9 +1365,25 @@ export declare type EditorModeOptions = {
1020
1365
  */
1021
1366
  role?: EditorStandardRole;
1022
1367
  } | {
1368
+ /**
1369
+ * 预览模式
1370
+ */
1023
1371
  type: 'preview';
1024
1372
  } | {
1373
+ /**
1374
+ * 演示模式
1375
+ */
1025
1376
  type: 'presentation';
1377
+ } | {
1378
+ /**
1379
+ * 历史模式
1380
+ */
1381
+ type: 'history';
1382
+ } | {
1383
+ /**
1384
+ * 嵌入模式
1385
+ */
1386
+ type: 'embedded';
1026
1387
  };
1027
1388
 
1028
1389
  /**
@@ -1030,8 +1391,9 @@ export declare type EditorModeOptions = {
1030
1391
  * - `standard` 标准模式,会根据用户权限配置不同的功能
1031
1392
  * - `preview` 预览模式,只能查看内容
1032
1393
  * - `presentation` 演示模式,用作演示场景,演示模式下部分套件可以进行一些简单的编辑操作
1394
+ * - `history` 历史模式,用作查看历史版本场景
1033
1395
  */
1034
- export declare type EditorModeType = 'standard' | 'preview' | 'presentation';
1396
+ export declare type EditorModeType = 'standard' | 'preview' | 'presentation' | 'history' | 'embedded';
1035
1397
 
1036
1398
  /**
1037
1399
  * 编辑器初始化通用参数
@@ -1055,7 +1417,7 @@ export declare interface EditorOptions {
1055
1417
  */
1056
1418
  anonymous?: EditorAnonymousOptions;
1057
1419
  /**
1058
- * 当前文件信息
1420
+ * 当前文件信息 & 配置
1059
1421
  */
1060
1422
  file?: EditorFileOptions;
1061
1423
  /**
@@ -1065,7 +1427,7 @@ export declare interface EditorOptions {
1065
1427
  /**
1066
1428
  * 品牌相关设置
1067
1429
  */
1068
- brand?: MaybePromiseValue<EditorBrandOptions>;
1430
+ brand?: EditorBrandOptions;
1069
1431
  /**
1070
1432
  * 编辑器内部资源请求配置
1071
1433
  */
@@ -1114,10 +1476,6 @@ export declare interface EditorOptions {
1114
1476
  * 编辑器 UI 相关
1115
1477
  */
1116
1478
  ui?: EditorUiOptions;
1117
- /**
1118
- * 编辑器卡点限制
1119
- */
1120
- checkpoints?: EditorCheckpointsOptions;
1121
1479
  /**
1122
1480
  * 编辑器工具箱设置
1123
1481
  */
@@ -1130,6 +1488,54 @@ export declare interface EditorOptions {
1130
1488
  * 编辑器协作相关
1131
1489
  */
1132
1490
  collaboration?: EditorCollaborationOptions;
1491
+ /**
1492
+ * 编辑器功能相关设置
1493
+ */
1494
+ features?: EditorFeaturesOptions;
1495
+ /**
1496
+ * 编辑器版本相关设置
1497
+ */
1498
+ version?: EditorVersionOptions;
1499
+ /**
1500
+ * 编辑器日志相关设置
1501
+ */
1502
+ logs?: EditorLogsOptions;
1503
+ /**
1504
+ * 编辑器快捷键相关设置
1505
+ */
1506
+ shortcuts?: EditorShortcutOptions;
1507
+ /**
1508
+ * 提及相关设置
1509
+ */
1510
+ mention?: EditorMentionOptions;
1511
+ /**
1512
+ * 编辑器拖放相关配置
1513
+ */
1514
+ dragNDrop?: EditorDragNDropOptions;
1515
+ /**
1516
+ * 编辑器引导相关设置
1517
+ */
1518
+ guides?: EditorGuidesOptions;
1519
+ /**
1520
+ * 编辑器复制相关设置
1521
+ */
1522
+ copy?: EditorCopyOptions;
1523
+ /**
1524
+ * 编辑器粘贴相关设置
1525
+ */
1526
+ paste?: EditorPasteOptions;
1527
+ /**
1528
+ * 编辑器设备信息相关设置
1529
+ */
1530
+ device?: EditorDeviceOptions;
1531
+ /**
1532
+ * 编辑器副本相关配置
1533
+ */
1534
+ duplicate?: EditorDuplicateOptions;
1535
+ /**
1536
+ * 分享相关接口
1537
+ */
1538
+ share?: EditorShareOptions;
1133
1539
  }
1134
1540
 
1135
1541
  /**
@@ -1182,7 +1588,7 @@ export declare interface EditorOutlineItem<Content = unknown> {
1182
1588
  * 大纲目录初始化参数,
1183
1589
  * 用于配置大纲目录的行为和外观。
1184
1590
  */
1185
- export declare interface EditorOutlineOptions {
1591
+ export declare interface EditorOutlineOptions extends EditorLogicFeatureConfig {
1186
1592
  /**
1187
1593
  * 初始化编辑器时是否显示大纲目录,
1188
1594
  * 默认为 false。
@@ -1190,6 +1596,50 @@ export declare interface EditorOutlineOptions {
1190
1596
  visible?: boolean;
1191
1597
  }
1192
1598
 
1599
+ export declare interface EditorPasteLimitationOptions {
1600
+ /**
1601
+ * 检查粘贴内容的规则
1602
+ * @param content
1603
+ * @returns
1604
+ */
1605
+ checkContent?: (params: EditorPasteLimitationOptionsCheckFunctionParams) => Promise<{
1606
+ limited: true;
1607
+ message: string;
1608
+ } | {
1609
+ limited: false;
1610
+ }>;
1611
+ /**
1612
+ * 获取最大粘贴数据大小,单位为MB
1613
+ */
1614
+ getMaxDataSize?: () => Promise<number | undefined>;
1615
+ }
1616
+
1617
+ export declare interface EditorPasteLimitationOptionsCheckFunctionParams {
1618
+ content: string;
1619
+ }
1620
+
1621
+ /**
1622
+ * 粘贴相关设置
1623
+ */
1624
+ export declare interface EditorPasteOptions extends EditorFeatureConfig {
1625
+ /**
1626
+ * 是否禁用远程图片粘贴, turbo暂时不支持远程图片粘贴
1627
+ */
1628
+ isRemoteImgDisabled?: boolean;
1629
+ /**
1630
+ * 粘贴内容限制规则
1631
+ */
1632
+ limitations?: EditorPasteLimitationOptions;
1633
+ }
1634
+
1635
+ export declare interface EditorPerformanceOptions {
1636
+ /**
1637
+ * 记录性能指标
1638
+ * @param mark 性能指标名称
1639
+ */
1640
+ record?: (mark: 'first_page' | 'first_editable_page') => void;
1641
+ }
1642
+
1193
1643
  export declare interface EditorPickedFile {
1194
1644
  /**
1195
1645
  * 文件大小
@@ -1213,6 +1663,17 @@ export declare interface EditorPickedFile {
1213
1663
  raw: File;
1214
1664
  }
1215
1665
 
1666
+ export declare interface EditorPresentation {
1667
+ /**
1668
+ * 进入演示模式
1669
+ */
1670
+ start: () => Promise<void>;
1671
+ /**
1672
+ * 退出演示模式
1673
+ */
1674
+ quit: () => Promise<void>;
1675
+ }
1676
+
1216
1677
  /**
1217
1678
  * 编辑器打印设置
1218
1679
  */
@@ -1237,6 +1698,13 @@ export declare interface EditorRemoteUploadableFile extends EditorBaseUploadable
1237
1698
  raw?: never;
1238
1699
  }
1239
1700
 
1701
+ export declare interface EditorRenderOptions {
1702
+ /**
1703
+ * 用于定位的锚点
1704
+ */
1705
+ hash?: string;
1706
+ }
1707
+
1240
1708
  /**
1241
1709
  * 编辑器通用接口
1242
1710
  */
@@ -1289,6 +1757,62 @@ export declare abstract class EditorSDK {
1289
1757
  * 部分环境不存在,如离线客户端
1290
1758
  */
1291
1759
  abstract get version(): EditorVersion | undefined;
1760
+ /**
1761
+ * 编辑器菜单栏相关接口
1762
+ */
1763
+ abstract get menu(): EditorMenu | undefined;
1764
+ /**
1765
+ * 编辑器演示模式相关接口
1766
+ */
1767
+ abstract get presentation(): EditorPresentation | undefined;
1768
+ }
1769
+
1770
+ export declare interface EditorShareOptions extends EditorLogicFeatureConfig {
1771
+ /**
1772
+ * 当前文件是否为共享文件
1773
+ */
1774
+ isShared?: boolean;
1775
+ }
1776
+
1777
+ export declare interface EditorShortcutOptions {
1778
+ /**
1779
+ * 自定义快捷键
1780
+ */
1781
+ customShortcuts?: ShortcutConfig[];
1782
+ /**
1783
+ * 禁用的快捷键
1784
+ * 桌面客户端需要禁用ctrl+s,ctrl+shift+s
1785
+ * 极速sdk需要禁用ctrl+s
1786
+ * sdk2.0需要禁用ctrl+shift+e
1787
+ */
1788
+ disabledShortcuts?: string[];
1789
+ }
1790
+
1791
+ /**
1792
+ * 编辑器 socket 接口, 用于评论、跟随模式、远程演示等场景
1793
+ * 实际类型为 socketIO.client
1794
+ */
1795
+ export declare interface EditorSocket {
1796
+ /**
1797
+ * 监听事件
1798
+ */
1799
+ on: (event: string, callback: (...args: unknown[]) => void) => unknown;
1800
+ /**
1801
+ * 监听事件, 只监听一次
1802
+ */
1803
+ once: (event: string, callback: (...args: unknown[]) => void) => unknown;
1804
+ /**
1805
+ * 移除事件
1806
+ */
1807
+ off: (event: string, callback: (...args: unknown[]) => void) => unknown;
1808
+ /**
1809
+ * 发送事件
1810
+ */
1811
+ emit: (event: string, ...args: unknown[]) => unknown;
1812
+ /**
1813
+ * 断开连接
1814
+ */
1815
+ disconnect: () => unknown;
1292
1816
  }
1293
1817
 
1294
1818
  /**
@@ -1478,6 +2002,12 @@ export declare interface EditorToolbarOptions<TName extends string> {
1478
2002
  * 自定义按钮
1479
2003
  */
1480
2004
  custom?: EditorToolbarFeatureButtonConfig<string>;
2005
+ /**
2006
+ * 工具栏挂载的容器dom,配置后则挂载到指定的容器上
2007
+ *
2008
+ * 如果不配置则按照套件的默认方式挂载。
2009
+ */
2010
+ container?: HTMLElement;
1481
2011
  }
1482
2012
 
1483
2013
  /**
@@ -1515,13 +2045,17 @@ export declare interface EditorUiOptions {
1515
2045
  /**
1516
2046
  * 显示升级弹窗
1517
2047
  */
1518
- showModal?: (options: ShowUpgradeModalProps) => Promise<ShowUpgradeModalResponse>;
2048
+ showModal?: (options: ShowUpgradeModalProps) => Promise<ShowUpgradeModalResponse | undefined>;
1519
2049
  };
1520
2050
  notification?: {
1521
2051
  /**
1522
2052
  * 渲染通知条
1523
2053
  */
1524
2054
  render?: (params: RenderNotificationProps) => void;
2055
+ /**
2056
+ * 是否禁用通知条
2057
+ */
2058
+ disabled?: boolean;
1525
2059
  };
1526
2060
  /**
1527
2061
  * 用户名片
@@ -1535,6 +2069,20 @@ export declare interface EditorUiOptions {
1535
2069
  * 渲染用户卡片
1536
2070
  */
1537
2071
  render?: (params: RenderUserCardProps) => RenderUserCardResult;
2072
+ /**
2073
+ * 是否禁用用户卡片
2074
+ * jd需要禁用
2075
+ */
2076
+ disabled?: boolean;
2077
+ };
2078
+ /**
2079
+ * 登录提示
2080
+ */
2081
+ loginNotice?: {
2082
+ /**
2083
+ * 显示登录提示
2084
+ */
2085
+ show?: () => void;
1538
2086
  };
1539
2087
  /**
1540
2088
  * toast
@@ -1548,6 +2096,10 @@ export declare interface EditorUiOptions {
1548
2096
  * 是否禁用toast
1549
2097
  */
1550
2098
  disabled?: boolean;
2099
+ /**
2100
+ * 自定义toast提示文本配置
2101
+ */
2102
+ tips?: ToastTipsConfig;
1551
2103
  };
1552
2104
  /**
1553
2105
  * confirm
@@ -1562,9 +2114,48 @@ export declare interface EditorUiOptions {
1562
2114
  */
1563
2115
  disabled?: boolean;
1564
2116
  };
2117
+ /**
2118
+ * 全屏配置
2119
+ */
2120
+ fullscreen?: EditorFeatureConfig;
2121
+ /**
2122
+ * 演示模式配置
2123
+ */
2124
+ presentation?: EditorFeatureConfig;
2125
+ /**
2126
+ * 帮助中心配置
2127
+ */
2128
+ helpCenter?: EditorFeatureConfig;
2129
+ /**
2130
+ * 新功能提醒相关配置
2131
+ */
2132
+ newFeature?: {
2133
+ /**
2134
+ * 是否不展示新功能提醒(包括任何形式的)
2135
+ */
2136
+ hidden?: boolean;
2137
+ };
2138
+ /**
2139
+ * 图片查看器配置
2140
+ */
2141
+ imageViewer?: {
2142
+ /**
2143
+ * 右键菜单配置
2144
+ */
2145
+ contextMenu?: EditorMenuOptions<'copy' | 'download'>;
2146
+ /**
2147
+ * 操作配置
2148
+ */
2149
+ operations?: {
2150
+ /**
2151
+ * 下载图片
2152
+ */
2153
+ download: EditorFeatureConfig;
2154
+ };
2155
+ };
1565
2156
  }
1566
2157
 
1567
- export declare type EditorUploadableFile = EditorLocalUploadableFile;
2158
+ export declare type EditorUploadableFile = EditorLocalUploadableFile | EditorRemoteUploadableFile;
1568
2159
 
1569
2160
  /**
1570
2161
  * 文件开始上传入参
@@ -1630,10 +2221,23 @@ export declare interface EditorUserOptions {
1630
2221
  export declare interface EditorVersion {
1631
2222
  /**
1632
2223
  * 保存版本
2224
+ * @param name 版本名称
2225
+ */
2226
+ createRevision: (name?: string) => void;
2227
+ /**
2228
+ * 显示版本(侧边栏或其他形式)
2229
+ * 区别于历史侧边栏,在应用表格里表现为打开历史侧边栏切换到版本 tab
2230
+ */
2231
+ show?: () => void;
2232
+ /**
2233
+ * 隐藏版本(侧边栏或其他形式)
2234
+ * 区别于历史侧边栏,在应用表格里表现为打开历史侧边栏切换到版本 tab
1633
2235
  */
1634
- createRevision: () => void;
2236
+ hide?: () => void;
1635
2237
  }
1636
2238
 
2239
+ export declare type EditorVersionOptions = EditorFeatureConfig;
2240
+
1637
2241
  /**
1638
2242
  * 编辑器外部水印信息
1639
2243
  */
@@ -1641,7 +2245,12 @@ export declare interface EditorWatermarkOptions {
1641
2245
  /**
1642
2246
  * 获取用作初始化使用的默认水印
1643
2247
  */
1644
- getWatermark: () => MaybePromiseValue<EditorWatermarkResource | null>;
2248
+ getWatermark?: () => MaybePromiseValue<EditorWatermarkResource | null>;
2249
+ /**
2250
+ * 获取文件导出水印
2251
+ * @param exportType 导出类型 图片/pdf/纯图pdf
2252
+ */
2253
+ getExportWatermark?: (exportType: 'image' | 'pdf' | 'image_pdf') => Promise<string[] | undefined>;
1645
2254
  /**
1646
2255
  * 是否必须,如果为 true,编辑器将在初始化时强制渲染水印,
1647
2256
  * 水印配置信息加载失败将导致编辑器初始化失败
@@ -1657,28 +2266,13 @@ export declare type EditorWatermarkResource = {
1657
2266
  url: string;
1658
2267
  };
1659
2268
 
1660
- export declare enum FeatureStatus {
1661
- /**
1662
- * 隐藏
1663
- */
1664
- Hidden = 0,
1665
- /**
1666
- * 正常
1667
- */
1668
- Normal = 1,
1669
- /**
1670
- * 禁用
1671
- */
1672
- Disabled = 2
1673
- }
1674
-
1675
2269
  export declare interface FileLinkParams {
1676
2270
  /**
1677
2271
  * 文件guid
1678
2272
  */
1679
2273
  fileGuid: string;
1680
2274
  /**
1681
- * 文件类型,如docs,sheets
2275
+ * 文件类型
1682
2276
  */
1683
2277
  type: string;
1684
2278
  /**
@@ -1737,6 +2331,14 @@ export declare enum FileType {
1737
2331
  CloudFile = 3
1738
2332
  }
1739
2333
 
2334
+ /**
2335
+ * 引导数据
2336
+ */
2337
+ export declare interface GuideData {
2338
+ type: number;
2339
+ id: number;
2340
+ }
2341
+
1740
2342
  /**
1741
2343
  * 请求、响应头
1742
2344
  */
@@ -1844,34 +2446,67 @@ export declare interface HTTPResponse<Data = unknown> {
1844
2446
  */
1845
2447
  export declare type HTTPResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
1846
2448
 
1847
- export declare interface Limitation {
2449
+ export declare type MaybePromiseValue<T> = T | Promise<T>;
2450
+
2451
+ export declare interface MentionEventPayload {
2452
+ /**
2453
+ * 距离页面左边的距离
2454
+ */
2455
+ x: number;
2456
+ /**
2457
+ * 距离页面顶部的距离
2458
+ */
2459
+ y: number;
2460
+ /**
2461
+ * mention信息
2462
+ */
2463
+ mentionInfo: MentionInfo;
2464
+ }
2465
+
2466
+ export declare interface MentionInfo {
2467
+ /** 用户 Id */
2468
+ userId?: number;
2469
+ /** 文件 Id */
2470
+ fileId?: string;
1848
2471
  /**
1849
- * 限制原因(错误码)
2472
+ * mention区域宽度
1850
2473
  */
1851
- code?: number;
2474
+ width?: number;
1852
2475
  /**
1853
- * 单位(不参与计算,仅作显示)
1854
- * minutes、MB
2476
+ * mention区域高度
1855
2477
  */
1856
- unit?: string;
2478
+ height?: number;
1857
2479
  /**
1858
- * 描述
2480
+ * mention区域左上角距离页面左边的距离
1859
2481
  */
1860
- desc?: string;
2482
+ left?: number;
1861
2483
  /**
1862
- * min/max int64 默认表示 MB/个/分钟/行
2484
+ * mention区域左上角距离页面顶部的距离
1863
2485
  */
1864
- max?: number;
1865
- min?: number;
2486
+ top?: number;
1866
2487
  }
1867
2488
 
1868
- export declare type MaybePromiseValue<T> = T | Promise<T>;
1869
-
1870
2489
  /**
1871
2490
  * 升级弹窗类型
1872
2491
  * 个人版或企业版
1873
2492
  */
1874
- export declare type OpenType = 'personal' | 'enterprise';
2493
+ export declare type OpenType = 'personal' | 'enterprise' | 'pendingOrder';
2494
+
2495
+ export declare interface OperationToastConfig {
2496
+ /**
2497
+ * 成功提示文本
2498
+ */
2499
+ success?: string;
2500
+ /**
2501
+ * 失败提示文本
2502
+ */
2503
+ failed?: string;
2504
+ /**
2505
+ * 权限不足提示文本
2506
+ * 桌面客户端安全模式下需要提供【当前账号未获得此项能力授权。】
2507
+ */
2508
+ noPermission?: string;
2509
+ }
1875
2510
 
1876
2511
  export declare interface RenderNotificationProps {
1877
2512
  /**
@@ -1893,15 +2528,15 @@ export declare interface RenderUserCardProps {
1893
2528
  height: number;
1894
2529
  hasReducedHeaderHeight?: boolean;
1895
2530
  };
1896
- position?: 'top' | 'left' | 'right' | 'bottom' | 'left_top' | 'left_bottom' | 'right_top' | 'bottom_top' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right';
1897
- trigger: 'hover' | 'click';
2531
+ position?: 'top' | 'left' | 'right' | 'bottom' | 'left_top' | 'left_bottom' | 'right_top' | 'right_bottom' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right';
2532
+ trigger?: 'hover' | 'click';
1898
2533
  }
1899
2534
 
1900
2535
  export declare interface RenderUserCardResult {
1901
2536
  /**
1902
2537
  * 关闭用户卡片
1903
2538
  */
1904
- close: (force?: boolean) => void;
2539
+ close?: (force?: boolean) => void;
1905
2540
  }
1906
2541
 
1907
2542
  /**
@@ -1942,6 +2577,18 @@ export declare interface SaveStatusDelegation {
1942
2577
  */
1943
2578
  export declare type Scene = 'history' | 'version' | 'public' | 'search' | 'attachments';
1944
2579
 
2580
+ export declare interface ShortcutConfig {
2581
+ /**
2582
+ * 快捷键,例如保存快捷键windows为ctrl+s, mac系统则为meta+s
2583
+ * 如果不想区分系统则为mod+s
2584
+ */
2585
+ key: string;
2586
+ /**
2587
+ * 快捷键回调
2588
+ */
2589
+ callback: () => void;
2590
+ }
2591
+
1945
2592
  export declare interface ShowConfirmOptions {
1946
2593
  /**
1947
2594
  * 确认框标题
@@ -2041,6 +2688,67 @@ export declare interface SyncStatusDelegation {
2041
2688
  onError: (error: unknown, context: SyncContext) => void;
2042
2689
  }
2043
2690
 
2691
+ /**
2692
+ * Toast提示文本配置接口
2693
+ */
2694
+ export declare interface ToastTipsConfig {
2695
+ /**
2696
+ * 复制相关提示文本
2697
+ */
2698
+ copy?: OperationToastConfig;
2699
+ /**
2700
+ * 粘贴相关提示文本
2701
+ */
2702
+ paste?: OperationToastConfig;
2703
+ /**
2704
+ * 剪切相关提示文本
2705
+ */
2706
+ cut?: OperationToastConfig;
2707
+ /**
2708
+ * 打印相关提示文本
2709
+ */
2710
+ print?: OperationToastConfig;
2711
+ /**
2712
+ * 导出相关提示文本
2713
+ */
2714
+ export?: OperationToastConfig;
2715
+ /**
2716
+ * 编辑相关提示文本
2717
+ */
2718
+ edit?: OperationToastConfig;
2719
+ /**
2720
+ * 下载相关提示文本
2721
+ */
2722
+ download?: {
2723
+ /**
2724
+ * 图片下载提示文本
2725
+ */
2726
+ image?: OperationToastConfig;
2727
+ /**
2728
+ * 附件下载提示文本
2729
+ */
2730
+ attachment?: OperationToastConfig;
2731
+ };
2732
+ /**
2733
+ * 预览相关提示文本
2734
+ */
2735
+ preview?: {
2736
+ /**
2737
+ * 图片预览提示文本
2738
+ */
2739
+ image?: OperationToastConfig;
2740
+ /**
2741
+ * 附件预览提示文本
2742
+ */
2743
+ attachment?: OperationToastConfig;
2744
+ };
2745
+ /**
2746
+ * 创建版本相关提示文本
2747
+ * sdk2.0需要提供
2748
+ */
2749
+ createVersion?: OperationToastConfig;
2750
+ }
2751
+
2044
2752
  /**
2045
2753
  * 工具箱工具项接口
2046
2754
  */