Update documentation

This commit is contained in:
Alex Hultman 2019-02-13 04:13:35 +01:00
parent 314bba0fe9
commit 7e4e4f52c9
10 changed files with 2000 additions and 36 deletions

File diff suppressed because one or more lines are too long

View File

@ -72,6 +72,8 @@
<li class="tsd-kind-interface tsd-is-not-exported"><a href="interfaces/httprequest.html" class="tsd-kind-icon">Http<wbr>Request</a></li>
<li class="tsd-kind-interface tsd-is-not-exported"><a href="interfaces/httpresponse.html" class="tsd-kind-icon">Http<wbr>Response</a></li>
<li class="tsd-kind-interface tsd-is-not-exported"><a href="interfaces/templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a></li>
<li class="tsd-kind-interface tsd-is-not-exported"><a href="interfaces/websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a></li>
<li class="tsd-kind-interface tsd-is-not-exported"><a href="interfaces/websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a></li>
<li class="tsd-kind-interface tsd-is-not-exported"><a href="interfaces/us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a></li>
</ul>
</section>
@ -80,6 +82,7 @@
<ul class="tsd-index-list">
<li class="tsd-kind-function"><a href="index.html#app" class="tsd-kind-icon">App</a></li>
<li class="tsd-kind-function"><a href="index.html#sslapp" class="tsd-kind-icon">SSLApp</a></li>
<li class="tsd-kind-function"><a href="index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a></li>
</ul>
</section>
</div>
@ -97,7 +100,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:42</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L138">index.d.ts:138</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -125,7 +128,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:45</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L141">index.d.ts:141</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -143,6 +146,34 @@
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function">
<a name="us_listen_socket_close" class="tsd-anchor"></a>
<h3>us_<wbr>listen_<wbr>socket_<wbr>close</h3>
<ul class="tsd-signatures tsd-kind-function">
<li class="tsd-signature tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close<span class="tsd-signature-symbol">(</span>listenSocket<span class="tsd-signature-symbol">: </span><a href="interfaces/us_listen_socket.html" class="tsd-signature-type">us_listen_socket</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L144">index.d.ts:144</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Closes a uSockets listen socket.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>listenSocket: <a href="interfaces/us_listen_socket.html" class="tsd-signature-type">us_listen_socket</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
@ -167,6 +198,12 @@
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="interfaces/templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="interfaces/websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="interfaces/websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="interfaces/us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
@ -176,6 +213,9 @@
<li class=" tsd-kind-function">
<a href="index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>

View File

@ -87,6 +87,7 @@
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="appoptions.html#cert_file_name" class="tsd-kind-icon">cert_<wbr>file_<wbr>name</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="appoptions.html#dh_params_file_name" class="tsd-kind-icon">dh_<wbr>params_<wbr>file_<wbr>name</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="appoptions.html#key_file_name" class="tsd-kind-icon">key_<wbr>file_<wbr>name</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="appoptions.html#passphrase" class="tsd-kind-icon">passphrase</a></li>
</ul>
@ -102,7 +103,17 @@
<div class="tsd-signature tsd-kind-icon">cert_<wbr>file_<wbr>name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:37</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L102">index.d.ts:102</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="dh_params_file_name" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> dh_<wbr>params_<wbr>file_<wbr>name</h3>
<div class="tsd-signature tsd-kind-icon">dh_<wbr>params_<wbr>file_<wbr>name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L104">index.d.ts:104</a></li>
</ul>
</aside>
</section>
@ -112,7 +123,7 @@
<div class="tsd-signature tsd-kind-icon">key_<wbr>file_<wbr>name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:36</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L101">index.d.ts:101</a></li>
</ul>
</aside>
</section>
@ -122,7 +133,7 @@
<div class="tsd-signature tsd-kind-icon">passphrase<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:38</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L103">index.d.ts:103</a></li>
</ul>
</aside>
</section>
@ -146,6 +157,9 @@
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="appoptions.html#cert_file_name" class="tsd-kind-icon">cert_<wbr>file_<wbr>name</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="appoptions.html#dh_params_file_name" class="tsd-kind-icon">dh_<wbr>params_<wbr>file_<wbr>name</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="appoptions.html#key_file_name" class="tsd-kind-icon">key_<wbr>file_<wbr>name</a>
</li>
@ -165,6 +179,12 @@
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
@ -174,6 +194,9 @@
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>

