Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d_1.ts
2593 views
1
/// <reference types="node" />
2
import { proto } from '../../WAProto';
3
import { ChatModification, ChatMutation, LTHashState, WAPatchCreate, WAPatchName } from '../Types';
4
import { BinaryNode } from '../WABinary';
5
declare type FetchAppStateSyncKey = (keyId: string) => Promise<proto.IAppStateSyncKeyData> | proto.IAppStateSyncKeyData;
6
export declare const newLTHashState: () => LTHashState;
7
export declare const encodeSyncdPatch: ({ type, index, syncAction, apiVersion, operation }: WAPatchCreate, myAppStateKeyId: string, state: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey) => Promise<{
8
patch: proto.ISyncdPatch;
9
state: LTHashState;
10
}>;
11
export declare const decodeSyncdMutations: (msgMutations: (proto.ISyncdMutation | proto.ISyncdRecord)[], initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{
12
hash: Buffer;
13
indexValueMap: {
14
[indexMacBase64: string]: {
15
valueMac: Uint8Array | Buffer;
16
};
17
};
18
mutations: ChatMutation[];
19
}>;
20
export declare const decodeSyncdPatch: (msg: proto.ISyncdPatch, name: WAPatchName, initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{
21
hash: Buffer;
22
indexValueMap: {
23
[indexMacBase64: string]: {
24
valueMac: Uint8Array | Buffer;
25
};
26
};
27
mutations: ChatMutation[];
28
}>;
29
export declare const extractSyncdPatches: (result: BinaryNode) => Promise<{
30
critical_block: {
31
patches: proto.ISyncdPatch[];
32
hasMorePatches: boolean;
33
snapshot?: proto.ISyncdSnapshot;
34
};
35
critical_unblock_low: {
36
patches: proto.ISyncdPatch[];
37
hasMorePatches: boolean;
38
snapshot?: proto.ISyncdSnapshot;
39
};
40
regular_low: {
41
patches: proto.ISyncdPatch[];
42
hasMorePatches: boolean;
43
snapshot?: proto.ISyncdSnapshot;
44
};
45
regular_high: {
46
patches: proto.ISyncdPatch[];
47
hasMorePatches: boolean;
48
snapshot?: proto.ISyncdSnapshot;
49
};
50
regular: {
51
patches: proto.ISyncdPatch[];
52
hasMorePatches: boolean;
53
snapshot?: proto.ISyncdSnapshot;
54
};
55
}>;
56
export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference) => Promise<Buffer>;
57
export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference) => Promise<proto.SyncdMutations>;
58
export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean) => Promise<{
59
state: LTHashState;
60
mutations: ChatMutation[];
61
}>;
62
export declare const decodePatches: (name: WAPatchName, syncds: proto.ISyncdPatch[], initial: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber?: number, validateMacs?: boolean) => Promise<{
63
newMutations: ChatMutation[];
64
state: LTHashState;
65
}>;
66
export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate;
67
export {};
68
69