Skip to content

Interface: ComposerApi ​

Writing into the composer, never sending.

Properties ​

insertDraft ​

readonly insertDraft: (text) => Promise<void>

Puts text in the open chat's composer for the user to edit and send. Needs composer:insert-draft.

Parameters ​

text ​

string

Returns ​

Promise<void>


readDraft ​

readonly readDraft: () => Promise<string | null>

What the user typed in the open chat's composer so far, or null when no chat is open. Needs composer:read-draft.

Returns ​

Promise<string | null>


replaceDraft ​

readonly replaceDraft: (text) => Promise<void>

Replaces what the user typed in the open chat's composer with text, as a rewritten draft for them to edit and send. Needs composer:insert-draft.

Parameters ​

text ​

string

Returns ​

Promise<void>

Released under the MIT License. Development supported by Ensita. YapYap is unofficial and not affiliated with WhatsApp or Meta.