53 lines
2.6 KiB
TypeScript
53 lines
2.6 KiB
TypeScript
import { Boom } from '@hapi/boom';
|
|
import type { SocketConfig } from '../Types/index.js';
|
|
import { type BinaryNode } from '../WABinary/index.js';
|
|
import { BinaryInfo } from '../WAM/BinaryInfo.js';
|
|
import { USyncQuery } from '../WAUSync/index.js';
|
|
import { WebSocketClient } from './Client/index.js';
|
|
/**
|
|
* 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: (config: SocketConfig) => {
|
|
type: "md";
|
|
ws: WebSocketClient;
|
|
ev: import("../Types/index.js").BaileysEventEmitter & {
|
|
process(handler: (events: Partial<import("../Types/index.js").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
buffer(): void;
|
|
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
flush(): boolean;
|
|
isBuffering(): boolean;
|
|
};
|
|
authState: {
|
|
creds: import("../Types/index.js").AuthenticationCreds;
|
|
keys: import("../Types/index.js").SignalKeyStoreWithTransaction;
|
|
};
|
|
signalRepository: import("../Types/index.js").SignalRepositoryWithLIDStore;
|
|
readonly user: import("../Types/index.js").Contact | undefined;
|
|
generateMessageTag: () => string;
|
|
query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
|
|
waitForSocketOpen: () => Promise<void>;
|
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
logout: (msg?: string) => Promise<void>;
|
|
end: (error: Error | undefined) => void;
|
|
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
|
uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
|
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
digestKeyBundle: () => Promise<void>;
|
|
rotateSignedPreKey: () => Promise<void>;
|
|
requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
|
|
wamBuffer: BinaryInfo;
|
|
/** Waits for the connection to WA to reach a state */
|
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types/index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
|
|
onWhatsApp: (...phoneNumber: string[]) => Promise<{
|
|
jid: string;
|
|
exists: boolean;
|
|
}[] | undefined>;
|
|
};
|
|
//# sourceMappingURL=socket.d.ts.map
|