@tixyel/streamelements 6.2.1 → 6.3.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
  /**
@@ -2756,98 +2849,6 @@ declare namespace Local {
2756
2849
  export {};
2757
2850
  }
2758
2851
 
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;
2849
- }
2850
-
2851
2852
  declare namespace Data {
2852
2853
  const avatars: string[];
2853
2854
  const badges: Record<Twitch.roles, Twitch.badge>;
@@ -2923,8 +2924,8 @@ declare class useComms<T extends MessageMap> extends EventProvider<BaseEvents<T>
2923
2924
  private SE_API;
2924
2925
  id: string;
2925
2926
  loaded: boolean;
2926
- private history;
2927
- private detected;
2927
+ history: Array<UseCommItem<T>>;
2928
+ detected: Set<string>;
2928
2929
  constructor(options?: UseCommsOptions);
2929
2930
  send<K extends keyof T>(key: K, data: T[K]): Promise<void>;
2930
2931
  update(history: Array<UseCommItem<T>>): void;
package/dist/index.es.js CHANGED
@@ -8196,11 +8196,27 @@ const ct = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(Dt())
8196
8196
  Local: q,
8197
8197
  Data: A,
8198
8198
  logger: N,
8199
- modules: { EventProvider: X, useStorage: it, useQueue: gt, useLogger: pt, useComms: St },
8200
- actions: { Button: at, Command: Z },
8201
- multistream: { useComfyJs: At },
8202
- data: { usedStorages: tt, usedComms: et },
8203
- pronouns: { Alejo: ot }
8199
+ modules: {
8200
+ EventProvider: X,
8201
+ useStorage: it,
8202
+ useQueue: gt,
8203
+ useLogger: pt,
8204
+ useComms: St
8205
+ },
8206
+ actions: {
8207
+ Button: at,
8208
+ Command: Z
8209
+ },
8210
+ multistream: {
8211
+ useComfyJs: At
8212
+ },
8213
+ data: {
8214
+ usedStorages: tt,
8215
+ usedComms: et
8216
+ },
8217
+ pronouns: {
8218
+ Alejo: ot
8219
+ }
8204
8220
  };
8205
8221
  typeof window < "u" ? window.Tixyel = mt : globalThis.Tixyel = mt;
8206
8222
  export {