UNPKG

superchats

Version:

SuperChats is a premium library with unique features that control Whatsapp functions. With Superchats you can build service bots, multiservice chats or any system that uses whatsapp

58 lines (57 loc) 1.56 kB
import { proto } from '../Connection/enc'; type DecryptGroupSignalOpts = { group: string; authorJid: string; msg: Uint8Array; }; type ProcessSenderKeyDistributionMessageOpts = { item: proto.Message.ISenderKeyDistributionMessage; authorJid: string; }; type DecryptSignalProtoOpts = { jid: string; type: 'pkmsg' | 'msg'; ciphertext: Uint8Array; }; type EncryptMessageOpts = { jid: string; data: Uint8Array; }; type EncryptGroupMessageOpts = { group: string; data: Uint8Array; meId: string; }; type PreKey = { keyId: number; publicKey: Uint8Array; }; type SignedPreKey = PreKey & { signature: Uint8Array; }; type E2ESession = { registrationId: number; identityKey: Uint8Array; signedPreKey: SignedPreKey; preKey: PreKey; }; type E2ESessionOpts = { jid: string; session: E2ESession; }; export type SignalRepository = { decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>; processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>; decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>; encryptMessage(opts: EncryptMessageOpts): Promise<{ type: 'pkmsg' | 'msg'; ciphertext: Uint8Array; }>; encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{ senderKeyDistributionMessage: Uint8Array; ciphertext: Uint8Array; }>; injectE2ESession(opts: E2ESessionOpts): Promise<void>; jidToSignalProtocolAddress(jid: string): string; }; export {};