@stll/docx-core
@@ -54,2 +54,7 @@ //#region src/generated/docx_kernel.d.ts | ||
| }; | ||
| /** Controls text materialization for fused document and review-fact projection. */ | ||
| type ProjectCompressedDocxWithReviewFactsOptions = { | ||
| /** Selects host-coordinate controls or normalized readable text. */ | ||
| textMaterialization?: "word-host" | "readable-plain-text"; | ||
| }; | ||
| /** Loads and caches the single-threaded WebAssembly runtime. */ | ||
@@ -63,4 +68,4 @@ declare const initializeDocxProjection: ({ wasm }?: InitializeDocxProjectionOptions) => Promise<void>; | ||
| */ | ||
| declare const projectCompressedDocxWithReviewFacts: (bytes: Uint8Array) => Promise<DocxPackageProjectionWire>; | ||
| declare const projectCompressedDocxWithReviewFacts: (bytes: Uint8Array, { textMaterialization }?: ProjectCompressedDocxWithReviewFactsOptions) => Promise<DocxPackageProjectionWire>; | ||
| //#endregion | ||
| export { type DocxAttributedComment, type DocxAttributedRevision, type DocxCommentContent, type DocxPackageProjectionWire, type DocxProjectionBookmarkFact, DocxProjectionError, type DocxProjectionFactSet, type DocxProjectionFormattingSpan, type DocxProjectionIndentationFact, DocxProjectionInitializationError, type DocxProjectionNumberingFact, type DocxProjectionParagraph, type DocxProjectionReferenceFact, type DocxProjectionRevisionStatus, type DocxProjectionRevisionUnsupportedReason, type DocxProjectionStructuralFacts, type DocxProjectionStructuralSpan, type DocxProjectionStructure, type DocxProjectionUnknownReason, DocxProjectionWasmSource, type DocxProjectionWire, type DocxReviewDetail, type DocxReviewFactSet, type DocxReviewFactsWire, type DocxReviewPoint, type DocxReviewSpan, type DocxReviewUnknownReason, type DocxRevisionContent, InitializeDocxProjectionOptions, initializeDocxProjection, projectCompressedDocx, projectCompressedDocxWithReviewFacts }; | ||
| export { type DocxAttributedComment, type DocxAttributedRevision, type DocxCommentContent, type DocxPackageProjectionWire, type DocxProjectionBookmarkFact, DocxProjectionError, type DocxProjectionFactSet, type DocxProjectionFormattingSpan, type DocxProjectionIndentationFact, DocxProjectionInitializationError, type DocxProjectionNumberingFact, type DocxProjectionParagraph, type DocxProjectionReferenceFact, type DocxProjectionRevisionStatus, type DocxProjectionRevisionUnsupportedReason, type DocxProjectionStructuralFacts, type DocxProjectionStructuralSpan, type DocxProjectionStructure, type DocxProjectionUnknownReason, DocxProjectionWasmSource, type DocxProjectionWire, type DocxReviewDetail, type DocxReviewFactSet, type DocxReviewFactsWire, type DocxReviewPoint, type DocxReviewSpan, type DocxReviewUnknownReason, type DocxRevisionContent, InitializeDocxProjectionOptions, ProjectCompressedDocxWithReviewFactsOptions, initializeDocxProjection, projectCompressedDocx, projectCompressedDocxWithReviewFacts }; |
+26
-2
@@ -34,2 +34,26 @@ import { TaggedError } from "better-result"; | ||
| /** | ||
| * Projects the same fused snapshot with controls normalized for readable text. | ||
| * | ||
| * # Errors | ||
| * | ||
| * Returns a JavaScript `Error` under the same conditions as | ||
| * [`project_compressed_docx_with_review_facts`]. | ||
| * @param {Uint8Array} bytes | ||
| * @returns {DocxPackageProjectionWire} | ||
| */ | ||
| function projectCompressedDocxWithReadableReviewFacts(bytes) { | ||
| try { | ||
| const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
| const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export); | ||
| const len0 = WASM_VECTOR_LEN; | ||
| wasm.projectCompressedDocxWithReadableReviewFacts(retptr, ptr0, len0); | ||
| var r0 = getDataViewMemory0().getInt32(retptr + 0, true); | ||
| var r1 = getDataViewMemory0().getInt32(retptr + 4, true); | ||
| if (getDataViewMemory0().getInt32(retptr + 8, true)) throw takeObject(r1); | ||
| return takeObject(r0); | ||
| } finally { | ||
| wasm.__wbindgen_add_to_stack_pointer(16); | ||
| } | ||
| } | ||
| /** | ||
| * Projects the document snapshot and attributed review facts from one bounded | ||
@@ -244,5 +268,5 @@ * package-directory scan. | ||
| */ | ||
| const projectCompressedDocxWithReviewFacts = (bytes) => projectWith({ | ||
| const projectCompressedDocxWithReviewFacts = (bytes, { textMaterialization = "word-host" } = {}) => projectWith({ | ||
| bytes, | ||
| project: projectCompressedDocxWithReviewFacts$1, | ||
| project: textMaterialization === "word-host" ? projectCompressedDocxWithReviewFacts$1 : projectCompressedDocxWithReadableReviewFacts, | ||
| message: PACKAGE_PROJECTION_FAILURE_MESSAGE | ||
@@ -249,0 +273,0 @@ }); |
+1
-1
| { | ||
| "name": "@stll/docx-core", | ||
| "version": "0.8.0", | ||
| "version": "0.9.0", | ||
| "description": "Typed OOXML/DOCX model, validation, serialization, legal-source compilation, and browser-native package projection.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
428150
3.22%4838
0.6%1
-50%