@rive-app/webgl-single 2.3.0 → 2.4.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.
@@ -508,6 +508,56 @@ export declare class TextValueRun {
508
508
  set text(val: string);
509
509
  }
510
510
 
511
+ /**
512
+ * Rive Event interface for "General" custom events defined in the Rive editor. Each event has a
513
+ * name and optionally some other custom properties and a type
514
+ */
515
+ export interface RiveEvent {
516
+ /**
517
+ * Name of the event fired
518
+ */
519
+ name: string;
520
+ /**
521
+ * Optional type of the specific kind of event fired (i.e. General, OpenUrl)
522
+ */
523
+ type?: number;
524
+ /**
525
+ * Optional custom properties defined on the event
526
+ */
527
+ properties?: RiveEventCustomProperties;
528
+ /**
529
+ * Optional elapsed time since the event specifically occurred
530
+ */
531
+ delay?: number;
532
+ }
533
+
534
+ /**
535
+ * A specific Rive Event type for "OpenUrl" events. This event type has a URL and optionally a
536
+ * target property to dictate how to open the URL
537
+ */
538
+ export interface OpenUrlEvent extends RiveEvent {
539
+ /**
540
+ * URL to open when the event is invoked
541
+ */
542
+ url: string;
543
+ /**
544
+ * Where to display the linked URL
545
+ */
546
+ target?: string;
547
+ }
548
+
549
+ /**
550
+ * A Rive Event may have any number of optional custom properties defined on itself with variable names
551
+ * and values that are either a number, boolean, or string
552
+ */
553
+ export interface RiveEventCustomProperties {
554
+ /**
555
+ * Custom property may be named anything in the Rive editor, and given a value of
556
+ * a number, boolean, or string type
557
+ */
558
+ [key: string]: number | boolean | string;
559
+ }
560
+
511
561
  export declare class LinearAnimation {
512
562
  /**
513
563
  * The animation's loop type
@@ -575,6 +625,21 @@ export declare class StateMachineInstance {
575
625
  */
576
626
  stateChangedNameByIndex(i: number): string;
577
627
 
628
+ /**
629
+ * Returns the number of events reported from the last advance call
630
+ * @returns Number of events reported
631
+ */
632
+ reportedEventCount(): number;
633
+
634
+ /**
635
+ * Returns a RiveEvent object emitted from the last advance call at the given index
636
+ * of a list of potentially multiple events. If an event at the index is not found,
637
+ * undefined is returned.
638
+ * @param i index of the event reported in a list of potentially multiple events
639
+ * @returns RiveEvent or extended RiveEvent object returned, or undefined
640
+ */
641
+ reportedEventAt(i: number): OpenUrlEvent | RiveEvent | undefined;
642
+
578
643
  /**
579
644
  * Notifies the state machine that the pointer has pressed down at the given coordinate in
580
645
  * Artboard space. Internally, Rive may advance a state machine if the listener coordinate is of