@rive-app/webgl-single 2.6.1 → 2.7.1

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.
@@ -29,8 +29,8 @@ export interface RiveCanvas {
29
29
  RenderPaintStyle: typeof RenderPaintStyle;
30
30
  StrokeCap: typeof StrokeCap;
31
31
  StrokeJoin: typeof StrokeJoin;
32
- decodeImage: Function;
33
- decodeFont: Function;
32
+ decodeImage: DecodeFont;
33
+ decodeFont: DecodeFont;
34
34
 
35
35
  /**
36
36
  * Loads a Rive file for the runtime and returns a Rive-specific File class
@@ -260,6 +260,25 @@ export interface CanvasRenderFactory {
260
260
  makeRenderPath(): CanvasRenderPath;
261
261
  }
262
262
 
263
+ export class Image {
264
+ unref(): void;
265
+ }
266
+ export interface ImageCallback {
267
+ (image: Image): void;
268
+ }
269
+ export interface DecodeImage {
270
+ (bytes: Uint8Array, callback: ImageCallback): void;
271
+ }
272
+ export class Font {
273
+ unref(): void;
274
+ }
275
+ export interface FontCallback {
276
+ (font: Font): void;
277
+ }
278
+ export interface DecodeFont {
279
+ (bytes: Uint8Array, callback: FontCallback): void;
280
+ }
281
+
263
282
  //////////
264
283
  // File //
265
284
  //////////
@@ -856,18 +875,37 @@ export declare class Vec2D {
856
875
  delete(): void;
857
876
  }
858
877
 
878
+ /**
879
+ * Rive class representing a FileAsset with relevant metadata fields to describe
880
+ * an asset associated wtih the Rive File
881
+ */
859
882
  export declare class FileAsset {
860
883
  name: string;
861
884
  fileExtension: string;
862
885
  isImage: boolean;
863
886
  isFont: boolean;
864
- cdnUuid: boolean;
887
+ cdnUuid: string;
888
+ }
889
+
890
+ /**
891
+ * Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
892
+ * decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset
893
+ */
894
+ export declare class ImageAsset extends FileAsset {
895
+ setRenderImage(image: Image): void;
865
896
  }
866
897
 
867
- export declare class FileAssetLoader {
898
+ /**
899
+ * Rive class extending the FileAsset that exposes a `setFont()` API with a
900
+ * decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset
901
+ */
902
+ export declare class FontAsset extends FileAsset {
903
+ setFont(font: Font): void;
868
904
  }
869
905
 
906
+ export declare class FileAssetLoader {}
907
+
870
908
  export declare class CustomFileAssetLoader extends FileAssetLoader {
871
- constructor({loadContents}: {loadContents:Function});
872
- loadContents(asset: FileAsset, bytes:any): boolean;
909
+ constructor({ loadContents }: { loadContents: Function });
910
+ loadContents(asset: FileAsset, bytes: any): boolean;
873
911
  }