mirror of
https://github.com/zadam/trilium.git
synced 2025-12-22 08:09:55 +01:00
Update API Docs
This commit is contained in:
@@ -53,6 +53,25 @@ const NOTE_TYPE_ICONS = {
|
||||
"contentWidget": "bx bxs-widget"
|
||||
};
|
||||
|
||||
/**
|
||||
* There are many different Note types, some of which are entirely opaque to the
|
||||
* end user. Those types should be used only for checking against, they are
|
||||
* not for direct use.
|
||||
* @typedef {"file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code"} NoteType
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} NotePathRecord
|
||||
* @property {boolean} isArchived
|
||||
* @property {boolean} isInHoistedSubTree
|
||||
* @property {boolean} isSearch
|
||||
* @property {Array<string>} notePath
|
||||
* @property {boolean} isHidden
|
||||
*/
|
||||
|
||||
/**
|
||||
* Note is the main node and concept in Trilium.
|
||||
*/
|
||||
class FNote {
|
||||
/**
|
||||
* @param {Froca} froca
|
||||
@@ -93,8 +112,8 @@ class FNote {
|
||||
/** @type {boolean} */
|
||||
this.isProtected = !!row.isProtected;
|
||||
/**
|
||||
* one of 'text', 'code', 'file' or 'render'
|
||||
* @type {string}
|
||||
* See {@see NoteType} for info on values.
|
||||
* @type {NoteType}
|
||||
*/
|
||||
this.type = row.type;
|
||||
/**
|
||||
@@ -399,7 +418,7 @@ class FNote {
|
||||
|
||||
/**
|
||||
* @param {string} [hoistedNoteId='root']
|
||||
* @return {Array<{isArchived: boolean, isInHoistedSubTree: boolean, isSearch: boolean, notePath: Array<string>, isHidden: boolean}>}
|
||||
* @return {Array<NotePathRecord>}
|
||||
*/
|
||||
getSortedNotePathRecords(hoistedNoteId = 'root') {
|
||||
const isHoistedRoot = hoistedNoteId === 'root';
|
||||
@@ -478,7 +497,7 @@ class FNote {
|
||||
|
||||
/**
|
||||
* @param {FAttribute[]} attributes
|
||||
* @param {string} type
|
||||
* @param {AttributeType} type
|
||||
* @param {string} name
|
||||
* @return {FAttribute[]}
|
||||
* @private
|
||||
@@ -607,7 +626,7 @@ class FNote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {AttributeType} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
|
||||
*/
|
||||
@@ -618,7 +637,7 @@ class FNote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {AttributeType} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
|
||||
*/
|
||||
@@ -627,7 +646,7 @@ class FNote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {AttributeType} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {FAttribute} attribute of the given type and name. If there are more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
*/
|
||||
@@ -638,7 +657,7 @@ class FNote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {AttributeType} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {FAttribute} attribute of the given type and name. If there are more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
*/
|
||||
@@ -649,7 +668,7 @@ class FNote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {AttributeType} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {string} attribute value of the given type and name or null if no such attribute exists.
|
||||
*/
|
||||
@@ -660,7 +679,7 @@ class FNote {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {AttributeType} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {string} attribute value of the given type and name or null if no such attribute exists.
|
||||
*/
|
||||
@@ -1012,7 +1031,7 @@ export default FNote;
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidget.html">BasicWidget</a></li><li><a href="FAttachment.html">FAttachment</a></li><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteContextAwareWidget.html">NoteContextAwareWidget</a></li><li><a href="RightPanelWidget.html">RightPanelWidget</a></li></ul><h3>Global</h3><ul><li><a href="global.html#api">api</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
Reference in New Issue
Block a user