@betteroffice/docx 0.4.0 → 0.4.2
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 +2 -1
- package/dist/chunk-4PRCO6EC.mjs +1 -0
- package/dist/chunk-5Z22FORG.mjs +1 -0
- package/dist/chunk-7SUVUKWT.mjs +1 -0
- package/dist/chunk-7ZV6P6NZ.mjs +57 -0
- package/dist/{chunk-2QHGQA3V.mjs → chunk-AXFMDV66.mjs} +1 -1
- package/dist/{chunk-YLFKV2NT.mjs → chunk-EBYC3CX7.mjs} +1 -1
- package/dist/{chunk-3CYO46ML.mjs → chunk-GKWXOZZH.mjs} +1 -1
- package/dist/chunk-HGKSOBXK.mjs +1 -0
- package/dist/chunk-LIOWZSE7.mjs +1 -0
- package/dist/chunk-ML6E23W2.mjs +1 -0
- package/dist/{chunk-NVN26RHH.mjs → chunk-MLEMGJP7.mjs} +1 -1
- package/dist/chunk-QBMNRD5V.mjs +2 -0
- package/dist/chunk-RNNTXPXC.mjs +1 -0
- package/dist/chunk-UBUTIWXN.mjs +1 -0
- package/dist/chunk-VH7P4734.mjs +16 -0
- package/dist/collaboration/index.d.mts +6 -5
- package/dist/compareDocx-CWOYEBCE.mjs +1 -0
- package/dist/{computeLayout-4MNWHE2T.mjs → computeLayout-ZTO6TBWX.mjs} +1 -1
- package/dist/{content-BzoC6bSz.d.mts → content-DSb-6a9T.d.mts} +5 -5
- package/dist/core.d.mts +5 -5
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-H5YnU_hX.d.mts → displayListQueries-BVBDVXoP.d.mts} +2 -2
- package/dist/docx/index.d.mts +3 -3
- package/dist/docx/index.mjs +2 -2
- package/dist/editor/index.d.mts +11 -6
- package/dist/editor/index.mjs +1 -1
- package/dist/{frameDelta-ByU7HBuB.d.mts → frameDelta-CLeO7K5z.d.mts} +5 -2
- 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-CHy6_Yuo.d.mts → index-DzZVJC8-.d.mts} +453 -12
- package/dist/layout/index.d.mts +2 -2
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +3 -3
- package/dist/layout/render/index.d.mts +32 -11
- package/dist/layout/render/index.mjs +1 -1
- package/dist/{pagedExport---0Dlmzo.d.mts → pagedExport-BmSlEhoP.d.mts} +1 -1
- package/dist/{parseWasm-NLAG22EU.mjs → parseWasm-BESKFFA3.mjs} +1 -1
- package/dist/plugin-api/RenderedDomContext.d.mts +5 -5
- package/dist/plugin-api/index.d.mts +1 -1
- package/dist/plugin-api/resolveItemPositions.d.mts +1 -1
- package/dist/{rustDisplayList-LcRZHCSL.d.mts → rustDisplayList-B7uPoItK.d.mts} +2 -2
- package/dist/types/content.d.mts +1 -1
- package/dist/types/document.d.mts +2 -2
- package/dist/{types-D6Pra38E.d.mts → types-Cz7S77Ut.d.mts} +23 -1
- package/dist/utils/comments.d.mts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/{wasm-K6DRABAA.mjs → wasm-GFT55YT6.mjs} +1 -1
- package/dist/wasm-QI7MWC5D.mjs +1 -0
- package/dist/wasm-QXYYV7LU.mjs +1 -0
- package/dist/wasm-edit.d.mts +41 -2
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/wasm-opc.mjs +1 -1
- package/dist/wasm-parse.mjs +1 -1
- package/dist/yrs/index.d.mts +5 -4
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-24Z6ZVFZ.mjs +0 -1
- package/dist/chunk-6CHGYCFU.mjs +0 -1
- package/dist/chunk-F2VBW6RB.mjs +0 -1
- package/dist/chunk-L2ML3DDI.mjs +0 -1
- package/dist/chunk-LIGZ75FP.mjs +0 -1
- package/dist/chunk-ND3FBCB3.mjs +0 -16
- package/dist/chunk-NMDQHUQB.mjs +0 -57
- package/dist/chunk-OK5UFGX3.mjs +0 -1
- package/dist/chunk-RZQ3OXZY.mjs +0 -2
- package/dist/compareDocx-IHFPGIGV.mjs +0 -1
- package/dist/wasm-GSI2XMOH.mjs +0 -1
- package/dist/wasm-NF6B3AH7.mjs +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { C as ColorValue } from './formatting-gqLFeJ9X.mjs';
|
|
2
2
|
import { Document, CompatibilityFlags } from './types/document.mjs';
|
|
3
|
-
import { a0 as DocxEditSuggestion, a1 as DocxEditFailure, a2 as DocxEditFailureCode, a3 as
|
|
4
|
-
import { R as RetainedFrame } from './frameDelta-
|
|
3
|
+
import { a0 as DocxEditSuggestion, a1 as DocxEditFailure, a2 as DocxEditFailureCode, a3 as DocxTextRange, a4 as DocxReadParagraphsRequest, a5 as DocxReadParagraphsResult, a6 as DocxFindTextRequest, a7 as DocxFindTextResult, a8 as DocxEditRequest, a9 as DocxValidationResult, aa as DocxEditResult, ab as DocxTextTarget, ac 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-BmSlEhoP.mjs';
|
|
4
|
+
import { R as RetainedFrame } from './frameDelta-CLeO7K5z.mjs';
|
|
5
5
|
import { a as WasmModuleMemory } from './loadWasmAsset-Cr95TImt.mjs';
|
|
6
|
+
import { PointPosition } from './plugin-api/index.mjs';
|
|
7
|
+
import { B as BlockContent, e as Comment } from './content-DSb-6a9T.mjs';
|
|
6
8
|
import { R as RepackOptions } from './rezip-Bxiq4Z_R.mjs';
|
|
7
9
|
|
|
8
10
|
type CollaborationUpdateOrigin = 'local' | 'remote';
|
|
@@ -108,6 +110,19 @@ interface RustParagraphIds {
|
|
|
108
110
|
part: string;
|
|
109
111
|
paraIds: Array<[number, string]>;
|
|
110
112
|
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Story parts written as their source bytes with only some paragraphs
|
|
115
|
+
* re-serialized: those whose `sourceOrdinal` is in `changed`, or whose
|
|
116
|
+
* written comments, revisions, notes or relationships differ from their
|
|
117
|
+
* source. `paragraphs` lists every `sourceOrdinal` the model holds for the
|
|
118
|
+
* part, `sha256` the source part it addresses.
|
|
119
|
+
*/
|
|
120
|
+
splicedParts?: Array<{
|
|
121
|
+
part: string;
|
|
122
|
+
sha256: string;
|
|
123
|
+
paragraphs: number[];
|
|
124
|
+
changed: number[];
|
|
125
|
+
}>;
|
|
111
126
|
}
|
|
112
127
|
|
|
113
128
|
/**
|
|
@@ -239,8 +254,18 @@ type DocxParagraphAnchorResult = {
|
|
|
239
254
|
status: 'unsupported';
|
|
240
255
|
reason: 'foreign-session' | 'foreign-package' | 'no-source-package';
|
|
241
256
|
};
|
|
242
|
-
/**
|
|
243
|
-
|
|
257
|
+
/**
|
|
258
|
+
* The paragraph IDs a session save applies, as the package writer's
|
|
259
|
+
* `paragraphIds`, with each spliced part's paragraphs as `[ordinal, session key]`. @internal
|
|
260
|
+
*/
|
|
261
|
+
interface DocxParagraphSavePlan extends Omit<RustParagraphIds, 'splicedParts'> {
|
|
262
|
+
splicedParts?: Array<{
|
|
263
|
+
part: string;
|
|
264
|
+
sha256: string;
|
|
265
|
+
paragraphs: Array<[number, string]>;
|
|
266
|
+
changed: number[];
|
|
267
|
+
}>;
|
|
268
|
+
}
|
|
244
269
|
|
|
245
270
|
/**
|
|
246
271
|
* Host proposals: tracked changes a host proposes by paragraph anchor and search, grouped by the
|
|
@@ -292,6 +317,18 @@ interface DocxProposalSnapshot {
|
|
|
292
317
|
previewVersion: number;
|
|
293
318
|
proposals: readonly DocxProposalRecord[];
|
|
294
319
|
}
|
|
320
|
+
/** @internal */
|
|
321
|
+
interface DocxProposalRegistryState {
|
|
322
|
+
previewVersion: number;
|
|
323
|
+
entries: {
|
|
324
|
+
record: DocxProposalRecord;
|
|
325
|
+
key: string;
|
|
326
|
+
suggest: {
|
|
327
|
+
author: string;
|
|
328
|
+
date: string;
|
|
329
|
+
};
|
|
330
|
+
}[];
|
|
331
|
+
}
|
|
295
332
|
type DocxProposalFailure = Omit<DocxEditFailure, 'code'> & {
|
|
296
333
|
code: DocxEditFailureCode | 'stale-preview' | 'unknown-proposal' | 'proposal-id-conflict';
|
|
297
334
|
proposalId?: string;
|
|
@@ -367,9 +404,270 @@ declare function residentCaretDeviceRect(rect: Pick<YrsResidentCaretRect, 'x' |
|
|
|
367
404
|
};
|
|
368
405
|
declare function residentCaretSnapshotForFrame(snapshot: YrsResidentCaretSnapshot, frame: RetainedFrame): YrsResidentCaretSnapshot | null;
|
|
369
406
|
|
|
407
|
+
type PositionReader = Pick<YrsSession, 'hasStory' | 'storySegments'>;
|
|
408
|
+
type YrsLocProjection = Pick<YrsPositionProjection, 'positionForLoc'>;
|
|
409
|
+
type YrsPositionOutline = Record<string, {
|
|
410
|
+
contentStart: number;
|
|
411
|
+
size: number;
|
|
412
|
+
paragraphs: Array<{
|
|
413
|
+
paraId: string;
|
|
414
|
+
displayStart: number;
|
|
415
|
+
length: number;
|
|
416
|
+
leading: number;
|
|
417
|
+
}>;
|
|
418
|
+
}>;
|
|
419
|
+
declare function createYrsLocProjectionFromOutline(outline: YrsPositionOutline): YrsLocProjection;
|
|
420
|
+
/** @internal */
|
|
421
|
+
interface YrsProjectedNode {
|
|
422
|
+
kind: string;
|
|
423
|
+
start: number;
|
|
424
|
+
nodeSize: number;
|
|
425
|
+
attrs: Record<string, unknown>;
|
|
426
|
+
story: string;
|
|
427
|
+
}
|
|
428
|
+
/** @internal */
|
|
429
|
+
interface YrsProjectedTable extends YrsProjectedNode {
|
|
430
|
+
kind: 'table';
|
|
431
|
+
tableIndex: number;
|
|
432
|
+
widthsTwips: number[];
|
|
433
|
+
rowCount: number;
|
|
434
|
+
cells: YrsProjectedCell[];
|
|
435
|
+
}
|
|
436
|
+
/** @internal */
|
|
437
|
+
interface YrsProjectedCell {
|
|
438
|
+
row: number;
|
|
439
|
+
column: number;
|
|
440
|
+
rowspan: number;
|
|
441
|
+
colspan: number;
|
|
442
|
+
story: string;
|
|
443
|
+
start: number;
|
|
444
|
+
contentStart: number;
|
|
445
|
+
nodeSize: number;
|
|
446
|
+
attrs: Record<string, unknown>;
|
|
447
|
+
}
|
|
448
|
+
/** @internal */
|
|
449
|
+
interface YrsPointerProjectionTarget {
|
|
450
|
+
story: string;
|
|
451
|
+
displayPosition: number;
|
|
452
|
+
cell?: YrsCellLoc;
|
|
453
|
+
}
|
|
454
|
+
/** @internal */
|
|
455
|
+
interface YrsStorySegmentSource {
|
|
456
|
+
segments(story: string): YrsStorySegment[];
|
|
457
|
+
}
|
|
458
|
+
/** @internal */
|
|
459
|
+
declare function createYrsPositionProjection(session: PositionReader, rootStory: string, source?: YrsStorySegmentSource): YrsPositionProjection | null;
|
|
460
|
+
/** @internal */
|
|
461
|
+
declare function projectYrsDisplayPosition(position: number | PointPosition, getProjection: (rootStory: string) => YrsPositionProjection | null): YrsPointerProjectionTarget | null;
|
|
462
|
+
/** @internal */
|
|
463
|
+
declare class YrsPositionProjection {
|
|
464
|
+
readonly rootStory: string;
|
|
465
|
+
private readonly stories;
|
|
466
|
+
private readonly nodes;
|
|
467
|
+
private readonly tables;
|
|
468
|
+
private readonly source;
|
|
469
|
+
private readonly paragraphsById;
|
|
470
|
+
constructor(session: Pick<YrsSession, 'storySegments'>, rootStory: string, source?: YrsStorySegmentSource);
|
|
471
|
+
get size(): number;
|
|
472
|
+
nodeAt(position: number): YrsProjectedNode | null;
|
|
473
|
+
tableAtPosition(position: number): YrsProjectedTable | null;
|
|
474
|
+
tableAtStart(start: number): YrsProjectedTable | null;
|
|
475
|
+
tableStartForLoc(at: YrsCellLoc): number | null;
|
|
476
|
+
cellPosition(tableStart: number, row: number, column: number): number | null;
|
|
477
|
+
targetAt(position: number): YrsPointerProjectionTarget;
|
|
478
|
+
positionForLoc(loc: YrsLoc): number | null;
|
|
479
|
+
/** First paragraph for each paraId. */
|
|
480
|
+
private paragraphIndex;
|
|
481
|
+
bookmarkPosition(name: string): number | null;
|
|
482
|
+
private buildStory;
|
|
483
|
+
private inputPositionAt;
|
|
484
|
+
private buildTable;
|
|
485
|
+
}
|
|
486
|
+
/** @internal */
|
|
487
|
+
declare function yrsLocToProjectedDisplayPosition(reader: Pick<YrsSession, 'hasStory' | 'paragraphSpans'>, projectionFor: (rootStory: string) => YrsLocProjection | null, loc: YrsLoc, activeRootStory?: string, inputMap?: (story: string) => YrsInputPositionMap | null): number | null;
|
|
488
|
+
|
|
489
|
+
/** @internal */
|
|
490
|
+
interface ResidentSearchMatch {
|
|
491
|
+
story: string;
|
|
492
|
+
paraId: string;
|
|
493
|
+
start: number;
|
|
494
|
+
displayFrom: number;
|
|
495
|
+
displayTo: number;
|
|
496
|
+
}
|
|
497
|
+
/** @internal */
|
|
498
|
+
interface ResidentSearchResult {
|
|
499
|
+
matches: ResidentSearchMatch[];
|
|
500
|
+
carried: number;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/** @internal */
|
|
504
|
+
interface AnchorResolutionFailure {
|
|
505
|
+
ok: false;
|
|
506
|
+
failure: {
|
|
507
|
+
code: 'stale-version' | 'missing-target' | 'ambiguous-target' | 'layout-unavailable' | 'unsupported' | 'unknown-proposal';
|
|
508
|
+
message: string;
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
/** @internal */
|
|
512
|
+
type AnchorReader = Pick<YrsSession, 'resolveParagraphAnchor' | 'hasStory' | 'paragraphSpans' | 'storySegments' | 'findText' | 'listRevisions'>;
|
|
513
|
+
/** @internal */
|
|
514
|
+
type ProposalGeometryReader = AnchorReader & Pick<YrsSession, 'storyIds' | 'paragraphs' | 'paragraphIdCount' | 'locateParagraph' | 'version'> & {
|
|
515
|
+
proposalRevisions?(ids: readonly string[]): readonly ProposalGeometryRevision[];
|
|
516
|
+
positionOutline?(root: string): YrsPositionOutline | null;
|
|
517
|
+
};
|
|
518
|
+
/** @internal */
|
|
519
|
+
type ProposalGeometryRevision = Pick<ReturnType<AnchorReader['listRevisions']>[number], 'revisionId' | 'kind' | 'story' | 'range'>;
|
|
520
|
+
/** @internal */
|
|
521
|
+
type AnchorGeometryTarget = {
|
|
522
|
+
kind: 'proposal';
|
|
523
|
+
id: string;
|
|
524
|
+
} | {
|
|
525
|
+
kind: 'revision';
|
|
526
|
+
revisionId: string;
|
|
527
|
+
} | {
|
|
528
|
+
kind: 'paragraph';
|
|
529
|
+
paragraph: DocxParagraphAnchor;
|
|
530
|
+
} | {
|
|
531
|
+
kind: 'search';
|
|
532
|
+
paragraph: DocxParagraphAnchor;
|
|
533
|
+
text: string;
|
|
534
|
+
occurrence?: DocxOccurrence;
|
|
535
|
+
} | {
|
|
536
|
+
kind: 'range';
|
|
537
|
+
version: string;
|
|
538
|
+
range: DocxTextRange;
|
|
539
|
+
};
|
|
540
|
+
/** @internal */
|
|
541
|
+
interface RawAnchorRange {
|
|
542
|
+
start: YrsLoc;
|
|
543
|
+
end: YrsLoc;
|
|
544
|
+
}
|
|
545
|
+
type AnchorResolution = {
|
|
546
|
+
ok: true;
|
|
547
|
+
ranges: RawAnchorRange[];
|
|
548
|
+
paragraph: YrsLoc;
|
|
549
|
+
} | AnchorResolutionFailure;
|
|
550
|
+
/** @internal */
|
|
551
|
+
declare function anchorFailure(code: AnchorResolutionFailure['failure']['code'], message: string): AnchorResolutionFailure;
|
|
552
|
+
/** @internal */
|
|
553
|
+
declare function isBodyStory(story: string): boolean;
|
|
554
|
+
/** @internal */
|
|
555
|
+
declare function textRangeToRaw(segments: readonly YrsStorySegment[], range: DocxTextRange): {
|
|
556
|
+
ok: true;
|
|
557
|
+
range: RawAnchorRange;
|
|
558
|
+
} | AnchorResolutionFailure;
|
|
559
|
+
/** @internal */
|
|
560
|
+
declare function hiddenRanges(session: AnchorReader, version: string, snapshot: DocxProposalSnapshot | null, revisions?: readonly ProposalGeometryRevision[]): RawAnchorRange[];
|
|
561
|
+
/** @internal */
|
|
562
|
+
declare function resolveAnchorTarget(session: AnchorReader, target: AnchorGeometryTarget, version: string, snapshot?: DocxProposalSnapshot | null, proposalRevisions?: readonly ProposalGeometryRevision[]): AnchorResolution;
|
|
563
|
+
/** @internal */
|
|
564
|
+
interface ProposalDisplayTarget {
|
|
565
|
+
ranges: {
|
|
566
|
+
from: number;
|
|
567
|
+
to: number;
|
|
568
|
+
}[];
|
|
569
|
+
paragraph: number | null;
|
|
570
|
+
}
|
|
571
|
+
/** @internal */
|
|
572
|
+
type ProposalGeometryTarget = ({
|
|
573
|
+
ok: true;
|
|
574
|
+
} & ProposalDisplayTarget) | AnchorResolutionFailure;
|
|
575
|
+
/** @internal */
|
|
576
|
+
interface ProposalGeometryMirror {
|
|
577
|
+
version: string;
|
|
578
|
+
previewVersion: number;
|
|
579
|
+
proposals: string;
|
|
580
|
+
targets: Record<string, ProposalGeometryTarget>;
|
|
581
|
+
navigationTargets?: Record<string, ReturnType<typeof resolveNavigationTarget>>;
|
|
582
|
+
hidden: {
|
|
583
|
+
from: number;
|
|
584
|
+
to: number;
|
|
585
|
+
}[];
|
|
586
|
+
}
|
|
587
|
+
/** @internal */
|
|
588
|
+
declare function proposalSetIdentity(snapshot: DocxProposalSnapshot): string;
|
|
589
|
+
/** @internal */
|
|
590
|
+
declare function computeProposalGeometryMirror(reader: ProposalGeometryReader, snapshot: DocxProposalSnapshot, includeNavigationTargets?: boolean): ProposalGeometryMirror;
|
|
591
|
+
/** @internal */
|
|
592
|
+
declare function resolveMirroredNavigationTarget(mirror: ProposalGeometryMirror | null, snapshot: DocxProposalSnapshot, story: string, paraId: string): ReturnType<typeof resolveNavigationTarget> | null;
|
|
593
|
+
/** @internal */
|
|
594
|
+
declare function resolveNavigationTarget(reader: ProposalGeometryReader, story: string, paraId: string): {
|
|
595
|
+
loc: YrsLoc;
|
|
596
|
+
position: number;
|
|
597
|
+
} | 'missing-target' | 'ambiguous-target' | 'unsupported';
|
|
598
|
+
|
|
599
|
+
/** @internal */
|
|
600
|
+
type ResidentProposalOperation = {
|
|
601
|
+
kind: 'propose';
|
|
602
|
+
request: DocxProposalRequest;
|
|
603
|
+
} | {
|
|
604
|
+
kind: 'setStates';
|
|
605
|
+
request: DocxProposalStateRequest;
|
|
606
|
+
} | {
|
|
607
|
+
kind: 'withdraw';
|
|
608
|
+
request: DocxProposalWithdrawRequest;
|
|
609
|
+
} | {
|
|
610
|
+
kind: 'snapshot';
|
|
611
|
+
};
|
|
612
|
+
/** @internal */
|
|
613
|
+
interface ResidentProposalResponse {
|
|
614
|
+
result?: DocxProposalResult;
|
|
615
|
+
mirror: {
|
|
616
|
+
version: string;
|
|
617
|
+
proposals: DocxProposalRegistryState;
|
|
618
|
+
};
|
|
619
|
+
changedStories: string[];
|
|
620
|
+
updates: ArrayBuffer[];
|
|
621
|
+
stateVector: ArrayBuffer;
|
|
622
|
+
geometry: ProposalGeometryMirror;
|
|
623
|
+
fontRequirements?: {
|
|
624
|
+
layoutInput: string;
|
|
625
|
+
requirementsJson: string;
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
/** @internal */
|
|
629
|
+
type ResidentDocumentRead = {
|
|
630
|
+
kind: 'paragraphIdentities';
|
|
631
|
+
} | {
|
|
632
|
+
kind: 'resolveParagraphAnchors';
|
|
633
|
+
anchors: DocxParagraphAnchor[];
|
|
634
|
+
} | {
|
|
635
|
+
kind: 'readParagraphs';
|
|
636
|
+
request: DocxReadParagraphsRequest;
|
|
637
|
+
} | {
|
|
638
|
+
kind: 'searchText';
|
|
639
|
+
query: string;
|
|
640
|
+
caseSensitive: boolean;
|
|
641
|
+
carry?: YrsStickyPosition | null;
|
|
642
|
+
} | {
|
|
643
|
+
kind: 'stickyAnchors';
|
|
644
|
+
locs: YrsLoc[];
|
|
645
|
+
version: string;
|
|
646
|
+
} | {
|
|
647
|
+
kind: 'navigationTarget';
|
|
648
|
+
story: string;
|
|
649
|
+
paraId: string;
|
|
650
|
+
};
|
|
651
|
+
/** @internal */
|
|
652
|
+
interface ResidentDocumentReadValues {
|
|
653
|
+
paragraphIdentities: DocxParagraphIdentitySnapshot;
|
|
654
|
+
resolveParagraphAnchors: {
|
|
655
|
+
results: DocxParagraphAnchorResult[];
|
|
656
|
+
};
|
|
657
|
+
readParagraphs: DocxReadParagraphsResult;
|
|
658
|
+
navigationTarget: ReturnType<typeof resolveNavigationTarget>;
|
|
659
|
+
searchText: ResidentSearchResult;
|
|
660
|
+
stickyAnchors: Array<YrsStickyPosition | null>;
|
|
661
|
+
}
|
|
662
|
+
/** @internal */
|
|
663
|
+
type ResidentEngineWorkerHostModule = {
|
|
664
|
+
type: 'editModule';
|
|
665
|
+
module: WebAssembly.Module | null;
|
|
666
|
+
};
|
|
370
667
|
type ResidentEngineWorkerRequest = {
|
|
371
668
|
id: number;
|
|
372
669
|
type: 'warm';
|
|
670
|
+
hostModule?: true;
|
|
373
671
|
} | {
|
|
374
672
|
id: number;
|
|
375
673
|
type: 'bootstrap';
|
|
@@ -404,6 +702,11 @@ type ResidentEngineWorkerRequest = {
|
|
|
404
702
|
generation?: string;
|
|
405
703
|
/** The most the worker's editing core may allocate at once. */
|
|
406
704
|
heapLimitBytes?: number;
|
|
705
|
+
/**
|
|
706
|
+
* Opens a display-only preview of the first `previewBlocks` body blocks instead. A later
|
|
707
|
+
* `open` of the whole document replaces it.
|
|
708
|
+
*/
|
|
709
|
+
previewBlocks?: number;
|
|
407
710
|
} | {
|
|
408
711
|
id: number;
|
|
409
712
|
type: 'fontRequirements';
|
|
@@ -411,6 +714,17 @@ type ResidentEngineWorkerRequest = {
|
|
|
411
714
|
} | {
|
|
412
715
|
id: number;
|
|
413
716
|
type: 'encodeState';
|
|
717
|
+
} | {
|
|
718
|
+
id: number;
|
|
719
|
+
type: 'revisionCount';
|
|
720
|
+
} | {
|
|
721
|
+
id: number;
|
|
722
|
+
type: 'proposal';
|
|
723
|
+
operation: ResidentProposalOperation;
|
|
724
|
+
} | {
|
|
725
|
+
id: number;
|
|
726
|
+
type: 'documentRead';
|
|
727
|
+
read: ResidentDocumentRead;
|
|
414
728
|
} | {
|
|
415
729
|
id: number;
|
|
416
730
|
type: 'sync';
|
|
@@ -426,12 +740,23 @@ type ResidentEngineWorkerRequest = {
|
|
|
426
740
|
layoutExtras?: string;
|
|
427
741
|
displayWindow?: [number, number];
|
|
428
742
|
retainBuiltPages?: boolean;
|
|
743
|
+
provisionalPages?: number;
|
|
429
744
|
} | {
|
|
430
745
|
id: number;
|
|
431
746
|
type: 'buildPages';
|
|
432
747
|
pages: number[];
|
|
433
748
|
expectedFrameEpoch: number;
|
|
434
749
|
paintCaret: boolean;
|
|
750
|
+
background?: boolean;
|
|
751
|
+
} | {
|
|
752
|
+
id: number;
|
|
753
|
+
type: 'releasePages';
|
|
754
|
+
pages: Array<{
|
|
755
|
+
index: number;
|
|
756
|
+
pageId: string;
|
|
757
|
+
}>;
|
|
758
|
+
expectedFrameEpoch: number;
|
|
759
|
+
paintCaret: boolean;
|
|
435
760
|
} | {
|
|
436
761
|
id: number;
|
|
437
762
|
type: 'completeLayout';
|
|
@@ -498,6 +823,9 @@ type ResidentEngineWorkerResponse = ({
|
|
|
498
823
|
id: number;
|
|
499
824
|
ok: true;
|
|
500
825
|
frame?: ArrayBuffer;
|
|
826
|
+
pageFrames?: ArrayBuffer[];
|
|
827
|
+
pageBuildSuperseded?: boolean;
|
|
828
|
+
superseded?: true;
|
|
501
829
|
updates?: ArrayBuffer[];
|
|
502
830
|
engineMs?: number;
|
|
503
831
|
workerTotalMs?: number;
|
|
@@ -520,10 +848,24 @@ type ResidentEngineWorkerResponse = ({
|
|
|
520
848
|
layoutProvisional?: boolean;
|
|
521
849
|
/** An `open` reply: the opened package's host metadata JSON. */
|
|
522
850
|
hostJson?: string;
|
|
851
|
+
/** An `open` reply: the package cannot open as a preview; nothing was opened. */
|
|
852
|
+
previewRefused?: boolean;
|
|
523
853
|
/** A `fontRequirements` reply. */
|
|
524
854
|
requirementsJson?: string;
|
|
525
855
|
/** An `encodeState` reply: the document state as one yrs v1 update. */
|
|
526
856
|
state?: ArrayBuffer;
|
|
857
|
+
revisionCount?: number;
|
|
858
|
+
/** @internal */
|
|
859
|
+
proposals?: DocxProposalRegistryState;
|
|
860
|
+
/** @internal */
|
|
861
|
+
version?: string;
|
|
862
|
+
/** @internal */
|
|
863
|
+
proposal?: ResidentProposalResponse;
|
|
864
|
+
/** @internal */
|
|
865
|
+
read?: {
|
|
866
|
+
version: string;
|
|
867
|
+
value: unknown;
|
|
868
|
+
};
|
|
527
869
|
} | {
|
|
528
870
|
id: number;
|
|
529
871
|
ok: false;
|
|
@@ -538,8 +880,14 @@ type ResidentEngineWorkerResponse = ({
|
|
|
538
880
|
memory?: WasmModuleMemory[];
|
|
539
881
|
};
|
|
540
882
|
|
|
883
|
+
/** @internal */
|
|
884
|
+
interface ResidentProposalReply extends Omit<ResidentProposalResponse, 'updates' | 'stateVector'> {
|
|
885
|
+
updates: Uint8Array[];
|
|
886
|
+
stateVector: Uint8Array;
|
|
887
|
+
}
|
|
541
888
|
interface ResidentEngineWorkerFrame {
|
|
542
889
|
frame: Uint8Array;
|
|
890
|
+
pageFrames?: Uint8Array[];
|
|
543
891
|
updates: Uint8Array[];
|
|
544
892
|
engineMs: number;
|
|
545
893
|
workerTotalMs: number;
|
|
@@ -564,7 +912,7 @@ interface ResidentEngineWorkerLayoutOptions {
|
|
|
564
912
|
layoutExtras?: string;
|
|
565
913
|
/** The host state vector the snapshot brings the worker to. */
|
|
566
914
|
stateVector?: Uint8Array;
|
|
567
|
-
/**
|
|
915
|
+
/** Lay out just the body's first pages before replying. */
|
|
568
916
|
provisionalPages?: number;
|
|
569
917
|
/** Bootstrap only: lay out the document {@link ResidentEngineWorkerClient.open} opened. */
|
|
570
918
|
opened?: boolean;
|
|
@@ -599,7 +947,7 @@ interface ResidentEngineWorkerPort {
|
|
|
599
947
|
onmessage: ((event: MessageEvent<ResidentEngineWorkerResponse>) => void) | null;
|
|
600
948
|
onerror: ((event: ErrorEvent) => void) | null;
|
|
601
949
|
onmessageerror: ((event: MessageEvent) => void) | null;
|
|
602
|
-
postMessage(message: ResidentEngineWorkerRequest, transfer?: Transferable[]): void;
|
|
950
|
+
postMessage(message: ResidentEngineWorkerRequest | ResidentEngineWorkerHostModule, transfer?: Transferable[]): void;
|
|
603
951
|
terminate(): void;
|
|
604
952
|
}
|
|
605
953
|
/** Dedicated-worker owner for resident input, pagination, and FrameDelta output. */
|
|
@@ -617,13 +965,17 @@ declare class ResidentEngineWorkerClient {
|
|
|
617
965
|
/** Set once `open` is sent, with the heap limit it opened under. */
|
|
618
966
|
private openedHeapLimit;
|
|
619
967
|
private bootstraps;
|
|
968
|
+
/** The font-requirements read still in flight, shared while nothing was posted after it. */
|
|
969
|
+
private fontRead;
|
|
620
970
|
/** Id of the last snapshot request sent; replies to earlier requests must
|
|
621
971
|
* not replace the state it recorded. */
|
|
622
972
|
private lastSnapshotId;
|
|
623
973
|
private keepSurfaces;
|
|
974
|
+
private bootstrapWaiters;
|
|
624
975
|
private lastMemory;
|
|
625
976
|
private answeredFrameEpoch;
|
|
626
977
|
private retainBuiltPages;
|
|
978
|
+
private failureListener;
|
|
627
979
|
constructor(worker?: ResidentEngineWorkerPort);
|
|
628
980
|
isReady(): boolean;
|
|
629
981
|
/** @internal */
|
|
@@ -635,7 +987,9 @@ declare class ResidentEngineWorkerClient {
|
|
|
635
987
|
answeredFrame(): number;
|
|
636
988
|
/** @internal */
|
|
637
989
|
setRetainBuiltPages(retain: boolean): void;
|
|
638
|
-
/** @internal
|
|
990
|
+
/** @internal Called once when the worker fails, whether or not a request was waiting; not on `destroy`. */
|
|
991
|
+
onFailure(listener: ((error: Error) => void) | null): void;
|
|
992
|
+
/** @internal Whether foreground document or frame work awaits its reply. */
|
|
639
993
|
frameRequestPending(): boolean;
|
|
640
994
|
/** The worker replica's last reported yrs state vector (null before any). */
|
|
641
995
|
remoteStateVector(): Uint8Array | null;
|
|
@@ -643,6 +997,8 @@ declare class ResidentEngineWorkerClient {
|
|
|
643
997
|
syncedFontsRevision(): number | null;
|
|
644
998
|
/** A bootstrap was sent; later snapshots go as syncs queued behind it. */
|
|
645
999
|
bootstrapSent(): boolean;
|
|
1000
|
+
/** Resolves once a bootstrap is sent, at once when one was. */
|
|
1001
|
+
whenBootstrapSent(): Promise<void>;
|
|
646
1002
|
/**
|
|
647
1003
|
* Starts over with another document in the same worker: the next request
|
|
648
1004
|
* is a bootstrap, which keeps the page surfaces already attached so the
|
|
@@ -659,10 +1015,35 @@ declare class ResidentEngineWorkerClient {
|
|
|
659
1015
|
generation?: string;
|
|
660
1016
|
heapLimitBytes?: number;
|
|
661
1017
|
}): Promise<ResidentEngineWorkerOpened>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Opens a display-only preview of the first `blocks` body blocks of a DOCX in the worker, or
|
|
1020
|
+
* resolves null when the package cannot open as a preview. Its first layout is a bootstrap
|
|
1021
|
+
* with `opened`; {@link rebootstrap} then lets {@link open} replace it with the whole document.
|
|
1022
|
+
* A copy of `bytes` is transferred.
|
|
1023
|
+
*/
|
|
1024
|
+
openPreview(bytes: Uint8Array, blocks: number, options?: {
|
|
1025
|
+
heapLimitBytes?: number;
|
|
1026
|
+
}): Promise<ResidentEngineWorkerOpened | null>;
|
|
662
1027
|
/** The font requirements of a region layout request, read from the opened document. */
|
|
663
1028
|
fontRequirements(layoutInput: string): Promise<string>;
|
|
1029
|
+
/** @internal */
|
|
1030
|
+
proposal(operation: ResidentProposalOperation): Promise<ResidentProposalReply>;
|
|
1031
|
+
/** @internal */
|
|
1032
|
+
documentRead<K extends ResidentDocumentRead['kind']>(read: ResidentDocumentRead & {
|
|
1033
|
+
kind: K;
|
|
1034
|
+
}): Promise<{
|
|
1035
|
+
version: string;
|
|
1036
|
+
value: ResidentDocumentReadValues[K];
|
|
1037
|
+
}>;
|
|
1038
|
+
/** @internal */
|
|
1039
|
+
handOver(): Promise<{
|
|
1040
|
+
state: Uint8Array;
|
|
1041
|
+
version: string;
|
|
1042
|
+
proposals: DocxProposalRegistryState;
|
|
1043
|
+
}>;
|
|
664
1044
|
/** The worker's whole document state as one yrs v1 update. */
|
|
665
1045
|
encodeState(): Promise<Uint8Array>;
|
|
1046
|
+
revisionCount(): Promise<number>;
|
|
666
1047
|
warm(): Promise<void>;
|
|
667
1048
|
bootstrap(snapshot: YrsResidentWorkerSnapshot, extras: string, options?: ResidentEngineWorkerLayoutOptions & ResidentEngineWorkerSnapshotOptions): Promise<ResidentEngineWorkerFrame>;
|
|
668
1049
|
sync(snapshot: YrsResidentWorkerSnapshot, extras: string, expectedFrameEpoch: number, paintCaret?: boolean, options?: ResidentEngineWorkerLayoutOptions & ResidentEngineWorkerSnapshotOptions): Promise<ResidentEngineWorkerFrame>;
|
|
@@ -674,6 +1055,14 @@ declare class ResidentEngineWorkerClient {
|
|
|
674
1055
|
buildFrame(extras: string, expectedFrameEpoch: number, paintCaret?: boolean, displayWindow?: [number, number]): Promise<ResidentEngineWorkerFrame>;
|
|
675
1056
|
/** Build unbuilt display pages; the reply frame carries them. */
|
|
676
1057
|
buildPages(pages: number[], expectedFrameEpoch: number, paintCaret?: boolean): Promise<ResidentEngineWorkerFrame>;
|
|
1058
|
+
/** @internal */
|
|
1059
|
+
buildPages(pages: number[], expectedFrameEpoch: number, paintCaret: boolean, background: boolean): Promise<ResidentEngineWorkerFrame | null>;
|
|
1060
|
+
releasePages(pages: Array<{
|
|
1061
|
+
index: number;
|
|
1062
|
+
pageId: string;
|
|
1063
|
+
}>, expectedFrameEpoch: number, paintCaret?: boolean): Promise<ResidentEngineWorkerFrame | {
|
|
1064
|
+
superseded: true;
|
|
1065
|
+
}>;
|
|
677
1066
|
applyInput(text: string, selection: YrsSelection, expectedFrameEpoch: number, profile?: boolean, paintCaret?: boolean, displayWindow?: [number, number]): Promise<ResidentEngineWorkerApplyResult | {
|
|
678
1067
|
applied: false;
|
|
679
1068
|
}>;
|
|
@@ -743,6 +1132,12 @@ declare function documentToYrs(session: YrsSession, document: Document, options?
|
|
|
743
1132
|
|
|
744
1133
|
/** yrs-to-OOXML save projection. */
|
|
745
1134
|
|
|
1135
|
+
/**
|
|
1136
|
+
* `blocks` with paragraphs of their own, in table cells too, each still the
|
|
1137
|
+
* session paragraph it was projected from: a save edits these, not the
|
|
1138
|
+
* projection the next one reuses. @internal
|
|
1139
|
+
*/
|
|
1140
|
+
declare function ownProjectedParagraphs(blocks: readonly BlockContent[]): BlockContent[];
|
|
746
1141
|
/**
|
|
747
1142
|
* Rebuild all yrs-owned editable stories into the serializer-facing Document
|
|
748
1143
|
* while preserving every package part the editor does not own.
|
|
@@ -795,11 +1190,13 @@ declare function captureSessionSave(session: YrsSession): DocxSessionSave;
|
|
|
795
1190
|
/**
|
|
796
1191
|
* Writes `document`, projected from `session` when `capture` was taken, and
|
|
797
1192
|
* records the Word paragraph IDs the bytes hold as saved. `patches` selects
|
|
798
|
-
* the planned parts written as `originalBuffer`'s bytes with IDs patched in
|
|
799
|
-
*
|
|
1193
|
+
* the planned parts written as `originalBuffer`'s bytes with IDs patched in,
|
|
1194
|
+
* and `splices` the story parts written as its bytes with only the
|
|
1195
|
+
* paragraphs that need it re-serialized; each selects none unless
|
|
1196
|
+
* `originalBuffer` is the session's source package.
|
|
800
1197
|
* @internal
|
|
801
1198
|
*/
|
|
802
|
-
declare function writeSessionSave(session: YrsSession, document: Document, capture: DocxSessionSave, originalBuffer: ArrayBuffer, options?: RepackOptions, patches?: (part: string) => boolean): Promise<DocxSavedDocument>;
|
|
1199
|
+
declare function writeSessionSave(session: YrsSession, document: Document, capture: DocxSessionSave, originalBuffer: ArrayBuffer, options?: RepackOptions, patches?: (part: string) => boolean, skipMutations?: boolean, splices?: (part: string) => boolean): Promise<DocxSavedDocument>;
|
|
803
1200
|
/**
|
|
804
1201
|
* Saves a session opened from DOCX bytes and reports each saved paragraph's
|
|
805
1202
|
* persisted anchor, read from the same projection the bytes are written
|
|
@@ -815,6 +1212,21 @@ declare function writeSessionSave(session: YrsSession, document: Document, captu
|
|
|
815
1212
|
*/
|
|
816
1213
|
declare function saveYrsDocx(session: YrsSession, options?: RepackOptions): Promise<DocxSavedDocument>;
|
|
817
1214
|
|
|
1215
|
+
/** @internal */
|
|
1216
|
+
declare function editorSaveKeys(document: Document, comments?: readonly Comment[]): {
|
|
1217
|
+
metadata: string;
|
|
1218
|
+
comments: string;
|
|
1219
|
+
commentIds: number[];
|
|
1220
|
+
};
|
|
1221
|
+
|
|
1222
|
+
/** Engine operations the package runs on sessions it creates itself; not public API. */
|
|
1223
|
+
|
|
1224
|
+
/** Returns the session's opened source package when available. @internal */
|
|
1225
|
+
declare function sessionSourcePackage(session: YrsSession): {
|
|
1226
|
+
buffer: ArrayBuffer;
|
|
1227
|
+
keys: ReturnType<typeof editorSaveKeys>;
|
|
1228
|
+
} | null;
|
|
1229
|
+
|
|
818
1230
|
interface YrsDocxHost {
|
|
819
1231
|
document: Document;
|
|
820
1232
|
referencedFonts: string[];
|
|
@@ -825,6 +1237,8 @@ interface YrsDocxHost {
|
|
|
825
1237
|
* preview's cover only its own first pages.
|
|
826
1238
|
*/
|
|
827
1239
|
unusedScriptFonts?: string[];
|
|
1240
|
+
/** A preview whose cut holds the whole body. */
|
|
1241
|
+
wholeBody?: true;
|
|
828
1242
|
embeddedFonts: Map<string, ArrayBuffer>;
|
|
829
1243
|
fontTableRelationshipsXml?: string;
|
|
830
1244
|
}
|
|
@@ -1298,6 +1712,8 @@ type YrsResidentFontRegistration = Uint8Array | {
|
|
|
1298
1712
|
family: string;
|
|
1299
1713
|
};
|
|
1300
1714
|
interface YrsResidentWorkerSnapshot {
|
|
1715
|
+
/** @internal */
|
|
1716
|
+
workerAuthoritative?: true;
|
|
1301
1717
|
clientId: number;
|
|
1302
1718
|
/** Full document state, or a state-vector diff when the caller supplied
|
|
1303
1719
|
* the worker's known vector — both apply through the same merge path. */
|
|
@@ -1500,6 +1916,11 @@ interface YrsMediaSource {
|
|
|
1500
1916
|
bytes: Uint8Array;
|
|
1501
1917
|
mimeType: string;
|
|
1502
1918
|
}
|
|
1919
|
+
/** @internal */
|
|
1920
|
+
interface YrsWorkerDocumentMirror {
|
|
1921
|
+
version: string;
|
|
1922
|
+
proposals: DocxProposalRegistryState;
|
|
1923
|
+
}
|
|
1503
1924
|
interface YrsSession extends CollaborationReplica {
|
|
1504
1925
|
/** The yrs client id this replica writes with. */
|
|
1505
1926
|
readonly clientId: number;
|
|
@@ -1555,8 +1976,12 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1555
1976
|
setDisplayWindow(start: number, end: number): void;
|
|
1556
1977
|
/** Keep every previously built page while windowed builds are on. @internal */
|
|
1557
1978
|
setDisplayRetainBuiltPages(retain: boolean): void;
|
|
1979
|
+
/** @internal */
|
|
1980
|
+
setWindowedIncrementalBuilds(enabled: boolean): void;
|
|
1558
1981
|
/** Build the listed unbuilt pages into a FrameDelta v1. @internal */
|
|
1559
1982
|
buildDisplayPagesFrame(pages: readonly number[], expectedFrameEpoch: number): Uint8Array;
|
|
1983
|
+
/** Release built pages; null means the request was superseded. @internal */
|
|
1984
|
+
releaseDisplayPagesFrame(pages: number[], expectedFrameEpoch: number): Uint8Array | null;
|
|
1560
1985
|
/** Make the next frame a full one, for a host taking over from another engine; no-op once destroyed. */
|
|
1561
1986
|
resetFrameBase(): void;
|
|
1562
1987
|
/** Caret geometry from the current resident display frame. */
|
|
@@ -1619,6 +2044,11 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1619
2044
|
openDocxPreview(bytes: Uint8Array, blocks: number): YrsDocxHost | null;
|
|
1620
2045
|
/** Opened by {@link openDocxPreview}: its document refuses every change. @internal */
|
|
1621
2046
|
isDisplayOnly(): boolean;
|
|
2047
|
+
/**
|
|
2048
|
+
* Marks this empty session as showing a preview another engine opened: it refuses every
|
|
2049
|
+
* change, and {@link openDocxPreview} can still load the preview here. @internal
|
|
2050
|
+
*/
|
|
2051
|
+
markDisplayOnly(): void;
|
|
1622
2052
|
/**
|
|
1623
2053
|
* Marks whether the document is a preview's, as a replica of one is: its
|
|
1624
2054
|
* layouts render NUMPAGES empty. @internal
|
|
@@ -1668,6 +2098,8 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1668
2098
|
applyUpdate(update: Uint8Array): CollaborationTextInsertion | null;
|
|
1669
2099
|
/** Apply a same-user worker update under the local undo origin. @internal */
|
|
1670
2100
|
applyLocalUpdate(update: Uint8Array): void;
|
|
2101
|
+
/** Adopt another replica's host batch outside undo history. @internal */
|
|
2102
|
+
applyHostUpdate(update: Uint8Array, stories?: readonly string[]): void;
|
|
1671
2103
|
/**
|
|
1672
2104
|
* Subscribes to every committed transaction's v1 update (local AND
|
|
1673
2105
|
* applied-remote). Returns an unsubscribe function.
|
|
@@ -1802,7 +2234,10 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1802
2234
|
* promotes an editor-only paragraph they author into.
|
|
1803
2235
|
*/
|
|
1804
2236
|
applyRawOps(story: string, ops: readonly YrsRawOp[]): void;
|
|
1805
|
-
/**
|
|
2237
|
+
/**
|
|
2238
|
+
* Applies seed raw operations with deterministic item ordering. A
|
|
2239
|
+
* `setComment` for a comment already seeded adds its ranges to it.
|
|
2240
|
+
*/
|
|
1806
2241
|
applySeedRawOps(story: string, ops: readonly YrsRawOp[]): void;
|
|
1807
2242
|
/** Sets one paragraph property (any JSON value). `paraId` is reserved. */
|
|
1808
2243
|
setParagraphAttr(paraId: string, key: string, value: unknown): void;
|
|
@@ -1873,6 +2308,8 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1873
2308
|
tablePayload(story: string, tableIndex: number): Record<string, unknown> | null;
|
|
1874
2309
|
/** A paragraph's story span (start unit, pilcrow index). */
|
|
1875
2310
|
locateParagraph(story: string, paraId: string): YrsParagraphSpan;
|
|
2311
|
+
/** How many paragraphs of `story` carry `paraId`: 0, 1, or 2 for two or more. */
|
|
2312
|
+
paragraphIdCount(story: string, paraId: string): number;
|
|
1876
2313
|
/**
|
|
1877
2314
|
* Session, persisted and source anchors of every paragraph, including the
|
|
1878
2315
|
* source package's paragraphs outside the stories, and the Word paragraph ID
|
|
@@ -1950,6 +2387,10 @@ interface YrsSession extends CollaborationReplica {
|
|
|
1950
2387
|
withdrawProposals(request: DocxProposalWithdrawRequest): DocxProposalResult;
|
|
1951
2388
|
/** The proposals in the order they were made. */
|
|
1952
2389
|
getProposals(): DocxProposalSnapshot;
|
|
2390
|
+
/** @internal */
|
|
2391
|
+
mirrorWorkerDocument(mirror: YrsWorkerDocumentMirror | null): void;
|
|
2392
|
+
/** @internal */
|
|
2393
|
+
workerDocumentMirrored(): boolean;
|
|
1953
2394
|
/** Listens for new proposals, decisions and a forgotten registry. Returns the unsubscribe. */
|
|
1954
2395
|
onProposalChange(listener: (snapshot: DocxProposalSnapshot) => void): () => void;
|
|
1955
2396
|
/**
|
|
@@ -2023,4 +2464,4 @@ declare function decodeDocxHostJson(json: string, source: Uint8Array): YrsDocxHo
|
|
|
2023
2464
|
*/
|
|
2024
2465
|
declare function createYrsSession(options?: CreateYrsSessionOptions): Promise<YrsSession>;
|
|
2025
2466
|
|
|
2026
|
-
export { type
|
|
2467
|
+
export { type DocxSavedDocument as $, type AnchorGeometryTarget as A, type DocxParagraphAnchor as B, type CollaborationReplica as C, type DocxOccurrence as D, type DocxParagraphAnchorResult as E, type DocxParagraphIdAssignment as F, type DocxParagraphIdDiagnostic as G, type DocxParagraphIdOrigin as H, type DocxParagraphIdRefusal as I, type DocxParagraphIdentity as J, type DocxParagraphIdentityReceipt as K, type DocxParagraphIdentitySnapshot as L, type DocxParagraphOrigin as M, type DocxParagraphRef as N, type DocxParagraphSavePlan as O, type DocxPersistedParagraphAnchor as P, type DocxProposalFailure as Q, type DocxProposalInput as R, type DocxProposalRecord as S, type DocxProposalRegistryState as T, type DocxProposalRequest as U, type DocxProposalResult as V, type DocxProposalSnapshot as W, type DocxProposalState as X, type YrsSession as Y, type DocxProposalStateRequest as Z, type DocxProposalWithdrawRequest as _, type YrsRenderEnv as a, type YrsResolvedCommentAnchor as a$, type DocxSavedParagraph as a0, type DocxSessionParagraphAnchor as a1, type DocxSessionSave as a2, type DocxSourceParagraphAnchor as a3, type DocxSourceStory as a4, type ProposalDisplayTarget as a5, type ProposalGeometryMirror as a6, type ProposalGeometryReader as a7, type ProposalGeometryRevision as a8, type ProposalGeometryTarget as a9, type YrsLocProjection as aA, type YrsMediaSource 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 YrsPointerProjectionTarget as aM, type YrsPositionOutline as aN, YrsPositionProjection as aO, type YrsProjectedCell as aP, type YrsProjectedNode as aQ, type YrsProjectedTable as aR, type YrsRawOp as aS, type YrsRegionLayoutProgress as aT, type YrsReplaceReceipt as aU, type YrsResidentCaretRect as aV, type YrsResidentCaretSnapshot as aW, type YrsResidentFontRegistration as aX, type YrsResidentWorkerSnapshot as aY, type YrsResidentWorkerSyncOptions as aZ, type YrsResolveReceipt as a_, type RawAnchorRange as aa, type ResidentCaretPaintStyle as ab, type ResidentEngineOffscreenPage as ac, type ResidentEngineWorkerApplyResult as ad, ResidentEngineWorkerClient as ae, type ResidentEngineWorkerFrame as af, type ResidentEngineWorkerOpened as ag, type ResidentProposalReply as ah, ResidentWorkerFailureError as ai, ResidentWorkerOutOfMemoryError as aj, type YrsAuthor as ak, type YrsCellBorder as al, type YrsCellBorders as am, type YrsCellLoc as an, type YrsChangeTarget as ao, type YrsCommentInfo as ap, type YrsCommentReceipt as aq, type YrsContentControlValue as ar, type YrsDocxHost as as, type YrsEngineApplyProfile as at, type YrsHyperlinkAttrs as au, type YrsImageGeometry as av, type YrsInlineFormatDelta as aw, type YrsInputParagraphSeed as ax, type YrsInputParagraphSpan as ay, type YrsInputPositionMap as az, type CollaborationTransport as b, type YrsRevisionReceipt as b0, type YrsRunMark as b1, type YrsSelectionContext as b2, type YrsSelectionText as b3, type YrsSplitReceipt as b4, type YrsStickyPosition as b5, type YrsStoryRange as b6, type YrsStorySeed as b7, type YrsStorySegmentSource as b8, type YrsTableLoc as b9, preloadDocxEngine as bA, preloadResidentEngineWorker as bB, prepareDocxBytes as bC, preparedDocxDigest as bD, projectYrsDisplayPosition as bE, proposalRevisionPreview as bF, proposalSetIdentity as bG, residentCaretDeviceRect as bH, residentCaretSnapshotForFrame as bI, resolveAnchorTarget as bJ, resolveMirroredNavigationTarget as bK, resolveNavigationTarget as bL, retainPreloadedResidentEngineWorker as bM, sameYrsSelection as bN, saveYrsDocx as bO, sessionSourcePackage as bP, takePreloadedResidentEngineWorker as bQ, textRangeToRaw as bR, writeSessionSave as bS, yrsLocToDisplayPosition as bT, yrsLocToProjectedDisplayPosition as bU, yrsToDocument as bV, type YrsTableRange as ba, type YrsTableReceipt as bb, type YrsTargetEditResult as bc, type YrsTextColor as bd, type YrsTextMatch as be, type YrsTextSearchOptions as bf, type YrsTriState as bg, type YrsUndoCaptureMode as bh, type YrsWatermark as bi, type YrsWorkerDocumentMirror as bj, anchorFailure as bk, canUseResidentEngineWorker as bl, captureSessionSave as bm, compareYrsLocs as bn, computeProposalGeometryMirror as bo, createYrsInputPositionMap as bp, createYrsLocProjectionFromOutline as bq, createYrsPositionProjection as br, createYrsSession as bs, decodeDocxHostJson as bt, displayPositionToYrsLoc as bu, documentToYrs as bv, editorSaveKeys as bw, hiddenRanges as bx, isBodyStory as by, ownProjectedParagraphs as bz, 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 YrsStorySegment as v, type YrsRevisionInfo as w, type AnchorReader as x, type AnchorResolutionFailure as y, type CreateYrsSessionOptions as z };
|