@betteroffice/docx 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +522 -3
- package/dist/{chunk-JHJLG4I6.mjs → chunk-5B4VMUXM.mjs} +1 -1
- package/dist/chunk-5JEQC76K.mjs +1 -0
- package/dist/chunk-7GJG6LLU.mjs +1 -0
- package/dist/chunk-FE6FWGBJ.mjs +1 -0
- package/dist/chunk-H5YYCN42.mjs +1 -0
- package/dist/chunk-NT2OYIJ4.mjs +57 -0
- package/dist/chunk-QE4ZDRKV.mjs +1 -0
- package/dist/chunk-VQXNED2P.mjs +2 -0
- package/dist/chunk-Z4HZIPBS.mjs +1 -0
- package/dist/collaboration/index.d.mts +8 -6
- package/dist/compareDocx-XXTZV4CG.mjs +1 -0
- package/dist/computeLayout-LWLAJWYA.mjs +1 -0
- package/dist/{content-CvEtPl0c.d.mts → content-BzoC6bSz.d.mts} +48 -8
- package/dist/core.d.mts +172 -9
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-DF8F6fMl.d.mts → displayListQueries-BYFrBkw5.d.mts} +2 -2
- package/dist/docx/index.d.mts +5 -4
- package/dist/docx/index.mjs +1 -1
- package/dist/editor/index.d.mts +10 -8
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-b8eicJKV.d.mts → fontLoader-CkXcPB1C.d.mts} +1 -1
- package/dist/{formatting-7zKCTu5a.d.mts → formatting-gqLFeJ9X.d.mts} +8 -0
- package/dist/{frameDelta-pA4jrQ1G.d.mts → frameDelta-CVt5FAXT.d.mts} +14 -3
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/{index-CHl2zLJ7.d.mts → index-BbZwdkPz.d.mts} +457 -29
- package/dist/layout/index.d.mts +6 -6
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +4 -4
- package/dist/layout/render/index.d.mts +12 -10
- package/dist/layout/render/index.mjs +1 -1
- package/dist/pagedExport-D3E4jZ-B.d.mts +907 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +10 -9
- package/dist/plugin-api/RenderedDomContext.mjs +1 -1
- package/dist/plugin-api/index.d.mts +21 -4
- package/dist/plugin-api/resolveItemPositions.d.mts +3 -3
- package/dist/rezip-Bxiq4Z_R.d.mts +24 -0
- package/dist/{rustDisplayList-BJqaN9tt.d.mts → rustDisplayList-CwOoUn3t.d.mts} +2 -2
- package/dist/{rustMeasureSource-C0EZB055.d.mts → rustMeasureSource-CyBMcy1x.d.mts} +12 -4
- package/dist/{selectiveSave-CRh-_Y_C.d.mts → selectiveSave-r-NMK6aI.d.mts} +1 -22
- package/dist/styles/index.d.mts +2 -2
- package/dist/{styles-7e-mq3c-.d.mts → styles-AryxLAhx.d.mts} +1 -1
- package/dist/types/content.d.mts +2 -2
- package/dist/types/document.d.mts +6 -6
- package/dist/{types-C4A8mWjU.d.mts → types-B4jD0rrc.d.mts} +19 -2
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/index.d.mts +7 -4
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/stylePreview.d.mts +2 -2
- package/dist/wasm-G62X4WRW.mjs +1 -0
- package/dist/wasm-US6R7SWN.mjs +1 -0
- package/dist/wasm-edit.d.mts +246 -13
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.d.mts +8 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/yrs/index.d.mts +7 -5
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-6LQJAKOC.mjs +0 -1
- package/dist/chunk-AFMVSI4Z.mjs +0 -57
- package/dist/chunk-GD4VNJ64.mjs +0 -1
- package/dist/chunk-WRWRCBLK.mjs +0 -1
- package/dist/chunk-WTFRNX5K.mjs +0 -1
- package/dist/wasm-7SOSHNGP.mjs +0 -1
- package/dist/wasm-ZQAVP7P2.mjs +0 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { C as ColorValue } from './formatting-gqLFeJ9X.mjs';
|
|
1
2
|
import { Document } from './types/document.mjs';
|
|
2
|
-
import {
|
|
3
|
+
import { a0 as DocxReadParagraphsRequest, a1 as DocxReadParagraphsResult, a2 as DocxFindTextRequest, a3 as DocxFindTextResult, a4 as DocxEditRequest, a5 as DocxValidationResult, a6 as DocxEditResult, a7 as DocxTextTarget, a8 as DocxEditRefusal, a as DocxExportOptions, H as DocxExportResult, c as DocxStructuredContent, b as DocxMarkdownContent, d as DocxPageExportOptions, f as DocxPagedStructuredContent, i as DocxLayoutMap, g as DocxSnapshotLayoutMap, D as DocxExportFailure, V as DocxParagraphHeading, m as DocxContentControlsOptions, w as DocxContentControlsResult, l as DocxContentControlQuery } from './pagedExport-D3E4jZ-B.mjs';
|
|
4
|
+
import { R as RetainedFrame } from './frameDelta-CVt5FAXT.mjs';
|
|
5
|
+
import { R as RepackOptions } from './rezip-Bxiq4Z_R.mjs';
|
|
3
6
|
|
|
4
7
|
type CollaborationUpdateOrigin = 'local' | 'remote';
|
|
5
8
|
interface CollaborationReplica {
|
|
@@ -87,6 +90,157 @@ interface CollaborationPresence {
|
|
|
87
90
|
type CollaborationStatusListener = (change: CollaborationStatusChange) => void;
|
|
88
91
|
type CollaborationErrorListener = (error: CollaborationError) => void;
|
|
89
92
|
|
|
93
|
+
/** Typed TypeScript boundary for the Rust package writer. */
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Paragraph IDs a session save applies: IDs for source paragraphs outside
|
|
97
|
+
* the edited stories by part and `w:p` occurrence, and parts written as their
|
|
98
|
+
* source bytes with only these IDs patched in.
|
|
99
|
+
*/
|
|
100
|
+
interface RustParagraphIds {
|
|
101
|
+
assignments: Array<{
|
|
102
|
+
part: string;
|
|
103
|
+
ordinal: number;
|
|
104
|
+
paraId: string;
|
|
105
|
+
}>;
|
|
106
|
+
patchedParts: Array<{
|
|
107
|
+
part: string;
|
|
108
|
+
paraIds: Array<[number, string]>;
|
|
109
|
+
}>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Paragraph identity DTOs for `YrsSession` identity reads and saves.
|
|
114
|
+
*
|
|
115
|
+
* A session key (`YrsLoc.paraId`) addresses a paragraph in one collaborative
|
|
116
|
+
* document session. A Word paragraph ID (`w14:paraId`) is saved in the file;
|
|
117
|
+
* a paragraph has one once its source carried it, it was authored in a
|
|
118
|
+
* session, or the host called `YrsSession.persistParagraphIds()`.
|
|
119
|
+
*/
|
|
120
|
+
/** A Word story qualified by the package part it is read from. */
|
|
121
|
+
type DocxSourceStory = {
|
|
122
|
+
partUri: string;
|
|
123
|
+
kind: 'body' | 'header' | 'footer';
|
|
124
|
+
} | {
|
|
125
|
+
partUri: string;
|
|
126
|
+
kind: 'footnote' | 'endnote' | 'comment';
|
|
127
|
+
itemId: string;
|
|
128
|
+
};
|
|
129
|
+
/** A paragraph in one collaborative document session, on any of its replicas. */
|
|
130
|
+
interface DocxSessionParagraphAnchor {
|
|
131
|
+
kind: 'session';
|
|
132
|
+
sessionId: string;
|
|
133
|
+
story: string;
|
|
134
|
+
paraId: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A `w:p` occurrence in the exact source package the session was opened
|
|
138
|
+
* from: its zero-based position among the part's paragraphs, nested ones
|
|
139
|
+
* included, as the source bytes hold them rather than as edited since.
|
|
140
|
+
*/
|
|
141
|
+
interface DocxSourceParagraphAnchor {
|
|
142
|
+
kind: 'source';
|
|
143
|
+
packageSha256: string;
|
|
144
|
+
/** OPC part name, such as `/word/document.xml`. */
|
|
145
|
+
partUri: string;
|
|
146
|
+
paragraphOrdinal: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A saved Word paragraph ID within its source story. It resolves after the
|
|
150
|
+
* saved file is reopened, but it is scoped to a document the host chose: an
|
|
151
|
+
* eight-digit ID is not a document identifier.
|
|
152
|
+
*/
|
|
153
|
+
interface DocxPersistedParagraphAnchor {
|
|
154
|
+
kind: 'persisted';
|
|
155
|
+
story: DocxSourceStory;
|
|
156
|
+
paraId: string;
|
|
157
|
+
}
|
|
158
|
+
type DocxParagraphAnchor = DocxSessionParagraphAnchor | DocxSourceParagraphAnchor | DocxPersistedParagraphAnchor;
|
|
159
|
+
/** A paragraph a resolution, assignment or diagnostic names. */
|
|
160
|
+
type DocxParagraphRef = DocxSessionParagraphAnchor | DocxSourceParagraphAnchor;
|
|
161
|
+
/**
|
|
162
|
+
* Where a Word paragraph ID comes from: `source` IDs are already in the source
|
|
163
|
+
* package; the others are prepared by the session and appear on save.
|
|
164
|
+
*/
|
|
165
|
+
type DocxParagraphIdOrigin = 'source' | 'authored' | 'persisted' | 'repaired';
|
|
166
|
+
/** Where a paragraph comes from; `synthetic` ones are editor-only until authored into. */
|
|
167
|
+
type DocxParagraphOrigin = 'source' | 'authored' | 'synthetic';
|
|
168
|
+
interface DocxParagraphIdentity {
|
|
169
|
+
/** `null` for a source paragraph outside the session stories. */
|
|
170
|
+
session: DocxSessionParagraphAnchor | null;
|
|
171
|
+
origin: DocxParagraphOrigin;
|
|
172
|
+
/** The Word paragraph ID the paragraph saves with, or `null` when it saves without one. */
|
|
173
|
+
ooxmlParaId: string | null;
|
|
174
|
+
idOrigin: DocxParagraphIdOrigin | null;
|
|
175
|
+
/** `null` without a Word paragraph ID or a source story. */
|
|
176
|
+
persisted: DocxPersistedParagraphAnchor | null;
|
|
177
|
+
/** `null` unless the paragraph occurs in the retained source package. */
|
|
178
|
+
source: DocxSourceParagraphAnchor | null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Every paragraph's identities: session paragraphs with stories sorted and in
|
|
182
|
+
* document order, then source paragraphs outside the stories in package order.
|
|
183
|
+
*/
|
|
184
|
+
interface DocxParagraphIdentitySnapshot {
|
|
185
|
+
sessionId: string;
|
|
186
|
+
/** SHA-256 of the retained source package, or `null` without one. */
|
|
187
|
+
packageSha256: string | null;
|
|
188
|
+
paragraphs: DocxParagraphIdentity[];
|
|
189
|
+
}
|
|
190
|
+
/** A paragraph `YrsSession.persistParagraphIds()` gave a Word paragraph ID. */
|
|
191
|
+
interface DocxParagraphIdAssignment {
|
|
192
|
+
paragraph: DocxParagraphRef;
|
|
193
|
+
/** The duplicate session key the paragraph carried before repair. */
|
|
194
|
+
replacedParaId: string | null;
|
|
195
|
+
/** The duplicate Word paragraph ID it replaces. */
|
|
196
|
+
previousOoxmlParaId: string | null;
|
|
197
|
+
ooxmlParaId: string;
|
|
198
|
+
idOrigin: 'persisted' | 'repaired';
|
|
199
|
+
/** `null` when the paragraph has no source story. */
|
|
200
|
+
persisted: DocxPersistedParagraphAnchor | null;
|
|
201
|
+
}
|
|
202
|
+
type DocxParagraphIdDiagnostic = {
|
|
203
|
+
/** Saved claims to one ID conflict; the paragraphs keep it and resolve as ambiguous. */
|
|
204
|
+
kind: 'conflicting-saved-ids';
|
|
205
|
+
ooxmlParaId: string;
|
|
206
|
+
paragraphs: DocxParagraphRef[];
|
|
207
|
+
} | {
|
|
208
|
+
/** No retained source package, so source paragraphs outside the stories were not covered. */
|
|
209
|
+
kind: 'no-source-package';
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Why `YrsSession.persistParagraphIds()` changed nothing: a duplicated
|
|
213
|
+
* comment paragraph ID the comment companion parts reference, where which
|
|
214
|
+
* comment they mean is ambiguous.
|
|
215
|
+
*/
|
|
216
|
+
interface DocxParagraphIdRefusal {
|
|
217
|
+
kind: 'ambiguous-comment-reference';
|
|
218
|
+
ooxmlParaId: string;
|
|
219
|
+
commentIds: string[];
|
|
220
|
+
}
|
|
221
|
+
type DocxParagraphIdentityReceipt = {
|
|
222
|
+
status: 'applied';
|
|
223
|
+
assignments: DocxParagraphIdAssignment[];
|
|
224
|
+
diagnostics: DocxParagraphIdDiagnostic[];
|
|
225
|
+
} | {
|
|
226
|
+
status: 'refused';
|
|
227
|
+
refusal: DocxParagraphIdRefusal;
|
|
228
|
+
};
|
|
229
|
+
type DocxParagraphAnchorResult = {
|
|
230
|
+
status: 'found';
|
|
231
|
+
anchor: DocxParagraphRef;
|
|
232
|
+
} | {
|
|
233
|
+
status: 'missing';
|
|
234
|
+
} | {
|
|
235
|
+
status: 'ambiguous';
|
|
236
|
+
candidates: DocxParagraphRef[];
|
|
237
|
+
} | {
|
|
238
|
+
status: 'unsupported';
|
|
239
|
+
reason: 'foreign-session' | 'foreign-package' | 'no-source-package';
|
|
240
|
+
};
|
|
241
|
+
/** The paragraph IDs a session save applies, as the package writer's `paragraphIds`. @internal */
|
|
242
|
+
type DocxParagraphSavePlan = RustParagraphIds;
|
|
243
|
+
|
|
90
244
|
/** One native paragraph in the yrs-backed display-position projection. */
|
|
91
245
|
interface YrsInputParagraphSpan {
|
|
92
246
|
paraId: string;
|
|
@@ -297,11 +451,11 @@ declare function canUseResidentEngineWorker(): boolean;
|
|
|
297
451
|
*
|
|
298
452
|
* Stories are `body`, `hf:{rId}`, `fn:{id}`, `en:{id}`, and recursively generated table
|
|
299
453
|
* cell / block-SDT stories. The target session must not already contain any of
|
|
300
|
-
* those story ids.
|
|
454
|
+
* those story ids. Seeding starts a new opening; see {@link YrsSession.beginOpening}.
|
|
301
455
|
*
|
|
302
456
|
* @public
|
|
303
457
|
*/
|
|
304
|
-
declare function documentToYrs(session: YrsSession, document: Document): void;
|
|
458
|
+
declare function documentToYrs(session: YrsSession, document: Document, options?: YrsOpeningOptions): void;
|
|
305
459
|
|
|
306
460
|
/** yrs-to-OOXML save projection. */
|
|
307
461
|
|
|
@@ -315,24 +469,67 @@ interface YrsToDocumentOptions {
|
|
|
315
469
|
* projection includes its nested table/content-control stories.
|
|
316
470
|
*/
|
|
317
471
|
storyIds?: ReadonlySet<string>;
|
|
472
|
+
/**
|
|
473
|
+
* The session comment id of each comment in `base` whose OOXML id is not
|
|
474
|
+
* that id, such as one added with {@link YrsSession.addComment}. @internal
|
|
475
|
+
*/
|
|
476
|
+
commentIds?: ReadonlyMap<number, string>;
|
|
318
477
|
}
|
|
319
478
|
declare function yrsToDocument(session: YrsSession, base: Document, options?: YrsToDocumentOptions): Document;
|
|
320
479
|
|
|
480
|
+
/** Session save that reports where each saved paragraph can be found after reopening. */
|
|
481
|
+
|
|
482
|
+
/** A saved paragraph's session anchor and the persisted anchor that resolves to it once reopened. */
|
|
483
|
+
interface DocxSavedParagraph {
|
|
484
|
+
session: DocxSessionParagraphAnchor;
|
|
485
|
+
persisted: DocxPersistedParagraphAnchor;
|
|
486
|
+
}
|
|
487
|
+
interface DocxSavedDocument {
|
|
488
|
+
bytes: Uint8Array;
|
|
489
|
+
/**
|
|
490
|
+
* Every session paragraph the bytes hold with a Word paragraph ID, in
|
|
491
|
+
* document order. Stories that share a part are views of its paragraphs:
|
|
492
|
+
* each view the part holds is listed, and its persisted anchor resolves to
|
|
493
|
+
* the first story's view once reopened.
|
|
494
|
+
*/
|
|
495
|
+
paragraphs: DocxSavedParagraph[];
|
|
496
|
+
/**
|
|
497
|
+
* Saved paragraphs whose Word paragraph ID the live session reassigned
|
|
498
|
+
* while the save was written, such as by a duplicate repair after a remote
|
|
499
|
+
* update: their persisted anchor finds them in these bytes, not in the
|
|
500
|
+
* live session.
|
|
501
|
+
*/
|
|
502
|
+
conflicts: DocxSavedParagraph[];
|
|
503
|
+
}
|
|
504
|
+
/** The identities and paragraph ID plan a session save applies. @internal */
|
|
505
|
+
interface DocxSessionSave {
|
|
506
|
+
identities: DocxParagraphIdentitySnapshot;
|
|
507
|
+
plan: DocxParagraphSavePlan;
|
|
508
|
+
}
|
|
509
|
+
/** Captures a save of `session`, in the task that projects the saved document. @internal */
|
|
510
|
+
declare function captureSessionSave(session: YrsSession): DocxSessionSave;
|
|
321
511
|
/**
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
* suggesting mode, sticky comment anchors) lives in Rust.
|
|
328
|
-
*
|
|
329
|
-
* `createYrsSession()` lazily loads the embedded wasm (`./wasm`) on first call.
|
|
330
|
-
*
|
|
331
|
-
* Addressing is the op-contract public vocabulary: a {@link YrsLoc} is
|
|
332
|
-
* `(story, paraId, offset)` with UTF-16 offsets scoped to one paragraph
|
|
333
|
-
* (`offset ∈ [0, paragraphLength]`; the paragraph's own pilcrow is excluded
|
|
334
|
-
* from its offset space). Story-global indices never cross this boundary.
|
|
512
|
+
* Writes `document`, projected from `session` when `capture` was taken, and
|
|
513
|
+
* records the Word paragraph IDs the bytes hold as saved. `patches` selects
|
|
514
|
+
* the planned parts written as `originalBuffer`'s bytes with IDs patched in;
|
|
515
|
+
* it selects none unless `originalBuffer` is the session's source package.
|
|
516
|
+
* @internal
|
|
335
517
|
*/
|
|
518
|
+
declare function writeSessionSave(session: YrsSession, document: Document, capture: DocxSessionSave, originalBuffer: ArrayBuffer, options?: RepackOptions, patches?: (part: string) => boolean): Promise<DocxSavedDocument>;
|
|
519
|
+
/**
|
|
520
|
+
* Saves a session opened from DOCX bytes and reports each saved paragraph's
|
|
521
|
+
* persisted anchor, read from the same projection the bytes are written
|
|
522
|
+
* from and kept only where the written part holds its Word paragraph ID.
|
|
523
|
+
* Parts whose stories are unchanged since the session opened keep
|
|
524
|
+
* their source bytes, paragraph IDs aside. The comments the session holds
|
|
525
|
+
* are saved with their anchors, those added to it included; replies and
|
|
526
|
+
* resolution are saved as the source package has them. A source paragraph without a
|
|
527
|
+
* Word paragraph ID saves without one unless the host called
|
|
528
|
+
* `persistParagraphIds()` first; the IDs a save writes are recorded as
|
|
529
|
+
* saved, so they keep them against unsaved claims from other replicas, once
|
|
530
|
+
* reconciled with the live session.
|
|
531
|
+
*/
|
|
532
|
+
declare function saveYrsDocx(session: YrsSession, options?: RepackOptions): Promise<DocxSavedDocument>;
|
|
336
533
|
|
|
337
534
|
interface YrsDocxHost {
|
|
338
535
|
document: Document;
|
|
@@ -379,6 +576,10 @@ type YrsRunMark = {
|
|
|
379
576
|
type: 'italic';
|
|
380
577
|
} | {
|
|
381
578
|
type: 'underline';
|
|
579
|
+
} | {
|
|
580
|
+
type: 'superscript';
|
|
581
|
+
} | {
|
|
582
|
+
type: 'subscript';
|
|
382
583
|
} | {
|
|
383
584
|
type: 'fontFamily';
|
|
384
585
|
value: string;
|
|
@@ -443,13 +644,36 @@ interface YrsStorySeed {
|
|
|
443
644
|
/** At least one paragraph. */
|
|
444
645
|
paragraphs: readonly YrsParagraphSeed[];
|
|
445
646
|
}
|
|
647
|
+
/** How a seeding entry point starts its opening; see {@link YrsSession.beginOpening}. */
|
|
648
|
+
interface YrsOpeningOptions {
|
|
649
|
+
/**
|
|
650
|
+
* A fixed opening generation, for a deterministic seed every replica loads
|
|
651
|
+
* as one session. Each opening mints a fresh one by default.
|
|
652
|
+
*/
|
|
653
|
+
generation?: string;
|
|
654
|
+
}
|
|
446
655
|
/** Snapshot of one paragraph from {@link YrsSession.paragraphs}. */
|
|
447
656
|
interface YrsParagraph {
|
|
657
|
+
/** Session key; not the paragraph's Word `w14:paraId`. */
|
|
448
658
|
paraId: string;
|
|
449
659
|
text: string;
|
|
450
660
|
/** pStyle / alignment plus any op-set extras. */
|
|
451
661
|
properties: Record<string, unknown>;
|
|
452
662
|
}
|
|
663
|
+
interface YrsTextSearchOptions {
|
|
664
|
+
/** Defaults to false. */
|
|
665
|
+
caseSensitive?: boolean;
|
|
666
|
+
/** Maximum matches; unlimited by default. */
|
|
667
|
+
limit?: number;
|
|
668
|
+
}
|
|
669
|
+
/** Paragraph-local UTF-16 offsets. */
|
|
670
|
+
interface YrsTextMatch {
|
|
671
|
+
story: string;
|
|
672
|
+
paraId: string;
|
|
673
|
+
start: number;
|
|
674
|
+
end: number;
|
|
675
|
+
text: string;
|
|
676
|
+
}
|
|
453
677
|
/** One direct numbering reference (`w:numPr`) on a paragraph. */
|
|
454
678
|
interface YrsNumberingProperties {
|
|
455
679
|
numId?: number;
|
|
@@ -487,6 +711,9 @@ interface YrsParagraphAttrs {
|
|
|
487
711
|
listMarkerHidden?: boolean | null;
|
|
488
712
|
listMarkerFontFamily?: string | null;
|
|
489
713
|
listMarkerFontSize?: number | null;
|
|
714
|
+
listMarkerBold?: boolean | null;
|
|
715
|
+
listMarkerItalic?: boolean | null;
|
|
716
|
+
listMarkerColor?: ColorValue | null;
|
|
490
717
|
listMarkerSuffix?: 'tab' | 'space' | 'nothing' | null;
|
|
491
718
|
listLevelNumFmts?: readonly string[] | null;
|
|
492
719
|
listAbstractNumId?: number | null;
|
|
@@ -494,7 +721,11 @@ interface YrsParagraphAttrs {
|
|
|
494
721
|
/** Passive pPr/model properties not covered by the typed fields. */
|
|
495
722
|
other?: Readonly<Record<string, unknown | null>>;
|
|
496
723
|
}
|
|
497
|
-
/**
|
|
724
|
+
/**
|
|
725
|
+
* Typed value for a content control. A string fills a plain- or rich-text control's content
|
|
726
|
+
* (as a `setContentControlText` edit step would); the objects set checkbox, dropdown and date
|
|
727
|
+
* controls.
|
|
728
|
+
*/
|
|
498
729
|
type YrsContentControlValue = {
|
|
499
730
|
kind: 'dropdown';
|
|
500
731
|
value: string;
|
|
@@ -616,6 +847,10 @@ type YrsRawOp = {
|
|
|
616
847
|
len: number;
|
|
617
848
|
attrs?: Record<string, unknown>;
|
|
618
849
|
} | {
|
|
850
|
+
/**
|
|
851
|
+
* A pilcrow's `ooxmlParaId` binds its Word paragraph ID and is dropped
|
|
852
|
+
* when it is not one; `sourceParaId` and `paraOrigin` are seeding's to set.
|
|
853
|
+
*/
|
|
619
854
|
op: 'insertEmbed';
|
|
620
855
|
index: number;
|
|
621
856
|
kind: string;
|
|
@@ -643,6 +878,8 @@ type YrsRawOp = {
|
|
|
643
878
|
interface YrsRenderEnv {
|
|
644
879
|
tocStyleIds?: string[];
|
|
645
880
|
paragraphSpacingLinePx?: number;
|
|
881
|
+
/** Section document-grid snap pitch in px (w:docGrid). The engine derives this from sections; hosts may omit it. */
|
|
882
|
+
docGridPitchPx?: number;
|
|
646
883
|
defaultParagraphStyleId?: string;
|
|
647
884
|
/** Theme color name → hex (`accent1` → `4472C4`), for theme-color resolution. */
|
|
648
885
|
themeColors?: Record<string, string>;
|
|
@@ -659,6 +896,16 @@ interface YrsRenderEnv {
|
|
|
659
896
|
interface YrsCommentReceipt {
|
|
660
897
|
commentId: string;
|
|
661
898
|
}
|
|
899
|
+
/** A comment the session holds; see {@link YrsSession.listComments}. @internal */
|
|
900
|
+
interface YrsCommentInfo {
|
|
901
|
+
id: string;
|
|
902
|
+
author: string;
|
|
903
|
+
date: string;
|
|
904
|
+
done: boolean;
|
|
905
|
+
parentId: string | null;
|
|
906
|
+
/** The body as it was given to {@link YrsSession.addComment} or `setComment`. */
|
|
907
|
+
body: unknown;
|
|
908
|
+
}
|
|
662
909
|
/**
|
|
663
910
|
* Target of {@link YrsSession.acceptChange} / {@link YrsSession.rejectChange}:
|
|
664
911
|
* one coalesced revision id (resolved at every site, in any story — the
|
|
@@ -713,6 +960,17 @@ interface YrsEngineApplyProfile {
|
|
|
713
960
|
*
|
|
714
961
|
* @internal
|
|
715
962
|
*/
|
|
963
|
+
/**
|
|
964
|
+
* One resident font-store registration, in the order the main thread made it:
|
|
965
|
+
* raw bytes, or a measurement view of an earlier id. The worker replays the
|
|
966
|
+
* list to reproduce the same dense ids, so the order and the mix both matter.
|
|
967
|
+
*
|
|
968
|
+
* @internal
|
|
969
|
+
*/
|
|
970
|
+
type YrsResidentFontRegistration = Uint8Array | {
|
|
971
|
+
substituteOf: number;
|
|
972
|
+
family: string;
|
|
973
|
+
};
|
|
716
974
|
interface YrsResidentWorkerSnapshot {
|
|
717
975
|
clientId: number;
|
|
718
976
|
/** Full document state, or a state-vector diff when the caller supplied
|
|
@@ -721,7 +979,7 @@ interface YrsResidentWorkerSnapshot {
|
|
|
721
979
|
selection: YrsSelection | null;
|
|
722
980
|
/** Empty when the caller declared the worker's fonts current
|
|
723
981
|
* (`knownFontsRevision` matches); the worker then keeps its registrations. */
|
|
724
|
-
fonts:
|
|
982
|
+
fonts: YrsResidentFontRegistration[];
|
|
725
983
|
/** Monotonic revision of the resident font set (bumped by register/clear). */
|
|
726
984
|
fontsRevision: number;
|
|
727
985
|
renderInputs: Array<{
|
|
@@ -758,12 +1016,16 @@ interface YrsSelectionContext {
|
|
|
758
1016
|
italic: YrsTriState;
|
|
759
1017
|
underline: YrsTriState;
|
|
760
1018
|
strike: YrsTriState;
|
|
1019
|
+
superscript: YrsTriState;
|
|
1020
|
+
subscript: YrsTriState;
|
|
761
1021
|
/** Uniform ASCII font family, or `null` when absent/mixed. */
|
|
762
1022
|
fontFamily: string | null;
|
|
763
1023
|
/** Uniform font size in half-points (the OOXML `w:sz` unit). */
|
|
764
1024
|
fontSize: number | null;
|
|
765
1025
|
/** Uniform RGB hex or theme-color name, or `null` when absent/mixed. */
|
|
766
1026
|
color: string | null;
|
|
1027
|
+
/** Uniform highlight name (`yellow`, …) or unmapped hex, or `null` when absent/mixed. */
|
|
1028
|
+
highlight: string | null;
|
|
767
1029
|
/** Paragraph containing the range start. */
|
|
768
1030
|
paraId: string;
|
|
769
1031
|
styleId: string | null;
|
|
@@ -858,6 +1120,8 @@ interface YrsTableReceipt {
|
|
|
858
1120
|
columns: number;
|
|
859
1121
|
createdStoryIds: string[];
|
|
860
1122
|
deletedStoryIds: string[];
|
|
1123
|
+
/** Existing stories whose content changed: the table's story, plus a merge's surviving cell. */
|
|
1124
|
+
changedStoryIds: string[];
|
|
861
1125
|
newParaIds: string[];
|
|
862
1126
|
deletedTable: boolean;
|
|
863
1127
|
revisionIds: string[];
|
|
@@ -882,6 +1146,21 @@ interface YrsCellBorder {
|
|
|
882
1146
|
* @public
|
|
883
1147
|
*/
|
|
884
1148
|
type YrsCellBorders = Partial<Record<'top' | 'bottom' | 'left' | 'right' | 'insideH' | 'insideV', YrsCellBorder | null>>;
|
|
1149
|
+
/** Undo grouping for tracked local transactions. */
|
|
1150
|
+
type YrsUndoCaptureMode = 'auto' | 'manual';
|
|
1151
|
+
/** Outcome of a target-resolving helper edit. @internal */
|
|
1152
|
+
type YrsTargetEditResult = {
|
|
1153
|
+
ok: true;
|
|
1154
|
+
version: string;
|
|
1155
|
+
} | DocxEditRefusal;
|
|
1156
|
+
/** Accepted-view texts around a selection; U+FFFC stands for each inline atom. @internal */
|
|
1157
|
+
interface YrsSelectionText {
|
|
1158
|
+
paraId: string;
|
|
1159
|
+
selectedText: string;
|
|
1160
|
+
paragraphText: string;
|
|
1161
|
+
before: string;
|
|
1162
|
+
after: string;
|
|
1163
|
+
}
|
|
885
1164
|
/**
|
|
886
1165
|
* One live replica of the yrs editing model. Thin typed wrapper over the
|
|
887
1166
|
* wasm `EditSession` — no editing logic on this side of the boundary.
|
|
@@ -891,6 +1170,12 @@ interface YrsSession extends CollaborationReplica {
|
|
|
891
1170
|
readonly clientId: number;
|
|
892
1171
|
/** Register raw sfnt bytes in the session's measurement/display font store. */
|
|
893
1172
|
registerFont(bytes: Uint8Array): number;
|
|
1173
|
+
/**
|
|
1174
|
+
* Register a measurement view of `base` carrying the vertical metrics Word
|
|
1175
|
+
* measures `family` with, for a face the host substituted; `base` when the
|
|
1176
|
+
* engine knows no metrics for the family.
|
|
1177
|
+
*/
|
|
1178
|
+
registerSubstituteFont(base: number, family: string): number;
|
|
894
1179
|
/** Clear the session's registered measurement/display fonts. */
|
|
895
1180
|
clearFonts(): void;
|
|
896
1181
|
/** Measure one paragraph through the session's resident text engine. */
|
|
@@ -946,13 +1231,26 @@ interface YrsSession extends CollaborationReplica {
|
|
|
946
1231
|
outlineGlyphJson(fontId: number, glyphId: number): string;
|
|
947
1232
|
/** Hydrates from an encoded yrs v1 update (typically a peer's {@link encodeState} output). */
|
|
948
1233
|
loadState(update: Uint8Array): void;
|
|
949
|
-
/** Parses a DOCX, seeds its stories, and returns thin host metadata. */
|
|
950
|
-
seedFromDocx(bytes: Uint8Array): YrsDocxHost;
|
|
951
|
-
/**
|
|
952
|
-
|
|
1234
|
+
/** Parses a DOCX, seeds its stories, and returns thin host metadata; see {@link openDocx}. */
|
|
1235
|
+
seedFromDocx(bytes: Uint8Array, options?: YrsOpeningOptions): YrsDocxHost;
|
|
1236
|
+
/**
|
|
1237
|
+
* Parses a DOCX and optionally seeds its stories. Seeding starts a new
|
|
1238
|
+
* opening, so its session anchors never resolve in another opening, even
|
|
1239
|
+
* one seeded alike by the same client; see {@link beginOpening}.
|
|
1240
|
+
*/
|
|
1241
|
+
openDocx(bytes: Uint8Array, seedStories: boolean, options?: YrsOpeningOptions): YrsDocxHost;
|
|
1242
|
+
/**
|
|
1243
|
+
* Starts a new opening of the document: its generation, replicated to
|
|
1244
|
+
* every replica, becomes part of every session anchor. Every seeding entry
|
|
1245
|
+
* point calls it; call it after building a document another way.
|
|
1246
|
+
*/
|
|
1247
|
+
beginOpening(generation?: string): void;
|
|
953
1248
|
/** Materializes the retained canonical package for compatibility APIs. */
|
|
954
1249
|
materializeDocx(): Document | null;
|
|
955
|
-
/**
|
|
1250
|
+
/**
|
|
1251
|
+
* Seeds stories and returns paragraph IDs in document order. Seeding a
|
|
1252
|
+
* document that has no opening yet starts one; see {@link beginOpening}.
|
|
1253
|
+
*/
|
|
956
1254
|
loadStories(stories: readonly YrsStorySeed[]): Record<string, string[]>;
|
|
957
1255
|
/** Full document state as one yrs v1 update (Yjs wire format). */
|
|
958
1256
|
encodeState(): Uint8Array;
|
|
@@ -987,6 +1285,12 @@ interface YrsSession extends CollaborationReplica {
|
|
|
987
1285
|
cellSelection(): YrsTableRange | null;
|
|
988
1286
|
/** Begin local-origin undo capture once import/seeding has completed. */
|
|
989
1287
|
beginUndoCapture(): void;
|
|
1288
|
+
/** Separates subsequent local edits from the current undo step; safe before capture starts. */
|
|
1289
|
+
addUndoBoundary(): void;
|
|
1290
|
+
/** Changes grouping policy, closing the current group while retaining history. */
|
|
1291
|
+
setUndoCaptureMode(mode: YrsUndoCaptureMode): void;
|
|
1292
|
+
/** Current grouping policy; defaults to auto. */
|
|
1293
|
+
undoCaptureMode(): YrsUndoCaptureMode;
|
|
990
1294
|
/** Stories changed by the latest undo or redo, sorted. */
|
|
991
1295
|
historyStories(): string[];
|
|
992
1296
|
/** Undo/redo only local-origin direct operations (never remote/system transactions). */
|
|
@@ -1048,7 +1352,8 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1048
1352
|
mergeParagraphs(story: string, paraId: string, suggesting?: YrsAuthor): YrsRevisionReceipt;
|
|
1049
1353
|
/**
|
|
1050
1354
|
* Toggles one run mark across a range: removes it when every unit already
|
|
1051
|
-
* carries it, otherwise adds it.
|
|
1355
|
+
* carries it, otherwise adds it. Adding superscript clears subscript and
|
|
1356
|
+
* vice versa.
|
|
1052
1357
|
*/
|
|
1053
1358
|
toggleMark(range: YrsStoryRange, mark: YrsRunMark): void;
|
|
1054
1359
|
/** Applies set-valued direct formatting; omitted fields are kept and `null` fields clear. */
|
|
@@ -1063,21 +1368,33 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1063
1368
|
setParagraphAttrs(range: YrsStoryRange, attrs: YrsParagraphAttrs, suggesting?: YrsAuthor): void;
|
|
1064
1369
|
/** Inserts one inline image embed, optionally as a tracked insertion. */
|
|
1065
1370
|
insertImage(at: YrsLoc, image: Readonly<Record<string, unknown>>, suggesting?: YrsAuthor): YrsRevisionReceipt;
|
|
1066
|
-
/**
|
|
1371
|
+
/**
|
|
1372
|
+
* Sets the value of a content-control embed addressed by stable payload id. A string fills a
|
|
1373
|
+
* text control's content as one version-checked step and throws when the fill is refused.
|
|
1374
|
+
*/
|
|
1067
1375
|
setContentControlValue(embedId: string, value: YrsContentControlValue): void;
|
|
1068
|
-
/**
|
|
1376
|
+
/** {@link setContentControlValue} for the embed at a paragraph-keyed position. */
|
|
1069
1377
|
setContentControlValueAt(at: YrsLoc, value: YrsContentControlValue): void;
|
|
1070
|
-
/**
|
|
1378
|
+
/**
|
|
1379
|
+
* Removes an authored value from a content-control embed. It never erases a text control's
|
|
1380
|
+
* text: fill it with `''` for that.
|
|
1381
|
+
*/
|
|
1071
1382
|
clearContentControlValue(embedId: string): void;
|
|
1072
1383
|
/** Commits image size/wrapping/position fields in one transaction. */
|
|
1073
1384
|
setImageGeometry(embedId: string, geometry: YrsImageGeometry): void;
|
|
1385
|
+
/** Commits image geometry at a paragraph-keyed position; reaches images that share an id. */
|
|
1386
|
+
setImageGeometryAt(at: YrsLoc, geometry: YrsImageGeometry): void;
|
|
1074
1387
|
/** Inserts a native page-break embed at a paragraph-keyed location. */
|
|
1075
1388
|
insertPageBreak(at: YrsLoc): void;
|
|
1076
1389
|
/** Inserts a native section-break embed at a paragraph-keyed location. */
|
|
1077
1390
|
insertSectionBreak(at: YrsLoc, type: 'nextPage' | 'continuous' | 'oddPage' | 'evenPage'): void;
|
|
1078
1391
|
/** Inserts a typed watermark embed at a paragraph-keyed location. */
|
|
1079
1392
|
insertWatermark(at: YrsLoc, watermark: YrsWatermark): void;
|
|
1080
|
-
/**
|
|
1393
|
+
/**
|
|
1394
|
+
* Applies raw story operations in one transaction, then repairs any
|
|
1395
|
+
* paragraph identity a pilcrow they insert or re-key duplicates and
|
|
1396
|
+
* promotes an editor-only paragraph they author into.
|
|
1397
|
+
*/
|
|
1081
1398
|
applyRawOps(story: string, ops: readonly YrsRawOp[]): void;
|
|
1082
1399
|
/** Applies seed raw operations with deterministic item ordering. */
|
|
1083
1400
|
applySeedRawOps(story: string, ops: readonly YrsRawOp[]): void;
|
|
@@ -1085,6 +1402,8 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1085
1402
|
setParagraphAttr(paraId: string, key: string, value: unknown): void;
|
|
1086
1403
|
/** Adds a sticky-anchored comment over one or more ranges. */
|
|
1087
1404
|
addComment(ranges: readonly YrsStoryRange[], author: string, date: string, body: unknown): YrsCommentReceipt;
|
|
1405
|
+
/** Reanchors an existing comment with non-empty ranges; preserves metadata and joins local undo capture. */
|
|
1406
|
+
setCommentRanges(commentId: string, ranges: readonly YrsStoryRange[]): void;
|
|
1088
1407
|
/**
|
|
1089
1408
|
* Accepts tracked changes: pending insertions become plain content,
|
|
1090
1409
|
* pending deletions are carried out; a `pPrIns` paragraph mark clears (the
|
|
@@ -1105,6 +1424,8 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1105
1424
|
listRevisions(): YrsRevisionInfo[];
|
|
1106
1425
|
/** Current offsets of a comment's sticky anchors. Throws when an anchor no longer resolves. */
|
|
1107
1426
|
resolveComment(commentId: string): YrsResolvedCommentAnchor[];
|
|
1427
|
+
/** Every comment the session holds, sorted by id. @internal */
|
|
1428
|
+
listComments(): YrsCommentInfo[];
|
|
1108
1429
|
/** Story ids in the document, sorted. */
|
|
1109
1430
|
storyIds(): string[];
|
|
1110
1431
|
/** Story length in UTF-16 units (every embed, pilcrows included, counts 1). */
|
|
@@ -1115,12 +1436,119 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1115
1436
|
yrsBlocksForStory(story: string, env?: YrsRenderEnv): unknown[];
|
|
1116
1437
|
/** Paragraph snapshots in document order. */
|
|
1117
1438
|
paragraphs(story: string): YrsParagraph[];
|
|
1439
|
+
/** Literal search in document order. */
|
|
1440
|
+
searchText(query: string, options?: YrsTextSearchOptions): YrsTextMatch[];
|
|
1118
1441
|
/** Paragraph ids and inline-unit lengths, resolved in one Rust story traversal. */
|
|
1119
1442
|
paragraphSpans(story: string): YrsParagraphLength[];
|
|
1120
1443
|
/** The raw formatted-segment view (the render bridge's input). */
|
|
1121
1444
|
storySegments(story: string): YrsStorySegment[];
|
|
1122
1445
|
/** A paragraph's story span (start unit, pilcrow index). */
|
|
1123
1446
|
locateParagraph(story: string, paraId: string): YrsParagraphSpan;
|
|
1447
|
+
/**
|
|
1448
|
+
* Session, persisted and source anchors of every paragraph, including the
|
|
1449
|
+
* source package's paragraphs outside the stories, and the Word paragraph ID
|
|
1450
|
+
* each saves with. Reads only.
|
|
1451
|
+
*/
|
|
1452
|
+
paragraphIdentities(): DocxParagraphIdentitySnapshot;
|
|
1453
|
+
/**
|
|
1454
|
+
* Gives every paragraph that saves without a Word paragraph ID a fresh one,
|
|
1455
|
+
* editor-only paragraphs excepted, and repairs duplicates, so persisted
|
|
1456
|
+
* anchors survive save and reopen. Source IDs and saved claims keep their
|
|
1457
|
+
* IDs over unsaved claims and copies. A replicated change outside undo
|
|
1458
|
+
* history that later saves keep; a refusal changes nothing.
|
|
1459
|
+
*/
|
|
1460
|
+
persistParagraphIds(): DocxParagraphIdentityReceipt;
|
|
1461
|
+
/** Resolves an anchor to the paragraph that currently holds it. Reads only. */
|
|
1462
|
+
resolveParagraphAnchor(anchor: DocxParagraphAnchor): DocxParagraphAnchorResult;
|
|
1463
|
+
/** The Word paragraph ID each paragraph of a story saves with, in pilcrow order. @internal */
|
|
1464
|
+
storyParagraphIds(story: string): Array<string | null>;
|
|
1465
|
+
/** The paragraph IDs a save of the session applies. @internal */
|
|
1466
|
+
paragraphSavePlan(): DocxParagraphSavePlan;
|
|
1467
|
+
/**
|
|
1468
|
+
* Publishes the `[owner, paraId]` pairs a save captured and returns those
|
|
1469
|
+
* whose binding changed since. @internal
|
|
1470
|
+
*/
|
|
1471
|
+
recordSavedParagraphIds(saved: ReadonlyArray<readonly [string, string]>): Array<[string, string]>;
|
|
1472
|
+
/**
|
|
1473
|
+
* The Word paragraph IDs a DOCX package holds, by part URI, in document
|
|
1474
|
+
* order and upper case. Reads only. @internal
|
|
1475
|
+
*/
|
|
1476
|
+
writtenParagraphIds(bytes: Uint8Array): Record<string, string[]>;
|
|
1477
|
+
/**
|
|
1478
|
+
* The session-scoped version token. It changes on every committed change, local or remote,
|
|
1479
|
+
* and when the document is replaced; compare tokens only within this session.
|
|
1480
|
+
*/
|
|
1481
|
+
version(): string;
|
|
1482
|
+
/** Paragraph texts in one view, with the version they were read at. */
|
|
1483
|
+
readParagraphs(request: DocxReadParagraphsRequest): DocxReadParagraphsResult;
|
|
1484
|
+
/** Exact, case-sensitive, paragraph-local search; overlapping matches count separately. */
|
|
1485
|
+
findText(request: DocxFindTextRequest): DocxFindTextResult;
|
|
1486
|
+
/** Resolves and checks an edit batch without changing anything or reserving ids. */
|
|
1487
|
+
validateEdits(request: DocxEditRequest): DocxValidationResult;
|
|
1488
|
+
/**
|
|
1489
|
+
* Applies every step or none, resolving all targets against `expectVersion`. Policy
|
|
1490
|
+
* failures are returned; malformed requests throw.
|
|
1491
|
+
*/
|
|
1492
|
+
applyEdits(request: DocxEditRequest): DocxEditResult;
|
|
1493
|
+
/** Resolves a text target and formats it in one call. @internal */
|
|
1494
|
+
formatTextTarget(target: DocxTextTarget, delta: YrsInlineFormatDelta): YrsTargetEditResult;
|
|
1495
|
+
/** Resolves a text target and anchors side-map comment `id` over it in one call. @internal */
|
|
1496
|
+
commentTextTarget(target: DocxTextTarget, comment: {
|
|
1497
|
+
id: string;
|
|
1498
|
+
author: string;
|
|
1499
|
+
date: string;
|
|
1500
|
+
body: unknown;
|
|
1501
|
+
}): YrsTargetEditResult;
|
|
1502
|
+
/** Accepted-view texts around a paragraph-keyed selection. @internal */
|
|
1503
|
+
selectionText(range: YrsStoryRange): YrsSelectionText;
|
|
1504
|
+
/**
|
|
1505
|
+
* Exports the committed document as read-only structured content with the version it was read
|
|
1506
|
+
* at; anchors resolve against that version. Nothing is committed, flushed or published.
|
|
1507
|
+
* Unusable options are refused; malformed ones throw.
|
|
1508
|
+
*/
|
|
1509
|
+
exportStructured(options: DocxExportOptions): DocxExportResult<DocxStructuredContent>;
|
|
1510
|
+
/** {@link exportStructured} rendered as Markdown from the same read. */
|
|
1511
|
+
exportMarkdown(options: DocxExportOptions): DocxExportResult<DocxMarkdownContent>;
|
|
1512
|
+
/**
|
|
1513
|
+
* {@link exportStructured} with the page map of the region layout this session retains. The
|
|
1514
|
+
* layout must have lowered the current version from this session's stories with section,
|
|
1515
|
+
* settings and note metadata that describe it, and measured every font the document uses
|
|
1516
|
+
* with the fonts registered now; this call lays nothing out, flushes nothing and loads no
|
|
1517
|
+
* font, and refuses a stale or incomplete layout.
|
|
1518
|
+
*/
|
|
1519
|
+
exportStructuredWithPages(options: DocxPageExportOptions): DocxExportResult<DocxPagedStructuredContent<DocxLayoutMap>>;
|
|
1520
|
+
/**
|
|
1521
|
+
* {@link exportStructuredWithPages} for an editor: `currentRequest` is the region layout
|
|
1522
|
+
* request it would lay the document out with now, and the retained layout must have used the
|
|
1523
|
+
* same fonts, measurement defaults, render environment and pagination options. @internal
|
|
1524
|
+
*/
|
|
1525
|
+
exportStructuredWithPagesFor(options: DocxPageExportOptions, currentRequest: string): DocxExportResult<DocxPagedStructuredContent<DocxLayoutMap>>;
|
|
1526
|
+
/**
|
|
1527
|
+
* Lays this private session out with `fonts` alone, in a measurement font store of its own,
|
|
1528
|
+
* and exports it with snapshot anchors and a snapshot map. `fonts` holds the font files back
|
|
1529
|
+
* to back and `fontLengths` their lengths; `request`'s font chains name them by index. Throws
|
|
1530
|
+
* for a font the engine rejects. @internal
|
|
1531
|
+
*/
|
|
1532
|
+
exportSnapshotWithPrivateFonts(fonts: Uint8Array, fontLengths: Uint32Array, request: string, options: DocxPageExportOptions): {
|
|
1533
|
+
ok: true;
|
|
1534
|
+
content: DocxPagedStructuredContent<DocxSnapshotLayoutMap>;
|
|
1535
|
+
} | {
|
|
1536
|
+
ok: false;
|
|
1537
|
+
failure: DocxExportFailure;
|
|
1538
|
+
};
|
|
1539
|
+
/**
|
|
1540
|
+
* The heading paragraphs of `story` in document order, classified as the structured export
|
|
1541
|
+
* classifies them. Throws for an unknown story.
|
|
1542
|
+
*/
|
|
1543
|
+
headings(story: string): DocxParagraphHeading[];
|
|
1544
|
+
/**
|
|
1545
|
+
* The content controls of the committed document with the version they were read at; control
|
|
1546
|
+
* ids and anchors resolve against that version. Nothing is committed, flushed or published.
|
|
1547
|
+
* Unusable options are refused; malformed ones throw.
|
|
1548
|
+
*/
|
|
1549
|
+
listContentControls(options?: DocxContentControlsOptions): DocxContentControlsResult;
|
|
1550
|
+
/** The controls {@link listContentControls} lists that match `query` exactly; none or several. */
|
|
1551
|
+
findContentControls(query: DocxContentControlQuery, options?: DocxContentControlsOptions): DocxContentControlsResult;
|
|
1124
1552
|
/** Drops the observer and frees the wasm-side replica. Idempotent. */
|
|
1125
1553
|
destroy(): void;
|
|
1126
1554
|
}
|
|
@@ -1139,4 +1567,4 @@ interface CreateYrsSessionOptions {
|
|
|
1139
1567
|
*/
|
|
1140
1568
|
declare function createYrsSession(options?: CreateYrsSessionOptions): Promise<YrsSession>;
|
|
1141
1569
|
|
|
1142
|
-
export { type
|
|
1570
|
+
export { type YrsCellLoc as $, type DocxParagraphIdOrigin as A, type DocxParagraphIdRefusal as B, type CollaborationReplica as C, type DocxParagraphAnchor as D, type DocxParagraphIdentity as E, type DocxParagraphIdentityReceipt as F, type DocxParagraphIdentitySnapshot as G, type DocxParagraphOrigin as H, type DocxParagraphRef as I, type DocxParagraphSavePlan as J, type DocxPersistedParagraphAnchor as K, type DocxSavedDocument as L, type DocxSavedParagraph as M, type DocxSessionParagraphAnchor as N, type DocxSessionSave as O, type DocxSourceParagraphAnchor as P, type DocxSourceStory as Q, type ResidentCaretPaintStyle as R, type ResidentEngineOffscreenPage as S, type ResidentEngineWorkerApplyResult as T, ResidentEngineWorkerClient as U, type ResidentEngineWorkerFrame as V, ResidentWorkerFailureError as W, type YrsAuthor as X, type YrsSession as Y, type YrsCellBorder as Z, type YrsCellBorders as _, type YrsRenderEnv as a, type YrsChangeTarget as a0, type YrsCommentInfo as a1, type YrsCommentReceipt as a2, type YrsContentControlValue as a3, type YrsDocxHost as a4, type YrsEngineApplyProfile as a5, type YrsHyperlinkAttrs as a6, type YrsImageGeometry as a7, type YrsInlineFormatDelta as a8, type YrsInputParagraphSeed as a9, type YrsStoryRange as aA, type YrsStorySeed as aB, type YrsStorySegment as aC, type YrsTableLoc as aD, type YrsTableRange as aE, type YrsTableReceipt as aF, type YrsTargetEditResult as aG, type YrsTextColor as aH, type YrsTextMatch as aI, type YrsTextSearchOptions as aJ, type YrsTriState as aK, type YrsUndoCaptureMode as aL, type YrsWatermark as aM, canUseResidentEngineWorker as aN, captureSessionSave as aO, compareYrsLocs as aP, createYrsInputPositionMap as aQ, createYrsSession as aR, displayPositionToYrsLoc as aS, documentToYrs as aT, residentCaretDeviceRect as aU, residentCaretSnapshotForFrame as aV, sameYrsSelection as aW, saveYrsDocx as aX, writeSessionSave as aY, yrsLocToDisplayPosition as aZ, yrsToDocument as a_, type YrsInputParagraphSpan as aa, type YrsInputPositionMap as ab, type YrsNumberingProperties as ac, type YrsOpeningOptions as ad, type YrsParaOffset as ae, type YrsParagraph as af, type YrsParagraphAttrs as ag, type YrsParagraphLength as ah, type YrsParagraphReceipt as ai, type YrsParagraphSeed as aj, type YrsParagraphSpan as ak, type YrsParagraphTabStop as al, type YrsRawOp as am, type YrsResidentCaretRect as an, type YrsResidentCaretSnapshot as ao, type YrsResidentFontRegistration as ap, type YrsResidentWorkerSnapshot as aq, type YrsResidentWorkerSyncOptions as ar, type YrsResolveReceipt as as, type YrsResolvedCommentAnchor as at, type YrsRevisionReceipt as au, type YrsRunMark as av, type YrsSelectionContext as aw, type YrsSelectionText as ax, type YrsSplitReceipt as ay, type YrsStickyPosition as az, type CollaborationTransport as b, type CollaborationProviderOptions as c, type CollaborationStatus as d, type CollaborationPeer as e, type CollaborationCursor as f, type CollaborationPeerListener as g, type CollaborationStatusListener as h, type CollaborationErrorListener as i, type YrsSelection as j, type CollaborationAwarenessState as k, CollaborationError as l, type CollaborationErrorCode as m, type CollaborationPresence as n, type CollaborationResolvedUser as o, type CollaborationStatusChange as p, type CollaborationTextInsertion as q, type CollaborationTransportEvent as r, type CollaborationUpdateOrigin as s, type CollaborationUser as t, type YrsLoc as u, type YrsRevisionInfo as v, type CreateYrsSessionOptions as w, type DocxParagraphAnchorResult as x, type DocxParagraphIdAssignment as y, type DocxParagraphIdDiagnostic as z };
|