@takumi-rs/wasm 2.12.0 → 2.13.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/dist/export.cjs CHANGED
@@ -519,16 +519,20 @@ async function __wbg_load(module, imports) {
519
519
  }
520
520
  function initSync(module) {
521
521
  if (wasm !== void 0) return wasm;
522
- if (module !== void 0) if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
523
- else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
522
+ if (module !== void 0) {
523
+ if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
524
+ else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
525
+ }
524
526
  const imports = __wbg_get_imports();
525
527
  if (!(module instanceof WebAssembly.Module)) module = new WebAssembly.Module(module);
526
528
  return __wbg_finalize_init(new WebAssembly.Instance(module, imports), module);
527
529
  }
528
530
  async function __wbg_init(module_or_path) {
529
531
  if (wasm !== void 0) return wasm;
530
- if (module_or_path !== void 0) if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
531
- else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
532
+ if (module_or_path !== void 0) {
533
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
534
+ else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
535
+ }
532
536
  const imports = __wbg_get_imports();
533
537
  if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
534
538
  const { instance, module } = await __wbg_load(await module_or_path, imports);
package/dist/export.d.cts CHANGED
@@ -1,9 +1,11 @@
1
- import { ContainerNode, ImageNode, Node, Node as Node$1, NodeMetadata, RgbaImage, TextNode } from "@takumi-rs/helpers";
1
+ import { ContainerNode, CssInput, ImageNode, Node, Node as Node$1, NodeMetadata, RgbaImage, TextNode } from "@takumi-rs/helpers";
2
2
  import { Properties } from "csstype";
3
3
  import { AnimationOutputFormatOptions, BackendAnimationOptions, BackendRenderOptions, BackendSvgOptions, FontLoader, FontLoader as FontLoader$1, ImageLoader, ImagesInput, OutputFormatOptions } from "@takumi-rs/helpers/renderer";
4
4
  //#region pkg/takumi_wasm.d.ts
5
5
  type ByteBuf = Uint8Array | ArrayBuffer | Buffer;
6
+ /** @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3. */
6
7
  type KeyframesMap = Record<string, Record<string, Properties>>;
8
+ /** @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3. */
7
9
  type KeyframesRuleList = {
8
10
  name: string;
9
11
  keyframes: {
@@ -11,6 +13,7 @@ type KeyframesRuleList = {
11
13
  declarations: Record<string, Properties>;
12
14
  }[];
13
15
  }[];
16
+ /** @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3. */
14
17
  type Keyframes = KeyframesMap | KeyframesRuleList;
15
18
  /** Output format for static images. */
16
19
  type OutputFormat = "png" | "jpeg" | "webp" | "ico" | "raw";
@@ -58,11 +61,16 @@ type RenderOptions$1 = {
58
61
  */
59
62
  images?: ImageSource[];
60
63
  /**
61
- * CSS stylesheets to apply before rendering.
64
+ * CSS to apply before rendering: stylesheet text, or a rule written as an
65
+ * object.
66
+ */
67
+ css?: CssInput[];
68
+ /**
69
+ * @deprecated Use `css` instead. Will be removed in v3.
62
70
  */
63
71
  stylesheets?: string[];
64
72
  /**
65
- * Structured keyframes to register alongside stylesheets.
73
+ * @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3.
66
74
  */
67
75
  keyframes?: Keyframes;
68
76
  /**
@@ -117,11 +125,16 @@ type RenderAnimationOptions$1 = {
117
125
  images?: ImageSource[];
118
126
  drawDebugBorder?: boolean;
119
127
  /**
120
- * CSS stylesheets to apply before rendering.
128
+ * CSS to apply before rendering: stylesheet text, or a rule written as an
129
+ * object.
130
+ */
131
+ css?: CssInput[];
132
+ /**
133
+ * @deprecated Use `css` instead. Will be removed in v3.
121
134
  */
122
135
  stylesheets?: string[];
123
136
  /**
124
- * Structured keyframes to register alongside stylesheets.
137
+ * @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3.
125
138
  */
126
139
  keyframes?: Keyframes;
127
140
  /**
@@ -282,4 +295,4 @@ declare class Renderer {
282
295
  free(): void;
283
296
  }
284
297
  //#endregion
285
- export { AnimationOutputFormat, type AnimationOutputFormatOptions, AnimationScene, ByteBuf, ContainerNode, DitheringAlgorithm, Font, FontDetails, type FontLoader, ImageCacheMode, type ImageLoader, ImageNode, ImageSource, type ImagesInput, InitInput, InitOutput, KeyframeRule, Keyframes, KeyframesMap, KeyframesRule, KeyframesRuleList, MeasuredNode, MeasuredTextRun, type Node, NodeMetadata, OutputFormat, type OutputFormatOptions, RegisteredFace, RegisteredFamily, RenderAnimationOptions, RenderOptions, Renderer, RendererOptions, RgbaImage, SvgRenderOptions, SyncInitInput, TextNode, __wbg_init as default, initSync, setGlyphCacheMaxBytes };
298
+ export { AnimationOutputFormat, type AnimationOutputFormatOptions, AnimationScene, ByteBuf, ContainerNode, type CssInput, DitheringAlgorithm, Font, FontDetails, type FontLoader, ImageCacheMode, type ImageLoader, ImageNode, ImageSource, type ImagesInput, InitInput, InitOutput, KeyframeRule, Keyframes, KeyframesMap, KeyframesRule, KeyframesRuleList, MeasuredNode, MeasuredTextRun, type Node, NodeMetadata, OutputFormat, type OutputFormatOptions, RegisteredFace, RegisteredFamily, RenderAnimationOptions, RenderOptions, Renderer, RendererOptions, RgbaImage, SvgRenderOptions, SyncInitInput, TextNode, __wbg_init as default, initSync, setGlyphCacheMaxBytes };
package/dist/export.d.mts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { AnimationOutputFormatOptions, BackendAnimationOptions, BackendRenderOptions, BackendSvgOptions, FontLoader, FontLoader as FontLoader$1, ImageLoader, ImagesInput, OutputFormatOptions } from "@takumi-rs/helpers/renderer";
2
- import { ContainerNode, ImageNode, Node, Node as Node$1, NodeMetadata, RgbaImage, TextNode } from "@takumi-rs/helpers";
2
+ import { ContainerNode, CssInput, ImageNode, Node, Node as Node$1, NodeMetadata, RgbaImage, TextNode } from "@takumi-rs/helpers";
3
3
  import { Properties } from "csstype";
4
4
  //#region pkg/takumi_wasm.d.ts
5
5
  type ByteBuf = Uint8Array | ArrayBuffer | Buffer;
6
+ /** @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3. */
6
7
  type KeyframesMap = Record<string, Record<string, Properties>>;
8
+ /** @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3. */
7
9
  type KeyframesRuleList = {
8
10
  name: string;
9
11
  keyframes: {
@@ -11,6 +13,7 @@ type KeyframesRuleList = {
11
13
  declarations: Record<string, Properties>;
12
14
  }[];
13
15
  }[];
16
+ /** @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3. */
14
17
  type Keyframes = KeyframesMap | KeyframesRuleList;
15
18
  /** Output format for static images. */
16
19
  type OutputFormat = "png" | "jpeg" | "webp" | "ico" | "raw";
@@ -58,11 +61,16 @@ type RenderOptions$1 = {
58
61
  */
59
62
  images?: ImageSource[];
60
63
  /**
61
- * CSS stylesheets to apply before rendering.
64
+ * CSS to apply before rendering: stylesheet text, or a rule written as an
65
+ * object.
66
+ */
67
+ css?: CssInput[];
68
+ /**
69
+ * @deprecated Use `css` instead. Will be removed in v3.
62
70
  */
63
71
  stylesheets?: string[];
64
72
  /**
65
- * Structured keyframes to register alongside stylesheets.
73
+ * @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3.
66
74
  */
67
75
  keyframes?: Keyframes;
68
76
  /**
@@ -117,11 +125,16 @@ type RenderAnimationOptions$1 = {
117
125
  images?: ImageSource[];
118
126
  drawDebugBorder?: boolean;
119
127
  /**
120
- * CSS stylesheets to apply before rendering.
128
+ * CSS to apply before rendering: stylesheet text, or a rule written as an
129
+ * object.
130
+ */
131
+ css?: CssInput[];
132
+ /**
133
+ * @deprecated Use `css` instead. Will be removed in v3.
121
134
  */
122
135
  stylesheets?: string[];
123
136
  /**
124
- * Structured keyframes to register alongside stylesheets.
137
+ * @deprecated Use a `{ keyframes, steps }` entry in `css` instead. Will be removed in v3.
125
138
  */
126
139
  keyframes?: Keyframes;
127
140
  /**
@@ -282,4 +295,4 @@ declare class Renderer {
282
295
  free(): void;
283
296
  }
284
297
  //#endregion
285
- export { AnimationOutputFormat, type AnimationOutputFormatOptions, AnimationScene, ByteBuf, ContainerNode, DitheringAlgorithm, Font, FontDetails, type FontLoader, ImageCacheMode, type ImageLoader, ImageNode, ImageSource, type ImagesInput, InitInput, InitOutput, KeyframeRule, Keyframes, KeyframesMap, KeyframesRule, KeyframesRuleList, MeasuredNode, MeasuredTextRun, type Node, NodeMetadata, OutputFormat, type OutputFormatOptions, RegisteredFace, RegisteredFamily, RenderAnimationOptions, RenderOptions, Renderer, RendererOptions, RgbaImage, SvgRenderOptions, SyncInitInput, TextNode, __wbg_init as default, initSync, setGlyphCacheMaxBytes };
298
+ export { AnimationOutputFormat, type AnimationOutputFormatOptions, AnimationScene, ByteBuf, ContainerNode, type CssInput, DitheringAlgorithm, Font, FontDetails, type FontLoader, ImageCacheMode, type ImageLoader, ImageNode, ImageSource, type ImagesInput, InitInput, InitOutput, KeyframeRule, Keyframes, KeyframesMap, KeyframesRule, KeyframesRuleList, MeasuredNode, MeasuredTextRun, type Node, NodeMetadata, OutputFormat, type OutputFormatOptions, RegisteredFace, RegisteredFamily, RenderAnimationOptions, RenderOptions, Renderer, RendererOptions, RgbaImage, SvgRenderOptions, SyncInitInput, TextNode, __wbg_init as default, initSync, setGlyphCacheMaxBytes };
package/dist/export.mjs CHANGED
@@ -515,16 +515,20 @@ async function __wbg_load(module, imports) {
515
515
  }
516
516
  function initSync(module) {
517
517
  if (wasm !== void 0) return wasm;
518
- if (module !== void 0) if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
519
- else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
518
+ if (module !== void 0) {
519
+ if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
520
+ else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
521
+ }
520
522
  const imports = __wbg_get_imports();
521
523
  if (!(module instanceof WebAssembly.Module)) module = new WebAssembly.Module(module);
522
524
  return __wbg_finalize_init(new WebAssembly.Instance(module, imports), module);
523
525
  }
524
526
  async function __wbg_init(module_or_path) {
525
527
  if (wasm !== void 0) return wasm;
526
- if (module_or_path !== void 0) if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
527
- else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
528
+ if (module_or_path !== void 0) {
529
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
530
+ else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
531
+ }
528
532
  const imports = __wbg_get_imports();
529
533
  if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
530
534
  const { instance, module } = await __wbg_load(await module_or_path, imports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/wasm",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Render OG images from Takumi node trees with WebAssembly. No headless browser.",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -138,16 +138,16 @@
138
138
  }
139
139
  },
140
140
  "scripts": {
141
- "build": "wasm-pack build --no-pack --release --out-dir pkg --target web && bun build:js",
141
+ "build": "wasm-pack build --no-pack --release --out-dir pkg --target web -- --locked && bun build:js",
142
142
  "build:js": "tsdown",
143
- "build:debug": "wasm-pack build --no-pack --dev --out-dir pkg --target web && bun build:js",
143
+ "build:debug": "wasm-pack build --no-pack --dev --out-dir pkg --target web -- --locked && bun build:js",
144
144
  "publish-lint": "attw --pack . && publint --strict ."
145
145
  },
146
146
  "dependencies": {
147
- "@takumi-rs/helpers": "2.12.0"
147
+ "@takumi-rs/helpers": "2.13.0"
148
148
  },
149
149
  "devDependencies": {
150
- "@types/bun": "^1.3.14",
150
+ "@types/bun": "^1.4.0",
151
151
  "csstype": "^3.2.3",
152
152
  "tsdown": "0.22.14",
153
153
  "unrun": "^0.3.1"
Binary file