inkoxide 0.4.1 → 0.6.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.
Files changed (3) hide show
  1. package/index.d.ts +11 -5
  2. package/index.js +0 -1
  3. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -47,16 +47,19 @@ export interface RenderOptions {
47
47
  format?: 'json' | 'msgpack';
48
48
  /** Flate-compress page content streams. Default `true`. */
49
49
  compress?: boolean;
50
- /** Flate level 0–9, used when `compress` is on. Default `6`. */
50
+ /** Flate level, an integer from 0 to 9, used when `compress` is on. Default `6`. */
51
51
  compressionLevel?: number;
52
52
  /**
53
53
  * RFC 3339 timestamp written as the creation date; overrides
54
54
  * `meta.creationDate`. With neither set no date is written. Default: none.
55
+ * Another string is `INVALID_ARGUMENT`.
55
56
  */
56
57
  creationDate?: string;
57
58
  /**
58
- * Worker threads for this render. Default: all cores. `1` renders on the libuv thread that
59
- * runs it, with no parallelism inside, so concurrent renders do not wait for each other.
59
+ * Worker threads for this render, an integer from 1 to 256. Default: all cores. `1` renders
60
+ * on the libuv thread that runs it, with no parallelism inside, so concurrent renders do not
61
+ * wait for each other. Any other number uses a pool of that size, kept for the life of the
62
+ * process and shared by the renders that ask for the same number.
60
63
  */
61
64
  threads?: number;
62
65
  /** Embed only the glyphs the document uses. Default `true`; `false` embeds whole fonts. */
@@ -105,8 +108,11 @@ export function registerHyphenationPatterns(lang: string, data: Uint8Array | str
105
108
  export function unregisterHyphenationPatterns(lang: string): boolean;
106
109
  /**
107
110
  * Validates a document against the schema and the registered fonts. Image
108
- * references are checked only when `images` is given. Returns at most 100
109
- * problems; one in the document's structure is returned alone.
111
+ * references (`src`) are checked only when `images` is given: each must be
112
+ * there and decode. Inline images (`data`) are always checked. Returns at
113
+ * most 100 problems; one in the document's structure is returned alone. An
114
+ * empty array means the document is valid; `render` can still fail on an
115
+ * option, the page limit or a font that cannot be embedded.
110
116
  */
111
117
  export function validate(
112
118
  doc: Uint8Array | string,
package/index.js CHANGED
@@ -49,7 +49,6 @@ export class InkoxideError extends Error {
49
49
  this.name = 'InkoxideError';
50
50
  this.code = code;
51
51
  this.path = path;
52
- this.detail = message;
53
52
  }
54
53
  }
55
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inkoxide",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Native PDF layout and rendering engine: declarative document tree in, PDF bytes out.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,11 +26,11 @@
26
26
  "node": ">=22"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@inkoxide/linux-x64-gnu": "0.4.1",
30
- "@inkoxide/linux-x64-musl": "0.4.1",
31
- "@inkoxide/linux-arm64-gnu": "0.4.1",
32
- "@inkoxide/darwin-arm64": "0.4.1",
33
- "@inkoxide/darwin-x64": "0.4.1",
34
- "@inkoxide/win32-x64-msvc": "0.4.1"
29
+ "@inkoxide/linux-x64-gnu": "0.6.0",
30
+ "@inkoxide/linux-x64-musl": "0.6.0",
31
+ "@inkoxide/linux-arm64-gnu": "0.6.0",
32
+ "@inkoxide/darwin-arm64": "0.6.0",
33
+ "@inkoxide/darwin-x64": "0.6.0",
34
+ "@inkoxide/win32-x64-msvc": "0.6.0"
35
35
  }
36
36
  }