@rhc-office/sdk 6.6.266 → 6.6.351
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/README.md +1 -5
- package/dist/api/annotation-tool.d.ts +162 -102
- package/dist/api/annotation-tool.d.ts.map +1 -1
- package/dist/api/callbacks.d.ts +32 -6
- package/dist/api/callbacks.d.ts.map +1 -1
- package/dist/api/document-sdk.d.ts +6 -5
- package/dist/api/document-sdk.d.ts.map +1 -1
- package/dist/api/document-tool.d.ts +16 -11
- package/dist/api/document-tool.d.ts.map +1 -1
- package/dist/api/menu-visibility.d.ts +6 -1
- package/dist/api/menu-visibility.d.ts.map +1 -1
- package/dist/api/page-arrange-tool.d.ts +28 -0
- package/dist/api/page-arrange-tool.d.ts.map +1 -0
- package/dist/api/security-tool.d.ts +21 -0
- package/dist/api/security-tool.d.ts.map +1 -0
- package/dist/api/ui-tool.d.ts +19 -0
- package/dist/api/ui-tool.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +1 -1
- package/dist/browser/document-viewer.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +730 -501
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/tools/AnnotationToolImpl.d.ts +25 -0
- package/dist/tools/AnnotationToolImpl.d.ts.map +1 -0
- package/dist/tools/CryptoToolImpl.d.ts +9 -0
- package/dist/tools/CryptoToolImpl.d.ts.map +1 -0
- package/dist/tools/DigitalSignToolImpl.d.ts +27 -0
- package/dist/tools/DigitalSignToolImpl.d.ts.map +1 -0
- package/dist/tools/DocumentToolImpl.d.ts +1 -0
- package/dist/tools/DocumentToolImpl.d.ts.map +1 -1
- package/dist/tools/PageArrangeToolImpl.d.ts +21 -0
- package/dist/tools/PageArrangeToolImpl.d.ts.map +1 -0
- package/dist/tools/SecurityToolImpl.d.ts +12 -0
- package/dist/tools/SecurityToolImpl.d.ts.map +1 -0
- package/dist/tools/SignServerToolImpl.d.ts +19 -0
- package/dist/tools/SignServerToolImpl.d.ts.map +1 -0
- package/dist/tools/SymbologyToolImpl.d.ts +8 -0
- package/dist/tools/SymbologyToolImpl.d.ts.map +1 -0
- package/dist/tools/TemplateSignToolImpl.d.ts +13 -0
- package/dist/tools/TemplateSignToolImpl.d.ts.map +1 -0
- package/dist/tools/UIToolImpl.d.ts +13 -0
- package/dist/tools/UIToolImpl.d.ts.map +1 -1
- package/dist/tools/index.d.ts +8 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/viewer/AdapterProtocol.d.ts +3 -1
- package/dist/viewer/AdapterProtocol.d.ts.map +1 -1
- package/dist/viewer/BridgeToolAdapter.d.ts +1 -0
- package/dist/viewer/BridgeToolAdapter.d.ts.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts +7 -5
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/dist/viewer/ReaderBridgeClient.d.ts +3 -0
- package/dist/viewer/ReaderBridgeClient.d.ts.map +1 -1
- package/dist/viewer/ReaderConfiguration.d.ts +0 -1
- package/dist/viewer/ReaderConfiguration.d.ts.map +1 -1
- package/dist/viewer/ReaderStateStore.d.ts +2 -0
- package/dist/viewer/ReaderStateStore.d.ts.map +1 -1
- package/dist/viewer/SdkCallbackRegistry.d.ts +5 -2
- package/dist/viewer/SdkCallbackRegistry.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/annotation-tool.ts +232 -146
- package/src/api/callbacks.ts +48 -7
- package/src/api/document-sdk.ts +9 -5
- package/src/api/document-tool.ts +25 -13
- package/src/api/menu-visibility.ts +10 -1
- package/src/api/page-arrange-tool.ts +67 -0
- package/src/api/security-tool.ts +32 -0
- package/src/api/ui-tool.ts +33 -0
- package/src/index.ts +3 -0
- package/src/tools/AnnotationToolImpl.ts +169 -0
- package/src/tools/CryptoToolImpl.ts +27 -0
- package/src/tools/DigitalSignToolImpl.ts +166 -0
- package/src/tools/DocumentToolImpl.ts +32 -6
- package/src/tools/PageArrangeToolImpl.ts +99 -0
- package/src/tools/SecurityToolImpl.ts +48 -0
- package/src/tools/SignServerToolImpl.ts +92 -0
- package/src/tools/SymbologyToolImpl.ts +34 -0
- package/src/tools/TemplateSignToolImpl.ts +51 -0
- package/src/tools/UIToolImpl.ts +98 -12
- package/src/tools/index.ts +8 -1
- package/src/viewer/AdapterProtocol.ts +4 -0
- package/src/viewer/BridgeToolAdapter.ts +11 -2
- package/src/viewer/DocumentSDK.ts +71 -144
- package/src/viewer/ReaderBridgeClient.ts +9 -0
- package/src/viewer/ReaderConfiguration.ts +0 -2
- package/src/viewer/ReaderStateStore.ts +13 -1
- package/src/viewer/SdkCallbackRegistry.ts +84 -6
- package/dist/tools/Phase1ToolPlaceholder.d.ts +0 -5
- package/dist/tools/Phase1ToolPlaceholder.d.ts.map +0 -1
- package/src/tools/Phase1ToolPlaceholder.ts +0 -35
|
@@ -1,199 +1,285 @@
|
|
|
1
|
-
export type
|
|
2
|
-
| '
|
|
3
|
-
| '
|
|
4
|
-
| '
|
|
5
|
-
| '
|
|
6
|
-
| '
|
|
7
|
-
| '
|
|
8
|
-
| '
|
|
9
|
-
| '
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
export type AnnotationMode =
|
|
2
|
+
| 'none'
|
|
3
|
+
| 'select'
|
|
4
|
+
| 'pen'
|
|
5
|
+
| 'eraser'
|
|
6
|
+
| 'line'
|
|
7
|
+
| 'arrow'
|
|
8
|
+
| 'rectangle'
|
|
9
|
+
| 'circle'
|
|
10
|
+
| 'text-highlight'
|
|
11
|
+
| 'text-underline'
|
|
12
|
+
| 'text-strikethrough'
|
|
13
|
+
| 'text-squiggly'
|
|
14
|
+
| 'text-note'
|
|
15
|
+
| 'stamp';
|
|
16
|
+
|
|
17
|
+
export type AnnotationViewPenType = AnnotationMode;
|
|
18
|
+
|
|
19
|
+
export type AnnotationTextMarkupType = 'highlight' | 'underline' | 'strikethrough' | 'squiggly';
|
|
20
|
+
|
|
21
|
+
export type AnnotationShapeType = 'line' | 'arrow' | 'rectangle' | 'ellipse';
|
|
22
|
+
|
|
23
|
+
export type AnnotationPresetStampType =
|
|
24
|
+
| 'approved'
|
|
25
|
+
| 'rejected'
|
|
26
|
+
| 'pending'
|
|
27
|
+
| 'draft'
|
|
28
|
+
| 'final'
|
|
29
|
+
| 'completed'
|
|
30
|
+
| 'void'
|
|
31
|
+
| 'confidential'
|
|
32
|
+
| 'urgent'
|
|
33
|
+
| 'received'
|
|
34
|
+
| 'archived'
|
|
35
|
+
| 'copy';
|
|
36
|
+
|
|
37
|
+
export type AnnotationStampSourceType = 'preset' | 'text' | 'image';
|
|
38
|
+
|
|
39
|
+
export type AnnotationStampShape = 'rectangle' | 'rounded-rectangle' | 'ellipse' | 'circle';
|
|
40
|
+
|
|
41
|
+
export interface AnnotationTextMarkupOptions {
|
|
42
|
+
type?: AnnotationTextMarkupType;
|
|
43
|
+
color?: string;
|
|
44
|
+
opacity?: number;
|
|
45
|
+
lineWidth?: number;
|
|
46
|
+
highlightStyle?: 'solid' | 'gradient' | 'translucent';
|
|
47
|
+
squigglyStyle?: 'wave' | 'zigzag' | 'sine' | 'sawtooth';
|
|
19
48
|
}
|
|
20
49
|
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
50
|
+
export interface AnnotationShapeOptions {
|
|
51
|
+
type?: AnnotationShapeType;
|
|
52
|
+
color?: string;
|
|
53
|
+
strokeWidth?: number;
|
|
54
|
+
opacity?: number;
|
|
55
|
+
fillColor?: string;
|
|
56
|
+
fillOpacity?: number;
|
|
57
|
+
fillEnabled?: boolean;
|
|
26
58
|
}
|
|
27
59
|
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
width: number;
|
|
34
|
-
height: number;
|
|
60
|
+
export interface AnnotationPresetStampOptions {
|
|
61
|
+
sourceType: 'preset';
|
|
62
|
+
presetType: AnnotationPresetStampType;
|
|
63
|
+
customColor?: string;
|
|
64
|
+
customText?: string;
|
|
35
65
|
}
|
|
36
66
|
|
|
37
|
-
export interface
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
locked?: boolean;
|
|
52
|
-
creationDateBefore?: Date;
|
|
53
|
-
creationDateAfter?: Date;
|
|
54
|
-
creationDateEquals?: Date;
|
|
55
|
-
|
|
56
|
-
parseSKQueryParams(query: string): void;
|
|
57
|
-
|
|
58
|
-
convertSKAnnotationTypeToSubject(skType: string): AnnotationSubject;
|
|
59
|
-
|
|
60
|
-
subjectEquals(subject: AnnotationSubject): AnnotationQueryParams;
|
|
61
|
-
|
|
62
|
-
batchIdEquals(batchId: string): AnnotationQueryParams;
|
|
63
|
-
|
|
64
|
-
batchIdInSet(batchIds: string[]): AnnotationQueryParams;
|
|
65
|
-
|
|
66
|
-
authorEquals(author: string): AnnotationQueryParams;
|
|
67
|
-
|
|
68
|
-
authorIsNull(): AnnotationQueryParams;
|
|
69
|
-
|
|
70
|
-
authorIsNotNull(): AnnotationQueryParams;
|
|
71
|
-
|
|
72
|
-
userNameEquals(userName: string): AnnotationQueryParams;
|
|
73
|
-
|
|
74
|
-
userNameIsNull(): AnnotationQueryParams;
|
|
75
|
-
|
|
76
|
-
userNameIsNotNull(): AnnotationQueryParams;
|
|
67
|
+
export interface AnnotationTextStampOptions {
|
|
68
|
+
sourceType: 'text';
|
|
69
|
+
text: string;
|
|
70
|
+
fontFamily?: string;
|
|
71
|
+
fontSize?: number;
|
|
72
|
+
fontBold?: boolean;
|
|
73
|
+
textColor?: string;
|
|
74
|
+
backgroundColor?: string;
|
|
75
|
+
borderColor?: string;
|
|
76
|
+
borderWidth?: number;
|
|
77
|
+
shape?: AnnotationStampShape;
|
|
78
|
+
cornerRadius?: number;
|
|
79
|
+
padding?: number;
|
|
80
|
+
}
|
|
77
81
|
|
|
78
|
-
|
|
82
|
+
export interface AnnotationImageStampOptions {
|
|
83
|
+
height?: number;
|
|
84
|
+
sourceType: 'image';
|
|
85
|
+
imageData: string;
|
|
86
|
+
mimeType?: string;
|
|
87
|
+
naturalHeight?: number;
|
|
88
|
+
naturalWidth?: number;
|
|
89
|
+
preserveAspectRatio?: boolean;
|
|
90
|
+
width?: number;
|
|
91
|
+
}
|
|
79
92
|
|
|
80
|
-
|
|
93
|
+
export type AnnotationStampOptions =
|
|
94
|
+
| AnnotationPresetStampOptions
|
|
95
|
+
| AnnotationTextStampOptions
|
|
96
|
+
| AnnotationImageStampOptions;
|
|
97
|
+
|
|
98
|
+
export interface AnnotationTextBoxOptions {
|
|
99
|
+
text?: string;
|
|
100
|
+
fontFamily?: string;
|
|
101
|
+
fontSize?: number;
|
|
102
|
+
fontWeight?: 'normal' | 'bold';
|
|
103
|
+
fontStyle?: 'normal' | 'italic';
|
|
104
|
+
fontColor?: string;
|
|
105
|
+
backgroundColor?: string;
|
|
106
|
+
backgroundOpacity?: number;
|
|
107
|
+
borderColor?: string;
|
|
108
|
+
borderWidth?: number;
|
|
109
|
+
borderRadius?: number;
|
|
110
|
+
padding?: number;
|
|
111
|
+
lineHeight?: number;
|
|
112
|
+
letterSpacing?: number;
|
|
113
|
+
firstLineIndentEnabled?: boolean;
|
|
114
|
+
firstLineIndentChars?: number;
|
|
115
|
+
captionSeal?: string;
|
|
116
|
+
captionName?: string;
|
|
117
|
+
captionShowDate?: boolean;
|
|
118
|
+
}
|
|
81
119
|
|
|
82
|
-
|
|
120
|
+
export type LegacyAnnotationPenType =
|
|
121
|
+
| AnnotationViewPenType
|
|
122
|
+
| 'draw'
|
|
123
|
+
| 'highlight'
|
|
124
|
+
| 'text'
|
|
125
|
+
| 'markup';
|
|
83
126
|
|
|
84
|
-
|
|
127
|
+
export interface AnnotationViewOptions<TPenType extends string = AnnotationViewPenType> {
|
|
128
|
+
penType?: TPenType;
|
|
129
|
+
penColor?: string;
|
|
130
|
+
penWidth?: number;
|
|
131
|
+
textSize?: number;
|
|
132
|
+
textColor?: string;
|
|
133
|
+
textFont?: '仿宋' | '楷体' | '黑体' | string;
|
|
134
|
+
textMarkup?: AnnotationTextMarkupOptions;
|
|
135
|
+
shape?: AnnotationShapeOptions;
|
|
136
|
+
stamp?: AnnotationStampOptions;
|
|
137
|
+
textBox?: AnnotationTextBoxOptions;
|
|
138
|
+
}
|
|
85
139
|
|
|
86
|
-
|
|
140
|
+
export interface LegacyAnnotationViewOptions extends AnnotationViewOptions<LegacyAnnotationPenType> {
|
|
141
|
+
penType?: LegacyAnnotationPenType;
|
|
142
|
+
}
|
|
87
143
|
|
|
88
|
-
|
|
144
|
+
export interface AnnotationPenStyleOptions {
|
|
145
|
+
penTipStyle?: 'round' | 'tapered';
|
|
146
|
+
pressureSensitivity?: boolean;
|
|
147
|
+
}
|
|
89
148
|
|
|
90
|
-
|
|
149
|
+
export interface AnnotationToolSelectOptions {
|
|
150
|
+
stamp?: AnnotationStampOptions;
|
|
151
|
+
}
|
|
91
152
|
|
|
92
|
-
|
|
153
|
+
export type AnnotationType =
|
|
154
|
+
| 'drawing'
|
|
155
|
+
| 'shape'
|
|
156
|
+
| 'text-markup'
|
|
157
|
+
| 'text-redaction'
|
|
158
|
+
| 'text-note'
|
|
159
|
+
| 'stamp';
|
|
93
160
|
|
|
94
|
-
|
|
161
|
+
export type AnnotationState = 'creating' | 'created' | 'editing' | 'selected' | 'hidden';
|
|
95
162
|
|
|
96
|
-
|
|
163
|
+
export type AnnotationGeometryUnit = 'mm' | 'pt';
|
|
97
164
|
|
|
98
|
-
|
|
165
|
+
export interface AnnotationAuthor {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
avatar?: string;
|
|
169
|
+
color?: string;
|
|
170
|
+
}
|
|
99
171
|
|
|
100
|
-
|
|
172
|
+
export interface AnnotationStyle {
|
|
173
|
+
strokeColor?: number;
|
|
174
|
+
strokeWidth?: number;
|
|
175
|
+
strokeOpacity?: number;
|
|
176
|
+
fillColor?: number;
|
|
177
|
+
fillOpacity?: number;
|
|
178
|
+
dashArray?: readonly [number, number];
|
|
179
|
+
lineCap?: 'butt' | 'round' | 'square';
|
|
180
|
+
lineJoin?: 'miter' | 'round' | 'bevel';
|
|
181
|
+
pressureSensitivity?: boolean;
|
|
182
|
+
}
|
|
101
183
|
|
|
102
|
-
|
|
184
|
+
export interface AnnotationGeometry {
|
|
185
|
+
unit?: AnnotationGeometryUnit;
|
|
186
|
+
[property: string]: unknown;
|
|
103
187
|
}
|
|
104
188
|
|
|
105
|
-
export interface
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
189
|
+
export interface AnnotationRecord {
|
|
190
|
+
id: string;
|
|
191
|
+
type?: AnnotationType;
|
|
192
|
+
pageRange?: readonly [number, number];
|
|
193
|
+
createdAt?: number;
|
|
194
|
+
modifiedAt?: number;
|
|
195
|
+
author?: AnnotationAuthor;
|
|
196
|
+
state?: AnnotationState;
|
|
197
|
+
zIndex?: number;
|
|
198
|
+
visible?: boolean;
|
|
199
|
+
locked?: boolean;
|
|
200
|
+
persisted?: boolean;
|
|
201
|
+
customData?: Record<string, unknown>;
|
|
202
|
+
tool?: string;
|
|
203
|
+
style?: AnnotationStyle;
|
|
204
|
+
geometry?: AnnotationGeometry;
|
|
205
|
+
[property: string]: unknown;
|
|
117
206
|
}
|
|
118
207
|
|
|
119
|
-
export interface
|
|
120
|
-
|
|
208
|
+
export interface AnnotationChangePayload {
|
|
209
|
+
annotationId?: string;
|
|
210
|
+
annotation?: AnnotationRecord;
|
|
211
|
+
}
|
|
121
212
|
|
|
122
|
-
|
|
213
|
+
export type AnnotationEventName =
|
|
214
|
+
| 'annotationAdded'
|
|
215
|
+
| 'annotationRemoved'
|
|
216
|
+
| 'annotationUpdated'
|
|
217
|
+
| 'annotationModeChange'
|
|
218
|
+
| 'annotationInputDeviceChange'
|
|
219
|
+
| 'annotationEvent';
|
|
123
220
|
|
|
124
|
-
|
|
221
|
+
export type AnnotationEventPayload = AnnotationChangePayload | Record<string, unknown>;
|
|
125
222
|
|
|
126
|
-
|
|
223
|
+
export type AnnotationEventCallback = (
|
|
224
|
+
event: AnnotationEventName | string,
|
|
225
|
+
payload?: AnnotationEventPayload,
|
|
226
|
+
) => void;
|
|
127
227
|
|
|
128
|
-
|
|
228
|
+
export interface IDigitalAnnotationInfo {
|
|
229
|
+
author: string;
|
|
230
|
+
customData: string;
|
|
231
|
+
digest: string;
|
|
232
|
+
creationDate: Date;
|
|
233
|
+
pageIndex: number;
|
|
234
|
+
pageX: number;
|
|
235
|
+
pageY: number;
|
|
236
|
+
}
|
|
129
237
|
|
|
130
|
-
|
|
238
|
+
export interface ITextAnnotationInfo {
|
|
239
|
+
content: string;
|
|
240
|
+
pageIndex: number;
|
|
241
|
+
x: number;
|
|
242
|
+
y: number;
|
|
243
|
+
width: number;
|
|
244
|
+
height: number;
|
|
245
|
+
}
|
|
131
246
|
|
|
132
|
-
|
|
247
|
+
export type AnnotationHistoryCommandResult = boolean | Promise<boolean>;
|
|
133
248
|
|
|
134
|
-
|
|
249
|
+
export interface AnnotationTool {
|
|
250
|
+
openAnnotationView(options?: LegacyAnnotationViewOptions): void;
|
|
135
251
|
|
|
136
|
-
|
|
252
|
+
closeAnnotationView(): void;
|
|
137
253
|
|
|
138
254
|
saveAnnotations(saveCallback?: () => void): void;
|
|
139
255
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
clearAnnotations(): void;
|
|
256
|
+
clearAnnotations(): AnnotationHistoryCommandResult;
|
|
143
257
|
|
|
144
|
-
|
|
258
|
+
undoAnnotation(): AnnotationHistoryCommandResult;
|
|
145
259
|
|
|
146
|
-
|
|
260
|
+
redoAnnotation(): AnnotationHistoryCommandResult;
|
|
147
261
|
|
|
148
|
-
|
|
262
|
+
canUndoAnnotation(): AnnotationHistoryCommandResult;
|
|
149
263
|
|
|
150
|
-
|
|
264
|
+
canRedoAnnotation(): AnnotationHistoryCommandResult;
|
|
151
265
|
|
|
152
|
-
|
|
266
|
+
selectAnnotationTool(tool: AnnotationMode, options?: AnnotationToolSelectOptions): void;
|
|
153
267
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
appendAnnotations(inkData: Blob, callback?: (event: { error: string } | 'ok') => void): void;
|
|
157
|
-
|
|
158
|
-
batchAppendAnnotations(inkData: Blob[], callback?: (event: { error: string } | 'ok') => void): void;
|
|
268
|
+
selectAnnotationStamp(stamp: AnnotationStampOptions): void;
|
|
159
269
|
|
|
160
270
|
setAnnotationPenColor(hexColor: string): void;
|
|
161
271
|
|
|
162
272
|
setAnnotationPenWidth(penWidth: number): void;
|
|
163
273
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
enableAnnotationsInfoView(enabled: boolean): void;
|
|
167
|
-
|
|
168
|
-
enableAnnotationsDeletion(enabled: boolean): void;
|
|
169
|
-
|
|
170
|
-
enableAnnotationsDeletionOnlyByAuthor(onlyByAuthor: boolean): void;
|
|
171
|
-
|
|
172
|
-
listDigitalStamps(): void;
|
|
274
|
+
setAnnotationPenStyle(options: AnnotationPenStyleOptions): void;
|
|
173
275
|
|
|
174
276
|
isInAnnotationMode(): boolean;
|
|
175
277
|
|
|
176
|
-
|
|
278
|
+
getAnnotationMode(): AnnotationMode;
|
|
177
279
|
|
|
178
|
-
getAnnotations():
|
|
280
|
+
getAnnotations(): AnnotationRecord[];
|
|
179
281
|
|
|
180
282
|
getAnnotationsCount(): number;
|
|
181
283
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
deleteAnnotationsBy(query?: AnnotationQueryParams, prompt?: boolean): void;
|
|
185
|
-
|
|
186
|
-
deleteAnnotationsById(annotationIds?: string[], prompt?: boolean): void;
|
|
187
|
-
|
|
188
|
-
addDigitalAnnotation(options: void | unknown): void;
|
|
189
|
-
|
|
190
|
-
addInkAnnotationCallback(callback: (event: any) => void): void;
|
|
191
|
-
|
|
192
|
-
addAnnotationEventCallback(callback: (event: string, payload: any) => void): void;
|
|
193
|
-
|
|
194
|
-
addAnnotationPersistCallback(callback: (event: any) => void): void;
|
|
195
|
-
|
|
196
|
-
addAnnotationRetrieveCallback(callback: (event: any) => void): void;
|
|
197
|
-
|
|
198
|
-
addDigitalAnnotationRetrieveCallback(callback: (annotations: IDigitalAnnotationInfo[]) => void): void;
|
|
284
|
+
addAnnotationEventCallback(callback: AnnotationEventCallback): void;
|
|
199
285
|
}
|
package/src/api/callbacks.ts
CHANGED
|
@@ -1,20 +1,63 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type AnnotationEventCallback,
|
|
3
|
+
type AnnotationEventName,
|
|
4
|
+
type AnnotationEventPayload,
|
|
5
|
+
IDigitalAnnotationInfo,
|
|
6
|
+
ITextAnnotationInfo,
|
|
7
|
+
} from './annotation-tool';
|
|
8
|
+
|
|
9
|
+
export type { AnnotationEventCallback, AnnotationEventName, AnnotationEventPayload };
|
|
2
10
|
|
|
3
11
|
export type ReaderReadyCallback = () => void;
|
|
4
12
|
export type ReaderUnloadCallback = () => void;
|
|
5
13
|
|
|
6
|
-
export
|
|
14
|
+
export interface DocumentReaderStatus {
|
|
15
|
+
currentPage?: number;
|
|
16
|
+
documentType?: string;
|
|
17
|
+
totalPages?: number;
|
|
18
|
+
zoomLevel?: number;
|
|
19
|
+
}
|
|
7
20
|
|
|
8
|
-
export
|
|
21
|
+
export interface DocumentOpenResult {
|
|
22
|
+
error?: string;
|
|
23
|
+
state?: DocumentReaderStatus;
|
|
24
|
+
status?: string;
|
|
25
|
+
success: boolean;
|
|
26
|
+
}
|
|
9
27
|
|
|
10
|
-
export
|
|
28
|
+
export interface DocumentSaveResult extends Record<string, unknown> {
|
|
29
|
+
error?: string;
|
|
30
|
+
savedContentType?: string;
|
|
31
|
+
success: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DocumentContentResult {
|
|
35
|
+
fileBuffer?: ArrayBuffer;
|
|
36
|
+
fileCacheId?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DocumentCloseResult {
|
|
40
|
+
closed: boolean;
|
|
41
|
+
error?: string;
|
|
42
|
+
success: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type DocumentOpenedCallback = (
|
|
46
|
+
status: string,
|
|
47
|
+
error?: string,
|
|
48
|
+
docInfo?: DocumentOpenResult,
|
|
49
|
+
) => void;
|
|
50
|
+
|
|
51
|
+
export type DocumentSavedCallback = (response?: DocumentSaveResult) => void;
|
|
52
|
+
|
|
53
|
+
export type DocumentModifiedCallback = (documentInfo: DocumentOpenResult) => boolean;
|
|
11
54
|
|
|
12
55
|
export interface IDocumentCloseEvent {
|
|
13
56
|
docId: string;
|
|
14
57
|
docTitle: string;
|
|
15
58
|
}
|
|
16
59
|
|
|
17
|
-
export type DocumentClosedCallback = (payload?:
|
|
60
|
+
export type DocumentClosedCallback = (payload?: DocumentCloseResult) => void;
|
|
18
61
|
|
|
19
62
|
export type PageChangeCallback = (pageIndex: number, pageCount: number) => void;
|
|
20
63
|
|
|
@@ -26,8 +69,6 @@ export type PageModeChangeCallback = (pageMode: number) => void;
|
|
|
26
69
|
|
|
27
70
|
export type AnnotationSaveCallback = () => void;
|
|
28
71
|
|
|
29
|
-
export type AnnotationEventCallback = (event: string, payload: any) => void;
|
|
30
|
-
|
|
31
72
|
export type DigitalSignCallback = (response: any) => void;
|
|
32
73
|
|
|
33
74
|
export type DigitalAnnotationRetrieveCallback = (
|
package/src/api/document-sdk.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ReaderReadyCallback, ReaderUnloadCallback } from './callbacks';
|
|
|
3
3
|
import { DocumentTool } from './document-tool';
|
|
4
4
|
import { AnnotationTool } from './annotation-tool';
|
|
5
5
|
import { UITool } from './ui-tool';
|
|
6
|
+
import { PageArrangeTool } from './page-arrange-tool';
|
|
6
7
|
import { PageTool } from './page-tool';
|
|
7
8
|
import { FindTool } from './find-tool';
|
|
8
9
|
import { DigitalSignTool } from './sign-tool';
|
|
@@ -12,6 +13,7 @@ import { SymbologyTool } from './symbology-tool';
|
|
|
12
13
|
import { TemplateSignTool } from './template-sign';
|
|
13
14
|
import { PdfFormFiller } from './pdf-formfiller';
|
|
14
15
|
import { CryptoTool } from './crypto-tool';
|
|
16
|
+
import { SecurityTool } from './security-tool';
|
|
15
17
|
|
|
16
18
|
export interface IReaderEmbedOptions {
|
|
17
19
|
debug?: boolean;
|
|
@@ -29,10 +31,6 @@ export interface IReaderEmbedOptions {
|
|
|
29
31
|
* View: 阅读模式,Annotation: 批注模式,DigitalSign: 签章模式
|
|
30
32
|
*/
|
|
31
33
|
viewMode: string;
|
|
32
|
-
/**
|
|
33
|
-
* 签章功能:Server: 服务器签章,Extension: 浏览器控件签章
|
|
34
|
-
*/
|
|
35
|
-
signMode?: 'Extension' | 'Server';
|
|
36
34
|
/**
|
|
37
35
|
* 是否显示菜单
|
|
38
36
|
*/
|
|
@@ -69,12 +67,14 @@ export interface IReaderEmbedOptions {
|
|
|
69
67
|
height?: string;
|
|
70
68
|
}
|
|
71
69
|
|
|
70
|
+
export type ReaderThemeMode = 'light' | 'dark' | 'high-contrast' | 'auto';
|
|
71
|
+
|
|
72
72
|
export interface IDocumentSDK {
|
|
73
73
|
enableDebug(debug: boolean): void;
|
|
74
74
|
|
|
75
75
|
changeLanguage(lang: string): void;
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
setThemeMode(theme: ReaderThemeMode): void;
|
|
78
78
|
|
|
79
79
|
setSessionUser(
|
|
80
80
|
userNameOrInfo:
|
|
@@ -115,6 +115,8 @@ export interface IDocumentSDK {
|
|
|
115
115
|
|
|
116
116
|
getPageTool(): PageTool;
|
|
117
117
|
|
|
118
|
+
getPageArrangeTool(): PageArrangeTool;
|
|
119
|
+
|
|
118
120
|
getFindTool(): FindTool;
|
|
119
121
|
|
|
120
122
|
getSignServerTool(): SignServerTool;
|
|
@@ -133,6 +135,8 @@ export interface IDocumentSDK {
|
|
|
133
135
|
|
|
134
136
|
getCryptoTool(): CryptoTool;
|
|
135
137
|
|
|
138
|
+
getSecurityTool(): SecurityTool;
|
|
139
|
+
|
|
136
140
|
createDigitalSignOptions(): IDigitalSignOptions;
|
|
137
141
|
|
|
138
142
|
createKVField(key: string, value: string, description?: string): IKVField;
|
package/src/api/document-tool.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DocumentClosedCallback,
|
|
3
|
+
DocumentContentResult,
|
|
4
|
+
DocumentOpenedCallback,
|
|
5
|
+
DocumentOpenResult,
|
|
6
|
+
DocumentSavedCallback,
|
|
7
|
+
} from './callbacks';
|
|
2
8
|
|
|
3
9
|
export type IFileSaveFormat = 'pdf' | 'png' | 'jpeg' | 'jpg' | 'tiff';
|
|
4
10
|
|
|
@@ -50,26 +56,34 @@ export interface IFileSaveResult {
|
|
|
50
56
|
error?: string;
|
|
51
57
|
}
|
|
52
58
|
|
|
59
|
+
export interface DocumentCreatePreviewOptions extends Record<string, unknown> {
|
|
60
|
+
fileId?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type DocumentOpenCallback = (event: DocumentOpenResult) => void;
|
|
64
|
+
|
|
65
|
+
export type DocumentContentCallback = (result: DocumentContentResult) => void;
|
|
66
|
+
|
|
53
67
|
export interface DocumentTool {
|
|
54
|
-
addDocumentOpenedCallback(callback:
|
|
68
|
+
addDocumentOpenedCallback(callback: DocumentOpenedCallback): void;
|
|
55
69
|
|
|
56
70
|
addDocumentSavedCallback(callback: DocumentSavedCallback): void;
|
|
57
71
|
|
|
58
72
|
addDocumentClosedCallback(callback: DocumentClosedCallback): void;
|
|
59
73
|
|
|
60
|
-
openPDFDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
74
|
+
openPDFDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
61
75
|
|
|
62
|
-
openPdfDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
76
|
+
openPdfDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
63
77
|
|
|
64
|
-
openOFDDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
78
|
+
openOFDDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
65
79
|
|
|
66
|
-
openOfdDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
80
|
+
openOfdDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
67
81
|
|
|
68
|
-
openOfficeDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
82
|
+
openOfficeDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
69
83
|
|
|
70
|
-
openImageDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
84
|
+
openImageDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
71
85
|
|
|
72
|
-
openTextDocument(options: IFileOpenOptions, onDocumentOpened?:
|
|
86
|
+
openTextDocument(options: IFileOpenOptions, onDocumentOpened?: DocumentOpenCallback): void;
|
|
73
87
|
|
|
74
88
|
openFromLocalStorage(): void;
|
|
75
89
|
|
|
@@ -83,9 +97,7 @@ export interface DocumentTool {
|
|
|
83
97
|
|
|
84
98
|
saveAs(options?: IFileSaveOptions): Promise<IFileSaveResult>;
|
|
85
99
|
|
|
86
|
-
getDocumentContent(
|
|
87
|
-
onDocumentContent?: (fileCacheId?: string, fileBuffer?: ArrayBuffer) => void,
|
|
88
|
-
): void;
|
|
100
|
+
getDocumentContent(onDocumentContent?: DocumentContentCallback): void;
|
|
89
101
|
|
|
90
102
|
closeDocument(
|
|
91
103
|
discardModify: boolean,
|
|
@@ -102,5 +114,5 @@ export interface DocumentTool {
|
|
|
102
114
|
|
|
103
115
|
print(): void;
|
|
104
116
|
|
|
105
|
-
createPreview(serverUrl: string, options:
|
|
117
|
+
createPreview(serverUrl: string, options: DocumentCreatePreviewOptions): void;
|
|
106
118
|
}
|
|
@@ -10,8 +10,17 @@ export interface RibbonMenuItemVisibility {
|
|
|
10
10
|
[propName: string]: ViewVisibility;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export interface
|
|
13
|
+
export interface RibbonMenuButtonContentStyle {
|
|
14
14
|
type: 'Icon' | 'Label' | 'ToolTip';
|
|
15
15
|
content: string;
|
|
16
16
|
iconContentType?: 'application/svg' | 'url';
|
|
17
|
+
showLabel?: boolean;
|
|
17
18
|
}
|
|
19
|
+
|
|
20
|
+
export interface RibbonMenuButtonLabelVisibilityStyle {
|
|
21
|
+
showLabel: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type MenuActionButtonStyle =
|
|
25
|
+
| RibbonMenuButtonContentStyle
|
|
26
|
+
| RibbonMenuButtonLabelVisibilityStyle;
|