View File

@ -87,6 +87,10 @@
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httprequest.html#getheader" class="tsd-kind-icon">get<wbr>Header</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httprequest.html#getmethod" class="tsd-kind-icon">get<wbr>Method</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httprequest.html#getparameter" class="tsd-kind-icon">get<wbr>Parameter</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httprequest.html#getquery" class="tsd-kind-icon">get<wbr>Query</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httprequest.html#geturl" class="tsd-kind-icon">get<wbr>Url</a></li>
</ul>
</section>
</div>
@ -104,9 +108,14 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:19</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L70">index.d.ts:70</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the lowercased header value or empty string.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
@ -117,6 +126,100 @@
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="getmethod" class="tsd-anchor"></a>
<h3>get<wbr>Method</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">get<wbr>Method<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L76">index.d.ts:76</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the HTTP method, useful for &quot;any&quot; routes.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="getparameter" class="tsd-anchor"></a>
<h3>get<wbr>Parameter</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">get<wbr>Parameter<span class="tsd-signature-symbol">(</span>index<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L72">index.d.ts:72</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the parsed parameter at index. Corresponds to route.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>index: <span class="tsd-signature-type">number</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="getquery" class="tsd-anchor"></a>
<h3>get<wbr>Query</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">get<wbr>Query<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L78">index.d.ts:78</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the part of URL after ? sign or empty string.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="geturl" class="tsd-anchor"></a>
<h3>get<wbr>Url</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">get<wbr>Url<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L74">index.d.ts:74</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the URL including initial /slash</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
@ -140,6 +243,18 @@
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httprequest.html#getheader" class="tsd-kind-icon">get<wbr>Header</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httprequest.html#getmethod" class="tsd-kind-icon">get<wbr>Method</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httprequest.html#getparameter" class="tsd-kind-icon">get<wbr>Parameter</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httprequest.html#getquery" class="tsd-kind-icon">get<wbr>Query</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httprequest.html#geturl" class="tsd-kind-icon">get<wbr>Url</a>
</li>
</ul>
</li>
</ul>
@ -150,6 +265,12 @@
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
@ -159,6 +280,9 @@
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>

View File

