takumi-js 2.1.0 → 2.1.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.
- package/dist/backend/node.cjs +2 -1
- package/dist/backend/node.mjs +2 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/{render-Cb_LVX55.d.mts → render-Dj1IRpxH.d.mts} +2 -2
- package/dist/{render-sRfulirT.d.cts → render-DqZwHBU1.d.cts} +2 -2
- package/dist/response.d.cts +1 -1
- package/dist/response.d.mts +1 -1
- package/dist/wasm-node-BsD8jxba.mjs +6 -0
- package/dist/wasm-node-CaSIdQS-.cjs +8 -0
- package/package.json +5 -5
package/dist/backend/node.cjs
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const loadNative = () => import("@takumi-rs/core").catch((cause) => {
|
|
4
4
|
throw new Error("Failed to load the native @takumi-rs/core backend. On a runtime without the native addon, pass a `module` (a WASM binary) to render with the WASM backend instead.", { cause });
|
|
5
5
|
});
|
|
6
|
-
const
|
|
6
|
+
const loadWasm = (module) => Promise.resolve().then(() => require("../wasm-node-CaSIdQS-.cjs")).then((backend) => backend.loadBackend(module));
|
|
7
|
+
const loadBackend = (module) => typeof process !== "undefined" && process.versions?.webcontainer ? loadWasm(module) : loadNative(module);
|
|
7
8
|
//#endregion
|
|
8
9
|
exports.loadBackend = loadBackend;
|
package/dist/backend/node.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const loadNative = () => import("@takumi-rs/core").catch((cause) => {
|
|
3
3
|
throw new Error("Failed to load the native @takumi-rs/core backend. On a runtime without the native addon, pass a `module` (a WASM binary) to render with the WASM backend instead.", { cause });
|
|
4
4
|
});
|
|
5
|
-
const
|
|
5
|
+
const loadWasm = (module) => import("../wasm-node-BsD8jxba.mjs").then((backend) => backend.loadBackend(module));
|
|
6
|
+
const loadBackend = (module) => typeof process !== "undefined" && process.versions?.webcontainer ? loadWasm(module) : loadNative(module);
|
|
6
7
|
//#endregion
|
|
7
8
|
export { loadBackend };
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-
|
|
1
|
+
import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-DqZwHBU1.cjs";
|
|
2
2
|
import { AnimationOutputFormat, DitheringAlgorithm, Font, FontDetails, FontLoader, ImageSource, Keyframes, KeyframesMap, KeyframesRuleList, MeasuredNode, MeasuredTextRun, OutputFormat } from "@takumi-rs/core";
|
|
3
3
|
import { ContainerNode, FetchOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, TextNode } from "@takumi-rs/helpers";
|
|
4
4
|
//#region src/index.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-
|
|
1
|
+
import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-Dj1IRpxH.mjs";
|
|
2
2
|
import { ContainerNode, FetchOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, TextNode } from "@takumi-rs/helpers";
|
|
3
3
|
import { AnimationOutputFormat, DitheringAlgorithm, Font, FontDetails, FontLoader, ImageSource, Keyframes, KeyframesMap, KeyframesRuleList, MeasuredNode, MeasuredTextRun, OutputFormat } from "@takumi-rs/core";
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -85,7 +85,7 @@ type RenderInput = ReactNode | ReactElementLike | Node | string;
|
|
|
85
85
|
* @param options - Configuration for rendering, including dimensions, format, fonts, and more.
|
|
86
86
|
* @returns A promise that resolves to the rendered image data (Buffer/Uint8Array).
|
|
87
87
|
*/
|
|
88
|
-
declare function render(element: RenderInput, options?: RenderOptions): Promise<
|
|
88
|
+
declare function render(element: RenderInput, options?: RenderOptions): Promise<Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>>;
|
|
89
89
|
/**
|
|
90
90
|
* Renders a React element, HTML string, or Takumi node tree into a vector SVG
|
|
91
91
|
* document string.
|
|
@@ -131,6 +131,6 @@ declare function renderSvg(element: RenderInput, options?: RenderSvgOptions): Pr
|
|
|
131
131
|
*
|
|
132
132
|
* @returns A promise that resolves to the encoded animation (Buffer/Uint8Array).
|
|
133
133
|
*/
|
|
134
|
-
declare function renderAnimation(options: RenderAnimationOptions): Promise<
|
|
134
|
+
declare function renderAnimation(options: RenderAnimationOptions): Promise<Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>>;
|
|
135
135
|
//#endregion
|
|
136
136
|
export { RenderOptions as a, renderAnimation as c, RenderInput as i, renderSvg as l, ImagesInput as n, RenderSvgOptions as o, RenderAnimationOptions as r, render as s, AnimationScene as t };
|
|
@@ -85,7 +85,7 @@ type RenderInput = ReactNode | ReactElementLike | Node | string;
|
|
|
85
85
|
* @param options - Configuration for rendering, including dimensions, format, fonts, and more.
|
|
86
86
|
* @returns A promise that resolves to the rendered image data (Buffer/Uint8Array).
|
|
87
87
|
*/
|
|
88
|
-
declare function render(element: RenderInput, options?: RenderOptions): Promise<
|
|
88
|
+
declare function render(element: RenderInput, options?: RenderOptions): Promise<Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>>;
|
|
89
89
|
/**
|
|
90
90
|
* Renders a React element, HTML string, or Takumi node tree into a vector SVG
|
|
91
91
|
* document string.
|
|
@@ -131,6 +131,6 @@ declare function renderSvg(element: RenderInput, options?: RenderSvgOptions): Pr
|
|
|
131
131
|
*
|
|
132
132
|
* @returns A promise that resolves to the encoded animation (Buffer/Uint8Array).
|
|
133
133
|
*/
|
|
134
|
-
declare function renderAnimation(options: RenderAnimationOptions): Promise<
|
|
134
|
+
declare function renderAnimation(options: RenderAnimationOptions): Promise<Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>>;
|
|
135
135
|
//#endregion
|
|
136
136
|
export { RenderOptions as a, renderAnimation as c, RenderInput as i, renderSvg as l, ImagesInput as n, RenderSvgOptions as o, RenderAnimationOptions as r, render as s, AnimationScene as t };
|
package/dist/response.d.cts
CHANGED
package/dist/response.d.mts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
+
const require_wasm_init = require("./wasm-init-H65IoN11.cjs");
|
|
3
|
+
let _takumi_rs_wasm_node = require("@takumi-rs/wasm/node");
|
|
4
|
+
_takumi_rs_wasm_node = require_rolldown_runtime.__toESM(_takumi_rs_wasm_node, 1);
|
|
5
|
+
//#region src/backend/wasm-node.ts
|
|
6
|
+
const loadBackend = (module) => require_wasm_init.initWasm(module, _takumi_rs_wasm_node.default);
|
|
7
|
+
//#endregion
|
|
8
|
+
exports.loadBackend = loadBackend;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "takumi-js",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "All-in-one Takumi package for Node.js and WebAssembly runtimes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -212,15 +212,15 @@
|
|
|
212
212
|
"publish-lint": "attw --pack . && publint --strict ."
|
|
213
213
|
},
|
|
214
214
|
"dependencies": {
|
|
215
|
-
"@takumi-rs/core": "2.1.
|
|
216
|
-
"@takumi-rs/helpers": "2.1.
|
|
217
|
-
"@takumi-rs/wasm": "2.1.
|
|
215
|
+
"@takumi-rs/core": "2.1.1",
|
|
216
|
+
"@takumi-rs/helpers": "2.1.1",
|
|
217
|
+
"@takumi-rs/wasm": "2.1.1"
|
|
218
218
|
},
|
|
219
219
|
"devDependencies": {
|
|
220
220
|
"@types/bun": "^1.3.14",
|
|
221
221
|
"@types/react": "^19.2.17",
|
|
222
222
|
"react": "^19.2.7",
|
|
223
|
-
"tsdown": "^0.22.
|
|
223
|
+
"tsdown": "^0.22.5",
|
|
224
224
|
"unrun": "^0.3.1"
|
|
225
225
|
},
|
|
226
226
|
"engines": {
|