@rive-app/webgl-single 2.15.6 → 2.17.0
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 +1 -1
- package/rive.d.ts +69 -1
- package/rive.js +264 -59
- package/rive.js.map +1 -1
- package/rive_advanced.mjs.d.ts +6 -0
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export declare enum EventType {
|
|
|
123
123
|
export type RiveEventPayload = rc.RiveEvent | rc.OpenUrlEvent;
|
|
124
124
|
export interface Event {
|
|
125
125
|
type: EventType;
|
|
126
|
-
data?: string | string[] | LoopEvent | number | RiveEventPayload;
|
|
126
|
+
data?: string | string[] | LoopEvent | number | RiveEventPayload | RiveFile;
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Looping types: one-shot, loop, and ping-pong
|
|
@@ -189,6 +189,7 @@ export interface RiveParameters {
|
|
|
189
189
|
canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
190
190
|
src?: string;
|
|
191
191
|
buffer?: ArrayBuffer;
|
|
192
|
+
riveFile?: RiveFile;
|
|
192
193
|
artboard?: string;
|
|
193
194
|
animations?: string | string[];
|
|
194
195
|
stateMachines?: string | string[];
|
|
@@ -265,6 +266,7 @@ export interface RiveParameters {
|
|
|
265
266
|
export interface RiveLoadParameters {
|
|
266
267
|
src?: string;
|
|
267
268
|
buffer?: ArrayBuffer;
|
|
269
|
+
riveFile?: RiveFile;
|
|
268
270
|
autoplay?: boolean;
|
|
269
271
|
artboard?: string;
|
|
270
272
|
animations?: string | string[];
|
|
@@ -278,6 +280,50 @@ export interface RiveResetParameters {
|
|
|
278
280
|
stateMachines?: string | string[];
|
|
279
281
|
autoplay?: boolean;
|
|
280
282
|
}
|
|
283
|
+
export interface RiveFileParameters {
|
|
284
|
+
src?: string;
|
|
285
|
+
buffer?: ArrayBuffer;
|
|
286
|
+
assetLoader?: AssetLoadCallback;
|
|
287
|
+
enableRiveAssetCDN?: boolean;
|
|
288
|
+
onLoad?: EventCallback;
|
|
289
|
+
onLoadError?: EventCallback;
|
|
290
|
+
}
|
|
291
|
+
export declare class RiveFile {
|
|
292
|
+
private static readonly missingErrorMessage;
|
|
293
|
+
private static readonly fileLoadErrorMessage;
|
|
294
|
+
private src;
|
|
295
|
+
private buffer;
|
|
296
|
+
private runtime;
|
|
297
|
+
private file;
|
|
298
|
+
private assetLoader;
|
|
299
|
+
private enableRiveAssetCDN;
|
|
300
|
+
private eventManager;
|
|
301
|
+
private referenceCount;
|
|
302
|
+
constructor(params: RiveFileParameters);
|
|
303
|
+
private initData;
|
|
304
|
+
init(): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* Subscribe to Rive-generated events
|
|
307
|
+
* @param type the type of event to subscribe to
|
|
308
|
+
* @param callback callback to fire when the event occurs
|
|
309
|
+
*/
|
|
310
|
+
on(type: EventType, callback: EventCallback): void;
|
|
311
|
+
/**
|
|
312
|
+
* Unsubscribes from a Rive-generated event
|
|
313
|
+
* @param type the type of event to unsubscribe from
|
|
314
|
+
* @param callback the callback to unsubscribe
|
|
315
|
+
*/
|
|
316
|
+
off(type: EventType, callback: EventCallback): void;
|
|
317
|
+
cleanup(): void;
|
|
318
|
+
/**
|
|
319
|
+
* Unsubscribes all Rive listeners from an event type, or everything if no type is
|
|
320
|
+
* given
|
|
321
|
+
* @param type the type of event to unsubscribe from, or all types if
|
|
322
|
+
* undefined
|
|
323
|
+
*/
|
|
324
|
+
removeAllRiveEventListeners(type?: EventType): void;
|
|
325
|
+
getInstance(): rc.File;
|
|
326
|
+
}
|
|
281
327
|
export declare class Rive {
|
|
282
328
|
private readonly canvas;
|
|
283
329
|
private src;
|
|
@@ -298,6 +344,7 @@ export declare class Rive {
|
|
|
298
344
|
private artboard;
|
|
299
345
|
private eventCleanup;
|
|
300
346
|
private file;
|
|
347
|
+
private riveFile;
|
|
301
348
|
private eventManager;
|
|
302
349
|
private taskQueue;
|
|
303
350
|
private animator;
|
|
@@ -448,6 +495,27 @@ export declare class Rive {
|
|
|
448
495
|
* @returns the inputs for the named state machine
|
|
449
496
|
*/
|
|
450
497
|
stateMachineInputs(name: string): StateMachineInput[];
|
|
498
|
+
private retrieveInputAtPath;
|
|
499
|
+
/**
|
|
500
|
+
* Set the boolean input with the provided name at the given path with value
|
|
501
|
+
* @param input the state machine input name
|
|
502
|
+
* @param value the value to set the input to
|
|
503
|
+
* @param path the path the input is located at an artboard level
|
|
504
|
+
*/
|
|
505
|
+
setBooleanStateAtPath(inputName: string, value: boolean, path: string): void;
|
|
506
|
+
/**
|
|
507
|
+
* Set the number input with the provided name at the given path with value
|
|
508
|
+
* @param input the state machine input name
|
|
509
|
+
* @param value the value to set the input to
|
|
510
|
+
* @param path the path the input is located at an artboard level
|
|
511
|
+
*/
|
|
512
|
+
setNumberStateAtPath(inputName: string, value: number, path: string): void;
|
|
513
|
+
/**
|
|
514
|
+
* Fire the trigger with the provided name at the given path
|
|
515
|
+
* @param input the state machine input name
|
|
516
|
+
* @param path the path the input is located at an artboard level
|
|
517
|
+
*/
|
|
518
|
+
fireStateAtPath(inputName: string, path: string): void;
|
|
451
519
|
get playingStateMachineNames(): string[];
|
|
452
520
|
get playingAnimationNames(): string[];
|
|
453
521
|
get pausedAnimationNames(): string[];
|