Merge branch 'master' into master

This commit is contained in:
Samuel Scheit
2023-05-12 18:06:19 +02:00
committed by GitHub
13 changed files with 2600 additions and 230 deletions

View File

@@ -3,6 +3,13 @@ import type { AccountSettings } from './Auth'
import type { BufferedEventData } from './Events'
import type { MinimalMessage } from './Message'
/** privacy settings in WhatsApp Web */
export type WAPrivacyValue = 'all' | 'contacts' | 'contact_blacklist' | 'none'
export type WAPrivacyOnlineValue = 'all' | 'match_last_seen'
export type WAReadReceiptsValue = 'all' | 'none'
/** set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send */
export type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'

View File

@@ -55,6 +55,7 @@ type Mentionable = {
type ViewOnce = {
viewOnce?: boolean
}
type Buttonable = {
/** add buttons to the message */
buttons?: proto.Message.ButtonsMessage.IButton[]
@@ -65,6 +66,9 @@ type Templatable = {
footer?: string
}
type Editable = {
edit?: WAMessageKey
}
type Listable = {
/** Sections of the List */
sections?: proto.Message.ListMessage.ISection[]
@@ -117,7 +121,7 @@ export type AnyMediaMessageContent = (
fileName?: string
caption?: string
} & Buttonable & Templatable))
& { mimetype?: string }
& { mimetype?: string } & Editable
export type ButtonReplyInfo = {
displayText: string
@@ -134,11 +138,11 @@ export type AnyRegularMessageContent = (
text: string
linkPreview?: WAUrlInfo | null
}
& Mentionable & Buttonable & Templatable & Listable)
& Mentionable & Buttonable & Templatable & Listable & Editable)
| AnyMediaMessageContent
| ({
poll: PollMessageOptions
} & Mentionable & Buttonable & Templatable)
} & Mentionable & Buttonable & Templatable & Editable)
| {
contacts: {
displayName?: string