UNPKG

textiot

Version:

A framework for building web and native (IoT) Dapps on the IPFS network

674 lines 37.3 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Threads | @textile/js-http-client</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">@textile/js-http-client</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> </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="threads.html">Threads</a> </li> </ul> <h1>Class Threads</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>Threads is an API module for managing Textile threads</p> </div> <p>Threads are distributed sets of encrypted files between peers governed by build-in or custom Schemas.</p> <p>Thread type controls read (R), annotate (A), and write (W) access:</p> <p>private --&gt; initiator: RAW, whitelist: readonly --&gt; initiator: RAW, whitelist: R public --&gt; initiator: RAW, whitelist: RA open --&gt; initiator: RAW, whitelist: RAW</p> <p>Thread sharing style controls if (Y/N) a thread can be shared:</p> <p>notshared --&gt; initiator: N, whitelist: N inviteonly --&gt; initiator: Y, whitelist: N shared --&gt; initiator: Y, whitelist: Y</p> <dl class="tsd-comment-tags"> <dt>extends</dt> <dd><p>API</p> </dd> </dl> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="tsd-signature-type">API</span> <ul class="tsd-hierarchy"> <li> <span class="target">Threads</span> </li> </ul> </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 "> <h3>Constructors</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="threads.html#constructor" class="tsd-kind-icon">constructor</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-class"><a href="threads.html#schemas" class="tsd-kind-icon">schemas</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="threads.html#snapshots" class="tsd-kind-icon">snapshots</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#add" class="tsd-kind-icon">add</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#addorupdate" class="tsd-kind-icon">add<wbr>OrUpdate</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#get" class="tsd-kind-icon">get</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#getbykey" class="tsd-kind-icon">get<wbr>ByKey</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#getbyname" class="tsd-kind-icon">get<wbr>ByName</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#list" class="tsd-kind-icon">list</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#peers" class="tsd-kind-icon">peers</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#remove" class="tsd-kind-icon">remove</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#removebykey" class="tsd-kind-icon">remove<wbr>ByKey</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="threads.html#rename" class="tsd-kind-icon">rename</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Constructors</h2> <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"> <a name="constructor" class="tsd-anchor"></a> <h3>constructor</h3> <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"> <li class="tsd-signature tsd-kind-icon">new <wbr>Threads<span class="tsd-signature-symbol">(</span>opts<span class="tsd-signature-symbol">?: </span><a href="../interfaces/apioptions.html" class="tsd-signature-type">ApiOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="threads.html" class="tsd-signature-type">Threads</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <p>Overrides API.__constructor</p> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L32">modules/threads.ts:32</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> opts: <a href="../interfaces/apioptions.html" class="tsd-signature-type">ApiOptions</a><span class="tsd-signature-symbol"> =&nbsp;DEFAULT_API_OPTIONS</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="threads.html" class="tsd-signature-type">Threads</a></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="schemas" class="tsd-anchor"></a> <h3>schemas</h3> <div class="tsd-signature tsd-kind-icon">schemas<span class="tsd-signature-symbol">:</span> <a href="schemas.html" class="tsd-signature-type">Schemas</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L32">modules/threads.ts:32</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="snapshots" class="tsd-anchor"></a> <h3>snapshots</h3> <div class="tsd-signature tsd-kind-icon">snapshots<span class="tsd-signature-symbol">:</span> <a href="snapshots.html" class="tsd-signature-type">Snapshots</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L31">modules/threads.ts:31</a></li> </ul> </aside> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="add" class="tsd-anchor"></a> <h3>add</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">add<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, schema<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">object</span>, key<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span>, type<span class="tsd-signature-symbol">?: </span><a href="../globals.html#threadtype" class="tsd-signature-type">ThreadType</a>, sharing<span class="tsd-signature-symbol">?: </span><a href="../globals.html#threadsharing" class="tsd-signature-type">ThreadSharing</a>, whitelist<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-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L52">modules/threads.ts:52</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Adds and joins a new thread</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> <div class="tsd-comment tsd-typography"> <p>The name of the new thread</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> schema: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">object</span></h5> <div class="tsd-comment tsd-typography"> <p>Schema ID for the new thread</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> key: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>A locally unique key used by an app to identify this thread on recovery</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> type: <a href="../globals.html#threadtype" class="tsd-signature-type">ThreadType</a></h5> <div class="tsd-comment tsd-typography"> <p>The type of thread, must be one of &#39;private&#39; (default), &#39;read_only&#39;, &#39;public&#39;, or &#39;open&#39;</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> sharing: <a href="../globals.html#threadsharing" class="tsd-signature-type">ThreadSharing</a></h5> <div class="tsd-comment tsd-typography"> <p>The sharing style of thread, must be one of &#39;notshared&#39; (default), &#39;invite_only&#39;, or &#39;shared&#39;</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> whitelist: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <p>An array of contact addresses. When supplied, the thread will not allow additional peers, useful for 1-1 chat/file sharing or private threads.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>The newly generated thread info</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="addorupdate" class="tsd-anchor"></a> <h3>add<wbr>OrUpdate</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">add<wbr>OrUpdate<span class="tsd-signature-symbol">(</span>thread<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, info<span class="tsd-signature-symbol">: </span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L90">modules/threads.ts:90</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Adds or updates a thread directly, usually from a backup</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>thread: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>ID of the thread</p> </div> </li> <li> <h5>info: <a href="../modules/thread.html" class="tsd-signature-type">Thread</a></h5> <div class="tsd-comment tsd-typography"> <p>Thread object</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="get" class="tsd-anchor"></a> <h3>get</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<span class="tsd-signature-symbol">(</span>thread<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L100">modules/threads.ts:100</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Retrieve a thread by ID</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>thread: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>ID of the thread</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>A thread object</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getbykey" class="tsd-anchor"></a> <h3>get<wbr>ByKey</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>ByKey<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-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L111">modules/threads.ts:111</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Retrieve a thread by Key</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> <div class="tsd-comment tsd-typography"> <p>Key of the thread</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>A thread object</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getbyname" class="tsd-anchor"></a> <h3>get<wbr>ByName</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>ByName<span class="tsd-signature-symbol">(</span>name<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L123">modules/threads.ts:123</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Retrieve threads by Name</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> <div class="tsd-comment tsd-typography"> <p>Name of the thread</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules/thread.html" class="tsd-signature-type">Thread</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>An array thread objects</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="list" class="tsd-anchor"></a> <h3>list</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">list<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/threadlist.html" class="tsd-signature-type">ThreadList</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L135">modules/threads.ts:135</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Lists all local threads</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/threadlist.html" class="tsd-signature-type">ThreadList</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>An array of threads</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="peers" class="tsd-anchor"></a> <h3>peers</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">peers<span class="tsd-signature-symbol">(</span>thread<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/contactlist.html" class="tsd-signature-type">ContactList</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L185">modules/threads.ts:185</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>List all peers in a thread</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>thread: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>ID of the thread (default is &#39;default&#39;).</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/contactlist.html" class="tsd-signature-type">ContactList</a><span class="tsd-signature-symbol">&gt;</span></h4> <p>An array of thread contacts</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="remove" class="tsd-anchor"></a> <h3>remove</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">remove<span class="tsd-signature-symbol">(</span>thread<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L146">modules/threads.ts:146</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Leave and remove a thread by ID</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>thread: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>ID of the thread</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Whether the thread removal was successfull</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="removebykey" class="tsd-anchor"></a> <h3>remove<wbr>ByKey</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">remove<wbr>ByKey<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-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L157">modules/threads.ts:157</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Leave and remove a thread by Key</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> <div class="tsd-comment tsd-typography"> <p>thread.key of the thread</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Whether the thread removal was successfull</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="rename" class="tsd-anchor"></a> <h3>rename</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">rename<span class="tsd-signature-symbol">(</span>thread<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, name<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">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/textileio/js-http-client/blob/master/src/modules/threads.ts#L174">modules/threads.ts:174</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Renames a thread</p> </div> <p>Note: Only initiators can rename a thread.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>thread: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>ID of the thread</p> </div> </li> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>New name for the thread</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></h4> <p>Whether the rename was successfully</p> </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="../globals.html"><em>Globals</em></a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-class"> <a href="threads.html" class="tsd-kind-icon">Threads</a> <ul> <li class=" tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"> <a href="threads.html#constructor" class="tsd-kind-icon">constructor</a> </li> <li class=" tsd-kind-property tsd-parent-kind-class"> <a href="threads.html#schemas" class="tsd-kind-icon">schemas</a> </li> <li class=" tsd-kind-property tsd-parent-kind-class"> <a href="threads.html#snapshots" class="tsd-kind-icon">snapshots</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#add" class="tsd-kind-icon">add</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#addorupdate" class="tsd-kind-icon">add<wbr>OrUpdate</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#get" class="tsd-kind-icon">get</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#getbykey" class="tsd-kind-icon">get<wbr>ByKey</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#getbyname" class="tsd-kind-icon">get<wbr>ByName</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#list" class="tsd-kind-icon">list</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#peers" class="tsd-kind-icon">peers</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#remove" class="tsd-kind-icon">remove</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#removebykey" class="tsd-kind-icon">remove<wbr>ByKey</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="threads.html#rename" class="tsd-kind-icon">rename</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <footer> <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="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>