UNPKG

express-mesh

Version:

A Gentics Mesh frontend for Express.

784 lines 145 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>IMeshResponse | ExpressMesh</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> <script src="../assets/js/modernizr.js"></script> </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">ExpressMesh</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-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</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="../globals.html">Globals</a> </li> <li> <a href="../modules/_lib_mesh_.html">&quot;lib/mesh&quot;</a> </li> <li> <a href="_lib_mesh_.imeshresponse.html">IMeshResponse</a> </li> </ul> <h1>Interface IMeshResponse</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>Wrapper for the express.Response. We can use them to add properties to the response.</p> </div> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="tsd-signature-type">Response</span> <ul class="tsd-hierarchy"> <li> <span class="target">IMeshResponse</span> </li> </ul> </li> </ul> </section> <section class="tsd-panel"> <h3>Implements</h3> <ul class="tsd-hierarchy"> <li><span class="tsd-signature-type">EventEmitter</span></li> <li><span class="tsd-signature-type">WritableStream</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-inherited"> <h3>Constructors</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constructor tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#constructor" class="tsd-kind-icon">constructor</a></li> </ul> </section> <section class="tsd-index-section tsd-is-inherited"> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#charset" class="tsd-kind-icon">charset</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#headerssent" class="tsd-kind-icon">headers<wbr>Sent</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#json" class="tsd-kind-icon">json</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#jsonp" class="tsd-kind-icon">jsonp</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#locals" class="tsd-kind-icon">locals</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#send" class="tsd-kind-icon">send</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#senddate" class="tsd-kind-icon">send<wbr>Date</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#statuscode" class="tsd-kind-icon">status<wbr>Code</a></li> <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#writable" class="tsd-kind-icon">writable</a></li> </ul> </section> <section class="tsd-index-section tsd-is-inherited"> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#_write" class="tsd-kind-icon">_write</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#addlistener" class="tsd-kind-icon">add<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#addtrailers" class="tsd-kind-icon">add<wbr>Trailers</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#attachment" class="tsd-kind-icon">attachment</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#clearcookie" class="tsd-kind-icon">clear<wbr>Cookie</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#contenttype" class="tsd-kind-icon">content<wbr>Type</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#cookie" class="tsd-kind-icon">cookie</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#download" class="tsd-kind-icon">download</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#emit" class="tsd-kind-icon">emit</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#end" class="tsd-kind-icon">end</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#format" class="tsd-kind-icon">format</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#get" class="tsd-kind-icon">get</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#getheader" class="tsd-kind-icon">get<wbr>Header</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#header" class="tsd-kind-icon">header</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#links" class="tsd-kind-icon">links</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#listeners" class="tsd-kind-icon">listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#location" class="tsd-kind-icon">location</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#on" class="tsd-kind-icon">on</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#once" class="tsd-kind-icon">once</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#redirect" class="tsd-kind-icon">redirect</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#removealllisteners" class="tsd-kind-icon">remove<wbr>All<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#removeheader" class="tsd-kind-icon">remove<wbr>Header</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#removelistener" class="tsd-kind-icon">remove<wbr>Listener</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#render" class="tsd-kind-icon">render</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#sendfile" class="tsd-kind-icon">send<wbr>File</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#sendstatus" class="tsd-kind-icon">send<wbr>Status</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#sendfile-1" class="tsd-kind-icon">sendfile</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#set" class="tsd-kind-icon">set</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#setheader" class="tsd-kind-icon">set<wbr>Header</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#setmaxlisteners" class="tsd-kind-icon">set<wbr>Max<wbr>Listeners</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#status" class="tsd-kind-icon">status</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#type" class="tsd-kind-icon">type</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#write" class="tsd-kind-icon">write</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#writecontinue" class="tsd-kind-icon">write<wbr>Continue</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="_lib_mesh_.imeshresponse.html#writehead" class="tsd-kind-icon">write<wbr>Head</a></li> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-static"><a href="_lib_mesh_.imeshresponse.html#listenercount" class="tsd-kind-icon">listener<wbr>Count</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-inherited"> <h2>Constructors</h2> <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-interface tsd-is-inherited"> <a name="constructor" class="tsd-anchor"></a> <h3>constructor</h3> <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">new IMesh<wbr>Response<span class="tsd-signature-symbol">(</span>opts<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">WritableOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_lib_mesh_.imeshresponse.html" class="tsd-signature-type">IMeshResponse</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Writable.__constructor</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L1690">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:1690</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> opts: <span class="tsd-signature-type">WritableOptions</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="_lib_mesh_.imeshresponse.html" class="tsd-signature-type">IMeshResponse</a></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-inherited"> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="charset" class="tsd-anchor"></a> <h3>charset</h3> <div class="tsd-signature tsd-kind-icon">charset<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <p>Inherited from Response.charset</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L793">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:793</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="headerssent" class="tsd-anchor"></a> <h3>headers<wbr>Sent</h3> <div class="tsd-signature tsd-kind-icon">headers<wbr>Sent<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <p>Inherited from Response.headersSent</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L690">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:690</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="json" class="tsd-anchor"></a> <h3>json</h3> <div class="tsd-signature tsd-kind-icon">json<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Send</span></div> <aside class="tsd-sources"> <p>Inherited from Response.json</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L485">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:485</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Send JSON response.</p> </div> <p>Examples:</p> <pre><code>res.json(<span class="hljs-literal">null</span>); res.json({ <span class="hljs-string">user:</span> <span class="hljs-string">'tj'</span> }); res.json(<span class="hljs-number">500</span>, <span class="hljs-string">'oh noes!'</span>); res.json(<span class="hljs-number">404</span>, <span class="hljs-string">'I dont have that'</span>); </code></pre> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="jsonp" class="tsd-anchor"></a> <h3>jsonp</h3> <div class="tsd-signature tsd-kind-icon">jsonp<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Send</span></div> <aside class="tsd-sources"> <p>Inherited from Response.jsonp</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L497">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:497</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Send JSON response with JSONP callback support.</p> </div> <p>Examples:</p> <pre><code>res.jsonp(<span class="hljs-literal">null</span>); res.jsonp({ <span class="hljs-string">user:</span> <span class="hljs-string">'tj'</span> }); res.jsonp(<span class="hljs-number">500</span>, <span class="hljs-string">'oh noes!'</span>); res.jsonp(<span class="hljs-number">404</span>, <span class="hljs-string">'I dont have that'</span>); </code></pre> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="locals" class="tsd-anchor"></a> <h3>locals</h3> <div class="tsd-signature tsd-kind-icon">locals<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div> <aside class="tsd-sources"> <p>Inherited from Response.locals</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L791">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:791</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="send" class="tsd-anchor"></a> <h3>send</h3> <div class="tsd-signature tsd-kind-icon">send<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Send</span></div> <aside class="tsd-sources"> <p>Inherited from Response.send</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L473">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:473</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Send a response.</p> </div> <p>Examples:</p> <pre><code>res.<span class="hljs-built_in">send</span>(new Buffer(<span class="hljs-string">'wahoo'</span>))<span class="hljs-comment">;</span> res.<span class="hljs-built_in">send</span>({ some: <span class="hljs-string">'json'</span> })<span class="hljs-comment">;</span> res.<span class="hljs-built_in">send</span>(<span class="hljs-string">'&lt;p&gt;some html&lt;/p&gt;'</span>)<span class="hljs-comment">;</span> res.<span class="hljs-built_in">send</span>(<span class="hljs-number">404</span>, <span class="hljs-string">'Sorry, cant find that'</span>)<span class="hljs-comment">;</span> res.<span class="hljs-built_in">send</span>(<span class="hljs-number">404</span>)<span class="hljs-comment">;</span> </code></pre> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="senddate" class="tsd-anchor"></a> <h3>send<wbr>Date</h3> <div class="tsd-signature tsd-kind-icon">send<wbr>Date<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <p>Inherited from ServerResponse.sendDate</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L457">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:457</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="statuscode" class="tsd-anchor"></a> <h3>status<wbr>Code</h3> <div class="tsd-signature tsd-kind-icon">status<wbr>Code<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <aside class="tsd-sources"> <p>Inherited from ServerResponse.statusCode</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L455">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:455</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"> <a name="writable" class="tsd-anchor"></a> <h3>writable</h3> <div class="tsd-signature tsd-kind-icon">writable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <p>Inherited from Writable.writable</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L1690">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:1690</a></li> </ul> </aside> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-inherited"> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="_write" class="tsd-anchor"></a> <h3>_write</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">_write<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Buffer</span>, encoding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<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><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon">_write<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, encoding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<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><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Writable._write</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L1692">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:1692</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>data: <span class="tsd-signature-type">Buffer</span></h5> </li> <li> <h5>encoding: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>callback: <span class="tsd-signature-type">Function</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Writable._write</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L1693">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:1693</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>data: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>encoding: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>callback: <span class="tsd-signature-type">Function</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="addlistener" class="tsd-anchor"></a> <h3>add<wbr>Listener</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">add<wbr>Listener<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, listener<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><span class="tsd-signature-type">EventEmitter</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from EventEmitter.addListener</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L413">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:413</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>event: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>listener: <span class="tsd-signature-type">Function</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">EventEmitter</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="addtrailers" class="tsd-anchor"></a> <h3>add<wbr>Trailers</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">add<wbr>Trailers<span class="tsd-signature-symbol">(</span>headers<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</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"> <aside class="tsd-sources"> <p>Inherited from ServerResponse.addTrailers</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L461">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:461</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>headers: <span class="tsd-signature-type">any</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="attachment" class="tsd-anchor"></a> <h3>attachment</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">attachment<span class="tsd-signature-symbol">(</span>filename<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">Response</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.attachment</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L669">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:669</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Set <em>Content-Disposition</em> header to <em>attachment</em> with optional <code>filename</code>.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> filename: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Response</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="clearcookie" class="tsd-anchor"></a> <h3>clear<wbr>Cookie</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">clear<wbr>Cookie<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Response</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.clearCookie</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L705">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:705</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Clear cookie <code>name</code>.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">any</span></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Response</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="contenttype" class="tsd-anchor"></a> <h3>content<wbr>Type</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">content<wbr>Type<span class="tsd-signature-symbol">(</span>type<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">Response</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.contentType</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L590">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:590</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Set <em>Content-Type</em> response header with <code>type</code> through <code>mime.lookup()</code> when it does not contain &quot;/&quot;, or set the Content-Type to <code>type</code> otherwise.</p> </div> <p>Examples:</p> <pre><code><span class="hljs-title">res</span>.<span class="hljs-typedef"><span class="hljs-keyword">type</span><span class="hljs-container">('.html')</span>;</span> <span class="hljs-title">res</span>.<span class="hljs-typedef"><span class="hljs-keyword">type</span><span class="hljs-container">('html')</span>;</span> <span class="hljs-title">res</span>.<span class="hljs-typedef"><span class="hljs-keyword">type</span><span class="hljs-container">('json')</span>;</span> <span class="hljs-title">res</span>.<span class="hljs-typedef"><span class="hljs-keyword">type</span><span class="hljs-container">('application/json')</span>;</span> <span class="hljs-title">res</span>.<span class="hljs-typedef"><span class="hljs-keyword">type</span><span class="hljs-container">('png')</span>;</span> </code></pre> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>type: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Response</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="cookie" class="tsd-anchor"></a> <h3>cookie</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">cookie<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, val<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">CookieOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Response</span></li> <li class="tsd-signature tsd-kind-icon">cookie<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, val<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">CookieOptions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Response</span></li> <li class="tsd-signature tsd-kind-icon">cookie<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, val<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Response</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.cookie</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L724">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:724</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Set cookie <code>name</code> to <code>val</code>, with the given <code>options</code>.</p> </div> <p>Options:</p> <ul> <li><code>maxAge</code> max-age in milliseconds, converted to <code>expires</code></li> <li><code>signed</code> sign the cookie</li> <li><code>path</code> defaults to &quot;/&quot;</li> </ul> <p>Examples:</p> <p> // &quot;Remember Me&quot; for 15 minutes res.cookie(&#39;rememberme&#39;, &#39;1&#39;, { expires: new Date(Date.now() + 900000), httpOnly: true });</p> <p> // save as above res.cookie(&#39;rememberme&#39;, &#39;1&#39;, { maxAge: 900000, httpOnly: true })</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>val: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>options: <span class="tsd-signature-type">CookieOptions</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Response</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.cookie</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L725">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:725</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>val: <span class="tsd-signature-type">any</span></h5> </li> <li> <h5>options: <span class="tsd-signature-type">CookieOptions</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Response</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.cookie</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L726">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:726</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>val: <span class="tsd-signature-type">any</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Response</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="download" class="tsd-anchor"></a> <h3>download</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">download<span class="tsd-signature-symbol">(</span>path<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">download<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, filename<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">download<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, fn<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Errback</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">download<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, filename<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, fn<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Errback</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"> <aside class="tsd-sources"> <p>Inherited from Response.download</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L571">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:571</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Transfer the file at the given <code>path</code> as an attachment.</p> </div> <p>Optionally providing an alternate attachment <code>filename</code>, and optional callback <code>fn(err)</code>. The callback is invoked when the data transfer is complete, or when an error has ocurred. Be sure to check <code>res.headerSent</code> if you plan to respond.</p> <p>This method uses <code>res.sendfile()</code>.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>path: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.download</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L572">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:572</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>path: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>filename: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.download</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L573">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:573</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>path: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>fn: <span class="tsd-signature-type">Errback</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from Response.download</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/express/express.d.ts#L574">/home/pgurtler/gentics/git/express-mesh/devtypes/express/express.d.ts:574</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>path: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>filename: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5>fn: <span class="tsd-signature-type">Errback</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <a name="emit" class="tsd-anchor"></a> <h3>emit</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">emit<span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-signature-symbol">...</span>args<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</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"> <p>Inherited from EventEmitter.emit</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L420">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:420</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>event: <span class="tsd-signature-type">string</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>args: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</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-overwrite tsd-is-inherited"> <a name="end" class="tsd-anchor"></a> <h3>end</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-inherited"> <li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</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">end<span class="tsd-signature-symbol">(</span>buffer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Buffer</span>, cb<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><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>str<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, cb<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><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>str<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, encoding<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, cb<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><span class="tsd-signature-type">void</span></li> <li class="tsd-signature tsd-kind-icon">end<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span>, encoding<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> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from ServerResponse.end</p> <p>Overwrites Writable.end</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L464">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:464</a></li> </ul> </aside> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <p>Inherited from ServerResponse.end</p> <p>Overwrites Writable.end</p> <ul> <li>Defined in <a href="https://github.com/gentics/express-mesh/blob/master/devtypes/node/node.d.ts#L465">/home/pgurtler/gentics/git/express-mesh/devtypes/node/node.d.ts:465</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>buffer: <span class="tsd-signature-type">Buffer</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> cb: <span class="tsd-signature-type">Function</span></