lecodes-sdk 2.2.10 → 2.2.11

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.
@@ -41,14 +41,14 @@ export declare class Canvas extends Recorder {
41
41
  drawImage(img: Bitmap | ImageRef, dx: number, dy: number, dw: number, dh: number): this;
42
42
  drawImage(img: Bitmap | ImageRef, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): this;
43
43
  /** Decode an image source into a standalone `Bitmap` you can blit with `drawImage()` — either an
44
- * `SvgSource(...)` (drawn by the core, painted by the host) or a `FetchResponse` holding already-fetched
45
- * image bytes (decoded; an SVG file is detected). This is async because the web host decodes with the
46
- * browser; `await` it ONCE, then `drawImage(bitmap, …)` is synchronous and the Bitmap is reusable. The
47
- * returned Bitmap owns a native surface at the image's natural pixel size (`pixelRatio` 1), freed
48
- * once nothing references the Bitmap (`destroy()` frees it early). Typical use:
44
+ * `SvgSource(...)` (drawn by the core, painted by the host) or a `FetchResponse` / `File` holding
45
+ * already-fetched image bytes (decoded; an SVG file is detected). This is async because the web host
46
+ * decodes with the browser; `await` it ONCE, then `drawImage(bitmap, …)` is synchronous and the Bitmap
47
+ * is reusable. The returned Bitmap owns a native surface at the image's natural pixel size
48
+ * (`pixelRatio` 1), freed once nothing references the Bitmap (`destroy()` frees it early). Typical use:
49
49
  * const logo = await canvas.loadImage(SvgSource(svg)) // or: await fetch(url) → the response
50
50
  * canvas.drawImage(logo, 0, 0) // sync, blit as often as you like */
51
- loadImage(source: SvgSourceValue | FetchResponse): Promise<Bitmap>;
51
+ loadImage(source: SvgSourceValue | FetchResponse | File): Promise<Bitmap>;
52
52
  /** Measure `text` in the current font and letterSpacing on THIS platform. The one synchronous
53
53
  * round-trip. */
54
54
  measureText(text: string): CanvasTextMetrics;
@@ -1,5 +1,6 @@
1
1
  import { Emitter } from "../core/events";
2
2
  import { Texture } from "../gl/Texture";
3
+ import type { File, FetchResponse } from "./fetch";
3
4
  type MediaEvents = {
4
5
  /** Fired at each loop boundary while `loop` is true. */
5
6
  loopReached: () => void;
@@ -32,10 +33,10 @@ declare abstract class MediaPlayer extends Emitter<MediaEvents> {
32
33
  dispose(): void;
33
34
  }
34
35
  export declare class AudioPlayer extends MediaPlayer {
35
- constructor(src?: string);
36
+ constructor(src?: string | File | FetchResponse);
36
37
  }
37
38
  export declare class VideoPlayer extends MediaPlayer {
38
- constructor(src?: string);
39
+ constructor(src?: string | File | FetchResponse);
39
40
  /** A 3D Texture that samples this video (e.g. for a Material.video()). Owned by the player. */
40
41
  get texture(): Texture;
41
42
  }
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "2.2.10";
1
+ export declare const SDK_VERSION = "2.2.11";
2
2
  /** The major of a semver string, or null when it is not one. */
3
3
  export declare const sdkMajor: (version: string | null | undefined) => number | null;
4
4
  /** The `// sdk: <version>` line of a compiled bundle's header (sdk/src/compile/header.ts), read from