Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d.ts
1129 views
1
/// <reference types="node" />
2
/// <reference types="node" />
3
/// <reference types="ws" />
4
import { LegacySocketConfig } from '../Types';
5
declare const makeLegacySocket: (config: Partial<LegacySocketConfig>) => {
6
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
7
getCatalog: (jid?: string | undefined, limit?: number) => Promise<{
8
beforeCursor: string;
9
products: import("../Types").Product[];
10
}>;
11
productCreate: (product: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
12
productDelete: (productIds: string[]) => Promise<{
13
deleted: any;
14
}>;
15
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
16
groupMetadata: (jid: string, minimal: boolean) => Promise<import("../Types").GroupMetadata>;
17
groupCreate: (title: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
18
groupLeave: (id: string) => Promise<void>;
19
groupUpdateSubject: (id: string, title: string) => Promise<void>;
20
groupUpdateDescription: (jid: string, description: string) => Promise<{
21
status: number;
22
}>;
23
groupParticipantsUpdate: (id: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
24
jid: string;
25
status: any;
26
}[]>;
27
getBroadcastListInfo: (jid: string) => Promise<import("../Types").GroupMetadata>;
28
groupInviteCode: (jid: string) => Promise<string>;
29
relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: {
30
waitForAck: boolean;
31
}) => Promise<void>;
32
waUploadToServer: import("../Types").WAMediaUploadFunction;
33
generateUrlInfo: (text: string) => Promise<import("../Types").WAUrlInfo>;
34
messageInfo: (jid: string, messageID: string) => Promise<import("../Types").WAProto.IUserReceipt[]>;
35
downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer", options?: import("..").MediaDownloadOptions) => Promise<Buffer | import("stream").Transform>;
36
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
37
fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor | undefined) => Promise<import("../Types").WAProto.WebMessageInfo[]>;
38
loadMessageFromWA: (jid: string, id: string) => Promise<import("../Types").WAProto.WebMessageInfo>;
39
searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{
40
last: boolean;
41
messages: import("../Types").WAProto.WebMessageInfo[];
42
}>;
43
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: {
44
messageId?: string | undefined;
45
cachedGroupMetadata?: ((jid: string) => Promise<import("../Types").GroupMetadataParticipants | undefined>) | undefined;
46
} & {
47
timestamp?: Date | undefined;
48
quoted?: import("../Types").WAProto.IWebMessageInfo | undefined;
49
ephemeralExpiration?: string | number | undefined;
50
mediaUploadTimeoutMs?: number | undefined;
51
} & {
52
waitForAck?: boolean | undefined;
53
}) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
54
sendChatsQuery: (epoch: number) => Promise<string>;
55
profilePictureUrl: (jid: string, timeoutMs?: number | undefined) => Promise<string | undefined>;
56
chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise<void>;
57
chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick<import("../Types").Chat, "mute" | "pin">, timestampNow?: number | undefined) => Promise<void | {
58
status: number;
59
}>;
60
onWhatsApp: (str: string) => Promise<{
61
exists: boolean;
62
jid: string;
63
isBusiness: boolean;
64
} | undefined>;
65
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<string>;
66
presenceSubscribe: (jid: string) => Promise<string>;
67
getStatus: (jid: string) => Promise<{
68
status: string;
69
}>;
70
setStatus: (status: string) => Promise<{
71
status: number;
72
}>;
73
updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise<void>;
74
updateProfileName: (name: string) => Promise<{
75
status: number;
76
pushname: string;
77
}>;
78
updateProfilePicture(jid: string, imgBuffer: Buffer): Promise<void>;
79
blockUser: (jid: string, type?: "add" | "remove") => Promise<void>;
80
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile>;
81
state: import("../Types").ConnectionState;
82
authInfo: import("../Types").LegacyAuthenticationCreds;
83
ev: import("../Types").LegacyBaileysEventEmitter;
84
canLogin: () => boolean;
85
logout: () => Promise<void>;
86
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
87
type: "legacy";
88
ws: import("ws");
89
sendAdminTest: () => Promise<string>;
90
updateKeys: (info: {
91
encKey: Buffer;
92
macKey: Buffer;
93
}) => {
94
encKey: Buffer;
95
macKey: Buffer;
96
};
97
waitForSocketOpen: () => Promise<void>;
98
sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise<string>;
99
generateMessageTag: (longTag?: boolean) => string;
100
waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number | undefined) => {
101
promise: Promise<any>;
102
cancelToken: () => void;
103
};
104
query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise<any>;
105
setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string | undefined) => Promise<{
106
status: number;
107
}>;
108
currentEpoch: () => number;
109
end: (error: Error | undefined) => void;
110
};
111
export default makeLegacySocket;
112
113