Path: blob/master/node_modules/@adiwajshing/baileys/lib/Utils/signal.d_1.ts
2593 views
/// <reference types="node" />1import { proto } from '../../WAProto';2import { AuthenticationCreds, KeyPair, SignalAuthState, SignalIdentity, SignalKeyStore, SignedKeyPair } from '../Types/Auth';3import { BinaryNode, JidWithDevice } from '../WABinary';4export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => Buffer;5export declare const jidToSignalProtocolAddress: (jid: string) => any;6export declare const jidToSignalSenderKeyName: (group: string, user: string) => string;7export declare const createSignalIdentity: (wid: string, accountSignatureKey: Uint8Array) => SignalIdentity;8export declare const getPreKeys: ({ get }: SignalKeyStore, min: number, limit: number) => Promise<{9[id: string]: KeyPair;10}>;11export declare const generateOrGetPreKeys: (creds: AuthenticationCreds, range: number) => {12newPreKeys: {13[id: number]: KeyPair;14};15lastPreKeyId: number;16preKeysRange: readonly [number, number];17};18export declare const xmppSignedPreKey: (key: SignedKeyPair) => BinaryNode;19export declare const xmppPreKey: (pair: KeyPair, id: number) => BinaryNode;20export declare const signalStorage: ({ creds, keys }: SignalAuthState) => {21loadSession: (id: string) => Promise<any>;22storeSession: (id: any, session: any) => Promise<void>;23isTrustedIdentity: () => boolean;24loadPreKey: (id: number | string) => Promise<{25privKey: Buffer;26pubKey: Buffer;27}>;28removePreKey: (id: number) => void | Promise<void>;29loadSignedPreKey: (keyId: number) => {30privKey: Buffer;31pubKey: Buffer;32};33loadSenderKey: (keyId: string) => Promise<any>;34storeSenderKey: (keyId: any, key: any) => Promise<void>;35getOurRegistrationId: () => number;36getOurIdentity: () => {37privKey: Buffer;38pubKey: Buffer;39};40};41export declare const decryptGroupSignalProto: (group: string, user: string, msg: Buffer | Uint8Array, auth: SignalAuthState) => any;42export declare const processSenderKeyMessage: (authorJid: string, item: proto.ISenderKeyDistributionMessage, auth: SignalAuthState) => Promise<void>;43export declare const decryptSignalProto: (user: string, type: 'pkmsg' | 'msg', msg: Buffer | Uint8Array, auth: SignalAuthState) => Promise<Buffer>;44export declare const encryptSignalProto: (user: string, buffer: Buffer, auth: SignalAuthState) => Promise<{45type: string;46ciphertext: Buffer;47}>;48export declare const encryptSenderKeyMsgSignalProto: (group: string, data: Uint8Array | Buffer, meId: string, auth: SignalAuthState) => Promise<{49ciphertext: Uint8Array;50senderKeyDistributionMessageKey: Buffer;51}>;52export declare const parseAndInjectE2ESessions: (node: BinaryNode, auth: SignalAuthState) => Promise<void>;53export declare const extractDeviceJids: (result: BinaryNode, myJid: string, excludeZeroDevices: boolean) => JidWithDevice[];545556