feat(domain): V1-2.2 wasm facade, contract types, module proofs

PreviewBuilder, PreviewSheet and clean_svg on the browser module, the
31 ts-rs types and their index, the glue interface, and the proofs on
the shipped module; the module stays under its 600 KB budget.
This commit is contained in:
bchanot committed 2026-10-29 13:14:22 +01:00
1 parent cf37aa265a
commit 8ae756534c
37 files changed
+558

No files matched your search

+24
View File
@@ -26,6 +26,30 @@ export interface GlueModule {
FileBytes: new (expected: number) => GlueFileBytes
/** R4.6: the incremental export; the constructor throws `<kind>: <detail>` on a refused input. */
ExportSession: new (inputJson: string) => GlueExportSession
/** V1-2.2: a stored version gathered for preview (drawings first, then `build`). */
PreviewBuilder: new () => GluePreviewBuilder
/** V1-2.2: the cleaning answer for a file picked for upload (`SvgCleaning` envelope). */
clean_svg(bytes: Uint8Array): string
}
/** A stored version being gathered (crates/wasm `PreviewBuilder`). */
export interface GluePreviewBuilder {
add_drawing(assetId: string, sha256: string, bytes: Uint8Array): void
/** Consumes the builder; throws `<kind>: <detail>` (`invalid_document`, `drawing_missing`,
* `drawing_hash_mismatch`, `fingerprint_mismatch`, `caps`, `invalid_shape`, `invalid_json`). */
build(inputJson: string): GluePreviewSheet
free(): void
}
/** A stored version loaded for the catalogue, the preview and the editor (crates/wasm
* `PreviewSheet`): no report migration map, never a report session. */
export interface GluePreviewSheet {
/** `preview.state` or `view.canvas`; outcome envelopes out. */
call(op: string, input: string): string
/** A draft's document after an edit, the drawings kept as read. */
replace_document(text: string): string
add_drawing(assetId: string, sha256: string, bytes: Uint8Array): string
free(): void
}
/** The export session of the module (crates/wasm `ExportSession`): outcome envelopes out. */