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