mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	Add some docs to note.js (for backend scripting docs)
This commit is contained in:
		
							parent
							
								
									dbb5d02ecf
								
							
						
					
					
						commit
						d63156a0d6
					
				@ -1018,6 +1018,13 @@ class Note extends AbstractEntity {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a new attribute to this note. The attribute is saved and returned.
 | 
			
		||||
     * See addLabel, addRelation for more specific methods.
 | 
			
		||||
     *
 | 
			
		||||
     * @param {string} type - attribute type (label / relation)
 | 
			
		||||
     * @param {string} name - name of the attribute, not including the leading ~/#
 | 
			
		||||
     * @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional.
 | 
			
		||||
     *
 | 
			
		||||
     * @return {Attribute}
 | 
			
		||||
     */
 | 
			
		||||
    addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
 | 
			
		||||
@ -1033,10 +1040,27 @@ class Note extends AbstractEntity {
 | 
			
		||||
        }).save();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a new label to this note. The label attribute is saved and returned.
 | 
			
		||||
     *
 | 
			
		||||
     * @param {string} name - name of the label, not including the leading #
 | 
			
		||||
     * @param {string} [value] - text value of the label; optional
 | 
			
		||||
     *
 | 
			
		||||
     * @return {Attribute}
 | 
			
		||||
     */
 | 
			
		||||
    addLabel(name, value = "", isInheritable = false) {
 | 
			
		||||
        return this.addAttribute(LABEL, name, value, isInheritable);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a new relation to this note. The relation attribute is saved and
 | 
			
		||||
     * returned.
 | 
			
		||||
     *
 | 
			
		||||
     * @param {string} name - name of the relation, not including the leading ~
 | 
			
		||||
     * @param {string} value - ID of the target note of the relation
 | 
			
		||||
     *
 | 
			
		||||
     * @return {Attribute}
 | 
			
		||||
     */
 | 
			
		||||
    addRelation(name, targetNoteId, isInheritable = false) {
 | 
			
		||||
        return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user