@rive-app/canvas 2.26.5 → 2.26.7

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",
3
- "version": "2.26.5",
3
+ "version": "2.26.7",
4
4
  "description": "Rive's canvas based web api.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.d.ts CHANGED
@@ -384,6 +384,7 @@ export declare class Rive {
384
384
  frameCount: number;
385
385
  isTouchScrollEnabled: boolean;
386
386
  constructor(params: RiveParameters);
387
+ get viewModelCount(): number;
387
388
  static new(params: RiveParameters): Rive;
388
389
  private onSystemAudioChanged;
389
390
  private onCanvasResize;
@@ -743,13 +744,25 @@ export declare class DataEnum {
743
744
  }
744
745
  export declare class ViewModelInstance {
745
746
  private _runtimeInstance;
746
- private _root;
747
+ private _parents;
748
+ private _children;
749
+ private _viewModelInstances;
747
750
  private _propertiesWithCallbacks;
748
751
  private _referenceCount;
749
- constructor(runtimeInstance: rc.ViewModelInstance, root: ViewModelInstance | null);
752
+ constructor(runtimeInstance: rc.ViewModelInstance, parent: ViewModelInstance | null);
750
753
  get runtimeInstance(): rc.ViewModelInstance | null;
751
754
  handleCallbacks(): void;
755
+ addParent(parent: ViewModelInstance): void;
756
+ removeParent(parent: ViewModelInstance): void;
757
+ addToPropertyCallbacks(property: ViewModelInstanceValue): void;
758
+ removeFromPropertyCallbacks(property: ViewModelInstanceValue): void;
759
+ addToViewModelCallbacks(instance: ViewModelInstance): void;
760
+ removeFromViewModelCallbacks(instance: ViewModelInstance): void;
752
761
  private clearCallbacks;
762
+ private propertyFromPath;
763
+ private viewModelFromPathSegments;
764
+ private propertyFromPathSegments;
765
+ private internalViewModelInstance;
753
766
  /**
754
767
  * method to access a property instance of type number belonging
755
768
  * to the view model instance or to a nested view model instance
@@ -759,47 +772,46 @@ export declare class ViewModelInstance {
759
772
  /**
760
773
  * method to access a property instance of type string belonging
761
774
  * to the view model instance or to a nested view model instance
762
- * @param path - path to the number property
775
+ * @param path - path to the string property
763
776
  */
764
777
  string(path: string): ViewModelInstanceString | null;
765
778
  /**
766
779
  * method to access a property instance of type boolean belonging
767
780
  * to the view model instance or to a nested view model instance
768
- * @param path - path to the number property
781
+ * @param path - path to the boolean property
769
782
  */
770
783
  boolean(path: string): ViewModelInstanceBoolean | null;
771
784
  /**
772
785
  * method to access a property instance of type color belonging
773
786
  * to the view model instance or to a nested view model instance
774
- * @param path - path to the number property
787
+ * @param path - path to the ttrigger property
775
788
  */
776
789
  color(path: string): ViewModelInstanceColor | null;
777
790
  /**
778
791
  * method to access a property instance of type trigger belonging
779
792
  * to the view model instance or to a nested view model instance
780
- * @param path - path to the number property
793
+ * @param path - path to the trigger property
781
794
  */
782
795
  trigger(path: string): ViewModelInstanceTrigger | null;
783
796
  /**
784
797
  * method to access a property instance of type enum belonging
785
798
  * to the view model instance or to a nested view model instance
786
- * @param path - path to the number property
799
+ * @param path - path to the enum property
787
800
  */
788
801
  enum(path: string): ViewModelInstanceEnum | null;
789
802
  /**
790
803
  * method to access a view model property instance belonging
791
804
  * to the view model instance or to a nested view model instance
792
- * @param path - path to the number property
805
+ * @param path - path to the view model property
793
806
  */
794
807
  viewModel(path: string): ViewModelInstance | null;
808
+ internalReplaceViewModel(name: string, value: ViewModelInstance): boolean;
795
809
  /**
796
810
  * method to replace a view model property with another view model value
797
811
  * @param path - path to the view model property
798
812
  * @param value - view model that will replace the original
799
813
  */
800
814
  replaceViewModel(path: string, value: ViewModelInstance): boolean;
801
- addToCallbacks(property: ViewModelInstanceValue): void;
802
- removeFromCallbacks(property: ViewModelInstanceValue): void;
803
815
  incrementReferenceCount(): void;
804
816
  decrementReferenceCount(): void;
805
817
  get properties(): rc.ViewModelProperty[];
@@ -807,42 +819,43 @@ export declare class ViewModelInstance {
807
819
  cleanup(): void;
808
820
  }
809
821
  export declare class ViewModelInstanceValue {
810
- protected _rootViewModel: ViewModelInstance;
822
+ protected _parentViewModel: ViewModelInstance;
811
823
  protected callbacks: EventCallback[];
812
824
  protected _viewModelInstanceValue: rc.ViewModelInstanceValue;
813
- constructor(instance: rc.ViewModelInstanceValue, root: ViewModelInstance);
825
+ constructor(instance: rc.ViewModelInstanceValue, parent: ViewModelInstance);
814
826
  on(callback: EventCallback): void;
815
827
  off(callback?: EventCallback): void;
816
828
  internalHandleCallback(callback: Function): void;
817
829
  handleCallbacks(): void;
830
+ clearChanges(): void;
818
831
  clearCallbacks(): void;
819
832
  get name(): string;
820
833
  }
821
834
  export declare class ViewModelInstanceString extends ViewModelInstanceValue {
822
- constructor(instance: rc.ViewModelInstanceString, root: ViewModelInstance);
835
+ constructor(instance: rc.ViewModelInstanceString, parent: ViewModelInstance);
823
836
  get value(): string;
824
837
  set value(val: string);
825
838
  internalHandleCallback(callback: Function): void;
826
839
  }
827
840
  export declare class ViewModelInstanceNumber extends ViewModelInstanceValue {
828
- constructor(instance: rc.ViewModelInstanceNumber, root: ViewModelInstance);
841
+ constructor(instance: rc.ViewModelInstanceNumber, parent: ViewModelInstance);
829
842
  get value(): number;
830
843
  set value(val: number);
831
844
  internalHandleCallback(callback: Function): void;
832
845
  }
833
846
  export declare class ViewModelInstanceBoolean extends ViewModelInstanceValue {
834
- constructor(instance: rc.ViewModelInstanceBoolean, root: ViewModelInstance);
847
+ constructor(instance: rc.ViewModelInstanceBoolean, parent: ViewModelInstance);
835
848
  get value(): boolean;
836
849
  set value(val: boolean);
837
850
  internalHandleCallback(callback: Function): void;
838
851
  }
839
852
  export declare class ViewModelInstanceTrigger extends ViewModelInstanceValue {
840
- constructor(instance: rc.ViewModelInstanceTrigger, root: ViewModelInstance);
853
+ constructor(instance: rc.ViewModelInstanceTrigger, parent: ViewModelInstance);
841
854
  trigger(): void;
842
855
  internalHandleCallback(callback: Function): void;
843
856
  }
844
857
  export declare class ViewModelInstanceEnum extends ViewModelInstanceValue {
845
- constructor(instance: rc.ViewModelInstanceEnum, root: ViewModelInstance);
858
+ constructor(instance: rc.ViewModelInstanceEnum, parent: ViewModelInstance);
846
859
  get value(): string;
847
860
  set value(val: string);
848
861
  set valueIndex(val: number);
@@ -851,7 +864,7 @@ export declare class ViewModelInstanceEnum extends ViewModelInstanceValue {
851
864
  internalHandleCallback(callback: Function): void;
852
865
  }
853
866
  export declare class ViewModelInstanceColor extends ViewModelInstanceValue {
854
- constructor(instance: rc.ViewModelInstanceColor, root: ViewModelInstance);
867
+ constructor(instance: rc.ViewModelInstanceColor, parent: ViewModelInstance);
855
868
  get value(): number;
856
869
  set value(val: number);
857
870
  rgb(r: number, g: number, b: number): void;