@rive-app/webgl-single 1.2.2 → 1.2.4

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 (4) hide show
  1. package/package.json +1 -1
  2. package/rive.d.ts +20 -5
  3. package/rive.js +165 -150
  4. package/rive.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/webgl-single",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Rive's webgl based web api with bundled wasm.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.d.ts CHANGED
@@ -2,11 +2,11 @@ import * as rc from "./rive_advanced.mjs";
2
2
  /**
3
3
  * Generic type for a parameterless void callback
4
4
  */
5
- export declare type VoidCallback = () => void;
5
+ export type VoidCallback = () => void;
6
6
  /**
7
7
  * Type for artboard bounds
8
8
  */
9
- export declare type Bounds = rc.AABB;
9
+ export type Bounds = rc.AABB;
10
10
  export declare enum Fit {
11
11
  Cover = "cover",
12
12
  Contain = "contain",
@@ -53,7 +53,7 @@ export declare class Layout {
53
53
  runtimeFit(rive: rc.RiveCanvas): rc.Fit;
54
54
  runtimeAlignment(rive: rc.RiveCanvas): rc.Alignment;
55
55
  }
56
- export declare type RuntimeCallback = (rive: rc.RiveCanvas) => void;
56
+ export type RuntimeCallback = (rive: rc.RiveCanvas) => void;
57
57
  export declare class RuntimeLoader {
58
58
  private static runtime;
59
59
  private static isLoading;
@@ -131,7 +131,7 @@ export interface LoopEvent {
131
131
  /**
132
132
  * Loop events are returned through onloop callbacks
133
133
  */
134
- export declare type EventCallback = (event: Event) => void;
134
+ export type EventCallback = (event: Event) => void;
135
135
  /**
136
136
  * Event listeners registered with the event manager
137
137
  */
@@ -142,7 +142,7 @@ export interface EventListener {
142
142
  /**
143
143
  * FPS Reporting through callbacks sent to the WASM runtime
144
144
  */
145
- export declare type FPSCallback = (fps: number) => void;
145
+ export type FPSCallback = (fps: number) => void;
146
146
  declare class EventManager {
147
147
  private listeners;
148
148
  constructor(listeners?: EventListener[]);
@@ -394,12 +394,27 @@ export declare class Rive {
394
394
  on(type: EventType, callback: EventCallback): void;
395
395
  /**
396
396
  * Unsubscribes from a Rive-generated event
397
+ * @param type the type of event to unsubscribe from
398
+ * @param callback the callback to unsubscribe
399
+ */
400
+ off(type: EventType, callback: EventCallback): void;
401
+ /**
402
+ * Unsubscribes from a Rive-generated event
403
+ * @deprecated
397
404
  * @param callback the callback to unsubscribe from
398
405
  */
399
406
  unsubscribe(type: EventType, callback: EventCallback): void;
407
+ /**
408
+ * Unsubscribes all Rive listeners from an event type, or everything if no type is
409
+ * given
410
+ * @param type the type of event to unsubscribe from, or all types if
411
+ * undefined
412
+ */
413
+ removeAllRiveEventListeners(type?: EventType): void;
400
414
  /**
401
415
  * Unsubscribes all listeners from an event type, or everything if no type is
402
416
  * given
417
+ * @deprecated
403
418
  * @param type the type of event to unsubscribe from, or all types if
404
419
  * undefined
405
420
  */