@takumi-rs/core 0.19.0 → 0.20.1

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 +7 -0
  2. package/index.js +1 -1
  3. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export declare class Renderer {
11
11
 
12
12
  export interface ConstructRendererOptions {
13
13
  debug?: boolean
14
+ persistentImages?: Array<PersistentImage>
15
+ fonts?: Array<ArrayBuffer>
14
16
  }
15
17
 
16
18
  export declare const enum OutputFormat {
@@ -19,6 +21,11 @@ export declare const enum OutputFormat {
19
21
  Jpeg = 'Jpeg'
20
22
  }
21
23
 
24
+ export interface PersistentImage {
25
+ src: string
26
+ data: ArrayBuffer
27
+ }
28
+
22
29
  export interface RenderOptions {
23
30
  width: number
24
31
  height: number
package/index.js CHANGED
@@ -386,7 +386,7 @@ if (!nativeBinding) {
386
386
  `Cannot find native binding. ` +
387
387
  `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
388
388
  'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
389
- { cause: loadErrors }
389
+ { cause: JSON.stringify(loadErrors, (k, v) => v instanceof Error ? (Object.getOwnPropertyNames(v).reduce((o, n) => (o[n] = v[n], o), {})) : v, 2) }
390
390
  )
391
391
  }
392
392
  throw new Error(`Failed to load native binding`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/core",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "author": {
5
5
  "email": "me@kane.tw",
6
6
  "name": "Kane Wang",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "main": "index.js",
13
13
  "devDependencies": {
14
- "@napi-rs/cli": "3.0.0",
14
+ "@napi-rs/cli": "3.0.4",
15
15
  "@takumi-rs/helpers": "workspace:*",
16
16
  "@types/bun": "catalog:",
17
17
  "typescript": "catalog:"
@@ -41,10 +41,10 @@
41
41
  "type": "commonjs",
42
42
  "types": "index.d.ts",
43
43
  "optionalDependencies": {
44
- "@takumi-rs/core-darwin-arm64": "0.19.0",
45
- "@takumi-rs/core-linux-arm64-gnu": "0.19.0",
46
- "@takumi-rs/core-linux-arm64-musl": "0.19.0",
47
- "@takumi-rs/core-linux-x64-gnu": "0.19.0",
48
- "@takumi-rs/core-linux-x64-musl": "0.19.0"
44
+ "@takumi-rs/core-darwin-arm64": "0.20.1",
45
+ "@takumi-rs/core-linux-arm64-gnu": "0.20.1",
46
+ "@takumi-rs/core-linux-arm64-musl": "0.20.1",
47
+ "@takumi-rs/core-linux-x64-gnu": "0.20.1",
48
+ "@takumi-rs/core-linux-x64-musl": "0.20.1"
49
49
  }
50
50
  }