Skip to content

Commit

Permalink
docs: 📝 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardDorian committed Jul 7, 2022
1 parent 9ae6e79 commit 74465e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/classes/BufWrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,35 +101,35 @@ <h3 class="tsd-anchor-link"><span>buffer</span><a href="#buffer" aria-label="Per
<div class="tsd-comment tsd-typography"><p>The wrapped NodeJS buffer</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L7">index.ts:7</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L7">index.ts:7</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="buffers" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>buffers</span><a href="#buffers" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">buffers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-comment tsd-typography"><p>List of buffers, used for the <code>oneConcat</code> option</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L22">index.ts:22</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L22">index.ts:22</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="offset" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>offset</span><a href="#offset" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">offset<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<div class="tsd-comment tsd-typography"><p>Current offset (used for reading)</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L11">index.ts:11</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L11">index.ts:11</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="options" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>options</span><a href="#options" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">options<span class="tsd-signature-symbol">?:</span> <a href="../interfaces/BufWrapperOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BufWrapperOptions</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">Plugins</span><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-comment tsd-typography"><p>Options that apply to the current <code>BufWrapper</code> instance</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L15">index.ts:15</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L15">index.ts:15</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="plugins" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>plugins</span><a href="#plugins" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">plugins<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type" data-tsd-kind="Type parameter">Plugins</span></div>
<div class="tsd-comment tsd-typography"><p>Installed plugins so you can access them from this object</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L19">index.ts:19</a></li></ul></aside></section></section>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L19">index.ts:19</a></li></ul></aside></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="finish" class="tsd-anchor"></a>
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ <h2>Note on the speed</h2>
what I got on my computer when writing 150,000 integers</p>
<pre><code><span class="hl-7">$</span><span class="hl-0"> </span><span class="hl-7">node</span><span class="hl-0"> </span><span class="hl-7">test</span><span class="hl-0">/</span><span class="hl-7">time</span><span class="hl-0">.</span><span class="hl-7">js</span><br/><span class="hl-7">oneConcat</span><span class="hl-0"> = </span><span class="hl-9">false</span><span class="hl-0"> : 7.261</span><span class="hl-7">s</span><br/><span class="hl-7">oneConcat</span><span class="hl-0"> = </span><span class="hl-9">true</span><span class="hl-0"> : 63.869</span><span class="hl-7">ms</span>
</code></pre>
<p>See more here: <a href="https://minecraftjs.github.io/BufWrapper/">https://minecraftjs.github.io/BufWrapper/</a></p>
</div></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
Expand Down
6 changes: 3 additions & 3 deletions docs/interfaces/BufWrapperOptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code
to the buffer.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L466">index.ts:466</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L479">index.ts:479</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="plugins" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>plugins</span><a href="#plugins" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">plugins<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type" data-tsd-kind="Type parameter">Plugins</span></div>
<div class="tsd-comment tsd-typography"><p>Plugins you want to install on the BufferWrapper intance
you are about to create</p>

<h3>Exemple</h3><pre><code class="language-javascript"><span class="hl-5">// Plugin we are creating</span><br/><span class="hl-1">const</span><span class="hl-0"> </span><span class="hl-2">BufWrapperPlugin</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">writeCustomType</span><span class="hl-0">(</span><span class="hl-7">buf</span><span class="hl-0">, </span><span class="hl-7">data</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">// Do stuff with `buf`</span><br/><span class="hl-0"> },</span><br/><span class="hl-0"> </span><span class="hl-3">readCustomType</span><span class="hl-0">(</span><span class="hl-7">buf</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">// Do stuff</span><br/><span class="hl-0"> </span><span class="hl-6">return</span><span class="hl-0"> </span><span class="hl-7">someValue</span><span class="hl-0">;</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-5">// Setting the first argument as null</span><br/><span class="hl-5">// since we don&#39;t have any data yet</span><br/><span class="hl-1">const</span><span class="hl-0"> </span><span class="hl-2">buf</span><span class="hl-0"> = </span><span class="hl-1">new</span><span class="hl-0"> </span><span class="hl-3">BufWrapper</span><span class="hl-0">(</span><span class="hl-1">null</span><span class="hl-0">, {</span><br/><span class="hl-0"> </span><span class="hl-7">plugins:</span><span class="hl-0"> { </span><span class="hl-7">BufWrapperPlugin</span><span class="hl-0"> }</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">// Call the plugin&#39;s method</span><br/><span class="hl-7">buf</span><span class="hl-0">.</span><span class="hl-7">plugins</span><span class="hl-0">.</span><span class="hl-7">BufWrapperPlugin</span><span class="hl-0">.</span><span class="hl-3">writeCustomType</span><span class="hl-0">(</span><span class="hl-7">buf</span><span class="hl-0">, </span><span class="hl-7">yourData</span><span class="hl-0">);</span>
<h3>Exemple</h3><pre><code class="language-javascript"><span class="hl-5">// Plugin we are creating</span><br/><span class="hl-1">const</span><span class="hl-0"> </span><span class="hl-2">BufWrapperPlugin</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">writeCustomType</span><span class="hl-0">(</span><span class="hl-7">data</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">// You can access the BufWrapper</span><br/><span class="hl-0"> </span><span class="hl-5">// instance with the `this` keyword</span><br/><span class="hl-0"> },</span><br/><span class="hl-0"> </span><span class="hl-3">readCustomType</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-5">// Do stuff</span><br/><span class="hl-0"> </span><span class="hl-6">return</span><span class="hl-0"> </span><span class="hl-7">someValue</span><span class="hl-0">;</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-5">// Setting the first argument as null</span><br/><span class="hl-5">// since we don&#39;t have any data yet</span><br/><span class="hl-1">const</span><span class="hl-0"> </span><span class="hl-2">buf</span><span class="hl-0"> = </span><span class="hl-1">new</span><span class="hl-0"> </span><span class="hl-3">BufWrapper</span><span class="hl-0">(</span><span class="hl-1">null</span><span class="hl-0">, {</span><br/><span class="hl-0"> </span><span class="hl-7">plugins:</span><span class="hl-0"> { </span><span class="hl-7">BufWrapperPlugin</span><span class="hl-0"> }</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">// Call the plugin&#39;s method</span><br/><span class="hl-7">buf</span><span class="hl-0">.</span><span class="hl-7">plugins</span><span class="hl-0">.</span><span class="hl-7">BufWrapperPlugin</span><span class="hl-0">.</span><span class="hl-3">writeCustomType</span><span class="hl-0">(</span><span class="hl-7">yourData</span><span class="hl-0">);</span><br/><span class="hl-7">buf</span><span class="hl-0">.</span><span class="hl-7">plugins</span><span class="hl-0">.</span><span class="hl-7">BufWrapperPlugin</span><span class="hl-0">.</span><span class="hl-3">readCustomType</span><span class="hl-0">();</span>
</code></pre>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9d42231/src/index.ts#L493">index.ts:493</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/MinecraftJS/BufWrapper/blob/9ae6e79/src/index.ts#L508">index.ts:508</a></li></ul></aside></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
Loading

0 comments on commit 74465e1

Please sign in to comment.