@laminapdf/sdk 0.0.0-stage → 0.2.0-alpha.2

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.
Files changed (139) hide show
  1. package/README.md +208 -2
  2. package/dist/api.d.ts +23 -0
  3. package/dist/api.d.ts.map +1 -0
  4. package/dist/api.js +11 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/builder.d.ts +319 -0
  7. package/dist/builder.d.ts.map +1 -0
  8. package/dist/builder.js +540 -0
  9. package/dist/builder.js.map +1 -0
  10. package/dist/defined.d.ts +5 -0
  11. package/dist/defined.d.ts.map +1 -0
  12. package/dist/defined.js +7 -0
  13. package/dist/defined.js.map +1 -0
  14. package/dist/document.d.ts +241 -0
  15. package/dist/document.d.ts.map +1 -0
  16. package/dist/document.js +427 -0
  17. package/dist/document.js.map +1 -0
  18. package/dist/entry/node.d.ts +30 -0
  19. package/dist/entry/node.d.ts.map +1 -0
  20. package/dist/entry/node.js +37 -0
  21. package/dist/entry/node.js.map +1 -0
  22. package/dist/entry/workerd.d.ts +30 -0
  23. package/dist/entry/workerd.d.ts.map +1 -0
  24. package/dist/entry/workerd.js +37 -0
  25. package/dist/entry/workerd.js.map +1 -0
  26. package/dist/errors.d.ts +102 -0
  27. package/dist/errors.d.ts.map +1 -0
  28. package/dist/errors.js +137 -0
  29. package/dist/errors.js.map +1 -0
  30. package/dist/explain.d.ts +20 -0
  31. package/dist/explain.d.ts.map +1 -0
  32. package/dist/explain.js +14 -0
  33. package/dist/explain.js.map +1 -0
  34. package/dist/font.d.ts +66 -0
  35. package/dist/font.d.ts.map +1 -0
  36. package/dist/font.js +103 -0
  37. package/dist/font.js.map +1 -0
  38. package/dist/generated/builder-enums.d.ts +29 -0
  39. package/dist/generated/builder-enums.d.ts.map +1 -0
  40. package/dist/generated/builder-enums.js +80 -0
  41. package/dist/generated/builder-enums.js.map +1 -0
  42. package/dist/generated/codes.d.ts +97 -0
  43. package/dist/generated/codes.d.ts.map +1 -0
  44. package/dist/generated/codes.js +453 -0
  45. package/dist/generated/codes.js.map +1 -0
  46. package/dist/generated/explain.d.ts +6 -0
  47. package/dist/generated/explain.d.ts.map +1 -0
  48. package/dist/generated/explain.js +138 -0
  49. package/dist/generated/explain.js.map +1 -0
  50. package/dist/index.d.ts +30 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +37 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/init.d.ts +80 -0
  55. package/dist/init.d.ts.map +1 -0
  56. package/dist/init.js +127 -0
  57. package/dist/init.js.map +1 -0
  58. package/dist/loader/fetch.d.ts +3 -0
  59. package/dist/loader/fetch.d.ts.map +1 -0
  60. package/dist/loader/fetch.js +2 -0
  61. package/dist/loader/fetch.js.map +1 -0
  62. package/dist/loader/node.d.ts +3 -0
  63. package/dist/loader/node.d.ts.map +1 -0
  64. package/dist/loader/node.js +9 -0
  65. package/dist/loader/node.js.map +1 -0
  66. package/dist/loader/workerd.d.ts +3 -0
  67. package/dist/loader/workerd.d.ts.map +1 -0
  68. package/dist/loader/workerd.js +15 -0
  69. package/dist/loader/workerd.js.map +1 -0
  70. package/dist/matrix.d.ts +16 -0
  71. package/dist/matrix.d.ts.map +1 -0
  72. package/dist/matrix.js +36 -0
  73. package/dist/matrix.js.map +1 -0
  74. package/dist/path.d.ts +34 -0
  75. package/dist/path.d.ts.map +1 -0
  76. package/dist/path.js +49 -0
  77. package/dist/path.js.map +1 -0
  78. package/dist/source/http.d.ts +36 -0
  79. package/dist/source/http.d.ts.map +1 -0
  80. package/dist/source/http.js +211 -0
  81. package/dist/source/http.js.map +1 -0
  82. package/dist/source/range.d.ts +70 -0
  83. package/dist/source/range.d.ts.map +1 -0
  84. package/dist/source/range.js +96 -0
  85. package/dist/source/range.js.map +1 -0
  86. package/dist/text.d.ts +90 -0
  87. package/dist/text.d.ts.map +1 -0
  88. package/dist/text.js +127 -0
  89. package/dist/text.js.map +1 -0
  90. package/dist/transaction.d.ts +36 -0
  91. package/dist/transaction.d.ts.map +1 -0
  92. package/dist/transaction.js +47 -0
  93. package/dist/transaction.js.map +1 -0
  94. package/dist/types.d.ts +79 -0
  95. package/dist/types.d.ts.map +1 -0
  96. package/dist/types.js +2 -0
  97. package/dist/types.js.map +1 -0
  98. package/dist/version.d.ts +3 -0
  99. package/dist/version.d.ts.map +1 -0
  100. package/dist/version.js +6 -0
  101. package/dist/version.js.map +1 -0
  102. package/dist/worker/client.d.ts +87 -0
  103. package/dist/worker/client.d.ts.map +1 -0
  104. package/dist/worker/client.js +405 -0
  105. package/dist/worker/client.js.map +1 -0
  106. package/dist/worker/emitter.d.ts +12 -0
  107. package/dist/worker/emitter.d.ts.map +1 -0
  108. package/dist/worker/emitter.js +34 -0
  109. package/dist/worker/emitter.js.map +1 -0
  110. package/dist/worker/entry.d.ts +2 -0
  111. package/dist/worker/entry.d.ts.map +1 -0
  112. package/dist/worker/entry.js +4 -0
  113. package/dist/worker/entry.js.map +1 -0
  114. package/dist/worker/index.d.ts +7 -0
  115. package/dist/worker/index.d.ts.map +1 -0
  116. package/dist/worker/index.js +4 -0
  117. package/dist/worker/index.js.map +1 -0
  118. package/dist/worker/protocol.d.ts +82 -0
  119. package/dist/worker/protocol.d.ts.map +1 -0
  120. package/dist/worker/protocol.js +11 -0
  121. package/dist/worker/protocol.js.map +1 -0
  122. package/dist/worker/server.d.ts +51 -0
  123. package/dist/worker/server.d.ts.map +1 -0
  124. package/dist/worker/server.js +460 -0
  125. package/dist/worker/server.js.map +1 -0
  126. package/dist/worker/support.d.ts +39 -0
  127. package/dist/worker/support.d.ts.map +1 -0
  128. package/dist/worker/support.js +25 -0
  129. package/dist/worker/support.js.map +1 -0
  130. package/dist/worker/transfer.d.ts +3 -0
  131. package/dist/worker/transfer.d.ts.map +1 -0
  132. package/dist/worker/transfer.js +13 -0
  133. package/dist/worker/transfer.js.map +1 -0
  134. package/dist/worker/types.d.ts +43 -0
  135. package/dist/worker/types.d.ts.map +1 -0
  136. package/dist/worker/types.js +2 -0
  137. package/dist/worker/types.js.map +1 -0
  138. package/package.json +91 -3
  139. package/schemas/error.schema.json +288 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.js","sourceRoot":"","sources":["../src/font.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAiB,UAAU,EAAiB,MAAM,WAAW,CAAC;AA6BrE;;;;;;;;;GASG;AACH,MAAM,OAAO,IAAI;IACf,sDAAsD;IAC7C,KAAK,CAAyB;IACvC,mDAAmD;IAC1C,QAAQ,CAAyB;IAE1C,YAAoB,KAA6B,EAAE,QAAgC;QACjF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,KAA+B;QAC9C,OAAO,IAAI,IAAI,CAAC,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAC1F,CAAC;IAED,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,IAAgB;QAC9B,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAOD,SAAS,MAAM,CAAC,IAAyB,EAAE,MAAmB;IAC5D,OAAO,KAAK,CAAC,GAAG,EAAE;QAChB,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3C,KAAK,KAAK;gBACR,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1C,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CA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AAC,CAAC;IAC/B,CAAC;IAED,kFAAkF;IAClF,IAAI;QACF,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAAE,KAAK,CAAC,IAAI,EAAE,CAAC;QACzD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,EAAE,CAAC,IAAyB;QAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ /** Every FillRule, as the WASM module names it. */
