@rive-app/webgl-single 1.0.43 → 1.0.44

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/webgl-single",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
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
@@ -139,6 +139,10 @@ export interface EventListener {
139
139
  type: EventType;
140
140
  callback: EventCallback;
141
141
  }
142
+ /**
143
+ * FPS Reporting through callbacks sent to the WASM runtime
144
+ */
145
+ export declare type FPSCallback = (fps: number) => void;
142
146
  declare class EventManager {
143
147
  private listeners;
144
148
  constructor(listeners?: EventListener[]);
@@ -399,6 +403,16 @@ export declare class Rive {
399
403
  * renderer is already active, then this will have zero effect.
400
404
  */
401
405
  startRendering(): void;
406
+ /**
407
+ * Enables frames-per-second (FPS) reporting for the runtime
408
+ * If no callback is provided, Rive will append a fixed-position div at the top-right corner of the page with the FPS reading
409
+ * @param fpsCallback - Callback from the runtime during the RAF loop that supplies the FPS value
410
+ */
411
+ enableFPSCounter(fpsCallback?: FPSCallback): void;
412
+ /**
413
+ * Disables frames-per-second (FPS) reporting for the runtime
414
+ */
415
+ disableFPSCounter(): void;
402
416
  /**
403
417
  * Returns the contents of a Rive file: the artboards, animations, and state machines
404
418
  */