@rive-app/canvas-advanced 2.38.0 → 2.38.2

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.
@@ -733,7 +733,7 @@ function Za(a, b) {
733
733
  return Ya(c, a, b);
734
734
  }));
735
735
  }
736
- var $a, ab, eb = {485773:(a, b, c, d, e) => {
736
+ var $a, ab, eb = {485853:(a, b, c, d, e) => {
737
737
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
738
738
  return 0;
739
739
  }
@@ -796,11 +796,11 @@ var $a, ab, eb = {485773:(a, b, c, d, e) => {
796
796
  }
797
797
  window.h.za += 1;
798
798
  return 1;
799
- }, 487951:() => {
799
+ }, 488031:() => {
800
800
  "undefined" !== typeof window.h && (window.h.Sa.map(function(a) {
801
801
  document.removeEventListener(a, window.h.unlock, !0);
802
802
  }), --window.h.za, 0 === window.h.za && delete window.h);
803
- }, 488255:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 488359:() => {
803
+ }, 488335:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 488439:() => {
804
804
  try {
805
805
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
806
806
  a.close();
@@ -808,7 +808,7 @@ var $a, ab, eb = {485773:(a, b, c, d, e) => {
808
808
  } catch (c) {
809
809
  return 0;
810
810
  }
811
- }, 488530:(a, b, c, d, e, f) => {
811
+ }, 488610:(a, b, c, d, e, f) => {
812
812
  if ("undefined" === typeof window.h) {
813
813
  return -1;
814
814
  }
@@ -854,7 +854,7 @@ var $a, ab, eb = {485773:(a, b, c, d, e) => {
854
854
  a == window.h.J.xa && g.Z.connect(g.L.destination);
855
855
  g.pb = f;
856
856
  return window.h.tc(g);
857
- }, 491407:a => window.h.qa(a).L.sampleRate, 491480:a => {
857
+ }, 491487:a => window.h.qa(a).L.sampleRate, 491560:a => {
858
858
  a = window.h.qa(a);
859
859
  void 0 !== a.Z && (a.Z.onaudioprocess = function() {
860
860
  }, a.Z.disconnect(), a.Z = void 0);
@@ -862,13 +862,13 @@ var $a, ab, eb = {485773:(a, b, c, d, e) => {
862
862
  a.L.close();
863
863
  a.L = void 0;
864
864
  a.pb = void 0;
865
- }, 491880:a => {
865
+ }, 491960:a => {
866
866
  window.h.Ab(a);
867
- }, 491930:a => {
867
+ }, 492010:a => {
868
868
  a = window.h.qa(a);
869
869
  a.L.resume();
870
870
  a.state = window.h.ga.wb;
871
- }, 492069:a => {
871
+ }, 492149:a => {
872
872
  a = window.h.qa(a);
873
873
  a.L.suspend();
874
874
  a.state = window.h.ga.stopped;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas-advanced",
3
- "version": "2.38.0",
3
+ "version": "2.38.2",
4
4
  "description": "Rive's lightweight low-level canvas based web api.",
5
5
  "main": "canvas_advanced.mjs",
6
6
  "homepage": "https://rive.app",
package/rive.wasm CHANGED
Binary file
@@ -1,3 +1,9 @@
1
+ import type {
2
+ ImageWrapper,
3
+ AudioWrapper,
4
+ FontWrapper,
5
+ } from "./utils/finalizationRegistry";
6
+
1
7
  interface RiveOptions {
2
8
  locateFile(file: string): string;
3
9
  wasmBinary?: ArrayBuffer;
@@ -169,6 +175,11 @@ export declare class RendererWrapper {
169
175
  flush(): void;
170
176
  translate(x: number, y: number): void;
171
177
  rotate(angle: number): void;
178
+ /**
179
+ * (WebGL only) Makes the GL context that backs this renderer's textures current, before
180
+ * performing any WASM teardown that frees resources
181
+ */
182
+ bindContext?(): void;
172
183
  }
173
184
 
174
185
  export declare class RenderPathWrapper {
@@ -1258,7 +1269,7 @@ export declare class AudioAssetInternal extends FileAssetInternal {
1258
1269
  * decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset
1259
1270
  */
1260
1271
  export declare class AudioAsset extends FileAsset {
1261
- setAudioSource(audio: Audio): void;
1272
+ setAudioSource(audio: Audio | AudioWrapper): void;
1262
1273
  }
1263
1274
 
1264
1275
  export declare class ImageAssetInternal extends FileAssetInternal {
@@ -1269,7 +1280,7 @@ export declare class ImageAssetInternal extends FileAssetInternal {
1269
1280
  * decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset
1270
1281
  */
1271
1282
  export declare class ImageAsset extends FileAsset {
1272
- setRenderImage(image: Image): void;
1283
+ setRenderImage(image: Image | ImageWrapper): void;
1273
1284
  }
1274
1285
 
1275
1286
  export declare class FontAssetInternal extends FileAssetInternal {
@@ -1280,7 +1291,10 @@ export declare class FontAssetInternal extends FileAssetInternal {
1280
1291
  * decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset
1281
1292
  */
1282
1293
  export declare class FontAsset extends FileAsset {
1283
- setFont(font: Font): void;
1294
+ // Accepts the high-level `FontWrapper` returned by `decodeFont()` as well as
1295
+ // the low-level embind `Font`. `FontWrapper` lacks the `ptr()` member that was
1296
+ // added to `Font`
1297
+ setFont(font: Font | FontWrapper): void;
1284
1298
  }
1285
1299
 
1286
1300
  export declare class FileAssetLoader {}
Binary file