SubscriptionCollection
The collection of subscriptions. This is an extended class of Map.
Extends
Map
<string
,SubscriptionType
<T
,K
>>
Type parameters
Type parameter | Value |
---|---|
K extends ConnectionTypes | ConnectionTypes |
T extends SubscriptionTypes | SubscriptionTypes |
Constructors
new SubscriptionCollection()
1new SubscriptionCollection<K, T>(entries?: readonly readonly [string, SubscriptionType<T, K>][]): SubscriptionCollection<K, T>
Parameters
Parameter | Type |
---|---|
entries ? | readonly readonly [string , SubscriptionType <T , K >][] |
Returns
SubscriptionCollection
<K
, T
>
Inherited from
Map<string, SubscriptionType<T, K>>.constructor
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:50
new SubscriptionCollection()
1new SubscriptionCollection<K, T>(iterable?: Iterable<readonly [string, SubscriptionType<T, K>]>): SubscriptionCollection<K, T>
Parameters
Parameter | Type |
---|---|
iterable ? | Iterable <readonly [string , SubscriptionType <T , K >]> |
Returns
SubscriptionCollection
<K
, T
>
Inherited from
Map<string, SubscriptionType<T, K>>.constructor
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:49
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
[toStringTag] | readonly | string | - | Map.[toStringTag] |
size | readonly | number | Map.size | |
[species] | readonly | MapConstructor | - | Map.[species] |
Methods
[iterator]
()
1iterator: IterableIterator<[string, SubscriptionType<T, K>]>
Returns an iterable of entries in the map.
Returns
IterableIterator
<[string
, SubscriptionType
<T
, K
>]>
Inherited from
Map.[iterator]
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:119
clear()
1clear(): void
Returns
void
Inherited from
Map.clear
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:20
delete()
1delete(key: string): boolean
Parameters
Parameter | Type |
---|---|
key | string |
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Inherited from
Map.delete
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:24
entries()
1entries(): IterableIterator<[string, SubscriptionType<T, K>]>
Returns an iterable of key, value pairs for every entry in the map.
Returns
IterableIterator
<[string
, SubscriptionType
<T
, K
>]>
Inherited from
Map.entries
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:124
exist()
1exist<U>(type: U, options: SubscriptionTypeOptions[U]): SubscriptionType<U, K>
Checks whether a subscription exists in the collection by its type and options.
Type parameters
Type parameter |
---|
U extends SubscriptionTypes |
Parameters
Parameter | Type | Description |
---|---|---|
type | U | The type of the subscription. |
options | SubscriptionTypeOptions [U ] | The options used to create the subscription. |
Returns
SubscriptionType
<U
, K
>
Whether the subscription exists. If it exists, the subscription is returned.
Source
twitchfy/packages/eventsub/src/structures/SubscriptionCollection.ts:38
forEach()
1forEach(callbackfn: (value: SubscriptionType<T, K>, key: string, map: Map<string, SubscriptionType<T, K>>) => void, thisArg?: any): void
Executes a provided function once per each key/value pair in the Map, in insertion order.
Parameters
Parameter | Type |
---|---|
callbackfn | (value : SubscriptionType <T , K >, key : string , map : Map <string , SubscriptionType <T , K >>) => void |
thisArg ? | any |
Returns
void
Inherited from
Map.forEach
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:28
get()
1get<U>(id: string): SubscriptionType<U, K>
Gets a subscription from the collection by its id.
Type parameters
Type parameter |
---|
U extends SubscriptionTypes |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the subscription. |
Returns
SubscriptionType
<U
, K
>
The subscription if it exists, otherwise undefined.
Overrides
Map.get
Source
twitchfy/packages/eventsub/src/structures/SubscriptionCollection.ts:18
has()
1has(key: string): boolean
Parameters
Parameter | Type |
---|---|
key | string |
Returns
boolean
boolean indicating whether an element with the specified key exists or not.
Inherited from
Map.has
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:37
keys()
1keys(): IterableIterator<string>
Returns an iterable of keys in the map
Returns
IterableIterator
<string
>
Inherited from
Map.keys
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:129
set()
1set<U>(id: string, value: SubscriptionType<U, K>): this
Sets a subscription into collection.
Type parameters
Type parameter |
---|
U extends SubscriptionTypes |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the subscription. |
value | SubscriptionType <U , K > | The subscription to set. |
Returns
this
The updated collection.
Overrides
Map.set
Source
twitchfy/packages/eventsub/src/structures/SubscriptionCollection.ts:28
values()
1values(): IterableIterator<SubscriptionType<T, K>>
Returns an iterable of values in the map
Returns
IterableIterator
<SubscriptionType
<T
, K
>>
Inherited from
Map.values
Source
node_modules/.pnpm/typescript@5.5.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:134