///
import WebSocket from 'ws';
import { LegacySocketConfig, SocketQueryOptions, SocketSendMessageOptions, WATag } from '../Types';
import { BinaryNode } from '../WABinary';
/**
* Connects to WA servers and performs:
* - simple queries (no retry mechanism, wait for connection establishment)
* - listen to messages and emit events
* - query phone connection
*/
export declare const makeSocket: ({ waWebSocketUrl, connectTimeoutMs, phoneResponseTimeMs, logger, agent, keepAliveIntervalMs, expectResponseTimeout, }: LegacySocketConfig) => {
type: "legacy";
ws: WebSocket;
sendAdminTest: () => Promise;
updateKeys: (info: {
encKey: Buffer;
macKey: Buffer;
}) => {
encKey: Buffer;
macKey: Buffer;
};
waitForSocketOpen: () => Promise;
sendNode: ({ json, binaryTag, tag, longTag }: SocketSendMessageOptions) => Promise;
generateMessageTag: (longTag?: boolean) => string;
waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number | undefined) => {
promise: Promise;
cancelToken: () => void;
};
query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: SocketQueryOptions) => Promise;
/** Generic function for action, set queries */
setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string | undefined) => Promise<{
status: number;
}>;
currentEpoch: () => number;
end: (error: Error | undefined) => void;
};