2
+ export declare const FILL_RULES: readonly ["nonZero", "evenOdd"];
3
+ /** How a filled or clipped path decides what is inside. */
4
+ export type FillRule = (typeof FILL_RULES)[number];
5
+ /** Every LineCap, as the WASM module names it. */
6
+ export declare const LINE_CAPS: readonly ["butt", "round", "square"];
7
+ /** How open line ends are drawn. */
8
+ export type LineCap = (typeof LINE_CAPS)[number];
9
+ /** Every LineJoin, as the WASM module names it. */
10
+ export declare const LINE_JOINS: readonly ["miter", "round", "bevel"];
11
+ /** How corners are drawn. */
12
+ export type LineJoin = (typeof LINE_JOINS)[number];
13
+ /** Every BlendMode, as the WASM module names it. */
14
+ export declare const BLEND_MODES: readonly ["normal", "multiply", "screen", "overlay", "darken", "lighten", "colorDodge", "colorBurn", "hardLight", "softLight", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
15
+ /** Blend modes (`/BM`), camelCase. */
16
+ export type BlendMode = (typeof BLEND_MODES)[number];
17
+ /** Every ArtifactKind, as the WASM module names it. */
18
+ export declare const ARTIFACT_KINDS: readonly ["layout", "page", "pagination", "background"];
19
+ /** What kind of artifact (content outside the logical structure). */
20
+ export type ArtifactKind = (typeof ARTIFACT_KINDS)[number];
21
+ /** Every TableScope, as the WASM module names it. */
22
+ export declare const TABLE_SCOPES: readonly ["row", "column", "both"];
23
+ /** Which header cells a `TH` heads (`/Scope`). */
24
+ export type TableScope = (typeof TABLE_SCOPES)[number];
25
+ /** Every TagName, as the WASM module names it. */
26
+ export declare const TAG_NAMES: readonly ["Document", "Part", "Sect", "H1", "H2", "H3", "H4", "H5", "H6", "P", "L", "LI", "Lbl", "LBody", "Table", "TR", "TH", "TD", "Figure", "Caption", "Link", "Span", "Quote", "Note", "Code"];
27
+ /** A standard structure type (ISO 32000-1 §14.8.4). */
28
+ export type TagName = (typeof TAG_NAMES)[number];
29
+ //# sourceMappingURL=builder-enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-enums.d.ts","sourceRoot":"","sources":["../../src/generated/builder-enums.ts"],"names":[],"mappings":"AAGA,mDAAmD;AACnD,eAAO,MAAM,UAAU,YACrB,SAAS,EACT,SAAS,CACD,CAAC;AAEX,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,kDAAkD;AAClD,eAAO,MAAM,SAAS,YACpB,MAAM,EACN,OAAO,EACP,QAAQ,CACA,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,mDAAmD;AACnD,eAAO,MAAM,UAAU,YACrB,OAAO,EACP,OAAO,EACP,OAAO,CACC,CAAC;AAEX,6BAA6B;AAC7B,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,oDAAoD;AACpD,eAAO,MAAM,WAAW,YACtB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,EACP,YAAY,CACJ,CAAC;AAEX,sCAAsC;AACtC,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,uDAAuD;AACvD,eAAO,MAAM,cAAc,YACzB,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,YAAY,CACJ,CAAC;AAEX,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,qDAAqD;AACrD,eAAO,MAAM,YAAY,YACvB,KAAK,EACL,QAAQ,EACR,MAAM,CACE,CAAC;AAEX,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,kDAAkD;AAClD,eAAO,MAAM,SAAS,YACpB,UAAU,EACV,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,CACE,CAAC;AAEX,uDAAuD;AACvD,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,80 @@
1
+ // @generated by cargo xtask gen boundary. DO NOT EDIT.
2
+ // From laminapdf-wasm's name tables and laminapdf-build's TagKind::as_str; `cargo xtask check docs` fails when it is stale.
3
+ /** Every FillRule, as the WASM module names it. */
4
+ export const FILL_RULES = [
5
+ "nonZero",
6
+ "evenOdd",
7
+ ];
8
+ /** Every LineCap, as the WASM module names it. */
9
+ export const LINE_CAPS = [
10
+ "butt",
11
+ "round",
12
+ "square",
13
+ ];
14
+ /** Every LineJoin, as the WASM module names it. */
15
+ export const LINE_JOINS = [
16
+ "miter",
17
+ "round",
18
+ "bevel",
19
+ ];
20
+ /** Every BlendMode, as the WASM module names it. */
21
+ export const BLEND_MODES = [
22
+ "normal",
23
+ "multiply",
24
+ "screen",
25
+ "overlay",
26
+ "darken",
27
+ "lighten",
28
+ "colorDodge",
29
+ "colorBurn",
30
+ "hardLight",
31
+ "softLight",
32
+ "difference",
33
+ "exclusion",
34
+ "hue",
35
+ "saturation",
36
+ "color",
37
+ "luminosity",
38
+ ];
39
+ /** Every ArtifactKind, as the WASM module names it. */
40
+ export const ARTIFACT_KINDS = [
41
+ "layout",
42
+ "page",
43
+ "pagination",
44
+ "background",
45
+ ];
46
+ /** Every TableScope, as the WASM module names it. */
47
+ export const TABLE_SCOPES = [
48
+ "row",
49
+ "column",
50
+ "both",
51
+ ];
52
+ /** Every TagName, as the WASM module names it. */
53
+ export const TAG_NAMES = [
54
+ "Document",
55
+ "Part",
56
+ "Sect",
57
+ "H1",
58
+ "H2",
59
+ "H3",
60
+ "H4",
61
+ "H5",
62
+ "H6",
63
+ "P",
64
+ "L",
65
+ "LI",
66
+ "Lbl",
67
+ "LBody",
68
+ "Table",
69
+ "TR",
70
+ "TH",
71
+ "TD",
72
+ "Figure",
73
+ "Caption",
74
+ "Link",
75
+ "Span",
76
+ "Quote",
77
+ "Note",
78
+ "Code",
79
+ ];
80
+ //# sourceMappingURL=builder-enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-enums.js","sourceRoot":"","sources":["../../src/generated/builder-enums.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,4HAA4H;AAE5H,mDAAmD;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS;IACT,SAAS;CACD,CAAC;AAKX,kDAAkD;AAClD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM;IACN,OAAO;IACP,QAAQ;CACA,CAAC;AAKX,mDAAmD;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO;IACP,OAAO;IACP,OAAO;CACC,CAAC;AAKX,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,KAAK;IACL,YAAY;IACZ,OAAO;IACP,YAAY;CACJ,CAAC;AAKX,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,YAAY;CACJ,CAAC;AAKX,qDAAqD;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK;IACL,QAAQ;IACR,MAAM;CACE,CAAC;AAKX,kDAAkD;AAClD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,MAAM;IACN,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;CACE,CAAC"}
@@ -0,0 +1,97 @@
1
+ /** The nine kinds of ADR 0026 §2: what the caller can do about an error. */
2
+ export type ErrorKind = "input" | "io" | "unsupported" | "limit" | "security" | "usage" | "state" | "cancelled" | "internal";
3
+ /** Every error code (ADR 0026 §3; `fixtures/codes.json`). */
4
+ export type ErrorCode = "not-pdf" | "missing-root" | "reference-cycle" | "limit-exceeded" | "strict" | "data-pending" | "source" | "type" | "invalid-structure" | "unset-object" | "repaired-base" | "encrypted-base" | "password-required" | "wrong-password" | "unsupported-security-handler" | "unexpected-eof" | "syntax" | "unsupported-filter" | "decompress" | "nested-transaction" | "no-transaction" | "unknown-page" | "direct-page" | "unsupported-version" | "invalid-op-log" | "saved-not-rebased" | "no-pending-save" | "sink" | "not-rebased" | "sink-not-empty" | "would-invalidate-signatures" | "requires-rewrite" | "invalid-font" | "collection-index" | "unknown-axis" | "font-not-embeddable" | "missing-glyph" | "glyph-out-of-range" | "unknown-font" | "subset-failed" | "invalid-axis-value" | "wrong-document" | "invalid-feature" | "invalid-text-range" | "unsupported-layout-option" | "font-mismatch" | "encoding-full" | "font-not-shapable" | "invalid-image" | "unsupported-image" | "image-too-large" | "image-data-length" | "invalid-icc-profile" | "color-components" | "invalid-color" | "invalid-geometry" | "text-overflow" | "page-index-out-of-range" | "unknown-destination" | "invalid-page-labels" | "profile-version-conflict" | "missing-title" | "missing-lang" | "missing-alt-text" | "untagged-content" | "heading-level-skipped" | "unnumbered-heading-misused" | "invalid-structure-nesting" | "link-without-structure" | "link-without-contents" | "font-not-embedded" | "glyph-without-unicode" | "device-color-without-output-intent" | "embedded-file-forbidden" | "embedded-file-without-mime-type" | "render-too-large" | "render-failed" | "render-backend-unavailable" | "cancelled" | "job-finished" | "document-changed" | "builder-finished" | "invalid-argument" | "source-budget-exceeded" | "unknown-option" | "already-initialized" | "extract-module-not-loaded" | "fetch-failed" | "not-initialized" | "source-changed" | "text-module-not-loaded" | "disposed" | "worker-version-mismatch" | "worker-crashed" | "worker-failed";
5
+ /** Every warning code (ADR 0026 §3; `fixtures/codes.json`). */
6
+ export type WarningCode = "missing-header" | "xref-repaired" | "xrefstm-ignored" | "stream-length-recovered" | "stale-generation" | "page-tree-node-skipped" | "page-count-mismatch" | "flate-truncated" | "objstm-index-mismatch" | "object-number-out-of-range" | "aes-padding-invalid" | "perms-mismatch" | "warnings-truncated" | "invalid-box" | "invalid-rotate" | "name-tree-node-skipped" | "outline-cycle" | "outline-item-skipped" | "invalid-date" | "invalid-page-label" | "invalid-entry" | "content-unknown-operator" | "content-bad-operands" | "content-unbalanced-q" | "content-unbalanced-bt" | "content-unbalanced-marked" | "content-syntax" | "content-resource-missing" | "inline-image-unterminated" | "xobject-cycle" | "content-path-unpainted" | "font-invalid" | "cmap-invalid" | "unmapped-glyph" | "tounicode-conflict" | "whole-font-rebuilt";
7
+ /** The names of the `Limits` (ADR 0003 §3), as `data.limit` of `limit-exceeded`. */
8
+ export type LimitName = "max_nesting_depth" | "max_stream_decoded" | "max_decoded_total" | "max_filter_chain" | "max_resolve_depth" | "max_page_tree_depth" | "max_tree_depth" | "max_string_length" | "max_content_operators" | "max_xobject_depth" | "max_image_pixels" | "max_read_window";
9
+ /** Every error code, in `codes.json` order. */
10
+ export declare const ERROR_CODES: readonly ErrorCode[];
11
+ /** Every warning code, in `codes.json` order. */
12
+ export declare const WARNING_CODES: readonly WarningCode[];
13
+ /** The kind of every code. */
14
+ export declare const KINDS: {
15
+ readonly [C in ErrorCode | WarningCode]: ErrorKind;
16
+ };
17
+ /** The hint of every code (ADR 0026 §5), with its `{limit}`/`{option}` parameters unfilled. */
18
+ export declare const HINTS: {
19
+ readonly [C in ErrorCode | WarningCode]: string;
20
+ };
21
+ /** `docsUrl` = base + code + suffix (ADR 0026 §6). */
22
+ export declare const DOCS_URL: {
23
+ readonly base: "https://github.com/laudebugs/laminapdf/blob/main/docs/errors/";
24
+ readonly suffix: ".md";
25
+ };
26
+ /** The explain page of `code` (`docsUrl`, ADR 0026 §6). */
27
+ export declare function docsUrl(code: ErrorCode | WarningCode): string;
28
+ /** The groups of `codes.json` that list errors. */
29
+ export declare const ERROR_GROUPS: readonly string[];
30
+ /** The groups of `codes.json` that list warnings. */
31
+ export declare const WARNING_GROUPS: readonly string[];
32
+ /** The groups whose codes only `@laminapdf/sdk` raises (not in the Rust enums or the WASM). */
33
+ export declare const TS_ONLY_GROUPS: readonly string[];
34
+ /** Kind and hint of the codes `@laminapdf/sdk` raises itself (the WASM fills in the others). */
35
+ export declare const RAISED_BY_PACKAGE: {
36
+ readonly "nested-transaction": {
37
+ readonly kind: "state";
38
+ readonly hint: "commit or roll back the open transaction first, or use a savepoint inside it";
39
+ };
40
+ readonly "no-transaction": {
41
+ readonly kind: "state";
42
+ readonly hint: "call begin first, or use transact";
43
+ };
44
+ readonly cancelled: {
45
+ readonly kind: "cancelled";
46
+ readonly hint: "nothing to do: this is the outcome the caller asked for; start a new job to try again";
47
+ };
48
+ readonly "builder-finished": {
49
+ readonly kind: "state";
50
+ readonly hint: "create a new builder or page: a finished one takes no more drawing, pages, fonts or settings";
51
+ };
52
+ readonly "invalid-argument": {
53
+ readonly kind: "usage";
54
+ readonly hint: "pass the value the type declarations describe; the data field says what was wrong";
55
+ };
56
+ readonly "already-initialized": {
57
+ readonly kind: "state";
58
+ readonly hint: "call init and loadText with a source once, before the first load; later calls need no source";
59
+ };
60
+ readonly "extract-module-not-loaded": {
61
+ readonly kind: "state";
62
+ readonly hint: "load the extract module (init with the extract option, or loadExtract) or the text module before opening the document";
63
+ };
64
+ readonly "fetch-failed": {
65
+ readonly kind: "io";
66
+ readonly hint: "check that the URL is reachable and that the server sends the CORS headers range requests need (Content-Range must be exposed); data.reason and data.status say what failed";
67
+ };
68
+ readonly "not-initialized": {
69
+ readonly kind: "state";
70
+ readonly hint: "await init() once before calling anything else in @laminapdf/sdk";
71
+ };
72
+ readonly "source-changed": {
73
+ readonly kind: "io";
74
+ readonly hint: "open the file again; the document already read parts of the old version and can't mix in the new one";
75
+ };
76
+ readonly "text-module-not-loaded": {
77
+ readonly kind: "state";
78
+ readonly hint: "load the text module with init and the text option, or with loadText, before creating the builder that draws text";
79
+ };
80
+ readonly disposed: {
81
+ readonly kind: "state";
82
+ readonly hint: "free a handle only after its last use; to keep working, open the document again or create a new builder";
83
+ };
84
+ readonly "worker-version-mismatch": {
85
+ readonly kind: "usage";
86
+ readonly hint: "serve the worker file from the same @laminapdf/sdk build as the page; don't load it from a CDN or an older deploy";
87
+ };
88
+ readonly "worker-crashed": {
89
+ readonly kind: "internal";
90
+ readonly hint: "call client.restart() and open the document again; report the file if it keeps happening";
91
+ };
92
+ readonly "worker-failed": {
93
+ readonly kind: "internal";
94
+ readonly hint: "this is a bug in Lamina PDF: report it with the call and the message; the worker keeps running";
95
+ };
96
+ };
97
+ //# sourceMappingURL=codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/generated/codes.ts"],"names":[],"mappings":"AAGA,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,IAAI,GACJ,aAAa,GACb,OAAO,GACP,UAAU,GACV,OAAO,GACP,OAAO,GACP,WAAW,GACX,UAAU,CAAC;AAEf,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,QAAQ,GACR,cAAc,GACd,QAAQ,GACR,MAAM,GACN,mBAAmB,GACnB,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,8BAA8B,GAC9B,gBAAgB,GAChB,QAAQ,GACR,oBAAoB,GACpB,YAAY,GACZ,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,qBAAqB,GACrB,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,MAAM,GACN,aAAa,GACb,gBAAgB,GAChB,6BAA6B,GAC7B,kBAAkB,GAClB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,qBAAqB,GACrB,eAAe,GACf,oBAAoB,GACpB,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,oBAAoB,GACpB,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,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