UNPKG

jspteroapi

Version:

A pterodactyl v1 api using undici

24 lines (23 loc) 889 B
/// <reference types="node" /> /// <reference types="node" /> import { WebSocket, Event, MessageEvent, CloseEvent, ErrorEvent } from 'ws'; export declare class Socket { private readonly url; private readonly options; constructor(url: string, options: { onopen: (this: Socket, ev: Event) => void; onmessage: (this: Socket, ev: MessageEvent) => void; onreconnect: (this: Socket, ev: Event | CloseEvent | ErrorEvent) => void; onmaximum: (this: Socket, ev: CloseEvent | ErrorEvent) => void; onclose: (this: Socket, ev: CloseEvent) => void; onerror: (this: Socket, ev: ErrorEvent) => void; }); ws: WebSocket; timer: NodeJS.Timeout; private reconnectNum; open: () => void; private reconnect; json: (x: unknown) => void; send: (x: string) => void; close: (x?: number, y?: string | Buffer) => void; }