@rive-app/canvas-lite
Advanced tools
Comparing version 2.15.6 to 2.16.0
{ | ||
"name": "@rive-app/canvas-lite", | ||
"version": "2.15.6", | ||
"version": "2.16.0", | ||
"description": "A lite version of Rive's canvas based web api.", | ||
@@ -5,0 +5,0 @@ "main": "rive.js", |
@@ -126,3 +126,3 @@ import * as rc from "./rive_advanced.mjs"; | ||
type: EventType; | ||
data?: string | string[] | LoopEvent | number | RiveEventPayload; | ||
data?: string | string[] | LoopEvent | number | RiveEventPayload | RiveFile; | ||
} | ||
@@ -193,2 +193,3 @@ /** | ||
buffer?: ArrayBuffer; | ||
riveFile?: RiveFile; | ||
artboard?: string; | ||
@@ -270,2 +271,3 @@ animations?: string | string[]; | ||
buffer?: ArrayBuffer; | ||
riveFile?: RiveFile; | ||
autoplay?: boolean; | ||
@@ -284,2 +286,46 @@ artboard?: string; | ||
} | ||
export interface RiveFileParameters { | ||
src?: string; | ||
buffer?: ArrayBuffer; | ||
assetLoader?: AssetLoadCallback; | ||
enableRiveAssetCDN?: boolean; | ||
onLoad?: EventCallback; | ||
onLoadError?: EventCallback; | ||
} | ||
export declare class RiveFile { | ||
private static readonly missingErrorMessage; | ||
private static readonly fileLoadErrorMessage; | ||
private src; | ||
private buffer; | ||
private runtime; | ||
private file; | ||
private assetLoader; | ||
private enableRiveAssetCDN; | ||
private eventManager; | ||
private referenceCount; | ||
constructor(params: RiveFileParameters); | ||
private initData; | ||
init(): Promise<void>; | ||
/** | ||
* Subscribe to Rive-generated events | ||
* @param type the type of event to subscribe to | ||
* @param callback callback to fire when the event occurs | ||
*/ | ||
on(type: EventType, callback: EventCallback): void; | ||
/** | ||
* Unsubscribes from a Rive-generated event | ||
* @param type the type of event to unsubscribe from | ||
* @param callback the callback to unsubscribe | ||
*/ | ||
off(type: EventType, callback: EventCallback): void; | ||
cleanup(): void; | ||
/** | ||
* Unsubscribes all Rive listeners from an event type, or everything if no type is | ||
* given | ||
* @param type the type of event to unsubscribe from, or all types if | ||
* undefined | ||
*/ | ||
removeAllRiveEventListeners(type?: EventType): void; | ||
getInstance(): rc.File; | ||
} | ||
export declare class Rive { | ||
@@ -305,2 +351,3 @@ private readonly canvas; | ||
private file; | ||
private riveFile; | ||
private eventManager; | ||
@@ -307,0 +354,0 @@ private taskQueue; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1249966
6503