@tixyel/streamelements 7.8.0 → 7.9.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 -62
- package/dist/index.es.js +3 -3
- 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 +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2006,6 +2006,62 @@ declare class useLogger {
|
|
|
2006
2006
|
readonly simple: LogMethod;
|
|
2007
2007
|
}
|
|
2008
2008
|
|
|
2009
|
+
type ComfyEvents = {
|
|
2010
|
+
load: [instance: ComfyJSInstance];
|
|
2011
|
+
error: Parameters<OnErrorHandler>;
|
|
2012
|
+
command: Parameters<OnCommandHandler>;
|
|
2013
|
+
chat: Parameters<OnChatHandler>;
|
|
2014
|
+
whisper: Parameters<OnWhisperHandler>;
|
|
2015
|
+
messageDeleted: Parameters<OnMessageDeletedHandler>;
|
|
2016
|
+
join: Parameters<OnJoinHandler>;
|
|
2017
|
+
part: Parameters<OnPartHandler>;
|
|
2018
|
+
hosted: Parameters<OnHostedHandler>;
|
|
2019
|
+
raid: Parameters<OnRaidHandler>;
|
|
2020
|
+
sub: Parameters<OnSubHandler>;
|
|
2021
|
+
resub: Parameters<OnResubHandler>;
|
|
2022
|
+
subGift: Parameters<OnSubGiftHandler>;
|
|
2023
|
+
subMysteryGift: Parameters<OnSubMysteryGiftHandler>;
|
|
2024
|
+
giftSubContinue: Parameters<OnGiftSubContinueHandler>;
|
|
2025
|
+
cheer: Parameters<OnCheerHandler>;
|
|
2026
|
+
chatMode: Parameters<OnChatModeHandler>;
|
|
2027
|
+
reward: Parameters<OnRewardHandler>;
|
|
2028
|
+
connected: Parameters<OnConnectedHandler>;
|
|
2029
|
+
reconnect: Parameters<OnReconnectHandler>;
|
|
2030
|
+
};
|
|
2031
|
+
/**
|
|
2032
|
+
* Creates and manages a ComfyJS instance for Twitch chat interaction.
|
|
2033
|
+
*/
|
|
2034
|
+
declare class useComfyJs extends EventProvider<ComfyEvents> {
|
|
2035
|
+
instance: ComfyJSInstance;
|
|
2036
|
+
username: string;
|
|
2037
|
+
password?: string;
|
|
2038
|
+
channels: string[];
|
|
2039
|
+
isDebug: boolean;
|
|
2040
|
+
private init;
|
|
2041
|
+
emulate: boolean;
|
|
2042
|
+
/**
|
|
2043
|
+
* Initializes a new ComfyJS instance and connects to Twitch chat.
|
|
2044
|
+
* @param options - Configuration options for ComfyJS instance.
|
|
2045
|
+
* @param emulate - Whether to emulate chat messages in the Local module.
|
|
2046
|
+
*/
|
|
2047
|
+
constructor(options: {
|
|
2048
|
+
username: string;
|
|
2049
|
+
password?: string;
|
|
2050
|
+
channels: string[];
|
|
2051
|
+
isDebug?: boolean;
|
|
2052
|
+
init?: boolean;
|
|
2053
|
+
}, emulate: boolean);
|
|
2054
|
+
/**
|
|
2055
|
+
* Loads the ComfyJS script if not already loaded.
|
|
2056
|
+
* @returns A promise that resolves to the ComfyJS instance.
|
|
2057
|
+
*/
|
|
2058
|
+
private load;
|
|
2059
|
+
/**
|
|
2060
|
+
* Connects event handlers to the ComfyJS instance.
|
|
2061
|
+
*/
|
|
2062
|
+
private connect;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2009
2065
|
type QueueEvents<T> = {
|
|
2010
2066
|
load: [];
|
|
2011
2067
|
cancel: [];
|
|
@@ -2026,7 +2082,7 @@ type QueueProps = {
|
|
|
2026
2082
|
type QueueItem<T> = {
|
|
2027
2083
|
value: T;
|
|
2028
2084
|
} & QueueProps;
|
|
2029
|
-
type QueueProcessor<T> = (this: useQueue<T>, item: T
|
|
2085
|
+
type QueueProcessor<T> = (this: useQueue<T>, item: QueueItem<T>, queue: useQueue<T>) => Promise<any> | any;
|
|
2030
2086
|
type QueueDuration = number | boolean | undefined;
|
|
2031
2087
|
interface QueueOptions<T> {
|
|
2032
2088
|
/**
|
|
@@ -2060,10 +2116,10 @@ declare class useQueue<T> extends EventProvider<QueueEvents<T>> {
|
|
|
2060
2116
|
priorityQueue: QueueItem<T>[];
|
|
2061
2117
|
history: QueueItem<T>[];
|
|
2062
2118
|
private timeouts;
|
|
2063
|
-
running: boolean;
|
|
2064
2119
|
duration: QueueDuration;
|
|
2065
|
-
private loaded;
|
|
2066
2120
|
processor: QueueProcessor<T>;
|
|
2121
|
+
running: boolean;
|
|
2122
|
+
private loaded;
|
|
2067
2123
|
private readonly clientWaitRetryDelay;
|
|
2068
2124
|
constructor(options: QueueOptions<T>);
|
|
2069
2125
|
private waitForClientAndBindLoad;
|
|
@@ -2111,7 +2167,11 @@ declare class useQueue<T> extends EventProvider<QueueEvents<T>> {
|
|
|
2111
2167
|
* });
|
|
2112
2168
|
* ```
|
|
2113
2169
|
*/
|
|
2114
|
-
update(save: Partial<
|
|
2170
|
+
update(save: Partial<{
|
|
2171
|
+
queue?: QueueItem<T>[];
|
|
2172
|
+
priorityQueue?: QueueItem<T>[];
|
|
2173
|
+
history?: QueueItem<T>[];
|
|
2174
|
+
}>): this;
|
|
2115
2175
|
/**
|
|
2116
2176
|
* Cancel all pending timeouts and stop the queue from processing further items. This will clear any scheduled processing and prevent any new items from being processed until `resume()` is called again. The current state of the queue, priority queue, and history will be retained, allowing you to resume processing later without losing any data.
|
|
2117
2177
|
*/
|
|
@@ -2124,62 +2184,6 @@ declare class useQueue<T> extends EventProvider<QueueEvents<T>> {
|
|
|
2124
2184
|
on<K extends keyof QueueEvents<T>>(eventName: K, callback: (this: useQueue<T>, ...args: QueueEvents<T>[K]) => void): this;
|
|
2125
2185
|
}
|
|
2126
2186
|
|
|
2127
|
-
type ComfyEvents = {
|
|
2128
|
-
load: [instance: ComfyJSInstance];
|
|
2129
|
-
error: Parameters<OnErrorHandler>;
|
|
2130
|
-
command: Parameters<OnCommandHandler>;
|
|
2131
|
-
chat: Parameters<OnChatHandler>;
|
|
2132
|
-
whisper: Parameters<OnWhisperHandler>;
|
|
2133
|
-
messageDeleted: Parameters<OnMessageDeletedHandler>;
|
|
2134
|
-
join: Parameters<OnJoinHandler>;
|
|
2135
|
-
part: Parameters<OnPartHandler>;
|
|
2136
|
-
hosted: Parameters<OnHostedHandler>;
|
|
2137
|
-
raid: Parameters<OnRaidHandler>;
|
|
2138
|
-
sub: Parameters<OnSubHandler>;
|
|
2139
|
-
resub: Parameters<OnResubHandler>;
|
|
2140
|
-
subGift: Parameters<OnSubGiftHandler>;
|
|
2141
|
-
subMysteryGift: Parameters<OnSubMysteryGiftHandler>;
|
|
2142
|
-
giftSubContinue: Parameters<OnGiftSubContinueHandler>;
|
|
2143
|
-
cheer: Parameters<OnCheerHandler>;
|
|
2144
|
-
chatMode: Parameters<OnChatModeHandler>;
|
|
2145
|
-
reward: Parameters<OnRewardHandler>;
|
|
2146
|
-
connected: Parameters<OnConnectedHandler>;
|
|
2147
|
-
reconnect: Parameters<OnReconnectHandler>;
|
|
2148
|
-
};
|
|
2149
|
-
/**
|
|
2150
|
-
* Creates and manages a ComfyJS instance for Twitch chat interaction.
|
|
2151
|
-
*/
|
|
2152
|
-
declare class useComfyJs extends EventProvider<ComfyEvents> {
|
|
2153
|
-
instance: ComfyJSInstance;
|
|
2154
|
-
username: string;
|
|
2155
|
-
password?: string;
|
|
2156
|
-
channels: string[];
|
|
2157
|
-
isDebug: boolean;
|
|
2158
|
-
private init;
|
|
2159
|
-
emulate: boolean;
|
|
2160
|
-
/**
|
|
2161
|
-
* Initializes a new ComfyJS instance and connects to Twitch chat.
|
|
2162
|
-
* @param options - Configuration options for ComfyJS instance.
|
|
2163
|
-
* @param emulate - Whether to emulate chat messages in the Local module.
|
|
2164
|
-
*/
|
|
2165
|
-
constructor(options: {
|
|
2166
|
-
username: string;
|
|
2167
|
-
password?: string;
|
|
2168
|
-
channels: string[];
|
|
2169
|
-
isDebug?: boolean;
|
|
2170
|
-
init?: boolean;
|
|
2171
|
-
}, emulate: boolean);
|
|
2172
|
-
/**
|
|
2173
|
-
* Loads the ComfyJS script if not already loaded.
|
|
2174
|
-
* @returns A promise that resolves to the ComfyJS instance.
|
|
2175
|
-
*/
|
|
2176
|
-
private load;
|
|
2177
|
-
/**
|
|
2178
|
-
* Connects event handlers to the ComfyJS instance.
|
|
2179
|
-
*/
|
|
2180
|
-
private connect;
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
2187
|
declare namespace Data {
|
|
2184
2188
|
const avatars: string[];
|
|
2185
2189
|
const badges: Twitch.GlobalBadge[];
|
|
@@ -3109,7 +3113,7 @@ declare class UtilsHelper {
|
|
|
3109
3113
|
userId: string;
|
|
3110
3114
|
name: string;
|
|
3111
3115
|
broadcasterId?: string;
|
|
3112
|
-
}, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<
|
|
3116
|
+
}, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<3 | 1 | 2>;
|
|
3113
3117
|
/**
|
|
3114
3118
|
* Identifies a user based on the received event and session data, returning their ID, name, role, badges, and top status.
|
|
3115
3119
|
* @param receivedEvent - The event received from the provider (Twitch or YouTube) containing user information.
|
|
@@ -3893,4 +3897,4 @@ declare global {
|
|
|
3893
3897
|
}
|
|
3894
3898
|
|
|
3895
3899
|
export { Alejo, Button, Command, EventProvider, StreamElements, StreamElementsEvents, Twitch, TwitchEvents, YoutubeEvents, main as default, useComfyJs, useLogger, useQueue, useStorage };
|
|
3896
|
-
export type { BttvEmote, ClientCustomEventPayload, ClientCustomProviderEvents, ClientEventTuple, ClientEvents, ClientProviderEvents, Emoji, Emote, FfzEmote, JSONObject, JSONPrimitive, JSONSerializable, MapNumberValuesToString, NumberAsString, PathValue, Provider$1 as Provider, RequireAtLeastOne, SeventvEmote, TwitchEmote };
|
|
3900
|
+
export type { BttvEmote, ClientCustomEventPayload, ClientCustomProviderEvents, ClientEventTuple, ClientEvents, ClientProviderEvents, Emoji, Emote, FfzEmote, JSONObject, JSONPrimitive, JSONSerializable, MapNumberValuesToString, NumberAsString, PathValue, Provider$1 as Provider, QueueDuration, QueueItem, QueueOptions, QueueProcessor, QueueProps, RequireAtLeastOne, SeventvEmote, TwitchEmote };
|
package/dist/index.es.js
CHANGED
|
@@ -10884,7 +10884,7 @@ var H = class {
|
|
|
10884
10884
|
}
|
|
10885
10885
|
}, W = class extends H {
|
|
10886
10886
|
constructor(e) {
|
|
10887
|
-
if (super(), this.queue = [], this.priorityQueue = [], this.history = [], this.timeouts = [], this.
|
|
10887
|
+
if (super(), this.queue = [], this.priorityQueue = [], this.history = [], this.timeouts = [], this.duration = void 0, this.running = !1, this.loaded = !1, this.clientWaitRetryDelay = 50, !e.processor || typeof e.processor != "function") throw Error("A valid processor function must be provided to useQueue.");
|
|
10888
10888
|
this.processor = e.processor, e.duration !== "client" && (this.duration = e.duration ?? 0), this.waitForClientAndBindLoad(e.duration);
|
|
10889
10889
|
}
|
|
10890
10890
|
waitForClientAndBindLoad(e = this.duration, t) {
|
|
@@ -10932,7 +10932,7 @@ var H = class {
|
|
|
10932
10932
|
return;
|
|
10933
10933
|
}
|
|
10934
10934
|
try {
|
|
10935
|
-
await this.processor.apply(this, [e
|
|
10935
|
+
await this.processor.apply(this, [e, this]), this.emit("process", e, this);
|
|
10936
10936
|
} catch (e) {
|
|
10937
10937
|
console.error(`Error during item processing: ${e instanceof Error ? e.message : String(e)}`);
|
|
10938
10938
|
}
|
|
@@ -12554,7 +12554,7 @@ var K = new class {
|
|
|
12554
12554
|
}
|
|
12555
12555
|
}(), q = new W({
|
|
12556
12556
|
duration: "client",
|
|
12557
|
-
processor: async function(e) {
|
|
12557
|
+
processor: async function({ value: e }) {
|
|
12558
12558
|
if (window.dispatchEvent(new CustomEvent(e.listener, { detail: e.data })), e.listener === "onEventReceived" && e.session) {
|
|
12559
12559
|
let t = await K.event.onSessionUpdate(N?.[0] ? N[0].session : void 0, B.event.parseProvider(e.data));
|
|
12560
12560
|
window.dispatchEvent(new CustomEvent("onSessionUpdate", { detail: t }));
|