import { MJConfig, MJMessage, LoadingHandler, WsEventMsg, MJInfo, MJSettings, MJOptions } from "./interfaces"; import { MidjourneyApi } from "./midjourne.api"; import WebSocket from "isomorphic-ws"; export declare const content2prompt: (content: string) => string; export declare const enum ImageType { imagine = "imagine", variation = "variation", inpaint = "inpaint", upscale = "upscale", upscale2x = "upscale2x", upscale4x = "upscale4x", zoomout = "zoomout", pan = "pan" } export declare class WsMessage { config: MJConfig; MJApi: MidjourneyApi; ws: WebSocket; MJBotId: string; private closed; private event; private waitMjEvents; private doneCallBack; private reconnectTime; private heartbeatInterval; private userId; private extra; session_id: string; constructor(config: MJConfig, MJApi: MidjourneyApi); private heartbeat; close(): void; private reconnect; private open; private auth; timeout(ms: number): Promise; private messageCreate; private messageUpdate; private processingImage; static handleCaptcha(message: any): Promise; private parseMessage; private verifyHuman; private EventError; getType(content: string): ImageType; private getMode; private done; protected content2progress(content: string): string; content2prompt(content: string | undefined): string; private getEventById; private updateMjEventIdByNonce; private updateMjEventContentById; uriToHash(uri: string): string; protected log(...args: any[]): Promise; emit(event: string, message: any): void; private emitImage; private emitDescribe; on(event: string, callback: (message: any) => void): void; once(event: string, callback: (message: any) => void): void; remove(event: string, callback: (message: any) => void): void; removeEvent(event: string): void; onceInfo(callback: (message: any) => void): void; onceSettings(callback: (message: any) => void): void; onceDescribe(nonce: string, callback: (data: any) => void): void; removeInfo(callback: (message: any) => void): void; private removeWaitMjEvent; onceImage(nonce: string, prompt: string, doneCallBack: any, callback: (data: WsEventMsg) => void): void; waitImageMessage(nonce: string, prompt: string, doneCallBack: any, loading?: LoadingHandler): Promise; waitDescribe(nonce: string): Promise<{ options: MJOptions[]; descriptions: string[]; } | null>; waitInfo(): Promise; waitSettings(): Promise; msg2Info(msg: string): MJInfo; }