@tixyel/streamelements 6.2.2 → 6.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.
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import { ComfyJSInstance, OnErrorHandler, OnCommandHandler, OnChatHandler, OnWhisperHandler, OnMessageDeletedHandler, OnJoinHandler, OnPartHandler, OnHostedHandler, OnRaidHandler, OnSubHandler, OnResubHandler, OnSubGiftHandler, OnSubMysteryGiftHandler, OnGiftSubContinueHandler, OnCheerHandler, OnChatModeHandler, OnRewardHandler, OnConnectedHandler, OnReconnectHandler } from 'comfy.js';
8
+ export { ComfyJSInstance } from 'comfy.js';
8
9
 
9
10
  declare namespace YoutubeEvents {
10
11
  namespace Message {
@@ -1666,6 +1667,42 @@ declare class Button {
1666
1667
  static execute(field: string, value: string | boolean | number): boolean;
1667
1668
  }
1668
1669
 
1670
+ interface Theme {
1671
+ color?: string;
1672
+ background?: string;
1673
+ bold?: boolean;
1674
+ italic?: boolean;
1675
+ fontSize?: number;
1676
+ icon?: string;
1677
+ }
1678
+ interface Options {
1679
+ enabled?: boolean;
1680
+ prefix?: string | (() => string);
1681
+ }
1682
+ type LogMethod = (...args: unknown[]) => void;
1683
+ declare class useLogger {
1684
+ enabled: boolean;
1685
+ prefix: string | (() => string);
1686
+ constructor(options?: Options);
1687
+ apply(theme: Theme): LogMethod;
1688
+ private style;
1689
+ group(label: string): void;
1690
+ groupCollapsed(label: string): void;
1691
+ groupEnd(): void;
1692
+ table(data: unknown): void;
1693
+ time(label: string): void;
1694
+ timeEnd(label: string): void;
1695
+ readonly error: LogMethod;
1696
+ readonly warn: LogMethod;
1697
+ readonly success: LogMethod;
1698
+ readonly info: LogMethod;
1699
+ readonly debug: LogMethod;
1700
+ readonly alert: LogMethod;
1701
+ readonly status: LogMethod;
1702
+ readonly received: LogMethod;
1703
+ readonly simple: LogMethod;
1704
+ }
1705
+
1669
1706
  /**
1670
1707
  * EventProvider class for managing event listeners and emitters.
1671
1708
  * This class allows you to register event listeners, emit events, and manage event subscriptions.
@@ -2019,6 +2056,62 @@ declare class useQueue<T> extends EventProvider<QueueEvents<T>> {
2019
2056
  on<K extends keyof QueueEvents<T>>(eventName: K, callback: (this: useQueue<T>, ...args: QueueEvents<T>[K]) => void): this;
2020
2057
  }
2021
2058
 
2059
+ type ComfyEvents = {
2060
+ load: [instance: ComfyJSInstance];
2061
+ error: Parameters<OnErrorHandler>;
2062
+ command: Parameters<OnCommandHandler>;
2063
+ chat: Parameters<OnChatHandler>;
2064
+ whisper: Parameters<OnWhisperHandler>;
2065
+ messageDeleted: Parameters<OnMessageDeletedHandler>;
2066
+ join: Parameters<OnJoinHandler>;
2067
+ part: Parameters<OnPartHandler>;
2068
+ hosted: Parameters<OnHostedHandler>;
2069
+ raid: Parameters<OnRaidHandler>;
2070
+ sub: Parameters<OnSubHandler>;
2071
+ resub: Parameters<OnResubHandler>;
2072
+ subGift: Parameters<OnSubGiftHandler>;
2073
+ subMysteryGift: Parameters<OnSubMysteryGiftHandler>;
2074
+ giftSubContinue: Parameters<OnGiftSubContinueHandler>;
2075
+ cheer: Parameters<OnCheerHandler>;
2076
+ chatMode: Parameters<OnChatModeHandler>;
2077
+ reward: Parameters<OnRewardHandler>;
2078
+ connected: Parameters<OnConnectedHandler>;
2079
+ reconnect: Parameters<OnReconnectHandler>;
2080
+ };
2081
+ /**
2082
+ * Creates and manages a ComfyJS instance for Twitch chat interaction.
2083
+ */
2084
+ declare class useComfyJs extends EventProvider<ComfyEvents> {
2085
+ instance: ComfyJSInstance;
2086
+ username: string;
2087
+ password?: string;
2088
+ channels: string[];
2089
+ isDebug: boolean;
2090
+ private init;
2091
+ emulate: boolean;
2092
+ /**
2093
+ * Initializes a new ComfyJS instance and connects to Twitch chat.
2094
+ * @param options - Configuration options for ComfyJS instance.
2095
+ * @param emulate - Whether to emulate chat messages in the Local module.
2096
+ */
2097
+ constructor(options: {
2098
+ username: string;
2099
+ password?: string;
2100
+ channels: string[];
2101
+ isDebug?: boolean;
2102
+ init?: boolean;
2103
+ }, emulate: boolean);
2104
+ /**
2105
+ * Loads the ComfyJS script if not already loaded.
2106
+ * @returns A promise that resolves to the ComfyJS instance.
2107
+ */
2108
+ private load;
2109
+ /**
2110
+ * Connects event handlers to the ComfyJS instance.
2111
+ */
2112
+ private connect;
2113
+ }
2114
+
2022
2115
  declare namespace Helper {
2023
2116
  namespace number {
2024
2117
  /**
@@ -2616,7 +2709,7 @@ declare namespace Helper {
2616
2709
  }
2617
2710
 
2618
2711
  declare namespace Local {
2619
- type Queue = useQueue<{
2712
+ type QueueItem = {
2620
2713
  listener: 'onEventReceived';
2621
2714
  data: StreamElements.Event.onEventReceived;
2622
2715
  session?: boolean;
@@ -2626,9 +2719,9 @@ declare namespace Local {
2626
2719
  } | {
2627
2720
  listener: 'onSessionUpdate';
2628
2721
  data: StreamElements.Event.onSessionUpdate;
2629
- }>;
2630
- export var queue: Queue | undefined;
2631
- export const generate: {
2722
+ };
2723
+ const queue: useQueue<QueueItem>;
2724
+ const generate: {
2632
2725
  session: {
2633
2726
  types: Record<string, StreamElements.Session.Config.Any>;
2634
2727
  available(): StreamElements.Session.Config.Available.Data;
@@ -2667,7 +2760,7 @@ declare namespace Local {
2667
2760
  onEventReceived(provider?: Provider$1 | "random", type?: StreamElements.Event.onEventReceived["listener"] | "random" | "tip" | "cheer" | "follower" | "raid" | "subscriber", options?: Record<string, string | number | boolean>): Promise<StreamElements.Event.onEventReceived | null>;
2668
2761
  };
2669
2762
  };
2670
- export const emulate: {
2763
+ const emulate: {
2671
2764
  twitch: {
2672
2765
  message(data?: Partial<{
2673
2766
  name: string;
@@ -2752,100 +2845,7 @@ declare namespace Local {
2752
2845
  facebook: {};
2753
2846
  send<T extends "onEventReceived" | "onSessionUpdate" | "onWidgetLoad">(listener: T, event: T extends "onEventReceived" ? StreamElements.Event.onEventReceived : T extends "onSessionUpdate" ? StreamElements.Event.onSessionUpdate : StreamElements.Event.onWidgetLoad): void;
2754
2847
  };
2755
- export function start(fieldsFile?: string[], dataFiles?: string[], session?: StreamElements.Session.Data): Promise<void>;
2756
- export {};
2757
- }
2758
-
2759
- type ComfyEvents = {
2760
- load: [instance: ComfyJSInstance];
2761
- error: Parameters<OnErrorHandler>;
2762
- command: Parameters<OnCommandHandler>;
2763
- chat: Parameters<OnChatHandler>;
2764
- whisper: Parameters<OnWhisperHandler>;
2765
- messageDeleted: Parameters<OnMessageDeletedHandler>;
2766
- join: Parameters<OnJoinHandler>;
2767
- part: Parameters<OnPartHandler>;
2768
- hosted: Parameters<OnHostedHandler>;
2769
- raid: Parameters<OnRaidHandler>;
2770
- sub: Parameters<OnSubHandler>;
2771
- resub: Parameters<OnResubHandler>;
2772
- subGift: Parameters<OnSubGiftHandler>;
2773
- subMysteryGift: Parameters<OnSubMysteryGiftHandler>;
2774
- giftSubContinue: Parameters<OnGiftSubContinueHandler>;
2775
- cheer: Parameters<OnCheerHandler>;
2776
- chatMode: Parameters<OnChatModeHandler>;
2777
- reward: Parameters<OnRewardHandler>;
2778
- connected: Parameters<OnConnectedHandler>;
2779
- reconnect: Parameters<OnReconnectHandler>;
2780
- };
2781
- /**
2782
- * Creates and manages a ComfyJS instance for Twitch chat interaction.
2783
- */
2784
- declare class useComfyJs extends EventProvider<ComfyEvents> {
2785
- instance: ComfyJSInstance;
2786
- username: string;
2787
- password?: string;
2788
- channels: string[];
2789
- isDebug: boolean;
2790
- private init;
2791
- emulate: boolean;
2792
- /**
2793
- * Initializes a new ComfyJS instance and connects to Twitch chat.
2794
- * @param options - Configuration options for ComfyJS instance.
2795
- * @param emulate - Whether to emulate chat messages in the Local module.
2796
- */
2797
- constructor(options: {
2798
- username: string;
2799
- password?: string;
2800
- channels: string[];
2801
- isDebug?: boolean;
2802
- init?: boolean;
2803
- }, emulate: boolean);
2804
- /**
2805
- * Loads the ComfyJS script if not already loaded.
2806
- * @returns A promise that resolves to the ComfyJS instance.
2807
- */
2808
- private load;
2809
- /**
2810
- * Connects event handlers to the ComfyJS instance.
2811
- */
2812
- private connect;
2813
- }
2814
-
2815
- interface Theme {
2816
- color?: string;
2817
- background?: string;
2818
- bold?: boolean;
2819
- italic?: boolean;
2820
- fontSize?: number;
2821
- icon?: string;
2822
- }
2823
- interface Options {
2824
- enabled?: boolean;
2825
- prefix?: string | (() => string);
2826
- }
2827
- type LogMethod = (...args: unknown[]) => void;
2828
- declare class useLogger {
2829
- enabled: boolean;
2830
- prefix: string | (() => string);
2831
- constructor(options?: Options);
2832
- apply(theme: Theme): LogMethod;
2833
- private style;
2834
- group(label: string): void;
2835
- groupCollapsed(label: string): void;
2836
- groupEnd(): void;
2837
- table(data: unknown): void;
2838
- time(label: string): void;
2839
- timeEnd(label: string): void;
2840
- readonly error: LogMethod;
2841
- readonly warn: LogMethod;
2842
- readonly success: LogMethod;
2843
- readonly info: LogMethod;
2844
- readonly debug: LogMethod;
2845
- readonly alert: LogMethod;
2846
- readonly status: LogMethod;
2847
- readonly received: LogMethod;
2848
- readonly simple: LogMethod;
2848
+ function start(fieldsFile?: string[], dataFiles?: string[], session?: StreamElements.Session.Data): Promise<void>;
2849
2849
  }
2850
2850
 
2851
2851
  declare namespace Data {