@rive-app/canvas-single 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-single",
3
- "version": "2.27.4",
3
+ "version": "2.27.5",
4
4
  "description": "Rive's high-level canvas based web api all in one js file.",
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
@@ -3358,7 +3358,7 @@ Xd();
3358
3358
  /* 2 */
3359
3359
  /***/ ((module) => {
3360
3360
 
3361
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-single","version":"2.27.4","description":"Rive\'s high-level canvas based web api all in one js file.","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.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3361
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-single","version":"2.27.5","description":"Rive\'s high-level canvas based web api all in one js file.","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.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3362
3362
 
3363
3363
  /***/ }),
3364
3364
  /* 3 */
@@ -3964,8 +3964,8 @@ var FileAssetWrapper = /** @class */ (function () {
3964
3964
  */
3965
3965
  var ImageAssetWrapper = /** @class */ (function (_super) {
3966
3966
  __extends(ImageAssetWrapper, _super);
3967
- function ImageAssetWrapper(nativeAsset) {
3968
- return _super.call(this, nativeAsset) || this;
3967
+ function ImageAssetWrapper() {
3968
+ return _super !== null && _super.apply(this, arguments) || this;
3969
3969
  }
3970
3970
  ImageAssetWrapper.prototype.setRenderImage = function (image) {
3971
3971
  this._nativeFileAsset.setRenderImage(image.nativeImage);
@@ -3978,8 +3978,8 @@ var ImageAssetWrapper = /** @class */ (function (_super) {
3978
3978
  */
3979
3979
  var AudioAssetWrapper = /** @class */ (function (_super) {
3980
3980
  __extends(AudioAssetWrapper, _super);
3981
- function AudioAssetWrapper(nativeAsset) {
3982
- return _super.call(this, nativeAsset) || this;
3981
+ function AudioAssetWrapper() {
3982
+ return _super !== null && _super.apply(this, arguments) || this;
3983
3983
  }
3984
3984
  AudioAssetWrapper.prototype.setAudioSource = function (audio) {
3985
3985
  this._nativeFileAsset.setAudioSource(audio.nativeAudio);
@@ -5717,7 +5717,7 @@ var Rive = /** @class */ (function () {
5717
5717
  this._artboardHeight = this.artboard.height =
5718
5718
  this._artboardHeight || this.artboard.height;
5719
5719
  };
5720
- // Initializes runtime with Rive data and preps for playing.
5720
+ // Initializes runtime with Rive data and preps for playing.
5721
5721
  // Returns true for successful initialization.
5722
5722
  Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
5723
5723
  return __awaiter(this, void 0, void 0, function () {
@@ -7610,8 +7610,7 @@ var ViewModelInstanceAssetImage = /** @class */ (function (_super) {
7610
7610
  }
7611
7611
  Object.defineProperty(ViewModelInstanceAssetImage.prototype, "value", {
7612
7612
  set: function (image) {
7613
- this._viewModelInstanceValue.value =
7614
- image.nativeImage;
7613
+ this._viewModelInstanceValue.value(image.nativeImage);
7615
7614
  },
7616
7615
  enumerable: false,
7617
7616
  configurable: true