@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/docs.d.ts CHANGED
@@ -32,16 +32,6 @@ export declare abstract class AbstractedEditorFileUploader {
32
32
  abstract resume(taskIds?: string[]): void;
33
33
  }
34
34
 
35
- export declare type CheckLimitationResult = {
36
- status: 'limited';
37
- /**
38
- * 被限制原因
39
- */
40
- reason?: string;
41
- } | {
42
- status: 'unlimited';
43
- };
44
-
45
35
  /**
46
36
  * 协作者信息接口
47
37
  */
@@ -200,6 +190,33 @@ export declare interface DocsSDKOptions extends EditorOptions {
200
190
  * 文档信息配置
201
191
  */
202
192
  info?: DocsInfoOptions;
193
+ /**
194
+ * 缩放比例
195
+ */
196
+ zoom?: number;
197
+ /**
198
+ * 纸张相关设置
199
+ */
200
+ pages: {
201
+ width: 'standard' | 'wide' | 'full';
202
+ };
203
+ /**
204
+ * 默认的文档样式,包括字体字号等等
205
+ */
206
+ defaultStyle?: {
207
+ color: string;
208
+ font: string;
209
+ linespacing: string;
210
+ size: string;
211
+ };
212
+ footer?: {
213
+ logo?: string;
214
+ viewsText?: string;
215
+ };
216
+ /**
217
+ * 错误处理回调
218
+ */
219
+ errorHandler?: (context: string, err: Error, extra?: Record<string, string>) => void;
203
220
  }
204
221
 
205
222
  /**
@@ -298,7 +315,7 @@ export declare interface EditorAssetsOssImageProcessing {
298
315
  quality?: number;
299
316
  maxWidth?: number;
300
317
  maxHeight?: number;
301
- }) => Promise<string>;
318
+ }) => string;
302
319
  /**
303
320
  * 裁切图片的方法
304
321
  * @param imageUrl 图片的 URL
@@ -306,12 +323,12 @@ export declare interface EditorAssetsOssImageProcessing {
306
323
  * @returns 裁切后的图片 URL
307
324
  */
308
325
  crop: (imageUrl: string, cropOptions: {
309
- x?: number;
310
- y?: number;
326
+ x: number;
327
+ y: number;
311
328
  w: number;
312
329
  h: number;
313
- g?: EditorImageCropPoint;
314
- }) => Promise<string>;
330
+ g: EditorImageCropPoint;
331
+ }) => string;
315
332
  }
316
333
 
