@rive-app/canvas 2.27.4 → 2.27.5

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.27.4",
3
+ "version": "2.27.5",
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
@@ -1,6 +1,6 @@
1
1
  import * as rc from "./rive_advanced.mjs";
2
- import { ImageWrapper, AssetLoadCallbackWrapper } from "./utils";
3
- export type { FileAssetWrapper as FileAsset, ImageAssetWrapper as ImageAsset, AudioAssetWrapper as AudioAsset, FontAssetWrapper as FontAsset, AssetLoadCallbackWrapper as AssetLoadCallback, } from "./utils";
2
+ export type AssetLoadCallback = (asset: rc.FileAsset, bytes: Uint8Array) => Boolean;
3
+ export type { FileAsset, AudioAsset, FontAsset, ImageAsset, } from "./rive_advanced.mjs";
4
4
  /**
5
5
  * Generic type for a parameterless void callback
6
6
  */
@@ -245,7 +245,7 @@ export interface RiveParameters {
245
245
  onLoop?: EventCallback;
246
246
  onStateChange?: EventCallback;
247
247
  onAdvance?: EventCallback;
248
- assetLoader?: AssetLoadCallbackWrapper;
248
+ assetLoader?: AssetLoadCallback;
249
249
  /**
250
250
  * @deprecated Use `onLoad()` instead
251
251
  */
@@ -297,7 +297,7 @@ export interface RiveResetParameters {
297
297
  export interface RiveFileParameters {
298
298
  src?: string;
299
299
  buffer?: ArrayBuffer;
300
- assetLoader?: AssetLoadCallbackWrapper;
300
+ assetLoader?: AssetLoadCallback;
301
301
  enableRiveAssetCDN?: boolean;
302
302
  onLoad?: EventCallback;
303
303
  onLoadError?: EventCallback;
@@ -897,7 +897,7 @@ export declare class ViewModelInstanceColor extends ViewModelInstanceValue {
897
897
  }
898
898
  export declare class ViewModelInstanceAssetImage extends ViewModelInstanceValue {
899
899
  constructor(instance: rc.ViewModelInstanceAssetImage, root: ViewModelInstance);
900
- set value(image: ImageWrapper);
900
+ set value(image: rc.Image);
901
901
  internalHandleCallback(callback: Function): void;
902
902
  }
903
903
  /**
@@ -946,7 +946,7 @@ export declare const decodeAudio: (bytes: Uint8Array) => Promise<rc.Audio>;
946
946
  * Be sure to call `.unref()` on the image once it is no longer needed. This
947
947
  * allows the engine to clean it up when it is not used by any more animations.
948
948
  */
949
- export declare const decodeImage: (bytes: Uint8Array) => Promise<ImageWrapper>;
949
+ export declare const decodeImage: (bytes: Uint8Array) => Promise<rc.Image>;
950
950
  /**
951
951
  * Decodes bytes into a font.
952
952
  *
package/rive.js CHANGED
@@ -3369,7 +3369,7 @@ $d();
3369
3369
  /* 2 */
3370
3370
  /***/ ((module) => {
3371
3371
 
3372
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.27.4","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3372
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.27.5","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3373
3373
 
3374
3374
  /***/ }),
3375
3375
  /* 3 */
@@ -3975,8 +3975,8 @@ var FileAssetWrapper = /** @class */ (function () {
3975
3975
  */
3976
3976
  var ImageAssetWrapper = /** @class */ (function (_super) {
3977
3977
  __extends(ImageAssetWrapper, _super);
3978
- function ImageAssetWrapper(nativeAsset) {
3979
- return _super.call(this, nativeAsset) || this;
3978
+ function ImageAssetWrapper() {
3979
+ return _super !== null && _super.apply(this, arguments) || this;
3980
3980
  }
3981
3981
  ImageAssetWrapper.prototype.setRenderImage = function (image) {
3982
3982
  this._nativeFileAsset.setRenderImage(image.nativeImage);
@@ -3989,8 +3989,8 @@ var ImageAssetWrapper = /** @class */ (function (_super) {
3989
3989
  */
3990
3990
  var AudioAssetWrapper = /** @class */ (function (_super) {
3991
3991
  __extends(AudioAssetWrapper, _super);
3992
- function AudioAssetWrapper(nativeAsset) {
3993
- return _super.call(this, nativeAsset) || this;
3992
+ function AudioAssetWrapper() {
3993
+ return _super !== null && _super.apply(this, arguments) || this;
3994
3994
  }
3995
3995
  AudioAssetWrapper.prototype.setAudioSource = function (audio) {
3996
3996
  this._nativeFileAsset.setAudioSource(audio.nativeAudio);
@@ -5728,7 +5728,7 @@ var Rive = /** @class */ (function () {
5728
5728
  this._artboardHeight = this.artboard.height =
5729
5729
  this._artboardHeight || this.artboard.height;
5730
5730
  };
5731
- // Initializes runtime with Rive data and preps for playing.
5731
+ // Initializes runtime with Rive data and preps for playing.
5732
5732
  // Returns true for successful initialization.
5733
5733
  Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
5734
5734
  return __awaiter(this, void 0, void 0, function () {
@@ -7621,8 +7621,7 @@ var ViewModelInstanceAssetImage = /** @class */ (function (_super) {
7621
7621
  }
7622
7622
  Object.defineProperty(ViewModelInstanceAssetImage.prototype, "value", {
7623
7623
  set: function (image) {
7624
- this._viewModelInstanceValue.value =
7625
- image.nativeImage;
7624
+ this._viewModelInstanceValue.value(image.nativeImage);
7626
7625
  },
7627
7626
  enumerable: false,
7628
7627
  configurable: true