BaseConnection
The base class for all the connections.
Extends
Extended by
Type parameters
Type parameter |
---|
K extends ConnectionTypes |
U extends WebhookEvents | WebSocketEvents | ConduitEvents |
Constructors
new BaseConnection()
Builds up a BaseConnection.
Parameters
Parameter | Type | Description |
---|---|---|
options | BaseConnectionOptions <K > | The options of the connection. |
Returns
BaseConnection
<K
, U
>
Overrides
EventSubEventEmitter
.constructor
Source
twitchfy/packages/eventsub/src/structures/BaseConnection.ts:74
Properties
Property | Modifier | Type | Description |
---|---|---|---|
clientId | readonly | string | The client ID of the connection. |
clientSecret | readonly | string | The client secret of the connection. |
debug | public | boolean | Whether the connection is in debug mode or not. |
helixClient | readonly | HelixClient | The Helix client used by the connection for making API Requests. |
logger | readonly | Logger | The logger of the connection. |
maintainSubscriptions | readonly | boolean | Whether the connection should maintain the subscriptions or not between each start. |
storage | readonly | StorageAdapter <K > | The storage adapter used by the connection for storing subscriptions. |
subscriptions | readonly | SubscriptionCollection <K , SubscriptionTypes > | The subscriptions of the connection. You will only receive events for this subscriptions. |
Methods
addListener()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
EventSubEventEmitter
.addListener
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:7
emit()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
…args | K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ] |
Returns
boolean
Inherited from
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:17
eventNames()
Returns
(keyof AsyncEventEmitterPredefinedEvents | keyof U
)[]
Inherited from
EventSubEventEmitter
.eventNames
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:21
getMaxListeners()
Returns
number
Inherited from
EventSubEventEmitter
.getMaxListeners
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:14
listenerCount()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
Returns
number
Inherited from
EventSubEventEmitter
.listenerCount
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:18
listeners()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
Returns
(…args
: U
[keyof U
]) => Awaitable
<void
>[]
Inherited from
EventSubEventEmitter
.listeners
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:15
makeDebug()
Makes a debug log
Parameters
Parameter | Type | Description |
---|---|---|
…args | any [] | The arguments to log. |
Returns
void
Source
twitchfy/packages/eventsub/src/structures/BaseConnection.ts:113
makeWarn()
Makes a warn log
Parameters
Parameter | Type | Description |
---|---|---|
…args | any [] | The arguments to log. |
Returns
void
Source
twitchfy/packages/eventsub/src/structures/BaseConnection.ts:124
off()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:11
on()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:8
once()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:9
prependListener()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
EventSubEventEmitter
.prependListener
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:19
prependOnceListener()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
EventSubEventEmitter
.prependOnceListener
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:20
rawListeners()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
Returns
Listener
<U
[keyof U
]>[]
Inherited from
EventSubEventEmitter
.rawListeners
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:16
removeAllListeners()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
event ? | K |
Returns
this
Inherited from
EventSubEventEmitter
.removeAllListeners
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:12
removeListener()
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : K extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [K <K >] : U [K ]) => void |
Returns
this
Inherited from
EventSubEventEmitter
.removeListener
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:10
setMaxListeners()
Parameters
Parameter | Type |
---|---|
n | number |
Returns
this
Inherited from
EventSubEventEmitter
.setMaxListeners
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:13
subscribe()
Subscribe to an EventSub event.
Type parameters
Type parameter |
---|
T extends SubscriptionTypes |
Parameters
Parameter | Type | Description |
---|---|---|
options | SubscriptionOptions <T > | The options of the subscription. |
Returns
Promise
<SubscriptionType
<T
, K
>>
Source
twitchfy/packages/eventsub/src/structures/BaseConnection.ts:100
subscribeAll()
Subscribe to multiple EventSub events.
Type parameters
Type parameter |
---|
T extends SubscriptionTypes |
Parameters
Parameter | Type | Description |
---|---|---|
…options | SubscriptionOptions <T >[] | The options of the subscriptions. |
Returns
Promise
<SubscriptionType
<T
, K
>[]>
Source
twitchfy/packages/eventsub/src/structures/BaseConnection.ts:106
waitForAllListenersToComplete()
Returns
Promise
<boolean
>
Inherited from
EventSubEventEmitter
.waitForAllListenersToComplete
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:22
listenerCount()
Type parameters
Type parameter | Value |
---|---|
Emitter extends AsyncEventEmitter <any , any > | - |
EventNames | Emitter extends AsyncEventEmitter <Events , Events > ? Events : never |
EventName extends PropertyKey | EventNames extends never ? string | symbol : keyof EventNames |
Parameters
Parameter | Type |
---|---|
emitter | Emitter |
eventName | keyof AsyncEventEmitterPredefinedEvents | EventName |
Returns
number
Inherited from
EventSubEventEmitter
.listenerCount
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:25
on()
Type parameters
Type parameter | Value |
---|---|
Emitter extends AsyncEventEmitter <any , any > | - |
EventNames extends object | Emitter extends AsyncEventEmitter <Events , any > ? Events : Record <PropertyKey , unknown []> |
EventName extends PropertyKey | keyof AsyncEventEmitterPredefinedEvents | keyof EventNames |
EventResult extends unknown [] | EventNames extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [EventName ] : EventNames [EventName ] |
Parameters
Parameter | Type |
---|---|
emitter | Emitter |
eventName | EventName |
options ? | AbortableMethods |
Returns
AsyncGenerator
<EventResult
, void
, unknown
>
Inherited from
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:29
once()
Type parameters
Type parameter | Value |
---|---|
Emitter extends AsyncEventEmitter <any , any > | - |
EventNames extends object | Emitter extends AsyncEventEmitter <Events , any > ? Events : Record <PropertyKey , unknown []> |
EventName extends PropertyKey | keyof AsyncEventEmitterPredefinedEvents | keyof EventNames |
EventResult extends unknown [] | EventNames extends keyof AsyncEventEmitterPredefinedEvents ? AsyncEventEmitterPredefinedEvents [EventName ] : EventNames [EventName ] |
Parameters
Parameter | Type |
---|---|
emitter | Emitter |
eventName | EventName |
options ? | AbortableMethods |
Returns
Promise
<EventResult
>
Inherited from
Source
twitchfy/node_modules/@vladfrangu/async_event_emitter/dist/index.d.ts:27