UNPKG

jspteroapi

Version:

A pterodactyl v1 api using undici

27 lines (26 loc) 1 kB
import { JSPteroAPIError } from 'index'; import { Client } from '../index'; import { WebsocketClient } from '../Websocket'; export declare class consoleMethods { private readonly client; private readonly errorHandler; constructor(client: Client, errorHandler: (error: JSPteroAPIError) => void); /** * @internal */ private getWebsocketAuthData; /** * @param serverId - ID of the server to get (In the settings tab of server/in link) * @remarks This method is used to connect to server websocket and have automatic authentication. This exposes the websocket client. * @returns WebsocketClient * @example * ```ts * const res = await client.startConsoleConnection('c2f5a3b6') // res = WebsocketClient * ``` * @example * ```ts * client.startConsoleConnection('c2f5a3b6').then((res) => console.log(res)) // res = WebsocketClient * ``` */ startConsoleConnection: (serverId: string) => Promise<WebsocketClient>; }