docs/Script API/classes/Frontend_Script_API.FNote.html
Note is the main node and concept in Trilium.
attachmentsattributesblobIdchildrenchildToBranchhighlightedTokens?isProtectedmimenoteIdparentsparentToBranchsearchResultsLoaded?targetRelationstitletype
__getInheritableAttributes__validateTypeNameaddChildaddParentexecuteScriptgetAllNotePathsgetAttachmentByIdgetAttachmentsgetAttachmentsByRolegetAttributegetAttributesgetAttributeValuegetBestNotePathgetBestNotePathStringgetBlobgetBranchesgetBranchIdsgetChildBranchesgetChildNoteIdsgetChildNotesgetColorClassgetContentgetCssClassgetFilteredChildBranchesgetIcongetJsonContentgetLabelgetLabelsgetLabelValuegetMetadatagetNoteComplementgetNotesToInheritAttributesFromgetOwnedAttributegetOwnedAttributesgetOwnedAttributeValuegetOwnedLabelgetOwnedLabelsgetOwnedLabelValuegetOwnedRelationgetOwnedRelationsgetOwnedRelationValuegetParentBranchesgetParentBranchIdsgetParentNoteIdsgetParentNotesgetPromotedDefinitionAttributesgetRelationgetRelationsgetRelationTargetgetRelationTargetsgetRelationValuegetScriptEnvgetSortedNotePathRecordsgetTargetRelationsgetTargetRelationSourceNotesgetWorkspaceIconClassgetWorkspaceTabBackgroundColorhasAncestorhasAttributehasChildrenhasLabelhasOwnedAttributehasOwnedLabelhasOwnedRelationhasRelationinvalidateAttributeCacheisContentAvailableisEligibleForConversionToAttachmentisFolderisHiddenCompletelyisHtmlisInHiddenSubtreeisJavaScriptisJsonisLabelTruthyisLaunchBarConfigisOptionsisRootisSharedsortChildrensortParentstoStringupdate
new FNote(froca: Froca, row: FNoteRow): FNote
attachments: null | FAttachment[]
attributes: string[]
blobId: string
children: string[]
childToBranch: Record<string, string>
OptionalhighlightedTokenshighlightedTokens?: string[]
isProtected: boolean
mime: string
content-type, e.g. "application/json"
noteId: string
parents: string[]
parentToBranch: Record<string, string>
OptionalsearchResultsLoadedsearchResultsLoaded?: boolean
targetRelations: string[]
title: string
type: NoteType
get dto(): Omit<FNote, "froca">
get isArchived(): boolean
__getInheritableAttributes(path: string[]): FAttribute[]
__validateTypeName(type?: string, name?: string): void
Optionaltype: stringOptionalname: stringaddChild(childNoteId: string, branchId: string, sort?: boolean): void
addParent(parentNoteId: string, branchId: string, sort?: boolean): void
executeScript(): Promise<any>
Executes this FNote as a front-end or back-end script.
a promise that resolves when the script has been run. Additionally, for front-end notes, the promise will contain the value that is returned by the script.
an Error if the note has an incorrect note type or MIME for execution.
getAllNotePaths(): string[][]
Gives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)
array of notePaths (each represented by array of noteIds constituting the particular note path)
getAttachmentById(attachmentId: string): Promise<undefined | FAttachment>
getAttachments(): Promise<FAttachment[]>
getAttachmentsByRole(role: string): Promise<FAttachment[]>
getAttribute(type: AttributeType, name: string): undefined | FAttribute
attribute type (label, relation, etc.)
attribute name
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.
getAttributes(type?: AttributeType, name?: string): FAttribute[]
Optionaltype: AttributeTypeattribute type to filter
Optionalname: stringattribute name to filter
all note's attributes, including inherited ones
getAttributeValue(type: AttributeType, name: string): null | string
attribute type (label, relation, etc.)
attribute name
attribute value of the given type and name or null if no such attribute exists.
getBestNotePath(hoistedNoteId?: string): string[]
Returns the note path considered to be the "best"
OptionalhoistedNoteId: string = "root"array of noteIds constituting the particular note path
getBestNotePathString(hoistedNoteId?: string): string
Returns the note path considered to be the "best"
OptionalhoistedNoteId: string = "root"serialized note path (e.g. 'root/a1h315/js725h')
getBlob(): Promise<null | void | default>
getBranches(): FBranch[]
use getParentBranches() instead
getBranchIds(): string[]
use getParentBranchIds() instead
getChildBranches(): FBranch[]
getChildNoteIds(): string[]
getChildNotes(): Promise<FNote[]>
getColorClass(): string
getContent(): Promise<undefined | string>
getCssClass(): string
getFilteredChildBranches(): FBranch[]
getIcon(): string
getJsonContent(): Promise<any>
getLabel(name: string): undefined | FAttribute
label name
label if it exists, null otherwise
getLabels(name?: string): FAttribute[]
Optionalname: stringlabel name to filter
all note's labels (attributes with type label), including inherited ones
getLabelValue(name: string): null | string
label name
label value if label exists, null otherwise
getMetadata(): Promise<NoteMetaData>
Provides note's date metadata.
getNoteComplement(): Promise<null | void | default>
use getBlob() instead
getNotesToInheritAttributesFrom(): FNote[]
getOwnedAttribute(type: AttributeType, name: string): undefined | FAttribute
attribute type (label, relation, etc.)
attribute name
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.
getOwnedAttributes(type?: AttributeType, name?: string): FAttribute[]
Optionaltype: AttributeTypeattribute type to filter
Optionalname: stringattribute name to filter
all note's attributes, including inherited ones
getOwnedAttributeValue(type: AttributeType, name: string): null | string
attribute type (label, relation, etc.)
attribute name
attribute value of the given type and name or null if no such attribute exists.
getOwnedLabel(name: string): undefined | FAttribute
label name
label if it exists, null otherwise
getOwnedLabels(name?: string): FAttribute[]
Optionalname: stringlabel name to filter
all note's labels (attributes with type label), including inherited ones
getOwnedLabelValue(name: string): null | string
label name
label value if label exists, null otherwise
getOwnedRelation(name: string): undefined | FAttribute
relation name
relation if it exists, null otherwise
getOwnedRelations(name?: string): FAttribute[]
Optionalname: stringrelation name to filter
all note's relations (attributes with type relation), including inherited ones
getOwnedRelationValue(name: string): null | string
relation name
relation value if relation exists, null otherwise
getParentBranches(): FBranch[]
getParentBranchIds(): string[]
getParentNoteIds(): string[]
getParentNotes(): FNote[]
getPromotedDefinitionAttributes(): FAttribute[]
getRelation(name: string): undefined | FAttribute
relation name
relation if it exists, null otherwise
getRelations(name?: string): FAttribute[]
Optionalname: stringrelation name to filter
all note's relations (attributes with type relation), including inherited ones
getRelationTarget(name: string): Promise<null | FNote>
target note of the relation or null (if target is empty or note was not found)
getRelationTargets(name?: string): Promise<(null | FNote)[]>
Optionalname: stringrelation name to filter
getRelationValue(name: string): null | string
relation name
relation value if relation exists, null otherwise
getScriptEnv(): null | "frontend" | "backend"
JS script environment - either "frontend" or "backend"
getSortedNotePathRecords(hoistedNoteId?: string): NotePathRecord[]
getTargetRelations(): FAttribute[]
Get relations which target this note
getTargetRelationSourceNotes(): Promise<FNote[]>
Get relations which target this note
getWorkspaceIconClass(): string
getWorkspaceTabBackgroundColor(): string
hasAncestor(
ancestorNoteId: string,
followTemplates?: boolean,
visitedNoteIds?: null | Set<string>,
): boolean
hasAttribute(type: AttributeType, name: string): boolean
attribute type (label, relation, etc.)
attribute name
true if note has an attribute with given type and name (including inherited)
hasChildren(): boolean
hasLabel(name: string): boolean
label name
true if label exists (including inherited)
hasOwnedAttribute(type: AttributeType, name: string): boolean
attribute type (label, relation, etc.)
attribute name
true if note has an attribute with given type and name (including inherited)
hasOwnedLabel(name: string): boolean
label name
true if label exists (excluding inherited)
hasOwnedRelation(name: string): boolean
relation name
true if relation exists (excluding inherited)
hasRelation(name: string): boolean
relation name
true if relation exists (including inherited)
invalidateAttributeCache(): void
NOOP
isContentAvailable(): boolean
isEligibleForConversionToAttachment(): boolean
isFolder(): boolean
isHiddenCompletely(): boolean
boolean - true if there's no non-hidden path, note is not cloned to the visible tree
isHtml(): boolean
true if this note is HTML
isInHiddenSubtree(): boolean
isJavaScript(): boolean
true if this note is JavaScript (code or file)
isJson(): boolean
isLabelTruthy(name: string): boolean
label name
true if label exists (including inherited) and does not have "false" value.
isLaunchBarConfig(): boolean
isOptions(): boolean
isRoot(): boolean
isShared(): boolean
sortChildren(): void
sortParents(): void
toString(): string
update(row: FNoteRow): void
Member Visibility
ThemeOSLightDark
Constructors constructor Properties attachmentsattributesblobIdchildrenchildToBranchhighlightedTokensisProtectedmimenoteIdparentsparentToBranchsearchResultsLoadedtargetRelationstitletype Accessors dtoisArchived Methods __getInheritableAttributes__validateTypeNameaddChildaddParentexecuteScriptgetAllNotePathsgetAttachmentByIdgetAttachmentsgetAttachmentsByRolegetAttributegetAttributesgetAttributeValuegetBestNotePathgetBestNotePathStringgetBlobgetBranchesgetBranchIdsgetChildBranchesgetChildNoteIdsgetChildNotesgetColorClassgetContentgetCssClassgetFilteredChildBranchesgetIcongetJsonContentgetLabelgetLabelsgetLabelValuegetMetadatagetNoteComplementgetNotesToInheritAttributesFromgetOwnedAttributegetOwnedAttributesgetOwnedAttributeValuegetOwnedLabelgetOwnedLabelsgetOwnedLabelValuegetOwnedRelationgetOwnedRelationsgetOwnedRelationValuegetParentBranchesgetParentBranchIdsgetParentNoteIdsgetParentNotesgetPromotedDefinitionAttributesgetRelationgetRelationsgetRelationTargetgetRelationTargetsgetRelationValuegetScriptEnvgetSortedNotePathRecordsgetTargetRelationsgetTargetRelationSourceNotesgetWorkspaceIconClassgetWorkspaceTabBackgroundColorhasAncestorhasAttributehasChildrenhasLabelhasOwnedAttributehasOwnedLabelhasOwnedRelationhasRelationinvalidateAttributeCacheisContentAvailableisEligibleForConversionToAttachmentisFolderisHiddenCompletelyisHtmlisInHiddenSubtreeisJavaScriptisJsonisLabelTruthyisLaunchBarConfigisOptionsisRootisSharedsortChildrensortParentstoStringupdate