@tixyel/streamelements 3.10.0 → 4.0.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 +66 -0
- package/dist/index.es.js +939 -756
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ComfyJSInstance, OnErrorHandler, OnCommandHandler, OnChatHandler, OnWhisperHandler, OnMessageDeletedHandler, OnJoinHandler, OnPartHandler, OnHostedHandler, OnRaidHandler, OnSubHandler, OnResubHandler, OnSubGiftHandler, OnSubMysteryGiftHandler, OnGiftSubContinueHandler, OnCheerHandler, OnChatModeHandler, OnRewardHandler, OnConnectedHandler, OnReconnectHandler } from 'comfy.js';
|
|
2
|
+
|
|
1
3
|
type TwitchEmote = {
|
|
2
4
|
type: 'twitch';
|
|
3
5
|
name: string;
|
|
@@ -1959,7 +1961,12 @@ declare namespace Simulation {
|
|
|
1959
1961
|
badges: BadgeOptions;
|
|
1960
1962
|
color: string;
|
|
1961
1963
|
userId: string;
|
|
1964
|
+
msgId: string;
|
|
1965
|
+
channel: string;
|
|
1966
|
+
time: number;
|
|
1962
1967
|
}>): void;
|
|
1968
|
+
deleteMessage(msgId: string): void;
|
|
1969
|
+
deleteMessages(userId: string): void;
|
|
1963
1970
|
follower(data?: Partial<{
|
|
1964
1971
|
avatar: string;
|
|
1965
1972
|
name: string;
|
|
@@ -2001,6 +2008,9 @@ declare namespace Simulation {
|
|
|
2001
2008
|
badges: BadgeOptions;
|
|
2002
2009
|
color: string;
|
|
2003
2010
|
userId: string;
|
|
2011
|
+
msgId: string;
|
|
2012
|
+
channel: string;
|
|
2013
|
+
time: number;
|
|
2004
2014
|
avatar: string;
|
|
2005
2015
|
}>): void;
|
|
2006
2016
|
subscriber(data?: Partial<{
|
|
@@ -2094,6 +2104,60 @@ declare class useStorage<T extends Record<string, any>> extends EventProvider<Us
|
|
|
2094
2104
|
on<K extends keyof UseStorageEvents<T>>(eventName: K, callback: (this: useStorage<T>, ...args: UseStorageEvents<T>[K]) => void): this;
|
|
2095
2105
|
}
|
|
2096
2106
|
|
|
2107
|
+
type ComfyEvents = {
|
|
2108
|
+
load: [instance: ComfyJSInstance];
|
|
2109
|
+
error: Parameters<OnErrorHandler>;
|
|
2110
|
+
command: Parameters<OnCommandHandler>;
|
|
2111
|
+
chat: Parameters<OnChatHandler>;
|
|
2112
|
+
whisper: Parameters<OnWhisperHandler>;
|
|
2113
|
+
messageDeleted: Parameters<OnMessageDeletedHandler>;
|
|
2114
|
+
join: Parameters<OnJoinHandler>;
|
|
2115
|
+
part: Parameters<OnPartHandler>;
|
|
2116
|
+
hosted: Parameters<OnHostedHandler>;
|
|
2117
|
+
raid: Parameters<OnRaidHandler>;
|
|
2118
|
+
sub: Parameters<OnSubHandler>;
|
|
2119
|
+
resub: Parameters<OnResubHandler>;
|
|
2120
|
+
subGift: Parameters<OnSubGiftHandler>;
|
|
2121
|
+
subMysteryGift: Parameters<OnSubMysteryGiftHandler>;
|
|
2122
|
+
giftSubContinue: Parameters<OnGiftSubContinueHandler>;
|
|
2123
|
+
cheer: Parameters<OnCheerHandler>;
|
|
2124
|
+
chatMode: Parameters<OnChatModeHandler>;
|
|
2125
|
+
reward: Parameters<OnRewardHandler>;
|
|
2126
|
+
connected: Parameters<OnConnectedHandler>;
|
|
2127
|
+
reconnect: Parameters<OnReconnectHandler>;
|
|
2128
|
+
};
|
|
2129
|
+
/**
|
|
2130
|
+
* Creates and manages a ComfyJS instance for Twitch chat interaction.
|
|
2131
|
+
*/
|
|
2132
|
+
declare class useComfyJs extends EventProvider<ComfyEvents> {
|
|
2133
|
+
instance: ComfyJSInstance;
|
|
2134
|
+
username: string;
|
|
2135
|
+
password?: string;
|
|
2136
|
+
channels: string[];
|
|
2137
|
+
isDebug: boolean;
|
|
2138
|
+
emulate: boolean;
|
|
2139
|
+
/**
|
|
2140
|
+
* Initializes a new ComfyJS instance and connects to Twitch chat.
|
|
2141
|
+
* @param options - Configuration options for ComfyJS instance.
|
|
2142
|
+
* @param emulate - Whether to emulate chat messages in the Simulation module.
|
|
2143
|
+
*/
|
|
2144
|
+
constructor(options: {
|
|
2145
|
+
username: string;
|
|
2146
|
+
password?: string;
|
|
2147
|
+
channels: string[];
|
|
2148
|
+
isDebug?: boolean;
|
|
2149
|
+
}, emulate: boolean);
|
|
2150
|
+
/**
|
|
2151
|
+
* Loads the ComfyJS script if not already loaded.
|
|
2152
|
+
* @returns A promise that resolves to the ComfyJS instance.
|
|
2153
|
+
*/
|
|
2154
|
+
private load;
|
|
2155
|
+
/**
|
|
2156
|
+
* Connects event handlers to the ComfyJS instance.
|
|
2157
|
+
*/
|
|
2158
|
+
private connect;
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2097
2161
|
interface ButtonOptions {
|
|
2098
2162
|
field: string | ((field: string, value: string | boolean | number) => boolean);
|
|
2099
2163
|
template?: string;
|
|
@@ -2302,6 +2366,7 @@ declare const Tixyel: {
|
|
|
2302
2366
|
readonly Button: typeof Button;
|
|
2303
2367
|
readonly Command: typeof Command;
|
|
2304
2368
|
readonly EventProvider: typeof EventProvider;
|
|
2369
|
+
readonly useComfyJs: typeof useComfyJs;
|
|
2305
2370
|
readonly useStorage: typeof useStorage;
|
|
2306
2371
|
readonly useQueue: typeof useQueue;
|
|
2307
2372
|
readonly Logger: typeof Logger;
|
|
@@ -2315,6 +2380,7 @@ declare global {
|
|
|
2315
2380
|
interface Window {
|
|
2316
2381
|
Tixyel: Main;
|
|
2317
2382
|
client: Client;
|
|
2383
|
+
ComfyJS?: ComfyJSInstance;
|
|
2318
2384
|
}
|
|
2319
2385
|
interface WindowEventMap {
|
|
2320
2386
|
onWidgetLoad: CustomEvent<StreamElements.Event.onWidgetLoad>;
|