317
334
  export declare interface EditorAssetsResolver {
@@ -320,13 +337,13 @@ export declare interface EditorAssetsResolver {
320
337
  * @param assetId 资源文件 ID
321
338
  * @returns 转换后的资源 URL ,如果无法转换则返回 null
322
339
  */
323
- resolveUrl: (assetId: string) => Promise<string | null>;
340
+ resolveUrl: (assetId: string) => string | null;
324
341
  /**
325
342
  * 从 URL 中解析资源文件 ID 的方法
326
343
  * @param url 资源 URL
327
344
  * @returns 解析出的资源文件 ID
328
345
  */
329
- parseId: (url: string) => Promise<string | null>;
346
+ parseId: (url: string) => string | null;
330
347
  /**
331
348
  * 检查资源文件 ID 对应的文件是否准备就绪,
332
349
  * 在部分环境中,资源文件需要异步导入,在编辑器加载的时候可能还未准备就绪
@@ -336,6 +353,28 @@ export declare interface EditorAssetsResolver {
336
353
  checkAssetReady: (assetId: string) => Promise<boolean> | boolean;
337
354
  }
338
355
 
356
+ /**
357
+ * 编辑器附件下载配置
358
+ */
359
+ export declare interface EditorAttachmentDownloadOptions {
360
+ /**
361
+ * 是否禁用下载
362
+ */
363
+ disabled?: boolean;
364
+ /**
365
+ * 是否跳过验证
366
+ */
367
+ skipValidate?: boolean;
368
+ /**
369
+ * 下载附件
370
+ */
371
+ download?: (url: string) => void;
372
+ /**
373
+ * 获取附件下载地址
374
+ */
375
+ getDownloadUrl?: (url: string) => Promise<string>;
376
+ }
377
+
339
378
  /**
340
379
  * 编辑器附件限制配置,sdk中会使用在不同的场景下使用不同的限制规则组合
341
380
  */
@@ -345,9 +384,9 @@ export declare interface EditorAttachmentLimitationOptions {
345
384
  * @param file
346
385
  * @returns
347
386
  */
348
- checkFile: (params: EditorAttachmentLimitationOptionsCheckFunctionParams) => Promise<{
387
+ checkFile?: (params: EditorAttachmentLimitationOptionsCheckFunctionParams) => Promise<{
349
388
  limited: true;
350
- message: string;
389
+ message?: string;
351
390
  } | {
352
391
  limited: false;
353
392
  }>;
@@ -396,9 +435,24 @@ export declare interface EditorAttachmentMaxSizeOptions {
396
435
  * 编辑器附件信息
397
436
  */
398
437
  export declare interface EditorAttachmentOptions {
438
+ /**
439
+ * 附件选择器
440
+ */
399
441
  picker?: EditorFilePicker;
442
+ /**
443
+ * 附件上传器
444
+ */
400
445
  uploader?: AbstractedEditorFileUploader;
446
+ /**
447
+ * 下载
448
+ * @deprecated, 使用不同类型附件的download配置
449
+ */
401
450
  download?: (url: string) => void;
451
+ /**
452
+ * 预览
453
+ * @deprecated, 使用不同类型附件的preview配置
454
+ */
455
+ preview?: (url: string) => void;
402
456
  /**
403
457
  * 图片附件相关配置
404
458
  */
@@ -416,9 +470,27 @@ export declare interface EditorAttachmentOptions {
416
470
  * 图片附件的限制配置
417
471
  */
418
472
  limitations?: EditorAttachmentLimitationOptions;
473
+ /**
474
+ * 禁止预览
475
+ * @deprecated 使用preview.disabled代替
476
+ */
477
+ disablePreview?: boolean;
478
+ /**
479
+ * 预览
480
+ */
481
+ preview?: EditorAttachmentPreviewOptions;
482
+ /**
483
+ * 下载
484
+ */
485
+ download?: EditorAttachmentDownloadOptions;
486
+ /**
487
+ * 是否禁用缩略图
488
+ * 桌面客户端/极速sdk需要禁用
489
+ */
490
+ disableThumbnail?: boolean;
419
491
  };
420
492
  /**
421
- * 其他附件相关配置
493
+ * 附件相关配置
422
494
  */
423
495
  attachment?: {
424
496
  /**
@@ -434,9 +506,94 @@ export declare interface EditorAttachmentOptions {
434
506
  * 附件的限制配置
435
507
  */
436
508
  limitations?: EditorAttachmentLimitationOptions;
509
+ /**
510
+ * 禁止预览
511
+ * @deprecated 使用preview.disabled代替
512
+ */
513
+ disablePreview?: boolean;
514
+ /**
515
+ * 预览
516
+ */
517
+ preview?: EditorAttachmentPreviewOptions;
518
+ /**
519
+ * 下载
520
+ */
521
+ download?: EditorAttachmentDownloadOptions;
522
+ };
523
+ /**
524
+ * 视频相关配置
525
+ */
526
+ video?: {
527
+ /**
528
+ * 支持的视频格式
529
+ */
530
+ supportTypes?: string[];
531
+ /**
532
+ * 视频的限制配置
533
+ */
534
+ limitations?: EditorAttachmentLimitationOptions;
535
+ /**
536
+ * 预览
537
+ */
538
+ preview?: EditorAttachmentPreviewOptions;
539
+ /**
540
+ * 下载
541
+ */
542
+ download?: EditorAttachmentDownloadOptions;
543
+ };
544
+ /**
545
+ * 音频相关配置
546
+ */
547
+ audio?: {
548
+ /**
549
+ * 支持的音频
550
+ */
551
+ supportTypes?: string[];
552
+ /**
553
+ * 音频的限制配置
554
+ */
555
+ limitations?: EditorAttachmentLimitationOptions;
556
+ /**
557
+ * 预览
558
+ */
559
+ preview?: EditorAttachmentPreviewOptions;
560
+ /**
561
+ * 下载
562
+ */
563
+ download?: EditorAttachmentDownloadOptions;
564
+ };
565
+ /**
566
+ * 云文件附件相关配置
567
+ */
568
+ cloudFile?: {
569
+ /**
570
+ * 是否禁用云文件
571
+ */
572
+ disabled?: boolean;
437
573
  };
438
574
  }
439
575
 
576
+ /**
577
+ * 编辑器附件预览配置
578
+ */
579
+ export declare interface EditorAttachmentPreviewOptions {
580
+ /**
581
+ * 预览附件
582
+ * app, 桌面客户端需提供
583
+ */
584
+ preview?: (url: string) => void;
585
+ /**
586
+ * 获取附件预览url,saas、sdk、极速sdk需要提供
587
+ * @param id 文件url
588
+ * @returns 预览url
589
+ */
590
+ getPreviewUrl?: (url: string) => Promise<string>;
591
+ /**
592
+ * 是否禁用预览
593
+ */
594
+ disabled?: boolean;
595
+ }
596
+
440
597
  /**
441
598
  * 基础文件属性
442
599
  */
@@ -447,11 +604,19 @@ export declare interface EditorBaseUploadableFile {
447
604
  fileGuid: string;
448
605
  }
449
606
 
607
+ /**
608
+ * 品牌设置
609
+ */
610
+ export declare interface EditorBrandOptions {
611
+ enable: boolean;
612
+ getSettings: () => Promise<EditorBrandSetting | null>;
613
+ }
614
+
450
615
  /**
451
616
  * 品牌相关设置,
452
617
  * 用于在套件中展示品牌外露信息
453
618
  */
454
- export declare interface EditorBrandOptions {
619
+ export declare interface EditorBrandSetting {
455
620
  /**
456
621
  * 需要显示在品牌展示位的内容,按数组顺序显示
457
622
  */
@@ -472,24 +637,6 @@ export declare interface EditorBrandOptions {
472
637
  };
473
638
  }
474
639
 
475
- export declare interface EditorCheckpointsOptions {
476
- /**
477
- * 获取功能卡点限制
478
- * undefined代表无限制
479
- */
480
- getFeatureLimitation?: (key: string) => Limitation | undefined;
481
- /**
482
- * 检查是否超限
483
- * @param key 功能卡点key
484
- * @param value 功能卡点检查值,如文件大小/行列数量等
485
- */
486
- checkFeatureLimitation?: (key: string, value: number) => CheckLimitationResult;
487
- /**
488
- * 获取功能卡点状态,如某功能入口是否开启
489
- */
490
- getFeatureStatus?: (key: string) => FeatureStatus;
491
- }
492
-
493
640
  export declare interface EditorCollaborationOptions {
494
641
  /**
495
642
  * 是否允许离线编辑
@@ -531,23 +678,36 @@ export declare interface EditorCollaborators {
531
678
  * 停止监听协作者状态变化
532
679
  * 调用此方法后,将不再接收协作者进入/离开的事件
533
680
  */
534
- stop: () => void;
681
+ quit: () => void;
682
+ /**
683
+ * 监听事件
684
+ */
685
+ on: (event: string, callback: (...args: unknown[]) => void) => unknown;
686
+ /**
687
+ * 监听事件, 只监听一次
688
+ */
689
+ once: (event: string, callback: (...args: unknown[]) => void) => unknown;
535
690
  /**
536
- * 添加协作者进入事件监听器
537
- * @param listener - 监听器回调函数,参数如下:
538
- * - allUsers: 当前所有协作者列表
539
- * - enteredUsers: 新进入的协作者列表
540
- * @returns 返回一个函数,调用该函数可以移除监听器
691
+ * 移除事件
541
692
  */
542
- addUserEnterListener: (listener: (allUsers: CollaboratorInfo[], enteredUsers: CollaboratorInfo[]) => void) => () => void;
693
+ off: (event: string, callback: (...args: unknown[]) => void) => unknown;
543
694
  /**
544
- * 添加协作者离开事件监听器
545
- * @param listener - 监听器回调函数
546
- * - allUsers: 当前所有协作者列表
547
- * - leftUsers: 离开的协作者列表
548
- * @returns 返回一个函数,调用该函数可以移除监听器
695
+ * 发送事件
549
696
  */
550
- addUserLeaveListener: (listener: (allUsers: CollaboratorInfo[], leftUsers: CollaboratorInfo[]) => void) => () => void;
697
+ emit: (event: string, ...args: unknown[]) => unknown;
698
+ }
699
+
700
+ export declare interface EditorCollaboratorsOptions {
701
+ /**
702
+ * 是否禁用
703
+ */
704
+ disabled?: boolean;
705
+ /**
706
+ * 推送协作者socket 对象
707
+ * 实际类型为socketIO.client
708
+ * TODO: 抽象为接口
709
+ */
710
+ socket?: EditorSocket;
551
711
  }
552
712
 
553
713
  /**
@@ -611,6 +771,14 @@ export declare interface EditorComments {
611
771
  * 删除单条评论
612
772
  */
613
773
  deleteOne: (commentId: string) => Promise<boolean>;
774
+ /**
775
+ * 显示评论(侧边栏或其他形式)
776
+ */
777
+ show?: () => void;
778
+ /**
779
+ * 隐藏评论(侧边栏或其他形式)
780
+ */
781
+ hide?: () => void;
614
782
  }
615
783
 
616
784
  /**
@@ -646,11 +814,22 @@ export declare interface EditorCommentsOptions extends EditorFeatureConfig {
646
814
  mode: 'none' | 'card';
647
815
  };
648
816
  /**
649
- * 评论变化监听
650
- * @param listener
651
- * @returns 返回一个函数,调用该函数可以移除监听器
817
+ * 推送评论的 socket 对象
652
818
  */
653
- addChangedListener?: (listener: (type: 'create' | 'update' | 'close', data: EditorCommentItem) => void) => () => void;
819
+ socket?: EditorSocket;
820
+ /**
821
+ * 评论相关功能配置
822
+ */
823
+ features?: {
824
+ /**
825
+ * 添加评论
826
+ */
827
+ addComment?: EditorFeatureConfig;
828
+ /**
829
+ * 评论列表
830
+ */
831
+ commentList?: EditorFeatureConfig;
832
+ };
654
833
  }
655
834
 
656
835
  export declare interface EditorContent<Delta = EditorDelta> {
@@ -676,6 +855,11 @@ export declare interface EditorContent<Delta = EditorDelta> {
676
855
  */
677
856
  export declare type EditorContextMenuOptions<TName extends string> = EditorMenuOptions<TName>;
678
857
 
858
+ /**
859
+ * 粘贴相关设置
860
+ */
861
+ export declare type EditorCopyOptions = EditorLogicFeatureConfig;
862
+
679
863
  /**
680
864
  * 编辑器解密选项接口
681
865
  * 用于配置编辑器中需要解密的内容的相关选项
@@ -696,6 +880,28 @@ export declare interface EditorDelta {
696
880
  length: number;
697
881
  }
698
882
 
883
+ export declare type EditorDeviceMode = 'desktop' | 'mobile' | 'tablet';
884
+
885
+ /**
886
+ * 编辑器设备相关设置
887
+ */
888
+ export declare interface EditorDeviceOptions {
889
+ /**
890
+ * 设备模式
891
+ */
892
+ mode?: EditorDeviceMode;
893
+ }
894
+
895
+ /**
896
+ * 编辑器拖放配置
897
+ */
898
+ export declare type EditorDragNDropOptions = EditorFeatureConfig;
899
+
900
+ /**
901
+ * 编辑器创建副本配置
902
+ */
903
+ export declare type EditorDuplicateOptions = EditorFeatureConfig;
904
+
699
905
  /**
700
906
  * 编辑器嵌入对象
701
907
  */
@@ -745,15 +951,20 @@ export declare interface EditorEmbeddedObjectOptions {
745
951
  };
746
952
  }
747
953
 
748
- export declare interface EditorExportOptions {
954
+ export declare interface EditorExportOptions extends EditorFeatureConfig {
955
+ /**
956
+ * 可导出类型, undefined 表示对可导出类型无限制
957
+ * 导出由接口 + 本地实现
958
+ */
959
+ types?: string[];
749
960
  /**
750
- * 可导出类型
961
+ * 接口支持的导出类型
751
962
  */
752
963
  supportedTypes?: string[];
753
964
  /**
754
- * 导出文件
965
+ * 导出文件,调用接口实现
755
966
  */
756
- exportFile: (type: string) => Promise<void>;
967
+ exportFile?: (type: string) => Promise<void>;
757
968
  }
758
969
 
759
970
  export declare interface EditorFeatureConfig {
@@ -767,6 +978,28 @@ export declare interface EditorFeatureConfig {
767
978
  hidden?: boolean;
768
979
  }
769
980
 
981
+ export declare interface EditorFeaturesOptions {
982
+ /**
983
+ * 禁用特性入口
984
+ */
985
+ disabled?: boolean;
986
+ /**
987
+ * 对应/features接口,返回所有功能key
988
+ */
989
+ getFeatures?: () => Promise<string[]>;
990
+ }
991
+
992
+ /**
993
+ * 文件限制
994
+ */
995
+ export declare interface EditorFileLimitationOptions {
996
+ /**
997
+ * 获取最大文件大小,单位为MB
998
+ * 超过该上限后禁止编辑
999
+ */
1000
+ getMaxFileSize?: () => number | undefined;
1001
+ }
1002
+
770
1003
  export declare interface EditorFileOptions {
771
1004
  /**
772
1005
  * 文件guid
@@ -776,6 +1009,18 @@ export declare interface EditorFileOptions {
776
1009
  * 文件名
777
1010
  */
778
1011
  name?: string;
1012
+ /**
1013
+ * 创建者,以id标识
1014
+ */
1015
+ creator?: number;
1016
+ /**
1017
+ * 创建时间, 毫秒级时间戳
1018
+ */
1019
+ createdAt?: number;
1020
+ /**
1021
+ * 文件限制
1022
+ */
1023
+ limitations?: EditorFileLimitationOptions;
779
1024
  }
780
1025
 
781
1026
  export declare interface EditorFilePicker {
@@ -805,7 +1050,7 @@ export declare interface EditorFollowMode {
805
1050
  * 获取当前演讲者信息
806
1051
  * @returns 返回包含演讲者ID、姓名和头像信息的对象
807
1052
  */
808
- getSpeaker: () => Speaker;
1053
+ getSpeaker: () => Speaker | undefined;
809
1054
  /**
810
1055
  * 添加跟随状态变化的监听器
811
1056
  * @param listener 状态变化时的回调函数
@@ -820,7 +1065,7 @@ export declare interface EditorFollowModeOptions extends EditorFeatureConfig {
820
1065
  * 实际类型为socketIO.client
821
1066
  * TODO: 抽象为接口
822
1067
  */
823
- socket?: unknown;
1068
+ socket?: EditorSocket;
824
1069
  }
825
1070
 
826
1071
  export declare interface EditorFontFace {
@@ -899,17 +1144,35 @@ export declare interface EditorFontsOptions {
899
1144
  * 并提供可用于字体的加载 URL 和字体元数据。
900
1145
  */
901
1146
  list: EditorFontsList;
1147
+ /**
1148
+ * 是否只使用本地字体,如果为 true,则不会从服务器获取字体列表。
1149
+ */
1150
+ useLocalFontsOnly?: boolean;
1151
+ }
1152
+
1153
+ /**
1154
+ * 功能引导设置
1155
+ */
1156
+ export declare interface EditorGuidesOptions {
1157
+ /**
1158
+ * 是否禁用
1159
+ */
1160
+ disabled?: boolean;
1161
+ /**
1162
+ * 获取引导数据
1163
+ */
1164
+ data?: <T = GuideData>() => Promise<T>;
902
1165
  }
903
1166
 
904
1167
  export declare interface EditorHistory {
905
1168
  /**
906
- * 显示历史记录侧边栏
1169
+ * 显示历史记录(侧边栏或其他形式)
907
1170
  */
908
- showSidebar: () => void;
1171
+ show: () => void;
909
1172
  /**
910
- * 隐藏历史记录侧边栏
1173
+ * 隐藏历史记录(侧边栏或其他形式)
911
1174
  */
912
- hideSidebar: () => void;
1175
+ hide: () => void;
913
1176
  }
914
1177
 
915
1178
  export declare type EditorHistoryOptions = EditorFeatureConfig;
@@ -932,7 +1195,12 @@ export declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'cen
932
1195
 
933
1196
  export declare interface EditorImportOptions {
934
1197
  /**
935
- * 获取导入状态,没有contentUrl时需要显示导入进度
1198
+ * 当前文件是否正在导入中
1199
+ * 用于初始化时判断是否需要显示导入进度
1200
+ */
1201
+ isImporting?: boolean;
1202
+ /**
1203
+ * 获取当前文件导入状态,没有contentUrl时需要显示导入进度
936
1204
  * 待导入完成后再渲染
937
1205
  */
938
1206
  getImportStatus?: () => Promise<{
@@ -949,15 +1217,19 @@ export declare interface EditorImportOptions {
949
1217
  * 导入完成
950
1218
  */
951
1219
  status: 'completed';
1220
+ /**
1221
+ * 导入完成后的内容URL
1222
+ */
1223
+ contentUrl: string;
952
1224
  } | {
953
1225
  /**
954
1226
  * 导入失败
955
1227
  */
956
1228
  status: 'failed';
957
1229
  /**
958
- * 导入失败错误信息
1230
+ * 导入失败报错
959
1231
  */
960
- errorMessage?: string;
1232
+ error?: unknown;
961
1233
  }>;
962
1234
  }
963
1235
 
@@ -1010,6 +1282,74 @@ export declare interface EditorLocalUploadableFile extends EditorBaseUploadableF
1010
1282
  raw: File;
1011
1283
  }
1012
1284
 
1285
+ /**
1286
+ * 纯逻辑功能配置。
1287
+ * 不包含 UI 相关配置,仅用于逻辑判断。
1288
+ * 如:权限判断、功能开关等。
1289
+ * 所以不需要hidden,只使用disabled来判断
1290
+ */
1291
+ export declare type EditorLogicFeatureConfig = Omit<EditorFeatureConfig, 'hidden'>;
1292
+
1293
+ export declare interface EditorLogsOptions {
1294
+ /**
1295
+ * 是否禁用审计日志
1296
+ * sdk2.0需要禁用
1297
+ */
1298
+ isAuditLogDisabled?: boolean;
1299
+ /**
1300
+ * 是否禁用日志
1301
+ */
1302
+ disabled?: boolean;
1303
+ }
1304
+
1305
+ export declare interface EditorMentionOptions extends EditorFeatureConfig {
1306
+ /**
1307
+ * mention api url前缀
1308
+ * @shimo/mention-suggestion 需要用到
1309
+ * 对应环境变量 SDK_V2_PATH_PREFIX
1310
+ */
1311
+ apiUrlPrefix?: string;
1312
+ /**
1313
+ * mention文件卡片禁用设置
1314
+ */
1315
+ disableFileCard?: boolean;
1316
+ /**
1317
+ * mention日期卡片禁用设置
1318
+ */
1319
+ disableDateCard?: boolean;
1320
+ /**
1321
+ * mention用户卡片禁用设置
1322
+ */
1323
+ disableUserCard?: boolean;
1324
+ /**
1325
+ * mention点击回调
1326
+ */
1327
+ onMentionClick?: (payload: MentionEventPayload) => void;
1328
+ /**
1329
+ * mention文件选择弹窗支持的tab类型
1330
+ */
1331
+ mentionFilePanelTabs?: ('mine' | 'recent' | 'space')[];
1332
+ /**
1333
+ * mention弹窗底部支持的tab类型
1334
+ */
1335
+ mentionPopoverTabs?: ('contacts' | 'file' | 'calendar')[];
1336
+ /**
1337
+ * 是否禁止检查组织架构成员可见性
1338
+ * 该属性需要各套件对接最新版本@shimo/mention-suggestion(没用到的话可忽略)
1339
+ */
1340
+ disableCheckStaffVisibility?: boolean;
1341
+ }
1342
+
1343
+ /**
1344
+ * 编辑器菜单api
1345
+ */
1346
+ export declare interface EditorMenu {
1347
+ /**
1348
+ * 菜单功能api
1349
+ */
1350
+ features: EditorMenuFeatures;
1351
+ }
1352
+
1013
1353
  /**
1014
1354
  * 基础菜单项配置,所有菜单项类型都包含这些属性
1015
1355
  */
@@ -1110,6 +1450,38 @@ export declare interface EditorMenuFeatureConfig extends EditorFeatureConfig {
1110
1450
  index?: number;
1111
1451
  }
1112
1452
 
1453
+ /**
1454
+ * 编辑器菜单功能api
1455
+ *
1456
+ * 提供对菜单项的显示、隐藏、启用和禁用等操作
1457
+ */
1458
+ export declare interface EditorMenuFeatures {
1459
+ /**
1460
+ * 显示菜单项
1461
+ * @param name 菜单项名称
1462
+ */
1463
+ showFeature: (name: string) => void;
1464
+ /**
1465
+ * 隐藏菜单项
1466
+ * @param name 菜单项名称
1467
+ */
1468
+ hideFeature: (name: string) => void;
1469
+ /**
1470
+ * 启用菜单项
1471
+ * @param name 菜单项名称
1472
+ */
1473
+ enableFeature: (name: string) => void;
1474
+ /**
1475
+ * 禁用菜单项
1476
+ * @param name 菜单项名称
1477
+ */
1478
+ disableFeature: (name: string) => void;
1479
+ /**
1480
+ * 恢复菜单项到默认状态,即根据配置项确定如何渲染菜单项。
1481
+ */
1482
+ resetFeature: (name: string) => void;
1483
+ }
1484
+
1113
1485
  /**
1114
1486
  * 隐藏菜单项配置
1115
1487
  */
@@ -1176,7 +1548,7 @@ export declare interface EditorMenuOptions<TName extends EditorMenuName> {
1176
1548
  * 更加间接的配置项
1177
1549
  * 仅在 TName 为字符串类型时有效
1178
1550
  */
1179
- features?: TName extends string ? Partial<Record<TName, EditorMenuFeatureConfig>> : never;
1551
+ features?: [TName] extends [string] ? Partial<Record<TName, EditorMenuFeatureConfig>> : never;
1180
1552
  /**
1181
1553
  * 自定义按钮配置
1182
1554
  */
@@ -1212,9 +1584,25 @@ export declare type EditorModeOptions = {
1212
1584
  */
1213
1585
  role?: EditorStandardRole;
1214
1586
  } | {
1587
+ /**
1588
+ * 预览模式
1589
+ */
1215
1590
  type: 'preview';
1216
1591
  } | {
1592
+ /**
1593
+ * 演示模式
1594
+ */
1217
1595
  type: 'presentation';
1596
+ } | {
1597
+ /**
1598
+ * 历史模式
1599
+ */
1600
+ type: 'history';
1601
+ } | {
1602
+ /**
1603
+ * 嵌入模式
1604
+ */
1605
+ type: 'embedded';
1218
1606
  };
1219
1607
 
1220
1608
  /**
@@ -1222,8 +1610,9 @@ export declare type EditorModeOptions = {
1222
1610
  * - `standard` 标准模式,会根据用户权限配置不同的功能
1223
1611
  * - `preview` 预览模式,只能查看内容
1224
1612
  * - `presentation` 演示模式,用作演示场景,演示模式下部分套件可以进行一些简单的编辑操作
1613
+ * - `history` 历史模式,用作查看历史版本场景
1225
1614
  */
1226
- export declare type EditorModeType = 'standard' | 'preview' | 'presentation';
1615
+ export declare type EditorModeType = 'standard' | 'preview' | 'presentation' | 'history' | 'embedded';
1227
1616
 
1228
1617
  /**
1229
1618
  * 编辑器初始化通用参数
@@ -1247,7 +1636,7 @@ export declare interface EditorOptions {
1247
1636
  */
1248
1637
  anonymous?: EditorAnonymousOptions;
1249
1638
  /**
1250
- * 当前文件信息
1639
+ * 当前文件信息 & 配置
1251
1640
  */
1252
1641
  file?: EditorFileOptions;
1253
1642
  /**
@@ -1257,7 +1646,7 @@ export declare interface EditorOptions {
1257
1646
  /**
1258
1647
  * 品牌相关设置
1259
1648
  */
1260
- brand?: MaybePromiseValue<EditorBrandOptions>;
1649
+ brand?: EditorBrandOptions;
1261
1650
  /**
1262
1651
  * 编辑器内部资源请求配置
1263
1652
  */
@@ -1306,10 +1695,6 @@ export declare interface EditorOptions {
1306
1695
  * 编辑器 UI 相关
1307
1696
  */
1308
1697
  ui?: EditorUiOptions;
1309
- /**
1310
- * 编辑器卡点限制
1311
- */
1312
- checkpoints?: EditorCheckpointsOptions;
1313
1698
  /**
1314
1699
  * 编辑器工具箱设置
1315
1700
  */
@@ -1322,6 +1707,54 @@ export declare interface EditorOptions {
1322
1707
  * 编辑器协作相关
1323
1708
  */
1324
1709
  collaboration?: EditorCollaborationOptions;
1710
+ /**
1711
+ * 编辑器功能相关设置
1712
+ */
1713
+ features?: EditorFeaturesOptions;
1714
+ /**
1715
+ * 编辑器版本相关设置
1716
+ */
1717
+ version?: EditorVersionOptions;
1718
+ /**
1719
+ * 编辑器日志相关设置
1720
+ */
1721
+ logs?: EditorLogsOptions;
1722
+ /**
1723
+ * 编辑器快捷键相关设置
1724
+ */
1725
+ shortcuts?: EditorShortcutOptions;
1726
+ /**
1727
+ * 提及相关设置
1728
+ */
1729
+ mention?: EditorMentionOptions;
1730
+ /**
1731
+ * 编辑器拖放相关配置
1732
+ */
1733
+ dragNDrop?: EditorDragNDropOptions;
1734
+ /**
1735
+ * 编辑器引导相关设置
1736
+ */
1737
+ guides?: EditorGuidesOptions;
1738
+ /**
1739
+ * 编辑器复制相关设置
1740
+ */
1741
+ copy?: EditorCopyOptions;
1742
+ /**
1743
+ * 编辑器粘贴相关设置
1744
+ */
1745
+ paste?: EditorPasteOptions;
1746
+ /**
1747
+ * 编辑器设备信息相关设置
1748
+ */
1749
+ device?: EditorDeviceOptions;
1750
+ /**
1751
+ * 编辑器副本相关配置
1752
+ */
1753
+ duplicate?: EditorDuplicateOptions;
1754
+ /**
1755
+ * 分享相关接口
1756
+ */
1757
+ share?: EditorShareOptions;
1325
1758
  }
1326
1759
 
1327
1760
  /**
@@ -1374,7 +1807,7 @@ export declare interface EditorOutlineItem<Content = unknown> {
1374
1807
  * 大纲目录初始化参数,
1375
1808
  * 用于配置大纲目录的行为和外观。
1376
1809
  */
1377
- export declare interface EditorOutlineOptions {
1810
+ export declare interface EditorOutlineOptions extends EditorLogicFeatureConfig {
1378
1811
  /**
1379
1812
  * 初始化编辑器时是否显示大纲目录,
1380
1813
  * 默认为 false。
@@ -1382,6 +1815,50 @@ export declare interface EditorOutlineOptions {
1382
1815
  visible?: boolean;
1383
1816
  }
1384
1817
 
1818
+ export declare interface EditorPasteLimitationOptions {
1819
+ /**
1820
+ * 检查粘贴内容的规则
1821
+ * @param content
1822
+ * @returns
1823
+ */
1824
+ checkContent?: (params: EditorPasteLimitationOptionsCheckFunctionParams) => Promise<{
1825
+ limited: true;
1826
+ message: string;
1827
+ } | {
1828
+ limited: false;
1829
+ }>;
1830
+ /**
1831
+ * 获取最大粘贴数据大小,单位为MB
1832
+ */
1833
+ getMaxDataSize?: () => Promise<number | undefined>;
1834
+ }
1835
+
1836
+ export declare interface EditorPasteLimitationOptionsCheckFunctionParams {
1837
+ content: string;
1838
+ }
1839
+
1840
+ /**
1841
+ * 粘贴相关设置
1842
+ */
1843
+ export declare interface EditorPasteOptions extends EditorFeatureConfig {
1844
+ /**
1845
+ * 是否禁用远程图片粘贴, turbo暂时不支持远程图片粘贴
1846
+ */
1847
+ isRemoteImgDisabled?: boolean;
1848
+ /**
1849
+ * 粘贴内容限制规则
1850
+ */
1851
+ limitations?: EditorPasteLimitationOptions;
1852
+ }
1853
+
1854
+ export declare interface EditorPerformanceOptions {
1855
+ /**
1856
+ * 记录性能指标
1857
+ * @param mark 性能指标名称
1858
+ */
1859
+ record?: (mark: 'first_page' | 'first_editable_page') => void;
1860
+ }
1861
+
1385
1862
  export declare interface EditorPickedFile {
1386
1863
  /**
1387
1864
  * 文件大小
@@ -1405,6 +1882,17 @@ export declare interface EditorPickedFile {
1405
1882
  raw: File;
1406
1883
  }
1407
1884
 
1885
+ export declare interface EditorPresentation {
1886
+ /**
1887
+ * 进入演示模式
1888
+ */
1889
+ start: () => Promise<void>;
1890
+ /**
1891
+ * 退出演示模式
1892
+ */
1893
+ quit: () => Promise<void>;
1894
+ }
1895
+
1408
1896
  /**
1409
1897
  * 编辑器打印设置
1410
1898
  */
@@ -1429,6 +1917,13 @@ export declare interface EditorRemoteUploadableFile extends EditorBaseUploadable
1429
1917
  raw?: never;
1430
1918
  }
1431
1919
 
1920
+ export declare interface EditorRenderOptions {
1921
+ /**
1922
+ * 用于定位的锚点
1923
+ */
1924
+ hash?: string;
1925
+ }
1926
+
1432
1927
  /**
1433
1928
  * 编辑器通用接口
1434
1929
  */
@@ -1481,6 +1976,62 @@ export declare abstract class EditorSDK {
1481
1976
  * 部分环境不存在,如离线客户端
1482
1977
  */
1483
1978
  abstract get version(): EditorVersion | undefined;
1979
+ /**
1980
+ * 编辑器菜单栏相关接口
1981
+ */
1982
+ abstract get menu(): EditorMenu | undefined;
1983
+ /**
1984
+ * 编辑器演示模式相关接口
1985
+ */
1986
+ abstract get presentation(): EditorPresentation | undefined;
1987
+ }
1988
+
1989
+ export declare interface EditorShareOptions extends EditorLogicFeatureConfig {
1990
+ /**
1991
+ * 当前文件是否为共享文件
1992
+ */
1993
+ isShared?: boolean;
1994
+ }
1995
+
1996
+ export declare interface EditorShortcutOptions {
1997
+ /**
1998
+ * 自定义快捷键
1999
+ */
2000
+ customShortcuts?: ShortcutConfig[];
2001
+ /**
2002
+ * 禁用的快捷键
2003
+ * 桌面客户端需要禁用ctrl+s,ctrl+shift+s
2004
+ * 极速sdk需要禁用ctrl+s
2005
+ * sdk2.0需要禁用ctrl+shift+e
2006
+ */
2007
+ disabledShortcuts?: string[];
2008
+ }
2009
+
2010
+ /**
2011
+ * 编辑器 socket 接口, 用于评论、跟随模式、远程演示等场景
2012
+ * 实际类型为 socketIO.client
2013
+ */
2014
+ export declare interface EditorSocket {
2015
+ /**
2016
+ * 监听事件
2017
+ */
2018
+ on: (event: string, callback: (...args: unknown[]) => void) => unknown;
2019
+ /**
2020
+ * 监听事件, 只监听一次
2021
+ */
2022
+ once: (event: string, callback: (...args: unknown[]) => void) => unknown;
2023
+ /**
2024
+ * 移除事件
2025
+ */
2026
+ off: (event: string, callback: (...args: unknown[]) => void) => unknown;
2027
+ /**
2028
+ * 发送事件
2029
+ */
2030
+ emit: (event: string, ...args: unknown[]) => unknown;
2031
+ /**
2032
+ * 断开连接
2033
+ */
2034
+ disconnect: () => unknown;
1484
2035
  }
1485
2036
 
1486
2037
  /**
@@ -1670,6 +2221,12 @@ export declare interface EditorToolbarOptions<TName extends string> {
1670
2221
  * 自定义按钮
1671
2222
  */
1672
2223
  custom?: EditorToolbarFeatureButtonConfig<string>;
2224
+ /**
2225
+ * 工具栏挂载的容器dom,配置后则挂载到指定的容器上
2226
+ *
2227
+ * 如果不配置则按照套件的默认方式挂载。
2228
+ */
2229
+ container?: HTMLElement;
1673
2230
  }
1674
2231
 
1675
2232
  /**
@@ -1707,13 +2264,17 @@ export declare interface EditorUiOptions {
1707
2264
  /**
1708
2265
  * 显示升级弹窗
1709
2266
  */
1710
- showModal?: (options: ShowUpgradeModalProps) => Promise<ShowUpgradeModalResponse>;
2267
+ showModal?: (options: ShowUpgradeModalProps) => Promise<ShowUpgradeModalResponse | undefined>;
1711
2268
  };
1712
2269
  notification?: {
1713
2270
  /**
1714
2271
  * 渲染通知条
1715
2272
  */
1716
2273
  render?: (params: RenderNotificationProps) => void;
2274
+ /**
2275
+ * 是否禁用通知条
2276
+ */
2277
+ disabled?: boolean;
1717
2278
  };
1718
2279
  /**
1719
2280
  * 用户名片
@@ -1727,6 +2288,20 @@ export declare interface EditorUiOptions {
1727
2288
  * 渲染用户卡片
1728
2289
  */
1729
2290
  render?: (params: RenderUserCardProps) => RenderUserCardResult;
2291
+ /**
2292
+ * 是否禁用用户卡片
2293
+ * jd需要禁用
2294
+ */
2295
+ disabled?: boolean;
2296
+ };
2297
+ /**
2298
+ * 登录提示
2299
+ */
2300
+ loginNotice?: {
2301
+ /**
2302
+ * 显示登录提示
2303
+ */
2304
+ show?: () => void;
1730
2305
  };
1731
2306
  /**
1732
2307
  * toast
@@ -1740,6 +2315,10 @@ export declare interface EditorUiOptions {
1740
2315
  * 是否禁用toast
1741
2316
  */
1742
2317
  disabled?: boolean;
2318
+ /**
2319
+ * 自定义toast提示文本配置
2320
+ */
2321
+ tips?: ToastTipsConfig;
1743
2322
  };
1744
2323
  /**
1745
2324
  * confirm
@@ -1754,9 +2333,48 @@ export declare interface EditorUiOptions {
1754
2333
  */
1755
2334
  disabled?: boolean;
1756
2335
  };
2336
+ /**
2337
+ * 全屏配置
2338
+ */
2339
+ fullscreen?: EditorFeatureConfig;
2340
+ /**
2341
+ * 演示模式配置
2342
+ */
2343
+ presentation?: EditorFeatureConfig;
2344
+ /**
2345
+ * 帮助中心配置
2346
+ */
2347
+ helpCenter?: EditorFeatureConfig;
2348
+ /**
2349
+ * 新功能提醒相关配置
2350
+ */
2351
+ newFeature?: {
2352
+ /**
2353
+ * 是否不展示新功能提醒(包括任何形式的)
2354
+ */
2355
+ hidden?: boolean;
2356
+ };
2357
+ /**
2358
+ * 图片查看器配置
2359
+ */
2360
+ imageViewer?: {
2361
+ /**
2362
+ * 右键菜单配置
2363
+ */
2364
+ contextMenu?: EditorMenuOptions<'copy' | 'download'>;
2365
+ /**
2366
+ * 操作配置
2367
+ */
2368
+ operations?: {
2369
+ /**
2370
+ * 下载图片
2371
+ */
2372
+ download: EditorFeatureConfig;
2373
+ };
2374
+ };
1757
2375
  }
1758
2376
 
1759
- export declare type EditorUploadableFile = EditorLocalUploadableFile;
2377
+ export declare type EditorUploadableFile = EditorLocalUploadableFile | EditorRemoteUploadableFile;
1760
2378
 
1761
2379
  /**
1762
2380
  * 文件开始上传入参
@@ -1822,10 +2440,23 @@ export declare interface EditorUserOptions {
1822
2440
  export declare interface EditorVersion {
1823
2441
  /**
1824
2442
  * 保存版本
2443
+ * @param name 版本名称
2444
+ */
2445
+ createRevision: (name?: string) => void;
2446
+ /**
2447
+ * 显示版本(侧边栏或其他形式)
2448
+ * 区别于历史侧边栏,在应用表格里表现为打开历史侧边栏切换到版本 tab
2449
+ */
2450
+ show?: () => void;
2451
+ /**
2452
+ * 隐藏版本(侧边栏或其他形式)
2453
+ * 区别于历史侧边栏,在应用表格里表现为打开历史侧边栏切换到版本 tab
1825
2454
  */
1826
- createRevision: () => void;
2455
+ hide?: () => void;
1827
2456
  }
1828
2457
 
2458
+ export declare type EditorVersionOptions = EditorFeatureConfig;
2459
+
1829
2460
  /**
1830
2461
  * 编辑器外部水印信息
1831
2462
  */
@@ -1833,7 +2464,12 @@ export declare interface EditorWatermarkOptions {
1833
2464
  /**
1834
2465
  * 获取用作初始化使用的默认水印
1835
2466
  */
1836
- getWatermark: () => MaybePromiseValue<EditorWatermarkResource | null>;
2467
+ getWatermark?: () => MaybePromiseValue<EditorWatermarkResource | null>;
2468
+ /**
2469
+ * 获取文件导出水印
2470
+ * @param exportType 导出类型 图片/pdf/纯图pdf
2471
+ */
2472
+ getExportWatermark?: (exportType: 'image' | 'pdf' | 'image_pdf') => Promise<string[] | undefined>;
1837
2473
  /**
1838
2474
  * 是否必须,如果为 true,编辑器将在初始化时强制渲染水印,
1839
2475
  * 水印配置信息加载失败将导致编辑器初始化失败
@@ -1849,28 +2485,13 @@ export declare type EditorWatermarkResource = {
1849
2485
  url: string;
1850
2486
  };
1851
2487
 
1852
- export declare enum FeatureStatus {
1853
- /**
1854
- * 隐藏
1855
- */
1856
- Hidden = 0,
1857
- /**
1858
- * 正常
1859
- */
1860
- Normal = 1,
1861
- /**
1862
- * 禁用
1863
- */
1864
- Disabled = 2
1865
- }
1866
-
1867
2488
  export declare interface FileLinkParams {
1868
2489
  /**
1869
2490
  * 文件guid
1870
2491
  */
1871
2492
  fileGuid: string;
1872
2493
  /**
1873
- * 文件类型,如docs,sheets
2494
+ * 文件类型
1874
2495
  */
1875
2496
  type: string;
1876
2497
  /**
@@ -1929,6 +2550,14 @@ export declare enum FileType {
1929
2550
  CloudFile = 3
1930
2551
  }
1931
2552
 
2553
+ /**
2554
+ * 引导数据
2555
+ */
2556
+ export declare interface GuideData {
2557
+ type: number;
2558
+ id: number;
2559
+ }
2560
+
1932
2561
  /**
1933
2562
  * 请求、响应头
1934
2563
  */
@@ -2036,34 +2665,67 @@ export declare interface HTTPResponse<Data = unknown> {
2036
2665
  */
2037
2666
  export declare type HTTPResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
2038
2667
 
2039
- export declare interface Limitation {
2668
+ export declare type MaybePromiseValue<T> = T | Promise<T>;
2669
+
2670
+ export declare interface MentionEventPayload {
2040
2671
  /**
2041
- * 限制原因(错误码)
2672
+ * 距离页面左边的距离
2042
2673
  */
2043
- code?: number;
2674
+ x: number;
2044
2675
  /**
2045
- * 单位(不参与计算,仅作显示)
2046
- * minutes、MB
2676
+ * 距离页面顶部的距离
2047
2677
  */
2048
- unit?: string;
2678
+ y: number;
2049
2679
  /**
2050
- * 描述
2680
+ * mention信息
2051
2681
  */
2052
- desc?: string;
2682
+ mentionInfo: MentionInfo;
2683
+ }
2684
+
2685
+ export declare interface MentionInfo {
2686
+ /** 用户 Id */
2687
+ userId?: number;
2688
+ /** 文件 Id */
2689
+ fileId?: string;
2690
+ /**
2691
+ * mention区域宽度
2692
+ */
2693
+ width?: number;
2694
+ /**
2695
+ * mention区域高度
2696
+ */
2697
+ height?: number;
2698
+ /**
2699
+ * mention区域左上角距离页面左边的距离
2700
+ */
2701
+ left?: number;
2053
2702
  /**
2054
- * min/max int64 默认表示 MB/个/分钟/行
2703
+ * mention区域左上角距离页面顶部的距离
2055
2704
  */
2056
- max?: number;
2057
- min?: number;
2705
+ top?: number;
2058
2706
  }
2059
2707
 
2060
- export declare type MaybePromiseValue<T> = T | Promise<T>;
2061
-
2062
2708
  /**
2063
2709
  * 升级弹窗类型
2064
2710
  * 个人版或企业版
2065
2711
  */
2066
- export declare type OpenType = 'personal' | 'enterprise';
2712
+ export declare type OpenType = 'personal' | 'enterprise' | 'pendingOrder';
2713
+
2714
+ export declare interface OperationToastConfig {
2715
+ /**
2716
+ * 成功提示文本
2717
+ */
2718
+ success?: string;
2719
+ /**
2720
+ * 失败提示文本
2721
+ */
2722
+ failed?: string;
2723
+ /**
2724
+ * 权限不足提示文本
2725
+ * 桌面客户端安全模式下需要提供【当前账号未获得此项能力授权。】
2726
+ */
2727
+ noPermission?: string;
2728
+ }
2067
2729
 
2068
2730
  export declare interface RenderNotificationProps {
2069
2731
  /**
@@ -2085,15 +2747,15 @@ export declare interface RenderUserCardProps {
2085
2747
  height: number;
2086
2748
  hasReducedHeaderHeight?: boolean;
2087
2749
  };
2088
- position?: 'top' | 'left' | 'right' | 'bottom' | 'left_top' | 'left_bottom' | 'right_top' | 'bottom_top' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right';
2089
- trigger: 'hover' | 'click';
2750
+ position?: 'top' | 'left' | 'right' | 'bottom' | 'left_top' | 'left_bottom' | 'right_top' | 'right_bottom' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right';
2751
+ trigger?: 'hover' | 'click';
2090
2752
  }
2091
2753
 
2092
2754
  export declare interface RenderUserCardResult {
2093
2755
  /**
2094
2756
  * 关闭用户卡片
2095
2757
  */
2096
- close: (force?: boolean) => void;
2758
+ close?: (force?: boolean) => void;
2097
2759
  }
2098
2760
 
2099
2761
  /**
@@ -2134,6 +2796,18 @@ export declare interface SaveStatusDelegation {
2134
2796
  */
2135
2797
  export declare type Scene = 'history' | 'version' | 'public' | 'search' | 'attachments';
2136
2798
 
2799
+ export declare interface ShortcutConfig {
2800
+ /**
2801
+ * 快捷键,例如保存快捷键windows为ctrl+s, mac系统则为meta+s
2802
+ * 如果不想区分系统则为mod+s
2803
+ */
2804
+ key: string;
2805
+ /**
2806
+ * 快捷键回调
2807
+ */
2808
+ callback: () => void;
2809
+ }
2810
+
2137
2811
  export declare interface ShowConfirmOptions {
2138
2812
  /**
2139
2813
  * 确认框标题
@@ -2233,6 +2907,67 @@ export declare interface SyncStatusDelegation {
2233
2907
  onError: (error: unknown, context: SyncContext) => void;
2234
2908
  }
2235
2909
 
2910
+ /**
2911
+ * Toast提示文本配置接口
2912
+ */
2913
+ export declare interface ToastTipsConfig {
2914
+ /**
2915
+ * 复制相关提示文本
2916
+ */
2917
+ copy?: OperationToastConfig;
2918
+ /**
2919
+ * 粘贴相关提示文本
2920
+ */
2921
+ paste?: OperationToastConfig;
2922
+ /**
2923
+ * 剪切相关提示文本
2924
+ */
2925
+ cut?: OperationToastConfig;
2926
+ /**
2927
+ * 打印相关提示文本
2928
+ */
2929
+ print?: OperationToastConfig;
2930
+ /**
2931
+ * 导出相关提示文本
2932
+ */
2933
+ export?: OperationToastConfig;
2934
+ /**
2935
+ * 编辑相关提示文本
2936
+ */
2937
+ edit?: OperationToastConfig;
2938
+ /**
2939
+ * 下载相关提示文本
2940
+ */
2941
+ download?: {
2942
+ /**
2943
+ * 图片下载提示文本
2944
+ */
2945
+ image?: OperationToastConfig;
2946
+ /**
2947
+ * 附件下载提示文本
2948
+ */
2949
+ attachment?: OperationToastConfig;
2950
+ };
2951
+ /**
2952
+ * 预览相关提示文本
2953
+ */
2954
+ preview?: {
2955
+ /**
2956
+ * 图片预览提示文本
2957
+ */
2958
+ image?: OperationToastConfig;
2959
+ /**
2960
+ * 附件预览提示文本
2961
+ */
2962
+ attachment?: OperationToastConfig;
2963
+ };
2964
+ /**
2965
+ * 创建版本相关提示文本
2966
+ * sdk2.0需要提供
2967
+ */
2968
+ createVersion?: OperationToastConfig;
2969
+ }
2970
+
2236
2971
  /**
2237
2972
  * 工具箱工具项接口
2238
2973
  */