@rive-app/webgl-single 2.35.4 → 2.36.0

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": "2.35.4",
3
+ "version": "2.36.0",
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
@@ -73,6 +73,11 @@ export declare class RuntimeLoader {
73
73
  private static rive;
74
74
  private static wasmURL;
75
75
  private constructor();
76
+ /**
77
+ * When true, performance.mark / performance.measure entries are emitted for
78
+ * WASM initialization.
79
+ */
80
+ static enablePerfMarks: boolean;
76
81
  private static loadRuntime;
77
82
  static getInstance(callback: RuntimeCallback): void;
78
83
  static awaitInstance(): Promise<rc.RiveCanvas>;
@@ -270,6 +275,13 @@ export interface RiveParameters {
270
275
  * Enum with drawing options for optimizations
271
276
  */
272
277
  drawingOptions?: DrawOptimizationOptions;
278
+ /**
279
+ * Emit performance.mark / performance.measure entries for load lifecycle
280
+ * events and the first 3 render frames. Useful for profiling Rive's
281
+ * contribution to load and render time in browser devtools.
282
+ * False by default.
283
+ */
284
+ enablePerfMarks?: boolean;
273
285
  onLoad?: EventCallback;
274
286
  onLoadError?: EventCallback;
275
287
  onPlay?: EventCallback;
@@ -334,6 +346,11 @@ export interface RiveFileParameters {
334
346
  enableRiveAssetCDN?: boolean;
335
347
  onLoad?: EventCallback;
336
348
  onLoadError?: EventCallback;
349
+ /**
350
+ * Emit performance.mark / performance.measure entries for load lifecycle
351
+ * events. False by default.
352
+ */
353
+ enablePerfMarks?: boolean;
337
354
  }
338
355
  export declare class RiveFile implements rc.FinalizableTarget {
339
356
  private static readonly missingErrorMessage;
@@ -344,6 +361,7 @@ export declare class RiveFile implements rc.FinalizableTarget {
344
361
  private file;
345
362
  private assetLoader;
346
363
  private enableRiveAssetCDN;
364
+ private enablePerfMarks;
347
365
  private eventManager;
348
366
  private referenceCount;
349
367
  private destroyed;
@@ -353,6 +371,8 @@ export declare class RiveFile implements rc.FinalizableTarget {
353
371
  private releaseFile;
354
372
  private releaseBindableArtboards;
355
373
  private initData;
374
+ private loadRiveFileBytes;
375
+ private loadRuntime;
356
376
  init(): Promise<void>;
357
377
  private fireLoadError;
358
378
  /**
@@ -436,6 +456,7 @@ export declare class Rive {
436
456
  private _viewModelInstance;
437
457
  private _dataEnums;
438
458
  private drawOptimization;
459
+ private enablePerfMarks;
439
460
  durations: number[];
440
461
  frameTimes: number[];
441
462
  frameCount: number;
@@ -918,6 +939,10 @@ export declare class ViewModelInstance {
918
939
  incrementReferenceCount(): void;
919
940
  decrementReferenceCount(): void;
920
941
  get properties(): rc.ViewModelProperty[];
942
+ /**
943
+ * Get the name of the ViewModel definition this instance was created from.
944
+ */
945
+ get viewModelName(): string;
921
946
  internalIncrementReferenceCount(): void;
922
947
  cleanup(): void;
923
948
  }