@officesdk/editor-sdk-core 0.0.0-1 → 0.0.0-11
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/docx/index.js +1 -1
- package/cjs/docx/info.js +1 -1
- package/cjs/docx/sdk.js +1 -1
- package/cjs/docx/selection.js +1 -1
- package/cjs/docx/window.js +1 -1
- package/cjs/index.js +4 -2
- package/cjs/pdf/selection.js +1 -1
- package/cjs/presentation/sdk.js +1 -1
- package/cjs/shared/attachment.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/uploader.js +22 -0
- package/cjs/sheet/sdk.js +1 -1
- package/esm/docx/index.js +1 -1
- package/esm/docx/info.js +1 -1
- package/esm/docx/sdk.js +1 -1
- package/esm/docx/selection.js +1 -1
- package/esm/docx/window.js +1 -1
- package/esm/index.js +2 -2
- package/esm/pdf/selection.js +1 -1
- package/esm/presentation/sdk.js +1 -1
- package/esm/shared/attachment.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/uploader.js +19 -0
- package/esm/sheet/sdk.js +1 -1
- package/{docx.d.ts → index.d.ts} +1323 -95
- package/package.json +1 -1
- package/diagram.d.ts +0 -358
- package/pdf.d.ts +0 -755
- package/presentation.d.ts +0 -1281
- package/shared.d.ts +0 -1066
- package/sheet.d.ts +0 -1370
package/{docx.d.ts → index.d.ts}
RENAMED
|
@@ -1,16 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 抽象 Diagram 接口
|
|
3
|
+
*/
|
|
4
|
+
export declare abstract class AbstractedDiagramSDK {
|
|
5
|
+
protected options: DiagramSDKOptions;
|
|
6
|
+
constructor(options: DiagramSDKOptions);
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
8
|
+
* 初始化 Diagram 、加载插件等操作。
|
|
4
9
|
*/
|
|
5
|
-
abstract
|
|
10
|
+
abstract init(): Promise<void>;
|
|
6
11
|
/**
|
|
7
|
-
*
|
|
12
|
+
* 销毁 Diagram
|
|
8
13
|
*/
|
|
9
|
-
abstract
|
|
14
|
+
abstract destroy(): Promise<void>;
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
16
|
+
* 将 Diagram 挂载到指定的根节点上,并渲染,
|
|
17
|
+
* mount 应该在 init 之后调用。
|
|
18
|
+
* @param root
|
|
19
|
+
*/
|
|
20
|
+
abstract mount(root: HTMLElement): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* 从根节点卸载 Diagram ,对应 `mount` 操作
|
|
23
|
+
*/
|
|
24
|
+
abstract unmount(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare abstract class AbstractedDocxSDK extends EditorSDK {
|
|
28
|
+
/**
|
|
29
|
+
* 文档准备就绪
|
|
30
|
+
*/
|
|
31
|
+
abstract ready(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 打印文档
|
|
13
34
|
*/
|
|
35
|
+
abstract print(): Promise<void>;
|
|
14
36
|
/**
|
|
15
37
|
* 文档目录集合接口,
|
|
16
38
|
* 一个文档中可以存在多个目录,这个接口是用来管理文档中的所有目录的。
|
|
@@ -46,6 +68,165 @@ export declare abstract class AbstractedDocxSDK extends EditorSDK {
|
|
|
46
68
|
abstract get search(): DocxSearch;
|
|
47
69
|
}
|
|
48
70
|
|
|
71
|
+
export declare abstract class AbstractedEditorFileUploader {
|
|
72
|
+
/**
|
|
73
|
+
* 开始上传
|
|
74
|
+
* @param options
|
|
75
|
+
*/
|
|
76
|
+
abstract start(options: EditorUploadStartOptions): EditorUploadTaskInfo[];
|
|
77
|
+
/**
|
|
78
|
+
* 暂停上传,不传参数则取消所有上传任务
|
|
79
|
+
* @param taskIds
|
|
80
|
+
*/
|
|
81
|
+
abstract pause(taskIds?: string[]): void;
|
|
82
|
+
/**
|
|
83
|
+
* 暂停上传,不传参数则暂停所有上传任务
|
|
84
|
+
* @param taskIds
|
|
85
|
+
*/
|
|
86
|
+
abstract abort(taskIds?: string[]): void;
|
|
87
|
+
/**
|
|
88
|
+
* 恢复上传,不传参数则恢复所有上传任务
|
|
89
|
+
* @param taskIds
|
|
90
|
+
*/
|
|
91
|
+
abstract resume(taskIds?: string[]): void;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 抽象 Pdf 接口
|
|
96
|
+
*/
|
|
97
|
+
export declare abstract class AbstractedPdfSDK {
|
|
98
|
+
protected options: PdfSDKOptions;
|
|
99
|
+
constructor(options: PdfSDKOptions);
|
|
100
|
+
/**
|
|
101
|
+
* 初始化 Pdf 、加载插件等操作。
|
|
102
|
+
*/
|
|
103
|
+
abstract init(): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* 销毁 Pdf
|
|
106
|
+
*/
|
|
107
|
+
abstract destroy(): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* 将 Pdf 挂载到指定的根节点上,并渲染,
|
|
110
|
+
* mount 应该在 init 之后调用。
|
|
111
|
+
* @param root
|
|
112
|
+
*/
|
|
113
|
+
abstract mount(root: HTMLElement): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* 从根节点卸载 pdf ,对应 `mount` 操作
|
|
116
|
+
*/
|
|
117
|
+
abstract unmount(): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* pdf 页面操作接口
|
|
120
|
+
*/
|
|
121
|
+
abstract get pages(): PdfPages;
|
|
122
|
+
/**
|
|
123
|
+
* pdf 选区接口
|
|
124
|
+
*/
|
|
125
|
+
abstract get selection(): PdfSelection;
|
|
126
|
+
/**
|
|
127
|
+
* pdf 目录接口
|
|
128
|
+
*/
|
|
129
|
+
abstract get outline(): PdfOutline;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare abstract class AbstractedPresentationSDK extends EditorSDK {
|
|
133
|
+
/**
|
|
134
|
+
* 幻灯片准备就绪
|
|
135
|
+
*/
|
|
136
|
+
abstract ready(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* 打印幻灯片
|
|
139
|
+
*/
|
|
140
|
+
abstract print(): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* 幻灯片集合接口
|
|
143
|
+
*/
|
|
144
|
+
abstract get slides(): PresentationSlides;
|
|
145
|
+
/**
|
|
146
|
+
* 幻灯片选区接口,用于获取、操作当前 slide 的选区
|
|
147
|
+
*/
|
|
148
|
+
abstract get selection(): PresentationSelection;
|
|
149
|
+
/**
|
|
150
|
+
* 幻灯片缩放接口
|
|
151
|
+
* @param scale
|
|
152
|
+
*/
|
|
153
|
+
abstract get zoom(): PresentationZoom;
|
|
154
|
+
/**
|
|
155
|
+
* 文本格式接口
|
|
156
|
+
*/
|
|
157
|
+
abstract get text(): PresentationText;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export declare abstract class AbstractedSheetSDK extends EditorSDK {
|
|
161
|
+
/**
|
|
162
|
+
* 表格准备就绪
|
|
163
|
+
*/
|
|
164
|
+
abstract ready(): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* 打印文档
|
|
167
|
+
*/
|
|
168
|
+
abstract print(): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* 工作簿接口
|
|
171
|
+
*/
|
|
172
|
+
abstract get workbook(): SheetWorkbook;
|
|
173
|
+
/**
|
|
174
|
+
* 当前活跃工作表对象
|
|
175
|
+
*/
|
|
176
|
+
abstract get activeSheet(): SheetWorksheet;
|
|
177
|
+
/**
|
|
178
|
+
* 当前活动单元格
|
|
179
|
+
*/
|
|
180
|
+
abstract get activeCell(): SheetCell | null;
|
|
181
|
+
/**
|
|
182
|
+
* 获取当前选区
|
|
183
|
+
*/
|
|
184
|
+
abstract get selections(): SheetSelection[] | null;
|
|
185
|
+
/**
|
|
186
|
+
* 文本格式接口
|
|
187
|
+
*/
|
|
188
|
+
abstract get text(): SheetText;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Diagram 初始化参数
|
|
193
|
+
*/
|
|
194
|
+
export declare interface DiagramSDKOptions {
|
|
195
|
+
/**
|
|
196
|
+
* Diagram 初始化内容,可以是 string 或者 ArrayBuffer,
|
|
197
|
+
* 也可以通过异步 Promise 加载
|
|
198
|
+
*/
|
|
199
|
+
content: MaybePromiseValue<string | ArrayBuffer>;
|
|
200
|
+
/**
|
|
201
|
+
* 当前操作 Diagram 的用户信息
|
|
202
|
+
*/
|
|
203
|
+
user?: EditorUserOptions;
|
|
204
|
+
/**
|
|
205
|
+
* i18n 相关设置
|
|
206
|
+
*/
|
|
207
|
+
i18n?: EditorI18nOptions;
|
|
208
|
+
/**
|
|
209
|
+
* 品牌相关设置
|
|
210
|
+
*/
|
|
211
|
+
brand?: EditorBrandOptions;
|
|
212
|
+
/**
|
|
213
|
+
* Diagram 内部资源请求配置
|
|
214
|
+
*/
|
|
215
|
+
assets?: EditorAssetsOptions;
|
|
216
|
+
/**
|
|
217
|
+
* Diagram 内部超链接设置
|
|
218
|
+
*/
|
|
219
|
+
link?: EditorLinkOptions;
|
|
220
|
+
/**
|
|
221
|
+
* 初始化水印配置
|
|
222
|
+
*/
|
|
223
|
+
watermark?: EditorWatermarkOptions;
|
|
224
|
+
/**
|
|
225
|
+
* Diagram 打印设置
|
|
226
|
+
*/
|
|
227
|
+
print?: EditorPrintOptions;
|
|
228
|
+
}
|
|
229
|
+
|
|
49
230
|
export declare type DocxFontFace = Omit<EditorFontFace, 'meta'> & {
|
|
50
231
|
meta: DocxFontMeta;
|
|
51
232
|
};
|
|
@@ -117,40 +298,6 @@ export declare interface DocxFontsOptions {
|
|
|
117
298
|
list: DocxFontsList;
|
|
118
299
|
}
|
|
119
300
|
|
|
120
|
-
export declare type DocxGotoOptions = {
|
|
121
|
-
/**
|
|
122
|
-
* 区域,跳转到对应区域位置
|
|
123
|
-
*/
|
|
124
|
-
type: 'range';
|
|
125
|
-
/**
|
|
126
|
-
* 区域值,这个值可以通过 DocxSelection 的 getRange 方法拿到
|
|
127
|
-
*/
|
|
128
|
-
range: string;
|
|
129
|
-
} | {
|
|
130
|
-
/**
|
|
131
|
-
* 页码,跳转到对应页码位置
|
|
132
|
-
*/
|
|
133
|
-
type: 'page';
|
|
134
|
-
/**
|
|
135
|
-
* 页码
|
|
136
|
-
*/
|
|
137
|
-
page: number;
|
|
138
|
-
} | {
|
|
139
|
-
/**
|
|
140
|
-
* 顶部,跳转到文档顶部
|
|
141
|
-
*/
|
|
142
|
-
type: 'top';
|
|
143
|
-
} | {
|
|
144
|
-
/**
|
|
145
|
-
* 跳转到某个评论
|
|
146
|
-
*/
|
|
147
|
-
type: 'comment';
|
|
148
|
-
/**
|
|
149
|
-
* 评论 ID
|
|
150
|
-
*/
|
|
151
|
-
commentId: string;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
301
|
/**
|
|
155
302
|
* 图片水印属性值
|
|
156
303
|
*/
|
|
@@ -180,6 +327,8 @@ export declare interface DocxInfoOptions {
|
|
|
180
327
|
time?: number;
|
|
181
328
|
author?: string;
|
|
182
329
|
};
|
|
330
|
+
id: string;
|
|
331
|
+
name: string;
|
|
183
332
|
}
|
|
184
333
|
|
|
185
334
|
/**
|
|
@@ -481,6 +630,11 @@ export declare interface DocxSelection {
|
|
|
481
630
|
* @returns
|
|
482
631
|
*/
|
|
483
632
|
addRangeListener: (listener: (value: DocxRangeValue | null) => void) => void;
|
|
633
|
+
/**
|
|
634
|
+
* 获取文档全部选区范围。
|
|
635
|
+
* @returns
|
|
636
|
+
*/
|
|
637
|
+
getWholeRange: () => DocxRange;
|
|
484
638
|
}
|
|
485
639
|
|
|
486
640
|
/**
|
|
@@ -812,12 +966,21 @@ export declare type DocxWatermarkOptions = EditorWatermarkOptions;
|
|
|
812
966
|
* 文档窗口接口
|
|
813
967
|
*/
|
|
814
968
|
export declare interface DocxWindow {
|
|
969
|
+
/**
|
|
970
|
+
* 获取当前文档滚动位置,
|
|
971
|
+
* 返回值为当前文档滚动位置的偏移量,
|
|
972
|
+
* 这个偏移量是基于文档的左上角为原点,向右向下为正方向
|
|
973
|
+
* @returns
|
|
974
|
+
*/
|
|
975
|
+
getScrollPosition: () => {
|
|
976
|
+
x: number;
|
|
977
|
+
y: number;
|
|
978
|
+
};
|
|
815
979
|
/**
|
|
816
980
|
* 滚动到指定位置
|
|
817
|
-
* @param
|
|
818
|
-
* @param y
|
|
981
|
+
* @param params 滚动参数
|
|
819
982
|
*/
|
|
820
|
-
scrollTo: (
|
|
983
|
+
scrollTo: (params: DocxWindowScrollParams) => void;
|
|
821
984
|
/**
|
|
822
985
|
* 滚动到指定页面
|
|
823
986
|
* @param page
|
|
@@ -838,6 +1001,65 @@ export declare interface DocxWindow {
|
|
|
838
1001
|
}) => void) => () => void;
|
|
839
1002
|
}
|
|
840
1003
|
|
|
1004
|
+
export declare type DocxWindowScrollParams = {
|
|
1005
|
+
/**
|
|
1006
|
+
* 区域,跳转到对应区域位置
|
|
1007
|
+
*/
|
|
1008
|
+
type: 'range';
|
|
1009
|
+
/**
|
|
1010
|
+
* 区域值,这个值可以通过 DocxSelection 的 getRange 方法拿到
|
|
1011
|
+
*/
|
|
1012
|
+
range: string;
|
|
1013
|
+
} | {
|
|
1014
|
+
/**
|
|
1015
|
+
* 页码,跳转到对应页码位置
|
|
1016
|
+
*/
|
|
1017
|
+
type: 'page';
|
|
1018
|
+
/**
|
|
1019
|
+
* 页码
|
|
1020
|
+
*/
|
|
1021
|
+
page: number;
|
|
1022
|
+
} | {
|
|
1023
|
+
/**
|
|
1024
|
+
* 顶部,跳转到文档顶部
|
|
1025
|
+
*/
|
|
1026
|
+
type: 'top';
|
|
1027
|
+
} | {
|
|
1028
|
+
/**
|
|
1029
|
+
* 滚动到某个位置,
|
|
1030
|
+
* 这个位置是基于文档的左上角为原点,向右向下为正方向
|
|
1031
|
+
*/
|
|
1032
|
+
type: 'position';
|
|
1033
|
+
/**
|
|
1034
|
+
* 位置
|
|
1035
|
+
*/
|
|
1036
|
+
position: {
|
|
1037
|
+
x: number;
|
|
1038
|
+
y: number;
|
|
1039
|
+
};
|
|
1040
|
+
} | {
|
|
1041
|
+
/**
|
|
1042
|
+
* 偏移量,跳转到对应偏移量位置
|
|
1043
|
+
*/
|
|
1044
|
+
type: 'offset';
|
|
1045
|
+
/**
|
|
1046
|
+
* 偏移量
|
|
1047
|
+
*/
|
|
1048
|
+
offset: {
|
|
1049
|
+
x: number;
|
|
1050
|
+
y: number;
|
|
1051
|
+
};
|
|
1052
|
+
} | {
|
|
1053
|
+
/**
|
|
1054
|
+
* 跳转到某个评论
|
|
1055
|
+
*/
|
|
1056
|
+
type: 'comment';
|
|
1057
|
+
/**
|
|
1058
|
+
* 评论 ID
|
|
1059
|
+
*/
|
|
1060
|
+
commentId: string;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
841
1063
|
/**
|
|
842
1064
|
* 文档缩放接口
|
|
843
1065
|
*/
|
|
@@ -879,7 +1101,7 @@ export declare interface DocxZoom {
|
|
|
879
1101
|
/**
|
|
880
1102
|
* 编辑器内部资源请求配置
|
|
881
1103
|
*/
|
|
882
|
-
declare interface EditorAssetsOptions {
|
|
1104
|
+
export declare interface EditorAssetsOptions {
|
|
883
1105
|
/**
|
|
884
1106
|
* 通用资源请求代理配置,
|
|
885
1107
|
* 用于套件内部资源请求时代理请求
|
|
@@ -898,7 +1120,7 @@ declare interface EditorAssetsOptions {
|
|
|
898
1120
|
/**
|
|
899
1121
|
* 基于对象存储的图片处理抽象
|
|
900
1122
|
*/
|
|
901
|
-
declare interface EditorAssetsOssImageProcessing {
|
|
1123
|
+
export declare interface EditorAssetsOssImageProcessing {
|
|
902
1124
|
/**
|
|
903
1125
|
* 压缩图片的方法
|
|
904
1126
|
* @param imageUrl 图片的 URL
|
|
@@ -925,7 +1147,7 @@ declare interface EditorAssetsOssImageProcessing {
|
|
|
925
1147
|
}) => Promise<string>;
|
|
926
1148
|
}
|
|
927
1149
|
|
|
928
|
-
declare interface EditorAssetsResolver {
|
|
1150
|
+
export declare interface EditorAssetsResolver {
|
|
929
1151
|
/**
|
|
930
1152
|
* 将资源文件 ID 转换为 URL 的方法
|
|
931
1153
|
* @param assetId 资源文件 ID
|
|
@@ -947,11 +1169,29 @@ declare interface EditorAssetsResolver {
|
|
|
947
1169
|
checkAssetReady: (assetId: string) => Promise<boolean> | boolean;
|
|
948
1170
|
}
|
|
949
1171
|
|
|
1172
|
+
/**
|
|
1173
|
+
* 编辑器附件信息
|
|
1174
|
+
*/
|
|
1175
|
+
export declare interface EditorAttachmentOptions {
|
|
1176
|
+
uploader: AbstractedEditorFileUploader;
|
|
1177
|
+
download: (url: string) => void;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* 基础文件属性
|
|
1182
|
+
*/
|
|
1183
|
+
export declare interface EditorBaseUploadableFile {
|
|
1184
|
+
secretly?: boolean;
|
|
1185
|
+
bucket: 'images' | 'attachments';
|
|
1186
|
+
encrypt: string;
|
|
1187
|
+
fileGuid: string;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
950
1190
|
/**
|
|
951
1191
|
* 品牌相关设置,
|
|
952
1192
|
* 用于在套件中展示品牌外露信息
|
|
953
1193
|
*/
|
|
954
|
-
declare interface EditorBrandOptions {
|
|
1194
|
+
export declare interface EditorBrandOptions {
|
|
955
1195
|
/**
|
|
956
1196
|
* 需要显示在品牌展示位的内容,按数组顺序显示
|
|
957
1197
|
*/
|
|
@@ -975,7 +1215,7 @@ declare interface EditorBrandOptions {
|
|
|
975
1215
|
/**
|
|
976
1216
|
* 单条评论数据
|
|
977
1217
|
*/
|
|
978
|
-
declare interface EditorCommentItem {
|
|
1218
|
+
export declare interface EditorCommentItem {
|
|
979
1219
|
/**
|
|
980
1220
|
* 评论 ID
|
|
981
1221
|
*/
|
|
@@ -992,7 +1232,7 @@ declare interface EditorCommentItem {
|
|
|
992
1232
|
};
|
|
993
1233
|
}
|
|
994
1234
|
|
|
995
|
-
declare interface EditorComments {
|
|
1235
|
+
export declare interface EditorComments {
|
|
996
1236
|
/**
|
|
997
1237
|
* 检查是否有评论
|
|
998
1238
|
* @returns
|
|
@@ -1038,7 +1278,7 @@ declare interface EditorComments {
|
|
|
1038
1278
|
/**
|
|
1039
1279
|
* 编辑器评论初始化配置
|
|
1040
1280
|
*/
|
|
1041
|
-
declare interface EditorCommentsOptions {
|
|
1281
|
+
export declare interface EditorCommentsOptions {
|
|
1042
1282
|
/**
|
|
1043
1283
|
* 评论作者信息,如果这里的信息为空,将会使用 user 信息
|
|
1044
1284
|
*/
|
|
@@ -1069,7 +1309,7 @@ declare interface EditorCommentsOptions {
|
|
|
1069
1309
|
};
|
|
1070
1310
|
}
|
|
1071
1311
|
|
|
1072
|
-
declare interface EditorContent {
|
|
1312
|
+
export declare interface EditorContent {
|
|
1073
1313
|
/**
|
|
1074
1314
|
* 设置编辑器内容
|
|
1075
1315
|
* @param content
|
|
@@ -1086,7 +1326,7 @@ declare interface EditorContent {
|
|
|
1086
1326
|
addChangeListener: (listener: (change: EditorDelta) => void) => () => void;
|
|
1087
1327
|
}
|
|
1088
1328
|
|
|
1089
|
-
declare interface EditorDelta {
|
|
1329
|
+
export declare interface EditorDelta {
|
|
1090
1330
|
compose: (other: EditorDelta, isDocument?: boolean) => EditorDelta;
|
|
1091
1331
|
transform: (other: EditorDelta, priority?: boolean) => EditorDelta;
|
|
1092
1332
|
stringify: () => string;
|
|
@@ -1096,7 +1336,7 @@ declare interface EditorDelta {
|
|
|
1096
1336
|
/**
|
|
1097
1337
|
* 编辑器嵌入对象
|
|
1098
1338
|
*/
|
|
1099
|
-
declare interface EditorEmbeddedObject {
|
|
1339
|
+
export declare interface EditorEmbeddedObject {
|
|
1100
1340
|
/**
|
|
1101
1341
|
* 嵌入的对象 url
|
|
1102
1342
|
*/
|
|
@@ -1114,7 +1354,7 @@ declare interface EditorEmbeddedObject {
|
|
|
1114
1354
|
/**
|
|
1115
1355
|
* 编辑器嵌入对象抽象类
|
|
1116
1356
|
*/
|
|
1117
|
-
declare interface EditorEmbeddedObjectOptions {
|
|
1357
|
+
export declare interface EditorEmbeddedObjectOptions {
|
|
1118
1358
|
/**
|
|
1119
1359
|
* 执行打开嵌入对象操作,
|
|
1120
1360
|
* 如果已经处理了打开操作,返回 true,否则返回 false,
|
|
@@ -1142,7 +1382,20 @@ declare interface EditorEmbeddedObjectOptions {
|
|
|
1142
1382
|
};
|
|
1143
1383
|
}
|
|
1144
1384
|
|
|
1145
|
-
declare interface
|
|
1385
|
+
export declare interface EditorExportOptions {
|
|
1386
|
+
/**
|
|
1387
|
+
* 可导出类型
|
|
1388
|
+
* @description
|
|
1389
|
+
*/
|
|
1390
|
+
supportedTypes?: string[];
|
|
1391
|
+
/**
|
|
1392
|
+
* 导出文件
|
|
1393
|
+
* @description
|
|
1394
|
+
*/
|
|
1395
|
+
exportFile: (type: string) => Promise<void>;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
export declare interface EditorFontFace {
|
|
1146
1399
|
/**
|
|
1147
1400
|
* 字体的名称,用于在用户界面上显示的名称
|
|
1148
1401
|
*/
|
|
@@ -1168,7 +1421,7 @@ declare interface EditorFontFace {
|
|
|
1168
1421
|
/**
|
|
1169
1422
|
* 字体元数据
|
|
1170
1423
|
*/
|
|
1171
|
-
declare interface EditorFontMeta {
|
|
1424
|
+
export declare interface EditorFontMeta {
|
|
1172
1425
|
head: {
|
|
1173
1426
|
unitsPerEm: number;
|
|
1174
1427
|
};
|
|
@@ -1202,10 +1455,28 @@ declare interface EditorFontMeta {
|
|
|
1202
1455
|
};
|
|
1203
1456
|
}
|
|
1204
1457
|
|
|
1458
|
+
/**
|
|
1459
|
+
* 字体列表
|
|
1460
|
+
*/
|
|
1461
|
+
export declare interface EditorFontsList {
|
|
1462
|
+
/**
|
|
1463
|
+
* 返回解析为字体的列表的 Promise。
|
|
1464
|
+
*/
|
|
1465
|
+
getAll: () => Promise<EditorFontFace[]>;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
export declare interface EditorFontsOptions {
|
|
1469
|
+
/**
|
|
1470
|
+
* 服务器字体列表,用于获取服务器端配置的字体列表,
|
|
1471
|
+
* 并提供可用于字体的加载 URL 和字体元数据。
|
|
1472
|
+
*/
|
|
1473
|
+
list: EditorFontsList;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1205
1476
|
/**
|
|
1206
1477
|
* i18n 相关设置
|
|
1207
1478
|
*/
|
|
1208
|
-
declare interface EditorI18nOptions {
|
|
1479
|
+
export declare interface EditorI18nOptions {
|
|
1209
1480
|
/**
|
|
1210
1481
|
* 语言,默认使用浏览器当前环境中的语言
|
|
1211
1482
|
*/
|
|
@@ -1216,12 +1487,12 @@ declare interface EditorI18nOptions {
|
|
|
1216
1487
|
direction?: 'ltr' | 'rtl';
|
|
1217
1488
|
}
|
|
1218
1489
|
|
|
1219
|
-
declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'center' | 'east' | 'sw' | 'south' | 'se';
|
|
1490
|
+
export declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'center' | 'east' | 'sw' | 'south' | 'se';
|
|
1220
1491
|
|
|
1221
1492
|
/**
|
|
1222
1493
|
* 链接配置,抽象打开链接等操作
|
|
1223
1494
|
*/
|
|
1224
|
-
declare interface EditorLinkOptions {
|
|
1495
|
+
export declare interface EditorLinkOptions {
|
|
1225
1496
|
/**
|
|
1226
1497
|
* 打开链接,如果取消了打开链接操作,返回 false
|
|
1227
1498
|
* @param url
|
|
@@ -1231,10 +1502,20 @@ declare interface EditorLinkOptions {
|
|
|
1231
1502
|
open: (url: string, target: string) => Promise<boolean>;
|
|
1232
1503
|
}
|
|
1233
1504
|
|
|
1505
|
+
/**
|
|
1506
|
+
* 可上传文件
|
|
1507
|
+
*/
|
|
1508
|
+
export declare interface EditorLocalUploadableFile extends EditorBaseUploadableFile {
|
|
1509
|
+
name: string;
|
|
1510
|
+
size: number;
|
|
1511
|
+
mime: string;
|
|
1512
|
+
raw: File;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1234
1515
|
/**
|
|
1235
1516
|
* 菜单栏自定义按钮配置
|
|
1236
1517
|
*/
|
|
1237
|
-
declare type EditorMenuCustomButton = {
|
|
1518
|
+
export declare type EditorMenuCustomButton = {
|
|
1238
1519
|
/**
|
|
1239
1520
|
* 按钮名称
|
|
1240
1521
|
*/
|
|
@@ -1277,7 +1558,7 @@ declare type EditorMenuCustomButton = {
|
|
|
1277
1558
|
/**
|
|
1278
1559
|
* 菜单栏二级以下的菜单入口
|
|
1279
1560
|
*/
|
|
1280
|
-
declare interface EditorMenuEntryButton {
|
|
1561
|
+
export declare interface EditorMenuEntryButton {
|
|
1281
1562
|
type: 'entry';
|
|
1282
1563
|
/**
|
|
1283
1564
|
* 菜单名称
|
|
@@ -1293,7 +1574,7 @@ declare interface EditorMenuEntryButton {
|
|
|
1293
1574
|
* 菜单栏一级菜单配置,此处用于定义一级菜单的操作入口,
|
|
1294
1575
|
* 一级菜单在鼠标悬停时展示二级列表
|
|
1295
1576
|
*/
|
|
1296
|
-
declare interface EditorMenuEntryConfig<TName extends string> {
|
|
1577
|
+
export declare interface EditorMenuEntryConfig<TName extends string> {
|
|
1297
1578
|
/**
|
|
1298
1579
|
* 一级菜单名称
|
|
1299
1580
|
*/
|
|
@@ -1309,7 +1590,7 @@ declare interface EditorMenuEntryConfig<TName extends string> {
|
|
|
1309
1590
|
/**
|
|
1310
1591
|
* 菜单栏功能按钮配置
|
|
1311
1592
|
*/
|
|
1312
|
-
declare type EditorMenuFeatureButton<TName extends string> = {
|
|
1593
|
+
export declare type EditorMenuFeatureButton<TName extends string> = {
|
|
1313
1594
|
/**
|
|
1314
1595
|
* 隐藏按钮,用作在需要隐藏菜单栏时定义
|
|
1315
1596
|
*/
|
|
@@ -1337,13 +1618,13 @@ declare type EditorMenuFeatureButton<TName extends string> = {
|
|
|
1337
1618
|
/**
|
|
1338
1619
|
* 菜单栏按钮配置
|
|
1339
1620
|
*/
|
|
1340
|
-
declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
1621
|
+
export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
1341
1622
|
|
|
1342
1623
|
/**
|
|
1343
1624
|
* 菜单栏相关配置,目前菜单栏不是所有套件都支持,
|
|
1344
1625
|
* 菜单栏是指的编辑器最上放可以展开二级菜单的那一栏。
|
|
1345
1626
|
*/
|
|
1346
|
-
declare interface EditorMenuOptions<TName extends string> {
|
|
1627
|
+
export declare interface EditorMenuOptions<TName extends string> {
|
|
1347
1628
|
/**
|
|
1348
1629
|
* 菜单栏是否显示
|
|
1349
1630
|
*/
|
|
@@ -1369,7 +1650,7 @@ declare interface EditorMenuOptions<TName extends string> {
|
|
|
1369
1650
|
/**
|
|
1370
1651
|
* 编辑器基础模式接口
|
|
1371
1652
|
*/
|
|
1372
|
-
declare interface EditorMode {
|
|
1653
|
+
export declare interface EditorMode {
|
|
1373
1654
|
/**
|
|
1374
1655
|
* 获取当前编辑器模式
|
|
1375
1656
|
*/
|
|
@@ -1388,7 +1669,7 @@ declare interface EditorMode {
|
|
|
1388
1669
|
/**
|
|
1389
1670
|
* 编辑器初始化的时相关的模式配置
|
|
1390
1671
|
*/
|
|
1391
|
-
declare type EditorModeOptions = {
|
|
1672
|
+
export declare type EditorModeOptions = {
|
|
1392
1673
|
type: 'standard';
|
|
1393
1674
|
/**
|
|
1394
1675
|
* 当 mode 为 `standard` 时,可以设置当前编辑器的权限模式
|
|
@@ -1406,12 +1687,12 @@ declare type EditorModeOptions = {
|
|
|
1406
1687
|
* - `preview` 预览模式,只能查看内容
|
|
1407
1688
|
* - `presentation` 演示模式,用作演示场景,演示模式下部分套件可以进行一些简单的编辑操作
|
|
1408
1689
|
*/
|
|
1409
|
-
declare type EditorModeType = 'standard' | 'preview' | 'presentation';
|
|
1690
|
+
export declare type EditorModeType = 'standard' | 'preview' | 'presentation';
|
|
1410
1691
|
|
|
1411
1692
|
/**
|
|
1412
1693
|
* 编辑器初始化通用参数
|
|
1413
1694
|
*/
|
|
1414
|
-
declare interface EditorOptions {
|
|
1695
|
+
export declare interface EditorOptions {
|
|
1415
1696
|
/**
|
|
1416
1697
|
* 编辑器初始化内容,可以是 string 或者 ArrayBuffer,
|
|
1417
1698
|
* 也可以通过异步 Promise 加载
|
|
@@ -1461,12 +1742,20 @@ declare interface EditorOptions {
|
|
|
1461
1742
|
* 编辑器评论设置
|
|
1462
1743
|
*/
|
|
1463
1744
|
comments?: EditorCommentsOptions;
|
|
1745
|
+
/**
|
|
1746
|
+
* 附件设置
|
|
1747
|
+
*/
|
|
1748
|
+
attachment?: EditorAttachmentOptions;
|
|
1749
|
+
/**
|
|
1750
|
+
* 导出设置
|
|
1751
|
+
*/
|
|
1752
|
+
export?: EditorExportOptions;
|
|
1464
1753
|
}
|
|
1465
1754
|
|
|
1466
1755
|
/**
|
|
1467
1756
|
* 大纲目录接口
|
|
1468
1757
|
*/
|
|
1469
|
-
declare interface EditorOutline<Content = unknown> {
|
|
1758
|
+
export declare interface EditorOutline<Content = unknown> {
|
|
1470
1759
|
/**
|
|
1471
1760
|
* 设置大纲目录是否可见
|
|
1472
1761
|
* @param visible 是否可见
|
|
@@ -1494,7 +1783,7 @@ declare interface EditorOutline<Content = unknown> {
|
|
|
1494
1783
|
/**
|
|
1495
1784
|
* 大纲目录项条目
|
|
1496
1785
|
*/
|
|
1497
|
-
declare interface EditorOutlineItem<Content = unknown> {
|
|
1786
|
+
export declare interface EditorOutlineItem<Content = unknown> {
|
|
1498
1787
|
/**
|
|
1499
1788
|
* 目录项 ID
|
|
1500
1789
|
*/
|
|
@@ -1513,7 +1802,7 @@ declare interface EditorOutlineItem<Content = unknown> {
|
|
|
1513
1802
|
* 大纲目录初始化参数,
|
|
1514
1803
|
* 用于配置大纲目录的行为和外观。
|
|
1515
1804
|
*/
|
|
1516
|
-
declare interface EditorOutlineOptions {
|
|
1805
|
+
export declare interface EditorOutlineOptions {
|
|
1517
1806
|
/**
|
|
1518
1807
|
* 初始化编辑器时是否显示大纲目录,
|
|
1519
1808
|
* 默认为 false。
|
|
@@ -1524,7 +1813,7 @@ declare interface EditorOutlineOptions {
|
|
|
1524
1813
|
/**
|
|
1525
1814
|
* 编辑器打印设置
|
|
1526
1815
|
*/
|
|
1527
|
-
declare interface EditorPrintOptions {
|
|
1816
|
+
export declare interface EditorPrintOptions {
|
|
1528
1817
|
/**
|
|
1529
1818
|
* 部分套件如果绕过了编辑器预设的打印接口,直接通过拉起了浏览器的打印页面,这时打印页面无法获取到编辑器的内容,
|
|
1530
1819
|
* 这种情况下就会 fallback 到这个 options 上,显示一个提示信息。
|
|
@@ -1538,10 +1827,21 @@ declare interface EditorPrintOptions {
|
|
|
1538
1827
|
disabled?: boolean;
|
|
1539
1828
|
}
|
|
1540
1829
|
|
|
1830
|
+
/**
|
|
1831
|
+
* 远程文件上传
|
|
1832
|
+
*/
|
|
1833
|
+
export declare interface EditorRemoteUploadableFile extends EditorBaseUploadableFile {
|
|
1834
|
+
src: string;
|
|
1835
|
+
name?: never;
|
|
1836
|
+
size?: never;
|
|
1837
|
+
mime?: never;
|
|
1838
|
+
raw?: never;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1541
1841
|
/**
|
|
1542
1842
|
* 编辑器通用接口
|
|
1543
1843
|
*/
|
|
1544
|
-
declare abstract class EditorSDK {
|
|
1844
|
+
export declare abstract class EditorSDK {
|
|
1545
1845
|
protected options: EditorOptions;
|
|
1546
1846
|
constructor(options: EditorOptions);
|
|
1547
1847
|
/**
|
|
@@ -1582,13 +1882,62 @@ declare abstract class EditorSDK {
|
|
|
1582
1882
|
* - `viewer` 阅读模式
|
|
1583
1883
|
* - `reviewer` 评论模式
|
|
1584
1884
|
*/
|
|
1585
|
-
declare type EditorStandardRole = 'editor' | 'viewer' | 'reviewer';
|
|
1885
|
+
export declare type EditorStandardRole = 'editor' | 'viewer' | 'reviewer';
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* 上传任务回调
|
|
1889
|
+
*/
|
|
1890
|
+
export declare interface EditorTaskCallbacks {
|
|
1891
|
+
/**
|
|
1892
|
+
* 上传进度回调
|
|
1893
|
+
* @param taskId
|
|
1894
|
+
* @param loaded
|
|
1895
|
+
* @param total
|
|
1896
|
+
* @param progress
|
|
1897
|
+
* @param data
|
|
1898
|
+
* @returns
|
|
1899
|
+
*/
|
|
1900
|
+
onProgress?: (taskId: string, loaded: number, total: number, progress: number, data?: unknown) => void;
|
|
1901
|
+
/**
|
|
1902
|
+
* 上传错误回调
|
|
1903
|
+
* @param taskId
|
|
1904
|
+
* @param error
|
|
1905
|
+
* @returns
|
|
1906
|
+
*/
|
|
1907
|
+
onError?: (taskId: string, error: Error) => void;
|
|
1908
|
+
/**
|
|
1909
|
+
* 上传暂停回调
|
|
1910
|
+
* @param taskId
|
|
1911
|
+
* @returns
|
|
1912
|
+
*/
|
|
1913
|
+
onPause?: (taskId: string) => void;
|
|
1914
|
+
/**
|
|
1915
|
+
* 上传取消
|
|
1916
|
+
* @param taskId
|
|
1917
|
+
* @returns
|
|
1918
|
+
*/
|
|
1919
|
+
onAbort?: (taskId: string) => void;
|
|
1920
|
+
/**
|
|
1921
|
+
* 上传恢复
|
|
1922
|
+
* @param taskId
|
|
1923
|
+
* @returns
|
|
1924
|
+
*/
|
|
1925
|
+
onResume?: (taskId: string) => void;
|
|
1926
|
+
/**
|
|
1927
|
+
* 上传完成回调
|
|
1928
|
+
* @param taskId
|
|
1929
|
+
* @param status
|
|
1930
|
+
* @param data
|
|
1931
|
+
* @returns
|
|
1932
|
+
*/
|
|
1933
|
+
onEnd?: (taskId: string, status: 'Error' | 'Finished' | 'Canceled', data: unknown) => void;
|
|
1934
|
+
}
|
|
1586
1935
|
|
|
1587
1936
|
/**
|
|
1588
1937
|
* 文本格式接口,
|
|
1589
1938
|
* 包括设置、读取选区内文本的 BIUS、family、大小、颜色等
|
|
1590
1939
|
*/
|
|
1591
|
-
declare interface EditorText<Color = string, TRangeValue = unknown> {
|
|
1940
|
+
export declare interface EditorText<Color = string, TRangeValue = unknown> {
|
|
1592
1941
|
/**
|
|
1593
1942
|
* 获取当前选区或指定选区内的文本格式状态
|
|
1594
1943
|
*/
|
|
@@ -1612,7 +1961,7 @@ declare interface EditorText<Color = string, TRangeValue = unknown> {
|
|
|
1612
1961
|
/**
|
|
1613
1962
|
* 文本格式状态
|
|
1614
1963
|
*/
|
|
1615
|
-
declare interface EditorTextFormat<Color = string> {
|
|
1964
|
+
export declare interface EditorTextFormat<Color = string> {
|
|
1616
1965
|
/**
|
|
1617
1966
|
* 粗体
|
|
1618
1967
|
*/
|
|
@@ -1650,7 +1999,7 @@ declare interface EditorTextFormat<Color = string> {
|
|
|
1650
1999
|
/**
|
|
1651
2000
|
* 文本格式初始化选项
|
|
1652
2001
|
*/
|
|
1653
|
-
declare interface EditorTextOptions<Color = string> {
|
|
2002
|
+
export declare interface EditorTextOptions<Color = string> {
|
|
1654
2003
|
/**
|
|
1655
2004
|
* 当前编辑器默认的文本格式
|
|
1656
2005
|
*/
|
|
@@ -1660,7 +2009,7 @@ declare interface EditorTextOptions<Color = string> {
|
|
|
1660
2009
|
/**
|
|
1661
2010
|
* 工具栏自定义按钮配置
|
|
1662
2011
|
*/
|
|
1663
|
-
declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureButton, 'name'> {
|
|
2012
|
+
export declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureButton, 'name'> {
|
|
1664
2013
|
/**
|
|
1665
2014
|
* 自定义按钮名称
|
|
1666
2015
|
*/
|
|
@@ -1678,7 +2027,7 @@ declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureBut
|
|
|
1678
2027
|
/**
|
|
1679
2028
|
* 工具栏自定义按钮配置
|
|
1680
2029
|
*/
|
|
1681
|
-
declare interface EditorToolbarCustomButtonConfig {
|
|
2030
|
+
export declare interface EditorToolbarCustomButtonConfig {
|
|
1682
2031
|
/**
|
|
1683
2032
|
* 按钮配置
|
|
1684
2033
|
*/
|
|
@@ -1688,7 +2037,7 @@ declare interface EditorToolbarCustomButtonConfig {
|
|
|
1688
2037
|
/**
|
|
1689
2038
|
* 工具栏内置功能按钮配置
|
|
1690
2039
|
*/
|
|
1691
|
-
declare interface EditorToolbarFeatureButton {
|
|
2040
|
+
export declare interface EditorToolbarFeatureButton {
|
|
1692
2041
|
/**
|
|
1693
2042
|
* 按钮类型
|
|
1694
2043
|
*/
|
|
@@ -1714,14 +2063,14 @@ declare interface EditorToolbarFeatureButton {
|
|
|
1714
2063
|
/**
|
|
1715
2064
|
* 工具栏内置功能按钮配置
|
|
1716
2065
|
*/
|
|
1717
|
-
declare type EditorToolbarFeatureButtonConfig = {
|
|
2066
|
+
export declare type EditorToolbarFeatureButtonConfig = {
|
|
1718
2067
|
[key in EditorToolbarFeatureButtonName]?: EditorToolbarFeatureButton;
|
|
1719
2068
|
};
|
|
1720
2069
|
|
|
1721
2070
|
/**
|
|
1722
2071
|
* 工具栏内置功能按钮
|
|
1723
2072
|
*/
|
|
1724
|
-
declare type EditorToolbarFeatureButtonName =
|
|
2073
|
+
export declare type EditorToolbarFeatureButtonName =
|
|
1725
2074
|
/**
|
|
1726
2075
|
* 加粗
|
|
1727
2076
|
*/
|
|
@@ -1754,7 +2103,7 @@ declare type EditorToolbarFeatureButtonName =
|
|
|
1754
2103
|
/**
|
|
1755
2104
|
* 工具栏相关设置,可以控制工具栏的显示内容
|
|
1756
2105
|
*/
|
|
1757
|
-
declare interface EditorToolbarOptions {
|
|
2106
|
+
export declare interface EditorToolbarOptions {
|
|
1758
2107
|
/**
|
|
1759
2108
|
* 控制工具栏显隐状态
|
|
1760
2109
|
*/
|
|
@@ -1773,10 +2122,51 @@ declare interface EditorToolbarOptions {
|
|
|
1773
2122
|
custom?: EditorToolbarCustomButtonConfig;
|
|
1774
2123
|
}
|
|
1775
2124
|
|
|
2125
|
+
export declare type EditorUploadableFile = EditorLocalUploadableFile;
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* 文件开始上传入参
|
|
2129
|
+
*/
|
|
2130
|
+
export declare interface EditorUploadStartOptions extends EditorUploadTaskCallbacks {
|
|
2131
|
+
files: EditorUploadableFile[];
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
/**
|
|
2135
|
+
* 上传状态
|
|
2136
|
+
*/
|
|
2137
|
+
export declare enum EditorUploadStatus {
|
|
2138
|
+
Waiting = "Waiting",
|
|
2139
|
+
Uploading = "Uploading",
|
|
2140
|
+
Paused = "Paused",
|
|
2141
|
+
Canceled = "Canceled",
|
|
2142
|
+
Error = "Error",
|
|
2143
|
+
Finished = "Finished"
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
export declare type EditorUploadTaskCallbacks = Omit<EditorTaskCallbacks, 'onEnd'> & {
|
|
2147
|
+
onLoadend: (results: {
|
|
2148
|
+
taskId: string;
|
|
2149
|
+
status: 'Error' | 'Finished' | 'Canceled';
|
|
2150
|
+
data?: unknown;
|
|
2151
|
+
}[]) => void;
|
|
2152
|
+
};
|
|
2153
|
+
|
|
2154
|
+
/**
|
|
2155
|
+
* 上传任务信息
|
|
2156
|
+
*/
|
|
2157
|
+
export declare interface EditorUploadTaskInfo {
|
|
2158
|
+
taskId: string;
|
|
2159
|
+
fileInfo: EditorUploadableFile;
|
|
2160
|
+
total: number;
|
|
2161
|
+
readonly loaded: number;
|
|
2162
|
+
readonly progress: number;
|
|
2163
|
+
readonly status: EditorUploadStatus;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
1776
2166
|
/**
|
|
1777
2167
|
* 操作当前编辑器的用户信息
|
|
1778
2168
|
*/
|
|
1779
|
-
declare interface EditorUserOptions {
|
|
2169
|
+
export declare interface EditorUserOptions {
|
|
1780
2170
|
/**
|
|
1781
2171
|
* 用户 ID,用于标识用户
|
|
1782
2172
|
*/
|
|
@@ -1794,7 +2184,7 @@ declare interface EditorUserOptions {
|
|
|
1794
2184
|
/**
|
|
1795
2185
|
* 编辑器外部水印信息
|
|
1796
2186
|
*/
|
|
1797
|
-
declare interface EditorWatermarkOptions {
|
|
2187
|
+
export declare interface EditorWatermarkOptions {
|
|
1798
2188
|
/**
|
|
1799
2189
|
* 获取用作初始化使用的默认水印
|
|
1800
2190
|
*/
|
|
@@ -1806,7 +2196,7 @@ declare interface EditorWatermarkOptions {
|
|
|
1806
2196
|
required?: boolean;
|
|
1807
2197
|
}
|
|
1808
2198
|
|
|
1809
|
-
declare type EditorWatermarkResource = {
|
|
2199
|
+
export declare type EditorWatermarkResource = {
|
|
1810
2200
|
type: 'data-url';
|
|
1811
2201
|
url: string;
|
|
1812
2202
|
} | {
|
|
@@ -1817,18 +2207,18 @@ declare type EditorWatermarkResource = {
|
|
|
1817
2207
|
/**
|
|
1818
2208
|
* 请求、响应头
|
|
1819
2209
|
*/
|
|
1820
|
-
declare type HTTPHeaders = Record<string, string | number | boolean | undefined>;
|
|
2210
|
+
export declare type HTTPHeaders = Record<string, string | number | boolean | undefined>;
|
|
1821
2211
|
|
|
1822
2212
|
/**
|
|
1823
2213
|
* 请求方法
|
|
1824
2214
|
*/
|
|
1825
|
-
declare type HTTPMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH';
|
|
2215
|
+
export declare type HTTPMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH';
|
|
1826
2216
|
|
|
1827
2217
|
/**
|
|
1828
2218
|
* HTTP 代理,用于抽象 HTTP 请求,
|
|
1829
2219
|
* 将请求代理编辑器外部
|
|
1830
2220
|
*/
|
|
1831
|
-
declare interface HTTPProxy {
|
|
2221
|
+
export declare interface HTTPProxy {
|
|
1832
2222
|
/**
|
|
1833
2223
|
* 发送请求,如果需要做请求、响应拦截,需要在 proxy.interceptors 中实现,
|
|
1834
2224
|
* 套件内使用 proxy 发送请求的方式应该为类似如下方式:
|
|
@@ -1875,7 +2265,7 @@ declare interface HTTPProxy {
|
|
|
1875
2265
|
/**
|
|
1876
2266
|
* 请求配置
|
|
1877
2267
|
*/
|
|
1878
|
-
declare interface HTTPRequestConfig<Data = unknown> {
|
|
2268
|
+
export declare interface HTTPRequestConfig<Data = unknown> {
|
|
1879
2269
|
/**
|
|
1880
2270
|
* 请求地址
|
|
1881
2271
|
*/
|
|
@@ -1901,7 +2291,7 @@ declare interface HTTPRequestConfig<Data = unknown> {
|
|
|
1901
2291
|
/**
|
|
1902
2292
|
* 响应数据
|
|
1903
2293
|
*/
|
|
1904
|
-
declare interface HTTPResponse<Data = unknown> {
|
|
2294
|
+
export declare interface HTTPResponse<Data = unknown> {
|
|
1905
2295
|
/**
|
|
1906
2296
|
* 响应数据 body
|
|
1907
2297
|
*/
|
|
@@ -1919,8 +2309,846 @@ declare interface HTTPResponse<Data = unknown> {
|
|
|
1919
2309
|
/**
|
|
1920
2310
|
* 请求返回类型
|
|
1921
2311
|
*/
|
|
1922
|
-
declare type HTTPResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
2312
|
+
export declare type HTTPResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
2313
|
+
|
|
2314
|
+
export declare type MaybePromiseValue<T> = T | Promise<T>;
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* pdf 工具栏一级菜单
|
|
2318
|
+
*/
|
|
2319
|
+
export declare type PdfMenuEntryConfig = EditorMenuEntryConfig<PdfMenuFeatureButtonName>;
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* 传统文档工具栏功能按钮
|
|
2323
|
+
*/
|
|
2324
|
+
export declare type PdfMenuFeatureButtonConfig = EditorMenuFeatureButtonConfig<PdfMenuFeatureButtonName>;
|
|
2325
|
+
|
|
2326
|
+
/**
|
|
2327
|
+
* pdf 工具栏内置功能按钮
|
|
2328
|
+
*/
|
|
2329
|
+
export declare type PdfMenuFeatureButtonName = 'selectAll';
|
|
2330
|
+
|
|
2331
|
+
export declare type PdfMenuOptions = EditorMenuOptions<PdfMenuFeatureButtonName>;
|
|
2332
|
+
|
|
2333
|
+
/**
|
|
2334
|
+
* pdf 目录大纲项接口
|
|
2335
|
+
*/
|
|
2336
|
+
export declare type PdfOutline = EditorOutline<{
|
|
2337
|
+
text: string;
|
|
2338
|
+
}>;
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* pdf 目录大纲项信息,用于描述 pdf 中的目录项信息。
|
|
2342
|
+
*/
|
|
2343
|
+
export declare type PdfOutlineItem = EditorOutlineItem<{
|
|
2344
|
+
text: string;
|
|
2345
|
+
}>;
|
|
2346
|
+
|
|
2347
|
+
export declare type PdfOutlineOptions = EditorOutlineOptions;
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* pdf 页面实例,
|
|
2351
|
+
* 可以通过实例对对应页面进行操作。
|
|
2352
|
+
*/
|
|
2353
|
+
export declare interface PdfPage {
|
|
2354
|
+
/**
|
|
2355
|
+
* 获取当前页码
|
|
2356
|
+
*/
|
|
2357
|
+
readonly pageNumber: number;
|
|
2358
|
+
/**
|
|
2359
|
+
* 获取当前页面的大小
|
|
2360
|
+
* @returns
|
|
2361
|
+
*/
|
|
2362
|
+
getPageSize: () => {
|
|
2363
|
+
width: number;
|
|
2364
|
+
height: number;
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
/**
|
|
2369
|
+
* pdf 页面集合操作接口,
|
|
2370
|
+
* 该接口和 PdfPage 负责不同的功能,
|
|
2371
|
+
* PdfPage 是一个页面的抽象,而 PdfPages 是对整个 pdf 文件中所有页面的操作。
|
|
2372
|
+
*/
|
|
2373
|
+
export declare interface PdfPages {
|
|
2374
|
+
/**
|
|
2375
|
+
* 获取当前页码
|
|
2376
|
+
* @returns
|
|
2377
|
+
*/
|
|
2378
|
+
getCurrentPageNumber: () => number;
|
|
2379
|
+
/**
|
|
2380
|
+
* 设置当前页码并跳转至对应页面
|
|
2381
|
+
* @param page
|
|
2382
|
+
*/
|
|
2383
|
+
setCurrentPage: (page: number) => void;
|
|
2384
|
+
/**
|
|
2385
|
+
* 获取总页数
|
|
2386
|
+
* @returns
|
|
2387
|
+
*/
|
|
2388
|
+
getPagesCount: () => number;
|
|
2389
|
+
/**
|
|
2390
|
+
* 获取指定页面
|
|
2391
|
+
*/
|
|
2392
|
+
getPage: (page: number) => Promise<PdfPage | null>;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* 区域(Range)
|
|
2397
|
+
* 区域对象,表示文件中的一个连续区域,每个 Range 对象包含起始字符位置和终止字符位置。
|
|
2398
|
+
*/
|
|
2399
|
+
/**
|
|
2400
|
+
* Pdf 区域对象,
|
|
2401
|
+
* 用于表示 Pdf 中的一个连续区域,
|
|
2402
|
+
* 每个选区值包含了起始位置和结束位置信息。
|
|
2403
|
+
*/
|
|
2404
|
+
export declare interface PdfRange {
|
|
2405
|
+
/**
|
|
2406
|
+
* 区域的开始位置。
|
|
2407
|
+
*/
|
|
2408
|
+
readonly start: string;
|
|
2409
|
+
/**
|
|
2410
|
+
* 区域的结束位置。
|
|
2411
|
+
*/
|
|
2412
|
+
readonly end: string;
|
|
2413
|
+
/**
|
|
2414
|
+
* 获取该区域对应的纯文本信息。
|
|
2415
|
+
* @returns
|
|
2416
|
+
*/
|
|
2417
|
+
getText: () => string;
|
|
2418
|
+
/**
|
|
2419
|
+
* 将区域中的内容以 HTML 格式返回。
|
|
2420
|
+
* @returns
|
|
2421
|
+
*/
|
|
2422
|
+
getHtml: () => string;
|
|
2423
|
+
/**
|
|
2424
|
+
* 获取选区在当前屏幕上的位置信息
|
|
2425
|
+
* @returns
|
|
2426
|
+
*/
|
|
2427
|
+
getBounding: () => PdfRangeBounding | null;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
/**
|
|
2431
|
+
* 记录选区在屏幕上的矩形位置信息,
|
|
2432
|
+
* 包含整个选区包围盒的四个边界值(top, right, bottom, left),
|
|
2433
|
+
* 以及第一行开始和最后一行结束的横向坐标。
|
|
2434
|
+
* 这些信息是选区中所有 ClientRects 的集合范围。
|
|
2435
|
+
*/
|
|
2436
|
+
export declare interface PdfRangeBounding {
|
|
2437
|
+
/**
|
|
2438
|
+
* 区域的上边界值,
|
|
2439
|
+
* 表示所有选区中最上方的 Y 坐标。
|
|
2440
|
+
*/
|
|
2441
|
+
top: number;
|
|
2442
|
+
/**
|
|
2443
|
+
* 区域的右边界值,
|
|
2444
|
+
* 表示所有选区中最右侧的 X 坐标。
|
|
2445
|
+
*/
|
|
2446
|
+
right: number;
|
|
2447
|
+
/**
|
|
2448
|
+
* 区域的下边界值,
|
|
2449
|
+
* 表示所有选区中最下方的 Y 坐标。
|
|
2450
|
+
*/
|
|
2451
|
+
bottom: number;
|
|
2452
|
+
/**
|
|
2453
|
+
* 区域的左边界值,
|
|
2454
|
+
* 表示所有选区中最左侧的 X 坐标。
|
|
2455
|
+
*/
|
|
2456
|
+
left: number;
|
|
2457
|
+
/**
|
|
2458
|
+
* 第一行选区的起始 X 坐标。
|
|
2459
|
+
*/
|
|
2460
|
+
start: number;
|
|
2461
|
+
/**
|
|
2462
|
+
* 最后一行选区的结束 X 坐标。
|
|
2463
|
+
*/
|
|
2464
|
+
end: number;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
export declare interface PdfRangeValue {
|
|
2468
|
+
start: string;
|
|
2469
|
+
end: string;
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
/**
|
|
2473
|
+
* Pdf 初始化参数
|
|
2474
|
+
*/
|
|
2475
|
+
export declare interface PdfSDKOptions {
|
|
2476
|
+
/**
|
|
2477
|
+
* Pdf 初始化内容,可以是 string 或者 ArrayBuffer,
|
|
2478
|
+
* 也可以通过异步 Promise 加载
|
|
2479
|
+
*/
|
|
2480
|
+
content: MaybePromiseValue<string | ArrayBuffer>;
|
|
2481
|
+
/**
|
|
2482
|
+
* 当前操作 Pdf 的用户信息
|
|
2483
|
+
*/
|
|
2484
|
+
user?: EditorUserOptions;
|
|
2485
|
+
/**
|
|
2486
|
+
* i18n 相关设置
|
|
2487
|
+
*/
|
|
2488
|
+
i18n?: EditorI18nOptions;
|
|
2489
|
+
/**
|
|
2490
|
+
* 品牌相关设置
|
|
2491
|
+
*/
|
|
2492
|
+
brand?: EditorBrandOptions;
|
|
2493
|
+
/**
|
|
2494
|
+
* Pdf 内部资源请求配置
|
|
2495
|
+
*/
|
|
2496
|
+
assets?: EditorAssetsOptions;
|
|
2497
|
+
/**
|
|
2498
|
+
* Pdf 内部超链接设置
|
|
2499
|
+
*/
|
|
2500
|
+
link?: EditorLinkOptions;
|
|
2501
|
+
/**
|
|
2502
|
+
* 初始化水印配置
|
|
2503
|
+
*/
|
|
2504
|
+
watermark?: EditorWatermarkOptions;
|
|
2505
|
+
/**
|
|
2506
|
+
* Pdf 打印设置
|
|
2507
|
+
*/
|
|
2508
|
+
print?: EditorPrintOptions;
|
|
2509
|
+
/**
|
|
2510
|
+
* Pdf 大纲目录设置
|
|
2511
|
+
*/
|
|
2512
|
+
outline?: PdfOutlineOptions;
|
|
2513
|
+
/**
|
|
2514
|
+
* Pdf 菜单栏设置
|
|
2515
|
+
*/
|
|
2516
|
+
menu?: PdfMenuOptions;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* 选区(Selection)
|
|
2521
|
+
* 表示窗口或窗格中的当前选定内容。
|
|
2522
|
+
*/
|
|
2523
|
+
export declare interface PdfSelection {
|
|
2524
|
+
/**
|
|
2525
|
+
* 获取选区的区域范围,
|
|
2526
|
+
* 如果没有指定范围,则返回当前选区的范围。
|
|
2527
|
+
* 如果指定了范围,则返回指定范围的选区。
|
|
2528
|
+
* 如果选区不存在,则返回 null。
|
|
2529
|
+
* @returns
|
|
2530
|
+
*/
|
|
2531
|
+
getRange: (value?: PdfRangeValue) => PdfRange | null;
|
|
2532
|
+
/**
|
|
2533
|
+
* 设置选区的区域范围,
|
|
2534
|
+
* 设置后,选区会自动选中指定范围。
|
|
2535
|
+
* 如果设置为 null,则清空选区。
|
|
2536
|
+
* @param bounds
|
|
2537
|
+
*/
|
|
2538
|
+
setRange: (vale: PdfRangeValue | null) => void;
|
|
2539
|
+
/**
|
|
2540
|
+
* 添加选区变化监听器,当选区发生变化时,会触发回调。
|
|
2541
|
+
* @param listener
|
|
2542
|
+
* @returns
|
|
2543
|
+
*/
|
|
2544
|
+
addRangeListener: (listener: (value: PdfRangeValue | null) => void) => void;
|
|
2545
|
+
/**
|
|
2546
|
+
* 获取 pdf 全部选区范围。
|
|
2547
|
+
* @returns
|
|
2548
|
+
*/
|
|
2549
|
+
getWholeRange: () => PdfRange;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
export declare type PresentationFontFace = EditorFontFace;
|
|
2553
|
+
|
|
2554
|
+
export declare type PresentationFontMeta = EditorFontMeta;
|
|
2555
|
+
|
|
2556
|
+
export declare interface PresentationFontsList {
|
|
2557
|
+
getAll: () => Promise<PresentationFontFace[]>;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
export declare interface PresentationFontsOptions {
|
|
2561
|
+
list: PresentationFontsList;
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* 幻灯片工具栏一级菜单
|
|
2566
|
+
*/
|
|
2567
|
+
export declare type PresentationMenuEntryConfig = EditorMenuEntryConfig<PresentationMenuFeatureButtonName>;
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* 幻灯片工具栏功能按钮
|
|
2571
|
+
*/
|
|
2572
|
+
export declare type PresentationMenuFeatureButtonConfig = EditorMenuFeatureButtonConfig<PresentationMenuFeatureButtonName>;
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* 幻灯片工具栏内置功能按钮
|
|
2576
|
+
*/
|
|
2577
|
+
export declare type PresentationMenuFeatureButtonName = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectAll';
|
|
2578
|
+
|
|
2579
|
+
export declare type PresentationMenuOptions = EditorMenuOptions<PresentationMenuFeatureButtonName>;
|
|
2580
|
+
|
|
2581
|
+
export declare interface PresentationSDKOptions extends EditorOptions {
|
|
2582
|
+
/**
|
|
2583
|
+
* 字体配置
|
|
2584
|
+
*/
|
|
2585
|
+
fonts?: PresentationFontsOptions;
|
|
2586
|
+
/**
|
|
2587
|
+
* 菜单栏相关设置
|
|
2588
|
+
*/
|
|
2589
|
+
menu?: PresentationMenuOptions;
|
|
2590
|
+
/**
|
|
2591
|
+
* 文本格式相关设置
|
|
2592
|
+
*/
|
|
2593
|
+
text?: PresentationTextOptions;
|
|
2594
|
+
}
|
|
1923
2595
|
|
|
1924
|
-
|
|
2596
|
+
/**
|
|
2597
|
+
* 选区(Selection)
|
|
2598
|
+
* 表示窗口中的当前选定内容。
|
|
2599
|
+
* 选定内容表示幻灯片中的选定(或突出显示)区域,或者代表插入点(如果未选择幻灯片中的任何内容)。
|
|
2600
|
+
*/
|
|
2601
|
+
export declare interface PresentationSelection {
|
|
2602
|
+
/**
|
|
2603
|
+
* 获取选区的区域范围,
|
|
2604
|
+
* 如果没有指定范围,则返回当前选区的范围。
|
|
2605
|
+
* 如果指定了范围,则返回指定范围的选区。
|
|
2606
|
+
* 如果选区不存在,则返回 null。
|
|
2607
|
+
* @returns
|
|
2608
|
+
*/
|
|
2609
|
+
getTextRange: (value?: PresentationTextRangeValue) => PresentationTextRange | null;
|
|
2610
|
+
/**
|
|
2611
|
+
* 设置选区的区域范围,
|
|
2612
|
+
* 设置后,选区会自动选中指定范围。
|
|
2613
|
+
* 如果设置为 null,则清空选区。
|
|
2614
|
+
* @param value
|
|
2615
|
+
*/
|
|
2616
|
+
setTextRange: (value: PresentationTextRangeValue | null) => void;
|
|
2617
|
+
/**
|
|
2618
|
+
* 获取当前选中的形状,
|
|
2619
|
+
* 如果没有选中形状,则返回 null。
|
|
2620
|
+
* 如果指定了 value,则返回指定形状。
|
|
2621
|
+
* @param ids 指定的形状 id
|
|
2622
|
+
* @returns
|
|
2623
|
+
*/
|
|
2624
|
+
getSelectedShapes: (ids?: string[]) => PresentationShape[] | null;
|
|
2625
|
+
/**
|
|
2626
|
+
* 选中指定的形状,选中形状后会清空文字选区。
|
|
2627
|
+
* 如果 value 为 null,则清空选中的形状。
|
|
2628
|
+
* @param ids 指定的形状 id
|
|
2629
|
+
* @returns
|
|
2630
|
+
*/
|
|
2631
|
+
setSelectedShapes: (ids: string[] | null) => void;
|
|
2632
|
+
/**
|
|
2633
|
+
* 添加选区变化监听器,当选区发生变化时,会触发回调。
|
|
2634
|
+
* @param listener
|
|
2635
|
+
* @returns
|
|
2636
|
+
*/
|
|
2637
|
+
addRangeListener: (listener: (value: PresentationTextRangeValue | null) => void) => void;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* 幻灯片形状(Shape)接口
|
|
2642
|
+
*/
|
|
2643
|
+
export declare interface PresentationShape {
|
|
2644
|
+
/**
|
|
2645
|
+
* 获取形状的 id
|
|
2646
|
+
*/
|
|
2647
|
+
readonly id: string;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
/**
|
|
2651
|
+
* 幻灯片页面(Slide)对象,
|
|
2652
|
+
* 是幻灯片的基础操作单元,包含幻灯片的基本信息和操作方法。
|
|
2653
|
+
*/
|
|
2654
|
+
export declare interface PresentationSlide {
|
|
2655
|
+
/**
|
|
2656
|
+
* 当前幻灯片的 id
|
|
2657
|
+
*/
|
|
2658
|
+
readonly id: string;
|
|
2659
|
+
/**
|
|
2660
|
+
* 获取当前幻灯片在所有幻灯片中的索引
|
|
2661
|
+
* @returns
|
|
2662
|
+
*/
|
|
2663
|
+
getIndex: () => number;
|
|
2664
|
+
/**
|
|
2665
|
+
* 获取当前页面所有的形状
|
|
2666
|
+
* @returns
|
|
2667
|
+
*/
|
|
2668
|
+
getShapes: () => PresentationShape[];
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
/**
|
|
2672
|
+
* 幻灯片集合对象,
|
|
2673
|
+
* 该接口和 PresentationSlide 负责不同的功能,
|
|
2674
|
+
* PresentationSlide 是一个幻灯片页面的抽象,而 PresentationSlides 是对整个文件中所有页面的操作。
|
|
2675
|
+
*/
|
|
2676
|
+
export declare interface PresentationSlides {
|
|
2677
|
+
/**
|
|
2678
|
+
* 获取当前幻灯片
|
|
2679
|
+
*/
|
|
2680
|
+
getCurrentSlide: () => PresentationSlide;
|
|
2681
|
+
/**
|
|
2682
|
+
* 切换当前幻灯片
|
|
2683
|
+
* @param slideId
|
|
2684
|
+
*/
|
|
2685
|
+
setCurrentSlideIndex: (slideId: string) => void;
|
|
2686
|
+
/**
|
|
2687
|
+
* 获取幻灯片索引
|
|
2688
|
+
* @param slideId
|
|
2689
|
+
* @returns
|
|
2690
|
+
*/
|
|
2691
|
+
getSlideIndex: (slideId: string) => number;
|
|
2692
|
+
/**
|
|
2693
|
+
* 获取幻灯片总数
|
|
2694
|
+
*/
|
|
2695
|
+
getSlidesCount: () => number;
|
|
2696
|
+
/**
|
|
2697
|
+
* 获取所有幻灯片
|
|
2698
|
+
* @returns
|
|
2699
|
+
*/
|
|
2700
|
+
getSlides: () => PresentationSlide[];
|
|
2701
|
+
/**
|
|
2702
|
+
* 获取指定幻灯片
|
|
2703
|
+
* @param slideId
|
|
2704
|
+
*/
|
|
2705
|
+
getSlideById: (slideId: string) => PresentationSlide;
|
|
2706
|
+
/**
|
|
2707
|
+
* 获取当前选中的幻灯片。
|
|
2708
|
+
* 至少存在一个选中的幻灯片。
|
|
2709
|
+
* @returns
|
|
2710
|
+
*/
|
|
2711
|
+
getSelectedSlides: (ids?: string[]) => PresentationSlide[];
|
|
2712
|
+
/**
|
|
2713
|
+
* 设置
|
|
2714
|
+
* @param ids
|
|
2715
|
+
* @returns
|
|
2716
|
+
*/
|
|
2717
|
+
setSelectedSlides: (ids: string[]) => void;
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
/**
|
|
2721
|
+
* 演示文稿文本接口
|
|
2722
|
+
*/
|
|
2723
|
+
export declare type PresentationText = EditorText<string, PresentationTextRangeValue>;
|
|
2724
|
+
|
|
2725
|
+
/**
|
|
2726
|
+
* 演示文稿文本格式
|
|
2727
|
+
*/
|
|
2728
|
+
export declare type PresentationTextFormat = EditorTextFormat;
|
|
2729
|
+
|
|
2730
|
+
/**
|
|
2731
|
+
* 演示文稿文本格式初始化选项
|
|
2732
|
+
*/
|
|
2733
|
+
export declare type PresentationTextOptions = EditorTextOptions<string>;
|
|
2734
|
+
|
|
2735
|
+
/**
|
|
2736
|
+
* 区域(Range)
|
|
2737
|
+
* 区域对象,表示幻灯片页面中的一个连续的文字区域,每个 Range 对象包含起始字符位置和终止字符位置。
|
|
2738
|
+
* 区域信息是一个临时状态,当内容发生变化后,或切换了幻灯片 slide 区域信息可能会失效。
|
|
2739
|
+
*/
|
|
2740
|
+
/**
|
|
2741
|
+
* 幻灯片区域对象,
|
|
2742
|
+
* 用于表示页面中的一个连续区域,
|
|
2743
|
+
* 每个选区值包含了起始位置和结束位置信息的字符串。
|
|
2744
|
+
*/
|
|
2745
|
+
export declare interface PresentationTextRange {
|
|
2746
|
+
/**
|
|
2747
|
+
* 区域的开始位置,
|
|
2748
|
+
* 当内容发生变化后,区域的标识可能会失效。
|
|
2749
|
+
*/
|
|
2750
|
+
readonly start: string;
|
|
2751
|
+
/**
|
|
2752
|
+
* 区域的结束位置,
|
|
2753
|
+
* 当内容发生变化后,区域的标识可能会失效。
|
|
2754
|
+
*/
|
|
2755
|
+
readonly end: string;
|
|
2756
|
+
/**
|
|
2757
|
+
* 获取该区域对应的纯文本信息。
|
|
2758
|
+
* @returns
|
|
2759
|
+
*/
|
|
2760
|
+
getText: () => string;
|
|
2761
|
+
/**
|
|
2762
|
+
* 设置该区域的内容
|
|
2763
|
+
* @param text 内容
|
|
2764
|
+
*/
|
|
2765
|
+
setText: (text: string) => void;
|
|
2766
|
+
/**
|
|
2767
|
+
* 将区域中的内容以 HTML 格式返回
|
|
2768
|
+
*/
|
|
2769
|
+
getHtml: () => string;
|
|
2770
|
+
/**
|
|
2771
|
+
* 设置该区域的内容为 HTML 格式
|
|
2772
|
+
* @param html 内容
|
|
2773
|
+
*/
|
|
2774
|
+
setHtml: (html: string) => void;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
export declare interface PresentationTextRangeValue {
|
|
2778
|
+
start: string;
|
|
2779
|
+
end: string;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
/**
|
|
2783
|
+
* 幻灯片缩放接口
|
|
2784
|
+
*/
|
|
2785
|
+
export declare interface PresentationZoom {
|
|
2786
|
+
/**
|
|
2787
|
+
* 获取当前缩放比例。
|
|
2788
|
+
* @returns
|
|
2789
|
+
*/
|
|
2790
|
+
getPercentage: () => number;
|
|
2791
|
+
/**
|
|
2792
|
+
* 设置缩放比例,
|
|
2793
|
+
* 有效范围 10 ~ 500。
|
|
2794
|
+
* @param percentage
|
|
2795
|
+
*/
|
|
2796
|
+
setPercentage: (percentage: number) => void;
|
|
2797
|
+
/**
|
|
2798
|
+
* 设置自动缩放模式,
|
|
2799
|
+
* none: 不自动缩放,默认值。
|
|
2800
|
+
* window: 根据窗口宽度自动缩放,页面宽度随着窗口宽度变化而变化
|
|
2801
|
+
* @param mode 缩放模式,可以是 'window'
|
|
2802
|
+
*/
|
|
2803
|
+
setFitMode: (mode: 'none' | 'window') => void;
|
|
2804
|
+
/**
|
|
2805
|
+
* 获取当前缩放模式。
|
|
2806
|
+
* @returns
|
|
2807
|
+
*/
|
|
2808
|
+
getFitMode: () => 'none' | 'window';
|
|
2809
|
+
/**
|
|
2810
|
+
* 放大。
|
|
2811
|
+
*/
|
|
2812
|
+
zoomIn: () => void;
|
|
2813
|
+
/**
|
|
2814
|
+
* 缩小。
|
|
2815
|
+
*/
|
|
2816
|
+
zoomOut: () => void;
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
/**
|
|
2820
|
+
* 表格单元格对象
|
|
2821
|
+
*/
|
|
2822
|
+
export declare interface SheetCell {
|
|
2823
|
+
/**
|
|
2824
|
+
* 单元格所在的行号
|
|
2825
|
+
*/
|
|
2826
|
+
row: number;
|
|
2827
|
+
/**
|
|
2828
|
+
* 单元格所在的列号
|
|
2829
|
+
*/
|
|
2830
|
+
column: number;
|
|
2831
|
+
/**
|
|
2832
|
+
* 单元格所在的工作表 ID
|
|
2833
|
+
*/
|
|
2834
|
+
sheetId: string;
|
|
2835
|
+
/**
|
|
2836
|
+
* 获取单元格的文本
|
|
2837
|
+
*/
|
|
2838
|
+
getCellText: () => string;
|
|
2839
|
+
/**
|
|
2840
|
+
* 获取单元格的值
|
|
2841
|
+
*/
|
|
2842
|
+
getCellValue: () => SheetCellValue | null;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
/**
|
|
2846
|
+
* 单元格值类型
|
|
2847
|
+
*/
|
|
2848
|
+
export declare type SheetCellValue = {
|
|
2849
|
+
type: 'primitive';
|
|
2850
|
+
value: string | number | boolean;
|
|
2851
|
+
} | {
|
|
2852
|
+
type: 'date';
|
|
2853
|
+
value: number;
|
|
2854
|
+
} | {
|
|
2855
|
+
type: 'calcError';
|
|
2856
|
+
value: {
|
|
2857
|
+
error: string;
|
|
2858
|
+
};
|
|
2859
|
+
};
|
|
2860
|
+
|
|
2861
|
+
/**
|
|
2862
|
+
* 电子表格工具栏一级菜单
|
|
2863
|
+
*/
|
|
2864
|
+
export declare type SheetMenuEntryConfig = EditorMenuEntryConfig<SheetMenuFeatureButtonName>;
|
|
2865
|
+
|
|
2866
|
+
/**
|
|
2867
|
+
* 电子表格工具栏功能按钮
|
|
2868
|
+
*/
|
|
2869
|
+
export declare type SheetMenuFeatureButtonConfig = EditorMenuFeatureButtonConfig<SheetMenuFeatureButtonName>;
|
|
2870
|
+
|
|
2871
|
+
/**
|
|
2872
|
+
* 电子表格工具栏内置功能按钮
|
|
2873
|
+
*/
|
|
2874
|
+
export declare type SheetMenuFeatureButtonName = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectAll';
|
|
2875
|
+
|
|
2876
|
+
export declare type SheetMenuOptions = EditorMenuOptions<SheetMenuFeatureButtonName>;
|
|
2877
|
+
|
|
2878
|
+
/**
|
|
2879
|
+
* 表格区域对象,
|
|
2880
|
+
* 用于表示表格中被选中的单元格区域,
|
|
2881
|
+
* 可以是一个单元格、一行、一列、或某个区域。
|
|
2882
|
+
*/
|
|
2883
|
+
export declare interface SheetRange {
|
|
2884
|
+
/**
|
|
2885
|
+
* 区域类型
|
|
2886
|
+
*/
|
|
2887
|
+
type: `${SheetRangeType}`;
|
|
2888
|
+
/**
|
|
2889
|
+
* 区域的行开始位置
|
|
2890
|
+
*/
|
|
2891
|
+
readonly row: number;
|
|
2892
|
+
/**
|
|
2893
|
+
* 区域的列开始位置
|
|
2894
|
+
*/
|
|
2895
|
+
readonly column: number;
|
|
2896
|
+
/**
|
|
2897
|
+
* 区域的行数
|
|
2898
|
+
*/
|
|
2899
|
+
readonly rowCount: number;
|
|
2900
|
+
/**
|
|
2901
|
+
* 区域的列数
|
|
2902
|
+
*/
|
|
2903
|
+
readonly columnCount: number;
|
|
2904
|
+
/**
|
|
2905
|
+
* 获取该区域对应的纯文本信息。
|
|
2906
|
+
* @returns
|
|
2907
|
+
*/
|
|
2908
|
+
getText: () => string;
|
|
2909
|
+
/**
|
|
2910
|
+
* 设置该区域的内容
|
|
2911
|
+
* @param text 内容
|
|
2912
|
+
*/
|
|
2913
|
+
setText: (text: string) => void;
|
|
2914
|
+
/**
|
|
2915
|
+
* 将区域中的内容以 HTML 格式返回
|
|
2916
|
+
*/
|
|
2917
|
+
getHtml: () => string;
|
|
2918
|
+
/**
|
|
2919
|
+
* 设置该区域的内容为 HTML 格式
|
|
2920
|
+
* @param html 内容
|
|
2921
|
+
*/
|
|
2922
|
+
setHtml: (html: string) => void;
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
/**
|
|
2926
|
+
* 区域(Range)
|
|
2927
|
+
* 区域对象,表示表格中的一个单元格区域,每个 Range 对象包含了一个或多个单元格、行、列信息。
|
|
2928
|
+
*/
|
|
2929
|
+
/**
|
|
2930
|
+
* 选区类型
|
|
2931
|
+
*/
|
|
2932
|
+
export declare enum SheetRangeType {
|
|
2933
|
+
/**
|
|
2934
|
+
* 选中一个或多个单元格
|
|
2935
|
+
*/
|
|
2936
|
+
Cells = "cells",
|
|
2937
|
+
/**
|
|
2938
|
+
* 选中一行或多行
|
|
2939
|
+
*/
|
|
2940
|
+
Rows = "rows",
|
|
2941
|
+
/**
|
|
2942
|
+
* 选中一列或多列
|
|
2943
|
+
*/
|
|
2944
|
+
Columns = "columns",
|
|
2945
|
+
/**
|
|
2946
|
+
* 选中整个工作表
|
|
2947
|
+
*/
|
|
2948
|
+
Sheet = "sheet"
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
export declare type SheetRangeValue = {
|
|
2952
|
+
/**
|
|
2953
|
+
* 单个或多个单元格
|
|
2954
|
+
*/
|
|
2955
|
+
type: `${SheetRangeType.Cells}`;
|
|
2956
|
+
/**
|
|
2957
|
+
* 起始单元格的行号
|
|
2958
|
+
*/
|
|
2959
|
+
row: number;
|
|
2960
|
+
/**
|
|
2961
|
+
* 总计行数
|
|
2962
|
+
*/
|
|
2963
|
+
rowCount: number;
|
|
2964
|
+
/**
|
|
2965
|
+
* 起始单元格的列号
|
|
2966
|
+
*/
|
|
2967
|
+
column: number;
|
|
2968
|
+
/**
|
|
2969
|
+
* 总计列数
|
|
2970
|
+
*/
|
|
2971
|
+
columnCount: number;
|
|
2972
|
+
} | {
|
|
2973
|
+
/**
|
|
2974
|
+
* 一列或多列
|
|
2975
|
+
*/
|
|
2976
|
+
type: `${SheetRangeType.Rows}`;
|
|
2977
|
+
/**
|
|
2978
|
+
* 起始列号
|
|
2979
|
+
*/
|
|
2980
|
+
row: number;
|
|
2981
|
+
/**
|
|
2982
|
+
* 总计行数
|
|
2983
|
+
*/
|
|
2984
|
+
rowCount: number;
|
|
2985
|
+
} | {
|
|
2986
|
+
/**
|
|
2987
|
+
* 一行或多行
|
|
2988
|
+
*/
|
|
2989
|
+
type: `${SheetRangeType.Columns}`;
|
|
2990
|
+
/**
|
|
2991
|
+
* 起始行号
|
|
2992
|
+
*/
|
|
2993
|
+
column: number;
|
|
2994
|
+
/**
|
|
2995
|
+
* 总计列数
|
|
2996
|
+
*/
|
|
2997
|
+
columnCount: number;
|
|
2998
|
+
} | {
|
|
2999
|
+
/**
|
|
3000
|
+
* 整个工作表
|
|
3001
|
+
*/
|
|
3002
|
+
type: `${SheetRangeType.Sheet}`;
|
|
3003
|
+
};
|
|
3004
|
+
|
|
3005
|
+
export declare interface SheetSDKOptions extends EditorOptions {
|
|
3006
|
+
/**
|
|
3007
|
+
* 字体配置
|
|
3008
|
+
*/
|
|
3009
|
+
fonts?: EditorFontsOptions;
|
|
3010
|
+
/**
|
|
3011
|
+
* 菜单栏相关设置
|
|
3012
|
+
*/
|
|
3013
|
+
menu?: SheetMenuOptions;
|
|
3014
|
+
/**
|
|
3015
|
+
* 文本格式相关设置
|
|
3016
|
+
*/
|
|
3017
|
+
text?: SheetTextOptions;
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
/**
|
|
3021
|
+
* 选区(Selection)
|
|
3022
|
+
* 表示窗口或窗格中的当前选定内容。
|
|
3023
|
+
* 选定内容表示表格中的选定(或突出显示)的单元格区域。
|
|
3024
|
+
*/
|
|
3025
|
+
export declare interface SheetSelection {
|
|
3026
|
+
/**
|
|
3027
|
+
* 获取选区的区域范围,
|
|
3028
|
+
* 如果没有指定范围,则返回当前选区的范围。
|
|
3029
|
+
* 如果指定了范围,则返回指定范围的选区。
|
|
3030
|
+
* 如果选区不存在,则返回 null。
|
|
3031
|
+
*/
|
|
3032
|
+
getRange: (value?: SheetRangeValue) => SheetRange | null;
|
|
3033
|
+
/**
|
|
3034
|
+
* 设置选区的区域范围,
|
|
3035
|
+
* 设置后,选区会自动选中指定范围。
|
|
3036
|
+
* 如果设置为 null,则清空选区。
|
|
3037
|
+
*/
|
|
3038
|
+
setRange: (value: SheetRangeValue | null) => void;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
/**
|
|
3042
|
+
* 电子表格文本接口
|
|
3043
|
+
*/
|
|
3044
|
+
export declare type SheetText = EditorText<string, SheetRangeValue>;
|
|
3045
|
+
|
|
3046
|
+
/**
|
|
3047
|
+
* 电子表格文本格式
|
|
3048
|
+
*/
|
|
3049
|
+
export declare type SheetTextFormat = EditorTextFormat;
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* 电子表格文本格式初始化选项
|
|
3053
|
+
*/
|
|
3054
|
+
export declare type SheetTextOptions = EditorTextOptions<string>;
|
|
3055
|
+
|
|
3056
|
+
/**
|
|
3057
|
+
* 工作表集合对象
|
|
3058
|
+
*/
|
|
3059
|
+
export declare interface SheetWorkbook {
|
|
3060
|
+
/**
|
|
3061
|
+
* 获取所有工作表
|
|
3062
|
+
* @returns
|
|
3063
|
+
*/
|
|
3064
|
+
getWorksheets: () => SheetWorksheet[];
|
|
3065
|
+
/**
|
|
3066
|
+
* 获取指定的工作表
|
|
3067
|
+
* @param sheetId
|
|
3068
|
+
* @returns
|
|
3069
|
+
*/
|
|
3070
|
+
getWorksheetById: (sheetId: string) => SheetWorksheet | null;
|
|
3071
|
+
/**
|
|
3072
|
+
* 获取当前活动的工作表
|
|
3073
|
+
* TODO: 是否存在返回空的场景
|
|
3074
|
+
* @returns
|
|
3075
|
+
*/
|
|
3076
|
+
getActiveWorksheet: () => SheetWorksheet;
|
|
3077
|
+
/**
|
|
3078
|
+
* 激活指定的工作表
|
|
3079
|
+
* @param sheetId
|
|
3080
|
+
*/
|
|
3081
|
+
setActiveWorksheet: (sheetId: string) => void;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
/**
|
|
3085
|
+
* 工作表对象
|
|
3086
|
+
*/
|
|
3087
|
+
export declare interface SheetWorksheet {
|
|
3088
|
+
/**
|
|
3089
|
+
* 工作表对应编号
|
|
3090
|
+
*/
|
|
3091
|
+
get id(): string;
|
|
3092
|
+
/**
|
|
3093
|
+
* 获取当前工作表名称
|
|
3094
|
+
*/
|
|
3095
|
+
get name(): string;
|
|
3096
|
+
/**
|
|
3097
|
+
* 这个工作表是否为当前活动的工作表
|
|
3098
|
+
*/
|
|
3099
|
+
get isActive(): boolean;
|
|
3100
|
+
/**
|
|
3101
|
+
* 获取工作表的所有选区
|
|
3102
|
+
* @returns
|
|
3103
|
+
*/
|
|
3104
|
+
getSelections: () => SheetSelection[] | null;
|
|
3105
|
+
/**
|
|
3106
|
+
* 获取选区的物理位置(相对于浏览器窗口),如果选区完全不在工作表的可视区域内,返回 null。
|
|
3107
|
+
* 其中选区超出可视区域的部分会被截断处理。
|
|
3108
|
+
*
|
|
3109
|
+
* 当工作表存在冻结行列时,可视区域将被分成四个部分(如果仅存在冻结行或冻结列则被分为两个部分),
|
|
3110
|
+
* 此时需要计算出选区在**视觉上**与可视区域的交集。
|
|
3111
|
+
*/
|
|
3112
|
+
getPhysicalPosition: (range: SheetRangeValue) => {
|
|
3113
|
+
left: number;
|
|
3114
|
+
top: number;
|
|
3115
|
+
width: number;
|
|
3116
|
+
height: number;
|
|
3117
|
+
} | null;
|
|
3118
|
+
/**
|
|
3119
|
+
* 添加选区变化监听器,当选区发生变化时,会触发回调。
|
|
3120
|
+
* @param listener
|
|
3121
|
+
* @returns 用于移除监听的回调
|
|
3122
|
+
*/
|
|
3123
|
+
addRangeListener: (listener: (range: {
|
|
3124
|
+
sheet: string;
|
|
3125
|
+
ranges: SheetRangeValue[] | null;
|
|
3126
|
+
}) => void) => () => void;
|
|
3127
|
+
/**
|
|
3128
|
+
* 获取工作表中指定区域的单元格对象
|
|
3129
|
+
* @returns
|
|
3130
|
+
*/
|
|
3131
|
+
getCell: (row: number, column: number) => SheetCell | null;
|
|
3132
|
+
/**
|
|
3133
|
+
* 获取工作表中选中的单元格对象
|
|
3134
|
+
* @returns
|
|
3135
|
+
*/
|
|
3136
|
+
getActiveCell: () => SheetCell | null;
|
|
3137
|
+
/**
|
|
3138
|
+
* 激活工作表中某个单元格
|
|
3139
|
+
* @param cell 单元格对象,需要传入行和列的索引值
|
|
3140
|
+
* @returns
|
|
3141
|
+
*/
|
|
3142
|
+
setActiveCell: (cell: {
|
|
3143
|
+
row: number;
|
|
3144
|
+
column: number;
|
|
3145
|
+
}) => void;
|
|
3146
|
+
/**
|
|
3147
|
+
* 定位到单元格所在位置
|
|
3148
|
+
* @param row 单元格所在行
|
|
3149
|
+
* @param column 单元格所在列
|
|
3150
|
+
*/
|
|
3151
|
+
locateCell: (row: number, column: number) => void;
|
|
3152
|
+
}
|
|
1925
3153
|
|
|
1926
3154
|
export { }
|