@takumi-rs/core 0.9.0 → 0.11.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.
Files changed (3) hide show
  1. package/README.md +7 -2
  2. package/index.d.ts +1 -3
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -9,9 +9,14 @@ import { writeFile } from "fs/promises";
9
9
 
10
10
  const render = new Renderer();
11
11
 
12
+ const logoUrl = "https://yeecord.com/img/logo.png";
13
+ const logo = await fetch("https://yeecord.com/img/logo.png").then((r) =>
14
+ r.arrayBuffer()
15
+ );
16
+
12
17
  const node = container({
13
18
  children: [
14
- image("https://yeecord.com/img/logo.png", {
19
+ image(logoUrl, {
15
20
  width: 128,
16
21
  height: 128,
17
22
  }),
@@ -24,6 +29,6 @@ const node = container({
24
29
  const buffer = await render.renderAsync(node, {
25
30
  width: 1200,
26
31
  height: 630,
27
- format: OutputFormat.WebP
32
+ format: OutputFormat.WebP,
28
33
  });
29
34
  ```
package/index.d.ts CHANGED
@@ -2,12 +2,10 @@
2
2
  /* eslint-disable */
3
3
  export declare class Renderer {
4
4
  constructor(options?: ConstructRendererOptions | undefined | null)
5
- loadLocalImageAsync(key: string, data: ArrayBuffer, signal?: AbortSignal | undefined | null): Promise<void>
5
+ putPersistentImageAsync(src: string, data: ArrayBuffer, signal?: AbortSignal | undefined | null): Promise<void>
6
6
  loadFontAsync(data: ArrayBuffer, signal?: AbortSignal | undefined | null): Promise<number>
7
7
  loadFontsAsync(fonts: Array<ArrayBuffer>, signal?: AbortSignal | undefined | null): Promise<number>
8
8
  clearImageStore(): void
9
- clearLocalImageStore(): void
10
- preloadImageAsync(url: string, signal?: AbortSignal | undefined | null): Promise<void>
11
9
  renderAsync(source: { type: string }, options: RenderOptions, signal?: AbortSignal): Promise<Buffer>
12
10
  }
13
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/core",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "author": {
5
5
  "email": "me@kane.tw",
6
6
  "name": "Kane Wang",
@@ -41,10 +41,10 @@
41
41
  "type": "commonjs",
42
42
  "types": "index.d.ts",
43
43
  "optionalDependencies": {
44
- "@takumi-rs/core-darwin-arm64": "0.9.0",
45
- "@takumi-rs/core-linux-arm64-gnu": "0.9.0",
46
- "@takumi-rs/core-linux-arm64-musl": "0.9.0",
47
- "@takumi-rs/core-linux-x64-gnu": "0.9.0",
48
- "@takumi-rs/core-linux-x64-musl": "0.9.0"
44
+ "@takumi-rs/core-darwin-arm64": "0.11.0",
45
+ "@takumi-rs/core-linux-arm64-gnu": "0.11.0",
46
+ "@takumi-rs/core-linux-arm64-musl": "0.11.0",
47
+ "@takumi-rs/core-linux-x64-gnu": "0.11.0",
48
+ "@takumi-rs/core-linux-x64-musl": "0.11.0"
49
49
  }
50
50
  }