@takumi-rs/wasm 0.71.7 → 0.73.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/package.json +6 -3
- package/pkg/takumi_wasm.d.ts +21 -8
- package/pkg/takumi_wasm.js +5 -5
- package/pkg/takumi_wasm_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"image",
|
|
6
6
|
"rendering",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "wasm-pack build --no-pack --release --out-dir pkg --target web && bun build pkg/takumi_wasm.js --define import.meta.url=undefined --format cjs --outfile pkg/takumi_wasm.cjs",
|
|
14
|
-
"build:debug": "wasm-pack build --no-pack --dev --out-dir pkg --target web && bun build pkg/takumi_wasm.js --define import.meta.url=undefined --format cjs --outfile pkg/takumi_wasm.cjs"
|
|
14
|
+
"build:debug": "wasm-pack build --no-pack --dev --out-dir pkg --target web && bun build pkg/takumi_wasm.js --define import.meta.url=undefined --format cjs --outfile pkg/takumi_wasm.cjs",
|
|
15
|
+
"prepublishOnly": "jq '.dependencies[\"@takumi-rs/helpers\"] = .version' package.json > tmp.json && mv tmp.json package.json"
|
|
15
16
|
},
|
|
16
17
|
"author": {
|
|
17
18
|
"email": "me@kane.tw",
|
|
@@ -21,10 +22,12 @@
|
|
|
21
22
|
"repository": {
|
|
22
23
|
"url": "git+https://github.com/kane50613/takumi.git"
|
|
23
24
|
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@takumi-rs/helpers": "0.73.0"
|
|
27
|
+
},
|
|
24
28
|
"readme": "README.md",
|
|
25
29
|
"license": "(MIT OR Apache-2.0)",
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@takumi-rs/helpers": "workspace:*",
|
|
28
31
|
"@types/bun": "catalog:",
|
|
29
32
|
"typescript": "catalog:"
|
|
30
33
|
},
|
package/pkg/takumi_wasm.d.ts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import type {
|
|
5
|
+
ContainerNode,
|
|
6
|
+
ImageNode,
|
|
7
|
+
Node,
|
|
8
|
+
NodeMetadata,
|
|
9
|
+
TextNode,
|
|
10
|
+
} from "@takumi-rs/helpers";
|
|
11
|
+
|
|
12
|
+
export type { ContainerNode, ImageNode, Node, NodeMetadata, TextNode };
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `Node` instead.
|
|
16
|
+
*/
|
|
17
|
+
export type AnyNode = Node;
|
|
5
18
|
|
|
6
19
|
export type ByteBuf = Uint8Array | ArrayBuffer | Buffer;
|
|
7
20
|
|
|
@@ -162,12 +175,12 @@ export type MeasuredNode = {
|
|
|
162
175
|
};
|
|
163
176
|
|
|
164
177
|
export type AnimationFrameSource = {
|
|
165
|
-
node:
|
|
178
|
+
node: Node,
|
|
166
179
|
durationMs: number,
|
|
167
180
|
};
|
|
168
181
|
|
|
169
182
|
export type AnimationSceneSource = {
|
|
170
|
-
node:
|
|
183
|
+
node: Node,
|
|
171
184
|
durationMs: number,
|
|
172
185
|
};
|
|
173
186
|
|
|
@@ -198,7 +211,7 @@ export class Renderer {
|
|
|
198
211
|
/**
|
|
199
212
|
* Measures a node tree and returns layout information.
|
|
200
213
|
*/
|
|
201
|
-
measure(node:
|
|
214
|
+
measure(node: Node, options?: RenderOptions | null): MeasuredNode;
|
|
202
215
|
/**
|
|
203
216
|
* Creates a new Renderer instance.
|
|
204
217
|
*/
|
|
@@ -210,7 +223,7 @@ export class Renderer {
|
|
|
210
223
|
/**
|
|
211
224
|
* Renders a node tree into an image buffer.
|
|
212
225
|
*/
|
|
213
|
-
render(node:
|
|
226
|
+
render(node: Node, options?: RenderOptions | null): Uint8Array;
|
|
214
227
|
/**
|
|
215
228
|
* Renders a sequential animation timeline into a buffer.
|
|
216
229
|
*/
|
|
@@ -220,19 +233,19 @@ export class Renderer {
|
|
|
220
233
|
*
|
|
221
234
|
* `raw` format is not supported for data URL.
|
|
222
235
|
*/
|
|
223
|
-
renderAsDataUrl(node:
|
|
236
|
+
renderAsDataUrl(node: Node, options: RenderOptions): string;
|
|
224
237
|
}
|
|
225
238
|
|
|
226
239
|
/**
|
|
227
240
|
* Collects the fetch task urls from the node.
|
|
228
241
|
* @deprecated Use `extractResourceUrls` instead.
|
|
229
242
|
*/
|
|
230
|
-
export function collectNodeFetchTasks(node:
|
|
243
|
+
export function collectNodeFetchTasks(node: Node): string[];
|
|
231
244
|
|
|
232
245
|
/**
|
|
233
246
|
* Collects the fetch task urls from the node.
|
|
234
247
|
*/
|
|
235
|
-
export function extractResourceUrls(node:
|
|
248
|
+
export function extractResourceUrls(node: Node): string[];
|
|
236
249
|
|
|
237
250
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
238
251
|
|
package/pkg/takumi_wasm.js
CHANGED
|
@@ -59,7 +59,7 @@ export class Renderer {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Measures a node tree and returns layout information.
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {Node} node
|
|
63
63
|
* @param {RenderOptions | null} [options]
|
|
64
64
|
* @returns {MeasuredNode}
|
|
65
65
|
*/
|
|
@@ -95,7 +95,7 @@ export class Renderer {
|
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Renders a node tree into an image buffer.
|
|
98
|
-
* @param {
|
|
98
|
+
* @param {Node} node
|
|
99
99
|
* @param {RenderOptions | null} [options]
|
|
100
100
|
* @returns {Uint8Array}
|
|
101
101
|
*/
|
|
@@ -126,7 +126,7 @@ export class Renderer {
|
|
|
126
126
|
* Renders a node tree into a data URL.
|
|
127
127
|
*
|
|
128
128
|
* `raw` format is not supported for data URL.
|
|
129
|
-
* @param {
|
|
129
|
+
* @param {Node} node
|
|
130
130
|
* @param {RenderOptions} options
|
|
131
131
|
* @returns {string}
|
|
132
132
|
*/
|
|
@@ -154,7 +154,7 @@ if (Symbol.dispose) Renderer.prototype[Symbol.dispose] = Renderer.prototype.free
|
|
|
154
154
|
/**
|
|
155
155
|
* Collects the fetch task urls from the node.
|
|
156
156
|
* @deprecated Use `extractResourceUrls` instead.
|
|
157
|
-
* @param {
|
|
157
|
+
* @param {Node} node
|
|
158
158
|
* @returns {string[]}
|
|
159
159
|
*/
|
|
160
160
|
export function collectNodeFetchTasks(node) {
|
|
@@ -169,7 +169,7 @@ export function collectNodeFetchTasks(node) {
|
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
171
|
* Collects the fetch task urls from the node.
|
|
172
|
-
* @param {
|
|
172
|
+
* @param {Node} node
|
|
173
173
|
* @returns {string[]}
|
|
174
174
|
*/
|
|
175
175
|
export function extractResourceUrls(node) {
|
package/pkg/takumi_wasm_bg.wasm
CHANGED
|
Binary file
|