Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DikaArdnt committed Dec 6, 2023
1 parent 2a1c5d0 commit 0447363
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 293 deletions.
74 changes: 36 additions & 38 deletions docs/Client.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,39 +458,37 @@ <h1>Source: Client.js</h1>
});
}, Events);

if (isAuthenticated &#x3D;&#x3D;&#x3D; true) {
await this.playPage.evaluate((Events) &#x3D;&gt; {
window.WPP.on(&#x27;conn.main_ready&#x27;, async () &#x3D;&gt; {
window.WPP.whatsapp.MsgStore.on(&#x27;change&#x27;, (msg) &#x3D;&gt; { window.onChangeMessageEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:type&#x27;, (msg) &#x3D;&gt; { window.onChangeMessageTypeEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:ack&#x27;, (msg, ack) &#x3D;&gt; { window.onMessageAckEvent(window.WAJS.getMessageModel(msg), ack); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:isUnsentMedia&#x27;, (msg, unsent) &#x3D;&gt; { if (msg.id.fromMe &amp;amp;&amp;amp; !unsent) window.onMessageMediaUploadedEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;remove&#x27;, (msg) &#x3D;&gt; { if (msg.isNewMsg) window.onRemoveMessageEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:caption&#x27;, (msg, newBody, prevBody) &#x3D;&gt; { window.onEditMessageEvent(window.WAJS.getMessageModel(msg), newBody, prevBody); });
window.WPP.whatsapp.Socket.on(&#x27;change:state&#x27;, (_AppState, state) &#x3D;&gt; { window.onAppStateChangedEvent(state); });
window.WPP.whatsapp.CallStore.on(&#x27;add&#x27;, (call) &#x3D;&gt; { window.onIncomingCall(call); });
window.WPP.whatsapp.ChatStore.on(&#x27;remove&#x27;, async (chat) &#x3D;&gt; { window.onRemoveChatEvent(await window.WAJS.getChatModel(chat)); });
window.WPP.whatsapp.ChatStore.on(&#x27;change:archive&#x27;, async (chat, currState, prevState) &#x3D;&gt; { window.onArchiveChatEvent(await window.WAJS.getChatModel(chat), currState, prevState); });
window.WPP.on(&#x27;chat.new_message&#x27;, (msg) &#x3D;&gt; {
if (msg.isNewMsg) {
if (msg.type &#x3D;&#x3D;&#x3D; &#x27;ciphertext&#x27;) {
// defer message event until ciphertext is resolved (type changed)
msg.once(&#x27;change:type&#x27;, (_msg) &#x3D;&gt; window.onAddMessageEvent(window.WAJS.getMessageModel(_msg)));
} else {
window.onAddMessageEvent(window.WAJS.getMessageModel(msg));
}
await this.playPage.evaluate((Events) &#x3D;&gt; {
window.WPP.on(&#x27;conn.main_ready&#x27;, async () &#x3D;&gt; {
window.WPP.whatsapp.MsgStore.on(&#x27;change&#x27;, (msg) &#x3D;&gt; { window.onChangeMessageEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:type&#x27;, (msg) &#x3D;&gt; { window.onChangeMessageTypeEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:ack&#x27;, (msg, ack) &#x3D;&gt; { window.onMessageAckEvent(window.WAJS.getMessageModel(msg), ack); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:isUnsentMedia&#x27;, (msg, unsent) &#x3D;&gt; { if (msg.id.fromMe &amp;amp;&amp;amp; !unsent) window.onMessageMediaUploadedEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;remove&#x27;, (msg) &#x3D;&gt; { if (msg.isNewMsg) window.onRemoveMessageEvent(window.WAJS.getMessageModel(msg)); });
window.WPP.whatsapp.MsgStore.on(&#x27;change:caption&#x27;, (msg, newBody, prevBody) &#x3D;&gt; { window.onEditMessageEvent(window.WAJS.getMessageModel(msg), newBody, prevBody); });
window.WPP.whatsapp.Socket.on(&#x27;change:state&#x27;, (_AppState, state) &#x3D;&gt; { window.onAppStateChangedEvent(state); });
window.WPP.whatsapp.CallStore.on(&#x27;add&#x27;, (call) &#x3D;&gt; { window.onIncomingCall(call); });
window.WPP.whatsapp.ChatStore.on(&#x27;remove&#x27;, async (chat) &#x3D;&gt; { window.onRemoveChatEvent(await window.WAJS.getChatModel(chat)); });
window.WPP.whatsapp.ChatStore.on(&#x27;change:archive&#x27;, async (chat, currState, prevState) &#x3D;&gt; { window.onArchiveChatEvent(await window.WAJS.getChatModel(chat), currState, prevState); });
window.WPP.on(&#x27;chat.new_message&#x27;, (msg) &#x3D;&gt; {
if (msg.isNewMsg) {
if (msg.type &#x3D;&#x3D;&#x3D; &#x27;ciphertext&#x27;) {
// defer message event until ciphertext is resolved (type changed)
msg.once(&#x27;change:type&#x27;, (_msg) &#x3D;&gt; window.onAddMessageEvent(window.WAJS.getMessageModel(_msg)));
} else {
window.onAddMessageEvent(window.WAJS.getMessageModel(msg));
}
});
window.WPP.whatsapp.ChatStore.on(&#x27;change:unreadCount&#x27;, async (chat) &#x3D;&gt; { window.onChatUnreadCountEvent(await window.WAJS.getChatModel(chat)); });

window.WPP.on(&#x27;chat.new_reaction&#x27;, (reaction) &#x3D;&gt; {
window.onReaction([reaction]);
});

window.EmitEvent(Events.READY);
}
});
}, Events);
}
window.WPP.whatsapp.ChatStore.on(&#x27;change:unreadCount&#x27;, async (chat) &#x3D;&gt; { window.onChatUnreadCountEvent(await window.WAJS.getChatModel(chat)); });

window.WPP.on(&#x27;chat.new_reaction&#x27;, (reaction) &#x3D;&gt; {
window.onReaction([reaction]);
});

window.EmitEvent(Events.READY);
});
}, Events);

await this.playPage.evaluate((Events) &#x3D;&gt; {
window.WPP.whatsapp.Cmd.on(&#x27;logout&#x27;, () &#x3D;&gt; window.EmitEvent(Events.DISCONNECTED, &#x27;NAVIGATION&#x27;));
Expand Down Expand Up @@ -604,12 +602,12 @@ <h1>Source: Client.js</h1>
if (content instanceof MessageMedia) {
internalOptions.attachment &#x3D; content;
internalOptions.isViewOnce &#x3D; options.isViewOnce,
content &#x3D; &#x27;&#x27;;
content &#x3D; &#x27;&#x27;;
} else if (options.media instanceof MessageMedia) {
internalOptions.attachment &#x3D; options.media;
internalOptions.caption &#x3D; content;
internalOptions.isViewOnce &#x3D; options.isViewOnce,
content &#x3D; &#x27;&#x27;;
content &#x3D; &#x27;&#x27;;
} else if (content instanceof Location) {
internalOptions.location &#x3D; content;
content &#x3D; &#x27;&#x27;;
Expand All @@ -627,11 +625,11 @@ <h1>Source: Client.js</h1>
if (internalOptions.sendMediaAsSticker &amp;amp;&amp;amp; internalOptions.attachment) {
internalOptions.attachment &#x3D; await Util.formatToWebpSticker(
internalOptions.attachment, {
name: options.stickerName,
author: options.stickerAuthor,
categories: options.stickerCategories,
isAvatarSticker: options.stickerIsAvatar,
}, this.playPage
name: options.stickerName,
author: options.stickerAuthor,
categories: options.stickerCategories,
isAvatarSticker: options.stickerIsAvatar,
}, this.playPage
);
}

Expand Down
128 changes: 8 additions & 120 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ <h2 class="summary-callout-heading">Abstract types</h2>
<dt><a href="global.html#AddParticipnatsOptions">AddParticipnatsOptions</a></dt>
<dd>
</dd>
<dt><a href="global.html#ButtonSpec">ButtonSpec</a></dt>
<dd>
</dd>
<dt><a href="global.html#ContactId">ContactId</a></dt>
<dd>
</dd>
Expand All @@ -86,19 +83,16 @@ <h2 class="summary-callout-heading">Abstract types</h2>
<dt><a href="global.html#CreateGroupResult">CreateGroupResult</a></dt>
<dd>
</dd>
<dt><a href="global.html#FormattedButtonSpec">FormattedButtonSpec</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="global.html#GroupMembershipRequest">GroupMembershipRequest</a></dt>
<dd>
</dd>
<dt><a href="global.html#GroupMembershipRequest">GroupMembershipRequest</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="global.html#GroupParticipant">GroupParticipant</a></dt>
<dd>
</dd>
Expand All @@ -114,16 +108,16 @@ <h2 class="summary-callout-heading">Abstract types</h2>
<dt><a href="global.html#MembershipRequestActionResult">MembershipRequestActionResult</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="global.html#MembershipRequestActionResult">MembershipRequestActionResult</a></dt>
<dd>
</dd>
<dt><a href="global.html#MessageInfo">MessageInfo</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="global.html#MessageSendOptions">MessageSendOptions</a></dt>
<dd>
</dd>
Expand Down Expand Up @@ -1685,54 +1679,6 @@ <h4>Properties</h4>
</section>
<dl class="dl-compact">
</dl>
<h3 id="ButtonSpec"><span class="symbol-name">ButtonSpec</span><small class="property-type">
&nbsp;Object</small></h3>
<p>Button spec used in Buttons constructor</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>id</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Custom ID to set on the button. A random one will be generated if one is not passed.</p>
</td>
</tr>
<tr>
<td>
<p>body</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
<p>The text to show on the button.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="ContactId"><span class="symbol-name">ContactId</span><small class="property-type">
&nbsp;Object</small></h3>
<p>ID that represents a contact</p>
Expand Down Expand Up @@ -1985,64 +1931,6 @@ <h4>Properties</h4>
</section>
<dl class="dl-compact">
</dl>
<h3 id="FormattedButtonSpec"><span class="symbol-name">FormattedButtonSpec</span><small class="property-type">
&nbsp;Object</small></h3>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>buttonId</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>type</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>buttonText</p>
</td>
<td>
<p>Object</p>
</td>
<td>
<p>&nbsp;</p>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<h3 id="GroupMembershipRequest"><span class="symbol-name">GroupMembershipRequest</span><small class="property-type">
&nbsp;Object</small></h3>
<p>An object that handles the information about the group membership request</p>
Expand Down
103 changes: 0 additions & 103 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,55 +359,6 @@ <h2 id="BusinessContact">BusinessContact</h2>
</div>
</div>
</section>
<section>
<div class="symbol-index-content">
<h2 id="Buttons">Buttons</h2>
<div class="symbol-index-section">
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="Buttons.html" class="!symbol-index-name">Buttons(body, buttons, title, footer)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Buttons.html#_format" class="!symbol-index-name">Buttons#<wbr>_format(buttons)</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="Buttons.html#body" class="!symbol-index-name">Buttons#<wbr>body</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Buttons.html#buttons" class="!symbol-index-name">Buttons#<wbr>buttons</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="Buttons.html#footer" class="!symbol-index-name">Buttons#<wbr>footer</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="Buttons.html#title" class="!symbol-index-name">Buttons#<wbr>title</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
</div>
</section>
<section>
<div class="symbol-index-content">
<h2 id="Call">Call</h2>
Expand Down Expand Up @@ -1866,60 +1817,6 @@ <h2 id="Label">Label</h2>
</div>
</div>
</section>
<section>
<div class="symbol-index-content">
<h2 id="List">List</h2>
<div class="symbol-index-section">
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="List.html" class="!symbol-index-name">List(body, buttonText, sections, title, footer)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="List.html#_format" class="!symbol-index-name">List#<wbr>_format(sections)</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="List.html#buttonText" class="!symbol-index-name">List#<wbr>buttonText</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="List.html#description" class="!symbol-index-name">List#<wbr>description</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="List.html#footer" class="!symbol-index-name">List#<wbr>footer</a>
</dt>
<dd>
</dd>
<dt class="symbol-index-name">
<a href="List.html#sections" class="!symbol-index-name">List#<wbr>sections</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="symbol-index-column">
<dl class="symbol-index-list">
<dt class="symbol-index-name">
<a href="List.html#title" class="!symbol-index-name">List#<wbr>title</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
</div>
</section>
<section>
<div class="symbol-index-content">
<h2 id="Location">Location</h2>
Expand Down
Loading

0 comments on commit 0447363

Please sign in to comment.