@rive-app/webgl-single 1.1.3 → 1.1.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 +1 -1
- package/rive.d.ts +9 -0
- package/rive.js +31 -18
- package/rive.js.map +1 -1
- package/rive_advanced.mjs.d.ts +61 -20
package/rive_advanced.mjs.d.ts
CHANGED
|
@@ -97,6 +97,13 @@ export interface RiveCanvas {
|
|
|
97
97
|
* This should be called when you wish to remove a rive animation from view.
|
|
98
98
|
*/
|
|
99
99
|
cleanup(): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Returns whether or not there are Rive Listeners configured on a given StateMachineInstance
|
|
103
|
+
* @param stateMachine - StateMachineInstance to check for Listeners
|
|
104
|
+
* @returns bool - Boolean of if there are Listners on the state machine
|
|
105
|
+
*/
|
|
106
|
+
hasListeners(stateMachine: StateMachineInstance): boolean;
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
//////////////
|
|
@@ -281,34 +288,50 @@ export declare class Artboard {
|
|
|
281
288
|
*/
|
|
282
289
|
draw(renderer: CanvasRenderer): void;
|
|
283
290
|
/**
|
|
284
|
-
* Creates a
|
|
285
|
-
*
|
|
286
|
-
*
|
|
291
|
+
* Creates a LinearAnimation for the animation with the given name
|
|
292
|
+
*
|
|
293
|
+
* Note: This does not create a LinearAnimationInstance to advance in the render loop.
|
|
294
|
+
* That needs to be created separately.
|
|
295
|
+
*
|
|
296
|
+
* @param name - Name of the animation to create a LinearAnimation reference for
|
|
297
|
+
* @returns A new LinearAnimation object
|
|
287
298
|
*/
|
|
288
|
-
animationByName(name: string):
|
|
299
|
+
animationByName(name: string): LinearAnimation;
|
|
289
300
|
/**
|
|
290
|
-
* Creates a
|
|
291
|
-
*
|
|
292
|
-
*
|
|
301
|
+
* Creates a LinearAnimation for the animation with the given index
|
|
302
|
+
*
|
|
303
|
+
* Note: This does not create a LinearAnimationInstance to advance in the render loop.
|
|
304
|
+
* That needs to be created separately.
|
|
305
|
+
*
|
|
306
|
+
* @param index - Index of the animation to create a LinearAnimation reference for
|
|
307
|
+
* @returns A new LinearAnimation object
|
|
293
308
|
*/
|
|
294
|
-
animationByIndex(index: number):
|
|
309
|
+
animationByIndex(index: number): LinearAnimation;
|
|
295
310
|
/**
|
|
296
311
|
* Returns the number of animations in the artboard
|
|
297
312
|
* @returns Number of animations on the Artboard
|
|
298
313
|
*/
|
|
299
314
|
animationCount(): number;
|
|
300
315
|
/**
|
|
301
|
-
* Creates a
|
|
302
|
-
*
|
|
303
|
-
*
|
|
316
|
+
* Creates a StateMachine for the state machine with the given name.
|
|
317
|
+
*
|
|
318
|
+
* Note: This does not create a StateMachineInstance to advance in the render loop.
|
|
319
|
+
* That needs to be created separately.
|
|
320
|
+
*
|
|
321
|
+
* @param name - Name of the state machine to create a StateMachine reference for
|
|
322
|
+
* @returns A new StateMachine object
|
|
304
323
|
*/
|
|
305
|
-
stateMachineByName(name: string):
|
|
324
|
+
stateMachineByName(name: string): StateMachine;
|
|
306
325
|
/**
|
|
307
|
-
* Creates a
|
|
308
|
-
*
|
|
309
|
-
*
|
|
326
|
+
* Creates a StateMachine for the state machine with the given index
|
|
327
|
+
*
|
|
328
|
+
* Note: This does not create a StateMachineInstance to advance in the render loop.
|
|
329
|
+
* That needs to be created separately.
|
|
330
|
+
*
|
|
331
|
+
* @param index - Index of the state machine to create a StateMachine reference for
|
|
332
|
+
* @returns A new StateMachine object
|
|
310
333
|
*/
|
|
311
|
-
stateMachineByIndex(index: number):
|
|
334
|
+
stateMachineByIndex(index: number): StateMachine;
|
|
312
335
|
/**
|
|
313
336
|
* Returns the number of state machines in the artboard
|
|
314
337
|
* @returns Number of state machines on the Artboard
|
|
@@ -393,11 +416,11 @@ export declare class TransformComponent {
|
|
|
393
416
|
export declare class LinearAnimationInstance {
|
|
394
417
|
/**
|
|
395
418
|
* Create a new LinearAnimationInstance reference
|
|
396
|
-
* @param animation - A
|
|
419
|
+
* @param animation - A LinearAnimation reference retrieved via the Artboard
|
|
397
420
|
* (i.e `artboard.animationByName('foo')`)
|
|
398
421
|
* @param artboard - The Artboard instance for this animation
|
|
399
422
|
*/
|
|
400
|
-
constructor(animation:
|
|
423
|
+
constructor(animation: LinearAnimation, artboard: Artboard);
|
|
401
424
|
get name(): string;
|
|
402
425
|
get duration(): number;
|
|
403
426
|
get fps(): number;
|
|
@@ -438,6 +461,24 @@ export declare class LinearAnimationInstance {
|
|
|
438
461
|
delete(): void;
|
|
439
462
|
}
|
|
440
463
|
|
|
464
|
+
export declare class LinearAnimation {
|
|
465
|
+
/**
|
|
466
|
+
* The animation's loop type
|
|
467
|
+
*/
|
|
468
|
+
get loopValue(): number;
|
|
469
|
+
/**
|
|
470
|
+
* Name of the LinearAnimation
|
|
471
|
+
*/
|
|
472
|
+
get name(): string;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export declare class StateMachine {
|
|
476
|
+
/**
|
|
477
|
+
* Name of the StateMachine
|
|
478
|
+
*/
|
|
479
|
+
get name(): string;
|
|
480
|
+
}
|
|
481
|
+
|
|
441
482
|
/**
|
|
442
483
|
* Rive class representing a StateMachine instance. Use this class to advance and control a
|
|
443
484
|
* particular state machine in the render loop (i.e scrub, grab state machine inputs, set up
|
|
@@ -451,11 +492,11 @@ export declare class LinearAnimationInstance {
|
|
|
451
492
|
export declare class StateMachineInstance {
|
|
452
493
|
/**
|
|
453
494
|
* Create a new StateMachineInstance reference
|
|
454
|
-
* @param stateMachine - A
|
|
495
|
+
* @param stateMachine - A StateMachine retrieved via the Artboard
|
|
455
496
|
* (i.e `artboard.stateMachineByName('foo')`)
|
|
456
497
|
* @param artboard - The Artboard instance for this state machine
|
|
457
498
|
*/
|
|
458
|
-
constructor(stateMachine:
|
|
499
|
+
constructor(stateMachine: StateMachine, artboard: Artboard);
|
|
459
500
|
get name(): string;
|
|
460
501
|
/**
|
|
461
502
|
* Returns the number of inputs associated with this state machine
|