@rive-app/webgl-single 2.14.4 → 2.15.1

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.
@@ -29,7 +29,8 @@ export interface RiveCanvas {
29
29
  RenderPaintStyle: typeof RenderPaintStyle;
30
30
  StrokeCap: typeof StrokeCap;
31
31
  StrokeJoin: typeof StrokeJoin;
32
- decodeImage: DecodeFont;
32
+ decodeAudio: DecodeAudio;
33
+ decodeImage: DecodeImage;
33
34
  decodeFont: DecodeFont;
34
35
 
35
36
  /**
@@ -92,7 +93,7 @@ export interface RiveCanvas {
92
93
  cancelAnimationFrame(requestID: number): void;
93
94
  /**
94
95
  * A Rive-specific function to "flush" queued up draw calls from using the renderer.
95
- *
96
+ *
96
97
  * This should only be invoked once at the end of a loop in a regular JS
97
98
  * requestAnimationFrame loop, and should not be used with the Rive-wrapped
98
99
  * requestAnimationFrame (aka, the requestAnimationFrame() API on this object) as that
@@ -269,6 +270,15 @@ export interface CanvasRenderFactory {
269
270
  makeRenderPath(): CanvasRenderPath;
270
271
  }
271
272
 
273
+ export class Audio {
274
+ unref(): void;
275
+ }
276
+ export interface AudioCallback {
277
+ (audio: Audio): void;
278
+ }
279
+ export interface DecodeAudio {
280
+ (bytes: Uint8Array, callback: AudioCallback): void;
281
+ }
272
282
  export class Image {
273
283
  unref(): void;
274
284
  }
@@ -338,6 +348,7 @@ export declare class Artboard {
338
348
  * Get the bounds of this Artboard instance
339
349
  */
340
350
  get bounds(): AABB;
351
+ get hasAudio(): boolean;
341
352
  get frameOrigin(): boolean;
342
353
  set frameOrigin(val: boolean);
343
354
  /**
@@ -896,13 +907,25 @@ export declare class Vec2D {
896
907
  export declare class FileAsset {
897
908
  name: string;
898
909
  fileExtension: string;
910
+ uniqueFilename: string;
911
+ isAudio: boolean;
899
912
  isImage: boolean;
900
913
  isFont: boolean;
901
914
  cdnUuid: string;
915
+
916
+ decode(bytes: Uint8Array): void;
917
+ }
918
+
919
+ /**
920
+ * Rive class extending the FileAsset that exposes a `setAudioSource()` API with a
921
+ * decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset
922
+ */
923
+ export declare class AudioAsset extends FileAsset {
924
+ setAudioSource(audio: Audio): void;
902
925
  }
903
926
 
904
927
  /**
905
- * Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
928
+ * Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
906
929
  * decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset
907
930
  */
908
931
  export declare class ImageAsset extends FileAsset {
@@ -910,7 +933,7 @@ export declare class ImageAsset extends FileAsset {
910
933
  }
911
934
 
912
935
  /**
913
- * Rive class extending the FileAsset that exposes a `setFont()` API with a
936
+ * Rive class extending the FileAsset that exposes a `setFont()` API with a
914
937
  * decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset
915
938
  */
916
939
  export declare class FontAsset extends FileAsset {