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

93 lines (92 loc) 5.18 kB
/// <reference types="node" /> import { proto } from '../enc'; import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../../Models'; import { BinaryNode } from '../../Internal'; export declare const makeChatsSocket: (config: SocketConfig) => { processingMutex: { mutex<T>(code: () => T | Promise<T>): Promise<T>; }; fetchPrivacySettings: (force?: boolean) => Promise<{ [_: string]: string; }>; upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>; appPatch: (patchCreate: WAPatchCreate) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>; profilePictureUrl: (jid: any, type?: string, timeoutMs?: number) => Promise<any>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string; }[]>; fetchBlocklist: () => Promise<string[]>; fetchStatus: (jid: string) => Promise<{ status: string | undefined; setAt: Date; } | undefined>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; removeProfilePicture: (jid: string) => Promise<void>; updateProfileStatus: (status: string) => Promise<void>; updateProfileName: (name: string) => Promise<void>; updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>; updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>; updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>; updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>; updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>; updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>; updateGroupsAddPrivacy: (value: WAPrivacyValue) => Promise<void>; updateDefaultDisappearingMode: (duration: number) => Promise<void>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>; resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>; chatModify: (mod: ChatModification, jid: string) => Promise<void>; cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>; addChatLabel: (jid: string, labelId: string) => Promise<void>; removeChatLabel: (jid: string, labelId: string) => Promise<void>; addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>; removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>; logout: (msg?: string | undefined) => Promise<void>; end: (error: Error | undefined, qr?: boolean) => void; /** * Adds label for the message */ onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void; uploadPreKeys: (count?: number) => Promise<void>; uploadPreKeysToServerIfRequired: () => Promise<void>; requestPairingCode: (phoneNumber: string) => Promise<string>; waitForConnectionUpdate: (check: (u: Partial<import("../../Models").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>; addInfoObjects: (name: any, extend: any) => boolean; getUser: (name: any) => any; checkAddUser: (name: any) => boolean; checkUser: (name: any) => boolean; sessionsDir: (sessionId?: string | undefined, dir?: string) => string; checkSession: (name: any) => boolean; getSessionKey: (name: any) => string | false; searchObjects: (phone: any) => any; getAll: () => any; checkClient: (name: any) => boolean; deleteToken: (name: any) => boolean; deleteSession: (name: any) => boolean; removeInfoObjects: (name: any, key: any) => boolean; type: "md"; ws: any; ev: import("../../Models").OrkestralEventEmitter & { process(handler: (events: Partial<import("../../Models").OrkestralEventMap>) => void | Promise<void>): () => void; buffer(): void; createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>; /** helper function to fetch the given app state sync key */ flush(force?: boolean | undefined): boolean; isBuffering(): boolean; }; authState: { creds: import("../../Models").AuthenticationCreds; keys: import("../../Models").SignalKeyStoreWithTransaction; }; signalRepository: import("../../Models").SignalRepository; user: import("../../Models").Contact | undefined; generateMessageTag: () => string; query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>; waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>; waitForSocketOpen: () => Promise<void>; sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>; sendNode: (frame: BinaryNode) => Promise<void>; close: () => void; };