From fc159e40bea439f36fb9dbcf68256c9a1213b673 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Thu, 28 Dec 2023 23:21:17 +0100 Subject: [PATCH 1/2] fix(types): export missing `Gateway` interface --- packages/core/src/Gateway.ts | 5 +++++ packages/core/src/index.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/packages/core/src/Gateway.ts b/packages/core/src/Gateway.ts index f9c3778bbd42..45abbd1250c4 100644 --- a/packages/core/src/Gateway.ts +++ b/packages/core/src/Gateway.ts @@ -2,6 +2,11 @@ import type { Awaitable } from '@discordjs/util'; import type { ManagerShardEventsMap, WebSocketShardEvents } from '@discordjs/ws'; import type { GatewaySendPayload } from 'discord-api-types/v10'; +/** + * Gateway-like structure that can be used to interact with an actual WebSocket connection. + * You can provide a custom implementation, useful for running a message broker between your app and your gateway, + * or you can simply use the {@link https://discord.js.org/docs/packages/ws/stable/WebSocketManager:Class | WebSocketManager} + */ export interface Gateway { getShardCount(): Awaitable; on( diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 33b31b76070a..03a97ad41f90 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,5 +1,6 @@ export * from './api/index.js'; export * from './client.js'; +export * from './Gateway.js'; export * from './util/index.js'; export * from 'discord-api-types/v10'; From 3dcc2e60748d666658f51ead564a1846b7d36197 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Fri, 29 Dec 2023 17:10:53 +0100 Subject: [PATCH 2/2] docs(Gateway): update link to `WebSocketManager` --- packages/core/src/Gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/Gateway.ts b/packages/core/src/Gateway.ts index 45abbd1250c4..86edd5be9e2f 100644 --- a/packages/core/src/Gateway.ts +++ b/packages/core/src/Gateway.ts @@ -5,7 +5,7 @@ import type { GatewaySendPayload } from 'discord-api-types/v10'; /** * Gateway-like structure that can be used to interact with an actual WebSocket connection. * You can provide a custom implementation, useful for running a message broker between your app and your gateway, - * or you can simply use the {@link https://discord.js.org/docs/packages/ws/stable/WebSocketManager:Class | WebSocketManager} + * or you can simply use the {@link @discordjs/ws#(WebSocketManager:class)}. */ export interface Gateway { getShardCount(): Awaitable;