@takumi-rs/wasm 2.13.3 → 2.13.5

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,3 @@
1
+ import url from "./wasm-url.mjs";
2
+
3
+ export default fetch(url).then((response) => response.arrayBuffer());
package/bundlers/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import url from "../pkg/takumi_wasm_bg.wasm?url";
4
4
  // importing server chunk, so resolve relative to import.meta.url, not the framework output dir.
5
5
  async function processUrl() {
6
6
  if (typeof process !== "undefined" && process.versions?.node != null) {
7
- const { readFile } = await import("node:fs/promises");
7
+ const { readFile } = process.getBuiltinModule("node:fs/promises");
8
8
  const path = decodeURIComponent(url.replace(/[?#].*$/, ""));
9
9
 
10
10
  // Dev SSR serves an `/@fs/<abs-path>` URL.
package/dist/export.d.cts CHANGED
@@ -19,7 +19,12 @@ type Keyframes = KeyframesMap | KeyframesRuleList;
19
19
  type OutputFormat = "png" | "jpeg" | "webp" | "ico" | "raw";
20
20
  /** Output format for animated images. */
21
21
  type AnimationOutputFormat = "webp" | "apng" | "gif";
22
- /** The output dithering algorithm. */
22
+ /**
23
+ * Gradient dithering algorithm.
24
+ *
25
+ * `"floyd-steinberg"` is a deprecated alias of `"ordered-bayer"`; it will be
26
+ * removed in v3.
27
+ */
23
28
  type DitheringAlgorithm = "none" | "ordered-bayer" | "floyd-steinberg";
24
29
  /** Cache policy for a decoded image. Defaults to `"auto"`. */
25
30
  type ImageCacheMode = "auto" | "none";
@@ -87,7 +92,7 @@ type RenderOptions$1 = {
87
92
  */
88
93
  timeMs?: number;
89
94
  /**
90
- * The output dithering algorithm.
95
+ * Dithers gradient fills before they quantize to 8-bit.
91
96
  * @default "none"
92
97
  */
93
98
  dithering?: DitheringAlgorithm;
package/dist/export.d.mts CHANGED
@@ -19,7 +19,12 @@ type Keyframes = KeyframesMap | KeyframesRuleList;
19
19
  type OutputFormat = "png" | "jpeg" | "webp" | "ico" | "raw";
20
20
  /** Output format for animated images. */
21
21
  type AnimationOutputFormat = "webp" | "apng" | "gif";
22
- /** The output dithering algorithm. */
22
+ /**
23
+ * Gradient dithering algorithm.
24
+ *
25
+ * `"floyd-steinberg"` is a deprecated alias of `"ordered-bayer"`; it will be
26
+ * removed in v3.
27
+ */
23
28
  type DitheringAlgorithm = "none" | "ordered-bayer" | "floyd-steinberg";
24
29
  /** Cache policy for a decoded image. Defaults to `"auto"`. */
25
30
  type ImageCacheMode = "auto" | "none";
@@ -87,7 +92,7 @@ type RenderOptions$1 = {
87
92
  */
88
93
  timeMs?: number;
89
94
  /**
90
- * The output dithering algorithm.
95
+ * Dithers gradient fills before they quantize to 8-bit.
91
96
  * @default "none"
92
97
  */
93
98
  dithering?: DitheringAlgorithm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/wasm",
3
- "version": "2.13.3",
3
+ "version": "2.13.5",
4
4
  "description": "Render OG images from Takumi node trees with WebAssembly. No headless browser.",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -95,6 +95,10 @@
95
95
  "default": "./bundlers/vite.mjs"
96
96
  }
97
97
  },
98
+ "browser": {
99
+ "types": "./bundlers/vite.d.ts",
100
+ "default": "./bundlers/browser.mjs"
101
+ },
98
102
  "module": {
99
103
  "types": "./bundlers/vite.d.ts",
100
104
  "default": "./bundlers/vite.mjs"
@@ -133,8 +137,14 @@
133
137
  "default": "./bundlers/next.mjs"
134
138
  },
135
139
  "./vite": {
136
- "types": "./bundlers/vite.d.ts",
137
- "default": "./bundlers/vite.mjs"
140
+ "browser": {
141
+ "types": "./bundlers/vite.d.ts",
142
+ "default": "./bundlers/browser.mjs"
143
+ },
144
+ "default": {
145
+ "types": "./bundlers/vite.d.ts",
146
+ "default": "./bundlers/vite.mjs"
147
+ }
138
148
  }
139
149
  },
140
150
  "scripts": {
@@ -144,7 +154,7 @@
144
154
  "publish-lint": "attw --pack . && publint --strict ."
145
155
  },
146
156
  "dependencies": {
147
- "@takumi-rs/helpers": "2.13.3"
157
+ "@takumi-rs/helpers": "2.13.5"
148
158
  },
149
159
  "devDependencies": {
150
160
  "@types/bun": "^1.4.0",
@@ -161,7 +171,7 @@
161
171
  }
162
172
  },
163
173
  "engines": {
164
- "node": ">=18"
174
+ "node": ">=20.19"
165
175
  },
166
176
  "readme": "README.md"
167
177
  }
Binary file