mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
feat(core): abstract gateway (#9410)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
12
packages/core/src/Gateway.ts
Normal file
12
packages/core/src/Gateway.ts
Normal 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user