Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@adiwajshing/baileys/lib/Socket/chats.d.ts
1129 views
1
/// <reference types="ws" />
2
/// <reference types="node" />
3
import { proto } from '../../WAProto';
4
import { ChatModification, InitialReceivedChatsState, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence } from '../Types';
5
import { BinaryNode } from '../WABinary';
6
export declare const makeChatsSocket: (config: SocketConfig) => {
7
processingMutex: {
8
mutex<T>(code: () => T | Promise<T>): Promise<T>;
9
};
10
fetchPrivacySettings: (force?: boolean) => Promise<{
11
[_: string]: string;
12
}>;
13
upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>;
14
appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
15
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
16
presenceSubscribe: (toJid: string) => Promise<void>;
17
profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | undefined>;
18
onWhatsApp: (...jids: string[]) => Promise<{
19
exists: boolean;
20
jid: string;
21
}[]>;
22
fetchBlocklist: () => Promise<string[]>;
23
fetchStatus: (jid: string) => Promise<{
24
status: string | undefined;
25
setAt: Date;
26
} | undefined>;
27
updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
28
updateProfileStatus: (status: string) => Promise<void>;
29
updateProfileName: (name: string) => Promise<void>;
30
updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>;
31
getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
32
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], recvChats: InitialReceivedChatsState | undefined) => Promise<void>;
33
chatModify: (mod: ChatModification, jid: string) => Promise<void>;
34
resyncMainAppState: (ctx?: InitialReceivedChatsState) => Promise<void>;
35
type: "md";
36
ws: import("ws");
37
ev: import("../Types").BaileysEventEmitter & {
38
process(handler: (events: Partial<import("../Types").BaileysEventMap<import("../Types").AuthenticationCreds>>) => void | Promise<void>): () => void;
39
buffer(): boolean;
40
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
41
flush(): Promise<void>;
42
processInBuffer(task: Promise<any>): any;
43
};
44
authState: {
45
creds: import("../Types").AuthenticationCreds;
46
keys: import("../Types").SignalKeyStoreWithTransaction;
47
};
48
user: import("../Types").Contact | undefined;
49
generateMessageTag: () => string;
50
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
51
waitForMessage: (msgId: string, timeoutMs?: number | undefined) => Promise<any>;
52
waitForSocketOpen: () => Promise<void>;
53
sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>;
54
sendNode: (frame: BinaryNode) => Promise<void>;
55
logout: () => Promise<void>;
56
end: (error: Error | undefined) => void;
57
onUnexpectedError: (error: Error, msg: string) => void;
58
uploadPreKeys: (count?: number) => Promise<void>;
59
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
60
};
61
62