@rive-app/canvas-lite 2.31.6 → 2.32.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/canvas-lite",
3
- "version": "2.31.6",
3
+ "version": "2.32.0",
4
4
  "description": "A lite version of Rive's canvas based web api.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.d.ts CHANGED
@@ -112,9 +112,20 @@ export declare enum RiveEventType {
112
112
  General = 128,
113
113
  OpenUrl = 131
114
114
  }
115
- declare class Artboard {
115
+ declare class BaseArtboard {
116
+ isBindableArtboard: boolean;
117
+ constructor(_isBindableArtboard: boolean);
118
+ }
119
+ declare class Artboard extends BaseArtboard {
116
120
  nativeArtboard: rc.Artboard;
117
- constructor(artboard: rc.Artboard);
121
+ file: RiveFile;
122
+ constructor(artboard: rc.Artboard, _file: RiveFile);
123
+ }
124
+ declare class BindableArtboard extends BaseArtboard implements rc.FinalizableTarget {
125
+ selfUnref: boolean;
126
+ nativeArtboard: rc.BindableArtboard;
127
+ constructor(artboard: rc.BindableArtboard);
128
+ destroy(): void;
118
129
  }
119
130
  /**
120
131
  * Supported event types triggered in Rive
@@ -241,6 +252,14 @@ export interface RiveParameters {
241
252
  * Rive will look for a default view model and view model instance to bind to the artboard
242
253
  */
243
254
  autoBind?: boolean;
255
+ /**
256
+ * For Rive Listeners, dispatch a pointer exit when the pointer exits the canvas.
257
+ */
258
+ dispatchPointerExit?: boolean;
259
+ /**
260
+ * Enables multi touch support
261
+ */
262
+ enableMultiTouch?: boolean;
244
263
  onLoad?: EventCallback;
245
264
  onLoadError?: EventCallback;
246
265
  onPlay?: EventCallback;
@@ -319,8 +338,10 @@ export declare class RiveFile implements rc.FinalizableTarget {
319
338
  private referenceCount;
320
339
  private destroyed;
321
340
  selfUnref: boolean;
341
+ private bindableArtboards;
322
342
  constructor(params: RiveFileParameters);
323
343
  private releaseFile;
344
+ private releaseBindableArtboards;
324
345
  private initData;
325
346
  init(): Promise<void>;
326
347
  private fireLoadError;
@@ -346,7 +367,17 @@ export declare class RiveFile implements rc.FinalizableTarget {
346
367
  removeAllRiveEventListeners(type?: EventType): void;
347
368
  getInstance(): rc.File;
348
369
  destroyIfUnused(): void;
370
+ private createBindableArtboard;
371
+ /**
372
+ * @deprecated This function is deprecated. For better stability and memory management
373
+ * use `getBindableArtboard()` instead.
374
+ * @param {string} name - The name of the artboard.
375
+ * @returns {Artboard} The artboard to bind to.
376
+ */
349
377
  getArtboard(name: string): Artboard | null;
378
+ getBindableArtboard(name: string): BindableArtboard | null;
379
+ getDefaultBindableArtboard(): BindableArtboard | null;
380
+ internalBindableArtboardFromArtboard(artboard: rc.Artboard): BindableArtboard | null;
350
381
  }
351
382
  export declare class Rive {
352
383
  private readonly canvas;
@@ -378,6 +409,8 @@ export declare class Rive {
378
409
  private static readonly cleanupErrorMessage;
379
410
  private shouldDisableRiveListeners;
380
411
  private automaticallyHandleEvents;
412
+ private dispatchPointerExit;
413
+ private enableMultiTouch;
381
414
  private enableRiveAssetCDN;
382
415
  private _volume;
383
416
  private _artboardWidth;
@@ -732,7 +765,15 @@ export declare class Rive {
732
765
  viewModelByName(name: string): ViewModel | null;
733
766
  enums(): DataEnum[];
734
767
  defaultViewModel(): ViewModel | null;
768
+ /**
769
+ * @deprecated This function is deprecated. For better stability and memory management
770
+ * use `getBindableArtboard()` instead.
771
+ * @param {string} name - The name of the artboard.
772
+ * @returns {Artboard} The artboard to bind to.
773
+ */
735
774
  getArtboard(name: string): Artboard | null;
775
+ getBindableArtboard(name: string): BindableArtboard | null;
776
+ getDefaultBindableArtboard(): BindableArtboard | null;
736
777
  }
737
778
  export declare class ViewModel {
738
779
  private _viewModel;
@@ -759,8 +800,10 @@ export declare class ViewModelInstance {
759
800
  private _viewModelInstances;
760
801
  private _propertiesWithCallbacks;
761
802
  private _referenceCount;
803
+ selfUnref: boolean;
762
804
  constructor(runtimeInstance: rc.ViewModelInstance, parent: ViewModelInstance | null);
763
805
  get runtimeInstance(): rc.ViewModelInstance | null;
806
+ get nativeInstance(): rc.ViewModelInstance | null;
764
807
  handleCallbacks(): void;
765
808
  addParent(parent: ViewModelInstance): void;
766
809
  removeParent(parent: ViewModelInstance): void;
@@ -920,7 +963,7 @@ export declare class ViewModelInstanceAssetImage extends ViewModelInstanceValue
920
963
  }
921
964
  export declare class ViewModelInstanceArtboard extends ViewModelInstanceValue {
922
965
  constructor(instance: rc.ViewModelInstanceArtboard, root: ViewModelInstance);
923
- set value(artboard: Artboard | null);
966
+ set value(artboard: BaseArtboard | null);
924
967
  internalHandleCallback(callback: Function): void;
925
968
  }
926
969
  /**