@laminapdf/wasm 0.0.0-stage → 0.2.0-alpha.3
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 +21 -2
- package/dist/lamina_pdf_base.d.ts +1268 -0
- package/dist/lamina_pdf_base.js +1718 -0
- package/dist/lamina_pdf_base.wasm +0 -0
- package/dist/lamina_pdf_extract.d.ts +1450 -0
- package/dist/lamina_pdf_extract.js +1808 -0
- package/dist/lamina_pdf_extract.wasm +0 -0
- package/dist/lamina_pdf_render_hayro.d.ts +114 -0
- package/dist/lamina_pdf_render_hayro.js +459 -0
- package/dist/lamina_pdf_render_hayro.wasm +0 -0
- package/dist/lamina_pdf_text.d.ts +1692 -0
- package/dist/lamina_pdf_text.js +1973 -0
- package/dist/lamina_pdf_text.wasm +0 -0
- package/package.json +60 -3
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@laminapdf/wasm`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lamina PDF's WebAssembly modules and their [wasm-bindgen](https://github.com/wasm-bindgen/wasm-bindgen) glue. The package is private: use [`@laminapdf/sdk`](../sdk/README.md), which is built on it. This package is its raw layer.
|
|
4
|
+
|
|
5
|
+
| Export | File | What it has |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `@laminapdf/wasm/base` | `dist/lamina_pdf_base.js`, `.d.ts`, `lamina_pdf_base.wasm` | Open, read, edit with ops, undo, save (save jobs, warnings); build vector and image pages with links, outline, labels, metadata |
|
|
8
|
+
| `@laminapdf/wasm/text` | `dist/lamina_pdf_text.js`, `.d.ts`, `lamina_pdf_text.wasm` | All of base, plus fonts (`fontBytes`, `standardFont`), `text` and `textBox`, and `WasmPage.text` |
|
|
9
|
+
| `@laminapdf/wasm/extract` | `dist/lamina_pdf_extract.js`, `.d.ts`, `lamina_pdf_extract.wasm` | All of base, plus `WasmPage.text` (text extraction) |
|
|
10
|
+
|
|
11
|
+
Each glue module exports a default async `init(input)` (a URL, `Response`, bytes or `WebAssembly.Module`) and `initSync({ module })`; after either, every call is synchronous. Errors are thrown as Lamina PDF's error object, the same fields as `LaminaPdfError`'s. Paths are flat `Float64Array`s (verb, numbers…: `0 x y` moveTo, `1 x y` lineTo, `2 x1 y1 x2 y2 x y` cubicTo, `3 x1 y1 x y` quadTo, `4` close, `5 x y w h` rect, `6 x y w h` ellipse, `7 cx cy r` circle), colours arrays of 1, 3 or 4 components.
|
|
12
|
+
|
|
13
|
+
## For contributors
|
|
14
|
+
|
|
15
|
+
The modules are built from [`crates/laminapdf-wasm`](../../crates/laminapdf-wasm) by `cargo xtask wasm` into `dist/`, which is generated and gitignored; this `package.json` is committed so `pnpm install --frozen-lockfile` works before a build ([ADR 0002](../../docs/decisions/0002-binding-strategy.md) §2). The package design is [ADR 0016](../../docs/decisions/0016-package-design.md) and the error object [ADR 0026](../../docs/decisions/0026-error-and-diagnostic-contract.md) §1.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
cargo xtask wasm # build both modules into dist/, run the wasm-bindgen-test suite and test/smoke.test.ts (Node)
|
|
19
|
+
cargo xtask size # raw/gzip/brotli per module and min+gzip glue vs size-budgets.json; writes target/size-report.json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`size-budgets.json` holds the budgets ADR 0016 §6 decides and the baseline the 5 % growth report compares with (`cargo xtask size --update-baseline` rewrites the baseline).
|