UNPKG

baileys-mod

Version:

Custom Baileys WhatsApp API

21 lines (20 loc) 998 B
import { ILogger } from './logger'; import { proto } from '../../WAProto'; import { KeyPair } from '../Types'; import { BinaryNode } from '../WABinary'; export declare const makeNoiseHandler: ({ keyPair: { private: privateKey, public: publicKey }, NOISE_HEADER, mobile, logger, routingInfo }: { keyPair: KeyPair; NOISE_HEADER: Uint8Array; mobile: boolean; logger: ILogger; routingInfo?: Buffer | undefined; }) => { encrypt: (plaintext: Uint8Array) => Buffer<ArrayBuffer>; decrypt: (ciphertext: Uint8Array) => Buffer<ArrayBuffer>; authenticate: (data: Uint8Array) => void; mixIntoKey: (data: Uint8Array) => Promise<void>; finishInit: () => Promise<void>; processHandshake: ({ serverHello }: proto.HandshakeMessage, noiseKey: KeyPair) => Promise<Buffer<ArrayBuffer>>; encodeFrame: (data: Buffer | Uint8Array) => Buffer<ArrayBuffer>; decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: Uint8Array | BinaryNode) => void) => Promise<void>; };