Path: blob/master/node_modules/@adiwajshing/baileys/lib/Socket/groups.d.ts
1129 views
/// <reference types="ws" />1/// <reference types="node" />2import { proto } from '../../WAProto';3import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';4import { BinaryNode } from '../WABinary';5export declare const makeGroupsSocket: (config: SocketConfig) => {6groupMetadata: (jid: string) => Promise<GroupMetadata>;7groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;8groupLeave: (id: string) => Promise<void>;9groupUpdateSubject: (jid: string, subject: string) => Promise<void>;10groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{11status: string;12jid: string;13}[]>;14groupUpdateDescription: (jid: string, description?: string) => Promise<void>;15groupInviteCode: (jid: string) => Promise<string | undefined>;16groupRevokeInvite: (jid: string) => Promise<string | undefined>;17groupAcceptInvite: (code: string) => Promise<string | undefined>;18/**19* accept a GroupInviteMessage20* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite21* @param inviteMessage the message to accept22*/23groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;24groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;25groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;26groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;27groupFetchAllParticipating: () => Promise<{28[_: string]: GroupMetadata;29}>;30processingMutex: {31mutex<T>(code: () => T | Promise<T>): Promise<T>;32};33fetchPrivacySettings: (force?: boolean) => Promise<{34[_: string]: string;35}>;36upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;37appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;38sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;39presenceSubscribe: (toJid: string) => Promise<void>;40profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;41onWhatsApp: (...jids: string[]) => Promise<{42exists: boolean;43jid: string;44}[]>;45fetchBlocklist: () => Promise<string[]>;46fetchStatus: (jid: string) => Promise<{47status: string | undefined;48setAt: Date;49} | undefined>;50updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;51updateProfileStatus: (status: string) => Promise<void>;52updateProfileName: (name: string) => Promise<void>;53updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;54getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;55resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], recvChats: import("../Types").InitialReceivedChatsState | undefined) => Promise<void>;56chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;57resyncMainAppState: (ctx?: import("../Types").InitialReceivedChatsState | undefined) => Promise<void>;58type: "md";59ws: import("ws");60ev: import("../Types").BaileysEventEmitter & {61process(handler: (events: Partial<import("../Types").BaileysEventMap<import("../Types").AuthenticationCreds>>) => void | Promise<void>): () => void;62buffer(): boolean;63createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;64flush(): Promise<void>;65processInBuffer(task: Promise<any>): any;66};67authState: {68creds: import("../Types").AuthenticationCreds;69keys: import("../Types").SignalKeyStoreWithTransaction;70};71user: import("../Types").Contact | undefined;72generateMessageTag: () => string;73query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;74waitForMessage: (msgId: string, timeoutMs?: number | undefined) => Promise<any>;75waitForSocketOpen: () => Promise<void>;76sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>;77sendNode: (frame: BinaryNode) => Promise<void>;78logout: () => Promise<void>;79end: (error: Error | undefined) => void;80onUnexpectedError: (error: Error, msg: string) => void;81uploadPreKeys: (count?: number) => Promise<void>;82waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;83};84export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;858687