StorageAdapter
The base class for building up a storage adapter used for reloading subscriptions.
Extended by
Type parameters
| Type parameter |
|---|
K extends ConnectionTypes |
Constructors
new StorageAdapter()
1new StorageAdapter<K>(): StorageAdapter<K>Returns
Methods
delete()
1abstract delete(id: string): anyDeletes a subscription from the storage.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the subscription which will be deleted. |
Returns
any
Source
twitchfy/packages/eventsub/src/storage/StorageAdapter.ts:34
get()
1abstract get<T>(id: string): StorageAdapterGet<K, T> | Promise<StorageAdapterGet<K, T>>Gets a subscription from the storage.
Type parameters
| Type parameter | Value |
|---|---|
T extends SubscriptionTypes | SubscriptionTypes |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the subscription which will be get. |
Returns
StorageAdapterGet<K, T> | Promise<StorageAdapterGet<K, T>>
The basic data which will be needed to reload the subscription. You can attach other data to the object.
Source
twitchfy/packages/eventsub/src/storage/StorageAdapter.ts:23
getAll()
1abstract getAll(): StorageAdapterGet<K>[] | Promise<StorageAdapterGet<K>[]>Gets all subscriptions from the storage.
Returns
StorageAdapterGet<K>[] | Promise<StorageAdapterGet<K>[]>
Source
twitchfy/packages/eventsub/src/storage/StorageAdapter.ts:28
set()
1abstract set<T>(id: string, subscription: SubscriptionType<T, K>): anySets a subscription into the storage.
Type parameters
| Type parameter | Value |
|---|---|
T extends SubscriptionTypes | SubscriptionTypes |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the subscription which will be set. Probably you want to use the id as a key. |
subscription | SubscriptionType<T, K> | The subscription which will be set. |
Returns
any