trilium/docs/backend_api/global.html

1724 lines
24 KiB
HTML
Raw Normal View History

2018-08-30 02:44:35 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2></h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="CreateNewNoteParams">CreateNewNoteParams</h4>
2018-08-30 02:44:35 +08:00
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>parentNoteId</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">MANDATORY</td>
2018-08-30 02:44:35 +08:00
</tr>
<tr>
<td class="name"><code>title</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">MANDATORY</td>
2018-08-30 02:44:35 +08:00
</tr>
<tr>
<td class="name"><code>content</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
<span class="param-type">string</span>
|
2018-08-30 02:44:35 +08:00
<span class="param-type">buffer</span>
2018-08-30 02:44:35 +08:00
</td>
2018-08-30 02:44:35 +08:00
<td class="description last">MANDATORY</td>
2018-08-30 02:44:35 +08:00
</tr>
<tr>
<td class="name"><code>type</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
2018-08-30 02:44:35 +08:00
<span class="param-type">string</span>
2018-08-30 02:44:35 +08:00
</td>
2018-08-30 02:44:35 +08:00
2018-08-30 02:44:35 +08:00
2018-08-30 02:44:35 +08:00
2022-12-15 06:51:56 +08:00
<td class="description last">text, code, file, image, search, book, relationMap, canvas - MANDATORY</td>
</tr>
2018-08-30 02:44:35 +08:00
<tr>
<td class="name"><code>mime</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
2019-11-26 05:45:09 +08:00
<span class="param-type">string</span>
2018-08-30 02:44:35 +08:00
</td>
<td class="description last">value is derived from default mimes for type</td>
2018-08-30 02:44:35 +08:00
</tr>
<tr>
<td class="name"><code>isProtected</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
<span class="param-type">boolean</span>
2018-08-30 02:44:35 +08:00
</td>
<td class="description last">default is false</td>
2019-11-26 05:45:09 +08:00
</tr>
<tr>
<td class="name"><code>isExpanded</code></td>
2019-11-26 05:45:09 +08:00
<td class="type">
2018-08-30 02:44:35 +08:00
<span class="param-type">boolean</span>
2019-11-26 05:45:09 +08:00
</td>
2018-08-30 02:44:35 +08:00
2019-11-26 05:45:09 +08:00
<td class="description last">default is false</td>
2018-08-30 02:44:35 +08:00
</tr>
<tr>
<td class="name"><code>prefix</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">default is empty string</td>
2019-11-26 05:45:09 +08:00
</tr>
<tr>
<td class="name"><code>notePosition</code></td>
2019-11-26 05:45:09 +08:00
<td class="type">
2018-08-30 02:44:35 +08:00
<span class="param-type">int</span>
2019-11-26 05:45:09 +08:00
</td>
2018-08-30 02:44:35 +08:00
<td class="description last">default is last existing notePosition in a parent + 10</td>
2018-08-30 02:44:35 +08:00
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2022-12-22 21:57:00 +08:00
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line212">line 212</a>
</li></ul></dd>
</dl>
2018-08-30 02:44:35 +08:00
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
2018-08-30 02:44:35 +08:00
<h5>Type:</h5>
<ul>
<li>
2018-08-30 02:44:35 +08:00
<span class="param-type">object</span>
</li>
</ul>
2018-08-30 02:44:35 +08:00
<h5 class="subsection-title">Properties:</h5>
2019-11-26 05:45:09 +08:00
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
2019-11-26 05:45:09 +08:00
<tr>
<td class="name"><code>type</code></td>
2019-11-26 05:45:09 +08:00
<td class="type">
2018-08-30 02:44:35 +08:00
<span class="param-type">string</span>
2019-11-26 05:45:09 +08:00
</td>
2018-08-30 02:44:35 +08:00
<td class="attributes">
</td>
2018-08-30 02:44:35 +08:00
2019-11-26 05:45:09 +08:00
<td class="description last">attribute type - label, relation etc.</td>
2018-08-30 02:44:35 +08:00
</tr>
<tr>
<td class="name"><code>name</code></td>
2018-08-30 02:44:35 +08:00
<td class="type">
2019-11-26 05:45:09 +08:00
<span class="param-type">string</span>
2018-08-30 02:44:35 +08:00
</td>
<td class="attributes">
2018-08-30 02:44:35 +08:00
</td>
2018-08-30 02:44:35 +08:00
<td class="description last">attribute name</td>
2019-11-26 05:45:09 +08:00
</tr>
<tr>
<td class="name"><code>value</code></td>
2019-11-26 05:45:09 +08:00
<td class="type">
2018-08-30 02:44:35 +08:00
<span class="param-type">string</span>
2019-11-26 05:45:09 +08:00
</td>
<td class="attributes">
&lt;optional><br>
</td>
2019-11-26 05:45:09 +08:00
2018-08-30 02:44:35 +08:00
<td class="description last">attribute value</td>
2018-08-30 02:44:35 +08:00
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2022-12-22 21:57:00 +08:00
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line173">line 173</a>
2018-08-30 02:44:35 +08:00
</li></ul></dd>
</dl>
2019-12-04 05:53:17 +08:00
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute type - label, relation etc.</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute name</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">attribute value</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2022-12-22 21:57:00 +08:00
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line233">line 233</a>
2019-12-04 05:53:17 +08:00
</li></ul></dd>
</dl>
<h4 class="name" id="CreateNoteExtraOptions">CreateNoteExtraOptions</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>json</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">should the note be JSON</td>
</tr>
<tr>
<td class="name"><code>isProtected</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">should the note be protected</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
'text'
</td>
<td class="description last">note type</td>
</tr>
<tr>
<td class="name"><code>mime</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
'text/html'
</td>
<td class="description last">MIME type of the note</td>
</tr>
<tr>
<td class="name"><code>attributes</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#CreateNoteAttribute">CreateNoteAttribute</a>></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
[]
</td>
<td class="description last">attributes to be created for this note</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2022-12-22 21:57:00 +08:00
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line240">line 240</a>
</li></ul></dd>
</dl>
<h4 class="name" id="CreateOrUpdateLauncher">CreateOrUpdateLauncher</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">id of the launcher, only alphanumeric at least 6 characters long</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">one of
* "note" - activating the launcher will navigate to the target note (specified in targetNoteId param)
* "script" - activating the launcher will execute the script (specified in scriptNoteId param)
* "customWidget" - the launcher will be rendered with a custom widget (specified in widgetNoteId param)</td>
</tr>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>isVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">if true, will be created in the "Visible launchers", otherwise in "Available launchers"</td>
</tr>
<tr>
<td class="name"><code>icon</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">name of the boxicon to be used (e.g. "bx-time")</td>
</tr>
<tr>
<td class="name"><code>keyboardShortcut</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">will activate the target note/script upon pressing, e.g. "ctrl+e"</td>
</tr>
<tr>
<td class="name"><code>targetNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">for type "note"</td>
</tr>
<tr>
<td class="name"><code>scriptNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">for type "script"</td>
</tr>
<tr>
<td class="name"><code>widgetNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">for type "customWidget"</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2022-12-25 20:03:22 +08:00
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line487">line 487</a>
</li></ul></dd>
</dl>
<h4 class="name" id="SortConfig">SortConfig</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>sortBy</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last">'title', 'dateCreated', 'dateModified' or a label name
see https://github.com/zadam/trilium/wiki/Sorting for details.</td>
</tr>
<tr>
<td class="name"><code>reverse</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>foldersFirst</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line400">line 400</a>
2019-12-04 05:53:17 +08:00
</li></ul></dd>
</dl>
2018-08-30 02:44:35 +08:00
</article>
</section>
</div>
<nav>
2022-12-25 20:03:22 +08:00
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
2018-08-30 02:44:35 +08:00
</nav>
<br class="clear">
<footer>
2022-11-08 04:26:13 +08:00
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
2018-08-30 02:44:35 +08:00
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>