- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -1174,7 +1172,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BAttachment.html b/docs/backend_api/BAttachment.html
new file mode 100644
index 000000000..1ab7b403f
--- /dev/null
+++ b/docs/backend_api/BAttachment.html
@@ -0,0 +1,2873 @@
+
+
+
+
+ JSDoc: Class: BAttachment
+
+
+
+
+
+
+
+
+
+
+
+
+
Class: BAttachment
+
+
+
+
+
+
+
+
+
+
+
BAttachment()
+
+
Attachment represent data related/attached to the note. Conceptually similar to attributes, but intended for
larger amounts of data and generally not accessible to the user.
+ true if the note has string content (not binary)
+
+
+
+
+
+
+ Type
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
markAsDeleted(deleteIdopt)
+
+
+
+
+
+
+
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/backend_api/BAttribute.html b/docs/backend_api/BAttribute.html
index cc20d0db8..cc67f7642 100644
--- a/docs/backend_api/BAttribute.html
+++ b/docs/backend_api/BAttribute.html
@@ -30,8 +30,7 @@
BAttribute()
-
Attribute is an abstract concept which has two real uses - label (key - value pair)
-and relation (representing named relationship between source and target note)
+
Attribute is an abstract concept which has two real uses - label (key - value pair)
and relation (representing named relationship between source and target note)
@@ -94,7 +93,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -1736,9 +1735,7 @@ and relation (representing named relationship between source and target note)
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -2097,7 +2094,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BBranch.html b/docs/backend_api/BBranch.html
index 4e716ec2e..b1ad91429 100644
--- a/docs/backend_api/BBranch.html
+++ b/docs/backend_api/BBranch.html
@@ -30,11 +30,7 @@
BBranch()
-
Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
-parents.
-
-Note that you should not rely on the branch's identity, since it can change easily with a note's move.
-Always check noteId instead.
+
Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
parents.
Note that you should not rely on the branch's identity, since it can change easily with a note's move.
Always check noteId instead.
@@ -421,11 +417,7 @@ Always check noteId instead.
- Branch is weak when its existence should not hinder deletion of its note.
-As a result, note with only weak branches should be immediately deleted.
-An example is shared or bookmarked clones - they are created automatically and exist for technical reasons,
-not as user-intended actions. From user perspective, they don't count as real clones and for the purpose
-of deletion should not act as a clone.
+ Branch is weak when its existence should not hinder deletion of its note.
As a result, note with only weak branches should be immediately deleted.
An example is shared or bookmarked clones - they are created automatically and exist for technical reasons,
not as user-intended actions. From user perspective, they don't count as real clones and for the purpose
of deletion should not act as a clone.
@@ -549,7 +541,7 @@ of deletion should not act as a clone.
-
@@ -1850,9 +1842,7 @@ of deletion should not act as a clone.
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -2211,7 +2201,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BEtapiToken.html b/docs/backend_api/BEtapiToken.html
index 6fce5b28a..4fc677120 100644
--- a/docs/backend_api/BEtapiToken.html
+++ b/docs/backend_api/BEtapiToken.html
@@ -30,13 +30,7 @@
BEtapiToken()
-
EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
-Used by:
-- Trilium Sender
-- ETAPI clients
-
-The format user is presented with is "_". This is also called "authToken" to distinguish it
-from tokenHash and token.
+
EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
Used by:
- Trilium Sender
- ETAPI clients
The format user is presented with is "_". This is also called "authToken" to distinguish it
from tokenHash and token.
@@ -1293,9 +1287,7 @@ from tokenHash and token.
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -1654,7 +1646,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BNote.html b/docs/backend_api/BNote.html
index 6c07103c9..e7eef679a 100644
--- a/docs/backend_api/BNote.html
+++ b/docs/backend_api/BNote.html
@@ -93,7 +93,7 @@
- - set during the deletion operation, before it is completed (removed from becca completely)
+ set during the deletion operation, before it is completed (removed from becca completely)
- Adds a new attribute to this note. The attribute is saved and returned.
-See addLabel, addRelation for more specific methods.
+ Adds a new attribute to this note. The attribute is saved and returned.
See addLabel, addRelation for more specific methods.
@@ -1518,7 +1517,7 @@ See addLabel, addRelation for more specific methods.
-int
+int
|
null
@@ -1588,7 +1587,7 @@ See addLabel, addRelation for more specific methods.
@@ -1897,8 +1896,7 @@ See addLabel, addRelation for more specific methods.
- Adds a new relation to this note. The relation attribute is saved and
-returned.
+ Adds a new relation to this note. The relation attribute is saved and
returned.
- Some notes are eligible for conversion into an attachment of its parent, note must have these properties:
-- it has exactly one target relation
-- it has a relation from its parent note
-- it has no children
-- it has no clones
-- the parent is of type text
-- both notes are either unprotected or user is in protected session
-
-Currently, works only for image notes.
-
-In the future, this functionality might get more generic and some of the requirements relaxed.
+ Some notes are eligible for conversion into an attachment of its parent, note must have these properties:
- it has exactly one target relation
- it has a relation from its parent note
- it has no children
- it has no clones
- the parent is of type text
- both notes are either unprotected or user is in protected session
Currently, works only for image notes.
In the future, this functionality might get more generic and some of the requirements relaxed.
@@ -2432,7 +2420,7 @@ In the future, this functionality might get more generic and some of the require
@@ -3639,8 +3627,7 @@ In the future, this functionality might get more generic and some of the require
- 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.
+ 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.
@@ -3789,7 +3776,7 @@ In the future, this functionality might get more generic and some of the require
@@ -3858,8 +3845,7 @@ In the future, this functionality might get more generic and some of the require
- Beware that the method must not create a copy of the array, but actually returns its internal array
-(for performance reasons)
+ Beware that the method must not create a copy of the array, but actually returns its internal array
(for performance reasons)
@@ -3997,7 +3983,7 @@ In the future, this functionality might get more generic and some of the require
@@ -5203,8 +5187,7 @@ In the future, this functionality might get more generic and some of the require
- - returns only notes which are templated, does not include their subtrees
- in effect returns notes which are influenced by note's non-inheritable attributes
+ - returns only notes which are templated, does not include their subtrees
in effect returns notes which are influenced by note's non-inheritable attributes
@@ -5281,7 +5264,7 @@ In the future, this functionality might get more generic and some of the require
@@ -6062,9 +6045,7 @@ In the future, this functionality might get more generic and some of the require
- attribute belonging to this specific note (excludes inherited attributes)
-
-This method can be significantly faster than the getAttribute()
+ attribute belonging to this specific note (excludes inherited attributes)
This method can be significantly faster than the getAttribute()
@@ -6213,7 +6194,7 @@ This method can be significantly faster than the getAttribute()
@@ -6282,8 +6263,7 @@ This method can be significantly faster than the getAttribute()
- Beware that the method must not create a copy of the array, but actually returns its internal array
-(for performance reasons)
+ Beware that the method must not create a copy of the array, but actually returns its internal array
(for performance reasons)
@@ -6483,7 +6463,7 @@ This method can be significantly faster than the getAttribute()
@@ -12121,9 +12101,7 @@ This method can be significantly faster than the getAttribute()
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -12536,7 +12514,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
@@ -14754,7 +14732,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BOption.html b/docs/backend_api/BOption.html
index 11696ebaf..5c7ef66ae 100644
--- a/docs/backend_api/BOption.html
+++ b/docs/backend_api/BOption.html
@@ -1151,9 +1151,7 @@
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -1512,7 +1510,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BRecentNote.html b/docs/backend_api/BRecentNote.html
index d339e4657..ff83f10a1 100644
--- a/docs/backend_api/BRecentNote.html
+++ b/docs/backend_api/BRecentNote.html
@@ -1083,9 +1083,7 @@
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
@@ -1444,7 +1442,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
diff --git a/docs/backend_api/BRevision.html b/docs/backend_api/BRevision.html
new file mode 100644
index 000000000..d34781be5
--- /dev/null
+++ b/docs/backend_api/BRevision.html
@@ -0,0 +1,2690 @@
+
+
+
+
+ JSDoc: Class: BRevision
+
+
+
+
+
+
+
+
+
+
+
+
+
Class: BRevision
+
+
+
+
+
+
+
+
+
+
+
BRevision()
+
+
Revision represents a snapshot of note's title and content at some point in the past.
It's used for seamless note versioning.
+ true if the note has string content (not binary)
+
+
+
+
+
+
+ Type
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
markAsDeleted(deleteIdopt)
+
+
+
+
+
+
+
+ Mark the entity as (soft) deleted. It will be completely erased later.
This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html
index b5c348b05..fb7f79735 100644
--- a/docs/backend_api/BackendScriptApi.html
+++ b/docs/backend_api/BackendScriptApi.html
@@ -49,8 +49,7 @@
-
This is the main backend API interface for scripts. All the properties and methods are published in the "api" object
-available in the JS backend notes. You can use e.g. api.log(api.startNote.title);
+
This is the main backend API interface for scripts. All the properties and methods are published in the "api" object
available in the JS backend notes. You can use e.g. api.log(api.startNote.title);
@@ -94,7 +93,7 @@ available in the JS backend notes. You can use e.g. api.log(api.startNote.
@@ -1048,8 +781,7 @@ available in the JS backend notes. You can use e.g. api.log(api.startNote.
- Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
-JSON MIME type. See also createNewNote() for more options.
+ Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
JSON MIME type. See also createNewNote() for more options.
@@ -1188,7 +920,7 @@ JSON MIME type. See also createNewNote() for more options.
@@ -1246,7 +978,7 @@ JSON MIME type. See also createNewNote() for more options.
-
createNewNote() → {Object}
+
createNewNote(params) → {Object}
@@ -1261,15 +993,10 @@ JSON MIME type. See also createNewNote() for more options.
-
-
-
-
-
Properties:
-
+
Parameters:
-
+
@@ -1309,8 +1036,9 @@ JSON MIME type. See also createNewNote() for more options.
Properties
+
-
+
@@ -1353,6 +1081,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1386,6 +1116,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1411,7 +1143,7 @@ JSON MIME type. See also createNewNote() for more options.
string
|
-buffer
+Buffer
@@ -1422,6 +1154,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1444,7 +1178,7 @@ JSON MIME type. See also createNewNote() for more options.
-string
+NoteType
@@ -1455,6 +1189,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1490,6 +1226,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1525,6 +1263,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1562,6 +1302,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1599,6 +1341,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1623,7 +1367,7 @@ JSON MIME type. See also createNewNote() for more options.
-int
+int
@@ -1636,6 +1380,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1662,6 +1408,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -1691,7 +1439,7 @@ JSON MIME type. See also createNewNote() for more options.
@@ -1934,23 +1682,11 @@ JSON MIME type. See also createNewNote() for more options.
-
-
+
+
Properties
+
-
-
-
-
-
-
-
-
-
-
Properties:
-
-
-
-
+
@@ -1976,7 +1712,7 @@ JSON MIME type. See also createNewNote() for more options.
-
extraOptions.json
+
json
@@ -1995,6 +1731,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2013,7 +1751,7 @@ JSON MIME type. See also createNewNote() for more options.
-
extraOptions.isProtected
+
isProtected
@@ -2032,6 +1770,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2050,7 +1790,7 @@ JSON MIME type. See also createNewNote() for more options.
-
extraOptions.type
+
type
@@ -2069,6 +1809,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2087,7 +1829,7 @@ JSON MIME type. See also createNewNote() for more options.
-
extraOptions.mime
+
mime
@@ -2106,6 +1848,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2124,7 +1868,7 @@ JSON MIME type. See also createNewNote() for more options.
-
extraOptions.attributes
+
attributes
@@ -2143,6 +1887,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2156,8 +1902,9 @@ JSON MIME type. See also createNewNote() for more options.
attributes to be created for this note
Properties
+
-
+
@@ -2187,7 +1934,7 @@ JSON MIME type. See also createNewNote() for more options.
-string
+AttributeType
@@ -2198,6 +1945,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2227,6 +1976,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2258,6 +2009,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2277,6 +2030,15 @@ JSON MIME type. See also createNewNote() for more options.
+
+
+
+
+
+
+
+
+
@@ -2311,7 +2073,7 @@ JSON MIME type. See also createNewNote() for more options.
@@ -2429,23 +2191,11 @@ JSON MIME type. See also createNewNote() for more options.
-
-
+
+
Properties
+
-
-
-
-
-
-
-
-
-
-
Properties:
-
-
-
-
+
@@ -2471,7 +2221,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.id
+
id
@@ -2488,6 +2238,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2504,13 +2256,19 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.type
+
type
-string
+"note"
+|
+
+"script"
+|
+
+"customWidget"
@@ -2521,6 +2279,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2530,17 +2290,14 @@ JSON MIME type. See also createNewNote() for more options.
-
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)
+
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)
-
opts.title
+
title
@@ -2557,6 +2314,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2573,7 +2332,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.isVisible
+
isVisible
@@ -2592,6 +2351,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2610,7 +2371,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.icon
+
icon
@@ -2629,6 +2390,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2645,7 +2408,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.keyboardShortcut
+
keyboardShortcut
@@ -2664,6 +2427,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2680,7 +2445,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.targetNoteId
+
targetNoteId
@@ -2699,6 +2464,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2715,7 +2482,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.scriptNoteId
+
scriptNoteId
@@ -2734,6 +2501,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2750,7 +2519,7 @@ JSON MIME type. See also createNewNote() for more options.
-
opts.widgetNoteId
+
widgetNoteId
@@ -2769,6 +2538,8 @@ JSON MIME type. See also createNewNote() for more options.
+
+
@@ -2785,6 +2556,15 @@ JSON MIME type. See also createNewNote() for more options.
+
+
+
+
+
+
+
+
+
@@ -2817,7 +2597,7 @@ JSON MIME type. See also createNewNote() for more options.
@@ -4433,8 +4213,7 @@ JSON MIME type. See also createNewNote() for more options.
- Instance name identifies particular Trilium instance. It can be useful for scripts
-if some action needs to happen on only one specific instance.
+ Instance name identifies particular Trilium instance. It can be useful for scripts
if some action needs to happen on only one specific instance.
@@ -4478,7 +4257,7 @@ if some action needs to happen on only one specific instance.
@@ -6389,8 +6168,7 @@ if some action needs to happen on only one specific instance.
- This is a powerful search method - you can search by attributes and their values, e.g.:
-"#dateModified =* MONTH AND #log". See https://github.com/zadam/trilium/wiki/Search for full documentation for all options
+ This is a powerful search method - you can search by attributes and their values, e.g.:
"#dateModified =* MONTH AND #log". See https://github.com/zadam/trilium/wiki/Search for full documentation for all options
@@ -6526,7 +6304,7 @@ if some action needs to happen on only one specific instance.
@@ -6591,8 +6369,7 @@ if some action needs to happen on only one specific instance.
- This is a powerful search method - you can search by attributes and their values, e.g.:
-"#dateModified =* MONTH AND #log". See https://github.com/zadam/trilium/wiki/Search for full documentation for all options
+ This is a powerful search method - you can search by attributes and their values, e.g.:
"#dateModified =* MONTH AND #log". See https://github.com/zadam/trilium/wiki/Search for full documentation for all options
@@ -6728,7 +6505,7 @@ if some action needs to happen on only one specific instance.
@@ -6790,10 +6567,7 @@ if some action needs to happen on only one specific instance.
- This method finds note by its noteId and prefix and either sets it to the given parentNoteId
-or removes the branch (if parentNoteId is not given).
-
-This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
+ This method finds note by its noteId and prefix and either sets it to the given parentNoteId
or removes the branch (if parentNoteId is not given).
This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
@@ -6937,7 +6711,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
@@ -7558,7 +7334,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
-
transactional(func) → {?}
+
transactional(func) → {any}
@@ -7566,8 +7342,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
- This functions wraps code which is supposed to be running in transaction. If transaction already
-exists, then we'll use that transaction.
+ This functions wraps code which is supposed to be running in transaction. If transaction already
exists, then we'll use that transaction.
@@ -7660,7 +7435,7 @@ exists, then we'll use that transaction.
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/frontend_api/FAttribute.html b/docs/frontend_api/FAttribute.html
index 7d05e5b0a..4ef3ae3ee 100644
--- a/docs/frontend_api/FAttribute.html
+++ b/docs/frontend_api/FAttribute.html
@@ -30,8 +30,7 @@
FAttribute()
-
Attribute is an abstract concept which has two real uses - label (key - value pair)
-and relation (representing named relationship between source and target note)
+
Attribute is an abstract concept which has two real uses - label (key - value pair)
and relation (representing named relationship between source and target note)
@@ -94,7 +93,7 @@ and relation (representing named relationship between source and target note)Source:
This is the main frontend API interface for scripts. All the properties and methods are published in the "api" object
-available in the JS frontend notes. You can use e.g. api.showMessage(api.startNote.title);
+
This is the main frontend API interface for scripts. All the properties and methods are published in the "api" object
available in the JS frontend notes. You can use e.g. api.showMessage(api.startNote.title);
@@ -94,7 +93,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
@@ -1455,23 +1157,11 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
-
-
+
+
Properties
+
-
-
-
-
-
-
-
-
-
-
Properties:
-
-
-
-
+
@@ -1495,7 +1185,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
-
opts.id
+
title
@@ -1510,38 +1200,8 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
- <optional>
-
-
-
-
-
-
-
id of the button, used to identify the old instances of this button to be replaced
- ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
-
-
-
-
-
-
-
opts.title
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
@@ -1556,38 +1216,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
-
opts.icon
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
name of the boxicon to be used (e.g. "time" for "bx-time" icon)
-
-
-
-
-
-
-
opts.action
+
action
@@ -1604,6 +1233,8 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
+
+
@@ -1616,7 +1247,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
-
opts.shortcut
+
id
@@ -1635,6 +1266,74 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
+
+
+
+
+
+
+
+
id of the button, used to identify the old instances of this button to be replaced
ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
+
+
+
+
+
+
+
icon
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
name of the boxicon to be used (e.g. "time" for "bx-time" icon)
+
+
+
+
+
+
+
shortcut
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
@@ -1647,6 +1346,15 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
+
+
+
+
+
+
+
+
+
@@ -1667,8 +1375,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
-
Deprecated:
you can now create/modify launchers in the top-left Menu -> Configure Launchbar
- for special needs there's also backend API's createOrUpdateLauncher()
+
Deprecated:
you can now create/modify launchers in the top-left Menu -> Configure Launchbar
for special needs there's also backend API's createOrUpdateLauncher()
@@ -1682,7 +1389,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
@@ -1985,8 +1692,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
-
specify namespace of the handler for the cases where call for bind may be repeated.
- If a handler with this ID exists, it's replaced by the new handler.
+
specify namespace of the handler for the cases where call for bind may be repeated.
If a handler with this ID exists, it's replaced by the new handler.
@@ -2027,7 +1733,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
@@ -3352,8 +3058,7 @@ available in the JS frontend notes. You can use e.g. api.showMessage(api.s
- Get access to the widget handling note detail. Methods like `getWidgetType()` and `getTypeWidget()` to get to the
-implementation of actual widget type.
+ Get access to the widget handling note detail. Methods like `getWidgetType()` and `getTypeWidget()` to get to the
implementation of actual widget type.
@@ -3397,7 +3102,7 @@ implementation of actual widget type.
@@ -3769,8 +3474,7 @@ implementation of actual widget type.
- Instance name identifies particular Trilium instance. It can be useful for scripts
-if some action needs to happen on only one specific instance.
+ Instance name identifies particular Trilium instance. It can be useful for scripts
if some action needs to happen on only one specific instance.
@@ -3814,7 +3518,7 @@ if some action needs to happen on only one specific instance.
@@ -4031,8 +3735,7 @@ if some action needs to happen on only one specific instance.
- Returns note by given noteId. If note is missing from the cache, it's loaded.
-*
+ Returns note by given noteId. If note is missing from the cache, it's loaded.
*
@@ -4125,7 +3828,7 @@ if some action needs to happen on only one specific instance.
@@ -4187,10 +3890,7 @@ if some action needs to happen on only one specific instance.
- Returns list of notes. If note is missing from the cache, it's loaded.
-
-This is often used to bulk-fill the cache with notes which would have to be picked one by one
-otherwise (by e.g. createLink())
+ Returns list of notes. If note is missing from the cache, it's loaded.
This is often used to bulk-fill the cache with notes which would have to be picked one by one
otherwise (by e.g. createLink())
@@ -4326,7 +4026,7 @@ otherwise (by e.g. createLink())
@@ -6251,7 +5951,7 @@ otherwise (by e.g. createLink())
-
runOnBackend(script, params) → {Promise.<*>}
+
runOnBackend(script, params) → {Promise.<any>}
@@ -6259,8 +5959,7 @@ otherwise (by e.g. createLink())
- Executes given anonymous function on the backend.
-Internally this serializes the anonymous function into string and sends it to backend via AJAX.
+ Executes given anonymous function on the backend.
Internally this serializes the anonymous function into string and sends it to backend via AJAX.
@@ -6303,6 +6002,9 @@ Internally this serializes the anonymous function into string and sends it to ba
string
+|
+
+function
@@ -6325,7 +6027,7 @@ Internally this serializes the anonymous function into string and sends it to ba
-Array.<?>
+Array.<any>
@@ -6376,7 +6078,7 @@ Internally this serializes the anonymous function into string and sends it to ba
@@ -6416,7 +6118,7 @@ Internally this serializes the anonymous function into string and sends it to ba
-Promise.<*>
+Promise.<any>
@@ -6442,8 +6144,7 @@ Internally this serializes the anonymous function into string and sends it to ba
- This is a powerful search method - you can search by attributes and their values, e.g.:
-"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+ This is a powerful search method - you can search by attributes and their values, e.g.:
"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
@@ -6536,7 +6237,7 @@ Internally this serializes the anonymous function into string and sends it to ba
@@ -6598,8 +6299,7 @@ Internally this serializes the anonymous function into string and sends it to ba
- This is a powerful search method - you can search by attributes and their values, e.g.:
-"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+ This is a powerful search method - you can search by attributes and their values, e.g.:
"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
@@ -6692,7 +6392,7 @@ Internally this serializes the anonymous function into string and sends it to ba
@@ -7654,11 +7354,7 @@ Internally this serializes the anonymous function into string and sends it to ba
- Trilium runs in a backend and frontend process, when something is changed on the backend from a script,
-frontend will get asynchronously synchronized.
-
-This method returns a promise which resolves once all the backend -> frontend synchronization is finished.
-Typical use case is when a new note has been created, we should wait until it is synced into frontend and only then activate it.
+ Trilium runs in a backend and frontend process, when something is changed on the backend from a script,
frontend will get asynchronously synchronized.
This method returns a promise which resolves once all the backend -> frontend synchronization is finished.
Typical use case is when a new note has been created, we should wait until it is synced into frontend and only then activate it.
@@ -7702,7 +7398,7 @@ Typical use case is when a new note has been created, we should wait until it is
@@ -7766,7 +7462,7 @@ Typical use case is when a new note has been created, we should wait until it is
diff --git a/docs/frontend_api/NoteContextAwareWidget.html b/docs/frontend_api/NoteContextAwareWidget.html
new file mode 100644
index 000000000..32692483d
--- /dev/null
+++ b/docs/frontend_api/NoteContextAwareWidget.html
@@ -0,0 +1,1029 @@
+
+
+
+
+ JSDoc: Class: NoteContextAwareWidget
+
+
+
+
+
+
+
+
+
+
+
+
+
Class: NoteContextAwareWidget
+
+
+
+
+
+
+
+
+
+
+
NoteContextAwareWidget()
+
+
This widget allows for changing and updating depending on the active note.
import promotedAttributeDefinitionParser from '../services/promoted_attribute_definition_parser.js';
+/**
+ * There are currently only two types of attributes, labels or relations.
+ * @typedef {"label" | "relation"} AttributeType
+ */
+
/**
* Attribute is an abstract concept which has two real uses - label (key - value pair)
* and relation (representing named relationship between source and target note)
@@ -45,7 +50,7 @@ class FAttribute {
this.attributeId = row.attributeId;
/** @type {string} */
this.noteId = row.noteId;
- /** @type {string} */
+ /** @type {AttributeType} */
this.type = row.type;
/** @type {string} */
this.name = row.name;
@@ -116,7 +121,7 @@ export default FAttribute;
diff --git a/docs/frontend_api/entities_fblob.js.html b/docs/frontend_api/entities_fblob.js.html
new file mode 100644
index 000000000..811119774
--- /dev/null
+++ b/docs/frontend_api/entities_fblob.js.html
@@ -0,0 +1,69 @@
+
+
+
+
+ JSDoc: Source: entities/fblob.js
+
+
+
+
+
+
+
+
+
+
+
+
+
Source: entities/fblob.js
+
+
+
+
+
+
+
+
+
export default class FBlob {
+ constructor(row) {
+ /** @type {string} */
+ this.blobId = row.blobId;
+
+ /**
+ * can either contain the whole content (in e.g. string notes), only part (large text notes) or nothing at all (binary notes, images)
+ * @type {string}
+ */
+ this.content = row.content;
+ this.contentLength = row.contentLength;
+
+ /** @type {string} */
+ this.dateModified = row.dateModified;
+ /** @type {string} */
+ this.utcDateModified = row.utcDateModified;
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/frontend_api/entities_fbranch.js.html b/docs/frontend_api/entities_fbranch.js.html
index 1d663d7de..95ef4d084 100644
--- a/docs/frontend_api/entities_fbranch.js.html
+++ b/docs/frontend_api/entities_fbranch.js.html
@@ -100,7 +100,7 @@ export default FBranch;
diff --git a/docs/frontend_api/entities_fnote.js.html b/docs/frontend_api/entities_fnote.js.html
index 99231fa38..5fefcb779 100644
--- a/docs/frontend_api/entities_fnote.js.html
+++ b/docs/frontend_api/entities_fnote.js.html
@@ -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;
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html
new file mode 100644
index 000000000..6d15487aa
--- /dev/null
+++ b/docs/frontend_api/global.html
@@ -0,0 +1,678 @@
+
+
+
+
+ JSDoc: Global
+
+
+
+
+
+
+
+
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/frontend_api/index.html b/docs/frontend_api/index.html
index 46ccdc9a8..1c6319630 100644
--- a/docs/frontend_api/index.html
+++ b/docs/frontend_api/index.html
@@ -50,7 +50,7 @@
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index 3540460c6..7780bc7a5 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -43,6 +43,18 @@ import BasicWidget from "../widgets/basic_widget.js";
import SpacedUpdate from "./spaced_update.js";
import shortcutService from "./shortcuts.js";
+
+/**
+ * A whole number
+ * @typedef {number} int
+ */
+
+/**
+ * An instance of the frontend api available globally.
+ * @global
+ * @var {FrontendScriptApi} api
+ */
+
/**
* <p>This is the main frontend API interface for scripts. All the properties and methods are published in the "api" object
* available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.startNote.title);</code></p>
@@ -50,26 +62,44 @@ import shortcutService from "./shortcuts.js";
* @constructor
*/
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
- /** @property {jQuery} container of all the rendered script content */
+ /**
+ * Container of all the rendered script content
+ * @type {jQuery}
+ * */
this.$container = $container;
- /** @property {object} note where the script started executing */
+ /**
+ * Note where the script started executing
+ * @type {FNote}
+ */
this.startNote = startNote;
- /** @property {object} note where the script is currently executing */
+
+ /**
+ * Note where the script is currently executing
+ * @type {FNote}
+ */
this.currentNote = currentNote;
- /** @property {object|null} entity whose event triggered this execution */
+ /**
+ * Entity whose event triggered this execution
+ * @type {object|null}
+ */
this.originEntity = originEntity;
- /** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
+ /**
+ * day.js library for date manipulation.
+ * See {@link https://day.js.org} for documentation
+ * @see https://day.js.org
+ * @type {dayjs}
+ */
this.dayjs = dayjs;
- /** @property {RightPanelWidget} */
+ /** @type {RightPanelWidget} */
this.RightPanelWidget = RightPanelWidget;
- /** @property {NoteContextAwareWidget} */
+ /** @type {NoteContextAwareWidget} */
this.NoteContextAwareWidget = NoteContextAwareWidget;
- /** @property {BasicWidget} */
+ /** @type {BasicWidget} */
this.BasicWidget = BasicWidget;
/**
@@ -142,12 +172,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @deprecated you can now create/modify launchers in the top-left Menu -> Configure Launchbar
* for special needs there's also backend API's createOrUpdateLauncher()
* @param {object} opts
- * @property {string} [opts.id] - id of the button, used to identify the old instances of this button to be replaced
+ * @param {string} opts.title
+ * @param {function} opts.action - callback handling the click on the button
+ * @param {string} [opts.id] - id of the button, used to identify the old instances of this button to be replaced
* ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
- * @property {string} opts.title
- * @property {string} [opts.icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
- * @property {function} opts.action - callback handling the click on the button
- * @property {string} [opts.shortcut] - keyboard shortcut for the button, e.g. "alt+t"
+ * @param {string} [opts.icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
+ * @param {string} [opts.shortcut] - keyboard shortcut for the button, e.g. "alt+t"
*/
this.addButtonToToolbar = async opts => {
console.warn("api.addButtonToToolbar() has been deprecated since v0.58 and may be removed in the future. Use Menu -> Configure Launchbar to create/update launchers instead.");
@@ -178,9 +208,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Internally this serializes the anonymous function into string and sends it to backend via AJAX.
*
* @method
- * @param {string} script - script to be executed on the backend
- * @param {Array.<?>} params - list of parameters to the anonymous function to be sent to backend
- * @returns {Promise<*>} return value of the executed function on the backend
+ * @param {string|Function} script - script to be executed on the backend
+ * @param {Array<any>} params - list of parameters to the anonymous function to be sent to backend
+ * @returns {Promise<any>} return value of the executed function on the backend
*/
this.runOnBackend = async (script, params = []) => {
if (typeof script === "function") {
@@ -328,7 +358,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @param {boolean} [params.showTooltip=true] - enable/disable tooltip on the link
* @param {boolean} [params.showNotePath=false] - show also whole note's path as part of the link
* @param {boolean} [params.showNoteIcon=false] - show also note icon before the title
- * @param {string} [params.title=] - custom link tile with note's title as default
+ * @param {string} [params.title] - custom link tile with note's title as default
*/
this.createLink = linkService.createLink;
@@ -569,7 +599,7 @@ export default FrontendScriptApi;
diff --git a/docs/frontend_api/widgets_basic_widget.js.html b/docs/frontend_api/widgets_basic_widget.js.html
new file mode 100644
index 000000000..01c2dc537
--- /dev/null
+++ b/docs/frontend_api/widgets_basic_widget.js.html
@@ -0,0 +1,230 @@
+
+
+
+
+ JSDoc: Source: widgets/basic_widget.js
+
+
+
+
+
+
+
+
+
+
+
import NoteContextAwareWidget from "./note_context_aware_widget.js";
+
+const WIDGET_TPL = `
+<div class="card widget">
+ <div class="card-header"></div>
+
+ <div id="[to be set]" class="body-wrapper">
+ <div class="card-body"></div>
+ </div>
+</div>`;
+
+/**
+ * This widget manages rendering panels in the right-hand pane.
+ * @extends {NoteContextAwareWidget}
+ */
+class RightPanelWidget extends NoteContextAwareWidget {
+ /** Title to show in the panel. */
+ get widgetTitle() { return "Untitled widget"; }
+
+ get help() { return {}; }
+
+ /**
+ * Do not override this method unless you know what you're doing.
+ */
+ doRender() {
+ this.$widget = $(WIDGET_TPL);
+ this.contentSized();
+ this.$widget.find('[data-target]').attr('data-target', `#${this.componentId}`);
+
+ this.$bodyWrapper = this.$widget.find('.body-wrapper');
+ this.$bodyWrapper.attr('id', this.componentId); // for toggle to work we need id
+
+ this.$body = this.$bodyWrapper.find('.card-body');
+
+ this.$title = this.$widget.find('.card-header');
+ this.$title.text(this.widgetTitle);
+
+ this.initialized = this.doRenderBody();
+ }
+
+ /**
+ * Method used for rendering the body of the widget.
+ *
+ * Your class should override this method.
+ * @returns {JQuery<HTMLElement>} The body of your widget.
+ */
+ async doRenderBody() {}
+}
+
+export default RightPanelWidget;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/package.json b/package.json
index 303bbe782..9ff348e93 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,7 @@
"switch-server": "rm -rf ./node_modules/better-sqlite3 && npm install",
"switch-electron": "./node_modules/.bin/electron-rebuild",
"build-backend-docs": "rm -rf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
- "build-frontend-docs": "rm -rf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/right_panel_widget.js",
+ "build-frontend-docs": "rm -rf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
"webpack": "webpack -c webpack.config.js",
"test-jasmine": "jasmine",
diff --git a/src/becca/entities/battachment.js b/src/becca/entities/battachment.js
index 9da0835f9..2906ef2fe 100644
--- a/src/becca/entities/battachment.js
+++ b/src/becca/entities/battachment.js
@@ -38,7 +38,10 @@ class BAttachment extends AbstractBeccaEntity {
/** @type {string} */
this.attachmentId = row.attachmentId;
- /** @type {string} either noteId or revisionId to which this attachment belongs */
+ /**
+ * either noteId or revisionId to which this attachment belongs
+ * @type {string}
+ */
this.ownerId = row.ownerId;
/** @type {string} */
this.role = row.role;
@@ -59,7 +62,10 @@ class BAttachment extends AbstractBeccaEntity {
/** @type {string} */
this.utcDateScheduledForErasureSince = row.utcDateScheduledForErasureSince;
- /** @type {int} optionally added to the entity */
+ /**
+ * optionally added to the entity
+ * @type {int}
+ */
this.contentLength = row.contentLength;
this.decrypt();
diff --git a/src/becca/entities/battribute.js b/src/becca/entities/battribute.js
index 41046b7e1..d09020269 100644
--- a/src/becca/entities/battribute.js
+++ b/src/becca/entities/battribute.js
@@ -7,6 +7,12 @@ const dateUtils = require("../../services/date_utils");
const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name");
+
+/**
+ * There are currently only two types of attributes, labels or relations.
+ * @typedef {"label" | "relation"} AttributeType
+ */
+
/**
* Attribute is an abstract concept which has two real uses - label (key - value pair)
* and relation (representing named relationship between source and target note)
@@ -47,7 +53,7 @@ class BAttribute extends AbstractBeccaEntity {
this.attributeId = attributeId;
/** @type {string} */
this.noteId = noteId;
- /** @type {string} */
+ /** @type {AttributeType} */
this.type = type;
/** @type {string} */
this.name = name;
diff --git a/src/becca/entities/bnote.js b/src/becca/entities/bnote.js
index 050fdd08d..4a827aafb 100644
--- a/src/becca/entities/bnote.js
+++ b/src/becca/entities/bnote.js
@@ -17,6 +17,21 @@ dayjs.extend(utc);
const LABEL = 'label';
const RELATION = 'relation';
+/**
+ * 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 {Array} notePath
+ * @property {boolean} isHidden
+ */
+
/**
* Trilium's main entity, which can represent text note, image, code note, file attachment etc.
*
@@ -60,7 +75,7 @@ class BNote extends AbstractBeccaEntity {
this.noteId = noteId;
/** @type {string} */
this.title = title;
- /** @type {string} */
+ /** @type {NoteType} */
this.type = type;
/** @type {string} */
this.mime = mime;
@@ -76,7 +91,10 @@ class BNote extends AbstractBeccaEntity {
this.utcDateCreated = utcDateCreated || dateUtils.utcNowDateTime();
/** @type {string} */
this.utcDateModified = utcDateModified;
- /** @type {boolean} - set during the deletion operation, before it is completed (removed from becca completely) */
+ /**
+ * set during the deletion operation, before it is completed (removed from becca completely)
+ * @type {boolean}
+ */
this.isBeingDeleted = false;
// ------ Derived attributes ------
@@ -1166,7 +1184,7 @@ class BNote extends AbstractBeccaEntity {
/**
* @param {string} [hoistedNoteId='root']
- * @return {Array<{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array, isHidden: boolean}>}
+ * @return {Array}
*/
getSortedNotePathRecords(hoistedNoteId = 'root') {
const isHoistedRoot = hoistedNoteId === 'root';
diff --git a/src/public/app/entities/fattachment.js b/src/public/app/entities/fattachment.js
index 85148abb3..e0c698e96 100644
--- a/src/public/app/entities/fattachment.js
+++ b/src/public/app/entities/fattachment.js
@@ -1,3 +1,7 @@
+/**
+ * Attachment is a file directly tied into a note without
+ * being a hidden child.
+ */
class FAttachment {
constructor(froca, row) {
/** @type {Froca} */
@@ -24,7 +28,10 @@ class FAttachment {
/** @type {string} */
this.utcDateScheduledForErasureSince = row.utcDateScheduledForErasureSince;
- /** @type {int} optionally added to the entity */
+ /**
+ * optionally added to the entity
+ * @type {int}
+ */
this.contentLength = row.contentLength;
this.froca.attachments[this.attachmentId] = this;
diff --git a/src/public/app/entities/fattribute.js b/src/public/app/entities/fattribute.js
index cd8ccc4fa..5e36c873f 100644
--- a/src/public/app/entities/fattribute.js
+++ b/src/public/app/entities/fattribute.js
@@ -1,5 +1,10 @@
import promotedAttributeDefinitionParser from '../services/promoted_attribute_definition_parser.js';
+/**
+ * There are currently only two types of attributes, labels or relations.
+ * @typedef {"label" | "relation"} AttributeType
+ */
+
/**
* Attribute is an abstract concept which has two real uses - label (key - value pair)
* and relation (representing named relationship between source and target note)
@@ -17,7 +22,7 @@ class FAttribute {
this.attributeId = row.attributeId;
/** @type {string} */
this.noteId = row.noteId;
- /** @type {string} */
+ /** @type {AttributeType} */
this.type = row.type;
/** @type {string} */
this.name = row.name;
diff --git a/src/public/app/entities/fnote.js b/src/public/app/entities/fnote.js
index 848243fd6..01c3cefe5 100644
--- a/src/public/app/entities/fnote.js
+++ b/src/public/app/entities/fnote.js
@@ -25,6 +25,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} notePath
+ * @property {boolean} isHidden
+ */
+
+/**
+ * Note is the main node and concept in Trilium.
+ */
class FNote {
/**
* @param {Froca} froca
@@ -65,8 +84,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;
/**
@@ -371,7 +390,7 @@ class FNote {
/**
* @param {string} [hoistedNoteId='root']
- * @return {Array<{isArchived: boolean, isInHoistedSubTree: boolean, isSearch: boolean, notePath: Array, isHidden: boolean}>}
+ * @return {Array}
*/
getSortedNotePathRecords(hoistedNoteId = 'root') {
const isHoistedRoot = hoistedNoteId === 'root';
@@ -450,7 +469,7 @@ class FNote {
/**
* @param {FAttribute[]} attributes
- * @param {string} type
+ * @param {AttributeType} type
* @param {string} name
* @return {FAttribute[]}
* @private
@@ -579,7 +598,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)
*/
@@ -590,7 +609,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)
*/
@@ -599,7 +618,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.
*/
@@ -610,7 +629,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.
*/
@@ -621,7 +640,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.
*/
@@ -632,7 +651,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.
*/
diff --git a/src/public/app/services/frontend_script_api.js b/src/public/app/services/frontend_script_api.js
index 6272c28e9..4c6807e6e 100644
--- a/src/public/app/services/frontend_script_api.js
+++ b/src/public/app/services/frontend_script_api.js
@@ -15,6 +15,18 @@ import BasicWidget from "../widgets/basic_widget.js";
import SpacedUpdate from "./spaced_update.js";
import shortcutService from "./shortcuts.js";
+
+/**
+ * A whole number
+ * @typedef {number} int
+ */
+
+/**
+ * An instance of the frontend api available globally.
+ * @global
+ * @var {FrontendScriptApi} api
+ */
+
/**
*
This is the main frontend API interface for scripts. All the properties and methods are published in the "api" object
* available in the JS frontend notes. You can use e.g. api.showMessage(api.startNote.title);
@@ -22,26 +34,44 @@ import shortcutService from "./shortcuts.js";
* @constructor
*/
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
- /** @property {jQuery} container of all the rendered script content */
+ /**
+ * Container of all the rendered script content
+ * @type {jQuery}
+ * */
this.$container = $container;
- /** @property {object} note where the script started executing */
+ /**
+ * Note where the script started executing
+ * @type {FNote}
+ */
this.startNote = startNote;
- /** @property {object} note where the script is currently executing */
+
+ /**
+ * Note where the script is currently executing
+ * @type {FNote}
+ */
this.currentNote = currentNote;
- /** @property {object|null} entity whose event triggered this execution */
+ /**
+ * Entity whose event triggered this execution
+ * @type {object|null}
+ */
this.originEntity = originEntity;
- /** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
+ /**
+ * day.js library for date manipulation.
+ * See {@link https://day.js.org} for documentation
+ * @see https://day.js.org
+ * @type {dayjs}
+ */
this.dayjs = dayjs;
- /** @property {RightPanelWidget} */
+ /** @type {RightPanelWidget} */
this.RightPanelWidget = RightPanelWidget;
- /** @property {NoteContextAwareWidget} */
+ /** @type {NoteContextAwareWidget} */
this.NoteContextAwareWidget = NoteContextAwareWidget;
- /** @property {BasicWidget} */
+ /** @type {BasicWidget} */
this.BasicWidget = BasicWidget;
/**
@@ -114,12 +144,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @deprecated you can now create/modify launchers in the top-left Menu -> Configure Launchbar
* for special needs there's also backend API's createOrUpdateLauncher()
* @param {object} opts
- * @property {string} [opts.id] - id of the button, used to identify the old instances of this button to be replaced
+ * @param {string} opts.title
+ * @param {function} opts.action - callback handling the click on the button
+ * @param {string} [opts.id] - id of the button, used to identify the old instances of this button to be replaced
* ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
- * @property {string} opts.title
- * @property {string} [opts.icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
- * @property {function} opts.action - callback handling the click on the button
- * @property {string} [opts.shortcut] - keyboard shortcut for the button, e.g. "alt+t"
+ * @param {string} [opts.icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
+ * @param {string} [opts.shortcut] - keyboard shortcut for the button, e.g. "alt+t"
*/
this.addButtonToToolbar = async opts => {
console.warn("api.addButtonToToolbar() has been deprecated since v0.58 and may be removed in the future. Use Menu -> Configure Launchbar to create/update launchers instead.");
@@ -150,9 +180,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Internally this serializes the anonymous function into string and sends it to backend via AJAX.
*
* @method
- * @param {string} script - script to be executed on the backend
- * @param {Array.>} params - list of parameters to the anonymous function to be sent to backend
- * @returns {Promise<*>} return value of the executed function on the backend
+ * @param {string|Function} script - script to be executed on the backend
+ * @param {Array} params - list of parameters to the anonymous function to be sent to backend
+ * @returns {Promise} return value of the executed function on the backend
*/
this.runOnBackend = async (script, params = []) => {
if (typeof script === "function") {
@@ -300,7 +330,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @param {boolean} [params.showTooltip=true] - enable/disable tooltip on the link
* @param {boolean} [params.showNotePath=false] - show also whole note's path as part of the link
* @param {boolean} [params.showNoteIcon=false] - show also note icon before the title
- * @param {string} [params.title=] - custom link tile with note's title as default
+ * @param {string} [params.title] - custom link tile with note's title as default
*/
this.createLink = linkService.createLink;
diff --git a/src/public/app/widgets/basic_widget.js b/src/public/app/widgets/basic_widget.js
index f7de3088a..25145c38f 100644
--- a/src/public/app/widgets/basic_widget.js
+++ b/src/public/app/widgets/basic_widget.js
@@ -1,5 +1,11 @@
import Component from "../components/component.js";
+
+/**
+ * This is the base widget for all other widgets.
+ *
+ * For information on using widgets, see the tutorial {@tutorial widget_basics}.
+ */
class BasicWidget extends Component {
constructor() {
super();
@@ -64,6 +70,11 @@ class BasicWidget extends Component {
return this;
}
+ /**
+ * Accepts a string of CSS to add with the widget.
+ * @param {string} block
+ * @returns {this} for chaining
+ */
cssBlock(block) {
this.cssEl = block;
return this;
@@ -112,7 +123,10 @@ class BasicWidget extends Component {
}
/**
- * for overriding
+ * Method used for rendering the widget.
+ *
+ * Your class should override this method.
+ * @returns {JQuery} Your widget.
*/
doRender() {}
diff --git a/src/public/app/widgets/note_context_aware_widget.js b/src/public/app/widgets/note_context_aware_widget.js
index 753edfaa1..1fb7e5de8 100644
--- a/src/public/app/widgets/note_context_aware_widget.js
+++ b/src/public/app/widgets/note_context_aware_widget.js
@@ -1,7 +1,11 @@
import BasicWidget from "./basic_widget.js";
import appContext from "../components/app_context.js";
-export default class NoteContextAwareWidget extends BasicWidget {
+/**
+ * This widget allows for changing and updating depending on the active note.
+ * @extends {BasicWidget}
+ */
+class NoteContextAwareWidget extends BasicWidget {
isNoteContext(ntxId) {
if (Array.isArray(ntxId)) {
return this.noteContext && ntxId.includes(this.noteContext.ntxId);
@@ -43,6 +47,9 @@ export default class NoteContextAwareWidget extends BasicWidget {
return this.noteContext?.ntxId;
}
+ /**
+ * @returns {boolean} true when an active note exists
+ */
isEnabled() {
return !!this.note;
}
@@ -58,6 +65,8 @@ export default class NoteContextAwareWidget extends BasicWidget {
}
/**
+ * Override this method to be able to refresh your
+ * widget with each note.
* @param {FNote} note
* @returns {Promise}
*/
@@ -109,3 +118,5 @@ export default class NoteContextAwareWidget extends BasicWidget {
await this.refresh();
}
}
+
+export default NoteContextAwareWidget;
diff --git a/src/public/app/widgets/right_panel_widget.js b/src/public/app/widgets/right_panel_widget.js
index a173dc759..12e3c71a0 100644
--- a/src/public/app/widgets/right_panel_widget.js
+++ b/src/public/app/widgets/right_panel_widget.js
@@ -9,11 +9,19 @@ const WIDGET_TPL = `
`;
-export default class RightPanelWidget extends NoteContextAwareWidget {
+/**
+ * This widget manages rendering panels in the right-hand pane.
+ * @extends {NoteContextAwareWidget}
+ */
+class RightPanelWidget extends NoteContextAwareWidget {
+ /** Title to show in the panel. */
get widgetTitle() { return "Untitled widget"; }
get help() { return {}; }
+ /**
+ * Do not override this method unless you know what you're doing.
+ */
doRender() {
this.$widget = $(WIDGET_TPL);
this.contentSized();
@@ -30,6 +38,13 @@ export default class RightPanelWidget extends NoteContextAwareWidget {
this.initialized = this.doRenderBody();
}
- /* for overriding */
+ /**
+ * Method used for rendering the body of the widget.
+ *
+ * Your class should override this method.
+ * @returns {JQuery} The body of your widget.
+ */
async doRenderBody() {}
}
+
+export default RightPanelWidget;
\ No newline at end of file
diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js
index ed0e0902c..1b5c52c25 100644
--- a/src/services/backend_script_api.js
+++ b/src/services/backend_script_api.js
@@ -20,6 +20,18 @@ const specialNotesService = require("./special_notes");
const branchService = require("./branches");
const exportService = require("./export/zip");
+
+/**
+ * A whole number
+ * @typedef {number} int
+ */
+
+/**
+ * An instance of the frontend api available globally.
+ * @global
+ * @var {BackendScriptApi} api
+ */
+
/**
*
This is the main backend API interface for scripts. All the properties and methods are published in the "api" object
* available in the JS backend notes. You can use e.g. api.log(api.startNote.title);
@@ -27,11 +39,20 @@ const exportService = require("./export/zip");
* @constructor
*/
function BackendScriptApi(currentNote, apiParams) {
- /** @property {BNote} note where the script started executing */
+ /**
+ * Note where the script started executing
+ * @type {BNote}
+ */
this.startNote = apiParams.startNote;
- /** @property {BNote} note where the script is currently executing. Don't mix this up with the concept of active note */
+ /**
+ * Note where the script is currently executing. Don't mix this up with the concept of active note
+ * @type {BNote}
+ */
this.currentNote = currentNote;
- /** @property {AbstractBeccaEntity} entity whose event triggered this execution */
+ /**
+ * Entity whose event triggered this execution
+ * @type {AbstractBeccaEntity}
+ */
this.originEntity = apiParams.originEntity;
for (const key in apiParams) {
@@ -39,13 +60,20 @@ function BackendScriptApi(currentNote, apiParams) {
}
/**
- * @property {axios} Axios library for HTTP requests. See {@link https://axios-http.com} for documentation
+ * Axios library for HTTP requests. See {@link https://axios-http.com} for documentation
+ * @type {axios}
* @deprecated use native (browser compatible) fetch() instead
*/
this.axios = axios;
- /** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
+ /**
+ * day.js library for date manipulation. See {@link https://day.js.org} for documentation
+ * @type {dayjs}
+ */
this.dayjs = dayjs;
- /** @property {axios} xml2js library for XML parsing. See {@link https://github.com/Leonidas-from-XIV/node-xml2js} for documentation */
+ /**
+ * xml2js library for XML parsing. See {@link https://github.com/Leonidas-from-XIV/node-xml2js} for documentation
+ * @type {xml2js}
+ */
this.xml2js = xml2js;
/**
@@ -206,16 +234,16 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
*
- * @property {object} params
- * @property {string} params.parentNoteId
- * @property {string} params.title
- * @property {string|buffer} params.content
- * @property {string} params.type - text, code, file, image, search, book, relationMap, canvas
- * @property {string} [params.mime] - value is derived from default mimes for type
- * @property {boolean} [params.isProtected=false]
- * @property {boolean} [params.isExpanded=false]
- * @property {string} [params.prefix='']
- * @property {int} [params.notePosition] - default is last existing notePosition in a parent + 10
+ * @param {object} params
+ * @param {string} params.parentNoteId
+ * @param {string} params.title
+ * @param {string|Buffer} params.content
+ * @param {NoteType} params.type - text, code, file, image, search, book, relationMap, canvas
+ * @param {string} [params.mime] - value is derived from default mimes for type
+ * @param {boolean} [params.isProtected=false]
+ * @param {boolean} [params.isExpanded=false]
+ * @param {string} [params.prefix='']
+ * @param {int} [params.notePosition] - default is last existing notePosition in a parent + 10
* @returns {{note: BNote, branch: BBranch}} object contains newly created entities note and branch
*/
this.createNewNote = noteService.createNewNote;
@@ -228,14 +256,14 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} title
* @param {string} [content=""]
* @param {object} [extraOptions={}]
- * @property {boolean} [extraOptions.json=false] - should the note be JSON
- * @property {boolean} [extraOptions.isProtected=false] - should the note be protected
- * @property {string} [extraOptions.type='text'] - note type
- * @property {string} [extraOptions.mime='text/html'] - MIME type of the note
- * @property {object[]} [extraOptions.attributes=[]] - attributes to be created for this note
- * @property {string} extraOptions.attributes.type - attribute type - label, relation etc.
- * @property {string} extraOptions.attributes.name - attribute name
- * @property {string} [extraOptions.attributes.value] - attribute value
+ * @param {boolean} [extraOptions.json=false] - should the note be JSON
+ * @param {boolean} [extraOptions.isProtected=false] - should the note be protected
+ * @param {string} [extraOptions.type='text'] - note type
+ * @param {string} [extraOptions.mime='text/html'] - MIME type of the note
+ * @param {object[]} [extraOptions.attributes=[]] - attributes to be created for this note
+ * @param {AttributeType} extraOptions.attributes.type - attribute type - label, relation etc.
+ * @param {string} extraOptions.attributes.name - attribute name
+ * @param {string} [extraOptions.attributes.value] - attribute value
* @returns {{note: BNote, branch: BBranch}} object contains newly created entities note and branch
*/
this.createNote = (parentNoteId, title, content = "", extraOptions= {}) => {
@@ -370,10 +398,10 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} parentNoteId - this note's child notes will be sorted
* @param {object} [sortConfig]
- * @property {string} [sortConfig.sortBy=title] - 'title', 'dateCreated', 'dateModified' or a label name
+ * @param {string} [sortConfig.sortBy=title] - 'title', 'dateCreated', 'dateModified' or a label name
* See {@link https://github.com/zadam/trilium/wiki/Sorting} for details.
- * @property {boolean} [sortConfig.reverse=false]
- * @property {boolean} [sortConfig.foldersFirst=false]
+ * @param {boolean} [sortConfig.reverse=false]
+ * @param {boolean} [sortConfig.foldersFirst=false]
* @returns {void}
*/
this.sortNotes = (parentNoteId, sortConfig = {}) => treeService.sortNotes(
@@ -404,7 +432,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {function} func
- * @returns {?} result of func callback
+ * @returns {any} result of func callback
*/
this.transactional = sql.transactional;
@@ -432,7 +460,8 @@ function BackendScriptApi(currentNote, apiParams) {
this.unescapeHtml = utils.unescapeHtml;
/**
- * @property {module:sql} sql
+ * sql
+ * @type {module:sql}
*/
this.sql = sql;
@@ -447,18 +476,18 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {object} opts
- * @property {string} opts.id - id of the launcher, only alphanumeric at least 6 characters long
- * @property {string} opts.type - one of
+ * @param {string} opts.id - id of the launcher, only alphanumeric at least 6 characters long
+ * @param {"note" | "script" | "customWidget"} opts.type - 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)
- * @property {string} opts.title
- * @property {boolean} [opts.isVisible=false] - if true, will be created in the "Visible launchers", otherwise in "Available launchers"
- * @property {string} [opts.icon] - name of the boxicon to be used (e.g. "bx-time")
- * @property {string} [opts.keyboardShortcut] - will activate the target note/script upon pressing, e.g. "ctrl+e"
- * @property {string} [opts.targetNoteId] - for type "note"
- * @property {string} [opts.scriptNoteId] - for type "script"
- * @property {string} [opts.widgetNoteId] - for type "customWidget"
+ * @param {string} opts.title
+ * @param {boolean} [opts.isVisible=false] - if true, will be created in the "Visible launchers", otherwise in "Available launchers"
+ * @param {string} [opts.icon] - name of the boxicon to be used (e.g. "bx-time")
+ * @param {string} [opts.keyboardShortcut] - will activate the target note/script upon pressing, e.g. "ctrl+e"
+ * @param {string} [opts.targetNoteId] - for type "note"
+ * @param {string} [opts.scriptNoteId] - for type "script"
+ * @param {string} [opts.widgetNoteId] - for type "customWidget"
* @returns {{note: BNote}}
*/
this.createOrUpdateLauncher = opts => {