@takumi-rs/wasm 0.47.0 → 0.49.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.
@@ -0,0 +1 @@
1
+ export default WebAssembly.Module;
@@ -0,0 +1,3 @@
1
+ import module from "../pkg/takumi_wasm_bg.wasm?module";
2
+
3
+ export default module;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/wasm",
3
- "version": "0.47.0",
3
+ "version": "0.49.0",
4
4
  "keywords": [
5
5
  "image",
6
6
  "rendering",
@@ -35,10 +35,15 @@
35
35
  "./takumi_wasm_bg.wasm": {
36
36
  "types": "./pkg/takumi_wasm_bg.wasm.d.ts",
37
37
  "default": "./pkg/takumi_wasm_bg.wasm"
38
+ },
39
+ "./next": {
40
+ "types": "./bundlers/next.d.ts",
41
+ "default": "./bundlers/next.js"
38
42
  }
39
43
  },
40
44
  "files": [
41
45
  "README.md",
42
- "pkg/takumi*"
46
+ "pkg/takumi*",
47
+ "bundlers/*"
43
48
  ]
44
49
  }
@@ -1,5 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Collects the fetch task urls from the node.
5
+ */
3
6
  export function collectNodeFetchTasks(node: AnyNode): string[];
4
7
 
5
8
  export type AnyNode = { type: string; [key: string]: any };
@@ -7,11 +10,29 @@ export type AnyNode = { type: string; [key: string]: any };
7
10
  export type ByteBuf = Uint8Array | ArrayBuffer | Buffer;
8
11
 
9
12
  export type RenderOptions = {
10
- width: number,
11
- height: number,
13
+ /**
14
+ * The width of the image. If not provided, the width will be automatically calculated based on the content.
15
+ */
16
+ width?: number,
17
+ /**
18
+ * The height of the image. If not provided, the height will be automatically calculated based on the content.
19
+ */
20
+ height?: number,
21
+ /**
22
+ * The format of the image.
23
+ */
12
24
  format?: "png" | "jpeg" | "webp",
25
+ /**
26
+ * The quality of JPEG format (0-100).
27
+ */
13
28
  quality?: number,
29
+ /**
30
+ * The resources fetched externally. You should collect the fetch tasks first using `collectNodeFetchTasks` and then pass the resources here.
31
+ */
14
32
  fetchedResources?: Map<string, ByteBuf>,
33
+ /**
34
+ * Whether to draw debug borders.
35
+ */
15
36
  drawDebugBorder?: boolean,
16
37
  };
17
38
 
@@ -193,6 +193,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
193
193
  return result;
194
194
  }
195
195
  /**
196
+ * Collects the fetch task urls from the node.
196
197
  * @param {AnyNode} node
197
198
  * @returns {string[]}
198
199
  */
Binary file