@laminapdf/render 0.2.0-alpha.6 → 0.2.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @laminapdf/render
|
|
2
2
|
|
|
3
|
-
The interface Lamina PDF's web renderers share, the TypeScript twin of the Rust `laminapdf-render` crate. Two packages implement it: [`@laminapdf/render-pdfium`](../render-pdfium/README.md), the default, and [`@laminapdf/render-hayro`](../render-hayro/README.md), a second engine to compare against and debug with. Both run inside the viewer's document Web Worker. It's on npm as
|
|
3
|
+
The interface Lamina PDF's web renderers share, the TypeScript twin of the Rust `laminapdf-render` crate. Two packages implement it: [`@laminapdf/render-pdfium`](../render-pdfium/README.md), the default, and [`@laminapdf/render-hayro`](../render-hayro/README.md), a second engine to compare against and debug with. Both run inside the viewer's document Web Worker. It's on npm as `@laminapdf/render`; most apps reach it through `@laminapdf/viewer`.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
const backend = await initPdfium(wasmUrl); // or initHayro()
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The codes a render backend throws (ADR 0026).
|
|
3
|
+
*
|
|
4
|
+
* @since 0.2.0
|
|
5
|
+
*/
|
|
6
|
+
export type RenderErrorCode = "render-too-large" | "render-failed" | "render-backend-unavailable" | "export-failed" | "invalid-argument" | "page-index-out-of-range" | "password-required" | "wrong-password" | "data-pending" | "source" | "cancelled" | "disposed";
|
|
7
|
+
/**
|
|
8
|
+
* What kind of failure a render code is (the ADR 0026 kinds its codes use).
|
|
9
|
+
*
|
|
10
|
+
* @since 0.2.0
|
|
11
|
+
*/
|
|
12
|
+
export type RenderErrorKind = "limit" | "input" | "io" | "internal" | "usage" | "security" | "state" | "cancelled";
|
|
5
13
|
/** The kind of each render code. */
|
|
6
14
|
export declare const KINDS: {
|
|
7
15
|
readonly [C in RenderErrorCode]: RenderErrorKind;
|
|
8
16
|
};
|
|
9
17
|
/** Where each code's page is (ADR 0026 §6): `${base}${code}${suffix}`. */
|
|
10
18
|
export declare const DOCS_URL: {
|
|
11
|
-
readonly base: "https://
|
|
12
|
-
readonly suffix: "
|
|
19
|
+
readonly base: "https://docs.laminapdf.com/reference/codes/";
|
|
20
|
+
readonly suffix: "/";
|
|
13
21
|
};
|
|
14
22
|
//# sourceMappingURL=codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/generated/codes.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/generated/codes.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,eAAe,GACf,4BAA4B,GAC5B,eAAe,GACf,kBAAkB,GAClB,yBAAyB,GACzB,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,QAAQ,GACR,WAAW,GACX,UAAU,CAAC;AAEf;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,OAAO,GACP,IAAI,GACJ,UAAU,GACV,OAAO,GACP,UAAU,GACV,OAAO,GACP,WAAW,CAAC;AAEhB,oCAAoC;AACpC,eAAO,MAAM,KAAK,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,eAAe,GAAG,eAAe;CAarE,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,QAAQ;aAAK,IAAI,EAAE,6CAA6C;aAAE,MAAM,EAAE,GAAG;CAAW,CAAC"}
|
package/dist/generated/codes.js
CHANGED
|
@@ -5,6 +5,7 @@ export const KINDS = {
|
|
|
5
5
|
"render-too-large": "limit",
|
|
6
6
|
"render-failed": "input",
|
|
7
7
|
"render-backend-unavailable": "io",
|
|
8
|
+
"export-failed": "internal",
|
|
8
9
|
"invalid-argument": "usage",
|
|
9
10
|
"page-index-out-of-range": "usage",
|
|
10
11
|
"password-required": "security",
|
|
@@ -15,5 +16,5 @@ export const KINDS = {
|
|
|
15
16
|
"disposed": "state",
|
|
16
17
|
};
|
|
17
18
|
/** Where each code's page is (ADR 0026 §6): `${base}${code}${suffix}`. */
|
|
18
|
-
export const DOCS_URL = { base: "https://
|
|
19
|
+
export const DOCS_URL = { base: "https://docs.laminapdf.com/reference/codes/", suffix: "/" };
|
|
19
20
|
//# sourceMappingURL=codes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../../src/generated/codes.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,oHAAoH;
|
|
1
|
+
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../../src/generated/codes.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,oHAAoH;AAoCpH,oCAAoC;AACpC,MAAM,CAAC,MAAM,KAAK,GAAyD;IACzE,kBAAkB,EAAE,OAAO;IAC3B,eAAe,EAAE,OAAO;IACxB,4BAA4B,EAAE,IAAI;IAClC,eAAe,EAAE,UAAU;IAC3B,kBAAkB,EAAE,OAAO;IAC3B,yBAAyB,EAAE,OAAO;IAClC,mBAAmB,EAAE,UAAU;IAC/B,gBAAgB,EAAE,UAAU;IAC5B,cAAc,EAAE,OAAO;IACvB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,OAAO;CACpB,CAAC;AAEF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,6CAA6C,EAAE,MAAM,EAAE,GAAG,EAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laminapdf/render",
|
|
3
|
-
"version": "0.2.0
|
|
4
|
-
"description": "The web
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The interface Lamina PDF's web viewer renders PDF pages through: a page tile as RGBA pixels, shared by @laminapdf/render-pdfium and @laminapdf/render-hayro.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"homepage": "https://laminapdf.com",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/laudebugs/laminapdf/issues"
|
|
9
|
+
},
|
|
7
10
|
"repository": {
|
|
8
11
|
"type": "git",
|
|
9
12
|
"url": "git+https://github.com/laudebugs/laminapdf.git",
|
|
@@ -12,8 +15,10 @@
|
|
|
12
15
|
"keywords": [
|
|
13
16
|
"pdf",
|
|
14
17
|
"render",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
18
|
+
"rendering",
|
|
19
|
+
"pdf-renderer",
|
|
20
|
+
"canvas",
|
|
21
|
+
"typescript"
|
|
17
22
|
],
|
|
18
23
|
"type": "module",
|
|
19
24
|
"sideEffects": false,
|