finalize multi-device

This commit is contained in:
Adhiraj Singh
2021-09-15 13:40:02 +05:30
parent 9cba28e891
commit f267f27ada
82 changed files with 35228 additions and 10644 deletions

View File

@@ -1,46 +1,30 @@
import type { proto } from "../../WAProto"
/** set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send */
export enum Presence {
unavailable = 'unavailable', // "offline"
available = 'available', // "online"
composing = 'composing', // "typing..."
recording = 'recording', // "recording..."
paused = 'paused', // stop typing
}
export type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'
export interface PresenceData {
lastKnownPresence: Presence
lastKnownPresence: WAPresence
lastSeen?: number
}
export interface Chat {
jid: string
t: number
/** number of unread messages, is < 0 if the chat is manually marked unread */
count: number
archive?: 'true' | 'false'
clear?: 'true' | 'false'
read_only?: 'true' | 'false'
mute?: string
pin?: string
spam?: 'false' | 'true'
modify_tag?: string
name?: string
/** when ephemeral messages were toggled on */
eph_setting_ts?: string
/** how long each message lasts for */
ephemeral?: string
export type Chat = Omit<proto.IConversation, 'messages'> & {
/** unix timestamp of date when mute ends, if applicable */
mute?: number | null
/** timestamp of when pinned */
pin?: number | null
archive?: boolean
}
export type ChatModification =
{ archive: boolean } |
{
/** pin at current timestamp, or provide timestamp of pin to remove */
pin: true | { remove: number }
pin: number | null
} |
{
/** mute for duration, or provide timestamp of mute to remove*/
mute: number | { remove: number }
mute: number | null
} |
{
clear: 'all' | { messages: { id: string, fromMe?: boolean }[] }
@@ -51,4 +35,7 @@ export type ChatModification =
star: boolean
}
} |
{
markRead: boolean
} |
{ delete: true }