docxodus 10.0.0 → 11.0.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 +4 -4
- package/dist/docxodus.worker.js +6 -38
- package/dist/docxodus.worker.js.map +1 -1
- package/dist/editor.bundle.js +66 -4
- package/dist/embed.bundle.js +165 -128
- package/dist/embed.d.ts +1 -1
- package/dist/embed.iife.js +165 -128
- package/dist/embed.js +1 -1
- package/dist/export-assets.json +38 -44
- package/dist/export-browser.bundle.js +2 -3
- package/dist/index.d.ts +24 -63
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -134
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +4 -4
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js.map +1 -1
- package/dist/ribbon-chrome.d.ts +2 -2
- package/dist/ribbon-chrome.d.ts.map +1 -1
- package/dist/ribbon-chrome.js +27 -4
- package/dist/ribbon-chrome.js.map +1 -1
- package/dist/ribbon.js +49 -0
- package/dist/ribbon.js.map +1 -1
- package/dist/session.bundle.js +52 -0
- package/dist/session.d.ts +26 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +31 -0
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +81 -223
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -75
- package/dist/types.js.map +1 -1
- package/dist/wasm/_framework/DocumentFormat.OpenXml.Framework.wasm +0 -0
- package/dist/wasm/_framework/DocumentFormat.OpenXml.Framework.wasm.br +0 -0
- package/dist/wasm/_framework/DocumentFormat.OpenXml.wasm +0 -0
- package/dist/wasm/_framework/DocumentFormat.OpenXml.wasm.br +0 -0
- package/dist/wasm/_framework/Docxodus.wasm +0 -0
- package/dist/wasm/_framework/Docxodus.wasm.br +0 -0
- package/dist/wasm/_framework/DocxodusWasm.wasm +0 -0
- package/dist/wasm/_framework/DocxodusWasm.wasm.br +0 -0
- package/dist/wasm/_framework/System.Collections.Concurrent.wasm +0 -0
- package/dist/wasm/_framework/System.Collections.Concurrent.wasm.br +0 -0
- package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm +0 -0
- package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm.br +0 -0
- package/dist/wasm/_framework/System.IO.Compression.wasm +0 -0
- package/dist/wasm/_framework/System.IO.Compression.wasm.br +0 -0
- package/dist/wasm/_framework/System.IO.Packaging.wasm +0 -0
- package/dist/wasm/_framework/System.IO.Packaging.wasm.br +0 -0
- package/dist/wasm/_framework/System.IO.Pipelines.wasm +0 -0
- package/dist/wasm/_framework/System.IO.Pipelines.wasm.br +0 -0
- package/dist/wasm/_framework/System.Linq.wasm +0 -0
- package/dist/wasm/_framework/System.Linq.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.CoreLib.wasm +0 -0
- package/dist/wasm/_framework/System.Private.CoreLib.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.Uri.wasm +0 -0
- package/dist/wasm/_framework/System.Private.Uri.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.Xml.Linq.wasm +0 -0
- package/dist/wasm/_framework/System.Private.Xml.Linq.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.Xml.wasm +0 -0
- package/dist/wasm/_framework/System.Private.Xml.wasm.br +0 -0
- package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
- package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm.br +0 -0
- package/dist/wasm/_framework/System.Security.Cryptography.wasm +0 -0
- package/dist/wasm/_framework/System.Security.Cryptography.wasm.br +0 -0
- package/dist/wasm/_framework/System.Text.Encodings.Web.wasm +0 -0
- package/dist/wasm/_framework/System.Text.Encodings.Web.wasm.br +0 -0
- package/dist/wasm/_framework/System.Text.Json.wasm +0 -0
- package/dist/wasm/_framework/System.Text.Json.wasm.br +0 -0
- package/dist/wasm/_framework/System.Text.RegularExpressions.wasm +0 -0
- package/dist/wasm/_framework/System.Text.RegularExpressions.wasm.br +0 -0
- package/dist/wasm/_framework/dotnet.boot.js +31 -37
- package/dist/wasm/_framework/dotnet.boot.js.br +0 -0
- package/dist/wasm/_framework/dotnet.native.js +39 -3
- package/dist/wasm/_framework/dotnet.native.js.br +0 -0
- package/dist/wasm/_framework/dotnet.native.wasm +0 -0
- package/dist/wasm/_framework/dotnet.native.wasm.br +0 -0
- package/dist/worker-proxy.bundle.js +2 -3
- package/dist/worker-proxy.d.ts +2 -2
- package/dist/worker-proxy.d.ts.map +1 -1
- package/dist/worker-proxy.js +1 -2
- package/dist/worker-proxy.js.map +1 -1
- package/package.json +2 -2
- package/dist/wasm/_framework/System.Diagnostics.Process.wasm +0 -0
- package/dist/wasm/_framework/System.Diagnostics.Process.wasm.br +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -149,7 +149,10 @@ export interface MarkdownProjection {
|
|
|
149
149
|
anchorIndex: Record<string, MarkdownAnchorTarget>;
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
* Revision type enum matching the .NET
|
|
152
|
+
* Revision type enum matching the .NET `DocxDiffRevisionType`, as returned by the `docxDiff*`
|
|
153
|
+
* comparison APIs. NOT the shape {@link getRevisions} returns — that reads a document's own markup
|
|
154
|
+
* and reports the markup-level kind on `RevisionListEntry.type` (`ins`/`del`/`moveFrom`), with the
|
|
155
|
+
* grouped classification on `family`.
|
|
153
156
|
*/
|
|
154
157
|
export declare enum RevisionType {
|
|
155
158
|
/** Text or content that was added/inserted */
|
|
@@ -161,24 +164,6 @@ export declare enum RevisionType {
|
|
|
161
164
|
/** Text content unchanged but formatting (bold, italic, etc.) changed */
|
|
162
165
|
FormatChanged = "FormatChanged"
|
|
163
166
|
}
|
|
164
|
-
/**
|
|
165
|
-
* Which comparison engine {@link compareDocuments} / {@link compareDocumentsToHtml}
|
|
166
|
-
* use to redline two documents.
|
|
167
|
-
*
|
|
168
|
-
* The numeric values are the contract shared with the .NET `ComparisonEngine` enum
|
|
169
|
-
* and the WASM boundary (marshalled as an int); `0` remains
|
|
170
|
-
* {@link ComparisonEngine.WmlComparer} for wire compatibility. Omitted selectors use
|
|
171
|
-
* {@link ComparisonEngine.DocxDiff}.
|
|
172
|
-
*
|
|
173
|
-
* `DocxDiff` is the default comparison engine. `WmlComparer` remains available for
|
|
174
|
-
* callers that explicitly require its historical behavior.
|
|
175
|
-
*/
|
|
176
|
-
export declare enum ComparisonEngine {
|
|
177
|
-
/** The legacy WmlComparer engine (retained at wire value 0). */
|
|
178
|
-
WmlComparer = 0,
|
|
179
|
-
/** The default DocxDiff IR diff engine. */
|
|
180
|
-
DocxDiff = 1
|
|
181
|
-
}
|
|
182
167
|
/**
|
|
183
168
|
* Comment render mode
|
|
184
169
|
* Use -1 (Disabled) to not render comments, or a positive value to enable with that mode
|
|
@@ -306,8 +291,6 @@ export interface ConversionOptions {
|
|
|
306
291
|
export interface CompareOptions {
|
|
307
292
|
/** Author name for tracked changes (default: "Docxodus") */
|
|
308
293
|
authorName?: string;
|
|
309
|
-
/** Detail threshold 0.0-1.0 (default: 0.15, lower = more detailed) */
|
|
310
|
-
detailThreshold?: number;
|
|
311
294
|
/** Whether comparison is case-insensitive (default: false) */
|
|
312
295
|
caseInsensitive?: boolean;
|
|
313
296
|
/**
|
|
@@ -316,68 +299,6 @@ export interface CompareOptions {
|
|
|
316
299
|
* If false: changes are accepted, output shows final "clean" document
|
|
317
300
|
*/
|
|
318
301
|
renderTrackedChanges?: boolean;
|
|
319
|
-
/**
|
|
320
|
-
* Which comparison engine to use (default: {@link ComparisonEngine.DocxDiff}).
|
|
321
|
-
* Pass {@link ComparisonEngine.WmlComparer} only when its historical behavior is required.
|
|
322
|
-
*/
|
|
323
|
-
engine?: ComparisonEngine;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Information about a document revision extracted from a compared document.
|
|
327
|
-
*
|
|
328
|
-
* @example
|
|
329
|
-
* ```typescript
|
|
330
|
-
* const revisions = await getRevisions(comparedDoc);
|
|
331
|
-
* for (const rev of revisions) {
|
|
332
|
-
* if (rev.revisionType === RevisionType.Inserted) {
|
|
333
|
-
* console.log(`${rev.author} added: "${rev.text}"`);
|
|
334
|
-
* } else if (rev.revisionType === RevisionType.Deleted) {
|
|
335
|
-
* console.log(`${rev.author} removed: "${rev.text}"`);
|
|
336
|
-
* }
|
|
337
|
-
* }
|
|
338
|
-
* ```
|
|
339
|
-
*/
|
|
340
|
-
export interface Revision {
|
|
341
|
-
/**
|
|
342
|
-
* Author who made the revision.
|
|
343
|
-
* This comes from the Word document's tracked changes author attribute.
|
|
344
|
-
* May be empty string if the document doesn't specify an author.
|
|
345
|
-
*/
|
|
346
|
-
author: string;
|
|
347
|
-
/**
|
|
348
|
-
* ISO 8601 date string when the revision was made.
|
|
349
|
-
* Format: "YYYY-MM-DDTHH:mm:ssZ" (e.g., "2024-01-15T10:30:00Z")
|
|
350
|
-
* May be empty string if the document doesn't specify a date.
|
|
351
|
-
*/
|
|
352
|
-
date: string;
|
|
353
|
-
/**
|
|
354
|
-
* Type of revision - "Inserted", "Deleted", or "Moved".
|
|
355
|
-
* Use the RevisionType enum for type-safe comparisons.
|
|
356
|
-
*/
|
|
357
|
-
revisionType: RevisionType | string;
|
|
358
|
-
/**
|
|
359
|
-
* Text content of the revision.
|
|
360
|
-
* For paragraph breaks, this will be a newline character.
|
|
361
|
-
* May be empty string for non-text elements (e.g., images, math equations).
|
|
362
|
-
*/
|
|
363
|
-
text: string;
|
|
364
|
-
/**
|
|
365
|
-
* For Moved revisions, this ID links the source and destination.
|
|
366
|
-
* Both the "from" and "to" revisions share the same moveGroupId.
|
|
367
|
-
* Undefined for non-move revisions.
|
|
368
|
-
*/
|
|
369
|
-
moveGroupId?: number;
|
|
370
|
-
/**
|
|
371
|
-
* For Moved revisions: true = source (content moved FROM here),
|
|
372
|
-
* false = destination (content moved TO here).
|
|
373
|
-
* Undefined for non-move revisions.
|
|
374
|
-
*/
|
|
375
|
-
isMoveSource?: boolean;
|
|
376
|
-
/**
|
|
377
|
-
* For FormatChanged revisions: details about what formatting changed.
|
|
378
|
-
* Undefined for non-format-change revisions.
|
|
379
|
-
*/
|
|
380
|
-
formatChange?: FormatChangeDetails;
|
|
381
302
|
}
|
|
382
303
|
/**
|
|
383
304
|
* Which property container a FormatChanged revision describes.
|
|
@@ -417,7 +338,7 @@ export interface FormatChangeDetails {
|
|
|
417
338
|
export declare enum DocxDiffRevisionGranularity {
|
|
418
339
|
/** The engine's native one-revision-per-token-span grain (the default). */
|
|
419
340
|
Fine = 0,
|
|
420
|
-
/** Coalesced to
|
|
341
|
+
/** Coalesced to the coarser contiguous-region grain the legacy comparer reported. */
|
|
421
342
|
WmlComparerCompatible = 1
|
|
422
343
|
}
|
|
423
344
|
/**
|
|
@@ -549,6 +470,22 @@ export interface DocxDiffProducts {
|
|
|
549
470
|
/** The stable semantic-change schema (what `docxDiffGetSemanticChanges` returns). */
|
|
550
471
|
semanticChanges?: SemanticChangeSet;
|
|
551
472
|
}
|
|
473
|
+
/** One candidate of a {@link docxDiffCompareBatch} run: the products of comparing the shared
|
|
474
|
+
* baseline against it, or the error that comparing it produced. */
|
|
475
|
+
export interface DocxDiffBatchResult extends DocxDiffProducts {
|
|
476
|
+
/** The candidate's name, echoed from the request (its index when none was given). */
|
|
477
|
+
name: string;
|
|
478
|
+
/** Set when this candidate failed; its products are then absent. The rest of the batch is
|
|
479
|
+
* unaffected — one malformed counterparty markup must not cost the other ninety-nine. */
|
|
480
|
+
error?: string;
|
|
481
|
+
}
|
|
482
|
+
/** A candidate document for {@link docxDiffCompareBatch}. */
|
|
483
|
+
export interface DocxDiffBatchCandidate {
|
|
484
|
+
/** Echoed back on the matching result. Defaults to the candidate's index. */
|
|
485
|
+
name?: string;
|
|
486
|
+
/** The candidate document. */
|
|
487
|
+
document: File | Uint8Array;
|
|
488
|
+
}
|
|
552
489
|
/** Stable v1 operation names emitted by the semantic-change schema. */
|
|
553
490
|
export type SemanticChangeOperation = "insert" | "delete" | "move" | "modify";
|
|
554
491
|
/** Stable v1 semantic families. New schema versions may append families. */
|
|
@@ -675,7 +612,7 @@ export interface DocxDiffConsolidatedRevision extends DocxDiffRevision {
|
|
|
675
612
|
* const insertions = revisions.filter(isInsertion);
|
|
676
613
|
* ```
|
|
677
614
|
*/
|
|
678
|
-
export declare function isInsertion(revision:
|
|
615
|
+
export declare function isInsertion(revision: RevisionListEntry): boolean;
|
|
679
616
|
/**
|
|
680
617
|
* Type guard to check if a revision is a deletion.
|
|
681
618
|
* @param revision - The revision to check
|
|
@@ -687,7 +624,7 @@ export declare function isInsertion(revision: Revision): boolean;
|
|
|
687
624
|
* const deletions = revisions.filter(isDeletion);
|
|
688
625
|
* ```
|
|
689
626
|
*/
|
|
690
|
-
export declare function isDeletion(revision:
|
|
627
|
+
export declare function isDeletion(revision: RevisionListEntry): boolean;
|
|
691
628
|
/**
|
|
692
629
|
* Type guard to check if a revision is a move operation.
|
|
693
630
|
* @param revision - The revision to check
|
|
@@ -699,7 +636,7 @@ export declare function isDeletion(revision: Revision): boolean;
|
|
|
699
636
|
* const moves = revisions.filter(isMove);
|
|
700
637
|
* ```
|
|
701
638
|
*/
|
|
702
|
-
export declare function isMove(revision:
|
|
639
|
+
export declare function isMove(revision: RevisionListEntry): boolean;
|
|
703
640
|
/**
|
|
704
641
|
* Type guard to check if a revision is a format change.
|
|
705
642
|
* @param revision - The revision to check
|
|
@@ -714,47 +651,7 @@ export declare function isMove(revision: Revision): boolean;
|
|
|
714
651
|
* }
|
|
715
652
|
* ```
|
|
716
653
|
*/
|
|
717
|
-
export declare function isFormatChange(revision:
|
|
718
|
-
/**
|
|
719
|
-
* Type guard to check if a revision is a move source (content moved FROM here).
|
|
720
|
-
* @param revision - The revision to check
|
|
721
|
-
* @returns true if the revision is the source of a move
|
|
722
|
-
*
|
|
723
|
-
* @example
|
|
724
|
-
* ```typescript
|
|
725
|
-
* const revisions = await getRevisions(doc);
|
|
726
|
-
* const moveSources = revisions.filter(isMoveSource);
|
|
727
|
-
* ```
|
|
728
|
-
*/
|
|
729
|
-
export declare function isMoveSource(revision: Revision): boolean;
|
|
730
|
-
/**
|
|
731
|
-
* Type guard to check if a revision is a move destination (content moved TO here).
|
|
732
|
-
* @param revision - The revision to check
|
|
733
|
-
* @returns true if the revision is the destination of a move
|
|
734
|
-
*
|
|
735
|
-
* @example
|
|
736
|
-
* ```typescript
|
|
737
|
-
* const revisions = await getRevisions(doc);
|
|
738
|
-
* const moveDestinations = revisions.filter(isMoveDestination);
|
|
739
|
-
* ```
|
|
740
|
-
*/
|
|
741
|
-
export declare function isMoveDestination(revision: Revision): boolean;
|
|
742
|
-
/**
|
|
743
|
-
* Find the matching pair for a move revision.
|
|
744
|
-
* @param revision - A move revision
|
|
745
|
-
* @param allRevisions - All revisions from the document
|
|
746
|
-
* @returns The matching move revision, or undefined if not found
|
|
747
|
-
*
|
|
748
|
-
* @example
|
|
749
|
-
* ```typescript
|
|
750
|
-
* const revisions = await getRevisions(doc);
|
|
751
|
-
* for (const rev of revisions.filter(isMoveSource)) {
|
|
752
|
-
* const destination = findMovePair(rev, revisions);
|
|
753
|
-
* console.log(`"${rev.text}" moved to become "${destination?.text}"`);
|
|
754
|
-
* }
|
|
755
|
-
* ```
|
|
756
|
-
*/
|
|
757
|
-
export declare function findMovePair(revision: Revision, allRevisions: Revision[]): Revision | undefined;
|
|
654
|
+
export declare function isFormatChange(revision: RevisionListEntry): boolean;
|
|
758
655
|
/**
|
|
759
656
|
* Version information for the library
|
|
760
657
|
*/
|
|
@@ -778,7 +675,7 @@ export interface CompareResult {
|
|
|
778
675
|
/** The redlined document as a Uint8Array */
|
|
779
676
|
document: Uint8Array;
|
|
780
677
|
/** List of revisions found */
|
|
781
|
-
revisions:
|
|
678
|
+
revisions: RevisionListEntry[];
|
|
782
679
|
}
|
|
783
680
|
/** Algorithm-labelled digest in a verification artifact. */
|
|
784
681
|
export interface VerificationDigest {
|
|
@@ -1195,15 +1092,12 @@ export interface DocxodusWasmExports {
|
|
|
1195
1092
|
* Idempotent — assemblies load only once.
|
|
1196
1093
|
*/
|
|
1197
1094
|
Warmup: () => string;
|
|
1198
|
-
CompareDocuments: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string
|
|
1095
|
+
CompareDocuments: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string) => Uint8Array;
|
|
1199
1096
|
CompareDocumentsToHtml: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string) => string;
|
|
1200
|
-
CompareDocumentsToHtmlWithOptions: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string, renderTrackedChanges: boolean
|
|
1201
|
-
CompareDocumentsToHtmlFull: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string,
|
|
1202
|
-
CompareDocumentsWithOptions: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string,
|
|
1097
|
+
CompareDocumentsToHtmlWithOptions: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string, renderTrackedChanges: boolean) => string;
|
|
1098
|
+
CompareDocumentsToHtmlFull: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string, caseInsensitive: boolean, renderTrackedChanges: boolean) => string;
|
|
1099
|
+
CompareDocumentsWithOptions: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string, caseInsensitive: boolean) => Uint8Array;
|
|
1203
1100
|
GetRevisionsJson: (comparedDocBytes: Uint8Array) => string;
|
|
1204
|
-
GetRevisionsJsonWithOptions: (comparedDocBytes: Uint8Array, detectMoves: boolean, moveSimilarityThreshold: number, moveMinimumWordCount: number, caseInsensitive: boolean) => string;
|
|
1205
|
-
CompareDocumentsWithLog: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string, detailThreshold: number, caseInsensitive: boolean) => string;
|
|
1206
|
-
CompareDocumentsToHtmlWithLog: (originalBytes: Uint8Array, modifiedBytes: Uint8Array, authorName: string, detailThreshold: number, caseInsensitive: boolean, renderTrackedChanges: boolean) => string;
|
|
1207
1101
|
};
|
|
1208
1102
|
DocxDiffBridge: {
|
|
1209
1103
|
/** Redlined DOCX bytes (native markup), or empty array on error. */
|
|
@@ -1217,6 +1111,9 @@ export interface DocxodusWasmExports {
|
|
|
1217
1111
|
/** One memoized pass, every requested product: `{"redlineB64":…, "revisions":[…],
|
|
1218
1112
|
* "editScript":…, "semanticChanges":…}` JSON (issue #594), or a JSON error object. */
|
|
1219
1113
|
CompareProductsJson: (leftBytes: Uint8Array, rightBytes: Uint8Array, settingsJson: string, productsJson: string) => string;
|
|
1114
|
+
/** One baseline read once, compared against many candidates:
|
|
1115
|
+
* `{"results":[{"name":…, …products…}]}` JSON (issue #617), or a JSON error object. */
|
|
1116
|
+
CompareBatchJson: (baselineBytes: Uint8Array, candidatesJson: string, settingsJson: string, productsJson: string) => string;
|
|
1220
1117
|
/** Accept all tracked revisions in a redlined DOCX → "right"-side bytes, or empty array on error. */
|
|
1221
1118
|
AcceptRevisions: (bytes: Uint8Array) => Uint8Array;
|
|
1222
1119
|
/** Reject all tracked revisions in a redlined DOCX → "left"-side bytes, or empty array on error. */
|
|
@@ -1307,6 +1204,9 @@ export interface DocxodusWasmExports {
|
|
|
1307
1204
|
SetFooterText: (handle: number, anchor: string, kind: string, markdown: string) => string;
|
|
1308
1205
|
InsertPageNumberField: (handle: number, anchor: string, field: string, format: string) => string;
|
|
1309
1206
|
SetPageNumbering: (handle: number, anchor: string, opJson: string) => string;
|
|
1207
|
+
InsertTableOfContents: (handle: number, anchor: string, pos: string, optionsJson: string) => string;
|
|
1208
|
+
InsertTableOfFigures: (handle: number, anchor: string, pos: string, optionsJson: string) => string;
|
|
1209
|
+
InsertTableOfAuthorities: (handle: number, anchor: string, pos: string, optionsJson: string) => string;
|
|
1310
1210
|
ClearPageNumbering: (handle: number, anchor: string) => string;
|
|
1311
1211
|
EnsureHeaderFooterVisible: (handle: number, anchor: string, kind: string) => string;
|
|
1312
1212
|
InsertFootnote: (handle: number, anchor: string, characterOffset: number, markdown: string) => string;
|
|
@@ -1414,7 +1314,7 @@ export interface DocxodusWasmExports {
|
|
|
1414
1314
|
SaveWithAnchorIds: (handle: number) => Uint8Array;
|
|
1415
1315
|
};
|
|
1416
1316
|
}
|
|
1417
|
-
export type EditErrorCode = "anchor_not_found" | "anchor_wrong_kind" | "anchors_not_adjacent" | "session_disposed" | "malformed_markdown" | "unsupported_markdown_syntax" | "table_insert_not_supported" | "footnote_ref_not_supported" | "comment_marker_not_supported" | "image_insert_not_supported" | "anchor_token_in_payload" | "offset_out_of_range" | "invalid_position" | "text_not_found" | "unknown_style" | "invalid_list_level" | "invalid_list_start_value" | "invalid_page_numbering" | "invalid_paragraph_format" | "invalid_table_styling" | "invalid_table_merge" | "table_anchor_migration_required" | "malformed_xml" | "disallowed_namespace" | "incompatible_element_type" | "validation_failed" | "nothing_to_undo" | "nothing_to_redo" | "duplicate_annotation_id" | "annotation_not_found" | "empty_annotation_span" | "empty_comment_span" | "revision_not_found" | "precondition_failed" | "invalid_batch_step" | "invalid_transaction" | "transaction_conflict" | "transaction_result_evicted" | "transaction_incomplete" | "hyperlink_not_found" | "bookmark_not_found" | "duplicate_bookmark_name" | "invalid_bookmark_name" | "invalid_hyperlink_target" | "missing_bookmark_target" | "bookmark_in_use" | "managed_bookmark" | "empty_hyperlink_span" | "unsupported_inline_boundary" | "revision_unsupported" | "revision_malformed" | "revision_ambiguous" | "tracked_operation_unsupported" | "unresolved_structural_revision" | "content_control_not_found" | "content_control_malformed" | "content_control_unsupported" | "content_control_locked" | "content_control_bound" | "content_control_wrong_type" | "invalid_content_control_value" | "content_control_placement_unsupported" | "content_control_nested_fill_unsupported" | "repeating_section_constraint" | "image_not_found" | "invalid_image_data" | "unsupported_image_format" | "image_too_large" | "invalid_image_dimensions" | "unsupported_image_markup" | "linked_image_read_only" | "invalid_image_layout" | "internal_error";
|
|
1317
|
+
export type EditErrorCode = "anchor_not_found" | "anchor_wrong_kind" | "anchors_not_adjacent" | "session_disposed" | "malformed_markdown" | "unsupported_markdown_syntax" | "table_insert_not_supported" | "footnote_ref_not_supported" | "comment_marker_not_supported" | "image_insert_not_supported" | "anchor_token_in_payload" | "offset_out_of_range" | "invalid_position" | "text_not_found" | "unknown_style" | "invalid_list_level" | "invalid_list_start_value" | "invalid_page_numbering" | "invalid_reference_field" | "invalid_paragraph_format" | "invalid_table_styling" | "invalid_table_merge" | "table_anchor_migration_required" | "malformed_xml" | "disallowed_namespace" | "incompatible_element_type" | "validation_failed" | "nothing_to_undo" | "nothing_to_redo" | "duplicate_annotation_id" | "annotation_not_found" | "empty_annotation_span" | "empty_comment_span" | "revision_not_found" | "precondition_failed" | "invalid_batch_step" | "invalid_transaction" | "transaction_conflict" | "transaction_result_evicted" | "transaction_incomplete" | "hyperlink_not_found" | "bookmark_not_found" | "duplicate_bookmark_name" | "invalid_bookmark_name" | "invalid_hyperlink_target" | "missing_bookmark_target" | "bookmark_in_use" | "managed_bookmark" | "empty_hyperlink_span" | "unsupported_inline_boundary" | "revision_unsupported" | "revision_malformed" | "revision_ambiguous" | "tracked_operation_unsupported" | "unresolved_structural_revision" | "content_control_not_found" | "content_control_malformed" | "content_control_unsupported" | "content_control_locked" | "content_control_bound" | "content_control_wrong_type" | "invalid_content_control_value" | "content_control_placement_unsupported" | "content_control_nested_fill_unsupported" | "repeating_section_constraint" | "image_not_found" | "invalid_image_data" | "unsupported_image_format" | "image_too_large" | "invalid_image_dimensions" | "unsupported_image_markup" | "linked_image_read_only" | "invalid_image_layout" | "internal_error";
|
|
1418
1318
|
export interface AnchorRef {
|
|
1419
1319
|
id: string;
|
|
1420
1320
|
kind: string;
|
|
@@ -1868,6 +1768,49 @@ export interface ParagraphFormatOp {
|
|
|
1868
1768
|
* `"even"` (even pages; sets `w:evenAndOddHeaders`).
|
|
1869
1769
|
*/
|
|
1870
1770
|
export type HeaderFooterKind = "default" | "first" | "even";
|
|
1771
|
+
/**
|
|
1772
|
+
* Options for {@link DocxSession.insertTableOfContents} (issue #607). Every field is a typed switch
|
|
1773
|
+
* on the underlying `TOC` field, so a caller never writes `\o "1-3"` by hand — a malformed switch
|
|
1774
|
+
* string renders as nothing in Word, silently, which is the failure these exist to prevent.
|
|
1775
|
+
*/
|
|
1776
|
+
export interface TableOfContentsOptions {
|
|
1777
|
+
/** Heading levels to list (`\o`): a level or a range within 1-9, e.g. `"1-3"`. Default `"1-3"`. */
|
|
1778
|
+
levels?: string;
|
|
1779
|
+
/** Make each entry a hyperlink to its heading (`\h`). Default true. */
|
|
1780
|
+
hyperlinks?: boolean;
|
|
1781
|
+
/** Hide the leader tab and page numbers in Word's web view (`\z`). Default true. */
|
|
1782
|
+
hideTabAndPageNumbersInWeb?: boolean;
|
|
1783
|
+
/** Include paragraphs with an outline level but no heading style (`\u`). Default true. */
|
|
1784
|
+
useOutlineLevels?: boolean;
|
|
1785
|
+
/** Heading above the table, in Word's `TOCHeading` style. `null` or `""` inserts no heading.
|
|
1786
|
+
* Default `"Contents"`. */
|
|
1787
|
+
title?: string | null;
|
|
1788
|
+
/** Right-aligned dot-leader tab stop in twips. Default 9350 (US Letter, one-inch margins). */
|
|
1789
|
+
rightTabPos?: number;
|
|
1790
|
+
}
|
|
1791
|
+
/** Options for {@link DocxSession.insertTableOfFigures}. A table of figures is a `TOC` field
|
|
1792
|
+
* selecting by caption label rather than outline level — Word's own encoding. */
|
|
1793
|
+
export interface TableOfFiguresOptions {
|
|
1794
|
+
/** The caption label whose captions to list (`\c`) — `"Figure"`, `"Table"`, `"Exhibit"`. */
|
|
1795
|
+
captionLabel?: string;
|
|
1796
|
+
/** Make each entry a hyperlink to its caption (`\h`). Default true. */
|
|
1797
|
+
hyperlinks?: boolean;
|
|
1798
|
+
/** Right-aligned dot-leader tab stop in twips. Default 9350. */
|
|
1799
|
+
rightTabPos?: number;
|
|
1800
|
+
}
|
|
1801
|
+
/** Word's fixed table-of-authorities categories. */
|
|
1802
|
+
export type AuthorityCategory = "cases" | "statutes" | "other_authorities" | "rules" | "treatises" | "regulations" | "constitutional_provisions";
|
|
1803
|
+
/** Options for {@link DocxSession.insertTableOfAuthorities}. */
|
|
1804
|
+
export interface TableOfAuthoritiesOptions {
|
|
1805
|
+
/** Which category of authority to list (`\c`). Default `"cases"`. */
|
|
1806
|
+
category?: AuthorityCategory;
|
|
1807
|
+
/** Make each entry a hyperlink to its citation (`\h`). Default true. */
|
|
1808
|
+
hyperlinks?: boolean;
|
|
1809
|
+
/** Separator between an entry and its page numbers (`\e`), e.g. a tab. Default: Word's own. */
|
|
1810
|
+
entryPageSeparator?: string;
|
|
1811
|
+
/** Right-aligned dot-leader tab stop in twips. Default 9350. */
|
|
1812
|
+
rightTabPos?: number;
|
|
1813
|
+
}
|
|
1871
1814
|
/** Which page-number field `DocxSession.insertPageNumberField` emits: `"currentPage"` → PAGE,
|
|
1872
1815
|
* `"totalPages"` → NUMPAGES. */
|
|
1873
1816
|
export type PageNumberField = "currentPage" | "totalPages";
|
|
@@ -2691,61 +2634,6 @@ export declare enum ComparisonLogLevel {
|
|
|
2691
2634
|
/** Error that may affect comparison results but didn't stop processing */
|
|
2692
2635
|
Error = "Error"
|
|
2693
2636
|
}
|
|
2694
|
-
/**
|
|
2695
|
-
* A single log entry from the comparison process.
|
|
2696
|
-
*/
|
|
2697
|
-
export interface ComparisonLogEntry {
|
|
2698
|
-
/** Severity level: "Info", "Warning", or "Error" */
|
|
2699
|
-
level: ComparisonLogLevel | string;
|
|
2700
|
-
/**
|
|
2701
|
-
* Machine-readable code identifying the type of issue.
|
|
2702
|
-
* Examples: "ORPHANED_FOOTNOTE_REFERENCE", "MISSING_STYLE"
|
|
2703
|
-
*/
|
|
2704
|
-
code: string;
|
|
2705
|
-
/** Human-readable description of the issue */
|
|
2706
|
-
message: string;
|
|
2707
|
-
/** Additional context or technical details (optional) */
|
|
2708
|
-
details?: string;
|
|
2709
|
-
/**
|
|
2710
|
-
* Location in the document where the issue occurred (optional).
|
|
2711
|
-
* Format: "part/xpath" e.g., "document.xml/w:footnoteReference[@w:id='3']"
|
|
2712
|
-
*/
|
|
2713
|
-
location?: string;
|
|
2714
|
-
}
|
|
2715
|
-
/**
|
|
2716
|
-
* Result from comparison operations that includes a log of warnings/errors.
|
|
2717
|
-
*/
|
|
2718
|
-
export interface CompareResultWithLog {
|
|
2719
|
-
/** Whether the comparison succeeded */
|
|
2720
|
-
success: boolean;
|
|
2721
|
-
/** The redlined document as a Uint8Array (only if success is true) */
|
|
2722
|
-
document?: Uint8Array;
|
|
2723
|
-
/** Error message if success is false */
|
|
2724
|
-
error?: string;
|
|
2725
|
-
/** Log entries from the comparison process */
|
|
2726
|
-
log: ComparisonLogEntry[];
|
|
2727
|
-
/** Whether the log contains any warnings */
|
|
2728
|
-
hasWarnings: boolean;
|
|
2729
|
-
/** Whether the log contains any errors */
|
|
2730
|
-
hasErrors: boolean;
|
|
2731
|
-
}
|
|
2732
|
-
/**
|
|
2733
|
-
* Result from HTML comparison operations that includes a log of warnings/errors.
|
|
2734
|
-
*/
|
|
2735
|
-
export interface CompareToHtmlResultWithLog {
|
|
2736
|
-
/** Whether the comparison succeeded */
|
|
2737
|
-
success: boolean;
|
|
2738
|
-
/** The HTML output (only if success is true) */
|
|
2739
|
-
html?: string;
|
|
2740
|
-
/** Error message if success is false */
|
|
2741
|
-
error?: string;
|
|
2742
|
-
/** Log entries from the comparison process */
|
|
2743
|
-
log: ComparisonLogEntry[];
|
|
2744
|
-
/** Whether the log contains any warnings */
|
|
2745
|
-
hasWarnings: boolean;
|
|
2746
|
-
/** Whether the log contains any errors */
|
|
2747
|
-
hasErrors: boolean;
|
|
2748
|
-
}
|
|
2749
2637
|
/**
|
|
2750
2638
|
* Well-known log entry codes used by the comparison engine.
|
|
2751
2639
|
*/
|
|
@@ -2767,34 +2655,6 @@ export declare const ComparisonLogCodes: {
|
|
|
2767
2655
|
/** A bookmark reference has no corresponding bookmark start/end */
|
|
2768
2656
|
readonly OrphanedBookmark: "ORPHANED_BOOKMARK";
|
|
2769
2657
|
};
|
|
2770
|
-
/**
|
|
2771
|
-
* Options for revision extraction with move detection configuration.
|
|
2772
|
-
*/
|
|
2773
|
-
export interface GetRevisionsOptions {
|
|
2774
|
-
/**
|
|
2775
|
-
* Whether to detect and mark moved content.
|
|
2776
|
-
* When enabled, deletions and insertions with similar text are linked as move pairs.
|
|
2777
|
-
* @default true
|
|
2778
|
-
*/
|
|
2779
|
-
detectMoves?: boolean;
|
|
2780
|
-
/**
|
|
2781
|
-
* Jaccard similarity threshold for move detection (0.0 to 1.0).
|
|
2782
|
-
* Higher values require more exact word overlap between deletion and insertion.
|
|
2783
|
-
* @default 0.8
|
|
2784
|
-
*/
|
|
2785
|
-
moveSimilarityThreshold?: number;
|
|
2786
|
-
/**
|
|
2787
|
-
* Minimum word count for content to be considered for move detection.
|
|
2788
|
-
* Short phrases below this threshold are excluded to avoid false positives.
|
|
2789
|
-
* @default 3
|
|
2790
|
-
*/
|
|
2791
|
-
moveMinimumWordCount?: number;
|
|
2792
|
-
/**
|
|
2793
|
-
* Whether similarity matching ignores case differences.
|
|
2794
|
-
* @default false
|
|
2795
|
-
*/
|
|
2796
|
-
caseInsensitive?: boolean;
|
|
2797
|
-
}
|
|
2798
2658
|
/**
|
|
2799
2659
|
* A custom annotation on a document range.
|
|
2800
2660
|
*/
|
|
@@ -3341,8 +3201,6 @@ export interface WorkerGetRevisionsRequest extends WorkerRequestBase {
|
|
|
3341
3201
|
type: "getRevisions";
|
|
3342
3202
|
/** Document bytes */
|
|
3343
3203
|
documentBytes: Uint8Array;
|
|
3344
|
-
/** Revision extraction options */
|
|
3345
|
-
options?: GetRevisionsOptions;
|
|
3346
3204
|
}
|
|
3347
3205
|
/**
|
|
3348
3206
|
* Get document metadata for lazy loading request.
|
|
@@ -3518,7 +3376,7 @@ export interface WorkerGetSemanticChangesResponse extends WorkerResponseBase {
|
|
|
3518
3376
|
export interface WorkerGetRevisionsResponse extends WorkerResponseBase {
|
|
3519
3377
|
type: "getRevisions";
|
|
3520
3378
|
/** Array of revisions */
|
|
3521
|
-
revisions?:
|
|
3379
|
+
revisions?: RevisionListEntry[];
|
|
3522
3380
|
}
|
|
3523
3381
|
/**
|
|
3524
3382
|
* Response from getDocumentMetadata request.
|