@yudaocode/univer-docs 0.0.0-stage → 1.6.204
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/LICENSE +190 -0
- package/README.md +24 -2
- package/lib/cjs/facade/index.js +1842 -0
- package/lib/cjs/facade/index.js.map +1 -0
- package/lib/cjs/index.js +31844 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/es/facade/index.js +2020 -0
- package/lib/es/facade/index.js.map +1 -0
- package/lib/es/index.js +31503 -0
- package/lib/es/index.js.map +1 -0
- package/lib/types/facade/index.d.ts +364 -0
- package/lib/types/index.d.ts +3687 -0
- package/package.json +61 -3
|
@@ -0,0 +1,3687 @@
|
|
|
1
|
+
import * as _univerjs_core from '@univerjs/core';
|
|
2
|
+
import { ISdtListItem, ICommand, IMutation, IAccessor, DocumentDataModel, IDocumentData, IDocumentBody, ITextStyle, Disposable, IDisposable, Plugin, Injector, IUniverInstanceService, ICommandService, IParagraph, ISdtRangeProperties, ICustomRange, ITableRow } from '@univerjs/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
declare const YUDAO_DOCS_TEMPLATE_RESOURCE = "YUDAO_DOCS_TEMPLATE_RESOURCE";
|
|
6
|
+
/**
|
|
7
|
+
* Document working mode:
|
|
8
|
+
* - `design`: full template authoring (edit body, insert/delete SDT controls, bind datasets & row loops)
|
|
9
|
+
* - `form`: interactive form filling (fill unlocked SDT controls & text)
|
|
10
|
+
* - `view`: strict read-only preview (typing, pasting, deleting, undo/redo, and SDT popups all disabled)
|
|
11
|
+
*/
|
|
12
|
+
type DocWorkMode = 'design' | 'form' | 'view';
|
|
13
|
+
type DocEmptyRowStrategy = 'keep-blank' | 'remove' | 'placeholder';
|
|
14
|
+
/**
|
|
15
|
+
* Structured Document Tag (SDT) control types aligned with `@univerjs/core` `ISdtCustomRange`
|
|
16
|
+
* and structured enterprise form, contract, and clinical EMR control capabilities.
|
|
17
|
+
*/
|
|
18
|
+
type DocSdtControlKind = 'text' | 'richText' | 'date' | 'dateRange' | 'dropDownList' | 'comboBox' | 'checkbox' | 'radio' | 'multiSelect' | 'cascader' | 'number' | 'repeatingSection' | 'picture' | 'group' | 'signature';
|
|
19
|
+
type DocSdtKind = DocSdtControlKind;
|
|
20
|
+
type DocSdtType = DocSdtControlKind;
|
|
21
|
+
type DocUnderlineStyle = 'single' | 'double' | 'dashed' | 'dotted' | 'wave';
|
|
22
|
+
interface IDocSdtOptionItem {
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
interface IDocCascaderNode {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
children?: IDocCascaderNode[];
|
|
30
|
+
}
|
|
31
|
+
type DocSdtLockPolicy = 'unlocked' | 'sdtLocked' | 'contentLocked' | 'sdtContentLocked';
|
|
32
|
+
/**
|
|
33
|
+
* Visual chrome rendering mode for SDT controls (Chinese contract & clinical form style):
|
|
34
|
+
* - `'highlight'`: colored background box (default)
|
|
35
|
+
* - `'underline'`: classic Chinese contract fill-in-the-blank bottom border `_______` without colored background box
|
|
36
|
+
* - `'brackets'`: wraps display text with `prefix` / `postfix` (e.g. `【...】` or `{...}`) without background fill
|
|
37
|
+
* - `'clean'`: hides control chrome on print/export
|
|
38
|
+
*/
|
|
39
|
+
type DocSdtVisualChrome = 'highlight' | 'underline' | 'brackets' | 'clean';
|
|
40
|
+
/**
|
|
41
|
+
* Built-in Chinese & standard format validator presets enforced during `validateDocForm`.
|
|
42
|
+
*/
|
|
43
|
+
type DocSdtValidatorPreset = 'idCard' | 'mobile' | 'creditCode' | 'email' | 'postalCode' | 'regex';
|
|
44
|
+
/**
|
|
45
|
+
* Automatic risk/alert keyword highlighting rule.
|
|
46
|
+
* Example: highlight red `#fee2e2` when a contract clause contains `"违约"` / `"无限连带"`, or EMR contains `"危急"` / `"阳性"`.
|
|
47
|
+
*/
|
|
48
|
+
interface IDocSdtHighlightRule {
|
|
49
|
+
keyword: string;
|
|
50
|
+
backgroundColor?: string;
|
|
51
|
+
textColor?: string;
|
|
52
|
+
level?: 'warning' | 'danger';
|
|
53
|
+
message?: string;
|
|
54
|
+
}
|
|
55
|
+
interface IDocSdtControlSpec {
|
|
56
|
+
id: string;
|
|
57
|
+
kind: DocSdtControlKind;
|
|
58
|
+
alias: string;
|
|
59
|
+
tag: string;
|
|
60
|
+
/** Shared semantic concept identifier for group-level cascade rules */
|
|
61
|
+
conceptId?: string;
|
|
62
|
+
/** Whether the control shell is allowed to be deleted (`false` blocks deletion unless forced) */
|
|
63
|
+
deletable?: boolean;
|
|
64
|
+
/** Multi-level hierarchical options tree when `kind === 'cascader'` */
|
|
65
|
+
cascaderOptions?: IDocCascaderNode[];
|
|
66
|
+
/** Path separator when `kind === 'cascader'` (default `' / '`) */
|
|
67
|
+
cascaderSeparator?: string;
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
bindingPath?: string;
|
|
70
|
+
required?: boolean;
|
|
71
|
+
lock: DocSdtLockPolicy;
|
|
72
|
+
checked?: boolean;
|
|
73
|
+
dateFormat?: string;
|
|
74
|
+
listItems?: ISdtListItem[];
|
|
75
|
+
/** Risk keyword auto-alert highlight rules */
|
|
76
|
+
highlightRules?: IDocSdtHighlightRule[];
|
|
77
|
+
/** Conditional visibility expression evaluated during dataset fill or live SDT edits, e.g. `payMode==stage` or `amount>50000` */
|
|
78
|
+
visibleIf?: string;
|
|
79
|
+
/** Cross-control reactive formula expression, e.g. `=price * qty`, `=CNMONEY(totalAmount)`, `=ROUND(amount * 0.13, 2)` */
|
|
80
|
+
computedExpr?: string;
|
|
81
|
+
/** Minimum value when `kind === 'number'` */
|
|
82
|
+
min?: number;
|
|
83
|
+
/** Maximum value when `kind === 'number'` */
|
|
84
|
+
max?: number;
|
|
85
|
+
/** Zone protection tag */
|
|
86
|
+
zoneLock?: 'editableZone' | 'lockedZone';
|
|
87
|
+
/** Visual chrome rendering mode (`highlight | underline | brackets | clean`) */
|
|
88
|
+
visualChrome?: DocSdtVisualChrome;
|
|
89
|
+
/** Optional prefix prepended to control display text (e.g. `¥` or `【`) */
|
|
90
|
+
prefix?: string;
|
|
91
|
+
/** Optional postfix appended to control display text (e.g. `元` or `】`) */
|
|
92
|
+
postfix?: string;
|
|
93
|
+
/** Built-in format validator preset (`idCard | mobile | creditCode | email | postalCode | regex`) */
|
|
94
|
+
validatorPreset?: DocSdtValidatorPreset;
|
|
95
|
+
/** Custom regular expression pattern when `validatorPreset === 'regex'` or custom regex validation is needed */
|
|
96
|
+
validatorPattern?: string;
|
|
97
|
+
/** Custom validation failure message */
|
|
98
|
+
validatorMessage?: string;
|
|
99
|
+
/** Multi-party co-signing allowed role IDs (e.g. `['partyA']` vs `['partyB']` vs `['lawyer']`) */
|
|
100
|
+
editableRoles?: string[];
|
|
101
|
+
/** Repeating section item template text when `kind === 'repeatingSection'` (supports `${field}` and `#{#list.field}`) */
|
|
102
|
+
templateText?: string;
|
|
103
|
+
/** Multi-option checkbox mark symbol ('check' or 'cross') */
|
|
104
|
+
checkboxMarkType?: 'check' | 'cross';
|
|
105
|
+
/** Option layout direction for multi-option `checkbox` / `radio` */
|
|
106
|
+
layoutDirection?: 'row' | 'column';
|
|
107
|
+
/** Concise `{ label, value }` option items (normalized alongside `listItems`) */
|
|
108
|
+
options?: IDocSdtOptionItem[];
|
|
109
|
+
/** Conditional prefix rendered ONLY when control value is non-empty */
|
|
110
|
+
preText?: string;
|
|
111
|
+
/** Conditional postfix rendered ONLY when control value is non-empty */
|
|
112
|
+
postText?: string;
|
|
113
|
+
/** Minimum blank underline width in points when empty */
|
|
114
|
+
minWidthPt?: number;
|
|
115
|
+
/** Pad blank underline to `minWidthPt` when empty */
|
|
116
|
+
underlineBlank?: boolean;
|
|
117
|
+
/** Block clipboard paste into this control */
|
|
118
|
+
pasteDisabled?: boolean;
|
|
119
|
+
/** Tooltip / helper hint displayed in popup & inspector */
|
|
120
|
+
hint?: string;
|
|
121
|
+
/** Enable inline arithmetic calculator keypad in canvas popup */
|
|
122
|
+
calculatorEnabled?: boolean;
|
|
123
|
+
/** String length bounds */
|
|
124
|
+
minLength?: number;
|
|
125
|
+
maxLength?: number;
|
|
126
|
+
/** Numeric integer & decimal precision rules */
|
|
127
|
+
integer?: boolean;
|
|
128
|
+
precision?: number;
|
|
129
|
+
/** ISO date bounds (`YYYY-MM-DD`) */
|
|
130
|
+
minDate?: string;
|
|
131
|
+
maxDate?: string;
|
|
132
|
+
/** Multi-option checked count bounds */
|
|
133
|
+
minChecked?: number;
|
|
134
|
+
maxChecked?: number;
|
|
135
|
+
/** Optional display dimensions in points for `'picture'` / `'signature'` controls */
|
|
136
|
+
widthPt?: number;
|
|
137
|
+
heightPt?: number;
|
|
138
|
+
/** Highlight flag applied by `HighlightInvalidDocSdtCommand` */
|
|
139
|
+
invalidHighlight?: boolean;
|
|
140
|
+
}
|
|
141
|
+
type IDocSdtControlMeta = IDocSdtControlSpec;
|
|
142
|
+
type IDocInsertSdtSpec = Partial<IDocSdtControlSpec> & {
|
|
143
|
+
alias: string;
|
|
144
|
+
};
|
|
145
|
+
interface IDocResolvedSdtControl extends IDocSdtControlSpec {
|
|
146
|
+
startIndex: number;
|
|
147
|
+
endIndex: number;
|
|
148
|
+
displayText: string;
|
|
149
|
+
value: string | boolean;
|
|
150
|
+
showingPlaceholder: boolean;
|
|
151
|
+
matchedHighlight?: IDocSdtHighlightRule;
|
|
152
|
+
/** Header or footer story `segmentId` (`undefined` when in main `body`) */
|
|
153
|
+
segmentId?: string;
|
|
154
|
+
}
|
|
155
|
+
interface IDocFormValidationIssue {
|
|
156
|
+
controlId: string;
|
|
157
|
+
alias: string;
|
|
158
|
+
tag: string;
|
|
159
|
+
message: string;
|
|
160
|
+
}
|
|
161
|
+
interface IDocRiskAlertItem {
|
|
162
|
+
controlId: string;
|
|
163
|
+
alias: string;
|
|
164
|
+
tag: string;
|
|
165
|
+
keyword: string;
|
|
166
|
+
level: 'warning' | 'danger';
|
|
167
|
+
message: string;
|
|
168
|
+
value: string;
|
|
169
|
+
}
|
|
170
|
+
interface IDocFormValidationResult {
|
|
171
|
+
valid: boolean;
|
|
172
|
+
issues: IDocFormValidationIssue[];
|
|
173
|
+
riskAlerts: IDocRiskAlertItem[];
|
|
174
|
+
values: Record<string, string | boolean>;
|
|
175
|
+
}
|
|
176
|
+
interface IDocCatalogItem {
|
|
177
|
+
id?: string;
|
|
178
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
179
|
+
title: string;
|
|
180
|
+
startIndex: number;
|
|
181
|
+
endIndex: number;
|
|
182
|
+
paragraphId?: string;
|
|
183
|
+
pageNo?: number;
|
|
184
|
+
subCatalog?: IDocCatalogItem[];
|
|
185
|
+
}
|
|
186
|
+
interface IDocVersionSnapshot {
|
|
187
|
+
id: string;
|
|
188
|
+
unitId: string;
|
|
189
|
+
label: string;
|
|
190
|
+
createdAt: string;
|
|
191
|
+
summary?: string;
|
|
192
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
193
|
+
}
|
|
194
|
+
interface IDocDatasetField {
|
|
195
|
+
key: string;
|
|
196
|
+
label: string;
|
|
197
|
+
kind?: DocSdtControlKind;
|
|
198
|
+
sampleValue?: string | boolean;
|
|
199
|
+
options?: ISdtListItem[];
|
|
200
|
+
}
|
|
201
|
+
interface IDocDatasetGroup {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
fields: IDocDatasetField[];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Row-level detail table loop configuration persisted inside `IDocumentData.resources`.
|
|
208
|
+
*/
|
|
209
|
+
interface IDocTableRowLoopConfig {
|
|
210
|
+
tableId: string;
|
|
211
|
+
rowIndex: number;
|
|
212
|
+
/** Dataset list/set key, e.g. `items` or `销售明细` */
|
|
213
|
+
listKey: string;
|
|
214
|
+
/** Repeat row 0 across page breaks (`w:tblHeader`). Default: `true` */
|
|
215
|
+
repeatHeaderRow?: boolean;
|
|
216
|
+
/** Strategy when `data[listKey]` has 0 items. Default: `'keep-blank'` */
|
|
217
|
+
emptyStrategy?: DocEmptyRowStrategy;
|
|
218
|
+
/** Text displayed in cell 0 when `emptyStrategy === 'placeholder'` */
|
|
219
|
+
emptyPlaceholderText?: string;
|
|
220
|
+
}
|
|
221
|
+
interface IDocTableRowSummary {
|
|
222
|
+
rowIndex: number;
|
|
223
|
+
cellTexts: string[];
|
|
224
|
+
loopConfig?: IDocTableRowLoopConfig;
|
|
225
|
+
}
|
|
226
|
+
interface IDocTableSummary {
|
|
227
|
+
tableId: string;
|
|
228
|
+
startIndex: number;
|
|
229
|
+
endIndex: number;
|
|
230
|
+
rowCount: number;
|
|
231
|
+
colCount: number;
|
|
232
|
+
repeatHeaderRow: boolean;
|
|
233
|
+
headerRowCount?: number;
|
|
234
|
+
rows: IDocTableRowSummary[];
|
|
235
|
+
}
|
|
236
|
+
type DocTrackRevisionType = 'insert' | 'delete';
|
|
237
|
+
type DocTrackRevisionStatus = 'pending' | 'accepted' | 'rejected';
|
|
238
|
+
interface IDocTrackRevision {
|
|
239
|
+
id: string;
|
|
240
|
+
type: DocTrackRevisionType;
|
|
241
|
+
author: string;
|
|
242
|
+
createdAt: string;
|
|
243
|
+
/** Inclusive start index in `body.dataStream` */
|
|
244
|
+
startIndex: number;
|
|
245
|
+
/** Exclusive end index in `body.dataStream` (`startIndex + text.length`) */
|
|
246
|
+
endIndex: number;
|
|
247
|
+
text: string;
|
|
248
|
+
status: DocTrackRevisionStatus;
|
|
249
|
+
}
|
|
250
|
+
interface IDocVisibilityClause {
|
|
251
|
+
id: string;
|
|
252
|
+
visibleIf: string;
|
|
253
|
+
/** Optional linked SDT control ID when the conditional clause is an SDT control */
|
|
254
|
+
controlId?: string;
|
|
255
|
+
/** Original template text/paragraph backup used to restore hidden clauses when `visibleIf` becomes true again */
|
|
256
|
+
cachedTemplateText: string;
|
|
257
|
+
/** Optional backed-up SDT spec when restoring a hidden SDT clause */
|
|
258
|
+
cachedSdtSpec?: IDocSdtControlSpec;
|
|
259
|
+
/** Optional backed-up SDT value when restoring a hidden SDT clause */
|
|
260
|
+
cachedSdtValue?: string | boolean;
|
|
261
|
+
/** Character offset anchor in `body.dataStream` where the clause resides / should be restored */
|
|
262
|
+
anchorOffset?: number;
|
|
263
|
+
/** Optional preceding SDT control ID for relative restoration ordering */
|
|
264
|
+
afterControlId?: string;
|
|
265
|
+
/** Whether the clause is currently visible in the document body */
|
|
266
|
+
currentlyVisible?: boolean;
|
|
267
|
+
}
|
|
268
|
+
type DocAiRiskSeverity = 'high' | 'medium' | 'low';
|
|
269
|
+
interface IDocAiRiskFinding {
|
|
270
|
+
id?: string;
|
|
271
|
+
severity: DocAiRiskSeverity;
|
|
272
|
+
clauseTitle: string;
|
|
273
|
+
excerpt: string;
|
|
274
|
+
suggestion: string;
|
|
275
|
+
category?: 'unilateral_termination' | 'unlimited_liability' | 'missing_jurisdiction' | 'excessive_penalty' | 'blank_required_sdt' | 'custom';
|
|
276
|
+
}
|
|
277
|
+
interface IDocAiCopilotContext {
|
|
278
|
+
unitId: string;
|
|
279
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
280
|
+
formValues: Record<string, string | boolean>;
|
|
281
|
+
defaultAudit: () => IDocAiRiskFinding[];
|
|
282
|
+
defaultDraft: (prompt: string) => string;
|
|
283
|
+
}
|
|
284
|
+
interface IDocAiCopilotAdapter {
|
|
285
|
+
name?: string;
|
|
286
|
+
auditContract?: (text: string, ctx: IDocAiCopilotContext) => Promise<IDocAiRiskFinding[]>;
|
|
287
|
+
draftClause?: (prompt: string, ctx: IDocAiCopilotContext) => Promise<string>;
|
|
288
|
+
}
|
|
289
|
+
type DocMedicalFormulaKind = 'dentalQuadrant' | 'menstrualHistory' | 'pupilLightReflex' | 'visualAcuity' | 'mathFraction';
|
|
290
|
+
interface IDocMedicalFormulaSpec {
|
|
291
|
+
id?: string;
|
|
292
|
+
kind: DocMedicalFormulaKind;
|
|
293
|
+
upperLeft?: string;
|
|
294
|
+
upperRight?: string;
|
|
295
|
+
lowerLeft?: string;
|
|
296
|
+
lowerRight?: string;
|
|
297
|
+
menarcheAge?: string | number;
|
|
298
|
+
durationDays?: string | number;
|
|
299
|
+
cycleDays?: string | number;
|
|
300
|
+
lastPeriodOrMenopause?: string | number;
|
|
301
|
+
rightEye?: string;
|
|
302
|
+
leftEye?: string;
|
|
303
|
+
od?: string;
|
|
304
|
+
os?: string;
|
|
305
|
+
intraocularPressureRight?: string;
|
|
306
|
+
intraocularPressureLeft?: string;
|
|
307
|
+
lightReflexRight?: string;
|
|
308
|
+
lightReflexLeft?: string;
|
|
309
|
+
numerator?: string;
|
|
310
|
+
denominator?: string;
|
|
311
|
+
prefix?: string;
|
|
312
|
+
superscript?: string;
|
|
313
|
+
subscript?: string;
|
|
314
|
+
/** Optional accent stroke/text color (hex) */
|
|
315
|
+
color?: string;
|
|
316
|
+
}
|
|
317
|
+
interface IDocEmbeddedMedicalFormulaEntry {
|
|
318
|
+
blockId: string;
|
|
319
|
+
spec: IDocMedicalFormulaSpec;
|
|
320
|
+
widthPt: number;
|
|
321
|
+
heightPt: number;
|
|
322
|
+
plainSummary: string;
|
|
323
|
+
}
|
|
324
|
+
interface IDocCodeBlockSpec {
|
|
325
|
+
id?: string;
|
|
326
|
+
code: string;
|
|
327
|
+
language?: string;
|
|
328
|
+
}
|
|
329
|
+
interface IDocEmbeddedCodeBlockEntry {
|
|
330
|
+
id: string;
|
|
331
|
+
language: string;
|
|
332
|
+
code: string;
|
|
333
|
+
startIndex: number;
|
|
334
|
+
endIndex: number;
|
|
335
|
+
}
|
|
336
|
+
type DocBarcodeBlockKind = 'qrcode' | 'barcode';
|
|
337
|
+
interface IDocBarcodeBlockSpec {
|
|
338
|
+
id?: string;
|
|
339
|
+
kind: DocBarcodeBlockKind;
|
|
340
|
+
/** Static content text when no dataset binding expression resolves */
|
|
341
|
+
value?: string;
|
|
342
|
+
/** Optional dataset binding path or `${field}` expression (e.g. `contractNo` or `${contract.url}`) */
|
|
343
|
+
bindingPath?: string;
|
|
344
|
+
/** Optional caption shown underneath barcode/QR */
|
|
345
|
+
label?: string;
|
|
346
|
+
widthPt?: number;
|
|
347
|
+
heightPt?: number;
|
|
348
|
+
}
|
|
349
|
+
interface IDocEmbeddedBarcodeEntry {
|
|
350
|
+
blockId: string;
|
|
351
|
+
spec: IDocBarcodeBlockSpec;
|
|
352
|
+
widthPt: number;
|
|
353
|
+
heightPt: number;
|
|
354
|
+
}
|
|
355
|
+
interface IDocDocumentStats {
|
|
356
|
+
charCount: number;
|
|
357
|
+
nonWhitespaceCharCount: number;
|
|
358
|
+
cjkCharCount: number;
|
|
359
|
+
wordCount: number;
|
|
360
|
+
paragraphCount: number;
|
|
361
|
+
tableCount: number;
|
|
362
|
+
sdtTotalCount: number;
|
|
363
|
+
sdtRequiredCount: number;
|
|
364
|
+
sdtFilledRequiredCount: number;
|
|
365
|
+
completionRate: number;
|
|
366
|
+
}
|
|
367
|
+
interface IDocFieldDiffItem {
|
|
368
|
+
key: string;
|
|
369
|
+
alias: string;
|
|
370
|
+
beforeValue: string | boolean | undefined;
|
|
371
|
+
afterValue: string | boolean | undefined;
|
|
372
|
+
}
|
|
373
|
+
interface IDocSnapshotDiffResult {
|
|
374
|
+
fieldDiffs: IDocFieldDiffItem[];
|
|
375
|
+
textChanged: boolean;
|
|
376
|
+
addedLength: number;
|
|
377
|
+
removedLength: number;
|
|
378
|
+
}
|
|
379
|
+
type DocCalloutPreset = 'info' | 'warning' | 'success' | 'danger' | 'neutral';
|
|
380
|
+
interface IDocCalloutBlock {
|
|
381
|
+
id: string;
|
|
382
|
+
preset: DocCalloutPreset;
|
|
383
|
+
title?: string;
|
|
384
|
+
text: string;
|
|
385
|
+
backgroundColor?: string;
|
|
386
|
+
borderColor?: string;
|
|
387
|
+
textColor?: string;
|
|
388
|
+
startIndex?: number;
|
|
389
|
+
endIndex?: number;
|
|
390
|
+
}
|
|
391
|
+
type IDocInsertCalloutSpec = Omit<IDocCalloutBlock, 'id' | 'preset'> & {
|
|
392
|
+
id?: string;
|
|
393
|
+
preset?: DocCalloutPreset;
|
|
394
|
+
};
|
|
395
|
+
interface IDocQuoteBlock {
|
|
396
|
+
id: string;
|
|
397
|
+
text: string;
|
|
398
|
+
citation?: string;
|
|
399
|
+
lineColor?: string;
|
|
400
|
+
textColor?: string;
|
|
401
|
+
startIndex?: number;
|
|
402
|
+
endIndex?: number;
|
|
403
|
+
}
|
|
404
|
+
type IDocInsertQuoteSpec = Omit<IDocQuoteBlock, 'id'> & {
|
|
405
|
+
id?: string;
|
|
406
|
+
};
|
|
407
|
+
interface IDocLatexFormulaSpec {
|
|
408
|
+
id: string;
|
|
409
|
+
latex: string;
|
|
410
|
+
displayMode?: boolean;
|
|
411
|
+
fontSize?: number;
|
|
412
|
+
color?: string;
|
|
413
|
+
widthPt?: number;
|
|
414
|
+
heightPt?: number;
|
|
415
|
+
}
|
|
416
|
+
interface IDocInsertLatexFormulaSpec {
|
|
417
|
+
id?: string;
|
|
418
|
+
latex: string;
|
|
419
|
+
displayMode?: boolean;
|
|
420
|
+
fontSize?: number;
|
|
421
|
+
color?: string;
|
|
422
|
+
}
|
|
423
|
+
interface IDocLatexRenderOptions {
|
|
424
|
+
displayMode?: boolean;
|
|
425
|
+
fontSize?: number;
|
|
426
|
+
color?: string;
|
|
427
|
+
}
|
|
428
|
+
interface IDocLatexRenderResult {
|
|
429
|
+
svg: string;
|
|
430
|
+
dataUri: string;
|
|
431
|
+
widthPt: number;
|
|
432
|
+
heightPt: number;
|
|
433
|
+
plainSummary: string;
|
|
434
|
+
}
|
|
435
|
+
type DocInlineFormulaFormat = 'number' | 'currency' | 'percent' | 'cnmoney';
|
|
436
|
+
interface IDocInlineFormula {
|
|
437
|
+
id: string;
|
|
438
|
+
formula: string;
|
|
439
|
+
format?: DocInlineFormulaFormat;
|
|
440
|
+
decimals?: number;
|
|
441
|
+
value?: string;
|
|
442
|
+
startIndex?: number;
|
|
443
|
+
endIndex?: number;
|
|
444
|
+
}
|
|
445
|
+
interface IDocInsertInlineFormulaSpec {
|
|
446
|
+
id?: string;
|
|
447
|
+
formula: string;
|
|
448
|
+
format?: DocInlineFormulaFormat;
|
|
449
|
+
decimals?: number;
|
|
450
|
+
}
|
|
451
|
+
type DocEmbeddedChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'pie' | 'doughnut';
|
|
452
|
+
interface IDocChartSeries {
|
|
453
|
+
name: string;
|
|
454
|
+
values: number[];
|
|
455
|
+
color?: string;
|
|
456
|
+
}
|
|
457
|
+
interface IDocEmbeddedChart {
|
|
458
|
+
id?: string;
|
|
459
|
+
title: string;
|
|
460
|
+
chartType: DocEmbeddedChartType;
|
|
461
|
+
categories: string[];
|
|
462
|
+
series: IDocChartSeries[];
|
|
463
|
+
width?: number;
|
|
464
|
+
height?: number;
|
|
465
|
+
}
|
|
466
|
+
type DocEmbeddedShapeKind = 'rect' | 'roundRect' | 'ellipse' | 'diamond' | 'arrow';
|
|
467
|
+
interface IDocEmbeddedShape {
|
|
468
|
+
id?: string;
|
|
469
|
+
shapeType?: DocEmbeddedShapeKind;
|
|
470
|
+
/** Alias for `shapeType` */
|
|
471
|
+
kind?: DocEmbeddedShapeKind;
|
|
472
|
+
text?: string;
|
|
473
|
+
fillColor?: string;
|
|
474
|
+
strokeColor?: string;
|
|
475
|
+
textColor?: string;
|
|
476
|
+
width?: number;
|
|
477
|
+
height?: number;
|
|
478
|
+
}
|
|
479
|
+
interface IDocRepeatingSectionSpec {
|
|
480
|
+
id?: string;
|
|
481
|
+
alias: string;
|
|
482
|
+
tag?: string;
|
|
483
|
+
bindingPath: string;
|
|
484
|
+
templateText: string;
|
|
485
|
+
emptyText?: string;
|
|
486
|
+
}
|
|
487
|
+
interface IDocBookmark {
|
|
488
|
+
id: string;
|
|
489
|
+
name: string;
|
|
490
|
+
startOffset: number;
|
|
491
|
+
endOffset: number;
|
|
492
|
+
}
|
|
493
|
+
interface IDocInsertBookmarkSpec {
|
|
494
|
+
id?: string;
|
|
495
|
+
name: string;
|
|
496
|
+
startOffset: number;
|
|
497
|
+
endOffset: number;
|
|
498
|
+
}
|
|
499
|
+
interface IDocTableOfContentsSpec {
|
|
500
|
+
title?: string;
|
|
501
|
+
maxLevel?: number;
|
|
502
|
+
showPageNumbers?: boolean;
|
|
503
|
+
rightAlignPageNumbers?: boolean;
|
|
504
|
+
mode?: 'entireTable' | 'pageNumbersOnly';
|
|
505
|
+
}
|
|
506
|
+
interface IDocTableOfContentsEntry {
|
|
507
|
+
id: string;
|
|
508
|
+
title: string;
|
|
509
|
+
maxLevel: number;
|
|
510
|
+
showPageNumbers?: boolean;
|
|
511
|
+
rightAlignPageNumbers?: boolean;
|
|
512
|
+
startIndex: number;
|
|
513
|
+
endIndex: number;
|
|
514
|
+
}
|
|
515
|
+
type DocHorizontalDividerStyle = 'single' | 'double' | 'dashed';
|
|
516
|
+
interface IDocParagraphBorderShadingSpec {
|
|
517
|
+
topBorder?: string;
|
|
518
|
+
bottomBorder?: string;
|
|
519
|
+
leftBorder?: string;
|
|
520
|
+
rightBorder?: string;
|
|
521
|
+
shadingFill?: string;
|
|
522
|
+
paddingPt?: number;
|
|
523
|
+
}
|
|
524
|
+
type DocTabStopAlignment = 'left' | 'center' | 'right' | 'decimal';
|
|
525
|
+
type DocTabStopLeader = 'none' | 'dot' | 'hyphen' | 'underscore';
|
|
526
|
+
interface IDocTabStop {
|
|
527
|
+
positionPt: number;
|
|
528
|
+
alignment: DocTabStopAlignment;
|
|
529
|
+
leader?: DocTabStopLeader;
|
|
530
|
+
}
|
|
531
|
+
interface IDocCollapsedHeadingSlice {
|
|
532
|
+
dataStream: string;
|
|
533
|
+
paragraphs: _univerjs_core.IParagraph[];
|
|
534
|
+
sectionBreaks: _univerjs_core.ISectionBreak[];
|
|
535
|
+
tables: NonNullable<_univerjs_core.IDocumentBody['tables']>;
|
|
536
|
+
customRanges: _univerjs_core.ICustomRange[];
|
|
537
|
+
customBlocks: NonNullable<_univerjs_core.IDocumentBody['customBlocks']>;
|
|
538
|
+
textRuns: _univerjs_core.ITextRun[];
|
|
539
|
+
tableSourceEntries?: Record<string, _univerjs_core.ITable>;
|
|
540
|
+
}
|
|
541
|
+
interface IDocCollapsedHeadingEntry {
|
|
542
|
+
id: string;
|
|
543
|
+
paragraphId: string;
|
|
544
|
+
paragraphIndex: number;
|
|
545
|
+
level: number;
|
|
546
|
+
title: string;
|
|
547
|
+
hiddenCharCount: number;
|
|
548
|
+
cachedSlice: IDocCollapsedHeadingSlice;
|
|
549
|
+
}
|
|
550
|
+
interface IDocFindReplaceOptions {
|
|
551
|
+
matchCase?: boolean;
|
|
552
|
+
wholeWord?: boolean;
|
|
553
|
+
useRegex?: boolean;
|
|
554
|
+
/** Optional 0-based match index to replace only a single occurrence instead of all matches */
|
|
555
|
+
replaceIndex?: number;
|
|
556
|
+
/** Skip matches inside locked SDTs, readonly DocAreas, locked table cells, or disabled Titles */
|
|
557
|
+
respectLocks?: boolean;
|
|
558
|
+
}
|
|
559
|
+
interface IDocReadabilityStatistics {
|
|
560
|
+
charCount: number;
|
|
561
|
+
charCountNoSpaces: number;
|
|
562
|
+
wordCount: number;
|
|
563
|
+
cjkCharCount: number;
|
|
564
|
+
paragraphCount: number;
|
|
565
|
+
tableCount: number;
|
|
566
|
+
estimatedReadingMinutes: number;
|
|
567
|
+
}
|
|
568
|
+
interface IDocCustomGlossaryRule {
|
|
569
|
+
wrong: string;
|
|
570
|
+
preferred: string;
|
|
571
|
+
message?: string;
|
|
572
|
+
}
|
|
573
|
+
type DocCustomGlossaryInput = Record<string, string> | IDocCustomGlossaryRule[];
|
|
574
|
+
interface IDocTermDiagnostic {
|
|
575
|
+
type: 'spelling' | 'terminology' | 'inconsistency';
|
|
576
|
+
term: string;
|
|
577
|
+
suggestion: string;
|
|
578
|
+
offset: number;
|
|
579
|
+
message: string;
|
|
580
|
+
}
|
|
581
|
+
type DocSectionBreakKind = 'nextPage' | 'continuous' | 'evenPage' | 'oddPage';
|
|
582
|
+
interface IDocColumnGroupOptions {
|
|
583
|
+
gapPt?: number;
|
|
584
|
+
widthRatios?: number[];
|
|
585
|
+
equalWidth?: boolean;
|
|
586
|
+
separatorLine?: boolean;
|
|
587
|
+
}
|
|
588
|
+
interface IDocColumnGroupConfig {
|
|
589
|
+
columnCount: 2 | 3 | 4 | 5;
|
|
590
|
+
gapPt: number;
|
|
591
|
+
widthRatios: number[];
|
|
592
|
+
equalWidth: boolean;
|
|
593
|
+
separatorLine: boolean;
|
|
594
|
+
}
|
|
595
|
+
interface IDocParagraphPaginationSpec {
|
|
596
|
+
keepLines?: boolean;
|
|
597
|
+
keepNext?: boolean;
|
|
598
|
+
widowControl?: boolean;
|
|
599
|
+
pageBreakBefore?: boolean;
|
|
600
|
+
}
|
|
601
|
+
interface IDocPageBorderConfig {
|
|
602
|
+
color: string;
|
|
603
|
+
widthPt: number;
|
|
604
|
+
marginPt?: number;
|
|
605
|
+
style?: 'single' | 'double';
|
|
606
|
+
}
|
|
607
|
+
type DocWatermarkLayer = 'behind' | 'front';
|
|
608
|
+
interface IDocPrintConfig {
|
|
609
|
+
watermarkText?: string;
|
|
610
|
+
watermarkGapPt?: number;
|
|
611
|
+
watermarkLayer?: DocWatermarkLayer;
|
|
612
|
+
watermarkColor?: string;
|
|
613
|
+
watermarkOpacity?: number;
|
|
614
|
+
watermarkFontSizePt?: number;
|
|
615
|
+
watermarkRotationDeg?: number;
|
|
616
|
+
watermarkRepeat?: boolean;
|
|
617
|
+
imageWatermarkDataUrl?: string;
|
|
618
|
+
imageWatermarkOpacity?: number;
|
|
619
|
+
imageWatermarkRotationDeg?: number;
|
|
620
|
+
imageWatermarkRepeat?: boolean;
|
|
621
|
+
imageWatermarkGapPt?: number;
|
|
622
|
+
includeComments?: boolean;
|
|
623
|
+
redHeaderTitle?: string;
|
|
624
|
+
showPageFooter?: boolean;
|
|
625
|
+
showLineNumbers?: boolean;
|
|
626
|
+
lineNumberStart?: number;
|
|
627
|
+
lineNumberCountBy?: number;
|
|
628
|
+
lineNumberStep?: number;
|
|
629
|
+
lineNumberRestart?: 'newPage' | 'newSection' | 'continuous';
|
|
630
|
+
straddleSealText?: string;
|
|
631
|
+
signatureImageDataUrl?: string;
|
|
632
|
+
printFieldsOnly?: boolean;
|
|
633
|
+
pageBorder?: IDocPageBorderConfig;
|
|
634
|
+
gutterPt?: number;
|
|
635
|
+
gutterPosition?: 'left' | 'top';
|
|
636
|
+
autoHyphenation?: boolean;
|
|
637
|
+
pagelessMode?: boolean;
|
|
638
|
+
pageNumberFormat?: string;
|
|
639
|
+
pageNumberType?: 'arabic' | 'chinese';
|
|
640
|
+
pageNumberAlign?: 'left' | 'center' | 'right';
|
|
641
|
+
fromPageNo?: number;
|
|
642
|
+
startPageNo?: number;
|
|
643
|
+
}
|
|
644
|
+
type DocImageWrapType = 'inline' | 'square' | 'tight' | 'topAndBottom' | 'behindText' | 'inFrontOfText';
|
|
645
|
+
interface IDocImageCropSpec {
|
|
646
|
+
left: number;
|
|
647
|
+
top: number;
|
|
648
|
+
right: number;
|
|
649
|
+
bottom: number;
|
|
650
|
+
}
|
|
651
|
+
interface IDocImageTransformSpec {
|
|
652
|
+
crop?: IDocImageCropSpec;
|
|
653
|
+
rotationDeg?: number;
|
|
654
|
+
wrapType?: DocImageWrapType;
|
|
655
|
+
posOffsetH?: number;
|
|
656
|
+
posOffsetV?: number;
|
|
657
|
+
relativeFromH?: string;
|
|
658
|
+
relativeFromV?: string;
|
|
659
|
+
distT?: number;
|
|
660
|
+
distB?: number;
|
|
661
|
+
distL?: number;
|
|
662
|
+
distR?: number;
|
|
663
|
+
behindDoc?: boolean;
|
|
664
|
+
wrapText?: string;
|
|
665
|
+
}
|
|
666
|
+
type DocSmartArtLayout = 'process' | 'hierarchy' | 'cycle' | 'pyramid' | 'matrix';
|
|
667
|
+
interface IDocSmartArtNode {
|
|
668
|
+
id: string;
|
|
669
|
+
label: string;
|
|
670
|
+
subLabel?: string;
|
|
671
|
+
parentId?: string;
|
|
672
|
+
}
|
|
673
|
+
interface IDocSmartArtSpec {
|
|
674
|
+
id?: string;
|
|
675
|
+
title?: string;
|
|
676
|
+
layout: DocSmartArtLayout;
|
|
677
|
+
nodes: IDocSmartArtNode[];
|
|
678
|
+
width?: number;
|
|
679
|
+
height?: number;
|
|
680
|
+
}
|
|
681
|
+
type DocFieldType = 'PAGE' | 'NUMPAGES' | 'DATE' | 'TIME' | 'AUTHOR' | 'FILENAME' | 'SEQ' | 'REF' | 'DOCPROPERTY' | 'COMPANY' | 'TITLE';
|
|
682
|
+
interface IDocFieldContext {
|
|
683
|
+
page?: number;
|
|
684
|
+
numPages?: number;
|
|
685
|
+
date?: string;
|
|
686
|
+
time?: string;
|
|
687
|
+
author?: string;
|
|
688
|
+
fileName?: string;
|
|
689
|
+
company?: string;
|
|
690
|
+
title?: string;
|
|
691
|
+
customProperties?: Record<string, string | number | boolean>;
|
|
692
|
+
}
|
|
693
|
+
interface IDocFieldEntry {
|
|
694
|
+
id: string;
|
|
695
|
+
fieldType: DocFieldType;
|
|
696
|
+
instructionArgs?: string;
|
|
697
|
+
instrText: string;
|
|
698
|
+
value: string;
|
|
699
|
+
startIndex?: number;
|
|
700
|
+
endIndex?: number;
|
|
701
|
+
}
|
|
702
|
+
type DocCaptionCategory = '图' | '表' | '公式';
|
|
703
|
+
interface IDocCaptionEntry {
|
|
704
|
+
id: string;
|
|
705
|
+
category: DocCaptionCategory;
|
|
706
|
+
number: number;
|
|
707
|
+
title: string;
|
|
708
|
+
fullText: string;
|
|
709
|
+
bookmarkName: string;
|
|
710
|
+
fieldId: string;
|
|
711
|
+
startIndex?: number;
|
|
712
|
+
endIndex?: number;
|
|
713
|
+
}
|
|
714
|
+
interface IDocCitationSource {
|
|
715
|
+
id: string;
|
|
716
|
+
author: string;
|
|
717
|
+
title: string;
|
|
718
|
+
year: string;
|
|
719
|
+
publisher?: string;
|
|
720
|
+
}
|
|
721
|
+
interface IDocBuildingBlockSpec {
|
|
722
|
+
id?: string;
|
|
723
|
+
name: string;
|
|
724
|
+
category: string;
|
|
725
|
+
content: string;
|
|
726
|
+
sdtSpecs?: Array<Partial<IDocSdtControlSpec> & {
|
|
727
|
+
alias: string;
|
|
728
|
+
}>;
|
|
729
|
+
}
|
|
730
|
+
interface IDocBuildingBlockEntry extends IDocBuildingBlockSpec {
|
|
731
|
+
id: string;
|
|
732
|
+
}
|
|
733
|
+
type DocMailMergeBatchFormat = 'docx' | 'pdf' | 'html';
|
|
734
|
+
interface IDocMailMergeBatchResultItem {
|
|
735
|
+
index: number;
|
|
736
|
+
output: Uint8Array | string;
|
|
737
|
+
}
|
|
738
|
+
interface IDocTemplateMetadata {
|
|
739
|
+
datasets?: IDocDatasetGroup[];
|
|
740
|
+
sampleData?: Record<string, unknown>;
|
|
741
|
+
/** Keyed by `${tableId}:${rowIndex}` */
|
|
742
|
+
tableRowLoops?: Record<string, IDocTableRowLoopConfig>;
|
|
743
|
+
/** Contract Track Changes (`修订留痕模式`) switch */
|
|
744
|
+
trackChangesEnabled?: boolean;
|
|
745
|
+
/** Default author name recorded for Track Changes */
|
|
746
|
+
trackAuthor?: string;
|
|
747
|
+
/** Recorded insert/delete revisions (persisted & round-tripped with OOXML `<w:ins>` / `<w:del>`) */
|
|
748
|
+
revisions?: IDocTrackRevision[];
|
|
749
|
+
/** Live reactive conditional visibility clauses with `cachedTemplateText` backup */
|
|
750
|
+
visibilityClauses?: IDocVisibilityClause[];
|
|
751
|
+
/** Active co-signing role in `'form'` mode (e.g. `'partyA'` | `'partyB'` | `'lawyer'`) */
|
|
752
|
+
activeRole?: string;
|
|
753
|
+
/** Structured EMR / scientific formula drawing blocks keyed by `blockId` for re-editing & vector export */
|
|
754
|
+
medicalFormulas?: Record<string, IDocEmbeddedMedicalFormulaEntry>;
|
|
755
|
+
/** Embedded syntax-styled code blocks metadata */
|
|
756
|
+
codeBlocks?: IDocEmbeddedCodeBlockEntry[];
|
|
757
|
+
/** Embedded QR Matrix / Code128 barcode drawing blocks keyed by `blockId` (supports live dataset binding) */
|
|
758
|
+
barcodeBlocks?: Record<string, IDocEmbeddedBarcodeEntry>;
|
|
759
|
+
/** Shaded bordered callout blocks (`IDocCalloutBlock[]`) */
|
|
760
|
+
callouts?: IDocCalloutBlock[];
|
|
761
|
+
/** Left-bordered indented quote blocks (`IDocQuoteBlock[]`) */
|
|
762
|
+
quotes?: IDocQuoteBlock[];
|
|
763
|
+
/** General-purpose LaTeX mathematical formula drawing blocks keyed by `id` */
|
|
764
|
+
latexFormulas?: Record<string, IDocLatexFormulaSpec>;
|
|
765
|
+
/** Inline document data formula fields keyed by `id` */
|
|
766
|
+
inlineFormulas?: Record<string, IDocInlineFormula>;
|
|
767
|
+
/** Embedded SVG document charts keyed by `id` */
|
|
768
|
+
docCharts?: Record<string, IDocEmbeddedChart & {
|
|
769
|
+
id: string;
|
|
770
|
+
}>;
|
|
771
|
+
/** Embedded SVG document shapes keyed by `id` */
|
|
772
|
+
docShapes?: Record<string, IDocEmbeddedShape & {
|
|
773
|
+
id: string;
|
|
774
|
+
}>;
|
|
775
|
+
/** Repeating table header row counts keyed by `tableId` */
|
|
776
|
+
tableRepeatHeaders?: Record<string, number>;
|
|
777
|
+
/** Repeating section SDT template definitions keyed by control `id` */
|
|
778
|
+
repeatingSections?: Record<string, IDocRepeatingSectionSpec & {
|
|
779
|
+
id: string;
|
|
780
|
+
}>;
|
|
781
|
+
/** Named OOXML document bookmarks (`<w:bookmarkStart>` / `<w:bookmarkEnd>`) */
|
|
782
|
+
bookmarks?: IDocBookmark[];
|
|
783
|
+
/** In-document generated Table of Contents block state */
|
|
784
|
+
tocConfig?: IDocTableOfContentsEntry;
|
|
785
|
+
/** Wave 2: Paragraph borders & shading keyed by `paragraphId` */
|
|
786
|
+
paragraphBorders?: Record<string, IDocParagraphBorderShadingSpec>;
|
|
787
|
+
/** Wave 2: Paragraph custom tab stops & leaders keyed by `paragraphId` */
|
|
788
|
+
paragraphTabStops?: Record<string, IDocTabStop[]>;
|
|
789
|
+
/** Wave 2: Paragraph pagination control (`keepLines/keepNext/widowControl/pageBreakBefore`) keyed by `paragraphId` */
|
|
790
|
+
paragraphPagination?: Record<string, IDocParagraphPaginationSpec>;
|
|
791
|
+
/** Wave 2: Currently collapsed headings with lossless cached slices */
|
|
792
|
+
collapsedHeadings?: IDocCollapsedHeadingEntry[];
|
|
793
|
+
/** Wave 2: Proportional multi-column group configuration (`2..5` columns) */
|
|
794
|
+
columnGroupConfig?: IDocColumnGroupConfig;
|
|
795
|
+
/** Wave 2: Section breaks recorded by `sectionId` or `paragraphId` */
|
|
796
|
+
sectionBreakTypes?: Record<string, DocSectionBreakKind>;
|
|
797
|
+
/** Wave 2: Page setup & print configuration (`pageBorder`, `gutterPt`, `autoHyphenation`, `pagelessMode`, `imageWatermarkDataUrl`) */
|
|
798
|
+
printConfig?: IDocPrintConfig;
|
|
799
|
+
/** Wave 2: Image crop, rotation & wrap transforms keyed by `drawingId` */
|
|
800
|
+
imageTransforms?: Record<string, IDocImageTransformSpec>;
|
|
801
|
+
/** Wave 2: Embedded SmartArt structured diagrams keyed by `id` */
|
|
802
|
+
smartArts?: Record<string, IDocSmartArtSpec & {
|
|
803
|
+
id: string;
|
|
804
|
+
}>;
|
|
805
|
+
/** Wave 2: Word dynamic fields (`PAGE/NUMPAGES/DATE/TIME/AUTHOR/FILENAME/SEQ/REF`) keyed by `id` */
|
|
806
|
+
docFields?: Record<string, IDocFieldEntry>;
|
|
807
|
+
/** Wave 2: Auto-numbered captions (`图/表/公式`) */
|
|
808
|
+
captions?: IDocCaptionEntry[];
|
|
809
|
+
/** Wave 2: Citation sources for bibliography generation */
|
|
810
|
+
citationSources?: IDocCitationSource[];
|
|
811
|
+
/** Wave 2: Reusable building blocks library */
|
|
812
|
+
buildingBlocks?: IDocBuildingBlockEntry[];
|
|
813
|
+
/** Batch 3: Named document sub-regions (`Area` / `Zone`) */
|
|
814
|
+
docAreas?: IDocAreaRegion[];
|
|
815
|
+
/** Batch 3: Document top corner badge on Page 1 */
|
|
816
|
+
mainBadge?: IDocCornerBadge | null;
|
|
817
|
+
/** Batch 3: Inline status pill label badges keyed by `id` */
|
|
818
|
+
labelBadges?: Record<string, IDocLabelBadge>;
|
|
819
|
+
/** Batch 3: Declarative cross-control & heading cascade rules */
|
|
820
|
+
cascadeRules?: IDocCascadeRule[];
|
|
821
|
+
/** Batch 3: Baseline control property snapshots for lossless cascade restoration */
|
|
822
|
+
cascadeBaselines?: Record<string, IDocControlCascadeBaseline>;
|
|
823
|
+
/** Batch 3: Baseline heading collapse states keyed by `headingTitle` */
|
|
824
|
+
cascadeHeadingBaselines?: Record<string, {
|
|
825
|
+
collapsed: boolean;
|
|
826
|
+
}>;
|
|
827
|
+
/** Batch 3: Styled line-dash horizontal separators keyed by `id` */
|
|
828
|
+
styledSeparators?: Record<string, IDocStyledSeparatorEntry>;
|
|
829
|
+
/** Batch 3: Embedded iframe / video blocks keyed by `id` */
|
|
830
|
+
embedBlocks?: Record<string, IDocEmbedBlock>;
|
|
831
|
+
/** Batch 3: Static document macro variables (`{{MACRO_NAME}}` -> value) */
|
|
832
|
+
macros?: Record<string, string>;
|
|
833
|
+
/** Batch 3: Freehand graffiti vector annotation strokes */
|
|
834
|
+
graffitiStrokes?: IDocGraffitiStroke[];
|
|
835
|
+
/** Batch 3: Extended SDT control specs keyed by `id` for lossless `.docx` round-trip */
|
|
836
|
+
sdtExtendedSpecs?: Record<string, Partial<IDocSdtControlSpec> & {
|
|
837
|
+
id: string;
|
|
838
|
+
tag: string;
|
|
839
|
+
kind: DocSdtControlKind;
|
|
840
|
+
sdtValue?: string | boolean;
|
|
841
|
+
segmentId?: string;
|
|
842
|
+
}>;
|
|
843
|
+
/** Round 1: Footnote & Endnote numbering settings */
|
|
844
|
+
noteSettings?: {
|
|
845
|
+
footnote?: IDocNoteSettings;
|
|
846
|
+
endnote?: IDocNoteSettings;
|
|
847
|
+
};
|
|
848
|
+
/** Round 1: Structured note entries cache */
|
|
849
|
+
docNotes?: IDocNoteEntry[];
|
|
850
|
+
/** Round 1: Document company metadata (`docProps/app.xml`) */
|
|
851
|
+
company?: string;
|
|
852
|
+
/** Round 1: Custom document properties (`docProps/custom.xml`) */
|
|
853
|
+
customProperties?: Record<string, string | number | boolean>;
|
|
854
|
+
/** Round 1: Copy / Paste governance policy */
|
|
855
|
+
copyPastePolicy?: IDocCopyPastePolicy;
|
|
856
|
+
/** Round 1: Per-section page orientation keyed by `paragraphId`, `sectionId`, or `'__trailing__'` */
|
|
857
|
+
sectionOrientations?: Record<string, DocPageOrientation>;
|
|
858
|
+
/** Round 1: Recorded command-level action macros */
|
|
859
|
+
actionMacros?: IDocRecordedActionMacro[];
|
|
860
|
+
/** Round 1: Paragraph text directions (`ltr | rtl | auto`) keyed by `paragraphId` */
|
|
861
|
+
paragraphDirections?: Record<string, DocTextDirection>;
|
|
862
|
+
/** Round 1: Table text directions (`ltr | rtl | auto`) keyed by `tableId` */
|
|
863
|
+
tableDirections?: Record<string, DocTextDirection>;
|
|
864
|
+
/** Round 1: Table border presets keyed by `tableId` */
|
|
865
|
+
tableBorderPresets?: Record<string, DocTableBorderPreset>;
|
|
866
|
+
/** Round 1: Table cell extended properties (`slashType`, `verticalAlign`, `locked`, `hint`) keyed by `${tableId}:${rowIndex}:${colIndex}` */
|
|
867
|
+
tableCellProperties?: Record<string, IDocTableCellProperties>;
|
|
868
|
+
/** Round 1: Multi-level list definitions keyed by `listId` */
|
|
869
|
+
listDefinitions?: Record<string, {
|
|
870
|
+
glyphType: DocListGlyphType;
|
|
871
|
+
levels?: Record<number, DocListGlyphType>;
|
|
872
|
+
}>;
|
|
873
|
+
/** Round 1: Task/checkbox list checked state keyed by `paragraphId` */
|
|
874
|
+
listParagraphChecks?: Record<string, boolean>;
|
|
875
|
+
/** Round 3: Document comment threads synchronized with `CustomRangeType.COMMENT` & `word/comments.xml` */
|
|
876
|
+
comments?: IDocCommentThread[];
|
|
877
|
+
/** Round 3: Structured Title concept block properties keyed by `paragraphId` */
|
|
878
|
+
titleProperties?: Record<string, IDocTitleProperties>;
|
|
879
|
+
}
|
|
880
|
+
type DocAreaMode = 'edit' | 'readonly' | 'form';
|
|
881
|
+
interface IDocCornerBadge {
|
|
882
|
+
text?: string;
|
|
883
|
+
imageDataUrl?: string;
|
|
884
|
+
leftPt?: number;
|
|
885
|
+
topPt?: number;
|
|
886
|
+
widthPt?: number;
|
|
887
|
+
heightPt?: number;
|
|
888
|
+
color?: string;
|
|
889
|
+
backgroundColor?: string;
|
|
890
|
+
borderColor?: string;
|
|
891
|
+
position?: 'top-right' | 'top-left';
|
|
892
|
+
}
|
|
893
|
+
interface IDocAreaHiddenSlice extends IDocCollapsedHeadingSlice {
|
|
894
|
+
paragraphCount: number;
|
|
895
|
+
drawingEntries?: Record<string, unknown>;
|
|
896
|
+
beforeParagraphId?: string;
|
|
897
|
+
insertedTempAnchorParaId?: string;
|
|
898
|
+
}
|
|
899
|
+
interface IDocAreaRegion {
|
|
900
|
+
id: string;
|
|
901
|
+
name: string;
|
|
902
|
+
mode: DocAreaMode;
|
|
903
|
+
backgroundColor?: string;
|
|
904
|
+
borderColor?: string;
|
|
905
|
+
placeholder?: string;
|
|
906
|
+
deletable?: boolean;
|
|
907
|
+
hide?: boolean;
|
|
908
|
+
startParagraphIndex: number;
|
|
909
|
+
endParagraphIndex: number;
|
|
910
|
+
startParagraphId?: string;
|
|
911
|
+
endParagraphId?: string;
|
|
912
|
+
startIndex?: number;
|
|
913
|
+
endIndex?: number;
|
|
914
|
+
badge?: IDocCornerBadge | null;
|
|
915
|
+
cachedHiddenSlice?: IDocAreaHiddenSlice;
|
|
916
|
+
}
|
|
917
|
+
interface IDocInsertAreaSpec {
|
|
918
|
+
id?: string;
|
|
919
|
+
name: string;
|
|
920
|
+
text?: string;
|
|
921
|
+
mode?: DocAreaMode;
|
|
922
|
+
backgroundColor?: string;
|
|
923
|
+
borderColor?: string;
|
|
924
|
+
placeholder?: string;
|
|
925
|
+
deletable?: boolean;
|
|
926
|
+
}
|
|
927
|
+
interface IDocAreaValueResult {
|
|
928
|
+
id: string;
|
|
929
|
+
name: string;
|
|
930
|
+
text: string;
|
|
931
|
+
paragraphs: string[];
|
|
932
|
+
sdtValues: Record<string, string | boolean>;
|
|
933
|
+
}
|
|
934
|
+
type DocLabelBadgeTone = 'primary' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
935
|
+
interface IDocLabelBadge {
|
|
936
|
+
id: string;
|
|
937
|
+
text: string;
|
|
938
|
+
tone: DocLabelBadgeTone;
|
|
939
|
+
color: string;
|
|
940
|
+
backgroundColor: string;
|
|
941
|
+
borderColor: string;
|
|
942
|
+
widthPt: number;
|
|
943
|
+
heightPt: number;
|
|
944
|
+
}
|
|
945
|
+
interface IDocInsertLabelBadgeSpec {
|
|
946
|
+
id?: string;
|
|
947
|
+
text: string;
|
|
948
|
+
tone?: DocLabelBadgeTone;
|
|
949
|
+
color?: string;
|
|
950
|
+
backgroundColor?: string;
|
|
951
|
+
}
|
|
952
|
+
interface IDocCascadeTargetEffects {
|
|
953
|
+
hide?: boolean;
|
|
954
|
+
required?: boolean;
|
|
955
|
+
disabled?: boolean;
|
|
956
|
+
deletable?: boolean;
|
|
957
|
+
setValue?: string | boolean;
|
|
958
|
+
}
|
|
959
|
+
interface IDocCascadeTarget {
|
|
960
|
+
controlId?: string;
|
|
961
|
+
conceptId?: string;
|
|
962
|
+
headingTitle?: string;
|
|
963
|
+
effects: IDocCascadeTargetEffects;
|
|
964
|
+
/** Optional fallback effects applied when `conditionExpr` evaluates to `false` */
|
|
965
|
+
elseEffects?: IDocCascadeTargetEffects;
|
|
966
|
+
}
|
|
967
|
+
interface IDocCascadeRule {
|
|
968
|
+
id: string;
|
|
969
|
+
conditionExpr: string;
|
|
970
|
+
targets: IDocCascadeTarget[];
|
|
971
|
+
/** Optional rule-level fallback effects applied to `targets` when `conditionExpr` is `false` */
|
|
972
|
+
elseEffects?: IDocCascadeTargetEffects;
|
|
973
|
+
/** Optional explicit fallback targets/actions applied when `conditionExpr` is `false` */
|
|
974
|
+
elseActions?: IDocCascadeTarget[];
|
|
975
|
+
}
|
|
976
|
+
interface IDocControlCascadeBaseline {
|
|
977
|
+
controlId: string;
|
|
978
|
+
conceptId?: string;
|
|
979
|
+
required: boolean;
|
|
980
|
+
lock: DocSdtLockPolicy;
|
|
981
|
+
deletable: boolean;
|
|
982
|
+
visible: boolean;
|
|
983
|
+
cachedSdtSpec?: IDocSdtControlSpec;
|
|
984
|
+
cachedSdtValue?: string | boolean;
|
|
985
|
+
anchorOffset?: number;
|
|
986
|
+
afterControlId?: string;
|
|
987
|
+
}
|
|
988
|
+
interface IDocCascadeEvaluationResult {
|
|
989
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
990
|
+
iterations: number;
|
|
991
|
+
hitMaxIterations: boolean;
|
|
992
|
+
appliedRuleIds: string[];
|
|
993
|
+
changed: boolean;
|
|
994
|
+
}
|
|
995
|
+
type DocSeparatorDashStyle = 'single' | 'double' | 'dot' | 'dashSmallGap' | 'dashLargeGap' | 'dashDot' | 'dashDotDot' | 'wavy';
|
|
996
|
+
interface IDocStyledSeparatorEntry {
|
|
997
|
+
id: string;
|
|
998
|
+
dashStyle: DocSeparatorDashStyle;
|
|
999
|
+
color: string;
|
|
1000
|
+
strokeWidthPt: number;
|
|
1001
|
+
spanWidthPt: number;
|
|
1002
|
+
paragraphId?: string;
|
|
1003
|
+
}
|
|
1004
|
+
type DocEmbedBlockKind = 'iframe' | 'video';
|
|
1005
|
+
interface IDocEmbedBlock {
|
|
1006
|
+
id: string;
|
|
1007
|
+
kind: DocEmbedBlockKind;
|
|
1008
|
+
url: string;
|
|
1009
|
+
title: string;
|
|
1010
|
+
widthPt: number;
|
|
1011
|
+
heightPt: number;
|
|
1012
|
+
posterDataUrl?: string;
|
|
1013
|
+
}
|
|
1014
|
+
interface IDocInsertEmbedBlockSpec {
|
|
1015
|
+
id?: string;
|
|
1016
|
+
kind: DocEmbedBlockKind;
|
|
1017
|
+
url: string;
|
|
1018
|
+
title?: string;
|
|
1019
|
+
widthPt?: number;
|
|
1020
|
+
heightPt?: number;
|
|
1021
|
+
posterDataUrl?: string;
|
|
1022
|
+
}
|
|
1023
|
+
type DocMacroResolver = string | number | boolean | ((ctx: {
|
|
1024
|
+
unitId?: string;
|
|
1025
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
1026
|
+
now: Date;
|
|
1027
|
+
}) => string | number | boolean);
|
|
1028
|
+
interface IDocGraffitiPoint {
|
|
1029
|
+
xPt: number;
|
|
1030
|
+
yPt: number;
|
|
1031
|
+
}
|
|
1032
|
+
interface IDocGraffitiStroke {
|
|
1033
|
+
id: string;
|
|
1034
|
+
pageIndex: number;
|
|
1035
|
+
points: IDocGraffitiPoint[];
|
|
1036
|
+
color: string;
|
|
1037
|
+
widthPt: number;
|
|
1038
|
+
}
|
|
1039
|
+
interface IDocAddGraffitiStrokeSpec {
|
|
1040
|
+
id?: string;
|
|
1041
|
+
pageIndex: number;
|
|
1042
|
+
points: IDocGraffitiPoint[];
|
|
1043
|
+
color?: string;
|
|
1044
|
+
widthPt?: number;
|
|
1045
|
+
}
|
|
1046
|
+
type IDocReportTemplateMetadata = IDocTemplateMetadata;
|
|
1047
|
+
interface IDocImportWarning {
|
|
1048
|
+
code: 'UNSUPPORTED_SHAPE' | 'UNSUPPORTED_TEXTBOX' | 'UNSUPPORTED_SMARTART' | 'UNSUPPORTED_FIELD' | 'UNSUPPORTED_NOTE' | 'UNSUPPORTED_COMMENT_TRACK' | 'UNSUPPORTED_EMBED' | 'MULTI_SECTION_FLATTENED' | 'FLOATING_IMAGE_INLINE' | 'COMPLEX_NUMBERING_SIMPLIFIED';
|
|
1049
|
+
message: string;
|
|
1050
|
+
count?: number;
|
|
1051
|
+
}
|
|
1052
|
+
type DocNoteType = 'footnote' | 'endnote';
|
|
1053
|
+
type DocNoteNumberFormat = 'decimal' | 'lowerRoman' | 'circled';
|
|
1054
|
+
type DocNoteRestartRule = 'continuous' | 'eachPage' | 'eachSection';
|
|
1055
|
+
interface IDocNoteEntry {
|
|
1056
|
+
id: string;
|
|
1057
|
+
noteType: DocNoteType;
|
|
1058
|
+
number: number;
|
|
1059
|
+
formattedMark?: string;
|
|
1060
|
+
text: string;
|
|
1061
|
+
startIndex: number;
|
|
1062
|
+
endIndex?: number;
|
|
1063
|
+
}
|
|
1064
|
+
interface IDocNoteSettings {
|
|
1065
|
+
numberFormat: DocNoteNumberFormat;
|
|
1066
|
+
startAt: number;
|
|
1067
|
+
restartRule: DocNoteRestartRule;
|
|
1068
|
+
}
|
|
1069
|
+
type DocListGlyphType = 'bullet' | 'decimal' | 'lowerLetter' | 'upperRoman' | 'chineseCounting' | 'checkbox';
|
|
1070
|
+
interface IDocListInsertSpec {
|
|
1071
|
+
listId?: string;
|
|
1072
|
+
glyphType?: DocListGlyphType;
|
|
1073
|
+
nestingLevel?: number;
|
|
1074
|
+
startOffset?: number;
|
|
1075
|
+
endOffset?: number;
|
|
1076
|
+
checked?: boolean;
|
|
1077
|
+
text?: string;
|
|
1078
|
+
}
|
|
1079
|
+
interface IDocListParagraphInfo {
|
|
1080
|
+
paragraphId: string;
|
|
1081
|
+
paragraphIndex: number;
|
|
1082
|
+
startIndex: number;
|
|
1083
|
+
listId: string;
|
|
1084
|
+
nestingLevel: number;
|
|
1085
|
+
glyphType: DocListGlyphType;
|
|
1086
|
+
marker: string;
|
|
1087
|
+
checked?: boolean;
|
|
1088
|
+
text: string;
|
|
1089
|
+
}
|
|
1090
|
+
type DocTextDirection = 'ltr' | 'rtl' | 'auto';
|
|
1091
|
+
interface IDocCopyPastePolicy {
|
|
1092
|
+
copyDisabled?: boolean;
|
|
1093
|
+
copyCopyrightSuffix?: string;
|
|
1094
|
+
pastePlainTextOnly?: boolean;
|
|
1095
|
+
}
|
|
1096
|
+
type DocTableBorderPreset = 'all' | 'empty' | 'external' | 'internal' | 'dash';
|
|
1097
|
+
type DocTableCellSlashType = 'none' | 'forward' | 'back' | 'both';
|
|
1098
|
+
type DocTableAutoFitMode = 'content' | 'window';
|
|
1099
|
+
type DocCellBorderLineStyle = 'single' | 'double' | 'dashed' | 'dotted' | 'none';
|
|
1100
|
+
interface IDocCellBorderEdgeSpec {
|
|
1101
|
+
style?: DocCellBorderLineStyle;
|
|
1102
|
+
widthPt?: number;
|
|
1103
|
+
color?: string;
|
|
1104
|
+
}
|
|
1105
|
+
interface IDocTableCellBorders {
|
|
1106
|
+
top?: IDocCellBorderEdgeSpec;
|
|
1107
|
+
bottom?: IDocCellBorderEdgeSpec;
|
|
1108
|
+
left?: IDocCellBorderEdgeSpec;
|
|
1109
|
+
right?: IDocCellBorderEdgeSpec;
|
|
1110
|
+
}
|
|
1111
|
+
interface IDocTableCellProperties {
|
|
1112
|
+
slashType?: DocTableCellSlashType;
|
|
1113
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
1114
|
+
locked?: boolean;
|
|
1115
|
+
hint?: string;
|
|
1116
|
+
backgroundColor?: string;
|
|
1117
|
+
borders?: IDocTableCellBorders;
|
|
1118
|
+
}
|
|
1119
|
+
type DocPageOrientation = 'portrait' | 'landscape';
|
|
1120
|
+
interface IDocCleanUpFormattingOptions {
|
|
1121
|
+
removeConsecutiveBlankParagraphs?: boolean;
|
|
1122
|
+
trimLeadingWhitespace?: boolean;
|
|
1123
|
+
firstLineIndentTwoChars?: boolean;
|
|
1124
|
+
normalizePunctuation?: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
interface IDocCleanUpFormattingResult {
|
|
1127
|
+
removedBlankParagraphs: number;
|
|
1128
|
+
trimmedParagraphs: number;
|
|
1129
|
+
indentedParagraphs: number;
|
|
1130
|
+
normalizedPunctuationCount: number;
|
|
1131
|
+
}
|
|
1132
|
+
interface IDocActionMacroStep {
|
|
1133
|
+
commandId: string;
|
|
1134
|
+
params?: Record<string, unknown>;
|
|
1135
|
+
timestamp: number;
|
|
1136
|
+
}
|
|
1137
|
+
interface IDocRecordedActionMacro {
|
|
1138
|
+
id: string;
|
|
1139
|
+
name: string;
|
|
1140
|
+
createdAt: string;
|
|
1141
|
+
steps: IDocActionMacroStep[];
|
|
1142
|
+
}
|
|
1143
|
+
interface IDocSignatureStrokePoint {
|
|
1144
|
+
x: number;
|
|
1145
|
+
y: number;
|
|
1146
|
+
}
|
|
1147
|
+
interface IDocSignatureStroke {
|
|
1148
|
+
points: IDocSignatureStrokePoint[];
|
|
1149
|
+
color: string;
|
|
1150
|
+
lineWidth: number;
|
|
1151
|
+
}
|
|
1152
|
+
interface IDocVisualComparisonOptions {
|
|
1153
|
+
baseAuthor?: string;
|
|
1154
|
+
revisedAuthor?: string;
|
|
1155
|
+
createdAt?: string;
|
|
1156
|
+
}
|
|
1157
|
+
interface IDocVisualComparisonResult {
|
|
1158
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
1159
|
+
revisions: IDocTrackRevision[];
|
|
1160
|
+
insertCount: number;
|
|
1161
|
+
deleteCount: number;
|
|
1162
|
+
}
|
|
1163
|
+
interface IDocHyperlinkEntry {
|
|
1164
|
+
id: string;
|
|
1165
|
+
url: string;
|
|
1166
|
+
text: string;
|
|
1167
|
+
tooltip?: string;
|
|
1168
|
+
isInternalAnchor: boolean;
|
|
1169
|
+
anchor?: string;
|
|
1170
|
+
startIndex: number;
|
|
1171
|
+
endIndex: number;
|
|
1172
|
+
}
|
|
1173
|
+
interface IDocInsertHyperlinkSpec {
|
|
1174
|
+
id?: string;
|
|
1175
|
+
url: string;
|
|
1176
|
+
text?: string;
|
|
1177
|
+
tooltip?: string;
|
|
1178
|
+
startOffset?: number;
|
|
1179
|
+
endOffset?: number;
|
|
1180
|
+
}
|
|
1181
|
+
interface IDocUpdateHyperlinkSpec {
|
|
1182
|
+
url?: string;
|
|
1183
|
+
text?: string;
|
|
1184
|
+
tooltip?: string;
|
|
1185
|
+
}
|
|
1186
|
+
interface IDocCommentReply {
|
|
1187
|
+
id: string;
|
|
1188
|
+
author: string;
|
|
1189
|
+
createdAt: string;
|
|
1190
|
+
initials?: string;
|
|
1191
|
+
content: string;
|
|
1192
|
+
}
|
|
1193
|
+
interface IDocCommentThread {
|
|
1194
|
+
id: string;
|
|
1195
|
+
author: string;
|
|
1196
|
+
createdAt: string;
|
|
1197
|
+
initials?: string;
|
|
1198
|
+
content: string;
|
|
1199
|
+
quoteText?: string;
|
|
1200
|
+
resolved?: boolean;
|
|
1201
|
+
startIndex: number;
|
|
1202
|
+
endIndex: number;
|
|
1203
|
+
replies: IDocCommentReply[];
|
|
1204
|
+
}
|
|
1205
|
+
interface IDocAddCommentSpec {
|
|
1206
|
+
id?: string;
|
|
1207
|
+
author?: string;
|
|
1208
|
+
initials?: string;
|
|
1209
|
+
createdAt?: string;
|
|
1210
|
+
content: string;
|
|
1211
|
+
startOffset?: number;
|
|
1212
|
+
endOffset?: number;
|
|
1213
|
+
}
|
|
1214
|
+
interface IDocReplyCommentSpec {
|
|
1215
|
+
id?: string;
|
|
1216
|
+
author?: string;
|
|
1217
|
+
initials?: string;
|
|
1218
|
+
createdAt?: string;
|
|
1219
|
+
content: string;
|
|
1220
|
+
}
|
|
1221
|
+
interface IDocContextMenuContext {
|
|
1222
|
+
isReadonly: boolean;
|
|
1223
|
+
mode: DocWorkMode;
|
|
1224
|
+
editorHasSelection: boolean;
|
|
1225
|
+
selectedText: string;
|
|
1226
|
+
startOffset: number;
|
|
1227
|
+
endOffset: number;
|
|
1228
|
+
isInTable: boolean;
|
|
1229
|
+
activeSdtControl: IDocResolvedSdtControl | null;
|
|
1230
|
+
zone: 'body' | 'header' | 'footer';
|
|
1231
|
+
}
|
|
1232
|
+
interface IDocContextMenuItem {
|
|
1233
|
+
key: string;
|
|
1234
|
+
name?: string;
|
|
1235
|
+
shortCut?: string;
|
|
1236
|
+
isDivider?: boolean;
|
|
1237
|
+
icon?: string;
|
|
1238
|
+
childMenus?: IDocContextMenuItem[];
|
|
1239
|
+
when?: (ctx: IDocContextMenuContext) => boolean;
|
|
1240
|
+
callback?: (docApi: any, ctx: IDocContextMenuContext) => void;
|
|
1241
|
+
}
|
|
1242
|
+
interface IDocShortcutItem {
|
|
1243
|
+
key: string;
|
|
1244
|
+
ctrl?: boolean;
|
|
1245
|
+
meta?: boolean;
|
|
1246
|
+
mod?: boolean;
|
|
1247
|
+
shift?: boolean;
|
|
1248
|
+
alt?: boolean;
|
|
1249
|
+
isGlobal?: boolean;
|
|
1250
|
+
when?: (ctx: IDocContextMenuContext) => boolean;
|
|
1251
|
+
callback: (docApi: any, ctx: IDocContextMenuContext) => void;
|
|
1252
|
+
}
|
|
1253
|
+
interface IDocMultiOptionSpan {
|
|
1254
|
+
index: number;
|
|
1255
|
+
label: string;
|
|
1256
|
+
value: string;
|
|
1257
|
+
checked: boolean;
|
|
1258
|
+
startIndex: number;
|
|
1259
|
+
endIndex: number;
|
|
1260
|
+
}
|
|
1261
|
+
interface IDocTitleProperties {
|
|
1262
|
+
conceptId: string;
|
|
1263
|
+
deletable?: boolean;
|
|
1264
|
+
disabled?: boolean;
|
|
1265
|
+
}
|
|
1266
|
+
interface IDocInsertTitleSpec {
|
|
1267
|
+
id?: string;
|
|
1268
|
+
text: string;
|
|
1269
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
1270
|
+
offset?: number;
|
|
1271
|
+
titleProperties: IDocTitleProperties;
|
|
1272
|
+
}
|
|
1273
|
+
interface IDocTitleEntry {
|
|
1274
|
+
id: string;
|
|
1275
|
+
paragraphId: string;
|
|
1276
|
+
paragraphIndex: number;
|
|
1277
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
1278
|
+
text: string;
|
|
1279
|
+
sectionText: string;
|
|
1280
|
+
startIndex: number;
|
|
1281
|
+
endIndex: number;
|
|
1282
|
+
conceptId: string;
|
|
1283
|
+
deletable: boolean;
|
|
1284
|
+
disabled: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
interface IDocBeforeSaveEvent {
|
|
1287
|
+
unitId: string;
|
|
1288
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
1289
|
+
cancel: () => void;
|
|
1290
|
+
readonly canceled: boolean;
|
|
1291
|
+
}
|
|
1292
|
+
interface IDocSavedEvent {
|
|
1293
|
+
unitId: string;
|
|
1294
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
1295
|
+
}
|
|
1296
|
+
interface IDocControlChangeEvent {
|
|
1297
|
+
unitId: string;
|
|
1298
|
+
controlId: string | null;
|
|
1299
|
+
previousControlId: string | null;
|
|
1300
|
+
control: IDocResolvedSdtControl | null;
|
|
1301
|
+
}
|
|
1302
|
+
interface IDocControlValueChangeEvent {
|
|
1303
|
+
unitId: string;
|
|
1304
|
+
controlId: string;
|
|
1305
|
+
tag: string;
|
|
1306
|
+
previousValue: string | boolean | undefined;
|
|
1307
|
+
value: string | boolean;
|
|
1308
|
+
control: IDocResolvedSdtControl | null;
|
|
1309
|
+
}
|
|
1310
|
+
interface IDocModeChangeEvent {
|
|
1311
|
+
unitId: string;
|
|
1312
|
+
mode: DocWorkMode;
|
|
1313
|
+
}
|
|
1314
|
+
interface IDocContentChangeEvent {
|
|
1315
|
+
unitId: string;
|
|
1316
|
+
snapshot: _univerjs_core.IDocumentData;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
interface ISyncDocAuxStateMutationParams {
|
|
1320
|
+
unitId: string;
|
|
1321
|
+
tableSource?: Record<string, any>;
|
|
1322
|
+
drawings?: Record<string, any>;
|
|
1323
|
+
drawingsOrder?: string[];
|
|
1324
|
+
documentStyle?: Record<string, any>;
|
|
1325
|
+
headers?: Record<string, any>;
|
|
1326
|
+
footers?: Record<string, any>;
|
|
1327
|
+
metadata?: IDocTemplateMetadata;
|
|
1328
|
+
}
|
|
1329
|
+
declare const SyncDocAuxStateMutation: IMutation<ISyncDocAuxStateMutationParams>;
|
|
1330
|
+
interface IInsertDocCalloutCommandParams {
|
|
1331
|
+
unitId?: string;
|
|
1332
|
+
offset?: number;
|
|
1333
|
+
spec: IDocInsertCalloutSpec;
|
|
1334
|
+
}
|
|
1335
|
+
declare const InsertDocCalloutCommand: ICommand<IInsertDocCalloutCommandParams>;
|
|
1336
|
+
interface IUpdateDocCalloutCommandParams {
|
|
1337
|
+
unitId?: string;
|
|
1338
|
+
id: string;
|
|
1339
|
+
patch: Partial<IDocInsertCalloutSpec>;
|
|
1340
|
+
}
|
|
1341
|
+
declare const UpdateDocCalloutCommand: ICommand<IUpdateDocCalloutCommandParams>;
|
|
1342
|
+
interface IRemoveDocCalloutCommandParams {
|
|
1343
|
+
unitId?: string;
|
|
1344
|
+
id: string;
|
|
1345
|
+
}
|
|
1346
|
+
declare const RemoveDocCalloutCommand: ICommand<IRemoveDocCalloutCommandParams>;
|
|
1347
|
+
interface IInsertDocQuoteCommandParams {
|
|
1348
|
+
unitId?: string;
|
|
1349
|
+
offset?: number;
|
|
1350
|
+
spec: IDocInsertQuoteSpec;
|
|
1351
|
+
}
|
|
1352
|
+
declare const InsertDocQuoteCommand: ICommand<IInsertDocQuoteCommandParams>;
|
|
1353
|
+
interface IUpdateDocQuoteCommandParams {
|
|
1354
|
+
unitId?: string;
|
|
1355
|
+
id: string;
|
|
1356
|
+
patch: Partial<IDocInsertQuoteSpec>;
|
|
1357
|
+
}
|
|
1358
|
+
declare const UpdateDocQuoteCommand: ICommand<IUpdateDocQuoteCommandParams>;
|
|
1359
|
+
interface IRemoveDocQuoteCommandParams {
|
|
1360
|
+
unitId?: string;
|
|
1361
|
+
id: string;
|
|
1362
|
+
}
|
|
1363
|
+
declare const RemoveDocQuoteCommand: ICommand<IRemoveDocQuoteCommandParams>;
|
|
1364
|
+
interface IInsertDocLatexFormulaCommandParams {
|
|
1365
|
+
unitId?: string;
|
|
1366
|
+
offset?: number;
|
|
1367
|
+
spec: IDocInsertLatexFormulaSpec;
|
|
1368
|
+
}
|
|
1369
|
+
declare const InsertDocLatexFormulaCommand: ICommand<IInsertDocLatexFormulaCommandParams>;
|
|
1370
|
+
interface IUpdateDocLatexFormulaCommandParams {
|
|
1371
|
+
unitId?: string;
|
|
1372
|
+
id: string;
|
|
1373
|
+
latex?: string;
|
|
1374
|
+
patch?: Partial<IDocLatexFormulaSpec>;
|
|
1375
|
+
}
|
|
1376
|
+
declare const UpdateDocLatexFormulaCommand: ICommand<IUpdateDocLatexFormulaCommandParams>;
|
|
1377
|
+
interface IRemoveDocLatexFormulaCommandParams {
|
|
1378
|
+
unitId?: string;
|
|
1379
|
+
id: string;
|
|
1380
|
+
}
|
|
1381
|
+
declare const RemoveDocLatexFormulaCommand: ICommand<IRemoveDocLatexFormulaCommandParams>;
|
|
1382
|
+
interface IInsertDocInlineFormulaCommandParams {
|
|
1383
|
+
unitId?: string;
|
|
1384
|
+
offset?: number;
|
|
1385
|
+
spec: IDocInsertInlineFormulaSpec;
|
|
1386
|
+
extraVars?: Record<string, unknown>;
|
|
1387
|
+
}
|
|
1388
|
+
declare const InsertDocInlineFormulaCommand: ICommand<IInsertDocInlineFormulaCommandParams>;
|
|
1389
|
+
interface IRecalculateDocInlineFormulasCommandParams {
|
|
1390
|
+
unitId?: string;
|
|
1391
|
+
extraVars?: Record<string, unknown>;
|
|
1392
|
+
}
|
|
1393
|
+
declare const RecalculateDocInlineFormulasCommand: ICommand<IRecalculateDocInlineFormulasCommandParams>;
|
|
1394
|
+
interface IInsertDocChartCommandParams {
|
|
1395
|
+
unitId?: string;
|
|
1396
|
+
offset?: number;
|
|
1397
|
+
spec: IDocEmbeddedChart;
|
|
1398
|
+
}
|
|
1399
|
+
declare const InsertDocChartCommand: ICommand<IInsertDocChartCommandParams>;
|
|
1400
|
+
interface IUpdateDocChartCommandParams {
|
|
1401
|
+
unitId?: string;
|
|
1402
|
+
id: string;
|
|
1403
|
+
patch: Partial<IDocEmbeddedChart>;
|
|
1404
|
+
}
|
|
1405
|
+
declare const UpdateDocChartCommand: ICommand<IUpdateDocChartCommandParams>;
|
|
1406
|
+
interface IRemoveDocChartCommandParams {
|
|
1407
|
+
unitId?: string;
|
|
1408
|
+
id: string;
|
|
1409
|
+
}
|
|
1410
|
+
declare const RemoveDocChartCommand: ICommand<IRemoveDocChartCommandParams>;
|
|
1411
|
+
interface IInsertDocShapeCommandParams {
|
|
1412
|
+
unitId?: string;
|
|
1413
|
+
offset?: number;
|
|
1414
|
+
spec: IDocEmbeddedShape;
|
|
1415
|
+
}
|
|
1416
|
+
declare const InsertDocShapeCommand: ICommand<IInsertDocShapeCommandParams>;
|
|
1417
|
+
interface IUpdateDocShapeCommandParams {
|
|
1418
|
+
unitId?: string;
|
|
1419
|
+
id: string;
|
|
1420
|
+
patch: Partial<IDocEmbeddedShape>;
|
|
1421
|
+
}
|
|
1422
|
+
declare const UpdateDocShapeCommand: ICommand<IUpdateDocShapeCommandParams>;
|
|
1423
|
+
interface IRemoveDocShapeCommandParams {
|
|
1424
|
+
unitId?: string;
|
|
1425
|
+
id: string;
|
|
1426
|
+
}
|
|
1427
|
+
declare const RemoveDocShapeCommand: ICommand<IRemoveDocShapeCommandParams>;
|
|
1428
|
+
interface ISortDocTableCommandParams {
|
|
1429
|
+
unitId?: string;
|
|
1430
|
+
tableIndex: number;
|
|
1431
|
+
columnIndex: number;
|
|
1432
|
+
direction?: 'asc' | 'desc';
|
|
1433
|
+
headerRowCount?: number;
|
|
1434
|
+
}
|
|
1435
|
+
declare const SortDocTableCommand: ICommand<ISortDocTableCommandParams>;
|
|
1436
|
+
interface ISetDocTableRepeatHeaderCommandParams {
|
|
1437
|
+
unitId?: string;
|
|
1438
|
+
tableIndex: number;
|
|
1439
|
+
headerRowCount: number;
|
|
1440
|
+
}
|
|
1441
|
+
declare const SetDocTableRepeatHeaderCommand: ICommand<ISetDocTableRepeatHeaderCommandParams>;
|
|
1442
|
+
interface IConvertTextToDocTableCommandParams {
|
|
1443
|
+
unitId?: string;
|
|
1444
|
+
text: string;
|
|
1445
|
+
delimiter?: string;
|
|
1446
|
+
offset?: number;
|
|
1447
|
+
}
|
|
1448
|
+
declare const ConvertTextToDocTableCommand: ICommand<IConvertTextToDocTableCommandParams>;
|
|
1449
|
+
interface IInsertDocRepeatingSectionCommandParams {
|
|
1450
|
+
unitId?: string;
|
|
1451
|
+
offset?: number;
|
|
1452
|
+
spec: IDocRepeatingSectionSpec;
|
|
1453
|
+
}
|
|
1454
|
+
declare const InsertDocRepeatingSectionCommand: ICommand<IInsertDocRepeatingSectionCommandParams>;
|
|
1455
|
+
interface IInsertDocBookmarkCommandParams {
|
|
1456
|
+
unitId?: string;
|
|
1457
|
+
spec: IDocInsertBookmarkSpec;
|
|
1458
|
+
}
|
|
1459
|
+
declare const InsertDocBookmarkCommand: ICommand<IInsertDocBookmarkCommandParams>;
|
|
1460
|
+
interface IRemoveDocBookmarkCommandParams {
|
|
1461
|
+
unitId?: string;
|
|
1462
|
+
nameOrId: string;
|
|
1463
|
+
}
|
|
1464
|
+
declare const RemoveDocBookmarkCommand: ICommand<IRemoveDocBookmarkCommandParams>;
|
|
1465
|
+
interface IInsertDocTableOfContentsCommandParams {
|
|
1466
|
+
unitId?: string;
|
|
1467
|
+
offset?: number;
|
|
1468
|
+
spec?: IDocTableOfContentsSpec;
|
|
1469
|
+
}
|
|
1470
|
+
declare const InsertDocTableOfContentsCommand: ICommand<IInsertDocTableOfContentsCommandParams>;
|
|
1471
|
+
interface IRefreshDocTableOfContentsCommandParams {
|
|
1472
|
+
unitId?: string;
|
|
1473
|
+
spec?: IDocTableOfContentsSpec;
|
|
1474
|
+
}
|
|
1475
|
+
declare const RefreshDocTableOfContentsCommand: ICommand<IRefreshDocTableOfContentsCommandParams>;
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Atomically applies `nextSnapshot` (`tableSource`, `drawings`, `documentStyle`, `metadata` + `body`)
|
|
1479
|
+
* and pushes a single unified Undo/Redo entry so both body mutations and auxiliary document tables/drawings/styles
|
|
1480
|
+
* revert and replay in lockstep.
|
|
1481
|
+
*/
|
|
1482
|
+
declare function executeWave2SnapshotUpdateWithUndoRedo(accessor: IAccessor, docModel: DocumentDataModel, prevSnapshotClone: IDocumentData, prevMetaClone: IDocTemplateMetadata, nextSnapshot: IDocumentData, cursorOffset?: number): boolean;
|
|
1483
|
+
interface ISetParagraphBorderAndShadingCommandParams {
|
|
1484
|
+
unitId?: string;
|
|
1485
|
+
paragraphIndex: number;
|
|
1486
|
+
spec: IDocParagraphBorderShadingSpec;
|
|
1487
|
+
}
|
|
1488
|
+
declare const SetParagraphBorderAndShadingCommand: ICommand<ISetParagraphBorderAndShadingCommandParams>;
|
|
1489
|
+
interface IInsertHorizontalDividerCommandParams {
|
|
1490
|
+
unitId?: string;
|
|
1491
|
+
style?: DocHorizontalDividerStyle;
|
|
1492
|
+
offset?: number;
|
|
1493
|
+
}
|
|
1494
|
+
declare const InsertHorizontalDividerCommand: ICommand<IInsertHorizontalDividerCommandParams>;
|
|
1495
|
+
interface ISetParagraphTabStopsCommandParams {
|
|
1496
|
+
unitId?: string;
|
|
1497
|
+
paragraphIndex: number;
|
|
1498
|
+
tabStops: IDocTabStop[];
|
|
1499
|
+
}
|
|
1500
|
+
declare const SetParagraphTabStopsCommand: ICommand<ISetParagraphTabStopsCommandParams>;
|
|
1501
|
+
interface IToggleHeadingCollapseCommandParams {
|
|
1502
|
+
unitId?: string;
|
|
1503
|
+
headingParagraphIndex: number;
|
|
1504
|
+
}
|
|
1505
|
+
declare const ToggleHeadingCollapseCommand: ICommand<IToggleHeadingCollapseCommandParams>;
|
|
1506
|
+
interface IFindAndReplaceDocTextCommandParams {
|
|
1507
|
+
unitId?: string;
|
|
1508
|
+
query: string;
|
|
1509
|
+
replacement: string;
|
|
1510
|
+
options?: IDocFindReplaceOptions;
|
|
1511
|
+
onResult?: (count: number) => void;
|
|
1512
|
+
}
|
|
1513
|
+
declare const FindAndReplaceDocTextCommand: ICommand<IFindAndReplaceDocTextCommandParams>;
|
|
1514
|
+
interface IInsertDocPageBreakCommandParams {
|
|
1515
|
+
unitId?: string;
|
|
1516
|
+
offset?: number;
|
|
1517
|
+
}
|
|
1518
|
+
declare const InsertDocPageBreakCommand: ICommand<IInsertDocPageBreakCommandParams>;
|
|
1519
|
+
interface IInsertDocSectionBreakCommandParams {
|
|
1520
|
+
unitId?: string;
|
|
1521
|
+
breakType?: DocSectionBreakKind;
|
|
1522
|
+
offset?: number;
|
|
1523
|
+
orientation?: 'portrait' | 'landscape';
|
|
1524
|
+
}
|
|
1525
|
+
declare const InsertDocSectionBreakCommand: ICommand<IInsertDocSectionBreakCommandParams>;
|
|
1526
|
+
interface IInsertDocColumnGroupCommandParams {
|
|
1527
|
+
unitId?: string;
|
|
1528
|
+
columnCount: 2 | 3 | 4 | 5;
|
|
1529
|
+
options?: IDocColumnGroupOptions;
|
|
1530
|
+
}
|
|
1531
|
+
declare const InsertDocColumnGroupCommand: ICommand<IInsertDocColumnGroupCommandParams>;
|
|
1532
|
+
interface ISetParagraphPaginationCommandParams {
|
|
1533
|
+
unitId?: string;
|
|
1534
|
+
paragraphIndex: number;
|
|
1535
|
+
spec: IDocParagraphPaginationSpec;
|
|
1536
|
+
}
|
|
1537
|
+
declare const SetParagraphPaginationCommand: ICommand<ISetParagraphPaginationCommandParams>;
|
|
1538
|
+
interface ISetDocPrintConfigCommandParams {
|
|
1539
|
+
unitId?: string;
|
|
1540
|
+
config: Partial<IDocPrintConfig>;
|
|
1541
|
+
}
|
|
1542
|
+
declare const SetDocPrintConfigCommand: ICommand<ISetDocPrintConfigCommandParams>;
|
|
1543
|
+
interface IUpdateDocImageTransformCommandParams {
|
|
1544
|
+
unitId?: string;
|
|
1545
|
+
drawingId: string;
|
|
1546
|
+
spec: IDocImageTransformSpec;
|
|
1547
|
+
}
|
|
1548
|
+
declare const UpdateDocImageTransformCommand: ICommand<IUpdateDocImageTransformCommandParams>;
|
|
1549
|
+
interface IInsertDocSmartArtCommandParams {
|
|
1550
|
+
unitId?: string;
|
|
1551
|
+
offset?: number;
|
|
1552
|
+
spec: IDocSmartArtSpec;
|
|
1553
|
+
}
|
|
1554
|
+
declare const InsertDocSmartArtCommand: ICommand<IInsertDocSmartArtCommandParams>;
|
|
1555
|
+
interface IUpdateDocSmartArtCommandParams {
|
|
1556
|
+
unitId?: string;
|
|
1557
|
+
id: string;
|
|
1558
|
+
patch: Partial<IDocSmartArtSpec>;
|
|
1559
|
+
}
|
|
1560
|
+
declare const UpdateDocSmartArtCommand: ICommand<IUpdateDocSmartArtCommandParams>;
|
|
1561
|
+
interface IRemoveDocSmartArtCommandParams {
|
|
1562
|
+
unitId?: string;
|
|
1563
|
+
id: string;
|
|
1564
|
+
}
|
|
1565
|
+
declare const RemoveDocSmartArtCommand: ICommand<IRemoveDocSmartArtCommandParams>;
|
|
1566
|
+
interface IInsertDocTableRowCommandParams {
|
|
1567
|
+
unitId?: string;
|
|
1568
|
+
tableIndex: number;
|
|
1569
|
+
rowIndex: number;
|
|
1570
|
+
position?: 'above' | 'below';
|
|
1571
|
+
}
|
|
1572
|
+
declare const InsertDocTableRowCommand: ICommand<IInsertDocTableRowCommandParams>;
|
|
1573
|
+
interface IDeleteDocTableRowCommandParams {
|
|
1574
|
+
unitId?: string;
|
|
1575
|
+
tableIndex: number;
|
|
1576
|
+
rowIndex: number;
|
|
1577
|
+
}
|
|
1578
|
+
declare const DeleteDocTableRowCommand: ICommand<IDeleteDocTableRowCommandParams>;
|
|
1579
|
+
interface IInsertDocTableColumnCommandParams {
|
|
1580
|
+
unitId?: string;
|
|
1581
|
+
tableIndex: number;
|
|
1582
|
+
colIndex: number;
|
|
1583
|
+
position?: 'left' | 'right';
|
|
1584
|
+
}
|
|
1585
|
+
declare const InsertDocTableColumnCommand: ICommand<IInsertDocTableColumnCommandParams>;
|
|
1586
|
+
interface IDeleteDocTableColumnCommandParams {
|
|
1587
|
+
unitId?: string;
|
|
1588
|
+
tableIndex: number;
|
|
1589
|
+
colIndex: number;
|
|
1590
|
+
}
|
|
1591
|
+
declare const DeleteDocTableColumnCommand: ICommand<IDeleteDocTableColumnCommandParams>;
|
|
1592
|
+
interface IMergeDocTableCellsCommandParams {
|
|
1593
|
+
unitId?: string;
|
|
1594
|
+
tableIndex: number;
|
|
1595
|
+
startRow: number;
|
|
1596
|
+
startCol: number;
|
|
1597
|
+
endRow: number;
|
|
1598
|
+
endCol: number;
|
|
1599
|
+
}
|
|
1600
|
+
declare const MergeDocTableCellsCommand: ICommand<IMergeDocTableCellsCommandParams>;
|
|
1601
|
+
interface ISplitDocTableCellCommandParams {
|
|
1602
|
+
unitId?: string;
|
|
1603
|
+
tableIndex: number;
|
|
1604
|
+
row: number;
|
|
1605
|
+
col: number;
|
|
1606
|
+
}
|
|
1607
|
+
declare const SplitDocTableCellCommand: ICommand<ISplitDocTableCellCommandParams>;
|
|
1608
|
+
interface IInsertDocFieldCommandParams {
|
|
1609
|
+
unitId?: string;
|
|
1610
|
+
fieldType: DocFieldType;
|
|
1611
|
+
instructionArgs?: string;
|
|
1612
|
+
offset?: number;
|
|
1613
|
+
context?: IDocFieldContext;
|
|
1614
|
+
fieldIdOut?: (id: string) => void;
|
|
1615
|
+
}
|
|
1616
|
+
declare const InsertDocFieldCommand: ICommand<IInsertDocFieldCommandParams>;
|
|
1617
|
+
interface IUpdateAllDocFieldsCommandParams {
|
|
1618
|
+
unitId?: string;
|
|
1619
|
+
context?: IDocFieldContext;
|
|
1620
|
+
}
|
|
1621
|
+
declare const UpdateAllDocFieldsCommand: ICommand<IUpdateAllDocFieldsCommandParams>;
|
|
1622
|
+
interface IInsertDocCaptionCommandParams {
|
|
1623
|
+
unitId?: string;
|
|
1624
|
+
category: DocCaptionCategory;
|
|
1625
|
+
title: string;
|
|
1626
|
+
offset?: number;
|
|
1627
|
+
captionIdOut?: (id: string) => void;
|
|
1628
|
+
}
|
|
1629
|
+
declare const InsertDocCaptionCommand: ICommand<IInsertDocCaptionCommandParams>;
|
|
1630
|
+
interface IInsertDocCrossReferenceCommandParams {
|
|
1631
|
+
unitId?: string;
|
|
1632
|
+
targetBookmarkOrCaptionId: string;
|
|
1633
|
+
offset?: number;
|
|
1634
|
+
fieldIdOut?: (id: string) => void;
|
|
1635
|
+
}
|
|
1636
|
+
declare const InsertDocCrossReferenceCommand: ICommand<IInsertDocCrossReferenceCommandParams>;
|
|
1637
|
+
interface IInsertDocCitationCommandParams {
|
|
1638
|
+
unitId?: string;
|
|
1639
|
+
source: IDocCitationSource;
|
|
1640
|
+
offset?: number;
|
|
1641
|
+
}
|
|
1642
|
+
declare const InsertDocCitationCommand: ICommand<IInsertDocCitationCommandParams>;
|
|
1643
|
+
interface IInsertDocBibliographyCommandParams {
|
|
1644
|
+
unitId?: string;
|
|
1645
|
+
offset?: number;
|
|
1646
|
+
title?: string;
|
|
1647
|
+
}
|
|
1648
|
+
declare const InsertDocBibliographyCommand: ICommand<IInsertDocBibliographyCommandParams>;
|
|
1649
|
+
interface IInsertDocBuildingBlockCommandParams {
|
|
1650
|
+
unitId?: string;
|
|
1651
|
+
blockId: string;
|
|
1652
|
+
offset?: number;
|
|
1653
|
+
}
|
|
1654
|
+
declare const InsertDocBuildingBlockCommand: ICommand<IInsertDocBuildingBlockCommandParams>;
|
|
1655
|
+
declare const ALL_DOC_WAVE2_COMMANDS: ICommand<any>[];
|
|
1656
|
+
|
|
1657
|
+
interface IInsertDocAreaCommandParams {
|
|
1658
|
+
unitId?: string;
|
|
1659
|
+
offset?: number;
|
|
1660
|
+
spec: IDocInsertAreaSpec;
|
|
1661
|
+
onResult?: (area: IDocAreaRegion) => void;
|
|
1662
|
+
}
|
|
1663
|
+
declare const InsertDocAreaCommand: ICommand<IInsertDocAreaCommandParams>;
|
|
1664
|
+
interface ISetDocAreaValueCommandParams {
|
|
1665
|
+
unitId?: string;
|
|
1666
|
+
areaId: string;
|
|
1667
|
+
newText: string;
|
|
1668
|
+
}
|
|
1669
|
+
declare const SetDocAreaValueCommand: ICommand<ISetDocAreaValueCommandParams>;
|
|
1670
|
+
interface ISetDocAreaPropertiesCommandParams {
|
|
1671
|
+
unitId?: string;
|
|
1672
|
+
areaId: string;
|
|
1673
|
+
patch: Partial<Omit<IDocAreaRegion, 'id' | 'startParagraphIndex' | 'endParagraphIndex'>>;
|
|
1674
|
+
}
|
|
1675
|
+
declare const SetDocAreaPropertiesCommand: ICommand<ISetDocAreaPropertiesCommandParams>;
|
|
1676
|
+
interface IDeleteDocAreaCommandParams {
|
|
1677
|
+
unitId?: string;
|
|
1678
|
+
areaId: string;
|
|
1679
|
+
force?: boolean;
|
|
1680
|
+
keepContent?: boolean;
|
|
1681
|
+
}
|
|
1682
|
+
declare const DeleteDocAreaCommand: ICommand<IDeleteDocAreaCommandParams>;
|
|
1683
|
+
interface ISetDocMainBadgeCommandParams {
|
|
1684
|
+
unitId?: string;
|
|
1685
|
+
badge: IDocCornerBadge | null;
|
|
1686
|
+
}
|
|
1687
|
+
declare const SetDocMainBadgeCommand: ICommand<ISetDocMainBadgeCommandParams>;
|
|
1688
|
+
interface ISetDocAreaBadgeCommandParams {
|
|
1689
|
+
unitId?: string;
|
|
1690
|
+
areaId: string;
|
|
1691
|
+
badge: IDocCornerBadge | null;
|
|
1692
|
+
}
|
|
1693
|
+
declare const SetDocAreaBadgeCommand: ICommand<ISetDocAreaBadgeCommandParams>;
|
|
1694
|
+
interface IInsertDocLabelBadgeCommandParams {
|
|
1695
|
+
unitId?: string;
|
|
1696
|
+
offset?: number;
|
|
1697
|
+
spec: IDocInsertLabelBadgeSpec;
|
|
1698
|
+
onResult?: (badge: IDocLabelBadge) => void;
|
|
1699
|
+
}
|
|
1700
|
+
declare const InsertDocLabelBadgeCommand: ICommand<IInsertDocLabelBadgeCommandParams>;
|
|
1701
|
+
interface IRemoveDocLabelBadgeCommandParams {
|
|
1702
|
+
unitId?: string;
|
|
1703
|
+
id: string;
|
|
1704
|
+
}
|
|
1705
|
+
declare const RemoveDocLabelBadgeCommand: ICommand<IRemoveDocLabelBadgeCommandParams>;
|
|
1706
|
+
interface ISetDocCascadeRulesCommandParams {
|
|
1707
|
+
unitId?: string;
|
|
1708
|
+
rules: IDocCascadeRule[];
|
|
1709
|
+
evaluateImmediately?: boolean;
|
|
1710
|
+
onResult?: (res: IDocCascadeEvaluationResult) => void;
|
|
1711
|
+
}
|
|
1712
|
+
declare const SetDocCascadeRulesCommand: ICommand<ISetDocCascadeRulesCommandParams>;
|
|
1713
|
+
interface IAddDocCascadeRuleCommandParams {
|
|
1714
|
+
unitId?: string;
|
|
1715
|
+
rule: IDocCascadeRule;
|
|
1716
|
+
evaluateImmediately?: boolean;
|
|
1717
|
+
onResult?: (res: IDocCascadeEvaluationResult) => void;
|
|
1718
|
+
}
|
|
1719
|
+
declare const AddDocCascadeRuleCommand: ICommand<IAddDocCascadeRuleCommandParams>;
|
|
1720
|
+
interface IRemoveDocCascadeRuleCommandParams {
|
|
1721
|
+
unitId?: string;
|
|
1722
|
+
ruleId: string;
|
|
1723
|
+
}
|
|
1724
|
+
declare const RemoveDocCascadeRuleCommand: ICommand<IRemoveDocCascadeRuleCommandParams>;
|
|
1725
|
+
interface IEvaluateDocCascadeRulesCommandParams {
|
|
1726
|
+
unitId?: string;
|
|
1727
|
+
extraData?: Record<string, unknown>;
|
|
1728
|
+
onResult?: (res: IDocCascadeEvaluationResult) => void;
|
|
1729
|
+
}
|
|
1730
|
+
declare const EvaluateDocCascadeRulesCommand: ICommand<IEvaluateDocCascadeRulesCommandParams>;
|
|
1731
|
+
interface IInsertStyledSeparatorCommandParams {
|
|
1732
|
+
unitId?: string;
|
|
1733
|
+
dashStyle: DocSeparatorDashStyle;
|
|
1734
|
+
color?: string;
|
|
1735
|
+
widthPt?: number;
|
|
1736
|
+
offset?: number;
|
|
1737
|
+
onResult?: (sep: IDocStyledSeparatorEntry) => void;
|
|
1738
|
+
}
|
|
1739
|
+
declare const InsertStyledSeparatorCommand: ICommand<IInsertStyledSeparatorCommandParams>;
|
|
1740
|
+
interface IInsertDocEmbedBlockCommandParams {
|
|
1741
|
+
unitId?: string;
|
|
1742
|
+
offset?: number;
|
|
1743
|
+
spec: IDocInsertEmbedBlockSpec;
|
|
1744
|
+
onResult?: (embed: IDocEmbedBlock) => void;
|
|
1745
|
+
}
|
|
1746
|
+
declare const InsertDocEmbedBlockCommand: ICommand<IInsertDocEmbedBlockCommandParams>;
|
|
1747
|
+
interface IRemoveDocEmbedBlockCommandParams {
|
|
1748
|
+
unitId?: string;
|
|
1749
|
+
id: string;
|
|
1750
|
+
}
|
|
1751
|
+
declare const RemoveDocEmbedBlockCommand: ICommand<IRemoveDocEmbedBlockCommandParams>;
|
|
1752
|
+
interface IApplyDocMacrosCommandParams {
|
|
1753
|
+
unitId?: string;
|
|
1754
|
+
extraMacros?: Record<string, DocMacroResolver>;
|
|
1755
|
+
onResult?: (count: number, resolvedValues: Record<string, string>) => void;
|
|
1756
|
+
}
|
|
1757
|
+
declare const ApplyDocMacrosCommand: ICommand<IApplyDocMacrosCommandParams>;
|
|
1758
|
+
interface IAddDocGraffitiStrokeCommandParams {
|
|
1759
|
+
unitId?: string;
|
|
1760
|
+
spec: IDocAddGraffitiStrokeSpec;
|
|
1761
|
+
onResult?: (stroke: IDocGraffitiStroke) => void;
|
|
1762
|
+
}
|
|
1763
|
+
declare const AddDocGraffitiStrokeCommand: ICommand<IAddDocGraffitiStrokeCommandParams>;
|
|
1764
|
+
interface IClearDocGraffitiStrokesCommandParams {
|
|
1765
|
+
unitId?: string;
|
|
1766
|
+
pageIndex?: number;
|
|
1767
|
+
}
|
|
1768
|
+
declare const ClearDocGraffitiStrokesCommand: ICommand<IClearDocGraffitiStrokesCommandParams>;
|
|
1769
|
+
declare const ALL_DOC_BATCH3_COMMANDS: Array<ICommand<any>>;
|
|
1770
|
+
|
|
1771
|
+
interface IHighlightInvalidDocSdtCommandParams {
|
|
1772
|
+
unitId?: string;
|
|
1773
|
+
clear?: boolean;
|
|
1774
|
+
}
|
|
1775
|
+
declare const HighlightInvalidDocSdtCommand: ICommand<IHighlightInvalidDocSdtCommandParams>;
|
|
1776
|
+
interface IJumpDocSdtControlCommandParams {
|
|
1777
|
+
unitId?: string;
|
|
1778
|
+
direction?: 'next' | 'prev';
|
|
1779
|
+
controlId?: string;
|
|
1780
|
+
}
|
|
1781
|
+
declare const JumpDocSdtControlCommand: ICommand<IJumpDocSdtControlCommandParams>;
|
|
1782
|
+
interface IInsertDocNoteCommandParams {
|
|
1783
|
+
unitId?: string;
|
|
1784
|
+
text: string;
|
|
1785
|
+
offset?: number;
|
|
1786
|
+
id?: string;
|
|
1787
|
+
onResult?: (note: IDocNoteEntry) => void;
|
|
1788
|
+
}
|
|
1789
|
+
declare const InsertDocFootnoteCommand: ICommand<IInsertDocNoteCommandParams>;
|
|
1790
|
+
declare const InsertDocEndnoteCommand: ICommand<IInsertDocNoteCommandParams>;
|
|
1791
|
+
interface IUpdateDocNoteCommandParams {
|
|
1792
|
+
unitId?: string;
|
|
1793
|
+
noteId: string;
|
|
1794
|
+
text: string;
|
|
1795
|
+
}
|
|
1796
|
+
declare const UpdateDocNoteCommand: ICommand<IUpdateDocNoteCommandParams>;
|
|
1797
|
+
interface IDeleteDocNoteCommandParams {
|
|
1798
|
+
unitId?: string;
|
|
1799
|
+
noteId: string;
|
|
1800
|
+
}
|
|
1801
|
+
declare const DeleteDocNoteCommand: ICommand<IDeleteDocNoteCommandParams>;
|
|
1802
|
+
interface ISetDocNoteSettingsCommandParams {
|
|
1803
|
+
unitId?: string;
|
|
1804
|
+
noteType: DocNoteType;
|
|
1805
|
+
settings: Partial<IDocNoteSettings>;
|
|
1806
|
+
}
|
|
1807
|
+
declare const SetDocNoteSettingsCommand: ICommand<ISetDocNoteSettingsCommandParams>;
|
|
1808
|
+
interface IInsertDocListCommandParams extends IDocListInsertSpec {
|
|
1809
|
+
unitId?: string;
|
|
1810
|
+
offset?: number;
|
|
1811
|
+
items?: Array<{
|
|
1812
|
+
text: string;
|
|
1813
|
+
level?: number;
|
|
1814
|
+
checked?: boolean;
|
|
1815
|
+
glyphType?: DocListGlyphType;
|
|
1816
|
+
}>;
|
|
1817
|
+
onResult?: (res: {
|
|
1818
|
+
listId: string;
|
|
1819
|
+
affectedParagraphIds: string[];
|
|
1820
|
+
}) => void;
|
|
1821
|
+
}
|
|
1822
|
+
declare const InsertDocListCommand: ICommand<IInsertDocListCommandParams>;
|
|
1823
|
+
interface ISetDocListGlyphTypeCommandParams {
|
|
1824
|
+
unitId?: string;
|
|
1825
|
+
listIdOrParagraphId: string;
|
|
1826
|
+
glyphType: DocListGlyphType;
|
|
1827
|
+
level?: number;
|
|
1828
|
+
}
|
|
1829
|
+
declare const SetDocListGlyphTypeCommand: ICommand<ISetDocListGlyphTypeCommandParams>;
|
|
1830
|
+
interface ISetDocListLevelCommandParams {
|
|
1831
|
+
unitId?: string;
|
|
1832
|
+
paragraphIdOrOffset?: string | number;
|
|
1833
|
+
nestingLevel: number;
|
|
1834
|
+
}
|
|
1835
|
+
declare const SetDocListLevelCommand: ICommand<ISetDocListLevelCommandParams>;
|
|
1836
|
+
interface IToggleDocListCheckboxCommandParams {
|
|
1837
|
+
unitId?: string;
|
|
1838
|
+
paragraphId: string;
|
|
1839
|
+
checked?: boolean;
|
|
1840
|
+
}
|
|
1841
|
+
declare const ToggleDocListCheckboxCommand: ICommand<IToggleDocListCheckboxCommandParams>;
|
|
1842
|
+
interface IRemoveDocTableOfContentsCommandParams {
|
|
1843
|
+
unitId?: string;
|
|
1844
|
+
}
|
|
1845
|
+
declare const RemoveDocTableOfContentsCommand: ICommand<IRemoveDocTableOfContentsCommandParams>;
|
|
1846
|
+
interface IUpdateDocColumnGroupCommandParams {
|
|
1847
|
+
unitId?: string;
|
|
1848
|
+
patch: Partial<IDocColumnGroupConfig>;
|
|
1849
|
+
}
|
|
1850
|
+
declare const UpdateDocColumnGroupCommand: ICommand<IUpdateDocColumnGroupCommandParams>;
|
|
1851
|
+
interface IDeleteDocColumnGroupCommandParams {
|
|
1852
|
+
unitId?: string;
|
|
1853
|
+
}
|
|
1854
|
+
declare const DeleteDocColumnGroupCommand: ICommand<IDeleteDocColumnGroupCommandParams>;
|
|
1855
|
+
interface ISetDocCustomPropertiesCommandParams {
|
|
1856
|
+
unitId?: string;
|
|
1857
|
+
customProperties?: Record<string, string | number | boolean>;
|
|
1858
|
+
company?: string;
|
|
1859
|
+
title?: string;
|
|
1860
|
+
}
|
|
1861
|
+
declare const SetDocCustomPropertiesCommand: ICommand<ISetDocCustomPropertiesCommandParams>;
|
|
1862
|
+
interface ISetDocSectionOrientationCommandParams {
|
|
1863
|
+
unitId?: string;
|
|
1864
|
+
orientation: DocPageOrientation;
|
|
1865
|
+
sectionKeyOrOffset?: string | number;
|
|
1866
|
+
}
|
|
1867
|
+
declare const SetDocSectionOrientationCommand: ICommand<ISetDocSectionOrientationCommandParams>;
|
|
1868
|
+
interface ISetDocTextDirectionCommandParams {
|
|
1869
|
+
unitId?: string;
|
|
1870
|
+
direction: DocTextDirection;
|
|
1871
|
+
paragraphIds?: string[];
|
|
1872
|
+
startOffset?: number;
|
|
1873
|
+
endOffset?: number;
|
|
1874
|
+
tableIndex?: number;
|
|
1875
|
+
tableId?: string;
|
|
1876
|
+
}
|
|
1877
|
+
declare const SetDocTextDirectionCommand: ICommand<ISetDocTextDirectionCommandParams>;
|
|
1878
|
+
interface ISetDocCopyPastePolicyCommandParams {
|
|
1879
|
+
unitId?: string;
|
|
1880
|
+
policy: Partial<IDocCopyPastePolicy>;
|
|
1881
|
+
}
|
|
1882
|
+
declare const SetDocCopyPastePolicyCommand: ICommand<ISetDocCopyPastePolicyCommandParams>;
|
|
1883
|
+
interface ISetDocTableBorderPresetCommandParams {
|
|
1884
|
+
unitId?: string;
|
|
1885
|
+
tableIndexOrId: number | string;
|
|
1886
|
+
preset: DocTableBorderPreset;
|
|
1887
|
+
color?: string;
|
|
1888
|
+
widthPt?: number;
|
|
1889
|
+
}
|
|
1890
|
+
declare const SetDocTableBorderPresetCommand: ICommand<ISetDocTableBorderPresetCommandParams>;
|
|
1891
|
+
interface ISetDocTableCellPropertiesCommandParams {
|
|
1892
|
+
unitId?: string;
|
|
1893
|
+
tableIndexOrId: number | string;
|
|
1894
|
+
rowIndex: number;
|
|
1895
|
+
colIndex: number;
|
|
1896
|
+
properties: IDocTableCellProperties;
|
|
1897
|
+
}
|
|
1898
|
+
declare const SetDocTableCellPropertiesCommand: ICommand<ISetDocTableCellPropertiesCommandParams>;
|
|
1899
|
+
interface IAutoFitDocTableCommandParams {
|
|
1900
|
+
unitId?: string;
|
|
1901
|
+
tableIndexOrId: number | string;
|
|
1902
|
+
mode?: DocTableAutoFitMode;
|
|
1903
|
+
}
|
|
1904
|
+
declare const AutoFitDocTableCommand: ICommand<IAutoFitDocTableCommandParams>;
|
|
1905
|
+
interface ICleanUpDocFormattingCommandParams {
|
|
1906
|
+
unitId?: string;
|
|
1907
|
+
options?: IDocCleanUpFormattingOptions;
|
|
1908
|
+
onResult?: (res: IDocCleanUpFormattingResult) => void;
|
|
1909
|
+
}
|
|
1910
|
+
declare const CleanUpDocFormattingCommand: ICommand<ICleanUpDocFormattingCommandParams>;
|
|
1911
|
+
interface ICompareDocSnapshotsToTrackCommandParams {
|
|
1912
|
+
unitId?: string;
|
|
1913
|
+
baseSnapshot: IDocumentData;
|
|
1914
|
+
revisedSnapshot?: IDocumentData;
|
|
1915
|
+
options?: IDocVisualComparisonOptions;
|
|
1916
|
+
onResult?: (res: IDocVisualComparisonResult) => void;
|
|
1917
|
+
}
|
|
1918
|
+
declare const CompareDocSnapshotsToTrackCommand: ICommand<ICompareDocSnapshotsToTrackCommandParams>;
|
|
1919
|
+
declare const ALL_DOC_ROUND1_COMMANDS: ICommand[];
|
|
1920
|
+
|
|
1921
|
+
interface IInsertDocHyperlinkCommandParams {
|
|
1922
|
+
unitId?: string;
|
|
1923
|
+
spec: IDocInsertHyperlinkSpec;
|
|
1924
|
+
onInserted?: (entry: IDocHyperlinkEntry) => void;
|
|
1925
|
+
}
|
|
1926
|
+
declare const InsertDocHyperlinkCommand: ICommand<IInsertDocHyperlinkCommandParams>;
|
|
1927
|
+
interface IUpdateDocHyperlinkCommandParams {
|
|
1928
|
+
unitId?: string;
|
|
1929
|
+
idOrOffset?: string | number;
|
|
1930
|
+
patch: IDocUpdateHyperlinkSpec;
|
|
1931
|
+
}
|
|
1932
|
+
declare const UpdateDocHyperlinkCommand: ICommand<IUpdateDocHyperlinkCommandParams>;
|
|
1933
|
+
interface ICancelDocHyperlinkCommandParams {
|
|
1934
|
+
unitId?: string;
|
|
1935
|
+
idOrOffset?: string | number;
|
|
1936
|
+
}
|
|
1937
|
+
declare const CancelDocHyperlinkCommand: ICommand<ICancelDocHyperlinkCommandParams>;
|
|
1938
|
+
interface IDeleteDocHyperlinkCommandParams {
|
|
1939
|
+
unitId?: string;
|
|
1940
|
+
idOrOffset?: string | number;
|
|
1941
|
+
}
|
|
1942
|
+
declare const DeleteDocHyperlinkCommand: ICommand<IDeleteDocHyperlinkCommandParams>;
|
|
1943
|
+
interface IAddDocCommentCommandParams {
|
|
1944
|
+
unitId?: string;
|
|
1945
|
+
spec: IDocAddCommentSpec;
|
|
1946
|
+
onAdded?: (comment: IDocCommentThread) => void;
|
|
1947
|
+
}
|
|
1948
|
+
declare const AddDocCommentCommand: ICommand<IAddDocCommentCommandParams>;
|
|
1949
|
+
interface IReplyDocCommentCommandParams {
|
|
1950
|
+
unitId?: string;
|
|
1951
|
+
commentId: string;
|
|
1952
|
+
spec: IDocReplyCommentSpec;
|
|
1953
|
+
onReplied?: (reply: IDocCommentReply) => void;
|
|
1954
|
+
}
|
|
1955
|
+
declare const ReplyDocCommentCommand: ICommand<IReplyDocCommentCommandParams>;
|
|
1956
|
+
interface IResolveDocCommentCommandParams {
|
|
1957
|
+
unitId?: string;
|
|
1958
|
+
commentId: string;
|
|
1959
|
+
resolved?: boolean;
|
|
1960
|
+
}
|
|
1961
|
+
declare const ResolveDocCommentCommand: ICommand<IResolveDocCommentCommandParams>;
|
|
1962
|
+
interface IDeleteDocCommentCommandParams {
|
|
1963
|
+
unitId?: string;
|
|
1964
|
+
commentId: string;
|
|
1965
|
+
}
|
|
1966
|
+
declare const DeleteDocCommentCommand: ICommand<IDeleteDocCommentCommandParams>;
|
|
1967
|
+
interface IToggleDocScriptCommandParams {
|
|
1968
|
+
unitId?: string;
|
|
1969
|
+
startOffset?: number;
|
|
1970
|
+
endOffset?: number;
|
|
1971
|
+
}
|
|
1972
|
+
declare const ToggleDocSuperscriptCommand: ICommand<IToggleDocScriptCommandParams>;
|
|
1973
|
+
declare const ToggleDocSubscriptCommand: ICommand<IToggleDocScriptCommandParams>;
|
|
1974
|
+
interface IInsertDocTitleCommandParams {
|
|
1975
|
+
unitId?: string;
|
|
1976
|
+
spec: IDocInsertTitleSpec;
|
|
1977
|
+
onInserted?: (entry: IDocTitleEntry) => void;
|
|
1978
|
+
}
|
|
1979
|
+
declare const InsertDocTitleCommand: ICommand<IInsertDocTitleCommandParams>;
|
|
1980
|
+
interface ISetDocTitlePropertiesCommandParams {
|
|
1981
|
+
unitId?: string;
|
|
1982
|
+
idOrConceptId: string;
|
|
1983
|
+
patch: Partial<IDocTitleProperties>;
|
|
1984
|
+
}
|
|
1985
|
+
declare const SetDocTitlePropertiesCommand: ICommand<ISetDocTitlePropertiesCommandParams>;
|
|
1986
|
+
declare const ALL_DOC_ROUND3_COMMANDS: ICommand[];
|
|
1987
|
+
|
|
1988
|
+
declare function getTargetDocModel(accessor: IAccessor, unitId?: string): DocumentDataModel | null;
|
|
1989
|
+
declare function syncSnapshotAuxFields(docModel: DocumentDataModel, nextSnapshot: Partial<IDocumentData>): void;
|
|
1990
|
+
/**
|
|
1991
|
+
* Applies `nextBody` via `RichTextEditingMutation` so Univer's skeleton, canvas layout,
|
|
1992
|
+
* selection state, and `IUndoRedoService` undo/redo stack stay 100% synchronized.
|
|
1993
|
+
*/
|
|
1994
|
+
declare function executeBodyUpdateViaRichTextMutation(accessor: IAccessor, docModel: DocumentDataModel, nextBody: IDocumentBody, cursorOffset?: number, bypassContentLock?: boolean, allowInViewMode?: boolean): boolean;
|
|
1995
|
+
interface IInsertDocSdtCommandParams {
|
|
1996
|
+
unitId?: string;
|
|
1997
|
+
offset?: number;
|
|
1998
|
+
endOffset?: number;
|
|
1999
|
+
segmentId?: string;
|
|
2000
|
+
spec: Partial<IDocSdtControlSpec> & {
|
|
2001
|
+
alias: string;
|
|
2002
|
+
};
|
|
2003
|
+
initialValue?: string | boolean;
|
|
2004
|
+
}
|
|
2005
|
+
declare const InsertDocSdtCommand: ICommand<IInsertDocSdtCommandParams>;
|
|
2006
|
+
interface IUpdateDocSdtValueCommandParams {
|
|
2007
|
+
unitId?: string;
|
|
2008
|
+
controlId: string;
|
|
2009
|
+
value: string | boolean;
|
|
2010
|
+
segmentId?: string;
|
|
2011
|
+
/** Allow programmatic form/dataset updates even if `contentLocked` is set */
|
|
2012
|
+
force?: boolean;
|
|
2013
|
+
}
|
|
2014
|
+
declare const UpdateDocSdtValueCommand: ICommand<IUpdateDocSdtValueCommandParams>;
|
|
2015
|
+
interface IUpdateDocSdtPropertiesCommandParams {
|
|
2016
|
+
unitId?: string;
|
|
2017
|
+
controlId: string;
|
|
2018
|
+
segmentId?: string;
|
|
2019
|
+
patch: Partial<IDocSdtControlSpec>;
|
|
2020
|
+
}
|
|
2021
|
+
declare const UpdateDocSdtPropertiesCommand: ICommand<IUpdateDocSdtPropertiesCommandParams>;
|
|
2022
|
+
interface IDeleteDocSdtCommandParams {
|
|
2023
|
+
unitId?: string;
|
|
2024
|
+
controlId: string;
|
|
2025
|
+
segmentId?: string;
|
|
2026
|
+
keepText?: boolean;
|
|
2027
|
+
force?: boolean;
|
|
2028
|
+
}
|
|
2029
|
+
declare const DeleteDocSdtCommand: ICommand<IDeleteDocSdtCommandParams>;
|
|
2030
|
+
interface IFillDocDatasetCommandParams {
|
|
2031
|
+
unitId?: string;
|
|
2032
|
+
data: Record<string, unknown>;
|
|
2033
|
+
}
|
|
2034
|
+
declare const FillDocDatasetCommand: ICommand<IFillDocDatasetCommandParams>;
|
|
2035
|
+
interface IReplaceDocUnitSnapshotCommandParams {
|
|
2036
|
+
unitId?: string;
|
|
2037
|
+
snapshot: Partial<IDocumentData>;
|
|
2038
|
+
/** Allow host preview refresh even when unit is in `view` mode */
|
|
2039
|
+
allowInViewMode?: boolean;
|
|
2040
|
+
}
|
|
2041
|
+
declare const ReplaceDocUnitSnapshotCommand: ICommand<IReplaceDocUnitSnapshotCommandParams>;
|
|
2042
|
+
interface ISetDocModeCommandParams {
|
|
2043
|
+
unitId?: string;
|
|
2044
|
+
mode: DocWorkMode;
|
|
2045
|
+
}
|
|
2046
|
+
declare const SetDocModeCommand: ICommand<ISetDocModeCommandParams>;
|
|
2047
|
+
interface ISetDocTableRowLoopCommandParams {
|
|
2048
|
+
unitId?: string;
|
|
2049
|
+
tableId: string;
|
|
2050
|
+
rowIndex: number;
|
|
2051
|
+
config: Omit<IDocTableRowLoopConfig, 'tableId' | 'rowIndex'> | null;
|
|
2052
|
+
}
|
|
2053
|
+
declare const SetDocTableRowLoopCommand: ICommand<ISetDocTableRowLoopCommandParams>;
|
|
2054
|
+
interface IEvaluateDocTableFormulasCommandParams {
|
|
2055
|
+
unitId?: string;
|
|
2056
|
+
}
|
|
2057
|
+
declare const EvaluateDocTableFormulasCommand: ICommand<IEvaluateDocTableFormulasCommandParams>;
|
|
2058
|
+
interface ISaveDocVersionCommandParams {
|
|
2059
|
+
unitId?: string;
|
|
2060
|
+
label?: string;
|
|
2061
|
+
}
|
|
2062
|
+
declare const SaveDocVersionCommand: ICommand<ISaveDocVersionCommandParams>;
|
|
2063
|
+
interface IRestoreDocVersionCommandParams {
|
|
2064
|
+
unitId?: string;
|
|
2065
|
+
versionId: string;
|
|
2066
|
+
}
|
|
2067
|
+
declare const RestoreDocVersionCommand: ICommand<IRestoreDocVersionCommandParams>;
|
|
2068
|
+
interface ISetDocTrackChangesCommandParams {
|
|
2069
|
+
unitId?: string;
|
|
2070
|
+
enabled: boolean;
|
|
2071
|
+
author?: string;
|
|
2072
|
+
}
|
|
2073
|
+
declare const SetDocTrackChangesCommand: ICommand<ISetDocTrackChangesCommandParams>;
|
|
2074
|
+
interface IRecordDocRevisionCommandParams {
|
|
2075
|
+
unitId?: string;
|
|
2076
|
+
type: DocTrackRevisionType;
|
|
2077
|
+
text?: string;
|
|
2078
|
+
index?: number;
|
|
2079
|
+
endIndex?: number;
|
|
2080
|
+
author?: string;
|
|
2081
|
+
}
|
|
2082
|
+
declare const RecordDocRevisionCommand: ICommand<IRecordDocRevisionCommandParams>;
|
|
2083
|
+
interface IResolveDocRevisionCommandParams {
|
|
2084
|
+
unitId?: string;
|
|
2085
|
+
revisionId?: string;
|
|
2086
|
+
action: 'accept' | 'reject';
|
|
2087
|
+
all?: boolean;
|
|
2088
|
+
}
|
|
2089
|
+
declare const ResolveDocRevisionCommand: ICommand<IResolveDocRevisionCommandParams>;
|
|
2090
|
+
declare function resolveActiveInsertOffset(accessor: IAccessor, body: IDocumentBody, explicitOffset?: number): number;
|
|
2091
|
+
interface ISetDocActiveRoleCommandParams {
|
|
2092
|
+
unitId?: string;
|
|
2093
|
+
role?: string;
|
|
2094
|
+
}
|
|
2095
|
+
declare const SetDocActiveRoleCommand: ICommand<ISetDocActiveRoleCommandParams>;
|
|
2096
|
+
interface IInsertDocMedicalFormulaCommandParams {
|
|
2097
|
+
unitId?: string;
|
|
2098
|
+
offset?: number;
|
|
2099
|
+
blockId?: string;
|
|
2100
|
+
spec: IDocMedicalFormulaSpec;
|
|
2101
|
+
}
|
|
2102
|
+
declare const InsertDocMedicalFormulaCommand: ICommand<IInsertDocMedicalFormulaCommandParams>;
|
|
2103
|
+
interface IInsertDocCodeBlockCommandParams {
|
|
2104
|
+
unitId?: string;
|
|
2105
|
+
offset?: number;
|
|
2106
|
+
id?: string;
|
|
2107
|
+
code: string;
|
|
2108
|
+
language?: string;
|
|
2109
|
+
}
|
|
2110
|
+
declare const InsertDocCodeBlockCommand: ICommand<IInsertDocCodeBlockCommandParams>;
|
|
2111
|
+
interface IInsertDocQrOrBarcodeBlockCommandParams {
|
|
2112
|
+
unitId?: string;
|
|
2113
|
+
offset?: number;
|
|
2114
|
+
blockId?: string;
|
|
2115
|
+
spec: IDocBarcodeBlockSpec;
|
|
2116
|
+
}
|
|
2117
|
+
declare const InsertDocQrOrBarcodeBlockCommand: ICommand<IInsertDocQrOrBarcodeBlockCommandParams>;
|
|
2118
|
+
|
|
2119
|
+
declare function inflateRawSync(src: Uint8Array, strict?: boolean): Uint8Array;
|
|
2120
|
+
declare function importHtmlToDocData(html: string, title?: string): IDocumentData;
|
|
2121
|
+
/**
|
|
2122
|
+
* Synchronously auto-detects and parses legacy/open office formats into Univer `IDocumentData`:
|
|
2123
|
+
* 1) RTF (`{\rtf1...` with `\par`, `\b`, `\i`, `\ul`, `\fsN`, `\uN?`, `\'xx`, `\trowd...\cell...\row`)
|
|
2124
|
+
* 2) Word 2003 WordprocessingML XML (`<?mso-application progid="Word.Document"?>` / `<w:wordDocument>`)
|
|
2125
|
+
* 3) HTML-wrapped `.doc` (`<html xmlns:w="urn:schemas-microsoft-com:office:word">`)
|
|
2126
|
+
* 4) OpenDocument Text `.odt` (`content.xml` inside ZIP `<text:h>`, `<text:p>`, `<table:table>`)
|
|
2127
|
+
* 5) Binary OLE2 `.doc` (`0xD0 0xCF 0x11 0xE0` FIB/WordDocument UTF-16LE & CP1252 text extraction)
|
|
2128
|
+
*/
|
|
2129
|
+
declare function importLegacyDocBytes(bytes: Uint8Array, title?: string): IDocumentData;
|
|
2130
|
+
declare function exportDocToRtf(rawSnapshot: IDocumentData, data?: Record<string, unknown>): string;
|
|
2131
|
+
declare function exportDocToOdtBytes(rawSnapshot: IDocumentData, data?: Record<string, unknown>): Uint8Array;
|
|
2132
|
+
|
|
2133
|
+
type DocMarkdownAlign = 'left' | 'center' | 'right' | 'none';
|
|
2134
|
+
/**
|
|
2135
|
+
* Parses a GitHub-Flavored Markdown (`.md`) document into a complete Univer `IDocumentData` snapshot.
|
|
2136
|
+
* Supports `H1..H6`, bold/italic/strike/inline-code, fenced code blocks, blockquotes, GFM Callouts
|
|
2137
|
+
* (`> [!NOTE|TIP|WARNING|IMPORTANT|CAUTION]`), ordered/unordered/task lists (`- [x]`), GFM tables
|
|
2138
|
+
* with column alignment, links, images, horizontal rules `---`, and `$...$` / `$$...$$` LaTeX math.
|
|
2139
|
+
*/
|
|
2140
|
+
declare function importMarkdownToDocData(markdown: string, title?: string): IDocumentData;
|
|
2141
|
+
/**
|
|
2142
|
+
* Exports a Univer `IDocumentData` snapshot (with optional dataset fill `data`) into clean GitHub-Flavored Markdown (`.md`).
|
|
2143
|
+
*/
|
|
2144
|
+
declare function exportDocToMarkdown(rawSnapshot: IDocumentData, data?: Record<string, unknown>): string;
|
|
2145
|
+
|
|
2146
|
+
interface IDocPdfExportOptions extends Partial<IDocPrintConfig> {
|
|
2147
|
+
/** Optional business dataset filled prior to pagination */
|
|
2148
|
+
data?: Record<string, unknown>;
|
|
2149
|
+
/** Government Red-Header Banner (`公文红头版头`) rendered on page 1 with double red vector lines */
|
|
2150
|
+
redHeaderText?: string;
|
|
2151
|
+
/** Alias for `redHeaderText` */
|
|
2152
|
+
redHeaderTitle?: string;
|
|
2153
|
+
/** Render legal left-gutter line numbers (`1, 2, 3...`) */
|
|
2154
|
+
showLineNumbers?: boolean;
|
|
2155
|
+
/** Render tiled diagonal anti-counterfeit watermark across every page */
|
|
2156
|
+
watermarkText?: string;
|
|
2157
|
+
/** Render background image watermark data URL across every page */
|
|
2158
|
+
imageWatermarkDataUrl?: string;
|
|
2159
|
+
/** Image watermark opacity (`0..1`) */
|
|
2160
|
+
imageWatermarkOpacity?: number;
|
|
2161
|
+
/** Render cross-page vector straddle seal (`跨页骑缝章`) sliced `[i/N, (i+1)/N]` on right page edge */
|
|
2162
|
+
straddleSealText?: string;
|
|
2163
|
+
/** Optional handwritten signature PNG/JPEG/SVG data URL appended at sign-off */
|
|
2164
|
+
signatureImageDataUrl?: string;
|
|
2165
|
+
/** Render page footer with page numbers (`Page i / N`). Default: `true` */
|
|
2166
|
+
showPageFooter?: boolean;
|
|
2167
|
+
/** Pre-printed certificate mode: hides static boilerplate text while keeping filled SDT & dynamic bound values at exact layout positions */
|
|
2168
|
+
printFieldsOnly?: boolean;
|
|
2169
|
+
}
|
|
2170
|
+
interface IPdfRasterImageAsset {
|
|
2171
|
+
key: string;
|
|
2172
|
+
pdfName: string;
|
|
2173
|
+
widthPx: number;
|
|
2174
|
+
heightPx: number;
|
|
2175
|
+
colorSpace: '/DeviceRGB' | '/DeviceGray' | '/DeviceCMYK';
|
|
2176
|
+
bitsPerComponent: number;
|
|
2177
|
+
filter?: '/DCTDecode';
|
|
2178
|
+
dataBytes: Uint8Array;
|
|
2179
|
+
smaskBytes?: Uint8Array;
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* Pure-TS decoder turning `data:image/png;base64,...` or `data:image/jpeg;base64,...` into a PDF 1.4 `/Subtype /Image` XObject!
|
|
2183
|
+
*/
|
|
2184
|
+
declare function decodeImageDataUrlForPdf(dataUrl: string, pdfName: string): IPdfRasterImageAsset | null;
|
|
2185
|
+
/**
|
|
2186
|
+
* 100% zero-dependency pure-TS PDF 1.4 binary compiler (`Uint8Array`).
|
|
2187
|
+
* Paginates Univer `IDocumentData` onto A4 pages (`595.28 x 841.89 pt`) with selectable ASCII (`/Helvetica`)
|
|
2188
|
+
* + CJK (`Type0 /STSong-Light /UniGB-UTF16-H` `<FEFF...>`) text, tables, SDT visualChrome & risk highlights,
|
|
2189
|
+
* `printFieldsOnly` certificate overprinting, Government Red-Header banner, legal line numbers,
|
|
2190
|
+
* real PNG/JPEG/SVG watermark & signature XObjects, and `[i/N, (i+1)/N]` sliced cross-page straddle seal!
|
|
2191
|
+
*/
|
|
2192
|
+
declare function exportDocToPdfBytes(rawSnapshot: IDocumentData, options?: IDocPdfExportOptions): Uint8Array;
|
|
2193
|
+
/**
|
|
2194
|
+
* Batch mail-merge multi-record PDF 1.4 compiler:
|
|
2195
|
+
* expands `templateSnapshot` for every record in `records` (including table row loops, `visibleIf`,
|
|
2196
|
+
* `computedExpr`, and in-table formulas) and compiles all records into a single continuous `%PDF-1.4` binary
|
|
2197
|
+
* with independent per-record page numbering (`Page 1 / N_r`) and per-record sliced straddle seal (`[i/N_r, (i+1)/N_r]`)!
|
|
2198
|
+
*/
|
|
2199
|
+
declare function exportBatchDocPdfBytes(templateSnapshot: IDocumentData, records: Array<Record<string, unknown>>, options?: Omit<IDocPdfExportOptions, 'data'>): Uint8Array;
|
|
2200
|
+
|
|
2201
|
+
type DocxImportErrorCode = 'INVALID_ZIP' | 'MISSING_DOCUMENT_XML' | 'DECOMPRESSION_UNSUPPORTED' | 'CORRUPT_ARCHIVE';
|
|
2202
|
+
declare class DocxImportError extends Error {
|
|
2203
|
+
readonly code: DocxImportErrorCode;
|
|
2204
|
+
constructor(code: DocxImportErrorCode, message: string);
|
|
2205
|
+
}
|
|
2206
|
+
interface IDocxImportReport {
|
|
2207
|
+
documentData: IDocumentData;
|
|
2208
|
+
warnings: IDocImportWarning[];
|
|
2209
|
+
}
|
|
2210
|
+
interface IDocxExportCapabilitiesReport {
|
|
2211
|
+
tableCount: number;
|
|
2212
|
+
imageCount: number;
|
|
2213
|
+
headerCount: number;
|
|
2214
|
+
footerCount: number;
|
|
2215
|
+
sdtCount: number;
|
|
2216
|
+
pageBreakCount: number;
|
|
2217
|
+
notesCount: number;
|
|
2218
|
+
snapshotByteSize: number;
|
|
2219
|
+
warnings: string[];
|
|
2220
|
+
}
|
|
2221
|
+
declare function inspectDocxExportCapabilities(snapshot: Partial<IDocumentData> | null | undefined): IDocxExportCapabilitiesReport;
|
|
2222
|
+
declare function resolveUnderlineCssStyle(ul?: ITextStyle['ul']): {
|
|
2223
|
+
style: 'solid' | 'double' | 'dashed' | 'dotted' | 'wavy';
|
|
2224
|
+
color?: string;
|
|
2225
|
+
};
|
|
2226
|
+
/**
|
|
2227
|
+
* Generates standard multi-part Word `.docx` binary bytes (`Uint8Array`) from a Univer `IDocumentData` snapshot,
|
|
2228
|
+
* preserving styles, numbering, headers/footers, inline images, tables (`gridSpan`, `vMerge`, `tblHeader`),
|
|
2229
|
+
* page breaks (`w:br w:type="page"`), document page setup, and `<w:sdt>` Structured Document Tags!
|
|
2230
|
+
*/
|
|
2231
|
+
declare function exportDocxBytes(rawSnapshot: IDocumentData, data?: Record<string, unknown>, exportOptions?: {
|
|
2232
|
+
signatureImageDataUrl?: string;
|
|
2233
|
+
watermarkLayer?: 'behind' | 'front';
|
|
2234
|
+
watermarkText?: string;
|
|
2235
|
+
imageWatermarkDataUrl?: string;
|
|
2236
|
+
}): Uint8Array;
|
|
2237
|
+
interface IDocBatchDocxFileItem {
|
|
2238
|
+
fileName: string;
|
|
2239
|
+
bytes: Uint8Array;
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Expands `templateSnapshot` across `records` and returns an array of `{ fileName, bytes }` Word `.docx` binaries.
|
|
2243
|
+
*/
|
|
2244
|
+
declare function exportBatchDocxFiles(templateSnapshot: IDocumentData, records: Array<Record<string, unknown>>, fileNamePattern?: string): IDocBatchDocxFileItem[];
|
|
2245
|
+
|
|
2246
|
+
interface IDocHtmlPrintOptions extends Partial<IDocPrintConfig> {
|
|
2247
|
+
watermarkText?: string;
|
|
2248
|
+
imageWatermarkDataUrl?: string;
|
|
2249
|
+
imageWatermarkOpacity?: number;
|
|
2250
|
+
redHeaderTitle?: string;
|
|
2251
|
+
showPageFooter?: boolean;
|
|
2252
|
+
/** Render legal left-gutter line numbers (`1, 2, 3...`) */
|
|
2253
|
+
showLineNumbers?: boolean;
|
|
2254
|
+
/** Render vector red multi-page straddle seal (`跨页骑缝章`) on right page edge */
|
|
2255
|
+
straddleSealText?: string;
|
|
2256
|
+
/** Optional handwritten signature PNG/SVG data URL appended at sign-off */
|
|
2257
|
+
signatureImageDataUrl?: string;
|
|
2258
|
+
/** Pre-printed certificate mode: hides static boilerplate text while keeping filled SDT & dynamic bound values at exact layout coordinates */
|
|
2259
|
+
printFieldsOnly?: boolean;
|
|
2260
|
+
}
|
|
2261
|
+
/**
|
|
2262
|
+
* Exports clean standalone A4 print-ready HTML string preserving tables (`thead` repeat & evaluated formulas),
|
|
2263
|
+
* page breaks, SDT badges (honoring `visualChrome`, risk alert highlights, and `printFieldsOnly`),
|
|
2264
|
+
* inline medical/barcode drawings, code blocks, legal line numbers, straddle seal (`骑缝章`),
|
|
2265
|
+
* handwritten signature, Red-Header banner, and tiled diagonal watermark.
|
|
2266
|
+
*/
|
|
2267
|
+
declare function exportDocHtmlString(rawSnapshot: IDocumentData, data?: Record<string, unknown>, printOptions?: IDocHtmlPrintOptions): string;
|
|
2268
|
+
/**
|
|
2269
|
+
* Pure-frontend `.docx` parser returning both Univer `IDocumentData` and an explicit loss/warning manifest.
|
|
2270
|
+
* Throws `DocxImportError` instead of silently returning placeholder documents when archive/compression fails!
|
|
2271
|
+
*/
|
|
2272
|
+
declare function parseDocxBytesWithReport(bytes: Uint8Array, title?: string): Promise<IDocxImportReport>;
|
|
2273
|
+
/**
|
|
2274
|
+
* Pure-frontend `.docx` parser returning Univer `IDocumentData`.
|
|
2275
|
+
* Throws `DocxImportError` on invalid or corrupt archives (no silent fallback!).
|
|
2276
|
+
*/
|
|
2277
|
+
declare function parseDocxBytesToDocData(bytes: Uint8Array, title?: string): Promise<IDocumentData>;
|
|
2278
|
+
|
|
2279
|
+
type DocExportFormat = 'docx' | 'html' | 'pdf' | 'json' | 'rtf' | 'odt' | 'doc' | 'md';
|
|
2280
|
+
/**
|
|
2281
|
+
* Per-operation IO execution target:
|
|
2282
|
+
* - `'auto'` (default): uses `'server'` when a server adapter hook is registered, otherwise `'browser'`
|
|
2283
|
+
* - `'browser'`: forces local browser engine (zero upload; never silently falls back to server on error)
|
|
2284
|
+
* - `'server'`: forces backend adapter hook (throws `DocIoTargetError` if not configured; never silently falls back to browser)
|
|
2285
|
+
*/
|
|
2286
|
+
type DocIoTarget = 'auto' | 'browser' | 'server';
|
|
2287
|
+
declare class DocIoTargetError extends Error {
|
|
2288
|
+
readonly code: "SERVER_ADAPTER_NOT_CONFIGURED";
|
|
2289
|
+
readonly target: "server";
|
|
2290
|
+
readonly suggestedFallback: "browser";
|
|
2291
|
+
constructor(message: string);
|
|
2292
|
+
}
|
|
2293
|
+
interface IDocIoCapabilities {
|
|
2294
|
+
browser: {
|
|
2295
|
+
importDocx: true;
|
|
2296
|
+
exportDocx: true;
|
|
2297
|
+
exportHtml: true;
|
|
2298
|
+
exportPdf: true;
|
|
2299
|
+
importMarkdown: true;
|
|
2300
|
+
exportMarkdown: true;
|
|
2301
|
+
};
|
|
2302
|
+
server: {
|
|
2303
|
+
adapterName: string;
|
|
2304
|
+
importDoc: boolean;
|
|
2305
|
+
exportDoc: boolean;
|
|
2306
|
+
onSave: boolean;
|
|
2307
|
+
};
|
|
2308
|
+
recommendedDefaultTarget: 'server' | 'browser';
|
|
2309
|
+
}
|
|
2310
|
+
interface IDocImportOutcomeReport {
|
|
2311
|
+
documentData: Partial<IDocumentData>;
|
|
2312
|
+
warnings: IDocImportWarning[];
|
|
2313
|
+
executedBy: 'browser' | 'server';
|
|
2314
|
+
}
|
|
2315
|
+
interface IDocImportContext {
|
|
2316
|
+
unitId?: string;
|
|
2317
|
+
defaultImport: (file: File) => Promise<Partial<IDocumentData>>;
|
|
2318
|
+
}
|
|
2319
|
+
interface IDocExportContext {
|
|
2320
|
+
unitId: string;
|
|
2321
|
+
snapshot: IDocumentData;
|
|
2322
|
+
format: DocExportFormat;
|
|
2323
|
+
data?: Record<string, unknown>;
|
|
2324
|
+
pdfOptions?: IDocPdfExportOptions;
|
|
2325
|
+
defaultExport: () => Promise<Uint8Array>;
|
|
2326
|
+
}
|
|
2327
|
+
interface IDocSaveContext {
|
|
2328
|
+
unitId: string;
|
|
2329
|
+
snapshot: IDocumentData;
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* Pluggable Import / Export / Save IO adapter for `@yudaocode/univer-docs`.
|
|
2333
|
+
* Built-in pure frontend engine supports `.docx` (with `<w:sdt>` Structured Document Tags),
|
|
2334
|
+
* `.html`, and `.json` out of the box; host apps can override any hook to delegate to backend APIs.
|
|
2335
|
+
*/
|
|
2336
|
+
interface IDocIoAdapter {
|
|
2337
|
+
name?: string;
|
|
2338
|
+
importDoc?: (file: File, context: IDocImportContext) => Promise<Partial<IDocumentData>>;
|
|
2339
|
+
exportDoc?: (context: IDocExportContext) => Promise<Uint8Array | ArrayBuffer | Blob>;
|
|
2340
|
+
onSave?: (context: IDocSaveContext) => Promise<void> | void;
|
|
2341
|
+
}
|
|
2342
|
+
interface IDocIoService {
|
|
2343
|
+
readonly adapter$: Observable<IDocIoAdapter>;
|
|
2344
|
+
readonly saved$: Observable<IDocSavedEvent>;
|
|
2345
|
+
getAdapter(): IDocIoAdapter;
|
|
2346
|
+
setAdapter(adapter: IDocIoAdapter): void;
|
|
2347
|
+
getIoCapabilities(): IDocIoCapabilities;
|
|
2348
|
+
onBeforeSave(cb: (ev: IDocBeforeSaveEvent) => void | boolean | Promise<void | boolean>, unitId?: string): IDisposable;
|
|
2349
|
+
onSaved(cb: (ev: IDocSavedEvent) => void, unitId?: string): IDisposable;
|
|
2350
|
+
importDoc(file: File, unitId?: string, options?: {
|
|
2351
|
+
target?: DocIoTarget;
|
|
2352
|
+
}): Promise<Partial<IDocumentData>>;
|
|
2353
|
+
importDocWithReport(file: File, options?: {
|
|
2354
|
+
unitId?: string;
|
|
2355
|
+
target?: DocIoTarget;
|
|
2356
|
+
}): Promise<IDocImportOutcomeReport>;
|
|
2357
|
+
exportDoc(params: {
|
|
2358
|
+
unitId: string;
|
|
2359
|
+
snapshot: IDocumentData;
|
|
2360
|
+
format?: DocExportFormat;
|
|
2361
|
+
data?: Record<string, unknown>;
|
|
2362
|
+
pdfOptions?: IDocPdfExportOptions;
|
|
2363
|
+
target?: DocIoTarget;
|
|
2364
|
+
}): Promise<Uint8Array>;
|
|
2365
|
+
saveToHost(context: IDocSaveContext): Promise<boolean>;
|
|
2366
|
+
}
|
|
2367
|
+
declare const IDocIoService: _univerjs_core.IdentifierDecorator<IDocIoService>;
|
|
2368
|
+
declare class DocIoService extends Disposable implements IDocIoService {
|
|
2369
|
+
private readonly _adapter$;
|
|
2370
|
+
private readonly _saved$;
|
|
2371
|
+
private _nextHookId;
|
|
2372
|
+
private readonly _beforeSaveHooks;
|
|
2373
|
+
private readonly _savedHooks;
|
|
2374
|
+
readonly adapter$: Observable<IDocIoAdapter>;
|
|
2375
|
+
readonly saved$: Observable<IDocSavedEvent>;
|
|
2376
|
+
constructor();
|
|
2377
|
+
onBeforeSave(cb: (ev: IDocBeforeSaveEvent) => void | boolean | Promise<void | boolean>, unitId?: string): IDisposable;
|
|
2378
|
+
onSaved(cb: (ev: IDocSavedEvent) => void, unitId?: string): IDisposable;
|
|
2379
|
+
getAdapter(): IDocIoAdapter;
|
|
2380
|
+
setAdapter(adapter: IDocIoAdapter): void;
|
|
2381
|
+
getIoCapabilities(): IDocIoCapabilities;
|
|
2382
|
+
importDocWithReport(file: File, options?: {
|
|
2383
|
+
unitId?: string;
|
|
2384
|
+
target?: DocIoTarget;
|
|
2385
|
+
}): Promise<IDocImportOutcomeReport>;
|
|
2386
|
+
importDoc(file: File, unitId?: string, options?: {
|
|
2387
|
+
target?: DocIoTarget;
|
|
2388
|
+
}): Promise<Partial<IDocumentData>>;
|
|
2389
|
+
exportDoc(params: {
|
|
2390
|
+
unitId: string;
|
|
2391
|
+
snapshot: IDocumentData;
|
|
2392
|
+
format?: DocExportFormat;
|
|
2393
|
+
data?: Record<string, unknown>;
|
|
2394
|
+
pdfOptions?: IDocPdfExportOptions;
|
|
2395
|
+
target?: DocIoTarget;
|
|
2396
|
+
}): Promise<Uint8Array>;
|
|
2397
|
+
saveToHost(context: IDocSaveContext): Promise<boolean>;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
interface IUniverDocsExtConfig {
|
|
2401
|
+
/** Optional pluggable frontend/backend DOCX, HTML, PDF & JSON IO adapter */
|
|
2402
|
+
io?: IDocIoAdapter;
|
|
2403
|
+
/** Optional pluggable AI Contract Risk Audit & Clause Drafting copilot adapter */
|
|
2404
|
+
aiCopilot?: IDocAiCopilotAdapter;
|
|
2405
|
+
/** Initial document mode (`'design'` | `'form'` | `'view'`). `'view'` enforces strict read-only */
|
|
2406
|
+
mode?: DocWorkMode;
|
|
2407
|
+
/**
|
|
2408
|
+
* Whether to forcibly focus every newly created/switched doc unit.
|
|
2409
|
+
* Defaults to `false` so multi-instance pages never steal focus from another active editor;
|
|
2410
|
+
* when no unit is focused at all, the first doc unit still receives initial focus for undo/redo.
|
|
2411
|
+
*/
|
|
2412
|
+
autoFocus?: boolean;
|
|
2413
|
+
}
|
|
2414
|
+
declare const UNIVER_DOCS_EXT_PLUGIN_NAME = "YUDAO_UNIVER_DOCS_EXT_PLUGIN";
|
|
2415
|
+
declare class UniverDocsExtPlugin extends Plugin {
|
|
2416
|
+
private readonly _config;
|
|
2417
|
+
protected readonly _injector: Injector;
|
|
2418
|
+
private readonly _univerInstanceService;
|
|
2419
|
+
private readonly _commandService;
|
|
2420
|
+
static pluginName: string;
|
|
2421
|
+
static packageName: string;
|
|
2422
|
+
constructor(_config: Partial<IUniverDocsExtConfig> | undefined, _injector: Injector, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService);
|
|
2423
|
+
onStarting(): void;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* Built-in zero-dependency offline legal clause risk auditor (`auditContractRisksOffline`).
|
|
2428
|
+
* Inspects contract body paragraphs, tables, and structured SDT controls for:
|
|
2429
|
+
* 1) Unilateral termination rights (`单方解除权失衡`)
|
|
2430
|
+
* 2) Unlimited or uncapped liability (`无限连带赔偿责任`)
|
|
2431
|
+
* 3) Missing dispute resolution / court / arbitration jurisdiction (`缺失争议管辖条款`)
|
|
2432
|
+
* 4) Excessive liquidated damages / overdue penalty > 30% (`违约金比例过高 > 30%`)
|
|
2433
|
+
* 5) Blank required structured SDT fields (`必填结构化要素未填写`)
|
|
2434
|
+
*/
|
|
2435
|
+
declare function auditContractRisksOffline(snapshot: Partial<IDocumentData> | null | undefined): IDocAiRiskFinding[];
|
|
2436
|
+
/**
|
|
2437
|
+
* Built-in offline formal Chinese legal clause drafter (`draftContractClauseByPrompt`).
|
|
2438
|
+
*/
|
|
2439
|
+
declare function draftContractClauseByPrompt(prompt: string): string;
|
|
2440
|
+
interface IDocAiCopilotService {
|
|
2441
|
+
readonly adapter$: Observable<IDocAiCopilotAdapter>;
|
|
2442
|
+
getAdapter(): IDocAiCopilotAdapter;
|
|
2443
|
+
setAdapter(adapter: IDocAiCopilotAdapter): void;
|
|
2444
|
+
auditContract(unitId: string, snapshot: IDocumentData): Promise<IDocAiRiskFinding[]>;
|
|
2445
|
+
draftClause(unitId: string, snapshot: IDocumentData, prompt: string): Promise<string>;
|
|
2446
|
+
}
|
|
2447
|
+
declare const IDocAiCopilotService: _univerjs_core.IdentifierDecorator<IDocAiCopilotService>;
|
|
2448
|
+
declare class DocAiCopilotService extends Disposable implements IDocAiCopilotService {
|
|
2449
|
+
private readonly _adapter$;
|
|
2450
|
+
readonly adapter$: Observable<IDocAiCopilotAdapter>;
|
|
2451
|
+
constructor();
|
|
2452
|
+
getAdapter(): IDocAiCopilotAdapter;
|
|
2453
|
+
setAdapter(adapter: IDocAiCopilotAdapter): void;
|
|
2454
|
+
private _buildContext;
|
|
2455
|
+
auditContract(unitId: string, snapshot: IDocumentData): Promise<IDocAiRiskFinding[]>;
|
|
2456
|
+
draftClause(unitId: string, snapshot: IDocumentData, prompt: string): Promise<string>;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
interface IDocSdtService {
|
|
2460
|
+
readonly activeControlId$: Observable<string | null>;
|
|
2461
|
+
readonly metadataChange$: Observable<string>;
|
|
2462
|
+
readonly modeChange$: Observable<{
|
|
2463
|
+
unitId: string;
|
|
2464
|
+
mode: DocWorkMode;
|
|
2465
|
+
}>;
|
|
2466
|
+
readonly activeRoleChange$: Observable<{
|
|
2467
|
+
unitId: string;
|
|
2468
|
+
role: string | undefined;
|
|
2469
|
+
}>;
|
|
2470
|
+
readonly versionsChange$: Observable<string>;
|
|
2471
|
+
readonly controlChange$: Observable<IDocControlChangeEvent>;
|
|
2472
|
+
readonly controlValueChange$: Observable<IDocControlValueChangeEvent>;
|
|
2473
|
+
readonly contentChange$: Observable<IDocContentChangeEvent>;
|
|
2474
|
+
getActiveControlId(): string | null;
|
|
2475
|
+
setActiveControlId(controlId: string | null): void;
|
|
2476
|
+
bumpRevision(unitId?: string): void;
|
|
2477
|
+
emitControlValueChange(ev: IDocControlValueChangeEvent): void;
|
|
2478
|
+
emitContentChange(unitId?: string): void;
|
|
2479
|
+
getTemplateMetadata(unitId: string): IDocTemplateMetadata;
|
|
2480
|
+
setTemplateMetadata(unitId: string, metadata: IDocTemplateMetadata): void;
|
|
2481
|
+
setTableRowLoop(unitId: string, config: IDocTableRowLoopConfig | null, tableId?: string, rowIndex?: number): void;
|
|
2482
|
+
getDefaultMode(): DocWorkMode;
|
|
2483
|
+
setDefaultMode(mode: DocWorkMode): void;
|
|
2484
|
+
getDocMode(unitId?: string): DocWorkMode;
|
|
2485
|
+
setDocMode(unitId: string, mode: DocWorkMode): void;
|
|
2486
|
+
getActiveRole(unitId?: string): string | undefined;
|
|
2487
|
+
setActiveRole(unitId: string, role?: string): void;
|
|
2488
|
+
saveVersionSnapshot(unitId: string, label?: string): IDocVersionSnapshot | null;
|
|
2489
|
+
listVersionSnapshots(unitId: string): IDocVersionSnapshot[];
|
|
2490
|
+
getVersionSnapshot(unitId: string, versionId: string): IDocVersionSnapshot | null;
|
|
2491
|
+
saveBuildingBlock(unitId: string, spec: IDocBuildingBlockSpec): IDocBuildingBlockEntry;
|
|
2492
|
+
getBuildingBlocks(unitId?: string): IDocBuildingBlockEntry[];
|
|
2493
|
+
removeBuildingBlock(unitId: string, blockId: string): boolean;
|
|
2494
|
+
}
|
|
2495
|
+
declare const IDocSdtService: _univerjs_core.IdentifierDecorator<IDocSdtService>;
|
|
2496
|
+
declare class DocSdtService extends Disposable implements IDocSdtService {
|
|
2497
|
+
private readonly _univerInstanceService;
|
|
2498
|
+
private readonly _activeControlId$;
|
|
2499
|
+
private readonly _metadataChange$;
|
|
2500
|
+
private readonly _modeChange$;
|
|
2501
|
+
private readonly _activeRoleChange$;
|
|
2502
|
+
private readonly _versionsChange$;
|
|
2503
|
+
private readonly _controlChange$;
|
|
2504
|
+
private readonly _controlValueChange$;
|
|
2505
|
+
private readonly _contentChange$;
|
|
2506
|
+
private readonly _metadataByUnit;
|
|
2507
|
+
private readonly _modeByUnit;
|
|
2508
|
+
private readonly _versionsByUnit;
|
|
2509
|
+
private readonly _buildingBlocks;
|
|
2510
|
+
private _defaultMode;
|
|
2511
|
+
readonly activeControlId$: Observable<string | null>;
|
|
2512
|
+
readonly metadataChange$: Observable<string>;
|
|
2513
|
+
readonly modeChange$: Observable<{
|
|
2514
|
+
unitId: string;
|
|
2515
|
+
mode: DocWorkMode;
|
|
2516
|
+
}>;
|
|
2517
|
+
readonly activeRoleChange$: Observable<{
|
|
2518
|
+
unitId: string;
|
|
2519
|
+
role: string | undefined;
|
|
2520
|
+
}>;
|
|
2521
|
+
readonly versionsChange$: Observable<string>;
|
|
2522
|
+
readonly controlChange$: Observable<IDocControlChangeEvent>;
|
|
2523
|
+
readonly controlValueChange$: Observable<IDocControlValueChangeEvent>;
|
|
2524
|
+
readonly contentChange$: Observable<IDocContentChangeEvent>;
|
|
2525
|
+
constructor(_univerInstanceService: IUniverInstanceService);
|
|
2526
|
+
getActiveControlId(): string | null;
|
|
2527
|
+
setActiveControlId(controlId: string | null): void;
|
|
2528
|
+
bumpRevision(unitId?: string): void;
|
|
2529
|
+
emitControlValueChange(ev: IDocControlValueChangeEvent): void;
|
|
2530
|
+
emitContentChange(unitId?: string): void;
|
|
2531
|
+
private _getDocModel;
|
|
2532
|
+
getTemplateMetadata(unitId: string): IDocTemplateMetadata;
|
|
2533
|
+
setTemplateMetadata(unitId: string, metadata: IDocTemplateMetadata): void;
|
|
2534
|
+
setTableRowLoop(unitId: string, config: IDocTableRowLoopConfig | null, tableId?: string, rowIndex?: number): void;
|
|
2535
|
+
getDefaultMode(): DocWorkMode;
|
|
2536
|
+
setDefaultMode(mode: DocWorkMode): void;
|
|
2537
|
+
getDocMode(unitId?: string): DocWorkMode;
|
|
2538
|
+
setDocMode(unitId: string, mode: DocWorkMode): void;
|
|
2539
|
+
getActiveRole(unitId?: string): string | undefined;
|
|
2540
|
+
setActiveRole(unitId: string, role?: string): void;
|
|
2541
|
+
saveVersionSnapshot(unitId: string, label?: string): IDocVersionSnapshot | null;
|
|
2542
|
+
listVersionSnapshots(unitId: string): IDocVersionSnapshot[];
|
|
2543
|
+
getVersionSnapshot(unitId: string, versionId: string): IDocVersionSnapshot | null;
|
|
2544
|
+
saveBuildingBlock(unitId: string, spec: IDocBuildingBlockSpec): IDocBuildingBlockEntry;
|
|
2545
|
+
getBuildingBlocks(unitId?: string): IDocBuildingBlockEntry[];
|
|
2546
|
+
removeBuildingBlock(unitId: string, blockId: string): boolean;
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
interface IDocShortcutKeyboardEventLike {
|
|
2550
|
+
key: string;
|
|
2551
|
+
code?: string;
|
|
2552
|
+
ctrlKey?: boolean;
|
|
2553
|
+
metaKey?: boolean;
|
|
2554
|
+
shiftKey?: boolean;
|
|
2555
|
+
altKey?: boolean;
|
|
2556
|
+
target?: unknown;
|
|
2557
|
+
preventDefault?: () => void;
|
|
2558
|
+
stopPropagation?: () => void;
|
|
2559
|
+
}
|
|
2560
|
+
interface IDocExtensionRegistryService {
|
|
2561
|
+
readonly changes$: Observable<number>;
|
|
2562
|
+
registerContextMenuList(items: IDocContextMenuItem[]): IDisposable;
|
|
2563
|
+
registerShortcutList(shortcuts: IDocShortcutItem[]): IDisposable;
|
|
2564
|
+
getContextMenuList(ctx?: IDocContextMenuContext): IDocContextMenuItem[];
|
|
2565
|
+
getShortcutList(ctx?: IDocContextMenuContext): IDocShortcutItem[];
|
|
2566
|
+
setDocApiResolver(resolver: (unitId: string) => unknown): void;
|
|
2567
|
+
resolveDocApi(unitId: string, fallback?: unknown): unknown;
|
|
2568
|
+
clearAll(): void;
|
|
2569
|
+
matchAndExecuteShortcut(ev: IDocShortcutKeyboardEventLike, docApi: unknown, ctx: IDocContextMenuContext, isInsideEditor?: boolean): boolean;
|
|
2570
|
+
}
|
|
2571
|
+
declare const IDocExtensionRegistryService: _univerjs_core.IdentifierDecorator<IDocExtensionRegistryService>;
|
|
2572
|
+
declare function doesDocShortcutMatchEvent(shortcut: IDocShortcutItem, ev: IDocShortcutKeyboardEventLike): boolean;
|
|
2573
|
+
declare class DocExtensionRegistryService extends Disposable implements IDocExtensionRegistryService {
|
|
2574
|
+
private readonly _changes$;
|
|
2575
|
+
private _nextBatchId;
|
|
2576
|
+
private readonly _contextMenuBatches;
|
|
2577
|
+
private readonly _shortcutBatches;
|
|
2578
|
+
private _docApiResolver;
|
|
2579
|
+
readonly changes$: Observable<number>;
|
|
2580
|
+
constructor();
|
|
2581
|
+
setDocApiResolver(resolver: (unitId: string) => unknown): void;
|
|
2582
|
+
resolveDocApi(unitId: string, fallback?: unknown): unknown;
|
|
2583
|
+
private _bump;
|
|
2584
|
+
registerContextMenuList(items: IDocContextMenuItem[]): IDisposable;
|
|
2585
|
+
registerShortcutList(shortcuts: IDocShortcutItem[]): IDisposable;
|
|
2586
|
+
getContextMenuList(ctx?: IDocContextMenuContext): IDocContextMenuItem[];
|
|
2587
|
+
getShortcutList(ctx?: IDocContextMenuContext): IDocShortcutItem[];
|
|
2588
|
+
clearAll(): void;
|
|
2589
|
+
matchAndExecuteShortcut(ev: IDocShortcutKeyboardEventLike, docApi: unknown, ctx: IDocContextMenuContext, isInsideEditor?: boolean): boolean;
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
declare const UNIVER_DOC_CHART_PALETTE: readonly string[];
|
|
2593
|
+
/**
|
|
2594
|
+
* Renders a crisp Univer-themed SVG chart (`bar`, `horizontalBar`, `line`, `area`, `pie`, `doughnut`).
|
|
2595
|
+
*/
|
|
2596
|
+
declare function renderDocChartSvg(spec: IDocEmbeddedChart): string;
|
|
2597
|
+
declare function renderDocChartToSvgDataUri(spec: IDocEmbeddedChart): {
|
|
2598
|
+
svg: string;
|
|
2599
|
+
dataUri: string;
|
|
2600
|
+
widthPt: number;
|
|
2601
|
+
heightPt: number;
|
|
2602
|
+
};
|
|
2603
|
+
/**
|
|
2604
|
+
* Renders a crisp Univer-themed SVG shape (`rect`, `roundRect`, `ellipse`, `diamond`, `arrow`).
|
|
2605
|
+
*/
|
|
2606
|
+
declare function renderDocShapeSvg(spec: IDocEmbeddedShape): string;
|
|
2607
|
+
declare function renderDocShapeToSvgDataUri(spec: IDocEmbeddedShape): {
|
|
2608
|
+
svg: string;
|
|
2609
|
+
dataUri: string;
|
|
2610
|
+
widthPt: number;
|
|
2611
|
+
heightPt: number;
|
|
2612
|
+
};
|
|
2613
|
+
|
|
2614
|
+
type LatexAstNode = {
|
|
2615
|
+
type: 'row';
|
|
2616
|
+
items: LatexAstNode[];
|
|
2617
|
+
} | {
|
|
2618
|
+
type: 'atom';
|
|
2619
|
+
value: string;
|
|
2620
|
+
italic?: boolean;
|
|
2621
|
+
bold?: boolean;
|
|
2622
|
+
isOperator?: boolean;
|
|
2623
|
+
} | {
|
|
2624
|
+
type: 'space';
|
|
2625
|
+
em: number;
|
|
2626
|
+
} | {
|
|
2627
|
+
type: 'frac';
|
|
2628
|
+
num: LatexAstNode;
|
|
2629
|
+
den: LatexAstNode;
|
|
2630
|
+
} | {
|
|
2631
|
+
type: 'sqrt';
|
|
2632
|
+
index?: LatexAstNode;
|
|
2633
|
+
radicand: LatexAstNode;
|
|
2634
|
+
} | {
|
|
2635
|
+
type: 'bigop';
|
|
2636
|
+
op: string;
|
|
2637
|
+
symbol: string;
|
|
2638
|
+
isTextOp: boolean;
|
|
2639
|
+
} | {
|
|
2640
|
+
type: 'subsup';
|
|
2641
|
+
base: LatexAstNode;
|
|
2642
|
+
sup?: LatexAstNode;
|
|
2643
|
+
sub?: LatexAstNode;
|
|
2644
|
+
} | {
|
|
2645
|
+
type: 'delim';
|
|
2646
|
+
left: string;
|
|
2647
|
+
right: string;
|
|
2648
|
+
body: LatexAstNode;
|
|
2649
|
+
} | {
|
|
2650
|
+
type: 'matrix';
|
|
2651
|
+
env: 'matrix' | 'pmatrix' | 'bmatrix' | 'Bmatrix' | 'vmatrix' | 'Vmatrix';
|
|
2652
|
+
rows: LatexAstNode[][];
|
|
2653
|
+
};
|
|
2654
|
+
declare function parseLatexMathAst(rawLatex: string): {
|
|
2655
|
+
ast: LatexAstNode;
|
|
2656
|
+
inferredDisplayMode: boolean;
|
|
2657
|
+
};
|
|
2658
|
+
/**
|
|
2659
|
+
* Layouts a general-purpose LaTeX mathematical expression into crisp vector `<svg>`, base64 data URI,
|
|
2660
|
+
* and intrinsic point dimensions (`widthPt`, `heightPt`).
|
|
2661
|
+
*/
|
|
2662
|
+
declare function layoutLatexFormulaWidget(latex: string, options?: IDocLatexRenderOptions): IDocLatexRenderResult;
|
|
2663
|
+
declare function renderLatexToSvg(latex: string, options?: IDocLatexRenderOptions): string;
|
|
2664
|
+
declare function renderLatexToSvgDataUri(latex: string, options?: IDocLatexRenderOptions): string;
|
|
2665
|
+
|
|
2666
|
+
declare function encodeUtf8Base64DataUri(mime: string, content: string): string;
|
|
2667
|
+
interface IMedicalFormulaLayoutResult {
|
|
2668
|
+
svg: string;
|
|
2669
|
+
dataUri: string;
|
|
2670
|
+
widthPt: number;
|
|
2671
|
+
heightPt: number;
|
|
2672
|
+
plainSummary: string;
|
|
2673
|
+
}
|
|
2674
|
+
/**
|
|
2675
|
+
* Computes vector SVG markup, base64 data URI, intrinsic point dimensions, and plain-text summary
|
|
2676
|
+
* for medical specialty & scientific formula blocks.
|
|
2677
|
+
*/
|
|
2678
|
+
declare function layoutMedicalFormulaWidget(spec: IDocMedicalFormulaSpec): IMedicalFormulaLayoutResult;
|
|
2679
|
+
/**
|
|
2680
|
+
* Generates clean vector `<svg>` string for medical specialty & scientific formulas:
|
|
2681
|
+
* `'dentalQuadrant'`, `'menstrualHistory'`, `'pupilLightReflex'`, `'visualAcuity'`, and `'mathFraction'`.
|
|
2682
|
+
*/
|
|
2683
|
+
declare function buildMedicalFormulaSvg(spec: IDocMedicalFormulaSpec): string;
|
|
2684
|
+
/**
|
|
2685
|
+
* Generates `data:image/svg+xml;base64,...` URI for medical specialty & scientific formulas.
|
|
2686
|
+
*/
|
|
2687
|
+
declare function buildMedicalFormulaDataUri(spec: IDocMedicalFormulaSpec): string;
|
|
2688
|
+
/**
|
|
2689
|
+
* Encodes a string into Code128 Subset B bar segments (`[moduleOffset, moduleWidth][]`) with exact modulo-103 checksum.
|
|
2690
|
+
*/
|
|
2691
|
+
declare function encodeCode128Bars(rawValue: string): {
|
|
2692
|
+
bars: Array<{
|
|
2693
|
+
x: number;
|
|
2694
|
+
w: number;
|
|
2695
|
+
}>;
|
|
2696
|
+
totalModules: number;
|
|
2697
|
+
};
|
|
2698
|
+
declare function buildCode128BarcodeSvg(value: string, options?: {
|
|
2699
|
+
width?: number;
|
|
2700
|
+
height?: number;
|
|
2701
|
+
label?: string;
|
|
2702
|
+
}): string;
|
|
2703
|
+
/**
|
|
2704
|
+
* Generates an ISO/IEC 18004 boolean QR module matrix for `payload` (UTF-8 Byte mode, ECC Level L, Mask 0).
|
|
2705
|
+
*/
|
|
2706
|
+
declare function buildQrMatrix(payload: string): boolean[][];
|
|
2707
|
+
declare function buildQrCodeSvg(value: string, options?: {
|
|
2708
|
+
size?: number;
|
|
2709
|
+
label?: string;
|
|
2710
|
+
}): string;
|
|
2711
|
+
declare function resolveBarcodeBlockPayload(spec: IDocBarcodeBlockSpec, data?: Record<string, unknown>): string;
|
|
2712
|
+
declare function buildQrOrBarcodeSvg(spec: IDocBarcodeBlockSpec, data?: Record<string, unknown>): string;
|
|
2713
|
+
declare function buildQrOrBarcodeDataUri(spec: IDocBarcodeBlockSpec, data?: Record<string, unknown>): string;
|
|
2714
|
+
interface ICodeSyntaxToken {
|
|
2715
|
+
text: string;
|
|
2716
|
+
color: string;
|
|
2717
|
+
bold?: boolean;
|
|
2718
|
+
italic?: boolean;
|
|
2719
|
+
}
|
|
2720
|
+
/**
|
|
2721
|
+
* Lightweight zero-dependency syntax tokenizer for inline code blocks (`ts/js/java/python/sql/json`).
|
|
2722
|
+
*/
|
|
2723
|
+
declare function tokenizeCodeLineForHighlight(line: string): ICodeSyntaxToken[];
|
|
2724
|
+
/**
|
|
2725
|
+
* Inserts a `\b` (`CUSTOM_BLOCK`) inline image drawing into `sourceSnapshot` at `rawOffset`,
|
|
2726
|
+
* keeping `paragraphs`, `sectionBreaks`, `tables`, `customBlocks`, `customRanges`, `textRuns`,
|
|
2727
|
+
* and `drawings` 100% synchronized.
|
|
2728
|
+
*/
|
|
2729
|
+
declare function insertInlineDrawingIntoSnapshot(sourceSnapshot: IDocumentData, params: {
|
|
2730
|
+
offset?: number;
|
|
2731
|
+
blockId?: string;
|
|
2732
|
+
dataUri: string;
|
|
2733
|
+
widthPt: number;
|
|
2734
|
+
heightPt: number;
|
|
2735
|
+
title?: string;
|
|
2736
|
+
}): {
|
|
2737
|
+
snapshot: IDocumentData;
|
|
2738
|
+
blockId: string;
|
|
2739
|
+
insertOffset: number;
|
|
2740
|
+
endOffset: number;
|
|
2741
|
+
};
|
|
2742
|
+
/**
|
|
2743
|
+
* Inserts a syntax-styled monospace code block (with light slate background `#f1f5f9`, border metadata,
|
|
2744
|
+
* and language header tag) into `sourceSnapshot` at `rawOffset`.
|
|
2745
|
+
*/
|
|
2746
|
+
declare function insertSyntaxCodeBlockIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocCodeBlockSpec, rawOffset?: number): {
|
|
2747
|
+
snapshot: IDocumentData;
|
|
2748
|
+
entry: IDocEmbeddedCodeBlockEntry;
|
|
2749
|
+
endOffset: number;
|
|
2750
|
+
};
|
|
2751
|
+
|
|
2752
|
+
declare function resolvePathValue(source: Record<string, unknown> | undefined, path?: string): unknown;
|
|
2753
|
+
declare function readDocTemplateMetadataFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocTemplateMetadata;
|
|
2754
|
+
declare function writeDocTemplateMetadataToSnapshot<T extends Partial<IDocumentData>>(snapshot: T, metadata: IDocTemplateMetadata): T;
|
|
2755
|
+
declare function getLocalTodayIso(): string;
|
|
2756
|
+
declare function formatIsoDateByPattern(raw: string, format?: string): string;
|
|
2757
|
+
declare function parseDateRangePair(raw: string): {
|
|
2758
|
+
startIso: string;
|
|
2759
|
+
endIso: string;
|
|
2760
|
+
} | null;
|
|
2761
|
+
declare function resolveEffectiveSdtAffixes(spec: Pick<IDocSdtControlSpec, 'visualChrome' | 'prefix' | 'postfix'>): {
|
|
2762
|
+
prefix: string;
|
|
2763
|
+
postfix: string;
|
|
2764
|
+
};
|
|
2765
|
+
declare function stripSdtAffixes(rawText: string, spec: Pick<IDocSdtControlSpec, 'visualChrome' | 'prefix' | 'postfix' | 'preText' | 'postText'>): string;
|
|
2766
|
+
declare function extractAnchorTypography(ts: ITextStyle | undefined): Partial<ITextStyle> | undefined;
|
|
2767
|
+
declare function resolveBodyOffsetTypography(body: IDocumentBody | undefined, offset: number): Partial<ITextStyle> | undefined;
|
|
2768
|
+
declare function resolveRangeAnchorTypography(body: IDocumentBody | undefined, range: ICustomRange | undefined): Partial<ITextStyle> | undefined;
|
|
2769
|
+
declare function matchSdtHighlightRule(rules: IDocSdtHighlightRule[] | undefined, textOrValue: string | boolean): IDocSdtHighlightRule | undefined;
|
|
2770
|
+
declare function computeSdtVisualStyle(kind: DocSdtControlKind, lock: DocSdtLockPolicy, showingPlaceholder: boolean, hasBinding: boolean, matchedHighlight?: IDocSdtHighlightRule, visualChrome?: DocSdtVisualChrome, anchorTypography?: Partial<ITextStyle>, options?: {
|
|
2771
|
+
underlineBlank?: boolean;
|
|
2772
|
+
minWidthPt?: number;
|
|
2773
|
+
invalidHighlight?: boolean;
|
|
2774
|
+
}): ITextStyle;
|
|
2775
|
+
declare const DEFAULT_CASCADER_OPTIONS: IDocCascaderNode[];
|
|
2776
|
+
declare function flattenCascaderLeafItems(options: IDocCascaderNode[] | undefined, separator?: string): Array<{
|
|
2777
|
+
displayText: string;
|
|
2778
|
+
value: string;
|
|
2779
|
+
}>;
|
|
2780
|
+
declare function resolveCascaderPath(options: IDocCascaderNode[] | undefined, rawInput: string, separator?: string): {
|
|
2781
|
+
labels: string[];
|
|
2782
|
+
values: string[];
|
|
2783
|
+
displayText: string;
|
|
2784
|
+
valueText: string;
|
|
2785
|
+
};
|
|
2786
|
+
declare function normalizeSdtListItems(spec: Pick<IDocSdtControlSpec, 'listItems' | 'options'>): NonNullable<IDocSdtControlSpec['listItems']> | undefined;
|
|
2787
|
+
declare function formatSdtDisplayText(spec: Pick<IDocSdtControlSpec, 'kind' | 'alias' | 'placeholder' | 'dateFormat' | 'listItems' | 'options' | 'checkboxMarkType' | 'layoutDirection' | 'cascaderOptions' | 'cascaderSeparator' | 'visualChrome' | 'prefix' | 'postfix' | 'preText' | 'postText' | 'minWidthPt' | 'underlineBlank'>, rawValue?: string | boolean): {
|
|
2788
|
+
text: string;
|
|
2789
|
+
showingPlaceholder: boolean;
|
|
2790
|
+
normalizedValue: string | boolean;
|
|
2791
|
+
};
|
|
2792
|
+
declare function buildSdtPropertiesFromSpec(spec: Partial<IDocSdtControlSpec> & {
|
|
2793
|
+
anchorTextStyle?: Partial<ITextStyle>;
|
|
2794
|
+
drawingBlockId?: string;
|
|
2795
|
+
}, showingPlaceholder: boolean, normalizedValue: string | boolean): ISdtRangeProperties & Record<string, unknown>;
|
|
2796
|
+
declare function parseSdtRangeToResolved(body: IDocumentBody, range: ICustomRange, segmentId?: string): IDocResolvedSdtControl | null;
|
|
2797
|
+
/**
|
|
2798
|
+
* Evaluates role-scoped co-signing edit permission in `'form'` mode:
|
|
2799
|
+
* when `activeRole` is set in `'form'` mode, only controls with empty/undefined `editableRoles`
|
|
2800
|
+
* or `editableRoles` including `activeRole` may be edited.
|
|
2801
|
+
*/
|
|
2802
|
+
declare function canRoleEditSdtControl(ctrl: Pick<IDocSdtControlSpec, 'editableRoles'>, mode: DocWorkMode, activeRole?: string): boolean;
|
|
2803
|
+
/**
|
|
2804
|
+
* Checks whether an interactive edit span `[startOffset, endOffset]` is blocked by a `'group'` SDT:
|
|
2805
|
+
* `'group'` SDT locks outer text while allowing edits strictly inside nested unlocked child SDTs.
|
|
2806
|
+
*/
|
|
2807
|
+
declare function isOffsetLockedByGroupSdt(snapshot: Partial<IDocumentData> | null | undefined, startOffset: number, endOffset?: number): boolean;
|
|
2808
|
+
declare function validateSdtValueBySpec(ctrl: Pick<IDocSdtControlSpec, 'alias' | 'validatorPreset' | 'validatorPattern' | 'validatorMessage'>, rawValue: string): string | null;
|
|
2809
|
+
declare function resolveSegmentBodyInSnapshot(snapshot: Partial<IDocumentData> | null | undefined, segmentId?: string): IDocumentBody | undefined;
|
|
2810
|
+
declare function writeSegmentBodyInSnapshot(snapshot: IDocumentData, body: IDocumentBody, segmentId?: string): void;
|
|
2811
|
+
declare function listDocSdtControls(snapshot: Partial<IDocumentData> | null | undefined, segmentIdOrOptions?: string | {
|
|
2812
|
+
includeSegments?: boolean;
|
|
2813
|
+
segmentId?: string;
|
|
2814
|
+
}): IDocResolvedSdtControl[];
|
|
2815
|
+
declare function extractDocFormValues(snapshot: IDocumentData | null | undefined): Record<string, string | boolean>;
|
|
2816
|
+
declare function validateDocForm(snapshot: IDocumentData | null | undefined): IDocFormValidationResult;
|
|
2817
|
+
/**
|
|
2818
|
+
* Replaces `[start, endInclusive]` inside `body` with `replacementText`, accurately shifting
|
|
2819
|
+
* all paragraph, sectionBreak, textRun, customRange, customBlock, and table indices.
|
|
2820
|
+
*/
|
|
2821
|
+
declare function spliceDocumentBodySpan(sourceBody: IDocumentBody, start: number, endInclusive: number, replacementText: string, options?: {
|
|
2822
|
+
targetRangeId?: string;
|
|
2823
|
+
updatedRangeProperties?: Record<string, unknown>;
|
|
2824
|
+
textStyle?: ITextStyle;
|
|
2825
|
+
preserveInternalRuns?: boolean;
|
|
2826
|
+
}): IDocumentBody;
|
|
2827
|
+
/**
|
|
2828
|
+
* Inserts a new `CustomRangeType.SDT` control at `rawOffset` in `sourceBody`.
|
|
2829
|
+
* Supports wrapping an existing `[rawOffset, wrapEndOffset)` selection span and inheriting anchor `ITextRun.ts`.
|
|
2830
|
+
*/
|
|
2831
|
+
declare function insertSdtControlIntoBody(sourceBody: IDocumentBody, rawOffset: number, spec: Partial<IDocSdtControlSpec> & {
|
|
2832
|
+
anchorTextStyle?: Partial<ITextStyle>;
|
|
2833
|
+
}, initialValue?: string | boolean, options?: {
|
|
2834
|
+
wrapEndOffset?: number;
|
|
2835
|
+
}): {
|
|
2836
|
+
body: IDocumentBody;
|
|
2837
|
+
controlId: string;
|
|
2838
|
+
endOffset: number;
|
|
2839
|
+
};
|
|
2840
|
+
declare function normalizeImageDataUriForSdt(raw: string): string;
|
|
2841
|
+
declare function applyPictureOrSignatureSdtValueInSnapshot(snapshot: IDocumentData, ctrl: IDocResolvedSdtControl, rawImageValue: string, segmentId?: string): boolean;
|
|
2842
|
+
interface IParsedTableCellSpan {
|
|
2843
|
+
cellStart: number;
|
|
2844
|
+
cellEndInclusive: number;
|
|
2845
|
+
contentStart: number;
|
|
2846
|
+
/** End index right before trailing `\r\n` inside the cell */
|
|
2847
|
+
textEndExclusive: number;
|
|
2848
|
+
rawText: string;
|
|
2849
|
+
}
|
|
2850
|
+
interface IParsedTableRowSpan {
|
|
2851
|
+
rowIndex: number;
|
|
2852
|
+
rowStart: number;
|
|
2853
|
+
rowEndInclusive: number;
|
|
2854
|
+
cells: IParsedTableCellSpan[];
|
|
2855
|
+
}
|
|
2856
|
+
declare function parseTableRowsInStream(dataStream: string, tableStartIndex: number, tableEndExclusive: number): IParsedTableRowSpan[];
|
|
2857
|
+
/**
|
|
2858
|
+
* Inspects all Univer `1.6.2` tables in `snapshot` and resolves row-level loop configurations.
|
|
2859
|
+
*/
|
|
2860
|
+
declare function listDocTables(snapshot: Partial<IDocumentData> | null | undefined): IDocTableSummary[];
|
|
2861
|
+
declare function parseIsoDateForExpr(raw: unknown): Date | null;
|
|
2862
|
+
declare function evaluateDocDateDiff(rawStart: unknown, rawEnd: unknown, rawUnit?: string): number | null;
|
|
2863
|
+
declare function evaluateVisibleIfCondition(expr: string, data: Record<string, unknown>): boolean;
|
|
2864
|
+
/**
|
|
2865
|
+
* Compiles and fills all dataset-bound SDT controls (including header/footer `segmentId` controls),
|
|
2866
|
+
* table detail row loops, paragraph loops, conditional `visibleIf` clauses, in-table formulas,
|
|
2867
|
+
* and `${field.path}` / `#{field.path}` expressions in `snapshot`.
|
|
2868
|
+
*/
|
|
2869
|
+
declare function fillDatasetIntoDocSnapshot(snapshot: IDocumentData, data: Record<string, unknown>, options?: {
|
|
2870
|
+
tableRowLoops?: Record<string, IDocTableRowLoopConfig>;
|
|
2871
|
+
/** Optional output array receiving `[start, end)` character spans of dynamically resolved `${...}` / `#{...}` values */
|
|
2872
|
+
dynamicFieldSpansOut?: Array<{
|
|
2873
|
+
start: number;
|
|
2874
|
+
end: number;
|
|
2875
|
+
}>;
|
|
2876
|
+
}): IDocumentData;
|
|
2877
|
+
type DocBuilderSegment = string | {
|
|
2878
|
+
text: string;
|
|
2879
|
+
style?: ITextStyle;
|
|
2880
|
+
trackRevision?: {
|
|
2881
|
+
id?: string;
|
|
2882
|
+
type: DocTrackRevisionType;
|
|
2883
|
+
author?: string;
|
|
2884
|
+
createdAt?: string;
|
|
2885
|
+
status?: DocTrackRevisionStatus;
|
|
2886
|
+
};
|
|
2887
|
+
} | {
|
|
2888
|
+
sdt: Partial<IDocSdtControlSpec> & {
|
|
2889
|
+
alias: string;
|
|
2890
|
+
anchorTextStyle?: ITextStyle;
|
|
2891
|
+
};
|
|
2892
|
+
value?: string | boolean;
|
|
2893
|
+
innerSegments?: DocBuilderSegment[];
|
|
2894
|
+
} | {
|
|
2895
|
+
noteRef: {
|
|
2896
|
+
noteId: string;
|
|
2897
|
+
noteType: 'footnote' | 'endnote';
|
|
2898
|
+
label?: string;
|
|
2899
|
+
};
|
|
2900
|
+
} | {
|
|
2901
|
+
pageBreak: true;
|
|
2902
|
+
} | {
|
|
2903
|
+
bookmarkStart: {
|
|
2904
|
+
wId: string;
|
|
2905
|
+
name: string;
|
|
2906
|
+
};
|
|
2907
|
+
} | {
|
|
2908
|
+
bookmarkEnd: {
|
|
2909
|
+
wId: string;
|
|
2910
|
+
};
|
|
2911
|
+
} | {
|
|
2912
|
+
tab: true;
|
|
2913
|
+
} | {
|
|
2914
|
+
docField: {
|
|
2915
|
+
id?: string;
|
|
2916
|
+
fieldType: DocFieldType;
|
|
2917
|
+
instructionArgs?: string;
|
|
2918
|
+
instrText: string;
|
|
2919
|
+
value: string;
|
|
2920
|
+
};
|
|
2921
|
+
} | {
|
|
2922
|
+
hyperlink: {
|
|
2923
|
+
id?: string;
|
|
2924
|
+
url: string;
|
|
2925
|
+
tooltip?: string;
|
|
2926
|
+
};
|
|
2927
|
+
text?: string;
|
|
2928
|
+
style?: ITextStyle;
|
|
2929
|
+
innerSegments?: DocBuilderSegment[];
|
|
2930
|
+
} | {
|
|
2931
|
+
commentStart: {
|
|
2932
|
+
wId: string;
|
|
2933
|
+
id?: string;
|
|
2934
|
+
author?: string;
|
|
2935
|
+
createdAt?: string;
|
|
2936
|
+
initials?: string;
|
|
2937
|
+
content?: string;
|
|
2938
|
+
resolved?: boolean;
|
|
2939
|
+
replies?: IDocCommentReply[];
|
|
2940
|
+
};
|
|
2941
|
+
} | {
|
|
2942
|
+
commentEnd: {
|
|
2943
|
+
wId: string;
|
|
2944
|
+
};
|
|
2945
|
+
};
|
|
2946
|
+
interface IDocBuilderParagraphInput {
|
|
2947
|
+
kind?: 'paragraph';
|
|
2948
|
+
segments: DocBuilderSegment[];
|
|
2949
|
+
paragraphStyle?: Record<string, unknown>;
|
|
2950
|
+
bullet?: IParagraph['bullet'];
|
|
2951
|
+
callout?: IDocCalloutBlock;
|
|
2952
|
+
quote?: IDocQuoteBlock;
|
|
2953
|
+
}
|
|
2954
|
+
interface IDocBuilderTableCellInput {
|
|
2955
|
+
text: string;
|
|
2956
|
+
style?: ITextStyle;
|
|
2957
|
+
colSpan?: number;
|
|
2958
|
+
rowSpan?: number;
|
|
2959
|
+
backgroundRgb?: string;
|
|
2960
|
+
borders?: IDocTableCellBorders;
|
|
2961
|
+
/** Optional rich multi-paragraph cell content (preserving multi-run styles & nested SDT controls) */
|
|
2962
|
+
paragraphs?: IDocBuilderParagraphInput[];
|
|
2963
|
+
}
|
|
2964
|
+
interface IDocBuilderTableInput {
|
|
2965
|
+
kind: 'table';
|
|
2966
|
+
tableId?: string;
|
|
2967
|
+
columnWidthsPt?: number[];
|
|
2968
|
+
repeatHeaderRow?: boolean;
|
|
2969
|
+
headerRowCount?: number;
|
|
2970
|
+
rows: Array<Array<string | IDocBuilderTableCellInput>>;
|
|
2971
|
+
rowLoop?: Omit<IDocTableRowLoopConfig, 'tableId'>;
|
|
2972
|
+
}
|
|
2973
|
+
type DocBuilderBlockInput = IDocBuilderParagraphInput | IDocBuilderTableInput;
|
|
2974
|
+
/**
|
|
2975
|
+
* Clean programmatic builder for creating valid Univer `1.6.2` `IDocumentData` templates with
|
|
2976
|
+
* styled paragraphs, native `CustomRangeType.SDT` controls, page breaks, and Univer tables.
|
|
2977
|
+
*/
|
|
2978
|
+
declare function buildStructuredDocData(params: {
|
|
2979
|
+
id?: string;
|
|
2980
|
+
title: string;
|
|
2981
|
+
paragraphs?: IDocBuilderParagraphInput[];
|
|
2982
|
+
blocks?: DocBuilderBlockInput[];
|
|
2983
|
+
pageWidthPt?: number;
|
|
2984
|
+
pageHeightPt?: number;
|
|
2985
|
+
disabled?: boolean;
|
|
2986
|
+
}): IDocumentData;
|
|
2987
|
+
/**
|
|
2988
|
+
* Extracts clickable H1~H6 document outline catalog (`getCatalog()`).
|
|
2989
|
+
* Recognizes Univer `NamedStyleType` headings, styled title paragraphs, and Chinese contract headings (`一、`, `第一条`, `1.1`).
|
|
2990
|
+
*/
|
|
2991
|
+
declare function extractDocCatalog(snapshot: Partial<IDocumentData> | null | undefined): IDocCatalogItem[];
|
|
2992
|
+
/**
|
|
2993
|
+
* Builds a nested `subCatalog` outline hierarchy (`H1 -> H2 -> H3 ...`) with `pageNo` on every node.
|
|
2994
|
+
*/
|
|
2995
|
+
declare function extractDocCatalogTree(snapshot: Partial<IDocumentData> | null | undefined): IDocCatalogItem[];
|
|
2996
|
+
|
|
2997
|
+
/**
|
|
2998
|
+
* Converts numeric RMB amount into standard Chinese financial uppercase (`壹拾贰万伍仟捌佰元整`).
|
|
2999
|
+
*/
|
|
3000
|
+
declare function numberToChineseUpperMoney(amount: number): string;
|
|
3001
|
+
/**
|
|
3002
|
+
* Evaluates all Word in-table formulas (`=SUM(ABOVE)`, `=SUM(LEFT)`, `=C2*D2`, `=CNMONEY(...)`)
|
|
3003
|
+
* across `snapshot.body.tables` (Word table formula specification).
|
|
3004
|
+
*/
|
|
3005
|
+
declare function evaluateDocTableFormulas(snapshot: IDocumentData): IDocumentData;
|
|
3006
|
+
declare const DOC_TRACK_INSERT_STYLE: ITextStyle;
|
|
3007
|
+
declare const DOC_TRACK_DELETE_STYLE: ITextStyle;
|
|
3008
|
+
/**
|
|
3009
|
+
* Replaces or clears `ITextStyle` on `[start, endExclusive)` without mutating `dataStream` or block offsets.
|
|
3010
|
+
*/
|
|
3011
|
+
declare function applyTextStyleToBodySpan(sourceBody: IDocumentBody, start: number, endExclusive: number, nextStyle: ITextStyle | null): IDocumentBody;
|
|
3012
|
+
/**
|
|
3013
|
+
* Shifts recorded track-change revision character spans when `[start, start + removedLen)` is replaced by `insertedLen` chars.
|
|
3014
|
+
*/
|
|
3015
|
+
declare function shiftTrackRevisions(revisions: IDocTrackRevision[], start: number, removedLen: number, insertedLen: number, excludeRevisionId?: string): IDocTrackRevision[];
|
|
3016
|
+
/**
|
|
3017
|
+
* Records a pending `'insert'` or `'delete'` track-changes revision on `snapshot` and applies
|
|
3018
|
+
* Word-style inline visual markup (green underline `#15803d` for insert; red strikethrough `#dc2626` for delete).
|
|
3019
|
+
*/
|
|
3020
|
+
declare function recordDocTrackRevisionOnSnapshot(snapshot: IDocumentData, params: {
|
|
3021
|
+
type: DocTrackRevisionType;
|
|
3022
|
+
text?: string;
|
|
3023
|
+
index?: number;
|
|
3024
|
+
endIndex?: number;
|
|
3025
|
+
author?: string;
|
|
3026
|
+
revisionId?: string;
|
|
3027
|
+
createdAt?: string;
|
|
3028
|
+
}, metadataOverride?: IDocTemplateMetadata): {
|
|
3029
|
+
snapshot: IDocumentData;
|
|
3030
|
+
metadata: IDocTemplateMetadata;
|
|
3031
|
+
revision: IDocTrackRevision | null;
|
|
3032
|
+
};
|
|
3033
|
+
/**
|
|
3034
|
+
* Accepts or rejects one or all pending revisions on `snapshot`, accurately updating body spans and subsequent offsets.
|
|
3035
|
+
*/
|
|
3036
|
+
declare function resolveDocTrackRevisionOnSnapshot(snapshot: IDocumentData, params: {
|
|
3037
|
+
revisionId?: string;
|
|
3038
|
+
action: 'accept' | 'reject';
|
|
3039
|
+
all?: boolean;
|
|
3040
|
+
}, metadataOverride?: IDocTemplateMetadata): {
|
|
3041
|
+
snapshot: IDocumentData;
|
|
3042
|
+
metadata: IDocTemplateMetadata;
|
|
3043
|
+
resolvedCount: number;
|
|
3044
|
+
};
|
|
3045
|
+
/**
|
|
3046
|
+
* CSP-safe pure-TS document expression evaluator supporting arithmetic (`+ - * / ()`),
|
|
3047
|
+
* field keys (`price * qty`), `SUM(...)`, `ROUND(x, n)`, `AVG(...)`, `MIN(...)`, `MAX(...)`, and `CNMONEY(x)`.
|
|
3048
|
+
*/
|
|
3049
|
+
declare function evaluateSafeDocExpression(rawExpr: string, values: Record<string, unknown>): string | null;
|
|
3050
|
+
declare function buildLiveDocFormContext(snapshot: IDocumentData, extraData?: Record<string, unknown>): Record<string, unknown>;
|
|
3051
|
+
/**
|
|
3052
|
+
* Evaluates all SDT controls that define `computedExpr` in topological/multi-pass fixed-point order,
|
|
3053
|
+
* updating their SDT value, display text, and risk highlight styling in-place on `snapshot`.
|
|
3054
|
+
*/
|
|
3055
|
+
declare function evaluateComputedSdtControlsInPlace(snapshot: IDocumentData, extraData?: Record<string, unknown>): boolean;
|
|
3056
|
+
declare function evaluateComputedSdtControls(snapshot: IDocumentData, extraData?: Record<string, unknown>): IDocumentData;
|
|
3057
|
+
declare function toControlSpecSnapshot(ctrl: IDocResolvedSdtControl): IDocSdtControlSpec;
|
|
3058
|
+
/**
|
|
3059
|
+
* Evaluates live reactive `visibleIf` clauses (`IDocVisibilityClause[]` + SDT controls with `visibleIf`),
|
|
3060
|
+
* hiding non-matching clauses while backing up `cachedTemplateText` and restoring hidden clauses back into
|
|
3061
|
+
* the document body whenever the controlling condition becomes true again!
|
|
3062
|
+
*/
|
|
3063
|
+
declare function evaluateLiveVisibilityClauses(snapshot: IDocumentData, metadataOverride?: IDocTemplateMetadata): {
|
|
3064
|
+
snapshot: IDocumentData;
|
|
3065
|
+
metadata: IDocTemplateMetadata;
|
|
3066
|
+
changed: boolean;
|
|
3067
|
+
};
|
|
3068
|
+
/**
|
|
3069
|
+
* Computes real-time document statistics & SDT form completion metrics.
|
|
3070
|
+
* Note: `completionRate` is a normalized ratio in `[0, 1]` (`1` when `sdtRequiredCount === 0`).
|
|
3071
|
+
*/
|
|
3072
|
+
declare function getDocumentStats(snapshot: Partial<IDocumentData> | null | undefined): IDocDocumentStats;
|
|
3073
|
+
/**
|
|
3074
|
+
* Compares two `IDocumentData` snapshots, returning structured SDT form field diffs
|
|
3075
|
+
* (`fieldDiffs`) plus exact plain-text insertion/deletion character counts (`textChanged`, `addedLength`, `removedLength`).
|
|
3076
|
+
*/
|
|
3077
|
+
declare function diffDocSnapshots(beforeSnapshot: Partial<IDocumentData> | null | undefined, afterSnapshot: Partial<IDocumentData> | null | undefined): IDocSnapshotDiffResult;
|
|
3078
|
+
|
|
3079
|
+
/**
|
|
3080
|
+
* Splices `[start, endInclusive]` with `replacementStream` (which may contain internal `\r` paragraph breaks),
|
|
3081
|
+
* removing superseded internal `IParagraph` entries in `[start, endInclusive]` and creating matching `IParagraph`
|
|
3082
|
+
* entries for every `\r` inside `replacementStream`.
|
|
3083
|
+
*/
|
|
3084
|
+
declare function spliceMultiParagraphBodySpan(sourceBody: IDocumentBody, start: number, endInclusive: number, replacementStream: string, options?: {
|
|
3085
|
+
targetRangeId?: string;
|
|
3086
|
+
updatedRangeProperties?: Record<string, unknown>;
|
|
3087
|
+
textStyle?: ITextStyle;
|
|
3088
|
+
paragraphStyle?: Record<string, unknown>;
|
|
3089
|
+
}): IDocumentBody;
|
|
3090
|
+
declare function resolveCalloutPresetTheme(preset?: DocCalloutPreset, overrides?: {
|
|
3091
|
+
title?: string;
|
|
3092
|
+
backgroundColor?: string;
|
|
3093
|
+
borderColor?: string;
|
|
3094
|
+
textColor?: string;
|
|
3095
|
+
}): {
|
|
3096
|
+
defaultLabel: string;
|
|
3097
|
+
effectiveTitle: string;
|
|
3098
|
+
backgroundColor: string;
|
|
3099
|
+
borderColor: string;
|
|
3100
|
+
textColor: string;
|
|
3101
|
+
};
|
|
3102
|
+
declare function formatCalloutDisplayText(block: Pick<IDocCalloutBlock, 'preset' | 'title' | 'text'>): string;
|
|
3103
|
+
declare function insertCalloutIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertCalloutSpec, offset?: number): {
|
|
3104
|
+
snapshot: IDocumentData;
|
|
3105
|
+
callout: IDocCalloutBlock;
|
|
3106
|
+
endOffset: number;
|
|
3107
|
+
};
|
|
3108
|
+
declare function updateCalloutInSnapshot(sourceSnapshot: IDocumentData, id: string, patch: Partial<Omit<IDocCalloutBlock, 'id'>>): {
|
|
3109
|
+
snapshot: IDocumentData;
|
|
3110
|
+
callout: IDocCalloutBlock;
|
|
3111
|
+
} | null;
|
|
3112
|
+
declare function removeCalloutFromSnapshot(sourceSnapshot: IDocumentData, id: string): IDocumentData | null;
|
|
3113
|
+
declare function listDocCallouts(snapshot: Partial<IDocumentData> | null | undefined): IDocCalloutBlock[];
|
|
3114
|
+
declare function formatQuoteDisplayText(quote: Pick<IDocQuoteBlock, 'text' | 'citation'>): string;
|
|
3115
|
+
declare function insertQuoteIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertQuoteSpec, offset?: number): {
|
|
3116
|
+
snapshot: IDocumentData;
|
|
3117
|
+
quote: IDocQuoteBlock;
|
|
3118
|
+
endOffset: number;
|
|
3119
|
+
};
|
|
3120
|
+
declare function updateQuoteInSnapshot(sourceSnapshot: IDocumentData, id: string, patch: Partial<Omit<IDocQuoteBlock, 'id'>>): {
|
|
3121
|
+
snapshot: IDocumentData;
|
|
3122
|
+
quote: IDocQuoteBlock;
|
|
3123
|
+
} | null;
|
|
3124
|
+
declare function removeQuoteFromSnapshot(sourceSnapshot: IDocumentData, id: string): IDocumentData | null;
|
|
3125
|
+
declare function listDocQuotes(snapshot: Partial<IDocumentData> | null | undefined): IDocQuoteBlock[];
|
|
3126
|
+
declare function removeInlineDrawingBlockFromBody(sourceBody: IDocumentBody, blockId: string): IDocumentBody | null;
|
|
3127
|
+
declare function listLiveLatexFormulas(snapshot: Partial<IDocumentData> | null | undefined): IDocLatexFormulaSpec[];
|
|
3128
|
+
declare function listLiveDocCharts(snapshot: Partial<IDocumentData> | null | undefined): Array<IDocEmbeddedChart & {
|
|
3129
|
+
id: string;
|
|
3130
|
+
}>;
|
|
3131
|
+
declare function listLiveDocShapes(snapshot: Partial<IDocumentData> | null | undefined): Array<IDocEmbeddedShape & {
|
|
3132
|
+
id: string;
|
|
3133
|
+
}>;
|
|
3134
|
+
declare function formatInlineFormulaResult(rawEval: string | null, format?: DocInlineFormulaFormat, decimals?: number): string;
|
|
3135
|
+
declare function insertInlineFormulaIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertInlineFormulaSpec, offset?: number, extraVars?: Record<string, unknown>): {
|
|
3136
|
+
snapshot: IDocumentData;
|
|
3137
|
+
entry: IDocInlineFormula;
|
|
3138
|
+
endOffset: number;
|
|
3139
|
+
};
|
|
3140
|
+
declare function recalculateInlineFormulasInPlace(snapshot: IDocumentData, extraVars?: Record<string, unknown>): boolean;
|
|
3141
|
+
declare function listDocInlineFormulas(snapshot: Partial<IDocumentData> | null | undefined): IDocInlineFormula[];
|
|
3142
|
+
declare function compareDocTableCellValues(rawA: string, rawB: string, direction?: 'asc' | 'desc'): number;
|
|
3143
|
+
/**
|
|
3144
|
+
* Sorts body rows (`rowIndex >= headerRowCount`) of `body.tables[tableIndex]` by `columnIndex`
|
|
3145
|
+
* while preserving header rows and accurately shifting all cell `paragraphs`, `sectionBreaks`,
|
|
3146
|
+
* `textRuns`, `customRanges`, `customBlocks`, and `tableSource.tableRows`!
|
|
3147
|
+
*/
|
|
3148
|
+
declare function sortDocTableByColumnInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, columnIndex: number, direction?: 'asc' | 'desc', headerRowCount?: number): IDocumentData | null;
|
|
3149
|
+
declare function setDocTableRepeatHeaderInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, headerRowCount: number): IDocumentData | null;
|
|
3150
|
+
declare function resolveTableHeaderRowCount(snapshot: Partial<IDocumentData> | null | undefined, tableId: string): number;
|
|
3151
|
+
declare function convertTextToDocTableInSnapshot(sourceSnapshot: IDocumentData, text: string, delimiter?: string, offset?: number): {
|
|
3152
|
+
snapshot: IDocumentData;
|
|
3153
|
+
tableId: string;
|
|
3154
|
+
endOffset: number;
|
|
3155
|
+
} | null;
|
|
3156
|
+
declare function convertDocTableToText(snapshot: Partial<IDocumentData> | null | undefined, tableIndex: number, delimiter?: string): string;
|
|
3157
|
+
declare function expandRepeatingSectionTemplate(templateText: string, bindingPath: string, items: unknown[], rootData: Record<string, unknown>, emptyText?: string): string;
|
|
3158
|
+
declare function insertBookmarkIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertBookmarkSpec): {
|
|
3159
|
+
snapshot: IDocumentData;
|
|
3160
|
+
bookmark: IDocBookmark;
|
|
3161
|
+
} | null;
|
|
3162
|
+
declare function removeBookmarkFromSnapshot(sourceSnapshot: IDocumentData, nameOrId: string): IDocumentData | null;
|
|
3163
|
+
declare function listDocBookmarks(snapshot: Partial<IDocumentData> | null | undefined): IDocBookmark[];
|
|
3164
|
+
/**
|
|
3165
|
+
* Estimates the 1-based physical page number at `targetOffset` in `snapshot.body` using real
|
|
3166
|
+
* page dimensions, margins, paragraph wrapped line heights, inline drawings, table rows,
|
|
3167
|
+
* explicit `\f` (`PAGE_BREAK`) tokens, `pageBreakBefore` flags, and section breaks!
|
|
3168
|
+
*/
|
|
3169
|
+
declare function estimateDocOffsetPageNumber(snapshot: Partial<IDocumentData>, targetOffset: number, extraLeadingHeightPt?: number): number;
|
|
3170
|
+
declare function buildTocBlockLines(snapshot: Partial<IDocumentData>, title: string, maxLevel: number, excludeRange?: {
|
|
3171
|
+
startIndex: number;
|
|
3172
|
+
endIndex: number;
|
|
3173
|
+
}, options?: {
|
|
3174
|
+
showPageNumbers?: boolean;
|
|
3175
|
+
rightAlignPageNumbers?: boolean;
|
|
3176
|
+
tocInsertOffset?: number;
|
|
3177
|
+
}): string[];
|
|
3178
|
+
declare function insertTableOfContentsIntoSnapshot(sourceSnapshot: IDocumentData, spec?: IDocTableOfContentsSpec, offset?: number): {
|
|
3179
|
+
snapshot: IDocumentData;
|
|
3180
|
+
toc: IDocTableOfContentsEntry;
|
|
3181
|
+
endOffset: number;
|
|
3182
|
+
};
|
|
3183
|
+
declare function refreshTableOfContentsInSnapshot(sourceSnapshot: IDocumentData, overrideSpec?: IDocTableOfContentsSpec): {
|
|
3184
|
+
snapshot: IDocumentData;
|
|
3185
|
+
toc: IDocTableOfContentsEntry;
|
|
3186
|
+
endOffset: number;
|
|
3187
|
+
} | null;
|
|
3188
|
+
declare function removeTableOfContentsFromSnapshot(sourceSnapshot: IDocumentData): {
|
|
3189
|
+
snapshot: IDocumentData;
|
|
3190
|
+
removed: boolean;
|
|
3191
|
+
};
|
|
3192
|
+
/**
|
|
3193
|
+
* Synchronizes `IDocTemplateMetadata` and inline SVG drawings (`drawings`) with the live `body`
|
|
3194
|
+
* after `UndoCommand` / `RedoCommand` so every `v1.6.204` block/formula/chart/shape/bookmark
|
|
3195
|
+
* stays 100% consistent across Undo/Redo!
|
|
3196
|
+
*/
|
|
3197
|
+
declare function reconcileTemplateMetadataWithLiveSnapshot(snapshot: IDocumentData, baseMeta: IDocTemplateMetadata): IDocTemplateMetadata;
|
|
3198
|
+
|
|
3199
|
+
interface IParsedParagraphBorderLine {
|
|
3200
|
+
style: 'single' | 'double' | 'dashed';
|
|
3201
|
+
widthPt: number;
|
|
3202
|
+
color: string;
|
|
3203
|
+
}
|
|
3204
|
+
declare function parseParagraphBorderLine(raw?: string): IParsedParagraphBorderLine | null;
|
|
3205
|
+
declare function setParagraphBorderAndShadingInSnapshot(sourceSnapshot: IDocumentData, paragraphIndex: number, spec: IDocParagraphBorderShadingSpec): IDocumentData | null;
|
|
3206
|
+
declare function getParagraphBorderAndShading(snapshot: Partial<IDocumentData> | null | undefined, paragraphIndex: number): IDocParagraphBorderShadingSpec | undefined;
|
|
3207
|
+
declare function insertHorizontalDividerInSnapshot(sourceSnapshot: IDocumentData, style?: DocHorizontalDividerStyle, offset?: number): {
|
|
3208
|
+
snapshot: IDocumentData;
|
|
3209
|
+
dividerId: string;
|
|
3210
|
+
endOffset: number;
|
|
3211
|
+
} | null;
|
|
3212
|
+
declare function setParagraphTabStopsInSnapshot(sourceSnapshot: IDocumentData, paragraphIndex: number, tabStops: IDocTabStop[]): IDocumentData | null;
|
|
3213
|
+
declare function getParagraphTabStops(snapshot: Partial<IDocumentData> | null | undefined, paragraphIndex: number): IDocTabStop[];
|
|
3214
|
+
declare function getCollapsedHeadingsFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocCollapsedHeadingEntry[];
|
|
3215
|
+
declare function toggleHeadingCollapseInSnapshot(sourceSnapshot: IDocumentData, headingParagraphIndex: number): {
|
|
3216
|
+
snapshot: IDocumentData;
|
|
3217
|
+
collapsed: boolean;
|
|
3218
|
+
} | null;
|
|
3219
|
+
declare function findAndReplaceDocTextInSnapshot(sourceSnapshot: IDocumentData, query: string, replacement: string, options?: IDocFindReplaceOptions): {
|
|
3220
|
+
snapshot: IDocumentData;
|
|
3221
|
+
count: number;
|
|
3222
|
+
};
|
|
3223
|
+
declare function getDocumentStatistics(snapshot: Partial<IDocumentData> | null | undefined): IDocReadabilityStatistics;
|
|
3224
|
+
|
|
3225
|
+
declare function checkDocumentSpellingAndTerms(snapshot: Partial<IDocumentData> | null | undefined, customGlossary?: DocCustomGlossaryInput): IDocTermDiagnostic[];
|
|
3226
|
+
declare function insertPageBreakInSnapshot(sourceSnapshot: IDocumentData, offset?: number): {
|
|
3227
|
+
snapshot: IDocumentData;
|
|
3228
|
+
endOffset: number;
|
|
3229
|
+
} | null;
|
|
3230
|
+
declare function insertSectionBreakInSnapshot(sourceSnapshot: IDocumentData, type?: DocSectionBreakKind, offset?: number, orientation?: 'portrait' | 'landscape'): {
|
|
3231
|
+
snapshot: IDocumentData;
|
|
3232
|
+
sectionId: string;
|
|
3233
|
+
endOffset: number;
|
|
3234
|
+
} | null;
|
|
3235
|
+
declare function setSectionOrientationInSnapshot(sourceSnapshot: IDocumentData, orientation: 'portrait' | 'landscape', sectionKeyOrOffset?: string | number): IDocumentData;
|
|
3236
|
+
declare function insertColumnGroupInSnapshot(sourceSnapshot: IDocumentData, columnCount: 2 | 3 | 4 | 5, options?: IDocColumnGroupOptions): {
|
|
3237
|
+
snapshot: IDocumentData;
|
|
3238
|
+
config: IDocColumnGroupConfig;
|
|
3239
|
+
} | null;
|
|
3240
|
+
declare function getColumnGroupConfigFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocColumnGroupConfig | undefined;
|
|
3241
|
+
declare function updateColumnGroupInSnapshot(sourceSnapshot: IDocumentData, patch: Partial<IDocColumnGroupConfig>): {
|
|
3242
|
+
snapshot: IDocumentData;
|
|
3243
|
+
config: IDocColumnGroupConfig;
|
|
3244
|
+
} | null;
|
|
3245
|
+
declare function deleteColumnGroupFromSnapshot(sourceSnapshot: IDocumentData): {
|
|
3246
|
+
snapshot: IDocumentData;
|
|
3247
|
+
deleted: boolean;
|
|
3248
|
+
};
|
|
3249
|
+
declare function setParagraphPaginationInSnapshot(sourceSnapshot: IDocumentData, paragraphIndex: number, spec: IDocParagraphPaginationSpec): IDocumentData | null;
|
|
3250
|
+
declare function getParagraphPagination(snapshot: Partial<IDocumentData> | null | undefined, paragraphIndex: number): IDocParagraphPaginationSpec;
|
|
3251
|
+
declare function setDocPrintConfigInSnapshot(sourceSnapshot: IDocumentData, patch: Partial<IDocPrintConfig>): IDocumentData;
|
|
3252
|
+
declare function getDocPrintConfigFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocPrintConfig;
|
|
3253
|
+
|
|
3254
|
+
declare function updateDocImageTransformInSnapshot(sourceSnapshot: IDocumentData, drawingId: string, spec: IDocImageTransformSpec): IDocumentData | null;
|
|
3255
|
+
declare function getDocImageTransformFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, drawingId: string): IDocImageTransformSpec | undefined;
|
|
3256
|
+
declare function renderSmartArtSvg(spec: IDocSmartArtSpec): string;
|
|
3257
|
+
declare function renderSmartArtToSvgDataUri(spec: IDocSmartArtSpec): {
|
|
3258
|
+
svg: string;
|
|
3259
|
+
dataUri: string;
|
|
3260
|
+
widthPt: number;
|
|
3261
|
+
heightPt: number;
|
|
3262
|
+
};
|
|
3263
|
+
declare function attachSmartArtMetaRangeOnBody(body: IDocumentBody, blockId: string, insertOffset: number, spec: IDocSmartArtSpec & {
|
|
3264
|
+
id: string;
|
|
3265
|
+
}): void;
|
|
3266
|
+
declare function insertSmartArtIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocSmartArtSpec, offset?: number): {
|
|
3267
|
+
snapshot: IDocumentData;
|
|
3268
|
+
smartArt: IDocSmartArtSpec & {
|
|
3269
|
+
id: string;
|
|
3270
|
+
};
|
|
3271
|
+
endOffset: number;
|
|
3272
|
+
} | null;
|
|
3273
|
+
declare function updateSmartArtInSnapshot(sourceSnapshot: IDocumentData, id: string, patch: Partial<IDocSmartArtSpec>): {
|
|
3274
|
+
snapshot: IDocumentData;
|
|
3275
|
+
smartArt: IDocSmartArtSpec & {
|
|
3276
|
+
id: string;
|
|
3277
|
+
};
|
|
3278
|
+
} | null;
|
|
3279
|
+
declare function listLiveSmartArts(snapshot: Partial<IDocumentData> | null | undefined): Array<IDocSmartArtSpec & {
|
|
3280
|
+
id: string;
|
|
3281
|
+
}>;
|
|
3282
|
+
declare function insertDocTableRowInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, rowIndex: number, position?: 'above' | 'below'): IDocumentData | null;
|
|
3283
|
+
declare function deleteDocTableRowInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, rowIndex: number): IDocumentData | null;
|
|
3284
|
+
declare function insertDocTableColumnInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, colIndex: number, position?: 'left' | 'right'): IDocumentData | null;
|
|
3285
|
+
declare function deleteDocTableColumnInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, colIndex: number): IDocumentData | null;
|
|
3286
|
+
declare function findMergedMasterInTableRows(tableRows: ITableRow[] | undefined, row: number, col: number): {
|
|
3287
|
+
row: number;
|
|
3288
|
+
col: number;
|
|
3289
|
+
rowSpan: number;
|
|
3290
|
+
colSpan: number;
|
|
3291
|
+
} | null;
|
|
3292
|
+
declare function mergeDocTableCellsInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, startRow: number, startCol: number, endRow: number, endCol: number): IDocumentData | null;
|
|
3293
|
+
declare function splitDocTableCellInSnapshot(sourceSnapshot: IDocumentData, tableIndex: number, row: number, col: number): IDocumentData | null;
|
|
3294
|
+
declare function parseFieldInstrString(rawInstr: string): {
|
|
3295
|
+
fieldType: DocFieldType;
|
|
3296
|
+
instructionArgs?: string;
|
|
3297
|
+
};
|
|
3298
|
+
declare function insertDocFieldIntoSnapshot(sourceSnapshot: IDocumentData, fieldType: DocFieldType, instructionArgs?: string, offset?: number, context?: IDocFieldContext): {
|
|
3299
|
+
snapshot: IDocumentData;
|
|
3300
|
+
field: IDocFieldEntry;
|
|
3301
|
+
endOffset: number;
|
|
3302
|
+
} | null;
|
|
3303
|
+
declare function setDocCustomPropertiesInSnapshot(sourceSnapshot: IDocumentData, customProperties: Record<string, string | number | boolean>, company?: string): IDocumentData;
|
|
3304
|
+
declare function getDocCustomPropertiesFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): {
|
|
3305
|
+
company?: string;
|
|
3306
|
+
customProperties: Record<string, string | number | boolean>;
|
|
3307
|
+
};
|
|
3308
|
+
declare function listDocFields(snapshot: Partial<IDocumentData> | null | undefined): IDocFieldEntry[];
|
|
3309
|
+
declare function updateAllDocFieldsInSnapshot(snapshot: IDocumentData, context?: IDocFieldContext): boolean;
|
|
3310
|
+
declare function insertCaptionIntoSnapshot(sourceSnapshot: IDocumentData, category: DocCaptionCategory, title: string, offset?: number): {
|
|
3311
|
+
snapshot: IDocumentData;
|
|
3312
|
+
caption: IDocCaptionEntry;
|
|
3313
|
+
endOffset: number;
|
|
3314
|
+
} | null;
|
|
3315
|
+
declare function listDocCaptions(snapshot: Partial<IDocumentData> | null | undefined): IDocCaptionEntry[];
|
|
3316
|
+
declare function insertCrossReferenceIntoSnapshot(sourceSnapshot: IDocumentData, targetBookmarkOrCaptionId: string, offset?: number): {
|
|
3317
|
+
snapshot: IDocumentData;
|
|
3318
|
+
field: IDocFieldEntry;
|
|
3319
|
+
endOffset: number;
|
|
3320
|
+
} | null;
|
|
3321
|
+
declare function insertCitationIntoSnapshot(sourceSnapshot: IDocumentData, source: IDocCitationSource, offset?: number): {
|
|
3322
|
+
snapshot: IDocumentData;
|
|
3323
|
+
citationIndex: number;
|
|
3324
|
+
endOffset: number;
|
|
3325
|
+
} | null;
|
|
3326
|
+
declare function listDocCitations(snapshot: Partial<IDocumentData> | null | undefined): IDocCitationSource[];
|
|
3327
|
+
declare function insertBibliographyIntoSnapshot(sourceSnapshot: IDocumentData, offset?: number, title?: string): {
|
|
3328
|
+
snapshot: IDocumentData;
|
|
3329
|
+
lineCount: number;
|
|
3330
|
+
endOffset: number;
|
|
3331
|
+
} | null;
|
|
3332
|
+
declare function insertBuildingBlockIntoSnapshot(sourceSnapshot: IDocumentData, block: IDocBuildingBlockEntry, offset?: number): {
|
|
3333
|
+
snapshot: IDocumentData;
|
|
3334
|
+
endOffset: number;
|
|
3335
|
+
} | null;
|
|
3336
|
+
declare function runMailMergeBatchOnSnapshot(templateSnapshot: IDocumentData, records: Array<Record<string, unknown>>, format: DocMailMergeBatchFormat): Promise<IDocMailMergeBatchResultItem[]>;
|
|
3337
|
+
|
|
3338
|
+
declare const DEFAULT_FOOTNOTE_SETTINGS: IDocNoteSettings;
|
|
3339
|
+
declare const DEFAULT_ENDNOTE_SETTINGS: IDocNoteSettings;
|
|
3340
|
+
declare function formatDocNoteNumber(num: number, format?: DocNoteNumberFormat): string;
|
|
3341
|
+
declare function getDocNoteSettingsFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, noteType?: DocNoteType): IDocNoteSettings;
|
|
3342
|
+
/**
|
|
3343
|
+
* Automatically renumbers all footnote & endnote superscript references in `snapshot.body`
|
|
3344
|
+
* (`1, 2, 3...` or configured `numberFormat` / `startAt` / `restartRule`) and syncs `snapshot.notes` + metadata.
|
|
3345
|
+
*/
|
|
3346
|
+
declare function renumberDocNotesInPlace(snapshot: IDocumentData): IDocNoteEntry[];
|
|
3347
|
+
declare function listDocNotesFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, noteType?: DocNoteType): IDocNoteEntry[];
|
|
3348
|
+
declare function insertDocNoteIntoSnapshot(sourceSnapshot: IDocumentData, params: {
|
|
3349
|
+
noteType: DocNoteType;
|
|
3350
|
+
text: string;
|
|
3351
|
+
offset?: number;
|
|
3352
|
+
id?: string;
|
|
3353
|
+
}): {
|
|
3354
|
+
snapshot: IDocumentData;
|
|
3355
|
+
note: IDocNoteEntry;
|
|
3356
|
+
};
|
|
3357
|
+
declare function updateDocNoteInSnapshot(sourceSnapshot: IDocumentData, noteId: string, nextText: string): {
|
|
3358
|
+
snapshot: IDocumentData;
|
|
3359
|
+
updated: boolean;
|
|
3360
|
+
};
|
|
3361
|
+
declare function deleteDocNoteFromSnapshot(sourceSnapshot: IDocumentData, noteId: string): {
|
|
3362
|
+
snapshot: IDocumentData;
|
|
3363
|
+
deleted: boolean;
|
|
3364
|
+
};
|
|
3365
|
+
declare function setDocNoteSettingsInSnapshot(sourceSnapshot: IDocumentData, noteType: DocNoteType, patch: Partial<IDocNoteSettings>): IDocumentData;
|
|
3366
|
+
declare function formatDocListMarker(glyphType: DocListGlyphType, level: number, countersAtLevels: number[], checked?: boolean): string;
|
|
3367
|
+
declare function resolveListIdGlyphType(listId: string, nestingLevel: number, metaListDefs?: Record<string, {
|
|
3368
|
+
glyphType: DocListGlyphType;
|
|
3369
|
+
levels?: Record<number, DocListGlyphType>;
|
|
3370
|
+
}>, bulletListType?: string): DocListGlyphType;
|
|
3371
|
+
declare function insertDocListInSnapshot(sourceSnapshot: IDocumentData, spec: IDocListInsertSpec): {
|
|
3372
|
+
snapshot: IDocumentData;
|
|
3373
|
+
listId: string;
|
|
3374
|
+
affectedParagraphIds: string[];
|
|
3375
|
+
};
|
|
3376
|
+
declare function setDocListGlyphTypeInSnapshot(sourceSnapshot: IDocumentData, listIdOrParagraphId: string, glyphType: DocListGlyphType, level?: number): IDocumentData;
|
|
3377
|
+
declare function setDocListLevelInSnapshot(sourceSnapshot: IDocumentData, paragraphIdOrOffset: string | number, nestingLevel: number): IDocumentData;
|
|
3378
|
+
declare function toggleDocListCheckboxInSnapshot(sourceSnapshot: IDocumentData, paragraphId: string, checked?: boolean): IDocumentData;
|
|
3379
|
+
declare function getDocListsFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocListParagraphInfo[];
|
|
3380
|
+
|
|
3381
|
+
declare function detectAutoTextDirection(text: string): 'ltr' | 'rtl';
|
|
3382
|
+
declare function setDocTextDirectionInSnapshot(sourceSnapshot: IDocumentData, direction: DocTextDirection, options?: {
|
|
3383
|
+
paragraphIds?: string[];
|
|
3384
|
+
startOffset?: number;
|
|
3385
|
+
endOffset?: number;
|
|
3386
|
+
tableIndex?: number;
|
|
3387
|
+
tableId?: string;
|
|
3388
|
+
}): IDocumentData;
|
|
3389
|
+
declare function getDocParagraphDirection(snapshot: Partial<IDocumentData> | null | undefined, paragraphOrId: IParagraph | string | undefined, paraPlainText?: string): 'ltr' | 'rtl';
|
|
3390
|
+
declare function getDocTableDirection(snapshot: Partial<IDocumentData> | null | undefined, tableId: string): 'ltr' | 'rtl';
|
|
3391
|
+
declare function setDocCopyPastePolicyInSnapshot(sourceSnapshot: IDocumentData, policy: Partial<IDocCopyPastePolicy>): IDocumentData;
|
|
3392
|
+
declare function getDocCopyPastePolicyFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocCopyPastePolicy;
|
|
3393
|
+
declare function applyCopyPolicyToSelectedText(selectedText: string, policy: IDocCopyPastePolicy | undefined): {
|
|
3394
|
+
allowed: boolean;
|
|
3395
|
+
text: string;
|
|
3396
|
+
};
|
|
3397
|
+
declare function setDocTableBorderPresetInSnapshot(sourceSnapshot: IDocumentData, tableIndexOrId: number | string, preset: DocTableBorderPreset, color?: string, widthPt?: number): IDocumentData | null;
|
|
3398
|
+
declare function setDocTableCellPropertiesInSnapshot(sourceSnapshot: IDocumentData, tableIndexOrId: number | string, rowIndex: number, colIndex: number, props: IDocTableCellProperties): IDocumentData | null;
|
|
3399
|
+
declare function getDocTableCellProperties(snapshot: Partial<IDocumentData> | null | undefined, tableId: string, rowIndex: number, colIndex: number): IDocTableCellProperties | undefined;
|
|
3400
|
+
declare function isOffsetInLockedTableCell(snapshot: Partial<IDocumentData> | null | undefined, offset: number): boolean;
|
|
3401
|
+
declare function autoFitDocTableInSnapshot(sourceSnapshot: IDocumentData, tableIndexOrId: number | string, mode?: DocTableAutoFitMode): IDocumentData | null;
|
|
3402
|
+
declare function computeSignatureBoundingBox(strokes: IDocSignatureStroke[], padding?: number): {
|
|
3403
|
+
minX: number;
|
|
3404
|
+
minY: number;
|
|
3405
|
+
maxX: number;
|
|
3406
|
+
maxY: number;
|
|
3407
|
+
width: number;
|
|
3408
|
+
height: number;
|
|
3409
|
+
} | null;
|
|
3410
|
+
declare function renderSignatureStrokesToSvgDataUri(strokes: IDocSignatureStroke[], autoCrop?: boolean, canvasWidth?: number, canvasHeight?: number): {
|
|
3411
|
+
dataUri: string;
|
|
3412
|
+
width: number;
|
|
3413
|
+
height: number;
|
|
3414
|
+
} | null;
|
|
3415
|
+
declare function autoCropCanvasToPngDataUrl(canvas: HTMLCanvasElement, strokes?: IDocSignatureStroke[], padding?: number): string;
|
|
3416
|
+
declare function cleanUpDocFormattingInSnapshot(sourceSnapshot: IDocumentData, options?: IDocCleanUpFormattingOptions): {
|
|
3417
|
+
snapshot: IDocumentData;
|
|
3418
|
+
result: IDocCleanUpFormattingResult;
|
|
3419
|
+
};
|
|
3420
|
+
interface IDocActionMacroService {
|
|
3421
|
+
isRecording(): boolean;
|
|
3422
|
+
startRecording(name?: string): void;
|
|
3423
|
+
stopRecording(name?: string): IDocRecordedActionMacro;
|
|
3424
|
+
recordStep(commandId: string, params?: Record<string, unknown>): void;
|
|
3425
|
+
getMacros(): IDocRecordedActionMacro[];
|
|
3426
|
+
deleteMacro(macroIdOrName: string): boolean;
|
|
3427
|
+
playMacro(macroIdOrName: string): Promise<number>;
|
|
3428
|
+
exportMacros(): string;
|
|
3429
|
+
importMacros(jsonOrList: string | IDocRecordedActionMacro[]): number;
|
|
3430
|
+
}
|
|
3431
|
+
declare const IDocActionMacroService: _univerjs_core.IdentifierDecorator<IDocActionMacroService>;
|
|
3432
|
+
declare class DocActionMacroService extends Disposable implements IDocActionMacroService {
|
|
3433
|
+
private readonly _commandService;
|
|
3434
|
+
private _recording;
|
|
3435
|
+
private _replaying;
|
|
3436
|
+
private _activeName;
|
|
3437
|
+
private _activeSteps;
|
|
3438
|
+
private _macros;
|
|
3439
|
+
constructor(_commandService: ICommandService);
|
|
3440
|
+
isRecording(): boolean;
|
|
3441
|
+
startRecording(name?: string): void;
|
|
3442
|
+
recordStep(commandId: string, params?: Record<string, unknown>): void;
|
|
3443
|
+
stopRecording(name?: string): IDocRecordedActionMacro;
|
|
3444
|
+
getMacros(): IDocRecordedActionMacro[];
|
|
3445
|
+
deleteMacro(macroIdOrName: string): boolean;
|
|
3446
|
+
playMacro(macroIdOrName: string): Promise<number>;
|
|
3447
|
+
exportMacros(): string;
|
|
3448
|
+
importMacros(jsonOrList: string | IDocRecordedActionMacro[]): number;
|
|
3449
|
+
}
|
|
3450
|
+
/**
|
|
3451
|
+
* Merges `baseSnapshot` and `revisedSnapshot` into a single red/blue `IDocTrackRevision` visual comparison document:
|
|
3452
|
+
* - Deleted tokens from `baseSnapshot` are highlighted in red strikethrough (`#DC2626` / `#FEE2E2`, `type: 'delete'`)
|
|
3453
|
+
* - Inserted tokens from `revisedSnapshot` are highlighted in blue underline (`#2C53F1` / `#F3F5FF`, `type: 'insert'`)
|
|
3454
|
+
*/
|
|
3455
|
+
declare function buildVisualComparisonSnapshot(baseSnapshot: IDocumentData, revisedSnapshot: IDocumentData, options?: IDocVisualComparisonOptions): IDocVisualComparisonResult;
|
|
3456
|
+
|
|
3457
|
+
/**
|
|
3458
|
+
* Resolves live paragraph indices and character offsets `[charStart, charEndInclusive]` for a visible `IDocAreaRegion`.
|
|
3459
|
+
*/
|
|
3460
|
+
declare function resolveLiveDocAreaSpan(snapshot: Partial<IDocumentData> | null | undefined, area: IDocAreaRegion): {
|
|
3461
|
+
area: IDocAreaRegion;
|
|
3462
|
+
charStart: number;
|
|
3463
|
+
charEndInclusive: number;
|
|
3464
|
+
contentEndExclusive: number;
|
|
3465
|
+
} | null;
|
|
3466
|
+
declare function getDocAreasFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocAreaRegion[];
|
|
3467
|
+
|
|
3468
|
+
declare function insertDocAreaInSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertAreaSpec, offset?: number): {
|
|
3469
|
+
snapshot: IDocumentData;
|
|
3470
|
+
area: IDocAreaRegion;
|
|
3471
|
+
endOffset: number;
|
|
3472
|
+
} | null;
|
|
3473
|
+
|
|
3474
|
+
declare function getDocAreaValueFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, areaId: string): IDocAreaValueResult | null;
|
|
3475
|
+
|
|
3476
|
+
/**
|
|
3477
|
+
* Atomically replaces body content inside `areaId`, shifting all downstream
|
|
3478
|
+
* `paragraphs`, `textRuns`, `tables`, `customRanges`, `customBlocks`, `revisions`, and downstream `docAreas`!
|
|
3479
|
+
*/
|
|
3480
|
+
declare function setDocAreaValueInSnapshot(sourceSnapshot: IDocumentData, areaId: string, newText: string): {
|
|
3481
|
+
snapshot: IDocumentData;
|
|
3482
|
+
area: IDocAreaRegion;
|
|
3483
|
+
} | null;
|
|
3484
|
+
|
|
3485
|
+
/**
|
|
3486
|
+
* Updates properties (`name`, `mode`, `backgroundColor`, `borderColor`, `placeholder`, `deletable`, `hide`)
|
|
3487
|
+
* on an `IDocAreaRegion`, supporting lossless `hide: true` / `hide: false` hide & restore!
|
|
3488
|
+
*/
|
|
3489
|
+
declare function setDocAreaPropertiesInSnapshot(sourceSnapshot: IDocumentData, areaId: string, patch: Partial<Omit<IDocAreaRegion, 'id' | 'startParagraphIndex' | 'endParagraphIndex'>>): {
|
|
3490
|
+
snapshot: IDocumentData;
|
|
3491
|
+
area: IDocAreaRegion;
|
|
3492
|
+
} | null;
|
|
3493
|
+
|
|
3494
|
+
declare function deleteDocAreaFromSnapshot(sourceSnapshot: IDocumentData, areaId: string, options?: {
|
|
3495
|
+
force?: boolean;
|
|
3496
|
+
keepContent?: boolean;
|
|
3497
|
+
}): IDocumentData | null;
|
|
3498
|
+
|
|
3499
|
+
/**
|
|
3500
|
+
* Enforces per-area `mode` at `offset`:
|
|
3501
|
+
* - `globalMode === 'view'`: always read-only (`true`)
|
|
3502
|
+
* - `area.mode === 'readonly'`: blocks ALL edits inside the area (`true`)
|
|
3503
|
+
* - `area.mode === 'form'`: allows edits ONLY inside unlocked SDT controls within that area (`false` inside SDT, `true` outside)
|
|
3504
|
+
* - `area.mode === 'edit'`: allows full editing (`false`)
|
|
3505
|
+
*/
|
|
3506
|
+
declare function isOffsetReadonlyByArea(snapshot: Partial<IDocumentData> | null | undefined, offset: number, globalMode?: DocWorkMode): boolean;
|
|
3507
|
+
declare function setDocMainBadgeInSnapshot(sourceSnapshot: IDocumentData, badge: IDocCornerBadge | null): IDocumentData;
|
|
3508
|
+
|
|
3509
|
+
declare function getDocMainBadgeFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocCornerBadge | null;
|
|
3510
|
+
|
|
3511
|
+
declare function setDocAreaBadgeInSnapshot(sourceSnapshot: IDocumentData, areaId: string, badge: IDocCornerBadge | null): IDocumentData | null;
|
|
3512
|
+
|
|
3513
|
+
declare function getDocAreaBadgeFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, areaId: string): IDocCornerBadge | null;
|
|
3514
|
+
|
|
3515
|
+
declare function resolveLabelBadgePalette(tone?: DocLabelBadgeTone, colorOverride?: string, bgOverride?: string): {
|
|
3516
|
+
color: string;
|
|
3517
|
+
backgroundColor: string;
|
|
3518
|
+
borderColor: string;
|
|
3519
|
+
};
|
|
3520
|
+
declare function renderDocLabelBadgeSvg(spec: Pick<IDocLabelBadge, 'text' | 'color' | 'backgroundColor' | 'borderColor'> & {
|
|
3521
|
+
widthPt?: number;
|
|
3522
|
+
heightPt?: number;
|
|
3523
|
+
}): {
|
|
3524
|
+
svg: string;
|
|
3525
|
+
dataUri: string;
|
|
3526
|
+
widthPt: number;
|
|
3527
|
+
heightPt: number;
|
|
3528
|
+
};
|
|
3529
|
+
declare function insertDocLabelBadgeInSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertLabelBadgeSpec, offset?: number): {
|
|
3530
|
+
snapshot: IDocumentData;
|
|
3531
|
+
badge: IDocLabelBadge;
|
|
3532
|
+
endOffset: number;
|
|
3533
|
+
} | null;
|
|
3534
|
+
|
|
3535
|
+
declare function getDocLabelBadgesFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocLabelBadge[];
|
|
3536
|
+
|
|
3537
|
+
declare function removeDocLabelBadgeFromSnapshot(sourceSnapshot: IDocumentData, id: string): IDocumentData | null;
|
|
3538
|
+
|
|
3539
|
+
declare const MAX_CASCADE_ITERATIONS = 10;
|
|
3540
|
+
/**
|
|
3541
|
+
* Evaluates a declarative cascade condition expression (supporting `&&`, `||`, `!`, `in [...]`,
|
|
3542
|
+
* `'today'`, `datediff`, `empty`, `notEmpty`, `len`, `count`, `contains`, `floor`, `ceil`, `power`, `sqrt`, `if`)
|
|
3543
|
+
* against the live document SDT & dataset context without `eval` or `Function`.
|
|
3544
|
+
*/
|
|
3545
|
+
declare function evaluateCascadeCondition(conditionExpr: string, context: Record<string, unknown>): boolean;
|
|
3546
|
+
/**
|
|
3547
|
+
* Evaluates all `IDocCascadeRule` definitions on `snapshot` in-place with baseline property snapshots
|
|
3548
|
+
* (so flipping `conditionExpr` back to `false` losslessly restores original `required` / `lock` / `deletable` / `visible` states)
|
|
3549
|
+
* and a `MAX_CASCADE_ITERATIONS = 10` cycle guard!
|
|
3550
|
+
*/
|
|
3551
|
+
declare function evaluateDocCascadeRulesInPlace(snapshot: IDocumentData, extraData?: Record<string, unknown>): Omit<IDocCascadeEvaluationResult, 'snapshot'>;
|
|
3552
|
+
declare function evaluateDocCascadeRules(sourceSnapshot: IDocumentData, extraData?: Record<string, unknown>): IDocCascadeEvaluationResult;
|
|
3553
|
+
declare function getDocCascadeRulesFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocCascadeRule[];
|
|
3554
|
+
|
|
3555
|
+
declare function setDocCascadeRulesInSnapshot(sourceSnapshot: IDocumentData, rules: IDocCascadeRule[], evaluateImmediately?: boolean): IDocCascadeEvaluationResult;
|
|
3556
|
+
|
|
3557
|
+
declare function addDocCascadeRuleInSnapshot(sourceSnapshot: IDocumentData, rule: IDocCascadeRule, evaluateImmediately?: boolean): IDocCascadeEvaluationResult;
|
|
3558
|
+
|
|
3559
|
+
declare function removeDocCascadeRuleFromSnapshot(sourceSnapshot: IDocumentData, ruleId: string, evaluateImmediately?: boolean): IDocCascadeEvaluationResult;
|
|
3560
|
+
|
|
3561
|
+
declare function resolveSeparatorDimensions(widthPt?: number): {
|
|
3562
|
+
strokeWidthPt: number;
|
|
3563
|
+
spanWidthPt: number;
|
|
3564
|
+
};
|
|
3565
|
+
declare function renderStyledSeparatorSvg(dashStyle?: DocSeparatorDashStyle, color?: string, widthPt?: number): {
|
|
3566
|
+
svg: string;
|
|
3567
|
+
dataUri: string;
|
|
3568
|
+
widthPt: number;
|
|
3569
|
+
heightPt: number;
|
|
3570
|
+
strokeWidthPt: number;
|
|
3571
|
+
};
|
|
3572
|
+
declare function insertStyledSeparatorInSnapshot(sourceSnapshot: IDocumentData, dashStyle?: DocSeparatorDashStyle, color?: string, widthPt?: number, offset?: number): {
|
|
3573
|
+
snapshot: IDocumentData;
|
|
3574
|
+
separator: IDocStyledSeparatorEntry;
|
|
3575
|
+
endOffset: number;
|
|
3576
|
+
} | null;
|
|
3577
|
+
|
|
3578
|
+
declare function getStyledSeparatorsFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocStyledSeparatorEntry[];
|
|
3579
|
+
declare function sanitizeDocEmbedUrl(rawUrl: string): string;
|
|
3580
|
+
declare function renderDocEmbedBlockCardSvg(block: IDocEmbedBlock): {
|
|
3581
|
+
svg: string;
|
|
3582
|
+
dataUri: string;
|
|
3583
|
+
widthPt: number;
|
|
3584
|
+
heightPt: number;
|
|
3585
|
+
};
|
|
3586
|
+
declare function insertDocEmbedBlockInSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertEmbedBlockSpec, offset?: number): {
|
|
3587
|
+
snapshot: IDocumentData;
|
|
3588
|
+
embedBlock: IDocEmbedBlock;
|
|
3589
|
+
endOffset: number;
|
|
3590
|
+
} | null;
|
|
3591
|
+
|
|
3592
|
+
declare function getDocEmbedBlocksFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocEmbedBlock[];
|
|
3593
|
+
|
|
3594
|
+
declare function removeDocEmbedBlockFromSnapshot(sourceSnapshot: IDocumentData, id: string): IDocumentData | null;
|
|
3595
|
+
|
|
3596
|
+
declare function normalizeMacroName(rawName: string): string;
|
|
3597
|
+
declare function registerDocMacro(name: string, resolverOrValue: DocMacroResolver, unitId?: string): void;
|
|
3598
|
+
declare function unregisterDocMacro(name: string, unitId?: string): boolean;
|
|
3599
|
+
declare function clearRegisteredDocMacros(unitId?: string): void;
|
|
3600
|
+
declare function getRegisteredDocMacros(unitId?: string): Record<string, DocMacroResolver>;
|
|
3601
|
+
declare function applyDocMacrosInSnapshot(sourceSnapshot: IDocumentData, options?: {
|
|
3602
|
+
unitId?: string;
|
|
3603
|
+
extraMacros?: Record<string, DocMacroResolver>;
|
|
3604
|
+
now?: Date;
|
|
3605
|
+
}): {
|
|
3606
|
+
snapshot: IDocumentData;
|
|
3607
|
+
replacedCount: number;
|
|
3608
|
+
resolvedValues: Record<string, string>;
|
|
3609
|
+
};
|
|
3610
|
+
|
|
3611
|
+
declare function addDocGraffitiStrokeInSnapshot(sourceSnapshot: IDocumentData, spec: IDocAddGraffitiStrokeSpec): {
|
|
3612
|
+
snapshot: IDocumentData;
|
|
3613
|
+
stroke: IDocGraffitiStroke;
|
|
3614
|
+
} | null;
|
|
3615
|
+
|
|
3616
|
+
declare function getDocGraffitiStrokesFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, pageIndex?: number): IDocGraffitiStroke[];
|
|
3617
|
+
|
|
3618
|
+
declare function clearDocGraffitiStrokesInSnapshot(sourceSnapshot: IDocumentData, pageIndex?: number): IDocumentData;
|
|
3619
|
+
|
|
3620
|
+
declare const DOC_HYPERLINK_DEFAULT_COLOR = "#2563eb";
|
|
3621
|
+
declare function sanitizeDocHyperlinkUrl(rawUrl: string): string;
|
|
3622
|
+
declare function listDocHyperlinks(snapshot: Partial<IDocumentData> | null | undefined): IDocHyperlinkEntry[];
|
|
3623
|
+
declare function insertHyperlinkIntoSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertHyperlinkSpec): {
|
|
3624
|
+
snapshot: IDocumentData;
|
|
3625
|
+
entry: IDocHyperlinkEntry | null;
|
|
3626
|
+
};
|
|
3627
|
+
declare function updateHyperlinkInSnapshot(sourceSnapshot: IDocumentData, idOrOffset: string | number, patch: IDocUpdateHyperlinkSpec): {
|
|
3628
|
+
snapshot: IDocumentData;
|
|
3629
|
+
updated: boolean;
|
|
3630
|
+
};
|
|
3631
|
+
declare function cancelHyperlinkInSnapshot(sourceSnapshot: IDocumentData, idOrOffset: string | number): {
|
|
3632
|
+
snapshot: IDocumentData;
|
|
3633
|
+
canceled: boolean;
|
|
3634
|
+
};
|
|
3635
|
+
declare function deleteHyperlinkFromSnapshot(sourceSnapshot: IDocumentData, idOrOffset: string | number): {
|
|
3636
|
+
snapshot: IDocumentData;
|
|
3637
|
+
deleted: boolean;
|
|
3638
|
+
};
|
|
3639
|
+
declare function computeAuthorInitials(author: string): string;
|
|
3640
|
+
declare function listDocCommentsFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocCommentThread[];
|
|
3641
|
+
declare function addDocCommentInSnapshot(sourceSnapshot: IDocumentData, spec: IDocAddCommentSpec): {
|
|
3642
|
+
snapshot: IDocumentData;
|
|
3643
|
+
comment: IDocCommentThread | null;
|
|
3644
|
+
};
|
|
3645
|
+
declare function replyDocCommentInSnapshot(sourceSnapshot: IDocumentData, commentId: string, spec: IDocReplyCommentSpec): {
|
|
3646
|
+
snapshot: IDocumentData;
|
|
3647
|
+
reply: IDocCommentReply | null;
|
|
3648
|
+
};
|
|
3649
|
+
declare function resolveDocCommentInSnapshot(sourceSnapshot: IDocumentData, commentId: string, resolved?: boolean): {
|
|
3650
|
+
snapshot: IDocumentData;
|
|
3651
|
+
updated: boolean;
|
|
3652
|
+
};
|
|
3653
|
+
declare function deleteDocCommentFromSnapshot(sourceSnapshot: IDocumentData, commentId: string): {
|
|
3654
|
+
snapshot: IDocumentData;
|
|
3655
|
+
deleted: boolean;
|
|
3656
|
+
};
|
|
3657
|
+
declare function toggleDocScriptInSnapshot(sourceSnapshot: IDocumentData, startOffset: number, endOffset: number, targetVa: 2 | 3): {
|
|
3658
|
+
snapshot: IDocumentData;
|
|
3659
|
+
active: boolean;
|
|
3660
|
+
};
|
|
3661
|
+
declare function getMultiOptionSpansForSdtControl(ctrl: IDocResolvedSdtControl): IDocMultiOptionSpan[];
|
|
3662
|
+
/**
|
|
3663
|
+
* Computes the 0-based option index hit at `clickOffset` inside a `radio` or multi-option `checkbox` SDT.
|
|
3664
|
+
* Supports:
|
|
3665
|
+
* - `getMultiOptionHitIndexAtOffset(ctrl, clickOffset)`
|
|
3666
|
+
* - `getMultiOptionHitIndexAtOffset(snapshot, controlId, clickOffset)`
|
|
3667
|
+
* - `getMultiOptionHitIndexAtOffset(snapshot, clickOffset)`
|
|
3668
|
+
*/
|
|
3669
|
+
declare function getMultiOptionHitIndexAtOffset(snapshotOrCtrl: Partial<IDocumentData> | IDocResolvedSdtControl, controlIdOrOffset: string | number, maybeOffset?: number): number;
|
|
3670
|
+
declare function computeToggledMultiOptionValue(ctrl: IDocResolvedSdtControl, optionIndex: number): {
|
|
3671
|
+
allowed: boolean;
|
|
3672
|
+
value: string;
|
|
3673
|
+
reason?: 'minChecked' | 'maxChecked' | 'outOfRange';
|
|
3674
|
+
};
|
|
3675
|
+
declare function getDocTitleEntriesFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined): IDocTitleEntry[];
|
|
3676
|
+
declare function getDocTitleValueFromSnapshot(snapshot: Partial<IDocumentData> | null | undefined, conceptId: string): string | null;
|
|
3677
|
+
declare function insertDocTitleInSnapshot(sourceSnapshot: IDocumentData, spec: IDocInsertTitleSpec): {
|
|
3678
|
+
snapshot: IDocumentData;
|
|
3679
|
+
entry: IDocTitleEntry | null;
|
|
3680
|
+
};
|
|
3681
|
+
declare function setDocTitlePropertiesInSnapshot(sourceSnapshot: IDocumentData, idOrConceptId: string, patch: Partial<IDocTitleProperties>): {
|
|
3682
|
+
snapshot: IDocumentData;
|
|
3683
|
+
updated: boolean;
|
|
3684
|
+
};
|
|
3685
|
+
declare function isEditBlockedByTitleLock(snapshot: Partial<IDocumentData> | null | undefined, editStart: number, editEndExclusive: number, isDeletion: boolean): boolean;
|
|
3686
|
+
|
|
3687
|
+
export { ALL_DOC_BATCH3_COMMANDS, ALL_DOC_ROUND1_COMMANDS, ALL_DOC_ROUND3_COMMANDS, ALL_DOC_WAVE2_COMMANDS, AddDocCascadeRuleCommand, AddDocCommentCommand, AddDocGraffitiStrokeCommand, ApplyDocMacrosCommand, AutoFitDocTableCommand, CancelDocHyperlinkCommand, CleanUpDocFormattingCommand, ClearDocGraffitiStrokesCommand, CompareDocSnapshotsToTrackCommand, ConvertTextToDocTableCommand, DEFAULT_CASCADER_OPTIONS, DEFAULT_ENDNOTE_SETTINGS, DEFAULT_FOOTNOTE_SETTINGS, DOC_HYPERLINK_DEFAULT_COLOR, DOC_TRACK_DELETE_STYLE, DOC_TRACK_INSERT_STYLE, DeleteDocAreaCommand, DeleteDocColumnGroupCommand, DeleteDocCommentCommand, DeleteDocHyperlinkCommand, DeleteDocNoteCommand, DeleteDocSdtCommand, DeleteDocTableColumnCommand, DeleteDocTableRowCommand, DocActionMacroService, DocAiCopilotService, type DocAiRiskSeverity, type DocAreaMode, type DocBarcodeBlockKind, type DocBuilderBlockInput, type DocBuilderSegment, type DocCalloutPreset, type DocCaptionCategory, type DocCellBorderLineStyle, type DocCustomGlossaryInput, type DocEmbedBlockKind, type DocEmbeddedChartType, type DocEmbeddedShapeKind, type DocEmptyRowStrategy, type DocExportFormat, DocExtensionRegistryService, type DocFieldType, type DocHorizontalDividerStyle, type DocImageWrapType, type DocInlineFormulaFormat, DocIoService, type DocIoTarget, DocIoTargetError, type DocLabelBadgeTone, type DocListGlyphType, type DocMacroResolver, type DocMailMergeBatchFormat, type DocMarkdownAlign, type DocMedicalFormulaKind, type DocNoteNumberFormat, type DocNoteRestartRule, type DocNoteType, type DocPageOrientation, type DocSdtControlKind, type DocSdtKind, type DocSdtLockPolicy, DocSdtService, type DocSdtType, type DocSdtValidatorPreset, type DocSdtVisualChrome, type DocSectionBreakKind, type DocSeparatorDashStyle, type DocSmartArtLayout, type DocTabStopAlignment, type DocTabStopLeader, type DocTableAutoFitMode, type DocTableBorderPreset, type DocTableCellSlashType, type DocTextDirection, type DocTrackRevisionStatus, type DocTrackRevisionType, type DocUnderlineStyle, type DocWatermarkLayer, type DocWorkMode, DocxImportError, EvaluateDocCascadeRulesCommand, EvaluateDocTableFormulasCommand, FillDocDatasetCommand, FindAndReplaceDocTextCommand, HighlightInvalidDocSdtCommand, type IAddDocCascadeRuleCommandParams, type IAddDocCommentCommandParams, type IAddDocGraffitiStrokeCommandParams, type IApplyDocMacrosCommandParams, type IAutoFitDocTableCommandParams, type ICancelDocHyperlinkCommandParams, type ICleanUpDocFormattingCommandParams, type IClearDocGraffitiStrokesCommandParams, type ICodeSyntaxToken, type ICompareDocSnapshotsToTrackCommandParams, type IConvertTextToDocTableCommandParams, type IDeleteDocAreaCommandParams, type IDeleteDocColumnGroupCommandParams, type IDeleteDocCommentCommandParams, type IDeleteDocHyperlinkCommandParams, type IDeleteDocNoteCommandParams, type IDeleteDocSdtCommandParams, type IDeleteDocTableColumnCommandParams, type IDeleteDocTableRowCommandParams, IDocActionMacroService, type IDocActionMacroStep, type IDocAddCommentSpec, type IDocAddGraffitiStrokeSpec, type IDocAiCopilotAdapter, type IDocAiCopilotContext, IDocAiCopilotService, type IDocAiRiskFinding, type IDocAreaHiddenSlice, type IDocAreaRegion, type IDocAreaValueResult, type IDocBarcodeBlockSpec, type IDocBatchDocxFileItem, type IDocBeforeSaveEvent, type IDocBookmark, type IDocBuilderParagraphInput, type IDocBuilderTableCellInput, type IDocBuilderTableInput, type IDocBuildingBlockEntry, type IDocBuildingBlockSpec, type IDocCalloutBlock, type IDocCaptionEntry, type IDocCascadeEvaluationResult, type IDocCascadeRule, type IDocCascadeTarget, type IDocCascadeTargetEffects, type IDocCascaderNode, type IDocCatalogItem, type IDocCellBorderEdgeSpec, type IDocChartSeries, type IDocCitationSource, type IDocCleanUpFormattingOptions, type IDocCleanUpFormattingResult, type IDocCodeBlockSpec, type IDocCollapsedHeadingEntry, type IDocCollapsedHeadingSlice, type IDocColumnGroupConfig, type IDocColumnGroupOptions, type IDocCommentReply, type IDocCommentThread, type IDocContentChangeEvent, type IDocContextMenuContext, type IDocContextMenuItem, type IDocControlCascadeBaseline, type IDocControlChangeEvent, type IDocControlValueChangeEvent, type IDocCopyPastePolicy, type IDocCornerBadge, type IDocCustomGlossaryRule, type IDocDatasetField, type IDocDatasetGroup, type IDocDocumentStats, type IDocEmbedBlock, type IDocEmbeddedBarcodeEntry, type IDocEmbeddedChart, type IDocEmbeddedCodeBlockEntry, type IDocEmbeddedMedicalFormulaEntry, type IDocEmbeddedShape, type IDocExportContext, IDocExtensionRegistryService, type IDocFieldContext, type IDocFieldDiffItem, type IDocFieldEntry, type IDocFindReplaceOptions, type IDocFormValidationIssue, type IDocFormValidationResult, type IDocGraffitiPoint, type IDocGraffitiStroke, type IDocHtmlPrintOptions, type IDocHyperlinkEntry, type IDocImageCropSpec, type IDocImageTransformSpec, type IDocImportContext, type IDocImportOutcomeReport, type IDocImportWarning, type IDocInlineFormula, type IDocInsertAreaSpec, type IDocInsertBookmarkSpec, type IDocInsertCalloutSpec, type IDocInsertEmbedBlockSpec, type IDocInsertHyperlinkSpec, type IDocInsertInlineFormulaSpec, type IDocInsertLabelBadgeSpec, type IDocInsertLatexFormulaSpec, type IDocInsertQuoteSpec, type IDocInsertSdtSpec, type IDocInsertTitleSpec, type IDocIoAdapter, type IDocIoCapabilities, IDocIoService, type IDocLabelBadge, type IDocLatexFormulaSpec, type IDocLatexRenderOptions, type IDocLatexRenderResult, type IDocListInsertSpec, type IDocListParagraphInfo, type IDocMailMergeBatchResultItem, type IDocMedicalFormulaSpec, type IDocModeChangeEvent, type IDocMultiOptionSpan, type IDocNoteEntry, type IDocNoteSettings, type IDocPageBorderConfig, type IDocParagraphBorderShadingSpec, type IDocParagraphPaginationSpec, type IDocPdfExportOptions, type IDocPrintConfig, type IDocQuoteBlock, type IDocReadabilityStatistics, type IDocRecordedActionMacro, type IDocRepeatingSectionSpec, type IDocReplyCommentSpec, type IDocReportTemplateMetadata, type IDocResolvedSdtControl, type IDocRiskAlertItem, type IDocSaveContext, type IDocSavedEvent, type IDocSdtControlMeta, type IDocSdtControlSpec, type IDocSdtHighlightRule, type IDocSdtOptionItem, IDocSdtService, type IDocShortcutItem, type IDocShortcutKeyboardEventLike, type IDocSignatureStroke, type IDocSignatureStrokePoint, type IDocSmartArtNode, type IDocSmartArtSpec, type IDocSnapshotDiffResult, type IDocStyledSeparatorEntry, type IDocTabStop, type IDocTableCellBorders, type IDocTableCellProperties, type IDocTableOfContentsEntry, type IDocTableOfContentsSpec, type IDocTableRowLoopConfig, type IDocTableRowSummary, type IDocTableSummary, type IDocTemplateMetadata, type IDocTermDiagnostic, type IDocTitleEntry, type IDocTitleProperties, type IDocTrackRevision, type IDocUpdateHyperlinkSpec, type IDocVersionSnapshot, type IDocVisibilityClause, type IDocVisualComparisonOptions, type IDocVisualComparisonResult, type IDocxExportCapabilitiesReport, type IDocxImportReport, type IEvaluateDocCascadeRulesCommandParams, type IEvaluateDocTableFormulasCommandParams, type IFillDocDatasetCommandParams, type IFindAndReplaceDocTextCommandParams, type IHighlightInvalidDocSdtCommandParams, type IInsertDocAreaCommandParams, type IInsertDocBibliographyCommandParams, type IInsertDocBookmarkCommandParams, type IInsertDocBuildingBlockCommandParams, type IInsertDocCalloutCommandParams, type IInsertDocCaptionCommandParams, type IInsertDocChartCommandParams, type IInsertDocCitationCommandParams, type IInsertDocCodeBlockCommandParams, type IInsertDocColumnGroupCommandParams, type IInsertDocCrossReferenceCommandParams, type IInsertDocEmbedBlockCommandParams, type IInsertDocFieldCommandParams, type IInsertDocHyperlinkCommandParams, type IInsertDocInlineFormulaCommandParams, type IInsertDocLabelBadgeCommandParams, type IInsertDocLatexFormulaCommandParams, type IInsertDocListCommandParams, type IInsertDocMedicalFormulaCommandParams, type IInsertDocNoteCommandParams, type IInsertDocPageBreakCommandParams, type IInsertDocQrOrBarcodeBlockCommandParams, type IInsertDocQuoteCommandParams, type IInsertDocRepeatingSectionCommandParams, type IInsertDocSdtCommandParams, type IInsertDocSectionBreakCommandParams, type IInsertDocShapeCommandParams, type IInsertDocSmartArtCommandParams, type IInsertDocTableColumnCommandParams, type IInsertDocTableOfContentsCommandParams, type IInsertDocTableRowCommandParams, type IInsertDocTitleCommandParams, type IInsertHorizontalDividerCommandParams, type IInsertStyledSeparatorCommandParams, type IJumpDocSdtControlCommandParams, type IMedicalFormulaLayoutResult, type IMergeDocTableCellsCommandParams, type IPdfRasterImageAsset, type IRecalculateDocInlineFormulasCommandParams, type IRecordDocRevisionCommandParams, type IRefreshDocTableOfContentsCommandParams, type IRemoveDocBookmarkCommandParams, type IRemoveDocCalloutCommandParams, type IRemoveDocCascadeRuleCommandParams, type IRemoveDocChartCommandParams, type IRemoveDocEmbedBlockCommandParams, type IRemoveDocLabelBadgeCommandParams, type IRemoveDocLatexFormulaCommandParams, type IRemoveDocQuoteCommandParams, type IRemoveDocShapeCommandParams, type IRemoveDocSmartArtCommandParams, type IRemoveDocTableOfContentsCommandParams, type IReplaceDocUnitSnapshotCommandParams, type IReplyDocCommentCommandParams, type IResolveDocCommentCommandParams, type IResolveDocRevisionCommandParams, type IRestoreDocVersionCommandParams, type ISaveDocVersionCommandParams, type ISetDocActiveRoleCommandParams, type ISetDocAreaBadgeCommandParams, type ISetDocAreaPropertiesCommandParams, type ISetDocAreaValueCommandParams, type ISetDocCascadeRulesCommandParams, type ISetDocCopyPastePolicyCommandParams, type ISetDocCustomPropertiesCommandParams, type ISetDocListGlyphTypeCommandParams, type ISetDocListLevelCommandParams, type ISetDocMainBadgeCommandParams, type ISetDocModeCommandParams, type ISetDocNoteSettingsCommandParams, type ISetDocPrintConfigCommandParams, type ISetDocSectionOrientationCommandParams, type ISetDocTableBorderPresetCommandParams, type ISetDocTableCellPropertiesCommandParams, type ISetDocTableRepeatHeaderCommandParams, type ISetDocTableRowLoopCommandParams, type ISetDocTextDirectionCommandParams, type ISetDocTitlePropertiesCommandParams, type ISetDocTrackChangesCommandParams, type ISetParagraphBorderAndShadingCommandParams, type ISetParagraphPaginationCommandParams, type ISetParagraphTabStopsCommandParams, type ISortDocTableCommandParams, type ISplitDocTableCellCommandParams, type ISyncDocAuxStateMutationParams, type IToggleDocListCheckboxCommandParams, type IToggleDocScriptCommandParams, type IToggleHeadingCollapseCommandParams, type IUniverDocsExtConfig, type IUpdateAllDocFieldsCommandParams, type IUpdateDocCalloutCommandParams, type IUpdateDocChartCommandParams, type IUpdateDocColumnGroupCommandParams, type IUpdateDocHyperlinkCommandParams, type IUpdateDocImageTransformCommandParams, type IUpdateDocLatexFormulaCommandParams, type IUpdateDocNoteCommandParams, type IUpdateDocQuoteCommandParams, type IUpdateDocSdtPropertiesCommandParams, type IUpdateDocSdtValueCommandParams, type IUpdateDocShapeCommandParams, type IUpdateDocSmartArtCommandParams, InsertDocAreaCommand, InsertDocBibliographyCommand, InsertDocBookmarkCommand, InsertDocBuildingBlockCommand, InsertDocCalloutCommand, InsertDocCaptionCommand, InsertDocChartCommand, InsertDocCitationCommand, InsertDocCodeBlockCommand, InsertDocColumnGroupCommand, InsertDocCrossReferenceCommand, InsertDocEmbedBlockCommand, InsertDocEndnoteCommand, InsertDocFieldCommand, InsertDocFootnoteCommand, InsertDocHyperlinkCommand, InsertDocInlineFormulaCommand, InsertDocLabelBadgeCommand, InsertDocLatexFormulaCommand, InsertDocListCommand, InsertDocMedicalFormulaCommand, InsertDocPageBreakCommand, InsertDocQrOrBarcodeBlockCommand, InsertDocQuoteCommand, InsertDocRepeatingSectionCommand, InsertDocSdtCommand, InsertDocSectionBreakCommand, InsertDocShapeCommand, InsertDocSmartArtCommand, InsertDocTableColumnCommand, InsertDocTableOfContentsCommand, InsertDocTableRowCommand, InsertDocTitleCommand, InsertHorizontalDividerCommand, InsertStyledSeparatorCommand, JumpDocSdtControlCommand, type LatexAstNode, MAX_CASCADE_ITERATIONS, MergeDocTableCellsCommand, RecalculateDocInlineFormulasCommand, RecordDocRevisionCommand, RefreshDocTableOfContentsCommand, RemoveDocBookmarkCommand, RemoveDocCalloutCommand, RemoveDocCascadeRuleCommand, RemoveDocChartCommand, RemoveDocEmbedBlockCommand, RemoveDocLabelBadgeCommand, RemoveDocLatexFormulaCommand, RemoveDocQuoteCommand, RemoveDocShapeCommand, RemoveDocSmartArtCommand, RemoveDocTableOfContentsCommand, ReplaceDocUnitSnapshotCommand, ReplyDocCommentCommand, ResolveDocCommentCommand, ResolveDocRevisionCommand, RestoreDocVersionCommand, SaveDocVersionCommand, SetDocActiveRoleCommand, SetDocAreaBadgeCommand, SetDocAreaPropertiesCommand, SetDocAreaValueCommand, SetDocCascadeRulesCommand, SetDocCopyPastePolicyCommand, SetDocCustomPropertiesCommand, SetDocListGlyphTypeCommand, SetDocListLevelCommand, SetDocMainBadgeCommand, SetDocModeCommand, SetDocNoteSettingsCommand, SetDocPrintConfigCommand, SetDocSectionOrientationCommand, SetDocTableBorderPresetCommand, SetDocTableCellPropertiesCommand, SetDocTableRepeatHeaderCommand, SetDocTableRowLoopCommand, SetDocTextDirectionCommand, SetDocTitlePropertiesCommand, SetDocTrackChangesCommand, SetParagraphBorderAndShadingCommand, SetParagraphPaginationCommand, SetParagraphTabStopsCommand, SortDocTableCommand, SplitDocTableCellCommand, SyncDocAuxStateMutation, ToggleDocListCheckboxCommand, ToggleDocSubscriptCommand, ToggleDocSuperscriptCommand, ToggleHeadingCollapseCommand, UNIVER_DOCS_EXT_PLUGIN_NAME, UNIVER_DOC_CHART_PALETTE, UniverDocsExtPlugin, UpdateAllDocFieldsCommand, UpdateDocCalloutCommand, UpdateDocChartCommand, UpdateDocColumnGroupCommand, UpdateDocHyperlinkCommand, UpdateDocImageTransformCommand, UpdateDocLatexFormulaCommand, UpdateDocNoteCommand, UpdateDocQuoteCommand, UpdateDocSdtPropertiesCommand, UpdateDocSdtValueCommand, UpdateDocShapeCommand, UpdateDocSmartArtCommand, YUDAO_DOCS_TEMPLATE_RESOURCE, addDocCascadeRuleInSnapshot as addDocCascadeRule, addDocCascadeRuleInSnapshot, addDocCommentInSnapshot, addDocGraffitiStrokeInSnapshot as addDocGraffitiStroke, addDocGraffitiStrokeInSnapshot, applyCopyPolicyToSelectedText, applyDocMacrosInSnapshot as applyDocMacros, applyDocMacrosInSnapshot, applyPictureOrSignatureSdtValueInSnapshot, applyTextStyleToBodySpan, attachSmartArtMetaRangeOnBody, auditContractRisksOffline, autoCropCanvasToPngDataUrl, autoFitDocTableInSnapshot, buildCode128BarcodeSvg, buildLiveDocFormContext, buildMedicalFormulaDataUri, buildMedicalFormulaSvg, buildQrCodeSvg, buildQrMatrix, buildQrOrBarcodeDataUri, buildQrOrBarcodeSvg, buildSdtPropertiesFromSpec, buildStructuredDocData, buildTocBlockLines, buildVisualComparisonSnapshot, canRoleEditSdtControl, cancelHyperlinkInSnapshot, checkDocumentSpellingAndTerms, cleanUpDocFormattingInSnapshot, clearDocGraffitiStrokesInSnapshot as clearDocGraffitiStrokes, clearDocGraffitiStrokesInSnapshot, clearRegisteredDocMacros, compareDocTableCellValues, computeAuthorInitials, computeSdtVisualStyle, computeSignatureBoundingBox, computeToggledMultiOptionValue, convertDocTableToText, convertTextToDocTableInSnapshot, decodeImageDataUrlForPdf, deleteColumnGroupFromSnapshot, deleteDocAreaFromSnapshot as deleteDocArea, deleteDocAreaFromSnapshot, deleteDocCommentFromSnapshot, deleteDocNoteFromSnapshot, deleteDocTableColumnInSnapshot, deleteDocTableRowInSnapshot, deleteHyperlinkFromSnapshot, detectAutoTextDirection, diffDocSnapshots, doesDocShortcutMatchEvent, draftContractClauseByPrompt, encodeCode128Bars, encodeUtf8Base64DataUri, estimateDocOffsetPageNumber, evaluateCascadeCondition, evaluateComputedSdtControls, evaluateComputedSdtControlsInPlace, evaluateDocCascadeRules, evaluateDocCascadeRulesInPlace, evaluateDocDateDiff, evaluateDocTableFormulas, evaluateLiveVisibilityClauses, evaluateSafeDocExpression, evaluateVisibleIfCondition, executeBodyUpdateViaRichTextMutation, executeWave2SnapshotUpdateWithUndoRedo, expandRepeatingSectionTemplate, exportBatchDocPdfBytes, exportBatchDocxFiles as exportBatchDocxArchives, exportBatchDocxFiles, exportDocHtmlString, exportDocToMarkdown, exportDocToOdtBytes, exportDocToPdfBytes, exportDocToRtf, exportDocxBytes, extractAnchorTypography, extractDocCatalog, extractDocCatalogTree, extractDocFormValues, fillDatasetIntoDocSnapshot, findAndReplaceDocTextInSnapshot, findMergedMasterInTableRows, flattenCascaderLeafItems, formatCalloutDisplayText, formatDocListMarker, formatDocNoteNumber, formatInlineFormulaResult, formatIsoDateByPattern, formatQuoteDisplayText, formatSdtDisplayText, getCollapsedHeadingsFromSnapshot, getColumnGroupConfigFromSnapshot, getDocAreaBadgeFromSnapshot as getDocAreaBadge, getDocAreaBadgeFromSnapshot, getDocAreaValueFromSnapshot as getDocAreaValue, getDocAreaValueFromSnapshot, getDocAreasFromSnapshot as getDocAreas, getDocAreasFromSnapshot, getDocCascadeRulesFromSnapshot as getDocCascadeRules, getDocCascadeRulesFromSnapshot, getDocCopyPastePolicyFromSnapshot, getDocCustomPropertiesFromSnapshot, getDocEmbedBlocksFromSnapshot as getDocEmbedBlocks, getDocEmbedBlocksFromSnapshot, getDocGraffitiStrokesFromSnapshot as getDocGraffitiStrokes, getDocGraffitiStrokesFromSnapshot, getDocImageTransformFromSnapshot, getDocLabelBadgesFromSnapshot as getDocLabelBadges, getDocLabelBadgesFromSnapshot, getDocListsFromSnapshot, getDocMainBadgeFromSnapshot as getDocMainBadge, getDocMainBadgeFromSnapshot, getDocNoteSettingsFromSnapshot, getDocParagraphDirection, getDocPrintConfigFromSnapshot, getDocTableCellProperties, getDocTableDirection, getDocTitleEntriesFromSnapshot, getDocTitleValueFromSnapshot, extractDocCatalog as getDocumentOutline, getDocumentStatistics, getDocumentStats, getLocalTodayIso, getMultiOptionHitIndexAtOffset, getMultiOptionSpansForSdtControl, getParagraphBorderAndShading, getParagraphPagination, getParagraphTabStops, getDocumentStatistics as getReadabilityStatistics, getRegisteredDocMacros, getStyledSeparatorsFromSnapshot, getTargetDocModel, importHtmlToDocData, importLegacyDocBytes, importMarkdownToDocData, inflateRawSync, insertBibliographyIntoSnapshot, insertBookmarkIntoSnapshot, insertBuildingBlockIntoSnapshot, insertCalloutIntoSnapshot, insertCaptionIntoSnapshot, insertCitationIntoSnapshot, insertColumnGroupInSnapshot, insertCrossReferenceIntoSnapshot, insertDocAreaInSnapshot as insertDocArea, insertDocAreaInSnapshot, insertDocEmbedBlockInSnapshot as insertDocEmbedBlock, insertDocEmbedBlockInSnapshot, insertDocFieldIntoSnapshot, insertDocLabelBadgeInSnapshot as insertDocLabelBadge, insertDocLabelBadgeInSnapshot, insertDocListInSnapshot, insertDocNoteIntoSnapshot, insertDocTableColumnInSnapshot, insertDocTableRowInSnapshot, insertDocTitleInSnapshot, insertHorizontalDividerInSnapshot, insertHyperlinkIntoSnapshot, insertInlineDrawingIntoSnapshot, insertInlineFormulaIntoSnapshot, insertPageBreakInSnapshot, insertQuoteIntoSnapshot, insertSdtControlIntoBody, insertSectionBreakInSnapshot, insertSmartArtIntoSnapshot, insertStyledSeparatorInSnapshot as insertStyledSeparator, insertStyledSeparatorInSnapshot, insertSyntaxCodeBlockIntoSnapshot, insertTableOfContentsIntoSnapshot, inspectDocxExportCapabilities, isEditBlockedByTitleLock, isOffsetInLockedTableCell, isOffsetLockedByGroupSdt, isOffsetReadonlyByArea, layoutLatexFormulaWidget, layoutMedicalFormulaWidget, listDocBookmarks, listDocCallouts, listDocCaptions, listDocCitations, listDocCommentsFromSnapshot, listDocFields, listDocHyperlinks, listDocInlineFormulas, listDocNotesFromSnapshot, listDocQuotes, listDocSdtControls, listDocTables, listLiveDocCharts, listLiveDocShapes, listLiveLatexFormulas, listLiveSmartArts, matchSdtHighlightRule, mergeDocTableCellsInSnapshot, normalizeImageDataUriForSdt, normalizeMacroName, normalizeSdtListItems, numberToChineseUpperMoney, parseDateRangePair, parseDocxBytesToDocData, parseDocxBytesWithReport, parseFieldInstrString, parseIsoDateForExpr, parseLatexMathAst, parseParagraphBorderLine, parseSdtRangeToResolved, parseTableRowsInStream, readDocTemplateMetadataFromSnapshot, recalculateInlineFormulasInPlace, reconcileTemplateMetadataWithLiveSnapshot, recordDocTrackRevisionOnSnapshot, refreshTableOfContentsInSnapshot, registerDocMacro, removeBookmarkFromSnapshot, removeCalloutFromSnapshot, removeDocCascadeRuleFromSnapshot as removeDocCascadeRule, removeDocCascadeRuleFromSnapshot, removeDocEmbedBlockFromSnapshot as removeDocEmbedBlock, removeDocEmbedBlockFromSnapshot, removeDocLabelBadgeFromSnapshot as removeDocLabelBadge, removeDocLabelBadgeFromSnapshot, removeInlineDrawingBlockFromBody, removeQuoteFromSnapshot, removeTableOfContentsFromSnapshot, renderDocChartSvg, renderDocChartToSvgDataUri, renderDocEmbedBlockCardSvg, renderDocLabelBadgeSvg, renderDocShapeSvg, renderDocShapeToSvgDataUri, renderLatexToSvg, renderLatexToSvgDataUri, renderSignatureStrokesToSvgDataUri, renderSmartArtSvg, renderSmartArtToSvgDataUri, exportDocHtmlString as renderStructuredDocHtml, renderStyledSeparatorSvg, renumberDocNotesInPlace, replyDocCommentInSnapshot, resolveActiveInsertOffset, resolveBarcodeBlockPayload, resolveBodyOffsetTypography, resolveCalloutPresetTheme, resolveCascaderPath, resolveDocCommentInSnapshot, resolveDocTrackRevisionOnSnapshot, resolveEffectiveSdtAffixes, resolveLabelBadgePalette, resolveListIdGlyphType, resolveLiveDocAreaSpan, resolvePathValue, resolveRangeAnchorTypography, resolveSegmentBodyInSnapshot, resolveSeparatorDimensions, resolveTableHeaderRowCount, resolveUnderlineCssStyle, runMailMergeBatchOnSnapshot, sanitizeDocEmbedUrl, sanitizeDocHyperlinkUrl, setDocAreaBadgeInSnapshot as setDocAreaBadge, setDocAreaBadgeInSnapshot, setDocAreaPropertiesInSnapshot as setDocAreaProperties, setDocAreaPropertiesInSnapshot, setDocAreaValueInSnapshot as setDocAreaValue, setDocAreaValueInSnapshot, setDocCascadeRulesInSnapshot as setDocCascadeRules, setDocCascadeRulesInSnapshot, setDocCopyPastePolicyInSnapshot, setDocCustomPropertiesInSnapshot, setDocListGlyphTypeInSnapshot, setDocListLevelInSnapshot, setDocMainBadgeInSnapshot as setDocMainBadge, setDocMainBadgeInSnapshot, setDocNoteSettingsInSnapshot, setDocPrintConfigInSnapshot, setDocTableBorderPresetInSnapshot, setDocTableCellPropertiesInSnapshot, setDocTableRepeatHeaderInSnapshot, setDocTextDirectionInSnapshot, setDocTitlePropertiesInSnapshot, setParagraphBorderAndShadingInSnapshot, setParagraphPaginationInSnapshot, setParagraphTabStopsInSnapshot, setSectionOrientationInSnapshot, shiftTrackRevisions, sortDocTableByColumnInSnapshot, spliceDocumentBodySpan, spliceMultiParagraphBodySpan, splitDocTableCellInSnapshot, stripSdtAffixes, syncSnapshotAuxFields, toControlSpecSnapshot, toggleDocListCheckboxInSnapshot, toggleDocScriptInSnapshot, toggleHeadingCollapseInSnapshot, tokenizeCodeLineForHighlight, unregisterDocMacro, updateAllDocFieldsInSnapshot, updateCalloutInSnapshot, updateColumnGroupInSnapshot, updateDocImageTransformInSnapshot, updateDocNoteInSnapshot, updateHyperlinkInSnapshot, updateQuoteInSnapshot, updateSmartArtInSnapshot, validateDocForm, validateSdtValueBySpec, writeDocTemplateMetadataToSnapshot, writeSegmentBodyInSnapshot };
|