UNPKG

koishi-plugin-adapter-iirose

Version:
20 lines (19 loc) 770 B
import { Context } from 'koishi'; import { IIROSE_Bot } from '../../bot/bot'; import { LoginObj } from './types'; /** * 测试服务器延迟 */ export declare function getLatency(ctx: Context, bot: IIROSE_Bot, url: string, disposed: () => boolean): Promise<number | 'error'>; /** * 准备 WebSocket 连接,测试服务器并选择最快的 */ export declare function prepareConnection(ctx: Context, bot: IIROSE_Bot, disposed: () => boolean): Promise<WebSocket>; /** * 创建登录对象 */ export declare function createLoginObj(bot: IIROSE_Bot): LoginObj; /** * 设置连接打开事件 */ export declare function setupOpenEvent(socket: WebSocket, bot: IIROSE_Bot, loginObj: LoginObj, startHeartbeat: () => void, startEvents: () => (() => boolean)[]): void;