docxodus 12.6.4 → 13.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 +8 -5
- package/dist/canonical.d.ts.map +1 -1
- package/dist/canonical.js +7 -3
- package/dist/canonical.js.map +1 -1
- package/dist/conversion-options.d.ts +16 -0
- package/dist/conversion-options.d.ts.map +1 -0
- package/dist/conversion-options.js +31 -0
- package/dist/conversion-options.js.map +1 -0
- package/dist/core.d.ts +17 -9
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +23 -24
- package/dist/core.js.map +1 -1
- package/dist/docxodus.worker.js +2 -1073
- package/dist/docxodus.worker.js.map +7 -1
- package/dist/editor.bundle.js +35 -14296
- package/dist/editor.bundle.js.map +7 -0
- package/dist/editor.d.ts +33 -2
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +6739 -4773
- package/dist/editor.js.map +7 -1
- package/dist/embed.bundle.js +159 -18703
- package/dist/embed.bundle.js.map +7 -0
- package/dist/embed.d.ts +1 -1
- package/dist/embed.iife.js +37 -18595
- package/dist/embed.iife.js.map +7 -0
- package/dist/embed.js +1 -1
- package/dist/export-assets.json +27 -27
- package/dist/export-browser.bundle.js +1388 -477
- package/dist/export-browser.d.ts +20 -0
- package/dist/export-browser.d.ts.map +1 -1
- package/dist/export-browser.js +132 -37
- package/dist/export-browser.js.map +1 -1
- package/dist/font-runtime.d.ts.map +1 -1
- package/dist/font-runtime.js +54 -0
- package/dist/font-runtime.js.map +1 -1
- package/dist/line-metrics.d.ts +60 -0
- package/dist/line-metrics.d.ts.map +1 -0
- package/dist/line-metrics.js +343 -0
- package/dist/line-metrics.js.map +1 -0
- package/dist/pagination.bundle.js +3 -3214
- package/dist/pagination.bundle.js.map +7 -0
- package/dist/pagination.d.ts +86 -9
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +358 -55
- package/dist/pagination.js.map +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +63 -12
- package/dist/react.js.map +1 -1
- package/dist/render-report-v2.schema.json +29 -0
- package/dist/session.bundle.js +2 -2013
- package/dist/session.bundle.js.map +7 -0
- package/dist/session.d.ts +14 -5
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +62 -29
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +137 -21
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +14 -0
- package/dist/types.js.map +1 -1
- 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.wasm +0 -0
- package/dist/wasm/_framework/System.Collections.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.Linq.wasm +0 -0
- package/dist/wasm/_framework/System.Linq.wasm.br +0 -0
- package/dist/wasm/_framework/System.Memory.wasm +0 -0
- package/dist/wasm/_framework/System.Memory.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.Xml.Linq.wasm +0 -0
- package/dist/wasm/_framework/System.Private.Xml.Linq.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 +11 -11
- package/dist/wasm/_framework/dotnet.boot.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/word-text.d.ts +14 -0
- package/dist/word-text.d.ts.map +1 -0
- package/dist/word-text.js +377 -0
- package/dist/word-text.js.map +1 -0
- package/dist/worker-proxy.bundle.js +2 -536
- package/dist/worker-proxy.bundle.js.map +7 -0
- package/dist/worker-proxy.d.ts +14 -1
- package/dist/worker-proxy.d.ts.map +1 -1
- package/dist/worker-proxy.js +357 -339
- package/dist/worker-proxy.js.map +1 -1
- package/package.json +13 -12
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/verification-request.ts", "../src/worker-proxy.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n DeliverableVerificationRequest,\n DeliverableCompanionArtifactInput,\n} from \"./types.js\";\n\n/**\n * Serialize the full deliverable-verification request (issue #747) to the wire shape every\n * transport parses: companion bytes become `bytesB64`, everything else passes through. Kept\n * separate from the API modules so the direct API, the session, and the worker proxy share\n * one encoding.\n */\nexport function serializeVerificationRequest(request: DeliverableVerificationRequest): string {\n if (request === null || typeof request !== \"object\" || Array.isArray(request)) {\n throw new RangeError(\"a verification request must be an object\");\n }\n const { companionArtifacts, ...rest } = request;\n const wire: Record<string, unknown> = { ...rest };\n if (companionArtifacts !== undefined) {\n wire.companionArtifacts = companionArtifacts.map(encodeCompanion);\n }\n return JSON.stringify(wire);\n}\n\nfunction encodeCompanion(artifact: DeliverableCompanionArtifactInput): Record<string, unknown> {\n const { bytes, ...rest } = artifact;\n const wire: Record<string, unknown> = { ...rest };\n if (bytes !== undefined) wire.bytesB64 = bytesToBase64(bytes);\n return wire;\n}\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n if (typeof btoa === \"function\") {\n let binary = \"\";\n const chunkSize = 0x8000;\n for (let i = 0; i < bytes.length; i += chunkSize) {\n const chunk = bytes.subarray(i, i + chunkSize);\n binary += String.fromCharCode.apply(null, chunk as unknown as number[]);\n }\n return btoa(binary);\n }\n return Buffer.from(bytes).toString(\"base64\");\n}\n", "/**\n * Worker Proxy - Main thread interface for the Docxodus Web Worker\n *\n * This module provides a Promise-based API that mirrors the main API but\n * executes all WASM operations in a Web Worker, keeping the main thread free.\n *\n * @example\n * ```typescript\n * import { createWorkerDocxodus } from 'docxodus/worker';\n *\n * // Create worker instance\n * const docxodus = await createWorkerDocxodus();\n *\n * // Use the same API as the main module, but non-blocking!\n * const html = await docxodus.convertDocxToHtml(docxFile);\n *\n * // Clean up when done\n * docxodus.terminate();\n * ```\n */\n\nimport type {\n WorkerRequest,\n WorkerResponse,\n WorkerConvertResponse,\n WorkerGeneratePackageManifestResponse,\n WorkerVerifyDeliverableResponse,\n DeliverableVerificationRequest,\n WorkerProveRedlineReversibilityResponse,\n WorkerProjectReviewProfileResponse,\n WorkerCompareResponse,\n WorkerCompareToHtmlResponse,\n WorkerGetSemanticChangesResponse,\n WorkerCreateExternalAnnotationSetResponse,\n WorkerValidateExternalAnnotationsResponse,\n WorkerProjectAnnotationsOntoHtmlResponse,\n WorkerConvertWithExternalAnnotationsResponse,\n WorkerExportToOpenContractResponse,\n ExternalAnnotationSet,\n ExternalAnnotationValidationResult,\n ExternalAnnotationProjectionSettings,\n OpenContractDocExport,\n WorkerGetRevisionsResponse,\n WorkerGetCommentsResponse,\n WorkerGetDocumentMetadataResponse,\n WorkerGetVersionResponse,\n WorkerPrepareResponse,\n WorkerSessionOpenResponse,\n WorkerSessionGetPackageManifestResponse,\n WorkerSessionGetSemanticChangesResponse,\n WorkerSessionVerifyDeliverableResponse,\n WorkerSessionEditResponse,\n WorkerDocxodusOptions,\n ConversionOptions,\n CompareOptions,\n DocxDiffSettings,\n RevisionListEntry,\n CommentListEntry,\n VersionInfo,\n DocumentMetadata,\n DocxSessionSettings,\n DocumentAnnotation,\n AnnotationUpdate,\n CharSpan,\n EditResult,\n PackageManifest,\n DeliverableVerificationResult,\n RedlineReversibilityProof,\n SemanticChangeSet,\n PackageManifestInspectionLimits,\n WorkerErrorCode,\n WorkerRequestOptions,\n} from \"./types.js\";\nimport { serializeVerificationRequest } from \"./verification-request.js\";\n\nexport type { WorkerDocxodusOptions, WorkerErrorCode, WorkerRequestOptions } from \"./types.js\";\n\n/**\n * Rejection carrying the worker's machine-readable cause. Callers classify failures with\n * {@link workerErrorCode}; `message` is diagnostic text whose wording is not a contract.\n */\nexport class WorkerOperationError extends Error {\n readonly code?: WorkerErrorCode;\n\n constructor(message: string, code?: WorkerErrorCode) {\n super(message);\n this.name = \"WorkerOperationError\";\n this.code = code;\n }\n}\n\nfunction workerError(message?: string, code?: WorkerErrorCode): WorkerOperationError {\n return new WorkerOperationError(message || \"Unknown error\", code);\n}\n\n/**\n * Read a success response's payload, rejecting with `missing_result` when the worker reported\n * success without it rather than handing the caller `undefined` typed as a value.\n */\nfunction requireField<R extends WorkerResponse, K extends keyof R>(response: R, field: K): NonNullable<R[K]> {\n const value = response[field];\n if (value === undefined || value === null) {\n throw workerError(\n `The worker's \"${(response as { type?: string }).type ?? \"unknown\"}\" response reported success without its ${String(field)}`,\n \"missing_result\",\n );\n }\n return value as NonNullable<R[K]>;\n}\n\n/** A positive, finite timeout in milliseconds, or undefined; anything else is a caller error. */\nfunction checkTimeout(timeoutMs: number | undefined, name: string): number | undefined {\n if (timeoutMs !== undefined && !(Number.isFinite(timeoutMs) && timeoutMs > 0)) {\n throw new RangeError(`${name} must be a positive, finite number of milliseconds; got ${timeoutMs}`);\n }\n return timeoutMs;\n}\n\n/** Reads a worker failure's machine-readable cause, or undefined for any other error. */\nexport function workerErrorCode(error: unknown): WorkerErrorCode | undefined {\n return error instanceof WorkerOperationError ? error.code : undefined;\n}\n\n/**\n * Generate a unique request ID.\n */\nfunction generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;\n}\n\n/**\n * Convert a File or Uint8Array to Uint8Array.\n */\nasync function toBytes(document: File | Uint8Array): Promise<Uint8Array> {\n if (document instanceof Uint8Array) {\n // Transfer only an exact-view clone. Transferring the caller's buffer would detach it,\n // and transferring a subarray's backing buffer would also send unrelated prefix/suffix bytes.\n return new Uint8Array(document);\n }\n const buffer = await document.arrayBuffer();\n return new Uint8Array(buffer);\n}\n\n/**\n * Derive the WASM base path from the current module URL.\n */\nfunction deriveWasmBasePath(): string {\n // Try to get the base path from the current script URL\n if (typeof document !== \"undefined\") {\n // Browser: look for docxodus script tag or use current location\n const scripts = document.querySelectorAll('script[src*=\"docxodus\"]');\n if (scripts.length > 0) {\n const src = (scripts[0] as HTMLScriptElement).src;\n const base = src.substring(0, src.lastIndexOf(\"/\") + 1);\n return base + \"wasm/\";\n }\n }\n\n // Default fallback\n return \"/wasm/\";\n}\n\n/**\n * A worker-proxied DocxSession. Mirrors the main-thread {@link DocxSession}\n * annotation write surface but each call returns a Promise, since the actual\n * work happens inside the Web Worker.\n *\n * Acquire via {@link WorkerDocxodus.openDocxSession}; always call\n * {@link close} when finished to free the in-worker handle.\n */\nexport interface WorkerDocxSession {\n /** Generate a deterministic manifest of the session's current logical checkpoint. */\n getPackageManifest(): Promise<PackageManifest>;\n\n /** Run the default deliverable gate over the session's clean-save checkpoint. */\n verifyDeliverable(request?: DeliverableVerificationRequest): Promise<DeliverableVerificationResult>;\n\n /** Compare the current logical checkpoint with the exact opening package. */\n getSemanticChanges(): Promise<SemanticChangeSet>;\n\n /**\n * Add an annotation to the document at the given anchor.\n * @param anchorId - Markdown-projection anchor id of the target block\n * @param span - Character span within the block, or null for the whole block\n * @param annotation - Annotation data (id auto-generated if omitted)\n * @returns EditResult indicating success and any created/modified anchors\n */\n addAnnotation(\n anchorId: string,\n span: CharSpan | null,\n annotation: DocumentAnnotation\n ): Promise<EditResult>;\n\n /**\n * Remove an existing annotation by its id.\n * @param annotationId - The annotation id to remove\n * @returns EditResult indicating success\n */\n removeAnnotation(annotationId: string): Promise<EditResult>;\n\n /**\n * Partially update an annotation's metadata without moving it.\n * @param annotationId - The annotation id to update\n * @param update - Fields to change (omitted fields are left unchanged)\n * @returns EditResult indicating success\n */\n updateAnnotation(\n annotationId: string,\n update: AnnotationUpdate\n ): Promise<EditResult>;\n\n /**\n * Move an annotation to a new anchor/span position.\n * @param annotationId - The annotation id to move\n * @param newAnchorId - Target anchor id\n * @param newSpan - New character span, or null for the whole block\n * @returns EditResult indicating success\n */\n moveAnnotation(\n annotationId: string,\n newAnchorId: string,\n newSpan: CharSpan | null\n ): Promise<EditResult>;\n\n /**\n * Close the session and release its in-worker handle.\n * After calling this, the instance cannot be used anymore.\n */\n close(): Promise<void>;\n}\n\n/**\n * A worker-based Docxodus instance.\n *\n * Provides the same API as the main module but executes all operations\n * in a Web Worker for non-blocking UI.\n */\nexport interface WorkerDocxodus {\n /** Generate a deterministic, non-mutating verification manifest. */\n generatePackageManifest(\n document: File | Uint8Array,\n limits?: PackageManifestInspectionLimits,\n ): Promise<PackageManifest>;\n\n /** Generate the exact canonical manifest JSON for strict boundary validation. */\n generatePackageManifestJson(\n document: File | Uint8Array,\n limits?: PackageManifestInspectionLimits,\n ): Promise<string>;\n\n /** Derive an isolated final/original package; the source bytes remain caller-owned. */\n projectReviewProfile(\n document: File | Uint8Array,\n profile: \"final\" | \"original\",\n maximumOutputBytes?: number,\n ): Promise<Uint8Array>;\n\n /** Run the default bounded deliverable gate, optionally against an exact baseline. */\n verifyDeliverable(\n document: File | Uint8Array,\n baseline?: File | Uint8Array,\n request?: DeliverableVerificationRequest,\n ): Promise<DeliverableVerificationResult>;\n\n /**\n * Prove that a redline's generated revisions accept to the intended final and reject to the\n * baseline. Three packages are inspected and two rebuilt, so this always runs off the main\n * thread; the returned proof carries digests and divergences rather than the rebuilt bytes.\n */\n proveRedlineReversibility(\n baseline: File | Uint8Array,\n intendedFinal: File | Uint8Array,\n redline: File | Uint8Array\n ): Promise<RedlineReversibilityProof>;\n\n /** Compare two DOCX packages into the stable, versioned semantic-change schema. */\n getSemanticChanges(\n left: File | Uint8Array,\n right: File | Uint8Array,\n settings?: DocxDiffSettings\n ): Promise<SemanticChangeSet>;\n\n /**\n * Create an empty external annotation set bound to the document's content hash \u2014 the input\n * to every other call in the annotation family. Runs in the worker, so a read-only viewer\n * that renders through this proxy needs no main-thread runtime to annotate (issue #775).\n */\n createExternalAnnotationSet(\n document: File | Uint8Array,\n documentId: string,\n ): Promise<ExternalAnnotationSet>;\n\n /** Validate an annotation set against a document: hash match and per-annotation text. */\n validateExternalAnnotations(\n document: File | Uint8Array,\n annotationSet: ExternalAnnotationSet,\n ): Promise<ExternalAnnotationValidationResult>;\n\n /**\n * Project an annotation set onto HTML the engine rendered. The input is parsed as XML, so\n * hand it the converter's output (or another well-formed serialization), not a live DOM's\n * `innerHTML`.\n */\n projectAnnotationsOntoHtml(\n html: string,\n annotationSet: ExternalAnnotationSet,\n projectionOptions?: ExternalAnnotationProjectionSettings,\n ): Promise<string>;\n\n /** Convert a document and project an annotation set onto it in one round trip. */\n convertDocxToHtmlWithExternalAnnotations(\n document: File | Uint8Array,\n annotationSet: ExternalAnnotationSet,\n conversionOptions?: ConversionOptions,\n projectionOptions?: ExternalAnnotationProjectionSettings,\n ): Promise<string>;\n\n /** Export a document to the OpenContracts format (text, layout tokens, labels). */\n exportToOpenContract(document: File | Uint8Array): Promise<OpenContractDocExport>;\n\n /**\n * Convert a DOCX document to HTML.\n * @param document - DOCX file as File object or Uint8Array\n * @param options - Conversion options\n * @returns HTML string\n */\n convertDocxToHtml(\n document: File | Uint8Array,\n options?: ConversionOptions,\n maximumOutputBytes?: number,\n ): Promise<string>;\n\n /**\n * Compare two DOCX documents and return the redlined result.\n * @param original - Original DOCX document\n * @param modified - Modified DOCX document\n * @param options - Comparison options\n * @returns Redlined DOCX as Uint8Array\n */\n compareDocuments(\n original: File | Uint8Array,\n modified: File | Uint8Array,\n options?: CompareOptions\n ): Promise<Uint8Array>;\n\n /**\n * Compare two DOCX documents and return the result as HTML.\n * @param original - Original DOCX document\n * @param modified - Modified DOCX document\n * @param options - Comparison options\n * @returns HTML string with redlined content\n */\n compareDocumentsToHtml(\n original: File | Uint8Array,\n modified: File | Uint8Array,\n options?: CompareOptions\n ): Promise<string>;\n\n /**\n * Get revisions from a compared document.\n * @param document - A document that has tracked changes\n * @param options - Revision extraction options\n * @returns Array of revisions\n */\n getRevisions(document: File | Uint8Array): Promise<RevisionListEntry[]>;\n\n /**\n * Read a document's native Word comments \u2014 the comment twin of {@link getRevisions}.\n * Same entries as `session.listComments()` without a session, so a read-only viewer\n * needs no main-thread runtime to show comment threads.\n * @param document - DOCX file as File object or Uint8Array\n * @returns Array of comments in comments-part order (empty when there are none)\n */\n getComments(document: File | Uint8Array): Promise<CommentListEntry[]>;\n\n /**\n * Get document metadata for lazy loading pagination.\n * This is a fast operation that extracts structure without full HTML rendering.\n * @param document - DOCX file as File object or Uint8Array\n * @returns Document metadata including sections, dimensions, and content counts\n */\n getDocumentMetadata(document: File | Uint8Array): Promise<DocumentMetadata>;\n\n /**\n * Get version information about the library.\n * @returns Version information\n */\n getVersion(): Promise<VersionInfo>;\n\n /**\n * Pre-warm the comparison code path.\n *\n * The 10s runtime warmup paid by {@link createWorkerDocxodus} does not load\n * the comparison assemblies \u2014 the .NET WASM runtime defers\n * `Docxodus.*.wasm` and its `System.*.wasm` dependents until the first\n * {@link compareDocuments} call, which then costs ~3s of pure assembly-load\n * latency. Call `prepare()` after creating the worker to pay that cost ahead\n * of any user action; once it resolves, the next {@link compareDocuments}\n * (or {@link compareDocumentsToHtml}) triggers no further `.wasm` fetches.\n *\n * Semantics:\n * - **Idempotent.** Repeated calls share one in-flight warmup and resolve\n * immediately once it has completed.\n * - **No caller IO.** No seed files to fetch, no inputs to construct \u2014 the\n * seed documents are built inside the worker.\n * - **Concurrent-safe.** `prepare()` and `compareDocuments()` may be called\n * in any order; a `compareDocuments()` issued while a `prepare()` is in\n * flight does not double-load assemblies.\n *\n * @returns A Promise that resolves when the comparison path is fully hot.\n */\n prepare(): Promise<void>;\n\n /**\n * Open a {@link WorkerDocxSession} for surgical annotation editing inside\n * the worker. Uint8Array inputs are copied once so the caller's buffer remains attached and\n * subarray boundaries are preserved; the private copy is then transferred.\n *\n * Always call {@link WorkerDocxSession.close} when you are done to release\n * the in-worker session handle.\n *\n * @param document - DOCX file as File or Uint8Array\n * @param settings - Optional session settings\n * @returns A proxied session whose methods are off-main-thread\n */\n openDocxSession(\n document: File | Uint8Array,\n settings?: DocxSessionSettings\n ): Promise<WorkerDocxSession>;\n\n /**\n * A view of this instance whose requests carry `options`: an `AbortSignal` that rejects each\n * request it is passed to, and a `timeoutMs` deadline that overrides the instance's\n * `requestTimeoutMs`. The view shares this instance's worker, so terminating either terminates\n * both. Sessions opened through the view inherit its options, except that\n * {@link WorkerDocxSession.close} ignores the signal so a session handle is always released.\n *\n * Rejecting a request does not stop work the worker has already started: the WASM engine runs\n * on the worker's single thread, so a request that was aborted or timed out is most likely still\n * running, and later requests queue behind it. Call {@link terminate} to stop it.\n */\n withRequestOptions(options: WorkerRequestOptions): WorkerDocxodus;\n\n /**\n * Terminate the worker.\n * After calling this, the instance cannot be used anymore.\n */\n terminate(): void;\n\n /**\n * Check if the worker is still active.\n */\n isActive(): boolean;\n}\n\n/**\n * Create a worker-based Docxodus instance.\n *\n * This function spawns a Web Worker that loads the WASM runtime independently.\n * All operations are executed in the worker, keeping the main thread responsive.\n *\n * @param options - Configuration options\n * @returns A Promise that resolves to a WorkerDocxodus instance\n *\n * @example\n * ```typescript\n * // Basic usage\n * const docxodus = await createWorkerDocxodus();\n * const html = await docxodus.convertDocxToHtml(docxFile);\n *\n * // With custom WASM path\n * const docxodus = await createWorkerDocxodus({\n * wasmBasePath: '/assets/wasm/'\n * });\n * ```\n */\nexport async function createWorkerDocxodus(\n options?: WorkerDocxodusOptions\n): Promise<WorkerDocxodus> {\n if (options?.signal?.aborted) {\n throw new Error(\"Worker creation aborted\");\n }\n const requestTimeoutMs = checkTimeout(options?.requestTimeoutMs, \"requestTimeoutMs\");\n // Determine WASM base path\n const wasmBasePath = options?.wasmBasePath ?? deriveWasmBasePath();\n\n // The worker bundle is packaged beside this module.\n const workerScriptPath = new URL(\"./docxodus.worker.js\", import.meta.url)\n .href;\n\n // Create the worker\n const worker = new Worker(workerScriptPath, { type: \"module\" });\n\n // Track pending requests\n const pendingRequests = new Map<\n string,\n {\n resolve: (value: any) => void;\n reject: (error: Error) => void;\n }\n >();\n\n // Track if worker is active\n let isWorkerActive = true;\n let abortListener: (() => void) | undefined;\n\n const stopWorker = (message: string): void => {\n if (!isWorkerActive) return;\n isWorkerActive = false;\n worker.terminate();\n for (const pending of pendingRequests.values()) {\n pending.reject(new Error(message));\n }\n pendingRequests.clear();\n if (abortListener && options?.signal) {\n options.signal.removeEventListener(\"abort\", abortListener);\n abortListener = undefined;\n }\n };\n if (options?.signal) {\n abortListener = () => stopWorker(\"Worker creation or operation aborted\");\n options.signal.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n // Cached warmup promise. Set on the first prepare() and reused thereafter so\n // repeated/concurrent calls share a single in-flight (or completed) warmup.\n // Reset to null on failure so a later prepare() can retry.\n let preparePromise: Promise<void> | null = null;\n\n // Handle worker messages\n worker.onmessage = (event: MessageEvent<WorkerResponse | { type: \"ready\" }>) => {\n const response = event.data;\n\n // Handle ready signal\n if (response.type === \"ready\") {\n return;\n }\n\n // Handle normal responses\n const pending = pendingRequests.get(response.id);\n if (pending) {\n pendingRequests.delete(response.id);\n\n if (response.success) {\n pending.resolve(response);\n } else {\n pending.reject(workerError(response.error, response.errorCode));\n }\n }\n };\n\n // Handle worker errors\n worker.onerror = (error) => {\n stopWorker(`Worker error: ${error.message}`);\n };\n\n // A response that cannot be deserialized arrives without its request id, so the request it\n // answered cannot be identified. Rather than leave that request pending forever, reject every\n // request in flight; the worker itself is unaffected and stays usable.\n worker.onmessageerror = () => {\n for (const pending of [...pendingRequests.values()]) {\n pending.reject(workerError(\n \"A worker response could not be deserialized, so every request in flight was rejected\",\n \"message_error\",\n ));\n }\n };\n\n /**\n * Send a request to the worker and wait for its response. Every way a request ends (a\n * response, a timeout, an abort, the worker stopping, or a failed post) goes through the\n * pending entry's resolve/reject, which clear its timer and abort listener exactly once.\n */\n function sendRequest<T extends WorkerResponse>(\n request: WorkerRequest,\n transfer?: Transferable[],\n requestOptions?: WorkerRequestOptions,\n ): Promise<T> {\n return new Promise((resolve, reject) => {\n if (!isWorkerActive) {\n reject(new Error(\"Worker has been terminated\"));\n return;\n }\n const signal = requestOptions?.signal;\n if (signal?.aborted) {\n reject(workerError(`The worker request \"${request.type}\" was aborted before it was sent`, \"aborted\"));\n return;\n }\n const timeoutMs = requestOptions?.timeoutMs ?? requestTimeoutMs;\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n let onAbort: (() => void) | undefined;\n const finish = (): void => {\n pendingRequests.delete(request.id);\n if (timer !== undefined) clearTimeout(timer);\n if (onAbort) signal?.removeEventListener(\"abort\", onAbort);\n };\n pendingRequests.set(request.id, {\n resolve: (value) => {\n finish();\n resolve(value);\n },\n reject: (error) => {\n finish();\n reject(error);\n },\n });\n const fail = (error: Error): void => pendingRequests.get(request.id)?.reject(error);\n\n if (timeoutMs !== undefined) {\n timer = setTimeout(() => fail(workerError(\n `The worker request \"${request.type}\" timed out after ${timeoutMs} ms`, \"timeout\")), timeoutMs);\n }\n if (signal) {\n onAbort = () => fail(workerError(`The worker request \"${request.type}\" was aborted`, \"aborted\"));\n signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n\n try {\n if (transfer && transfer.length > 0) {\n worker.postMessage(request, transfer);\n } else {\n worker.postMessage(request);\n }\n } catch (error) {\n fail(error instanceof Error ? error : new Error(String(error)));\n }\n });\n }\n\n // Initialize the worker\n try {\n await sendRequest({\n id: generateId(),\n type: \"init\",\n wasmBasePath,\n });\n } catch (error) {\n stopWorker(\"Worker initialization failed\");\n throw error;\n }\n\n // The instance, and any withRequestOptions views of it, share this worker; each view's\n // requests carry its options.\n const createApi = (requestOptions?: WorkerRequestOptions): WorkerDocxodus => {\n const send = <T extends WorkerResponse>(request: WorkerRequest, transfer?: Transferable[]): Promise<T> =>\n sendRequest<T>(request, transfer, requestOptions);\n\n return {\n async generatePackageManifest(\n document: File | Uint8Array,\n limits?: PackageManifestInspectionLimits,\n ): Promise<PackageManifest> {\n const bytes = await toBytes(document);\n const response = await send<WorkerGeneratePackageManifestResponse>(\n {\n id: generateId(),\n type: \"generatePackageManifest\",\n documentBytes: bytes,\n limits,\n representation: \"object\",\n },\n [bytes.buffer]\n );\n return requireField(response, \"manifest\");\n },\n\n async verifyDeliverable(\n document: File | Uint8Array,\n baseline?: File | Uint8Array,\n request?: DeliverableVerificationRequest,\n ): Promise<DeliverableVerificationResult> {\n const bytes = await toBytes(document);\n const baselineBytes = baseline === undefined ? undefined : await toBytes(baseline);\n const transfer: Transferable[] = [bytes.buffer];\n if (baselineBytes !== undefined) transfer.push(baselineBytes.buffer);\n const response = await send<WorkerVerifyDeliverableResponse>(\n {\n id: generateId(),\n type: \"verifyDeliverable\",\n documentBytes: bytes,\n baselineBytes,\n requestJson: request === undefined ? undefined : serializeVerificationRequest(request),\n },\n transfer\n );\n return requireField(response, \"verification\");\n },\n\n async proveRedlineReversibility(\n baseline: File | Uint8Array,\n intendedFinal: File | Uint8Array,\n redline: File | Uint8Array\n ): Promise<RedlineReversibilityProof> {\n const baselineBytes = await toBytes(baseline);\n const intendedFinalBytes = await toBytes(intendedFinal);\n const redlineBytes = await toBytes(redline);\n const response = await send<WorkerProveRedlineReversibilityResponse>(\n {\n id: generateId(),\n type: \"proveRedlineReversibility\",\n baselineBytes,\n intendedFinalBytes,\n redlineBytes,\n },\n [baselineBytes.buffer, intendedFinalBytes.buffer, redlineBytes.buffer]\n );\n return requireField(response, \"proof\");\n },\n\n async getSemanticChanges(\n left: File | Uint8Array,\n right: File | Uint8Array,\n settings?: DocxDiffSettings\n ): Promise<SemanticChangeSet> {\n const leftBytes = await toBytes(left);\n const rightBytes = await toBytes(right);\n const response = await send<WorkerGetSemanticChangesResponse>(\n {\n id: generateId(),\n type: \"getSemanticChanges\",\n leftBytes,\n rightBytes,\n settings,\n },\n [leftBytes.buffer, rightBytes.buffer]\n );\n return requireField(response, \"semanticChanges\");\n },\n\n async createExternalAnnotationSet(\n document: File | Uint8Array,\n documentId: string,\n ): Promise<ExternalAnnotationSet> {\n const bytes = await toBytes(document);\n const response = await send<WorkerCreateExternalAnnotationSetResponse>(\n { id: generateId(), type: \"createExternalAnnotationSet\", documentBytes: bytes, documentId },\n [bytes.buffer]\n );\n return requireField(response, \"annotationSet\");\n },\n\n async validateExternalAnnotations(\n document: File | Uint8Array,\n annotationSet: ExternalAnnotationSet,\n ): Promise<ExternalAnnotationValidationResult> {\n const bytes = await toBytes(document);\n const response = await send<WorkerValidateExternalAnnotationsResponse>(\n { id: generateId(), type: \"validateExternalAnnotations\", documentBytes: bytes, annotationSet },\n [bytes.buffer]\n );\n return requireField(response, \"validation\");\n },\n\n async projectAnnotationsOntoHtml(\n html: string,\n annotationSet: ExternalAnnotationSet,\n projectionOptions?: ExternalAnnotationProjectionSettings,\n ): Promise<string> {\n const response = await send<WorkerProjectAnnotationsOntoHtmlResponse>({\n id: generateId(),\n type: \"projectAnnotationsOntoHtml\",\n html,\n annotationSet,\n projectionOptions,\n });\n return requireField(response, \"html\");\n },\n\n async convertDocxToHtmlWithExternalAnnotations(\n document: File | Uint8Array,\n annotationSet: ExternalAnnotationSet,\n conversionOptions?: ConversionOptions,\n projectionOptions?: ExternalAnnotationProjectionSettings,\n ): Promise<string> {\n const bytes = await toBytes(document);\n const response = await send<WorkerConvertWithExternalAnnotationsResponse>(\n {\n id: generateId(),\n type: \"convertDocxToHtmlWithExternalAnnotations\",\n documentBytes: bytes,\n annotationSet,\n conversionOptions,\n projectionOptions,\n },\n [bytes.buffer]\n );\n return requireField(response, \"html\");\n },\n\n async exportToOpenContract(document: File | Uint8Array): Promise<OpenContractDocExport> {\n const bytes = await toBytes(document);\n const response = await send<WorkerExportToOpenContractResponse>(\n { id: generateId(), type: \"exportToOpenContract\", documentBytes: bytes },\n [bytes.buffer]\n );\n return requireField(response, \"export\");\n },\n\n async generatePackageManifestJson(\n document: File | Uint8Array,\n limits?: PackageManifestInspectionLimits,\n ): Promise<string> {\n const bytes = await toBytes(document);\n const response = await send<WorkerGeneratePackageManifestResponse>(\n {\n id: generateId(),\n type: \"generatePackageManifest\",\n documentBytes: bytes,\n limits,\n representation: \"json\",\n },\n [bytes.buffer],\n );\n return requireField(response, \"manifestJson\");\n },\n\n async projectReviewProfile(\n document: File | Uint8Array,\n profile: \"final\" | \"original\",\n maximumOutputBytes?: number,\n ): Promise<Uint8Array> {\n const bytes = await toBytes(document);\n const response = await send<WorkerProjectReviewProfileResponse>(\n {\n id: generateId(),\n type: \"projectReviewProfile\",\n documentBytes: bytes,\n profile,\n maximumOutputBytes,\n },\n [bytes.buffer],\n );\n if (!response.documentBytes || response.documentBytes.byteLength === 0) {\n throw new Error(`Failed to derive the ${profile} review profile`);\n }\n return response.documentBytes;\n },\n\n async convertDocxToHtml(\n document: File | Uint8Array,\n options?: ConversionOptions,\n maximumOutputBytes?: number,\n ): Promise<string> {\n const bytes = await toBytes(document);\n const response = await send<WorkerConvertResponse>(\n {\n id: generateId(),\n type: \"convertDocxToHtml\",\n documentBytes: bytes,\n options,\n maximumOutputBytes,\n },\n [bytes.buffer]\n );\n return requireField(response, \"html\");\n },\n\n async compareDocuments(\n original: File | Uint8Array,\n modified: File | Uint8Array,\n options?: CompareOptions\n ): Promise<Uint8Array> {\n const originalBytes = await toBytes(original);\n const modifiedBytes = await toBytes(modified);\n const response = await send<WorkerCompareResponse>(\n {\n id: generateId(),\n type: \"compareDocuments\",\n originalBytes,\n modifiedBytes,\n options,\n },\n [originalBytes.buffer, modifiedBytes.buffer]\n );\n return requireField(response, \"documentBytes\");\n },\n\n async compareDocumentsToHtml(\n original: File | Uint8Array,\n modified: File | Uint8Array,\n options?: CompareOptions\n ): Promise<string> {\n const originalBytes = await toBytes(original);\n const modifiedBytes = await toBytes(modified);\n const response = await send<WorkerCompareToHtmlResponse>(\n {\n id: generateId(),\n type: \"compareDocumentsToHtml\",\n originalBytes,\n modifiedBytes,\n options,\n },\n [originalBytes.buffer, modifiedBytes.buffer]\n );\n return requireField(response, \"html\");\n },\n\n async getRevisions(\n document: File | Uint8Array\n ): Promise<RevisionListEntry[]> {\n const bytes = await toBytes(document);\n const response = await send<WorkerGetRevisionsResponse>(\n {\n id: generateId(),\n type: \"getRevisions\",\n documentBytes: bytes,\n },\n [bytes.buffer]\n );\n return requireField(response, \"revisions\");\n },\n\n async getComments(document: File | Uint8Array): Promise<CommentListEntry[]> {\n const bytes = await toBytes(document);\n const response = await send<WorkerGetCommentsResponse>(\n { id: generateId(), type: \"getComments\", documentBytes: bytes },\n [bytes.buffer]\n );\n return requireField(response, \"comments\");\n },\n\n async getDocumentMetadata(\n document: File | Uint8Array\n ): Promise<DocumentMetadata> {\n const bytes = await toBytes(document);\n const response = await send<WorkerGetDocumentMetadataResponse>(\n {\n id: generateId(),\n type: \"getDocumentMetadata\",\n documentBytes: bytes,\n },\n [bytes.buffer]\n );\n return requireField(response, \"metadata\");\n },\n\n async getVersion(): Promise<VersionInfo> {\n const response = await send<WorkerGetVersionResponse>({\n id: generateId(),\n type: \"getVersion\",\n });\n return requireField(response, \"version\");\n },\n\n prepare(): Promise<void> {\n // Idempotent: hand back the existing warmup if one is in flight or done.\n if (preparePromise) {\n return preparePromise;\n }\n preparePromise = send<WorkerPrepareResponse>({\n id: generateId(),\n type: \"prepare\",\n }).then(() => undefined);\n // On failure, clear the cache so a subsequent prepare() can retry.\n preparePromise.catch(() => {\n preparePromise = null;\n });\n return preparePromise;\n },\n\n async openDocxSession(\n document: File | Uint8Array,\n settings?: DocxSessionSettings\n ): Promise<WorkerDocxSession> {\n const bytes = await toBytes(document);\n const settingsJson = settings ? JSON.stringify(settings) : \"\";\n const openResponse = await send<WorkerSessionOpenResponse>(\n {\n id: generateId(),\n type: \"sessionOpen\",\n documentBytes: bytes,\n settingsJson,\n },\n [bytes.buffer]\n );\n\n const handle = requireField(openResponse, \"handle\");\n\n return {\n async getPackageManifest(): Promise<PackageManifest> {\n const res = await send<WorkerSessionGetPackageManifestResponse>({\n id: generateId(),\n type: \"sessionGetPackageManifest\",\n handle,\n });\n return requireField(res, \"manifest\");\n },\n\n async getSemanticChanges(): Promise<SemanticChangeSet> {\n const res = await send<WorkerSessionGetSemanticChangesResponse>({\n id: generateId(),\n type: \"sessionGetSemanticChanges\",\n handle,\n });\n return requireField(res, \"semanticChanges\");\n },\n\n async verifyDeliverable(\n request?: DeliverableVerificationRequest,\n ): Promise<DeliverableVerificationResult> {\n const res = await send<WorkerSessionVerifyDeliverableResponse>({\n id: generateId(),\n type: \"sessionVerifyDeliverable\",\n handle,\n requestJson: request === undefined ? undefined : serializeVerificationRequest(request),\n });\n return requireField(res, \"verification\");\n },\n\n async addAnnotation(\n anchorId: string,\n span: CharSpan | null,\n annotation: DocumentAnnotation\n ): Promise<EditResult> {\n const res = await send<WorkerSessionEditResponse>({\n id: generateId(),\n type: \"sessionAddAnnotation\",\n handle,\n anchorId,\n spanJson: span ? JSON.stringify(span) : \"\",\n annotationJson: JSON.stringify(annotation),\n });\n return requireField(res, \"result\");\n },\n\n async removeAnnotation(annotationId: string): Promise<EditResult> {\n const res = await send<WorkerSessionEditResponse>({\n id: generateId(),\n type: \"sessionRemoveAnnotation\",\n handle,\n annotationId,\n });\n return requireField(res, \"result\");\n },\n\n async updateAnnotation(\n annotationId: string,\n update: AnnotationUpdate\n ): Promise<EditResult> {\n const res = await send<WorkerSessionEditResponse>({\n id: generateId(),\n type: \"sessionUpdateAnnotation\",\n handle,\n annotationId,\n updateJson: JSON.stringify(update),\n });\n return requireField(res, \"result\");\n },\n\n async moveAnnotation(\n annotationId: string,\n newAnchorId: string,\n newSpan: CharSpan | null\n ): Promise<EditResult> {\n const res = await send<WorkerSessionEditResponse>({\n id: generateId(),\n type: \"sessionMoveAnnotation\",\n handle,\n annotationId,\n newAnchorId,\n newSpanJson: newSpan ? JSON.stringify(newSpan) : \"\",\n });\n return requireField(res, \"result\");\n },\n\n async close(): Promise<void> {\n // Not abortable: an aborted view must still release the in-worker session handle.\n await sendRequest(\n { id: generateId(), type: \"sessionClose\", handle },\n undefined,\n { timeoutMs: requestOptions?.timeoutMs },\n );\n },\n };\n },\n\n terminate(): void {\n stopWorker(\"Worker terminated\");\n },\n\n withRequestOptions(more: WorkerRequestOptions): WorkerDocxodus {\n checkTimeout(more.timeoutMs, \"timeoutMs\");\n return createApi({ ...requestOptions, ...more });\n },\n\n isActive(): boolean {\n return isWorkerActive;\n },\n };\n };\n\n return createApi();\n}\n\n/**\n * Check if Web Workers are supported in the current environment.\n */\nexport function isWorkerSupported(): boolean {\n return typeof Worker !== \"undefined\";\n}\n"],
|
|
5
|
+
"mappings": "AAWO,SAASA,EAA6BC,EAAiD,CAC5F,GAAIA,IAAY,MAAQ,OAAOA,GAAY,UAAY,MAAM,QAAQA,CAAO,EAC1E,MAAM,IAAI,WAAW,0CAA0C,EAEjE,GAAM,CAAE,mBAAAC,EAAoB,GAAGC,CAAK,EAAIF,EAClCG,EAAgC,CAAE,GAAGD,CAAK,EAChD,OAAID,IAAuB,SACzBE,EAAK,mBAAqBF,EAAmB,IAAIG,CAAe,GAE3D,KAAK,UAAUD,CAAI,CAC5B,CAEA,SAASC,EAAgBC,EAAsE,CAC7F,GAAM,CAAE,MAAAC,EAAO,GAAGJ,CAAK,EAAIG,EACrBF,EAAgC,CAAE,GAAGD,CAAK,EAChD,OAAII,IAAU,SAAWH,EAAK,SAAWI,EAAcD,CAAK,GACrDH,CACT,CAEA,SAASI,EAAcD,EAA2B,CAChD,GAAI,OAAO,MAAS,WAAY,CAC9B,IAAIE,EAAS,GAEb,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAK,MAAW,CAChD,IAAMC,EAAQJ,EAAM,SAASG,EAAGA,EAAI,KAAS,EAC7CD,GAAU,OAAO,aAAa,MAAM,KAAME,CAA4B,CACxE,CACA,OAAO,KAAKF,CAAM,CACpB,CACA,OAAO,OAAO,KAAKF,CAAK,EAAE,SAAS,QAAQ,CAC7C,CCwCO,IAAMK,EAAN,cAAmC,KAAM,CAG9C,YAAYC,EAAiBC,EAAwB,CACnD,MAAMD,CAAO,EACb,KAAK,KAA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ACnC,EAEA,MAAM,iBAAiBI,EAA2C,CAChE,IAAMJ,EAAM,MAAM7B,EAAgC,CAChD,GAAIhC,EAAW,EACf,KAAM,0BACN,OAAA4D,EACA,aAAAK,CACF,CAAC,EACD,OAAO1E,EAAasE,EAAK,QAAQ,CACnC,EAEA,MAAM,iBACJI,EACAC,EACqB,CACrB,IAAML,EAAM,MAAM7B,EAAgC,CAChD,GAAIhC,EAAW,EACf,KAAM,0BACN,OAAA4D,EACA,aAAAK,EACA,WAAY,KAAK,UAAUC,CAAM,CACnC,CAAC,EACD,OAAO3E,EAAasE,EAAK,QAAQ,CACnC,EAEA,MAAM,eACJI,EACAE,EACAC,EACqB,CACrB,IAAMP,EAAM,MAAM7B,EAAgC,CAChD,GAAIhC,EAAW,EACf,KAAM,wBACN,OAAA4D,EACA,aAAAK,EACA,YAAAE,EACA,YAAaC,EAAU,KAAK,UAAUA,CAAO,EAAI,EACnD,CAAC,EACD,OAAO7E,EAAasE,EAAK,QAAQ,CACnC,EAEA,MAAM,OAAuB,CAE3B,MAAMzC,EACJ,CAAE,GAAIpB,EAAW,EAAG,KAAM,eAAgB,OAAA4D,CAAO,EACjD,OACA,CAAE,UAAWrC,GAAgB,SAAU,CACzC,CACF,CACF,CACF,EAEA,WAAkB,CAChBP,EAAW,mBAAmB,CAChC,EAEA,mBAAmBqD,EAA4C,CAC7D,OAAA1E,EAAa0E,EAAK,UAAW,WAAW,EACjCtC,EAAU,CAAE,GAAGR,EAAgB,GAAG8C,CAAK,CAAC,CACjD,EAEA,UAAoB,CAClB,OAAOvD,CACT,CACF,CACF,EAEA,OAAOiB,EAAU,CACnB,CAKO,SAASuC,GAA6B,CAC3C,OAAO,OAAO,OAAW,GAC3B",
|
|
6
|
+
"names": ["serializeVerificationRequest", "request", "companionArtifacts", "rest", "wire", "encodeCompanion", "artifact", "bytes", "bytesToBase64", "binary", "i", "chunk", "WorkerOperationError", "message", "code", "workerError", "requireField", "response", "field", "value", "checkTimeout", "timeoutMs", "name", "workerErrorCode", "error", "generateId", "toBytes", "document", "buffer", "deriveWasmBasePath", "scripts", "src", "createWorkerDocxodus", "options", "requestTimeoutMs", "wasmBasePath", "workerScriptPath", "worker", "pendingRequests", "isWorkerActive", "abortListener", "stopWorker", "pending", "preparePromise", "event", "sendRequest", "request", "transfer", "requestOptions", "resolve", "reject", "signal", "timer", "onAbort", "finish", "fail", "createApi", "send", "limits", "bytes", "baseline", "baselineBytes", "serializeVerificationRequest", "intendedFinal", "redline", "intendedFinalBytes", "redlineBytes", "left", "right", "settings", "leftBytes", "rightBytes", "documentId", "annotationSet", "html", "projectionOptions", "conversionOptions", "profile", "maximumOutputBytes", "original", "modified", "originalBytes", "modifiedBytes", "settingsJson", "openResponse", "handle", "res", "anchorId", "span", "annotation", "annotationId", "update", "newAnchorId", "newSpan", "more", "isWorkerSupported"]
|
|
7
|
+
}
|
package/dist/worker-proxy.d.ts
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* docxodus.terminate();
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
import type { DeliverableVerificationRequest, ExternalAnnotationSet, ExternalAnnotationValidationResult, ExternalAnnotationProjectionSettings, OpenContractDocExport, WorkerDocxodusOptions, ConversionOptions, CompareOptions, DocxDiffSettings, RevisionListEntry, CommentListEntry, VersionInfo, DocumentMetadata, DocxSessionSettings, DocumentAnnotation, AnnotationUpdate, CharSpan, EditResult, PackageManifest, DeliverableVerificationResult, RedlineReversibilityProof, SemanticChangeSet, PackageManifestInspectionLimits, WorkerErrorCode } from "./types.js";
|
|
21
|
+
import type { DeliverableVerificationRequest, ExternalAnnotationSet, ExternalAnnotationValidationResult, ExternalAnnotationProjectionSettings, OpenContractDocExport, WorkerDocxodusOptions, ConversionOptions, CompareOptions, DocxDiffSettings, RevisionListEntry, CommentListEntry, VersionInfo, DocumentMetadata, DocxSessionSettings, DocumentAnnotation, AnnotationUpdate, CharSpan, EditResult, PackageManifest, DeliverableVerificationResult, RedlineReversibilityProof, SemanticChangeSet, PackageManifestInspectionLimits, WorkerErrorCode, WorkerRequestOptions } from "./types.js";
|
|
22
|
+
export type { WorkerDocxodusOptions, WorkerErrorCode, WorkerRequestOptions } from "./types.js";
|
|
22
23
|
/**
|
|
23
24
|
* Rejection carrying the worker's machine-readable cause. Callers classify failures with
|
|
24
25
|
* {@link workerErrorCode}; `message` is diagnostic text whose wording is not a contract.
|
|
@@ -206,6 +207,18 @@ export interface WorkerDocxodus {
|
|
|
206
207
|
* @returns A proxied session whose methods are off-main-thread
|
|
207
208
|
*/
|
|
208
209
|
openDocxSession(document: File | Uint8Array, settings?: DocxSessionSettings): Promise<WorkerDocxSession>;
|
|
210
|
+
/**
|
|
211
|
+
* A view of this instance whose requests carry `options`: an `AbortSignal` that rejects each
|
|
212
|
+
* request it is passed to, and a `timeoutMs` deadline that overrides the instance's
|
|
213
|
+
* `requestTimeoutMs`. The view shares this instance's worker, so terminating either terminates
|
|
214
|
+
* both. Sessions opened through the view inherit its options, except that
|
|
215
|
+
* {@link WorkerDocxSession.close} ignores the signal so a session handle is always released.
|
|
216
|
+
*
|
|
217
|
+
* Rejecting a request does not stop work the worker has already started: the WASM engine runs
|
|
218
|
+
* on the worker's single thread, so a request that was aborted or timed out is most likely still
|
|
219
|
+
* running, and later requests queue behind it. Call {@link terminate} to stop it.
|
|
220
|
+
*/
|
|
221
|
+
withRequestOptions(options: WorkerRequestOptions): WorkerDocxodus;
|
|
209
222
|
/**
|
|
210
223
|
* Terminate the worker.
|
|
211
224
|
* After calling this, the instance cannot be used anymore.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-proxy.d.ts","sourceRoot":"","sources":["../src/worker-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAMV,8BAA8B,EAW9B,qBAAqB,EACrB,kCAAkC,EAClC,oCAAoC,EACpC,qBAAqB,EAWrB,qBAAqB,EACrB,iBAAiB,EACjB,c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