@tixyel/streamelements 7.3.1 → 7.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 +154 -145
- package/dist/index.es.js +867 -826
- 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
|
@@ -3353,156 +3353,165 @@ declare namespace Helper {
|
|
|
3353
3353
|
const utils: UtilsHelper;
|
|
3354
3354
|
}
|
|
3355
3355
|
|
|
3356
|
-
declare
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
session: {
|
|
3371
|
-
types: Record<string, StreamElements.Session.Config.Any>;
|
|
3372
|
-
available(): StreamElements.Session.Config.Available.Data;
|
|
3373
|
-
get(startSession?: StreamElements.Session.Data): Promise<StreamElements.Session.Data>;
|
|
3374
|
-
};
|
|
3375
|
-
event: {
|
|
3376
|
-
/**
|
|
3377
|
-
* Simulates the onWidgetLoad event for a widget.
|
|
3378
|
-
* @param fields - The field values to be included in the event.
|
|
3379
|
-
* @param session - The session data to be included in the event.
|
|
3380
|
-
* @param currency - The currency to be used (default is 'USD').
|
|
3381
|
-
* @returns A Promise that resolves to the simulated onWidgetLoad event data.
|
|
3382
|
-
*/
|
|
3383
|
-
onWidgetLoad(fields: Record<string, StreamElements.CustomField.Value>, session: StreamElements.Session.Data, currency?: "BRL" | "USD" | "EUR"): Promise<StreamElements.Event.onWidgetLoad>;
|
|
3384
|
-
/**
|
|
3385
|
-
* Simulates the onSessionUpdate event for a widget.
|
|
3386
|
-
* @param session - The session data to be included in the event.
|
|
3387
|
-
* @returns A Promise that resolves to the simulated onSessionUpdate event data.
|
|
3388
|
-
*/
|
|
3389
|
-
onSessionUpdate(session?: StreamElements.Session.Data, update?: ClientEvents$1): Promise<StreamElements.Event.onSessionUpdate>;
|
|
3390
|
-
/**
|
|
3391
|
-
* Simulates the onEventReceived event for a widget.
|
|
3392
|
-
* @param provider - The provider of the event (default is 'random').
|
|
3393
|
-
* @param type - The type of event to simulate (default is 'random').
|
|
3394
|
-
* @param options - Additional options to customize the event data.
|
|
3395
|
-
* @returns A Promise that resolves to the simulated onEventReceived event data, or null if the event type is not supported.
|
|
3396
|
-
* @example
|
|
3397
|
-
* ```javascript
|
|
3398
|
-
* // Simulate a random event
|
|
3399
|
-
* const randomEvent = await Local .generate.event.onEventReceived();
|
|
3400
|
-
*
|
|
3401
|
-
* // Simulate a Twitch message event with custom options
|
|
3402
|
-
* const twitchMessageEvent = await Local .generate.event.onEventReceived('twitch', 'message', { name: 'Streamer', message: 'Hello World!' });
|
|
3403
|
-
* ```
|
|
3404
|
-
*/
|
|
3405
|
-
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>;
|
|
3406
|
-
};
|
|
3407
|
-
};
|
|
3408
|
-
const emulate: {
|
|
3409
|
-
twitch: {
|
|
3410
|
-
message(data?: Partial<{
|
|
3411
|
-
name: string;
|
|
3412
|
-
message: string;
|
|
3413
|
-
badges: BadgeOptions;
|
|
3414
|
-
color: string;
|
|
3415
|
-
userId: string;
|
|
3356
|
+
declare class Emulator {
|
|
3357
|
+
twitch: {
|
|
3358
|
+
message(data?: Partial<{
|
|
3359
|
+
name: string;
|
|
3360
|
+
message: string;
|
|
3361
|
+
badges: BadgeOptions;
|
|
3362
|
+
color: string;
|
|
3363
|
+
userId: string;
|
|
3364
|
+
msgId: string;
|
|
3365
|
+
channel: string;
|
|
3366
|
+
time: number;
|
|
3367
|
+
firstMsg: boolean;
|
|
3368
|
+
returningChatter: boolean;
|
|
3369
|
+
reply: {
|
|
3416
3370
|
msgId: string;
|
|
3417
|
-
channel: string;
|
|
3418
|
-
time: number;
|
|
3419
|
-
firstMsg: boolean;
|
|
3420
|
-
returningChatter: boolean;
|
|
3421
|
-
reply: {
|
|
3422
|
-
msgId: string;
|
|
3423
|
-
userId: string;
|
|
3424
|
-
login: string;
|
|
3425
|
-
name: string;
|
|
3426
|
-
text: string;
|
|
3427
|
-
};
|
|
3428
|
-
thread: {
|
|
3429
|
-
msgId: string;
|
|
3430
|
-
name: string;
|
|
3431
|
-
};
|
|
3432
|
-
}>): void;
|
|
3433
|
-
deleteMessage(msgId: string): void;
|
|
3434
|
-
deleteMessages(userId: string): void;
|
|
3435
|
-
follower(data?: Partial<{
|
|
3436
|
-
avatar: string;
|
|
3437
|
-
name: string;
|
|
3438
|
-
}>): void;
|
|
3439
|
-
raid(data?: Partial<{
|
|
3440
|
-
amount: number;
|
|
3441
|
-
avatar: string;
|
|
3442
|
-
name: string;
|
|
3443
|
-
}>): void;
|
|
3444
|
-
cheer(data?: Partial<{
|
|
3445
|
-
amount: number;
|
|
3446
|
-
avatar: string;
|
|
3447
|
-
name: string;
|
|
3448
|
-
message: string;
|
|
3449
|
-
}>): void;
|
|
3450
|
-
subscriber(data?: Partial<{
|
|
3451
|
-
tier: "1000" | "2000" | "3000" | "prime";
|
|
3452
|
-
amount: number;
|
|
3453
|
-
avatar: string;
|
|
3454
|
-
name: string;
|
|
3455
|
-
sender: string;
|
|
3456
|
-
message: string;
|
|
3457
|
-
subType: "default" | "gift" | "community" | "spam";
|
|
3458
|
-
}> & {
|
|
3459
|
-
subType?: "default" | "gift" | "community" | "spam";
|
|
3460
|
-
}): void;
|
|
3461
|
-
};
|
|
3462
|
-
streamelements: {
|
|
3463
|
-
tip(data?: Partial<{
|
|
3464
|
-
amount: number;
|
|
3465
|
-
avatar: string;
|
|
3466
|
-
name: string;
|
|
3467
|
-
}>): void;
|
|
3468
|
-
};
|
|
3469
|
-
youtube: {
|
|
3470
|
-
message(data?: Partial<{
|
|
3471
|
-
name: string;
|
|
3472
|
-
message: string;
|
|
3473
|
-
badges: BadgeOptions;
|
|
3474
|
-
color: string;
|
|
3475
3371
|
userId: string;
|
|
3476
|
-
|
|
3477
|
-
channel: string;
|
|
3478
|
-
time: number;
|
|
3479
|
-
avatar: string;
|
|
3480
|
-
}>): void;
|
|
3481
|
-
subscriber(data?: Partial<{
|
|
3482
|
-
avatar: string;
|
|
3372
|
+
login: string;
|
|
3483
3373
|
name: string;
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
name: string;
|
|
3489
|
-
}>): void;
|
|
3490
|
-
sponsor(data?: Partial<{
|
|
3491
|
-
tier: "1000" | "2000" | "3000";
|
|
3492
|
-
amount: number;
|
|
3493
|
-
avatar: string;
|
|
3374
|
+
text: string;
|
|
3375
|
+
};
|
|
3376
|
+
thread: {
|
|
3377
|
+
msgId: string;
|
|
3494
3378
|
name: string;
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3379
|
+
};
|
|
3380
|
+
}>): void;
|
|
3381
|
+
deleteMessage(msgId: string): void;
|
|
3382
|
+
deleteMessages(userId: string): void;
|
|
3383
|
+
follower(data?: Partial<{
|
|
3384
|
+
avatar: string;
|
|
3385
|
+
name: string;
|
|
3386
|
+
}>): void;
|
|
3387
|
+
raid(data?: Partial<{
|
|
3388
|
+
amount: number;
|
|
3389
|
+
avatar: string;
|
|
3390
|
+
name: string;
|
|
3391
|
+
}>): void;
|
|
3392
|
+
cheer(data?: Partial<{
|
|
3393
|
+
amount: number;
|
|
3394
|
+
avatar: string;
|
|
3395
|
+
name: string;
|
|
3396
|
+
message: string;
|
|
3397
|
+
}>): void;
|
|
3398
|
+
subscriber(data?: Partial<{
|
|
3399
|
+
tier: "1000" | "2000" | "3000" | "prime";
|
|
3400
|
+
amount: number;
|
|
3401
|
+
avatar: string;
|
|
3402
|
+
name: string;
|
|
3403
|
+
sender: string;
|
|
3404
|
+
message: string;
|
|
3405
|
+
subType: "default" | "gift" | "community" | "spam";
|
|
3406
|
+
}> & {
|
|
3407
|
+
subType?: "default" | "gift" | "community" | "spam";
|
|
3408
|
+
}): void;
|
|
3505
3409
|
};
|
|
3410
|
+
streamelements: {
|
|
3411
|
+
tip(data?: Partial<{
|
|
3412
|
+
amount: number;
|
|
3413
|
+
avatar: string;
|
|
3414
|
+
name: string;
|
|
3415
|
+
}>): void;
|
|
3416
|
+
};
|
|
3417
|
+
youtube: {
|
|
3418
|
+
message(data?: Partial<{
|
|
3419
|
+
name: string;
|
|
3420
|
+
message: string;
|
|
3421
|
+
badges: BadgeOptions;
|
|
3422
|
+
color: string;
|
|
3423
|
+
userId: string;
|
|
3424
|
+
msgId: string;
|
|
3425
|
+
channel: string;
|
|
3426
|
+
time: number;
|
|
3427
|
+
avatar: string;
|
|
3428
|
+
}>): void;
|
|
3429
|
+
subscriber(data?: Partial<{
|
|
3430
|
+
avatar: string;
|
|
3431
|
+
name: string;
|
|
3432
|
+
}>): void;
|
|
3433
|
+
superchat(data?: Partial<{
|
|
3434
|
+
amount: number;
|
|
3435
|
+
avatar: string;
|
|
3436
|
+
name: string;
|
|
3437
|
+
}>): void;
|
|
3438
|
+
sponsor(data?: Partial<{
|
|
3439
|
+
tier: "1000" | "2000" | "3000";
|
|
3440
|
+
amount: number;
|
|
3441
|
+
avatar: string;
|
|
3442
|
+
name: string;
|
|
3443
|
+
sender: string;
|
|
3444
|
+
message: string;
|
|
3445
|
+
subType: "default" | "gift" | "community" | "spam";
|
|
3446
|
+
}> & {
|
|
3447
|
+
subType?: "default" | "gift" | "community" | "spam";
|
|
3448
|
+
}): void;
|
|
3449
|
+
};
|
|
3450
|
+
kick: {};
|
|
3451
|
+
facebook: {};
|
|
3452
|
+
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;
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
/**
|
|
3456
|
+
* Simulates the onWidgetLoad event for a widget.
|
|
3457
|
+
* @param fields - The field values to be included in the event.
|
|
3458
|
+
* @param session - The session data to be included in the event.
|
|
3459
|
+
* @param currency - The currency to be used (default is 'USD').
|
|
3460
|
+
* @returns A Promise that resolves to the simulated onWidgetLoad event data.
|
|
3461
|
+
*/
|
|
3462
|
+
declare function onWidgetLoad(fields: Record<string, StreamElements.CustomField.Value>, session: StreamElements.Session.Data, currency?: 'BRL' | 'USD' | 'EUR'): Promise<StreamElements.Event.onWidgetLoad>;
|
|
3463
|
+
/**
|
|
3464
|
+
* Simulates the onSessionUpdate event for a widget.
|
|
3465
|
+
* @param session - The session data to be included in the event.
|
|
3466
|
+
* @returns A Promise that resolves to the simulated onSessionUpdate event data.
|
|
3467
|
+
*/
|
|
3468
|
+
declare function onSessionUpdate(session?: StreamElements.Session.Data, update?: ClientEvents$1): Promise<StreamElements.Event.onSessionUpdate>;
|
|
3469
|
+
/**
|
|
3470
|
+
* Simulates the onEventReceived event for a widget.
|
|
3471
|
+
* @param provider - The provider of the event (default is 'random').
|
|
3472
|
+
* @param type - The type of event to simulate (default is 'random').
|
|
3473
|
+
* @param options - Additional options to customize the event data.
|
|
3474
|
+
* @returns A Promise that resolves to the simulated onEventReceived event data, or null if the event type is not supported.
|
|
3475
|
+
* @example
|
|
3476
|
+
* ```javascript
|
|
3477
|
+
* // Simulate a random event
|
|
3478
|
+
* const randomEvent = await onEventReceived();
|
|
3479
|
+
*
|
|
3480
|
+
* // Simulate a Twitch message event with custom options
|
|
3481
|
+
* const twitchMessageEvent = await onEventReceived('twitch', 'message', { name: 'Streamer', message: 'Hello World!' });
|
|
3482
|
+
* ```
|
|
3483
|
+
*/
|
|
3484
|
+
declare function 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>;
|
|
3485
|
+
declare class Generator {
|
|
3486
|
+
event: {
|
|
3487
|
+
onWidgetLoad: typeof onWidgetLoad;
|
|
3488
|
+
onSessionUpdate: typeof onSessionUpdate;
|
|
3489
|
+
onEventReceived: typeof onEventReceived;
|
|
3490
|
+
};
|
|
3491
|
+
session: {
|
|
3492
|
+
types: Record<string, StreamElements.Session.Config.Any>;
|
|
3493
|
+
available(): StreamElements.Session.Config.Available.Data;
|
|
3494
|
+
get(startSession?: StreamElements.Session.Data): Promise<StreamElements.Session.Data>;
|
|
3495
|
+
};
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
type localQueueItem = {
|
|
3499
|
+
listener: 'onEventReceived';
|
|
3500
|
+
data: StreamElements.Event.onEventReceived;
|
|
3501
|
+
session?: boolean;
|
|
3502
|
+
} | {
|
|
3503
|
+
listener: 'onWidgetLoad';
|
|
3504
|
+
data: StreamElements.Event.onWidgetLoad;
|
|
3505
|
+
} | {
|
|
3506
|
+
listener: 'onSessionUpdate';
|
|
3507
|
+
data: StreamElements.Event.onSessionUpdate;
|
|
3508
|
+
};
|
|
3509
|
+
|
|
3510
|
+
declare namespace Local {
|
|
3511
|
+
type QueueItem = localQueueItem;
|
|
3512
|
+
const queue: useQueue<localQueueItem>;
|
|
3513
|
+
const generate: Generator;
|
|
3514
|
+
const emulate: Emulator;
|
|
3506
3515
|
function start(fieldsFile?: string[], dataFiles?: string[], session?: StreamElements.Session.Data): Promise<void>;
|
|
3507
3516
|
}
|
|
3508
3517
|
|