@ -86,9 +86,16 @@
<section class="tsd-index-section tsd-is-not-exported">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#close" class="tsd-kind-icon">close</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#end" class="tsd-kind-icon">end</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#getwriteoffset" class="tsd-kind-icon">get<wbr>Write<wbr>Offset</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#onaborted" class="tsd-kind-icon">on<wbr>Aborted</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#ondata" class="tsd-kind-icon">on<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#onwritable" class="tsd-kind-icon">on<wbr>Writable</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#tryend" class="tsd-kind-icon">try<wbr>End</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#write" class="tsd-kind-icon">write</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#writeheader" class="tsd-kind-icon">write<wbr>Header</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="httpresponse.html#writestatus" class="tsd-kind-icon">write<wbr>Status</a></li>
</ul>
</section>
</div>
@ -97,16 +104,38 @@
<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="end" class="tsd-anchor"></a>
<h3>end</h3>
<a name="close" class="tsd-anchor"></a>
<h3>close</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:12</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L46">index.d.ts:46</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Immediately force closes the connection.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="end" class="tsd-anchor"></a>
<h3>end</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L41">index.d.ts:41</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -117,10 +146,181 @@
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>body: <span class="tsd-signature-type">string</span></h5>
<h5>body: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="getwriteoffset" class="tsd-anchor"></a>
<h3>get<wbr>Write<wbr>Offset</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">get<wbr>Write<wbr>Offset<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L49">index.d.ts:49</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the global byte write offset for this response. Use with onWritable.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="onaborted" class="tsd-anchor"></a>
<h3>on<wbr>Aborted</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">on<wbr>Aborted<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L61">index.d.ts:61</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Every HttpResponse MUST have an attached abort handler IF you do not respond
to it immediately inside of the callback. Returning from an Http request handler
without attaching (by calling onAborted) an abort handler is ill-use and will termiante.
When this event emits, the response has been aborted and may not be used.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="ondata" class="tsd-anchor"></a>
<h3>on<wbr>Data</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">on<wbr>Data<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L64">index.d.ts:64</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Handler for reading data from POST and such requests. You MUST copy the data of chunk if isLast is not true. We Neuter ArrayBuffers on return, making it zero length.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isLast<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>chunk: <span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
<li>
<h5>isLast: <span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="onwritable" class="tsd-anchor"></a>
<h3>on<wbr>Writable</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">on<wbr>Writable<span class="tsd-signature-symbol">(</span>handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L55">index.d.ts:55</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers a handler for writable events. Continue failed write attempts in here.
You MUST return true for success, false for failure.
Writing nothing is always success, so by default you must return true.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
@ -134,7 +334,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:14</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L43">index.d.ts:43</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -156,28 +356,89 @@
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="writeheader" class="tsd-anchor"></a>
<h3>write<wbr>Header</h3>
<a name="write" class="tsd-anchor"></a>
<h3>write</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">write<wbr>Header<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-signature tsd-kind-icon">write<span class="tsd-signature-symbol">(</span>chunk<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:10</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L39">index.d.ts:39</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Enters or continues chunked encoding mode. Writes part of the response. End with zero length write.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>key: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>value: <span class="tsd-signature-type">string</span></h5>
<h5>chunk: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="writeheader" class="tsd-anchor"></a>
<h3>write<wbr>Header</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">write<wbr>Header<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L37">index.d.ts:37</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Writes key and value to HTTP response.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
<li>
<h5>value: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="writestatus" class="tsd-anchor"></a>
<h3>write<wbr>Status</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">write<wbr>Status<span class="tsd-signature-symbol">(</span>status<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L35">index.d.ts:35</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Writes the HTTP status message such as &quot;200 OK&quot;.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>status: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h4>
</li>
</ul>
</section>
@ -204,15 +465,36 @@
<li class="current tsd-kind-interface tsd-is-not-exported">
<a href="httpresponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
<ul>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#close" class="tsd-kind-icon">close</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#end" class="tsd-kind-icon">end</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#getwriteoffset" class="tsd-kind-icon">get<wbr>Write<wbr>Offset</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#onaborted" class="tsd-kind-icon">on<wbr>Aborted</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#ondata" class="tsd-kind-icon">on<wbr>Data</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#onwritable" class="tsd-kind-icon">on<wbr>Writable</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#tryend" class="tsd-kind-icon">try<wbr>End</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#write" class="tsd-kind-icon">write</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#writeheader" class="tsd-kind-icon">write<wbr>Header</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="httpresponse.html#writestatus" class="tsd-kind-icon">write<wbr>Status</a>
</li>
</ul>
</li>
</ul>
@ -220,6 +502,12 @@
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
@ -229,6 +517,9 @@
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>

View File

@ -86,9 +86,18 @@
<section class="tsd-index-section tsd-is-not-exported">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#any" class="tsd-kind-icon">any</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#connect" class="tsd-kind-icon">connect</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#del" class="tsd-kind-icon">del</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#get" class="tsd-kind-icon">get</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#head" class="tsd-kind-icon">head</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#listen" class="tsd-kind-icon">listen</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#options" class="tsd-kind-icon">options</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#patch" class="tsd-kind-icon">patch</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#post" class="tsd-kind-icon">post</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#put" class="tsd-kind-icon">put</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#trace" class="tsd-kind-icon">trace</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="templatedapp.html#ws" class="tsd-kind-icon">ws</a></li>
</ul>
</section>
</div>
@ -96,6 +105,162 @@
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="any" class="tsd-anchor"></a>
<h3>any</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">any<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L132">index.d.ts:132</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP handler matching specified URL pattern on any HTTP method.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="connect" class="tsd-anchor"></a>
<h3>connect</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">connect<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L128">index.d.ts:128</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP CONNECT handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="del" class="tsd-anchor"></a>
<h3>del</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">del<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L120">index.d.ts:120</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP DELETE handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="get" class="tsd-anchor"></a>
<h3>get</h3>
@ -106,7 +271,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:29</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L114">index.d.ts:114</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -148,6 +313,58 @@
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="head" class="tsd-anchor"></a>
<h3>head</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">head<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L126">index.d.ts:126</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP HEAD handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="listen" class="tsd-anchor"></a>
<h3>listen</h3>
@ -159,7 +376,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:25</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L110">index.d.ts:110</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -202,7 +419,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:27</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L112">index.d.ts:112</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -241,6 +458,110 @@
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="options" class="tsd-anchor"></a>
<h3>options</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">options<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L118">index.d.ts:118</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP OPTIONS handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="patch" class="tsd-anchor"></a>
<h3>patch</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">patch<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L122">index.d.ts:122</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP PATCH handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="post" class="tsd-anchor"></a>
<h3>post</h3>
@ -251,7 +572,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in index.d.ts:31</li>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L116">index.d.ts:116</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -293,6 +614,141 @@
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="put" class="tsd-anchor"></a>
<h3>put</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">put<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L124">index.d.ts:124</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP PUT handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="trace" class="tsd-anchor"></a>
<h3>trace</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">trace<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, handler<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L130">index.d.ts:130</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers an HTTP TRACE handler matching specified URL pattern.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>handler: <span class="tsd-signature-type">function</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>res: <a href="httpresponse.html" class="tsd-signature-type">HttpResponse</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="ws" class="tsd-anchor"></a>
<h3>ws</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">ws<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, behavior<span class="tsd-signature-symbol">: </span><a href="websocketbehavior.html" class="tsd-signature-type">WebSocketBehavior</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L134">index.d.ts:134</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Registers a handler matching specified URL pattern where WebSocket upgrade requests are caught.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern: <span class="tsd-signature-type">string</span></h5>
</li>
<li>
<h5>behavior: <a href="websocketbehavior.html" class="tsd-signature-type">WebSocketBehavior</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="templatedapp.html" class="tsd-signature-type">TemplatedApp</a></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
@ -319,19 +775,52 @@
<li class="current tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
<ul>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#any" class="tsd-kind-icon">any</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#connect" class="tsd-kind-icon">connect</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#del" class="tsd-kind-icon">del</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#get" class="tsd-kind-icon">get</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#head" class="tsd-kind-icon">head</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#listen" class="tsd-kind-icon">listen</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#options" class="tsd-kind-icon">options</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#patch" class="tsd-kind-icon">patch</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#post" class="tsd-kind-icon">post</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#put" class="tsd-kind-icon">put</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#trace" class="tsd-kind-icon">trace</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="templatedapp.html#ws" class="tsd-kind-icon">ws</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
@ -341,6 +830,9 @@
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>

View File

@ -102,6 +102,12 @@
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface tsd-is-not-exported">
@ -115,6 +121,9 @@
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>

View File

@ -0,0 +1,439 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>WebSocket | uWebSockets.js v15.1.0 documentation (WIP &amp; incomplete)</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">uWebSockets.js v15.1.0 documentation (WIP &amp; incomplete)</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">Globals</a>
</li>
<li>
<a href="websocket.html">WebSocket</a>
</li>
</ul>
<h1>Interface WebSocket</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A WebSocket connection that is valid from open to close event</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">WebSocket</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section tsd-is-not-exported">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#close" class="tsd-kind-icon">close</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#end" class="tsd-kind-icon">end</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#getbufferedamount" class="tsd-kind-icon">get<wbr>Buffered<wbr>Amount</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#publish" class="tsd-kind-icon">publish</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#send" class="tsd-kind-icon">send</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#subscribe" class="tsd-kind-icon">subscribe</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported"><a href="websocket.html#unsubscribe" class="tsd-kind-icon">unsubscribe</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="close" class="tsd-anchor"></a>
<h3>close</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L20">index.d.ts:20</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Forefully closes this WebSocket. Immediately calls close handler.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="end" class="tsd-anchor"></a>
<h3>end</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>code<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, shortMessage<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L17">index.d.ts:17</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gradefully closes this WebSocket. Immediately calls close handler.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>code: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5>shortMessage: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="getbufferedamount" class="tsd-anchor"></a>
<h3>get<wbr>Buffered<wbr>Amount</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">get<wbr>Buffered<wbr>Amount<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L14">index.d.ts:14</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the bytes buffered in backpressure.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="publish" class="tsd-anchor"></a>
<h3>publish</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">publish<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L26">index.d.ts:26</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Publish a message to a topic in MQTT syntax</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>topic: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
<li>
<h5>message: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="send" class="tsd-anchor"></a>
<h3>send</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">send<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span>, isBinary<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, compress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L11">index.d.ts:11</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Sends a message. Make sure to check getBufferedAmount() before sending. Returns true for success, false for built up backpressure that will drain when time is given.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>message: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
<li>
<h5>isBinary: <span class="tsd-signature-type">boolean</span></h5>
</li>
<li>
<h5>compress: <span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="subscribe" class="tsd-anchor"></a>
<h3>subscribe</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">subscribe<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L23">index.d.ts:23</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Subscribe to a topic in MQTT syntax</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>topic: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a name="unsubscribe" class="tsd-anchor"></a>
<h3>unsubscribe</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">unsubscribe<span class="tsd-signature-symbol">(</span>topic<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L29">index.d.ts:29</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Unsubscribe from topic (not implemented yet)</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>topic: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>Globals</em></a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="appoptions.html" class="tsd-kind-icon">App<wbr>Options</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="httprequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="httpresponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
<ul>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#close" class="tsd-kind-icon">close</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#end" class="tsd-kind-icon">end</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#getbufferedamount" class="tsd-kind-icon">get<wbr>Buffered<wbr>Amount</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#publish" class="tsd-kind-icon">publish</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#send" class="tsd-kind-icon">send</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#subscribe" class="tsd-kind-icon">subscribe</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocket.html#unsubscribe" class="tsd-kind-icon">unsubscribe</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#app" class="tsd-kind-icon">App</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>

View File

@ -0,0 +1,447 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>WebSocketBehavior | uWebSockets.js v15.1.0 documentation (WIP &amp; incomplete)</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">uWebSockets.js v15.1.0 documentation (WIP &amp; incomplete)</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">Globals</a>
</li>
<li>
<a href="websocketbehavior.html">WebSocketBehavior</a>
</li>
</ul>
<h1>Interface WebSocketBehavior</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A structure holding settings and handlers for a WebSocket route handler.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">WebSocketBehavior</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section tsd-is-not-exported">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#close" class="tsd-kind-icon">close</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#compression" class="tsd-kind-icon">compression</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#drain" class="tsd-kind-icon">drain</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#idletimeout" class="tsd-kind-icon">idle<wbr>Timeout</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#maxpayloadlength" class="tsd-kind-icon">max<wbr>Payload<wbr>Length</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#message" class="tsd-kind-icon">message</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="websocketbehavior.html#open" class="tsd-kind-icon">open</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="close" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> close</h3>
<div class="tsd-signature tsd-kind-icon">close<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L96">index.d.ts:96</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Handler for close event, no matter if error, timeout or graceful close. You may not use WebSocket after this event.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a>, code<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>ws: <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h5>
</li>
<li>
<h5>code: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="compression" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> compression</h3>
<div class="tsd-signature tsd-kind-icon">compression<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L88">index.d.ts:88</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>0 = no compression, 1 = shared compressor, 2 = dedicated compressor. See C++ project.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="drain" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> drain</h3>
<div class="tsd-signature tsd-kind-icon">drain<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L94">index.d.ts:94</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Handler for when WebSocket backpressure drains. Check ws.getBufferedAmount().</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>ws: <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="idletimeout" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> idle<wbr>Timeout</h3>
<div class="tsd-signature tsd-kind-icon">idle<wbr>Timeout<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L86">index.d.ts:86</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Maximum amount of seconds that may pass without sending or getting a message.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="maxpayloadlength" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> max<wbr>Payload<wbr>Length</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Payload<wbr>Length<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L84">index.d.ts:84</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Maximum length of received message.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="message" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> message</h3>
<div class="tsd-signature tsd-kind-icon">message<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L92">index.d.ts:92</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Handler for a WebSocket message.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ArrayBuffer</span>, isBinary<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>ws: <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h5>
</li>
<li>
<h5>message: <span class="tsd-signature-type">ArrayBuffer</span></h5>
</li>
<li>
<h5>isBinary: <span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a name="open" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> open</h3>
<div class="tsd-signature tsd-kind-icon">open<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/uNetworking/uWebSockets.js/blob/20200a8/docs/index.d.ts#L90">index.d.ts:90</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Handler for new WebSocket connection. WebSocket is valid from open to close, no errors.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>ws<span class="tsd-signature-symbol">: </span><a href="websocket.html" class="tsd-signature-type">WebSocket</a>, req<span class="tsd-signature-symbol">: </span><a href="httprequest.html" class="tsd-signature-type">HttpRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>ws: <a href="websocket.html" class="tsd-signature-type">WebSocket</a></h5>
</li>
<li>
<h5>req: <a href="httprequest.html" class="tsd-signature-type">HttpRequest</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</div>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>Globals</em></a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="appoptions.html" class="tsd-kind-icon">App<wbr>Options</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="httprequest.html" class="tsd-kind-icon">Http<wbr>Request</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="httpresponse.html" class="tsd-kind-icon">Http<wbr>Response</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="templatedapp.html" class="tsd-kind-icon">Templated<wbr>App</a>
</li>
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="websocket.html" class="tsd-kind-icon">Web<wbr>Socket</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html" class="tsd-kind-icon">Web<wbr>Socket<wbr>Behavior</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#close" class="tsd-kind-icon">close</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#compression" class="tsd-kind-icon">compression</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#drain" class="tsd-kind-icon">drain</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#idletimeout" class="tsd-kind-icon">idle<wbr>Timeout</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#maxpayloadlength" class="tsd-kind-icon">max<wbr>Payload<wbr>Length</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#message" class="tsd-kind-icon">message</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
<a href="websocketbehavior.html#open" class="tsd-kind-icon">open</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-is-not-exported">
<a href="us_listen_socket.html" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#app" class="tsd-kind-icon">App</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#sslapp" class="tsd-kind-icon">SSLApp</a>
</li>
<li class=" tsd-kind-function">
<a href="../index.html#us_listen_socket_close" class="tsd-kind-icon">us_<wbr>listen_<wbr>socket_<wbr>close</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>

117
docs/index.d.ts vendored
View File

@ -5,18 +5,103 @@ interface us_listen_socket {
}
/** A WebSocket connection that is valid from open to close event */
interface WebSocket {
/** Sends a message. Make sure to check getBufferedAmount() before sending. Returns true for success, false for built up backpressure that will drain when time is given. */
send(message: string | ArrayBuffer, isBinary: boolean, compress: boolean) : boolean;
/** Returns the bytes buffered in backpressure. */
getBufferedAmount() : number;
/** Gradefully closes this WebSocket. Immediately calls close handler. */
end(code: number, shortMessage: string | ArrayBuffer) : WebSocket;
/** Forefully closes this WebSocket. Immediately calls close handler. */
close() : WebSocket;
/** Subscribe to a topic in MQTT syntax */
subscribe(topic: string | ArrayBuffer) : WebSocket;
/** Publish a message to a topic in MQTT syntax */
publish(topic: string | ArrayBuffer, message: string | ArrayBuffer) : WebSocket;
/** Unsubscribe from topic (not implemented yet) */
unsubscribe(topic: string | ArrayBuffer) : WebSocket;
}
/** An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object. */
interface HttpResponse {
writeHeader(key: string, value: string) : void;
/** Writes the HTTP status message such as "200 OK". */
writeStatus(status: string | ArrayBuffer) : HttpResponse;
/** Writes key and value to HTTP response. */
writeHeader(key: string | ArrayBuffer, value: string | ArrayBuffer) : HttpResponse;
/** Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. */
write(chunk: string | ArrayBuffer) : HttpResponse;
/** Ends this response by copying the contents of body. */
end(body: string) : void;
end(body: string | ArrayBuffer) : HttpResponse;
/** Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].*/
tryEnd(fullBodyOrChunk: string, totalSize: number) : [boolean, boolean];
/** Immediately force closes the connection. */
close() : HttpResponse;
/** Returns the global byte write offset for this response. Use with onWritable. */
getWriteOffset() : number;
/** Registers a handler for writable events. Continue failed write attempts in here.
* You MUST return true for success, false for failure.
* Writing nothing is always success, so by default you must return true.
*/
onWritable(handler: (res: HttpResponse) => boolean) : HttpResponse;
/** Every HttpResponse MUST have an attached abort handler IF you do not respond
* to it immediately inside of the callback. Returning from an Http request handler
* without attaching (by calling onAborted) an abort handler is ill-use and will termiante.
* When this event emits, the response has been aborted and may not be used. */
onAborted(handler: (res: HttpResponse) => void) : HttpResponse;
/** Handler for reading data from POST and such requests. You MUST copy the data of chunk if isLast is not true. We Neuter ArrayBuffers on return, making it zero length.*/
onData(handler: (res: HttpResponse, chunk: ArrayBuffer, isLast: boolean) => void) : HttpResponse;
}
/** An HttpRequest is stack allocated and only accessible during the callback invocation. */
interface HttpRequest {
/** Returns the lowercased header value or empty string. */
getHeader(lowerCaseKey: string) : string;
/** Returns the parsed parameter at index. Corresponds to route. */
getParameter(index: number) : string;
/** Returns the URL including initial /slash */
getUrl() : string;
/** Returns the HTTP method, useful for "any" routes. */
getMethod() : string;
/** Returns the part of URL after ? sign or empty string. */
getQuery() : string;
}
/** A structure holding settings and handlers for a WebSocket route handler. */
interface WebSocketBehavior {
/** Maximum length of received message. */
maxPayloadLength?: number;
/** Maximum amount of seconds that may pass without sending or getting a message. */
idleTimeout?: number;
/** 0 = no compression, 1 = shared compressor, 2 = dedicated compressor. See C++ project. */
compression?: number;
/** Handler for new WebSocket connection. WebSocket is valid from open to close, no errors. */
open?: (ws: WebSocket, req: HttpRequest) => void;
/** Handler for a WebSocket message. */
message?: (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => void;
/** Handler for when WebSocket backpressure drains. Check ws.getBufferedAmount(). */
drain?: (ws: WebSocket) => void;
/** Handler for close event, no matter if error, timeout or graceful close. You may not use WebSocket after this event. */
close?: (ws: WebSocket, code: number, message: ArrayBuffer) => void;
}
/** Options used when constructing an app. */
interface AppOptions {
key_file_name?: string;
cert_file_name?: string;
passphrase?: string;
dh_params_file_name?: string;
}
/** TemplatedApp is either an SSL or non-SSL app. */
@ -29,13 +114,24 @@ interface TemplatedApp {
get(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP POST handler matching specified URL pattern. */
post(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
}
/** Options used when constructing an app. */
interface AppOptions {
key_file_name?: string
cert_file_name?: string
passphrase?: string
/** Registers an HTTP OPTIONS handler matching specified URL pattern. */
options(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP DELETE handler matching specified URL pattern. */
del(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP PATCH handler matching specified URL pattern. */
patch(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP PUT handler matching specified URL pattern. */
put(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP HEAD handler matching specified URL pattern. */
head(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP CONNECT handler matching specified URL pattern. */
connect(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP TRACE handler matching specified URL pattern. */
trace(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers an HTTP handler matching specified URL pattern on any HTTP method. */
any(pattern: string, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
/** Registers a handler matching specified URL pattern where WebSocket upgrade requests are caught. */
ws(pattern: string, behavior: WebSocketBehavior) : TemplatedApp;
}
/** Constructs a non-SSL app */
@ -43,3 +139,6 @@ export function App(options: AppOptions): TemplatedApp;
/** Constructs an SSL app */
export function SSLApp(options: AppOptions): TemplatedApp;
/** Closes a uSockets listen socket. */
export function us_listen_socket_close(listenSocket: us_listen_socket): void;