import { EventEmitter } from "node:events"; import DiscordConnector = require("./DiscordConnector"); import type { ShardEvents } from "./Types"; /** * Shard class, which provides a wrapper around the DiscordConnector with metadata like the id of the shard. * * This class is automatically instantiated by the library and is documented for reference. * @since 0.1.4 */ declare class Shard extends EventEmitter { id: number; client: import("./Client"); /** If this shard has received the READY or RESUMED payload and isn't disconnected yet. */ ready: boolean; /** The connector that handles all of the Discord specific connection logic. */ connector: DiscordConnector; /** * Create a new Shard. * @param id id of the shard. * @param client Main class used for forwarding events. */ constructor(id: number, client: import("./Client")); /** * Time in ms it took for Discord to acknowledge an OP 1 HEARTBEAT. * @since 0.3.0 */ get latency(): number; /** * Create a new connection to Discord. * @since 0.1.4 */ connect(): void; /** * Close the current connection to Discord. * @since 0.1.4 * @param resumable Whether to close with a code that keeps the session alive for a later resume. See DiscordConnector.disconnect. */ disconnect(resumable?: boolean): Promise; /** * Send an OP 3 PRESENCE_UPDATE to Discord. * @since 0.3.0 * @param data Data to send. */ presenceUpdate(data: Parameters["0"]): Promise; /** * Send an OP 4 VOICE_STATE_UPDATE to Discord. * @since 0.1.4 * @param data Data to send */ voiceStateUpdate(data: Parameters["0"]): Promise; /** * Send an OP 8 REQUEST_GUILD_MEMBERS to Discord. * @since 0.1.4 * @param data Data to send. */ requestGuildMembers(data: Parameters["0"]): Promise; /** * Send an OP 31 REQUEST_SOUNDBOARD_SOUNDS to the gateway. * @since 0.19.0 * @param guilds The guilds to get the soundboard sounds from. */ requestSoundboardSounds(guilds: Parameters["0"]): Promise; /** * Send an OP 43 REQUEST_CHANNEL_INFO to the gateway. * @since 0.19.0 * @param data Data to send. */ requestChannelInfo(data: Parameters["0"]): Promise; } export = Shard;