feat(core): abstract gateway (#9410)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
DD
2023-04-17 23:05:05 +03:00
committed by GitHub
parent 98a76db482
commit 5d1a4c27d5
2 changed files with 24 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
import type { Awaitable } from '@discordjs/util';
import type { ManagerShardEventsMap, WebSocketShardEvents } from '@discordjs/ws';
import type { GatewaySendPayload } from 'discord-api-types/v10';
export interface Gateway {
getShardCount(): Awaitable<number>;
on(
event: WebSocketShardEvents.Dispatch,
listener: (...params: ManagerShardEventsMap[WebSocketShardEvents.Dispatch]) => Awaitable<void>,
): this;
send(shardId: number, payload: GatewaySendPayload): Awaitable<void>;
}