import type { proto } from "../../WAProto"; import type { AccountSettings } from "./Auth"; import type { BufferedEventData } from "./Events"; import type { MinimalMessage } from "./Message"; /** privacy settings in WhatsApp Web */ export declare type WAPrivacyValue = "all" | "contacts" | "contact_blacklist" | "none"; export declare type WAPrivacyOnlineValue = "all" | "match_last_seen"; export declare type WAPrivacyGroupAddValue = "all" | "contacts" | "contact_blacklist"; export declare type WAReadReceiptsValue = "all" | "none"; export declare type WAPrivacyCallValue = "all" | "known"; export declare type WAPrivacyMessagesValue = "all" | "contacts"; /** set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send */ export declare type WAPresence = "unavailable" | "available" | "composing" | "recording" | "paused"; export declare const ALL_WA_PATCH_NAMES: readonly ["critical_block", "critical_unblock_low", "regular_high", "regular_low", "regular"]; export declare type WAPatchName = (typeof ALL_WA_PATCH_NAMES)[number]; export interface PresenceData { lastKnownPresence: WAPresence; lastSeen?: number; } export declare type ChatMutation = { syncAction: proto.ISyncActionData; index: string[]; }; export declare type WAPatchCreate = { syncAction: proto.ISyncActionValue; index: string[]; type: WAPatchName; apiVersion: number; operation: proto.SyncdMutation.SyncdOperation; }; export declare type Chat = proto.IConversation & { /** unix timestamp of when the last message was received in the chat */ lastMessageRecvTimestamp?: number; }; export declare type ChatUpdate = Partial boolean | undefined; }>; /** * the last messages in a chat, sorted reverse-chronologically. That is, the latest message should be first in the chat * for MD modifications, the last message in the array (i.e. the earlist message) must be the last message recv in the chat * */ export declare type LastMessageList = MinimalMessage[] | proto.SyncActionValue.ISyncActionMessageRange; export declare type VoteAggregation = { name: string; voters: string[]; }; /** Association type */ export declare enum LabelAssociationType { Chat = "label_jid", Message = "label_message" } export declare type LabelAssociationTypes = `${LabelAssociationType}`; /** Association for chat */ export interface ChatLabelAssociation { type: LabelAssociationType.Chat; chatId: string; labelId: string; } /** Association for message */ export interface MessageLabelAssociation { type: LabelAssociationType.Message; chatId: string; messageId: string; labelId: string; } export declare type LabelAssociation = ChatLabelAssociation | MessageLabelAssociation; /** Body for add/remove chat label association action */ export interface ChatLabelAssociationActionBody { labelId: string; } /** body for add/remove message label association action */ export interface MessageLabelAssociationActionBody { labelId: string; messageId: string; } export interface Label { id: string; name: string; color: number; predefinedId: number; deleted: boolean; } export declare type ChatModification = { archive: boolean; lastMessages: LastMessageList; } | { pushNameSetting: string; } | { pin: boolean; } | { /** mute for duration, or provide timestamp of mute to remove*/ mute: number | null; } | { clear: "all" | { messages: { id: string; fromMe?: boolean; timestamp: number; }[]; }; } | { star: { messages: { id: string; fromMe?: boolean; }[]; star: boolean; }; } | { markRead: boolean; lastMessages: LastMessageList; } | { delete: true; lastMessages: LastMessageList; } | { /** contact action (create/edit/remove contact in app state) */ contact: proto.SyncActionValue.IContactAction | null; } | { addLabel: { name: string; color: number; predefinedId: number; deleted: boolean; id: string; }; } | { addChatLabel: { labelId: string; }; } | { removeChatLabel: { labelId: string; }; } | { addMessageLabel: { labelId: string; messageId: string; }; } | { removeMessageLabel: { labelId: string; messageId: string; }; }; export declare type InitialReceivedChatsState = { [jid: string]: { /** the last message received from the other party */ lastMsgRecvTimestamp?: number; /** the absolute last message in the chat */ lastMsgTimestamp: number; }; }; export declare type InitialAppStateSyncOptions = { accountSettings: AccountSettings; };