crisp-api 10.10.4 → 10.10.6

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/lib/crisp.ts CHANGED
@@ -25,6 +25,9 @@ import Plugin, { PluginServiceInterface } from "@/services/plugin";
25
25
  import Plan, { PlanServiceInterface } from "@/services/plan";
26
26
  import Website, { WebsiteServiceInterface } from "@/services/website";
27
27
 
28
+ // PROJECT: EVENTS
29
+ import { EventsMap, EventName } from "@/events/Events";
30
+
28
31
  /**************************************************************************
29
32
  * TYPES
30
33
  ***************************************************************************/
@@ -424,6 +427,22 @@ class Crisp {
424
427
 
425
428
  /* eslint-enable @typescript-eslint/no-explicit-any */
426
429
 
430
+ /**
431
+ * Binds RTM event (typed variant)
432
+ */
433
+ on<Name extends EventName>(
434
+ // eslint-disable-next-line no-unused-vars
435
+ event: Name, callback: (data: EventsMap[Name]) => unknown
436
+ ): Promise<unknown>;
437
+
438
+ /**
439
+ * Binds RTM event (loose variant)
440
+ */
441
+ on(
442
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-unused-vars
443
+ event: string, callback: (data: any) => unknown
444
+ ): Promise<unknown>;
445
+
427
446
  /**
428
447
  * Binds RTM event
429
448
  */
@@ -1046,5 +1065,6 @@ class Crisp {
1046
1065
  ***************************************************************************/
1047
1066
 
1048
1067
  export * from "@/resources";
1068
+ export * from "@/events/Events";
1049
1069
  export { Crisp };
1050
1070
  export default Crisp;