///
import { Logger } from 'pino';
import { proto } from '../Proto';
export declare const BRAND: string;
import { BinaryNode } from '../Internal';
import { SuperChatsEventMap, CommonSuperChatsEventEmitter, ConnectionState, WACallUpdateType, WAVersion } from '../Models';
export declare const Browsers: {
ubuntu: (browser: any) => [string, string, string];
macOS: (browser: any) => [string, string, string];
superchats: (browser: any) => [string, string, string];
/** The appropriate browser based on your OS & release */
appropriate: (browser: any) => [string, string, string];
};
export declare const BufferJSON: {
replacer: (k: any, value: any) => any;
reviver: (_: any, value: any) => any;
};
export declare const writeRandomPadMax16: (msg: Uint8Array) => Buffer;
export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array;
export declare const encodeWAMessage: (message: proto.IMessage) => Buffer;
export declare const generateRegistrationId: () => number;
export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array;
export declare const toNumber: (t: Long | number) => any;
export declare function shallowChanges(old: T, current: T, { lookForDeletedKeys }: {
lookForDeletedKeys: boolean;
}): Partial;
/** unix timestamp of a date in seconds */
export declare const unixTimestampSeconds: (date?: Date) => number;
export declare type DebouncedTimeout = ReturnType;
export declare const debouncedTimeout: (intervalMs?: number, task?: () => void) => {
start: (newIntervalMs?: number, newTask?: () => void) => void;
cancel: () => void;
setTask: (newTask: () => void) => () => void;
setInterval: (newInterval: number) => number;
};
export declare const delay: (ms: number) => Promise;
export declare const delayCancellable: (ms: number) => {
delay: Promise;
cancel: () => void;
};
export declare function promiseTimeout(ms: number, promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void): Promise;
export declare const generateMessageID: () => string;
export declare function bindWaitForEvent>(ev: CommonSuperChatsEventEmitter, event: T): (check: (u: SuperChatsEventMap[T]) => boolean, timeoutMs?: number) => Promise;
export declare const bindWaitForConnectionUpdate: (ev: CommonSuperChatsEventEmitter) => (check: (u: Partial) => boolean, timeoutMs?: number) => Promise;
export declare const printQRIfNecessaryListener: (ev: CommonSuperChatsEventEmitter, logger: Logger) => void;
/** unique message tag prefix for MD clients */
export declare const generateMdTagPrefix: () => string;
export declare const getStatusFromReceiptType: (type: string | undefined) => proto.WebMessageInfo.Status;
/**
* Stream errors generally provide a reason, map that to a SuperChats DisconnectReason
* @param reason the string reason given, eg. "conflict"
*/
export declare const getErrorCodeFromStreamError: (node: BinaryNode) => {
reason: string;
statusCode: number;
};
export declare const getCallStatusFromNode: ({ tag, attrs }: BinaryNode) => WACallUpdateType;
/**
* utility that fetches latest baileys version from the master branch.
* Use to ensure your WA connection is always on the latest version
*/
export declare const verifyVersion: () => Promise<{
version: WAVersion;
isLatest: boolean;
error?: undefined;
} | {
version: WAVersion;
isLatest: boolean;
error: any;
}>;