@officesdk/editor-sdk-core 0.0.0-10 → 0.0.0-12
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.
- package/cjs/diagram/index.js +16 -1
- package/cjs/diagram/sdk.js +1 -1
- package/cjs/docs/index.js +21 -0
- package/cjs/docs/info.js +3 -0
- package/cjs/docs/range.js +7 -0
- package/cjs/docs/sdk.js +28 -0
- package/cjs/docs/selection.js +3 -0
- package/cjs/docx/context-menu.js +3 -0
- package/cjs/docx/index.js +16 -1
- package/cjs/docx/info.js +1 -1
- package/cjs/docx/menu.js +1 -1
- package/cjs/docx/sdk.js +1 -1
- package/cjs/docx/selection.js +1 -1
- package/cjs/docx/theme.js +1 -1
- package/cjs/docx/window.js +1 -1
- package/cjs/pdf/index.js +16 -1
- package/cjs/presentation/index.js +16 -1
- package/cjs/presentation/sdk.js +1 -1
- package/cjs/presentation/toolbar.js +3 -0
- package/cjs/shared/attachment.js +3 -0
- package/cjs/shared/content.js +1 -1
- package/cjs/shared/context-menu.js +3 -0
- package/cjs/shared/editor.js +1 -1
- package/cjs/shared/export.js +3 -0
- package/cjs/shared/file-picker.js +3 -0
- package/cjs/shared/index.js +5 -2
- package/cjs/shared/menu.js +1 -1
- package/cjs/shared/toolbar.js +1 -1
- package/cjs/shared/uploader.js +22 -0
- package/cjs/shared/user.js +1 -1
- package/cjs/sheet/index.js +16 -1
- package/cjs/sheet/sdk.js +1 -1
- package/cjs/table/content.js +3 -0
- package/cjs/table/index.js +23 -0
- package/cjs/table/resource.js +3 -0
- package/cjs/table/sdk.js +11 -0
- package/cjs/table/selection.js +21 -0
- package/cjs/table/table.js +3 -0
- package/esm/diagram/index.js +2 -1
- package/esm/diagram/sdk.js +1 -1
- package/esm/docs/index.js +3 -0
- package/esm/docs/info.js +2 -0
- package/esm/docs/range.js +6 -0
- package/esm/docs/sdk.js +25 -0
- package/esm/docs/selection.js +2 -0
- package/esm/docx/context-menu.js +2 -0
- package/esm/docx/index.js +2 -1
- package/esm/docx/info.js +1 -1
- package/esm/docx/menu.js +1 -1
- package/esm/docx/sdk.js +1 -1
- package/esm/docx/selection.js +1 -1
- package/esm/docx/theme.js +1 -1
- package/esm/docx/window.js +1 -1
- package/esm/pdf/index.js +2 -1
- package/esm/presentation/index.js +2 -1
- package/esm/presentation/sdk.js +1 -1
- package/esm/presentation/toolbar.js +2 -0
- package/esm/shared/attachment.js +2 -0
- package/esm/shared/content.js +1 -1
- package/esm/shared/context-menu.js +2 -0
- package/esm/shared/editor.js +1 -1
- package/esm/shared/export.js +2 -0
- package/esm/shared/file-picker.js +2 -0
- package/esm/shared/index.js +2 -1
- package/esm/shared/menu.js +1 -1
- package/esm/shared/toolbar.js +1 -1
- package/esm/shared/uploader.js +19 -0
- package/esm/shared/user.js +1 -1
- package/esm/sheet/index.js +2 -1
- package/esm/sheet/sdk.js +1 -1
- package/esm/table/content.js +2 -0
- package/esm/table/index.js +4 -0
- package/esm/table/resource.js +2 -0
- package/esm/table/sdk.js +8 -0
- package/esm/table/selection.js +18 -0
- package/esm/table/table.js +2 -0
- package/package.json +72 -7
- package/types/diagram.d.ts +1454 -0
- package/types/docs.d.ts +1581 -0
- package/{docx.d.ts → types/docx.d.ts} +535 -114
- package/types/pdf.d.ts +1663 -0
- package/{presentation.d.ts → types/presentation.d.ts} +488 -61
- package/{shared.d.ts → types/shared.d.ts} +341 -18
- package/{sheet.d.ts → types/sheet.d.ts} +448 -63
- package/types/table.d.ts +1704 -0
- package/cjs/index.js +0 -16
- package/diagram.d.ts +0 -358
- package/esm/index.js +0 -7
- package/pdf.d.ts +0 -760
|
@@ -1,4 +1,31 @@
|
|
|
1
|
+
export declare abstract class AbstractedEditorFileUploader {
|
|
2
|
+
/**
|
|
3
|
+
* 开始上传
|
|
4
|
+
* @param options
|
|
5
|
+
*/
|
|
6
|
+
abstract start(options: EditorUploadStartOptions): EditorUploadTaskInfo[];
|
|
7
|
+
/**
|
|
8
|
+
* 暂停上传,不传参数则取消所有上传任务
|
|
9
|
+
* @param taskIds
|
|
10
|
+
*/
|
|
11
|
+
abstract pause(taskIds?: string[]): void;
|
|
12
|
+
/**
|
|
13
|
+
* 暂停上传,不传参数则暂停所有上传任务
|
|
14
|
+
* @param taskIds
|
|
15
|
+
*/
|
|
16
|
+
abstract abort(taskIds?: string[]): void;
|
|
17
|
+
/**
|
|
18
|
+
* 恢复上传,不传参数则恢复所有上传任务
|
|
19
|
+
* @param taskIds
|
|
20
|
+
*/
|
|
21
|
+
abstract resume(taskIds?: string[]): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
1
24
|
export declare abstract class AbstractedPresentationSDK extends EditorSDK {
|
|
25
|
+
/**
|
|
26
|
+
* 幻灯片准备就绪
|
|
27
|
+
*/
|
|
28
|
+
abstract ready(): Promise<void>;
|
|
2
29
|
/**
|
|
3
30
|
* 打印幻灯片
|
|
4
31
|
*/
|
|
@@ -22,10 +49,25 @@ export declare abstract class AbstractedPresentationSDK extends EditorSDK {
|
|
|
22
49
|
abstract get text(): PresentationText;
|
|
23
50
|
}
|
|
24
51
|
|
|
52
|
+
/**
|
|
53
|
+
* 匿名用户信息
|
|
54
|
+
* 当前用户信息未知时的缺省值
|
|
55
|
+
*/
|
|
56
|
+
export declare interface EditorAnonymousOptions {
|
|
57
|
+
/**
|
|
58
|
+
* 匿名用户默认显示名称
|
|
59
|
+
*/
|
|
60
|
+
name: string;
|
|
61
|
+
/**
|
|
62
|
+
* 匿名用户默认头像
|
|
63
|
+
*/
|
|
64
|
+
avatar: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
25
67
|
/**
|
|
26
68
|
* 编辑器内部资源请求配置
|
|
27
69
|
*/
|
|
28
|
-
declare interface EditorAssetsOptions {
|
|
70
|
+
export declare interface EditorAssetsOptions {
|
|
29
71
|
/**
|
|
30
72
|
* 通用资源请求代理配置,
|
|
31
73
|
* 用于套件内部资源请求时代理请求
|
|
@@ -44,7 +86,7 @@ declare interface EditorAssetsOptions {
|
|
|
44
86
|
/**
|
|
45
87
|
* 基于对象存储的图片处理抽象
|
|
46
88
|
*/
|
|
47
|
-
declare interface EditorAssetsOssImageProcessing {
|
|
89
|
+
export declare interface EditorAssetsOssImageProcessing {
|
|
48
90
|
/**
|
|
49
91
|
* 压缩图片的方法
|
|
50
92
|
* @param imageUrl 图片的 URL
|
|
@@ -71,7 +113,7 @@ declare interface EditorAssetsOssImageProcessing {
|
|
|
71
113
|
}) => Promise<string>;
|
|
72
114
|
}
|
|
73
115
|
|
|
74
|
-
declare interface EditorAssetsResolver {
|
|
116
|
+
export declare interface EditorAssetsResolver {
|
|
75
117
|
/**
|
|
76
118
|
* 将资源文件 ID 转换为 URL 的方法
|
|
77
119
|
* @param assetId 资源文件 ID
|
|
@@ -93,11 +135,121 @@ declare interface EditorAssetsResolver {
|
|
|
93
135
|
checkAssetReady: (assetId: string) => Promise<boolean> | boolean;
|
|
94
136
|
}
|
|
95
137
|
|
|
138
|
+
/**
|
|
139
|
+
* 编辑器附件限制配置,sdk中会使用在不同的场景下使用不同的限制规则组合
|
|
140
|
+
*/
|
|
141
|
+
export declare interface EditorAttachmentLimitationOptions {
|
|
142
|
+
/**
|
|
143
|
+
* 检查附件大小的规则
|
|
144
|
+
* @param file
|
|
145
|
+
* @returns
|
|
146
|
+
*/
|
|
147
|
+
checkFile: (params: EditorAttachmentLimitationOptionsCheckFunctionParams) => Promise<{
|
|
148
|
+
limited: true;
|
|
149
|
+
message: string;
|
|
150
|
+
} | {
|
|
151
|
+
limited: false;
|
|
152
|
+
}>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 编辑器附件限制配置检查函数参数
|
|
157
|
+
*/
|
|
158
|
+
export declare interface EditorAttachmentLimitationOptionsCheckFunctionParams {
|
|
159
|
+
/**
|
|
160
|
+
* 文件名称,带后缀名
|
|
161
|
+
*/
|
|
162
|
+
name: string;
|
|
163
|
+
/**
|
|
164
|
+
* 文件大小,单位为Byte
|
|
165
|
+
*/
|
|
166
|
+
size: number;
|
|
167
|
+
/**
|
|
168
|
+
* 文件的mime类型,例如image/jpeg、application/vnd.ms-excel等
|
|
169
|
+
*/
|
|
170
|
+
mime?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 编辑器附件限制配置
|
|
175
|
+
* @deprecated 使用limitations代替
|
|
176
|
+
*/
|
|
177
|
+
export declare interface EditorAttachmentMaxSizeOptions {
|
|
178
|
+
/**
|
|
179
|
+
* 图片大小上限值,单位为Byte
|
|
180
|
+
* 设置为Infinity时表示不限制图片大小
|
|
181
|
+
*/
|
|
182
|
+
value?: number;
|
|
183
|
+
/**
|
|
184
|
+
* 超限警告相关配置
|
|
185
|
+
*/
|
|
186
|
+
warning?: {
|
|
187
|
+
/**
|
|
188
|
+
* 超限警告文本
|
|
189
|
+
*/
|
|
190
|
+
text?: string;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 编辑器附件信息
|
|
196
|
+
*/
|
|
197
|
+
export declare interface EditorAttachmentOptions {
|
|
198
|
+
uploader: AbstractedEditorFileUploader;
|
|
199
|
+
download: (url: string) => void;
|
|
200
|
+
/**
|
|
201
|
+
* 图片附件相关配置
|
|
202
|
+
*/
|
|
203
|
+
image?: {
|
|
204
|
+
/**
|
|
205
|
+
* 图片大小上限相关配置
|
|
206
|
+
* @deprecated 使用limitations代替
|
|
207
|
+
*/
|
|
208
|
+
maxSize?: EditorAttachmentMaxSizeOptions;
|
|
209
|
+
/**
|
|
210
|
+
* 支持的图片格式列表,例如jpg,png等
|
|
211
|
+
*/
|
|
212
|
+
supportTypes?: string[];
|
|
213
|
+
/**
|
|
214
|
+
* 图片附件的限制配置
|
|
215
|
+
*/
|
|
216
|
+
limitations?: EditorAttachmentLimitationOptions;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* 其他附件相关配置
|
|
220
|
+
*/
|
|
221
|
+
attachment?: {
|
|
222
|
+
/**
|
|
223
|
+
* 图片大小上限相关配置
|
|
224
|
+
* @deprecated 使用limitations代替
|
|
225
|
+
*/
|
|
226
|
+
maxSize?: EditorAttachmentMaxSizeOptions;
|
|
227
|
+
/**
|
|
228
|
+
* 支持的附件格式列表,例如doc,docx等
|
|
229
|
+
*/
|
|
230
|
+
supportTypes?: string[];
|
|
231
|
+
/**
|
|
232
|
+
* 附件的限制配置
|
|
233
|
+
*/
|
|
234
|
+
limitations?: EditorAttachmentLimitationOptions;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* 基础文件属性
|
|
240
|
+
*/
|
|
241
|
+
export declare interface EditorBaseUploadableFile {
|
|
242
|
+
secretly?: boolean;
|
|
243
|
+
bucket: 'images' | 'attachments';
|
|
244
|
+
encrypt: string;
|
|
245
|
+
fileGuid: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
96
248
|
/**
|
|
97
249
|
* 品牌相关设置,
|
|
98
250
|
* 用于在套件中展示品牌外露信息
|
|
99
251
|
*/
|
|
100
|
-
declare interface EditorBrandOptions {
|
|
252
|
+
export declare interface EditorBrandOptions {
|
|
101
253
|
/**
|
|
102
254
|
* 需要显示在品牌展示位的内容,按数组顺序显示
|
|
103
255
|
*/
|
|
@@ -121,7 +273,7 @@ declare interface EditorBrandOptions {
|
|
|
121
273
|
/**
|
|
122
274
|
* 单条评论数据
|
|
123
275
|
*/
|
|
124
|
-
declare interface EditorCommentItem {
|
|
276
|
+
export declare interface EditorCommentItem {
|
|
125
277
|
/**
|
|
126
278
|
* 评论 ID
|
|
127
279
|
*/
|
|
@@ -138,7 +290,7 @@ declare interface EditorCommentItem {
|
|
|
138
290
|
};
|
|
139
291
|
}
|
|
140
292
|
|
|
141
|
-
declare interface EditorComments {
|
|
293
|
+
export declare interface EditorComments {
|
|
142
294
|
/**
|
|
143
295
|
* 检查是否有评论
|
|
144
296
|
* @returns
|
|
@@ -184,7 +336,7 @@ declare interface EditorComments {
|
|
|
184
336
|
/**
|
|
185
337
|
* 编辑器评论初始化配置
|
|
186
338
|
*/
|
|
187
|
-
declare interface EditorCommentsOptions {
|
|
339
|
+
export declare interface EditorCommentsOptions {
|
|
188
340
|
/**
|
|
189
341
|
* 评论作者信息,如果这里的信息为空,将会使用 user 信息
|
|
190
342
|
*/
|
|
@@ -215,7 +367,7 @@ declare interface EditorCommentsOptions {
|
|
|
215
367
|
};
|
|
216
368
|
}
|
|
217
369
|
|
|
218
|
-
declare interface EditorContent {
|
|
370
|
+
export declare interface EditorContent<Delta = EditorDelta> {
|
|
219
371
|
/**
|
|
220
372
|
* 设置编辑器内容
|
|
221
373
|
* @param content
|
|
@@ -224,15 +376,42 @@ declare interface EditorContent {
|
|
|
224
376
|
/**
|
|
225
377
|
* 获取编辑器内容
|
|
226
378
|
*/
|
|
227
|
-
getContent: () => Promise<
|
|
379
|
+
getContent: () => Promise<Delta>;
|
|
228
380
|
/**
|
|
229
381
|
* 添加监听,当内容发生变化时触发监听,传入 Delta
|
|
230
382
|
* @param listener
|
|
231
383
|
*/
|
|
232
|
-
addChangeListener: (listener: (change:
|
|
384
|
+
addChangeListener: (listener: (change: Delta) => void) => () => void;
|
|
233
385
|
}
|
|
234
386
|
|
|
235
|
-
|
|
387
|
+
/**
|
|
388
|
+
* 右键菜单栏二级以下的菜单入口
|
|
389
|
+
*/
|
|
390
|
+
export declare type EditorContextMenuEntryButton<TName extends string> = EditorMenuEntryButton<TName>;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* 右键菜单栏一级菜单配置,此处用于定义一级菜单的操作入口,
|
|
394
|
+
* 右键菜单栏一级菜单指点击右键弹出菜单时的菜单项
|
|
395
|
+
*/
|
|
396
|
+
export declare type EditorContextMenuEntryConfig<TName extends string> = EditorMenuEntryConfig<TName>;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* 右键菜单栏功能按钮配置
|
|
400
|
+
*/
|
|
401
|
+
export declare type EditorContextMenuFeatureButton<TName extends string> = EditorMenuFeatureButton<TName>;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* 右键菜单栏按钮配置
|
|
405
|
+
*/
|
|
406
|
+
export declare type EditorContextMenuFeatureButtonConfig<TName extends string> = EditorMenuFeatureButtonConfig<TName>;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* 右键菜单栏相关配置
|
|
410
|
+
* 右键菜单栏是指的编辑器中点击右键弹出的菜单栏。目前等于菜单栏配置,可扩展
|
|
411
|
+
*/
|
|
412
|
+
export declare type EditorContextMenuOptions<TName extends string> = EditorMenuOptions<TName>;
|
|
413
|
+
|
|
414
|
+
export declare interface EditorDelta {
|
|
236
415
|
compose: (other: EditorDelta, isDocument?: boolean) => EditorDelta;
|
|
237
416
|
transform: (other: EditorDelta, priority?: boolean) => EditorDelta;
|
|
238
417
|
stringify: () => string;
|
|
@@ -242,7 +421,7 @@ declare interface EditorDelta {
|
|
|
242
421
|
/**
|
|
243
422
|
* 编辑器嵌入对象
|
|
244
423
|
*/
|
|
245
|
-
declare interface EditorEmbeddedObject {
|
|
424
|
+
export declare interface EditorEmbeddedObject {
|
|
246
425
|
/**
|
|
247
426
|
* 嵌入的对象 url
|
|
248
427
|
*/
|
|
@@ -260,7 +439,7 @@ declare interface EditorEmbeddedObject {
|
|
|
260
439
|
/**
|
|
261
440
|
* 编辑器嵌入对象抽象类
|
|
262
441
|
*/
|
|
263
|
-
declare interface EditorEmbeddedObjectOptions {
|
|
442
|
+
export declare interface EditorEmbeddedObjectOptions {
|
|
264
443
|
/**
|
|
265
444
|
* 执行打开嵌入对象操作,
|
|
266
445
|
* 如果已经处理了打开操作,返回 true,否则返回 false,
|
|
@@ -288,7 +467,20 @@ declare interface EditorEmbeddedObjectOptions {
|
|
|
288
467
|
};
|
|
289
468
|
}
|
|
290
469
|
|
|
291
|
-
declare interface
|
|
470
|
+
export declare interface EditorExportOptions {
|
|
471
|
+
/**
|
|
472
|
+
* 可导出类型
|
|
473
|
+
* @description
|
|
474
|
+
*/
|
|
475
|
+
supportedTypes?: string[];
|
|
476
|
+
/**
|
|
477
|
+
* 导出文件
|
|
478
|
+
* @description
|
|
479
|
+
*/
|
|
480
|
+
exportFile: (type: string) => Promise<void>;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export declare interface EditorFontFace {
|
|
292
484
|
/**
|
|
293
485
|
* 字体的名称,用于在用户界面上显示的名称
|
|
294
486
|
*/
|
|
@@ -314,7 +506,7 @@ declare interface EditorFontFace {
|
|
|
314
506
|
/**
|
|
315
507
|
* 字体元数据
|
|
316
508
|
*/
|
|
317
|
-
declare interface EditorFontMeta {
|
|
509
|
+
export declare interface EditorFontMeta {
|
|
318
510
|
head: {
|
|
319
511
|
unitsPerEm: number;
|
|
320
512
|
};
|
|
@@ -348,10 +540,28 @@ declare interface EditorFontMeta {
|
|
|
348
540
|
};
|
|
349
541
|
}
|
|
350
542
|
|
|
543
|
+
/**
|
|
544
|
+
* 字体列表
|
|
545
|
+
*/
|
|
546
|
+
export declare interface EditorFontsList {
|
|
547
|
+
/**
|
|
548
|
+
* 返回解析为字体的列表的 Promise。
|
|
549
|
+
*/
|
|
550
|
+
getAll: () => Promise<EditorFontFace[]>;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export declare interface EditorFontsOptions {
|
|
554
|
+
/**
|
|
555
|
+
* 服务器字体列表,用于获取服务器端配置的字体列表,
|
|
556
|
+
* 并提供可用于字体的加载 URL 和字体元数据。
|
|
557
|
+
*/
|
|
558
|
+
list: EditorFontsList;
|
|
559
|
+
}
|
|
560
|
+
|
|
351
561
|
/**
|
|
352
562
|
* i18n 相关设置
|
|
353
563
|
*/
|
|
354
|
-
declare interface EditorI18nOptions {
|
|
564
|
+
export declare interface EditorI18nOptions {
|
|
355
565
|
/**
|
|
356
566
|
* 语言,默认使用浏览器当前环境中的语言
|
|
357
567
|
*/
|
|
@@ -362,12 +572,12 @@ declare interface EditorI18nOptions {
|
|
|
362
572
|
direction?: 'ltr' | 'rtl';
|
|
363
573
|
}
|
|
364
574
|
|
|
365
|
-
declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'center' | 'east' | 'sw' | 'south' | 'se';
|
|
575
|
+
export declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'center' | 'east' | 'sw' | 'south' | 'se';
|
|
366
576
|
|
|
367
577
|
/**
|
|
368
578
|
* 链接配置,抽象打开链接等操作
|
|
369
579
|
*/
|
|
370
|
-
declare interface EditorLinkOptions {
|
|
580
|
+
export declare interface EditorLinkOptions {
|
|
371
581
|
/**
|
|
372
582
|
* 打开链接,如果取消了打开链接操作,返回 false
|
|
373
583
|
* @param url
|
|
@@ -377,10 +587,20 @@ declare interface EditorLinkOptions {
|
|
|
377
587
|
open: (url: string, target: string) => Promise<boolean>;
|
|
378
588
|
}
|
|
379
589
|
|
|
590
|
+
/**
|
|
591
|
+
* 可上传文件
|
|
592
|
+
*/
|
|
593
|
+
export declare interface EditorLocalUploadableFile extends EditorBaseUploadableFile {
|
|
594
|
+
name: string;
|
|
595
|
+
size: number;
|
|
596
|
+
mime: string;
|
|
597
|
+
raw: File;
|
|
598
|
+
}
|
|
599
|
+
|
|
380
600
|
/**
|
|
381
601
|
* 菜单栏自定义按钮配置
|
|
382
602
|
*/
|
|
383
|
-
declare type EditorMenuCustomButton = {
|
|
603
|
+
export declare type EditorMenuCustomButton = {
|
|
384
604
|
/**
|
|
385
605
|
* 按钮名称
|
|
386
606
|
*/
|
|
@@ -423,7 +643,7 @@ declare type EditorMenuCustomButton = {
|
|
|
423
643
|
/**
|
|
424
644
|
* 菜单栏二级以下的菜单入口
|
|
425
645
|
*/
|
|
426
|
-
declare interface EditorMenuEntryButton {
|
|
646
|
+
export declare interface EditorMenuEntryButton<TName extends string> {
|
|
427
647
|
type: 'entry';
|
|
428
648
|
/**
|
|
429
649
|
* 菜单名称
|
|
@@ -433,13 +653,17 @@ declare interface EditorMenuEntryButton {
|
|
|
433
653
|
* 菜单图标
|
|
434
654
|
*/
|
|
435
655
|
icon?: string;
|
|
656
|
+
/**
|
|
657
|
+
* 下一级子菜单
|
|
658
|
+
*/
|
|
659
|
+
children?: Array<EditorMenuFeatureButton<TName> | EditorMenuEntryButton<TName>>[];
|
|
436
660
|
}
|
|
437
661
|
|
|
438
662
|
/**
|
|
439
663
|
* 菜单栏一级菜单配置,此处用于定义一级菜单的操作入口,
|
|
440
664
|
* 一级菜单在鼠标悬停时展示二级列表
|
|
441
665
|
*/
|
|
442
|
-
declare interface EditorMenuEntryConfig<TName extends string> {
|
|
666
|
+
export declare interface EditorMenuEntryConfig<TName extends string> {
|
|
443
667
|
/**
|
|
444
668
|
* 一级菜单名称
|
|
445
669
|
*/
|
|
@@ -449,13 +673,17 @@ declare interface EditorMenuEntryConfig<TName extends string> {
|
|
|
449
673
|
* 将第一层数组中的所有按钮放到一个区域内用分隔符隔开,
|
|
450
674
|
* 第二层数组为按钮的定义,可以是功能按钮也可以是一个下拉入口。
|
|
451
675
|
*/
|
|
452
|
-
children: Array<EditorMenuFeatureButton<TName> | EditorMenuEntryButton
|
|
676
|
+
children: Array<EditorMenuFeatureButton<TName> | EditorMenuEntryButton<TName>>[];
|
|
677
|
+
/**
|
|
678
|
+
* 是否隐藏一级菜单
|
|
679
|
+
*/
|
|
680
|
+
type?: 'hidden';
|
|
453
681
|
}
|
|
454
682
|
|
|
455
683
|
/**
|
|
456
684
|
* 菜单栏功能按钮配置
|
|
457
685
|
*/
|
|
458
|
-
declare type EditorMenuFeatureButton<TName extends string> = {
|
|
686
|
+
export declare type EditorMenuFeatureButton<TName extends string> = {
|
|
459
687
|
/**
|
|
460
688
|
* 隐藏按钮,用作在需要隐藏菜单栏时定义
|
|
461
689
|
*/
|
|
@@ -483,17 +711,17 @@ declare type EditorMenuFeatureButton<TName extends string> = {
|
|
|
483
711
|
/**
|
|
484
712
|
* 菜单栏按钮配置
|
|
485
713
|
*/
|
|
486
|
-
declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
714
|
+
export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
487
715
|
|
|
488
716
|
/**
|
|
489
717
|
* 菜单栏相关配置,目前菜单栏不是所有套件都支持,
|
|
490
718
|
* 菜单栏是指的编辑器最上放可以展开二级菜单的那一栏。
|
|
491
719
|
*/
|
|
492
|
-
declare interface EditorMenuOptions<TName extends string> {
|
|
720
|
+
export declare interface EditorMenuOptions<TName extends string> {
|
|
493
721
|
/**
|
|
494
|
-
*
|
|
722
|
+
* 菜单栏是否隐藏
|
|
495
723
|
*/
|
|
496
|
-
|
|
724
|
+
hidden?: boolean;
|
|
497
725
|
/**
|
|
498
726
|
* 是否禁用菜单栏所有功能
|
|
499
727
|
*/
|
|
@@ -515,7 +743,7 @@ declare interface EditorMenuOptions<TName extends string> {
|
|
|
515
743
|
/**
|
|
516
744
|
* 编辑器基础模式接口
|
|
517
745
|
*/
|
|
518
|
-
declare interface EditorMode {
|
|
746
|
+
export declare interface EditorMode {
|
|
519
747
|
/**
|
|
520
748
|
* 获取当前编辑器模式
|
|
521
749
|
*/
|
|
@@ -534,7 +762,7 @@ declare interface EditorMode {
|
|
|
534
762
|
/**
|
|
535
763
|
* 编辑器初始化的时相关的模式配置
|
|
536
764
|
*/
|
|
537
|
-
declare type EditorModeOptions = {
|
|
765
|
+
export declare type EditorModeOptions = {
|
|
538
766
|
type: 'standard';
|
|
539
767
|
/**
|
|
540
768
|
* 当 mode 为 `standard` 时,可以设置当前编辑器的权限模式
|
|
@@ -552,12 +780,12 @@ declare type EditorModeOptions = {
|
|
|
552
780
|
* - `preview` 预览模式,只能查看内容
|
|
553
781
|
* - `presentation` 演示模式,用作演示场景,演示模式下部分套件可以进行一些简单的编辑操作
|
|
554
782
|
*/
|
|
555
|
-
declare type EditorModeType = 'standard' | 'preview' | 'presentation';
|
|
783
|
+
export declare type EditorModeType = 'standard' | 'preview' | 'presentation';
|
|
556
784
|
|
|
557
785
|
/**
|
|
558
786
|
* 编辑器初始化通用参数
|
|
559
787
|
*/
|
|
560
|
-
declare interface EditorOptions {
|
|
788
|
+
export declare interface EditorOptions {
|
|
561
789
|
/**
|
|
562
790
|
* 编辑器初始化内容,可以是 string 或者 ArrayBuffer,
|
|
563
791
|
* 也可以通过异步 Promise 加载
|
|
@@ -571,6 +799,10 @@ declare interface EditorOptions {
|
|
|
571
799
|
* 当前操作编辑器的用户信息
|
|
572
800
|
*/
|
|
573
801
|
user?: EditorUserOptions;
|
|
802
|
+
/**
|
|
803
|
+
* 匿名用户的缺省信息
|
|
804
|
+
*/
|
|
805
|
+
anonymous?: EditorAnonymousOptions;
|
|
574
806
|
/**
|
|
575
807
|
* i18n 相关设置
|
|
576
808
|
*/
|
|
@@ -579,10 +811,6 @@ declare interface EditorOptions {
|
|
|
579
811
|
* 品牌相关设置
|
|
580
812
|
*/
|
|
581
813
|
brand?: EditorBrandOptions;
|
|
582
|
-
/**
|
|
583
|
-
* 工具栏相关设置
|
|
584
|
-
*/
|
|
585
|
-
toolbar?: EditorToolbarOptions;
|
|
586
814
|
/**
|
|
587
815
|
* 编辑器内部资源请求配置
|
|
588
816
|
*/
|
|
@@ -607,12 +835,78 @@ declare interface EditorOptions {
|
|
|
607
835
|
* 编辑器评论设置
|
|
608
836
|
*/
|
|
609
837
|
comments?: EditorCommentsOptions;
|
|
838
|
+
/**
|
|
839
|
+
* 附件设置
|
|
840
|
+
*/
|
|
841
|
+
attachment?: EditorAttachmentOptions;
|
|
842
|
+
/**
|
|
843
|
+
* 导出设置
|
|
844
|
+
*/
|
|
845
|
+
export?: EditorExportOptions;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* 大纲目录接口
|
|
850
|
+
*/
|
|
851
|
+
export declare interface EditorOutline<Content = unknown> {
|
|
852
|
+
/**
|
|
853
|
+
* 设置大纲目录是否可见
|
|
854
|
+
* @param visible 是否可见
|
|
855
|
+
*/
|
|
856
|
+
setVisible: (visible: boolean) => void;
|
|
857
|
+
/**
|
|
858
|
+
* 获取目录信息
|
|
859
|
+
* @returns 目录信息
|
|
860
|
+
*/
|
|
861
|
+
getContent: () => Promise<EditorOutlineItem<Content>[]>;
|
|
862
|
+
/**
|
|
863
|
+
* 添加目录信息改变时的监听器
|
|
864
|
+
* @param listener 监听器
|
|
865
|
+
* @returns 取消监听器的函数
|
|
866
|
+
*/
|
|
867
|
+
addChangedListener: (listener: (content: EditorOutlineItem<Content>[]) => void) => () => void;
|
|
868
|
+
/**
|
|
869
|
+
* 跳转到指定条目对应的正文位置
|
|
870
|
+
* @param id 条目id
|
|
871
|
+
* @returns 跳转是否成功
|
|
872
|
+
*/
|
|
873
|
+
goto: (id: string) => Promise<boolean>;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* 大纲目录项条目
|
|
878
|
+
*/
|
|
879
|
+
export declare interface EditorOutlineItem<Content = unknown> {
|
|
880
|
+
/**
|
|
881
|
+
* 目录项 ID
|
|
882
|
+
*/
|
|
883
|
+
id: string;
|
|
884
|
+
/**
|
|
885
|
+
* 目录项层级
|
|
886
|
+
*/
|
|
887
|
+
level: number;
|
|
888
|
+
/**
|
|
889
|
+
* 目录项内容
|
|
890
|
+
*/
|
|
891
|
+
content: Content;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* 大纲目录初始化参数,
|
|
896
|
+
* 用于配置大纲目录的行为和外观。
|
|
897
|
+
*/
|
|
898
|
+
export declare interface EditorOutlineOptions {
|
|
899
|
+
/**
|
|
900
|
+
* 初始化编辑器时是否显示大纲目录,
|
|
901
|
+
* 默认为 false。
|
|
902
|
+
*/
|
|
903
|
+
visible?: boolean;
|
|
610
904
|
}
|
|
611
905
|
|
|
612
906
|
/**
|
|
613
907
|
* 编辑器打印设置
|
|
614
908
|
*/
|
|
615
|
-
declare interface EditorPrintOptions {
|
|
909
|
+
export declare interface EditorPrintOptions {
|
|
616
910
|
/**
|
|
617
911
|
* 部分套件如果绕过了编辑器预设的打印接口,直接通过拉起了浏览器的打印页面,这时打印页面无法获取到编辑器的内容,
|
|
618
912
|
* 这种情况下就会 fallback 到这个 options 上,显示一个提示信息。
|
|
@@ -626,10 +920,21 @@ declare interface EditorPrintOptions {
|
|
|
626
920
|
disabled?: boolean;
|
|
627
921
|
}
|
|
628
922
|
|
|
923
|
+
/**
|
|
924
|
+
* 远程文件上传
|
|
925
|
+
*/
|
|
926
|
+
export declare interface EditorRemoteUploadableFile extends EditorBaseUploadableFile {
|
|
927
|
+
src: string;
|
|
928
|
+
name?: never;
|
|
929
|
+
size?: never;
|
|
930
|
+
mime?: never;
|
|
931
|
+
raw?: never;
|
|
932
|
+
}
|
|
933
|
+
|
|
629
934
|
/**
|
|
630
935
|
* 编辑器通用接口
|
|
631
936
|
*/
|
|
632
|
-
declare abstract class EditorSDK {
|
|
937
|
+
export declare abstract class EditorSDK {
|
|
633
938
|
protected options: EditorOptions;
|
|
634
939
|
constructor(options: EditorOptions);
|
|
635
940
|
/**
|
|
@@ -670,13 +975,62 @@ declare abstract class EditorSDK {
|
|
|
670
975
|
* - `viewer` 阅读模式
|
|
671
976
|
* - `reviewer` 评论模式
|
|
672
977
|
*/
|
|
673
|
-
declare type EditorStandardRole = 'editor' | 'viewer' | 'reviewer';
|
|
978
|
+
export declare type EditorStandardRole = 'editor' | 'viewer' | 'reviewer';
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* 上传任务回调
|
|
982
|
+
*/
|
|
983
|
+
export declare interface EditorTaskCallbacks {
|
|
984
|
+
/**
|
|
985
|
+
* 上传进度回调
|
|
986
|
+
* @param taskId
|
|
987
|
+
* @param loaded
|
|
988
|
+
* @param total
|
|
989
|
+
* @param progress
|
|
990
|
+
* @param data
|
|
991
|
+
* @returns
|
|
992
|
+
*/
|
|
993
|
+
onProgress?: (taskId: string, loaded: number, total: number, progress: number, data?: unknown) => void;
|
|
994
|
+
/**
|
|
995
|
+
* 上传错误回调
|
|
996
|
+
* @param taskId
|
|
997
|
+
* @param error
|
|
998
|
+
* @returns
|
|
999
|
+
*/
|
|
1000
|
+
onError?: (taskId: string, error: Error) => void;
|
|
1001
|
+
/**
|
|
1002
|
+
* 上传暂停回调
|
|
1003
|
+
* @param taskId
|
|
1004
|
+
* @returns
|
|
1005
|
+
*/
|
|
1006
|
+
onPause?: (taskId: string) => void;
|
|
1007
|
+
/**
|
|
1008
|
+
* 上传取消
|
|
1009
|
+
* @param taskId
|
|
1010
|
+
* @returns
|
|
1011
|
+
*/
|
|
1012
|
+
onAbort?: (taskId: string) => void;
|
|
1013
|
+
/**
|
|
1014
|
+
* 上传恢复
|
|
1015
|
+
* @param taskId
|
|
1016
|
+
* @returns
|
|
1017
|
+
*/
|
|
1018
|
+
onResume?: (taskId: string) => void;
|
|
1019
|
+
/**
|
|
1020
|
+
* 上传完成回调
|
|
1021
|
+
* @param taskId
|
|
1022
|
+
* @param status
|
|
1023
|
+
* @param data
|
|
1024
|
+
* @returns
|
|
1025
|
+
*/
|
|
1026
|
+
onEnd?: (taskId: string, status: 'Error' | 'Finished' | 'Canceled', data: unknown) => void;
|
|
1027
|
+
}
|
|
674
1028
|
|
|
675
1029
|
/**
|
|
676
1030
|
* 文本格式接口,
|
|
677
1031
|
* 包括设置、读取选区内文本的 BIUS、family、大小、颜色等
|
|
678
1032
|
*/
|
|
679
|
-
declare interface EditorText<Color = string, TRangeValue = unknown> {
|
|
1033
|
+
export declare interface EditorText<Color = string, TRangeValue = unknown> {
|
|
680
1034
|
/**
|
|
681
1035
|
* 获取当前选区或指定选区内的文本格式状态
|
|
682
1036
|
*/
|
|
@@ -700,7 +1054,7 @@ declare interface EditorText<Color = string, TRangeValue = unknown> {
|
|
|
700
1054
|
/**
|
|
701
1055
|
* 文本格式状态
|
|
702
1056
|
*/
|
|
703
|
-
declare interface EditorTextFormat<Color = string> {
|
|
1057
|
+
export declare interface EditorTextFormat<Color = string> {
|
|
704
1058
|
/**
|
|
705
1059
|
* 粗体
|
|
706
1060
|
*/
|
|
@@ -738,7 +1092,7 @@ declare interface EditorTextFormat<Color = string> {
|
|
|
738
1092
|
/**
|
|
739
1093
|
* 文本格式初始化选项
|
|
740
1094
|
*/
|
|
741
|
-
declare interface EditorTextOptions<Color = string> {
|
|
1095
|
+
export declare interface EditorTextOptions<Color = string> {
|
|
742
1096
|
/**
|
|
743
1097
|
* 当前编辑器默认的文本格式
|
|
744
1098
|
*/
|
|
@@ -748,7 +1102,7 @@ declare interface EditorTextOptions<Color = string> {
|
|
|
748
1102
|
/**
|
|
749
1103
|
* 工具栏自定义按钮配置
|
|
750
1104
|
*/
|
|
751
|
-
declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureButton, 'name'> {
|
|
1105
|
+
export declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureButton, 'name'> {
|
|
752
1106
|
/**
|
|
753
1107
|
* 自定义按钮名称
|
|
754
1108
|
*/
|
|
@@ -766,7 +1120,7 @@ declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureBut
|
|
|
766
1120
|
/**
|
|
767
1121
|
* 工具栏自定义按钮配置
|
|
768
1122
|
*/
|
|
769
|
-
declare interface EditorToolbarCustomButtonConfig {
|
|
1123
|
+
export declare interface EditorToolbarCustomButtonConfig {
|
|
770
1124
|
/**
|
|
771
1125
|
* 按钮配置
|
|
772
1126
|
*/
|
|
@@ -776,11 +1130,11 @@ declare interface EditorToolbarCustomButtonConfig {
|
|
|
776
1130
|
/**
|
|
777
1131
|
* 工具栏内置功能按钮配置
|
|
778
1132
|
*/
|
|
779
|
-
declare interface EditorToolbarFeatureButton {
|
|
1133
|
+
export declare interface EditorToolbarFeatureButton<ToolButtonName extends string = EditorToolbarFeatureButtonName> {
|
|
780
1134
|
/**
|
|
781
1135
|
* 按钮类型
|
|
782
1136
|
*/
|
|
783
|
-
name:
|
|
1137
|
+
name: ToolButtonName;
|
|
784
1138
|
/**
|
|
785
1139
|
* 按钮标签(显示文本)
|
|
786
1140
|
*/
|
|
@@ -789,6 +1143,10 @@ declare interface EditorToolbarFeatureButton {
|
|
|
789
1143
|
* 按钮图标,可以是 base64 的图片信息,也可以是图片 url
|
|
790
1144
|
*/
|
|
791
1145
|
icon?: string;
|
|
1146
|
+
/**
|
|
1147
|
+
* 按钮是否隐藏
|
|
1148
|
+
*/
|
|
1149
|
+
hidden?: boolean;
|
|
792
1150
|
/**
|
|
793
1151
|
* 按钮是否禁用
|
|
794
1152
|
*/
|
|
@@ -802,14 +1160,14 @@ declare interface EditorToolbarFeatureButton {
|
|
|
802
1160
|
/**
|
|
803
1161
|
* 工具栏内置功能按钮配置
|
|
804
1162
|
*/
|
|
805
|
-
declare type EditorToolbarFeatureButtonConfig = {
|
|
806
|
-
[key in
|
|
1163
|
+
export declare type EditorToolbarFeatureButtonConfig<ToolButtonName extends string> = {
|
|
1164
|
+
[key in ToolButtonName]?: EditorToolbarFeatureButton<ToolButtonName>;
|
|
807
1165
|
};
|
|
808
1166
|
|
|
809
1167
|
/**
|
|
810
1168
|
* 工具栏内置功能按钮
|
|
811
1169
|
*/
|
|
812
|
-
declare type EditorToolbarFeatureButtonName =
|
|
1170
|
+
export declare type EditorToolbarFeatureButtonName =
|
|
813
1171
|
/**
|
|
814
1172
|
* 加粗
|
|
815
1173
|
*/
|
|
@@ -842,11 +1200,11 @@ declare type EditorToolbarFeatureButtonName =
|
|
|
842
1200
|
/**
|
|
843
1201
|
* 工具栏相关设置,可以控制工具栏的显示内容
|
|
844
1202
|
*/
|
|
845
|
-
declare interface EditorToolbarOptions {
|
|
1203
|
+
export declare interface EditorToolbarOptions<ToolButtonName extends string = EditorToolbarFeatureButtonName> {
|
|
846
1204
|
/**
|
|
847
1205
|
* 控制工具栏显隐状态
|
|
848
1206
|
*/
|
|
849
|
-
|
|
1207
|
+
hidden?: boolean;
|
|
850
1208
|
/**
|
|
851
1209
|
* 是否禁用工具栏所有功能
|
|
852
1210
|
*/
|
|
@@ -854,17 +1212,58 @@ declare interface EditorToolbarOptions {
|
|
|
854
1212
|
/**
|
|
855
1213
|
* 现有按钮的功能配置
|
|
856
1214
|
*/
|
|
857
|
-
features?: EditorToolbarFeatureButtonConfig
|
|
1215
|
+
features?: EditorToolbarFeatureButtonConfig<ToolButtonName>;
|
|
858
1216
|
/**
|
|
859
1217
|
* 自定义按钮
|
|
860
1218
|
*/
|
|
861
1219
|
custom?: EditorToolbarCustomButtonConfig;
|
|
862
1220
|
}
|
|
863
1221
|
|
|
1222
|
+
export declare type EditorUploadableFile = EditorLocalUploadableFile;
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* 文件开始上传入参
|
|
1226
|
+
*/
|
|
1227
|
+
export declare interface EditorUploadStartOptions extends EditorUploadTaskCallbacks {
|
|
1228
|
+
files: EditorUploadableFile[];
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* 上传状态
|
|
1233
|
+
*/
|
|
1234
|
+
export declare enum EditorUploadStatus {
|
|
1235
|
+
Waiting = "Waiting",
|
|
1236
|
+
Uploading = "Uploading",
|
|
1237
|
+
Paused = "Paused",
|
|
1238
|
+
Canceled = "Canceled",
|
|
1239
|
+
Error = "Error",
|
|
1240
|
+
Finished = "Finished"
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
export declare type EditorUploadTaskCallbacks = Omit<EditorTaskCallbacks, 'onEnd'> & {
|
|
1244
|
+
onLoadend: (results: {
|
|
1245
|
+
taskId: string;
|
|
1246
|
+
status: 'Error' | 'Finished' | 'Canceled';
|
|
1247
|
+
data?: unknown;
|
|
1248
|
+
}[]) => void;
|
|
1249
|
+
};
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* 上传任务信息
|
|
1253
|
+
*/
|
|
1254
|
+
export declare interface EditorUploadTaskInfo {
|
|
1255
|
+
taskId: string;
|
|
1256
|
+
fileInfo: EditorUploadableFile;
|
|
1257
|
+
total: number;
|
|
1258
|
+
readonly loaded: number;
|
|
1259
|
+
readonly progress: number;
|
|
1260
|
+
readonly status: EditorUploadStatus;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
864
1263
|
/**
|
|
865
1264
|
* 操作当前编辑器的用户信息
|
|
866
1265
|
*/
|
|
867
|
-
declare interface EditorUserOptions {
|
|
1266
|
+
export declare interface EditorUserOptions {
|
|
868
1267
|
/**
|
|
869
1268
|
* 用户 ID,用于标识用户
|
|
870
1269
|
*/
|
|
@@ -877,12 +1276,16 @@ declare interface EditorUserOptions {
|
|
|
877
1276
|
* 用户头像
|
|
878
1277
|
*/
|
|
879
1278
|
avatar?: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* 用户默认头像,当用户未设置头像时显示
|
|
1281
|
+
*/
|
|
1282
|
+
defaultAvatar?: string;
|
|
880
1283
|
}
|
|
881
1284
|
|
|
882
1285
|
/**
|
|
883
1286
|
* 编辑器外部水印信息
|
|
884
1287
|
*/
|
|
885
|
-
declare interface EditorWatermarkOptions {
|
|
1288
|
+
export declare interface EditorWatermarkOptions {
|
|
886
1289
|
/**
|
|
887
1290
|
* 获取用作初始化使用的默认水印
|
|
888
1291
|
*/
|
|
@@ -894,7 +1297,7 @@ declare interface EditorWatermarkOptions {
|
|
|
894
1297
|
required?: boolean;
|
|
895
1298
|
}
|
|
896
1299
|
|
|
897
|
-
declare type EditorWatermarkResource = {
|
|
1300
|
+
export declare type EditorWatermarkResource = {
|
|
898
1301
|
type: 'data-url';
|
|
899
1302
|
url: string;
|
|
900
1303
|
} | {
|
|
@@ -905,18 +1308,18 @@ declare type EditorWatermarkResource = {
|
|
|
905
1308
|
/**
|
|
906
1309
|
* 请求、响应头
|
|
907
1310
|
*/
|
|
908
|
-
declare type HTTPHeaders = Record<string, string | number | boolean | undefined>;
|
|
1311
|
+
export declare type HTTPHeaders = Record<string, string | number | boolean | undefined>;
|
|
909
1312
|
|
|
910
1313
|
/**
|
|
911
1314
|
* 请求方法
|
|
912
1315
|
*/
|
|
913
|
-
declare type HTTPMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH';
|
|
1316
|
+
export declare type HTTPMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH';
|
|
914
1317
|
|
|
915
1318
|
/**
|
|
916
1319
|
* HTTP 代理,用于抽象 HTTP 请求,
|
|
917
1320
|
* 将请求代理编辑器外部
|
|
918
1321
|
*/
|
|
919
|
-
declare interface HTTPProxy {
|
|
1322
|
+
export declare interface HTTPProxy {
|
|
920
1323
|
/**
|
|
921
1324
|
* 发送请求,如果需要做请求、响应拦截,需要在 proxy.interceptors 中实现,
|
|
922
1325
|
* 套件内使用 proxy 发送请求的方式应该为类似如下方式:
|
|
@@ -963,7 +1366,7 @@ declare interface HTTPProxy {
|
|
|
963
1366
|
/**
|
|
964
1367
|
* 请求配置
|
|
965
1368
|
*/
|
|
966
|
-
declare interface HTTPRequestConfig<Data = unknown> {
|
|
1369
|
+
export declare interface HTTPRequestConfig<Data = unknown> {
|
|
967
1370
|
/**
|
|
968
1371
|
* 请求地址
|
|
969
1372
|
*/
|
|
@@ -989,7 +1392,7 @@ declare interface HTTPRequestConfig<Data = unknown> {
|
|
|
989
1392
|
/**
|
|
990
1393
|
* 响应数据
|
|
991
1394
|
*/
|
|
992
|
-
declare interface HTTPResponse<Data = unknown> {
|
|
1395
|
+
export declare interface HTTPResponse<Data = unknown> {
|
|
993
1396
|
/**
|
|
994
1397
|
* 响应数据 body
|
|
995
1398
|
*/
|
|
@@ -1007,9 +1410,9 @@ declare interface HTTPResponse<Data = unknown> {
|
|
|
1007
1410
|
/**
|
|
1008
1411
|
* 请求返回类型
|
|
1009
1412
|
*/
|
|
1010
|
-
declare type HTTPResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
1413
|
+
export declare type HTTPResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
1011
1414
|
|
|
1012
|
-
declare type MaybePromiseValue<T> = T | Promise<T>;
|
|
1415
|
+
export declare type MaybePromiseValue<T> = T | Promise<T>;
|
|
1013
1416
|
|
|
1014
1417
|
export declare type PresentationFontFace = EditorFontFace;
|
|
1015
1418
|
|
|
@@ -1049,6 +1452,10 @@ export declare interface PresentationSDKOptions extends EditorOptions {
|
|
|
1049
1452
|
* 菜单栏相关设置
|
|
1050
1453
|
*/
|
|
1051
1454
|
menu?: PresentationMenuOptions;
|
|
1455
|
+
/**
|
|
1456
|
+
* 工具栏相关设置
|
|
1457
|
+
*/
|
|
1458
|
+
toolbar?: PresentationToolbarOptions;
|
|
1052
1459
|
/**
|
|
1053
1460
|
* 文本格式相关设置
|
|
1054
1461
|
*/
|
|
@@ -1241,6 +1648,26 @@ export declare interface PresentationTextRangeValue {
|
|
|
1241
1648
|
end: string;
|
|
1242
1649
|
}
|
|
1243
1650
|
|
|
1651
|
+
/**
|
|
1652
|
+
* 幻灯片工具栏功能按钮
|
|
1653
|
+
*/
|
|
1654
|
+
export declare type PresentationToolbarFeatureButton = EditorToolbarFeatureButton<PresentationToolbarFeatureButtonName>;
|
|
1655
|
+
|
|
1656
|
+
/**
|
|
1657
|
+
* 幻灯片工具栏功能按钮配置
|
|
1658
|
+
*/
|
|
1659
|
+
export declare type PresentationToolbarFeatureButtonConfig = EditorToolbarFeatureButtonConfig<PresentationToolbarFeatureButtonName>;
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* 幻灯片工具栏按钮名称
|
|
1663
|
+
*/
|
|
1664
|
+
export declare type PresentationToolbarFeatureButtonName = 'insertImage' | 'insertShape' | 'insertChart' | 'insertTable' | 'insertTextbox' | 'insertSymbol' | 'insertDiagram' | 'insertAudio' | 'insertAttachment' | 'insertVideo' | 'insertLink' | 'changeTheme' | 'presentationSize' | 'backgroundSetting' | 'pageTransitionAnimation' | 'elementAnimation' | 'searchAndReplace' | 'addComment';
|
|
1665
|
+
|
|
1666
|
+
/**
|
|
1667
|
+
* 幻灯片工具栏
|
|
1668
|
+
*/
|
|
1669
|
+
export declare type PresentationToolbarOptions = EditorToolbarOptions<PresentationToolbarFeatureButtonName>;
|
|
1670
|
+
|
|
1244
1671
|
/**
|
|
1245
1672
|
* 幻灯片缩放接口
|
|
1246
1673
|
*/
|