# Class FNote

Note is the main node and concept in Trilium.

- Defined in src/public/app/entities/fnote.ts:68

##### Index

### Constructors

constructor

### Properties

attachments
attributes
blobId
children
childToBranch
highlightedTokens?
isProtected
mime
noteId
parents
parentToBranch
searchResultsLoaded?
targetRelations
title
type

### Accessors

dto
isArchived

### Methods

__getInheritableAttributes
__validateTypeName
addChild
addParent
executeScript
getAllNotePaths
getAttachmentById
getAttachments
getAttachmentsByRole
getAttribute
getAttributes
getAttributeValue
getBestNotePath
getBestNotePathString
getBlob
getBranches
getBranchIds
getChildBranches
getChildNoteIds
getChildNotes
getColorClass
getContent
getCssClass
getFilteredChildBranches
getIcon
getJsonContent
getLabel
getLabels
getLabelValue
getMetadata
getNoteComplement
getNotesToInheritAttributesFrom
getOwnedAttribute
getOwnedAttributes
getOwnedAttributeValue
getOwnedLabel
getOwnedLabels
getOwnedLabelValue
getOwnedRelation
getOwnedRelations
getOwnedRelationValue
getParentBranches
getParentBranchIds
getParentNoteIds
getParentNotes
getPromotedDefinitionAttributes
getRelation
getRelations
getRelationTarget
getRelationTargets
getRelationValue
getScriptEnv
getSortedNotePathRecords
getTargetRelations
getTargetRelationSourceNotes
getWorkspaceIconClass
getWorkspaceTabBackgroundColor
hasAncestor
hasAttribute
hasChildren
hasLabel
hasOwnedAttribute
hasOwnedLabel
hasOwnedRelation
hasRelation
invalidateAttributeCache
isContentAvailable
isEligibleForConversionToAttachment
isFolder
isHiddenCompletely
isHtml
isInHiddenSubtree
isJavaScript
isJson
isLabelTruthy
isLaunchBarConfig
isOptions
isRoot
isShared
sortChildren
sortParents
toString
update

## Constructors

### constructor

- new FNote(froca: Froca , row: FNoteRow ): FNote

  #### Parameters

  - froca: Froca
  - row: FNoteRow

  #### Returns FNote

  - Defined in src/public/app/entities/fnote.ts:95

## Properties

### attachments

attachments: null | FAttachment []

- Defined in src/public/app/entities/fnote.ts:89

### attributes

attributes: string[]

- Defined in src/public/app/entities/fnote.ts:82

### blobId

blobId: string

- Defined in src/public/app/entities/fnote.ts:80

### children

children: string[]

- Defined in src/public/app/entities/fnote.ts:85

### childToBranch

childToBranch: Record <string, string>

- Defined in src/public/app/entities/fnote.ts:88

### `Optional` highlightedTokens

highlightedTokens?: string[]

- Defined in src/public/app/entities/fnote.ts:93

### isProtected

isProtected: boolean

- Defined in src/public/app/entities/fnote.ts:73

### mime

mime: string

content-type, e.g. "application/json"

- Defined in src/public/app/entities/fnote.ts:78

### noteId

noteId: string

- Defined in src/public/app/entities/fnote.ts:71

### parents

parents: string[]

- Defined in src/public/app/entities/fnote.ts:84

### parentToBranch

parentToBranch: Record <string, string>

- Defined in src/public/app/entities/fnote.ts:87

### `Optional` searchResultsLoaded

searchResultsLoaded?: boolean

- Defined in src/public/app/entities/fnote.ts:92

### targetRelations

targetRelations: string[]

- Defined in src/public/app/entities/fnote.ts:83

### title

title: string

- Defined in src/public/app/entities/fnote.ts:72

### type

type: NoteType

- Defined in src/public/app/entities/fnote.ts:74

## Accessors

### dto

- get dto(): Omit < FNote , "froca">

  #### Returns Omit < FNote , "froca">

  - Defined in src/public/app/entities/fnote.ts:903

### isArchived

- get isArchived(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:252

## Methods

### __getInheritableAttributes

- __getInheritableAttributes(path: string[]): FAttribute []

  #### Parameters

  - path: string[]

  #### Returns FAttribute []

  - Defined in src/public/app/entities/fnote.ts:500

### __validateTypeName

- __validateTypeName(type?: string, name?: string): void

  #### Parameters

  - `Optional` type: string
  - `Optional` name: string

  #### Returns void

  - Defined in src/public/app/entities/fnote.ts:506

### addChild

- addChild(childNoteId: string, branchId: string, sort?: boolean): void

  #### Parameters

  - childNoteId: string
  - branchId: string
  - sort: boolean = true

  #### Returns void

  - Defined in src/public/app/entities/fnote.ts:137

### addParent

- addParent(parentNoteId: string, branchId: string, sort?: boolean): void

  #### Parameters

  - parentNoteId: string
  - branchId: string
  - sort: boolean = true

  #### Returns void

  - Defined in src/public/app/entities/fnote.ts:121

### executeScript

- executeScript(): Promise<any>

  Executes this FNote as a front-end or back-end script.

  #### Returns Promise<any>

  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.

  #### Throws

  an Error if the note has an incorrect note type or MIME for execution.

  - Defined in src/public/app/entities/fnote.ts:961

### getAllNotePaths

- getAllNotePaths(): string[][]

  Gives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)

  #### Returns string[][]

  array of notePaths (each represented by array of noteIds constituting the particular note path)

  - Defined in src/public/app/entities/fnote.ts:387

### getAttachmentById

- getAttachmentById(attachmentId: string): Promise<undefined | FAttachment >

  #### Parameters

  - attachmentId: string

  #### Returns Promise<undefined | FAttachment >

  - Defined in src/public/app/entities/fnote.ts:276

### getAttachments

- getAttachments(): Promise< FAttachment []>

  #### Returns Promise< FAttachment []>

  - Defined in src/public/app/entities/fnote.ts:264

### getAttachmentsByRole

- getAttachmentsByRole(role: string): Promise< FAttachment []>

  #### Parameters

  - role: string

  #### Returns Promise< FAttachment []>

  - Defined in src/public/app/entities/fnote.ts:272

### getAttribute

- getAttribute(type: AttributeType , name: string): undefined | FAttribute

  #### Parameters

  - type: AttributeType

    attribute type (label, relation, etc.)

  - name: string

    attribute name

  #### Returns undefined | 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.

  - Defined in src/public/app/entities/fnote.ts:638

### getAttributes

- getAttributes(type?: AttributeType , name?: string): FAttribute []

  #### Parameters

  - `Optional` type: AttributeType

    attribute type to filter

  - `Optional` name: string

    attribute name to filter

  #### Returns FAttribute []

  all note's attributes, including inherited ones

  - Defined in src/public/app/entities/fnote.ts:321

### getAttributeValue

- getAttributeValue(type: AttributeType , name: string): null | string

  #### Parameters

  - type: AttributeType

    attribute type (label, relation, etc.)

  - name: string

    attribute name

  #### Returns null | string

  attribute value of the given type and name or null if no such attribute exists.

  - Defined in src/public/app/entities/fnote.ts:660

### getBestNotePath

- getBestNotePath(hoistedNoteId?: string): string[]

  Returns the note path considered to be the "best"

  #### Parameters

  - `Optional` hoistedNoteId: string = "root"

  #### Returns string[]

  array of noteIds constituting the particular note path

  - Defined in src/public/app/entities/fnote.ts:440

### getBestNotePathString

- getBestNotePathString(hoistedNoteId?: string): string

  Returns the note path considered to be the "best"

  #### Parameters

  - `Optional` hoistedNoteId: string = "root"

  #### Returns string

  serialized note path (e.g. 'root/a1h315/js725h')

  - Defined in src/public/app/entities/fnote.ts:450

### getBlob

- getBlob(): Promise<null | void | default >

  #### Returns Promise<null | void | default >

  - Defined in src/public/app/entities/fnote.ts:895

### getBranches

- getBranches(): FBranch []

  #### Returns FBranch []

  #### Deprecated

  use getParentBranches() instead

  - Defined in src/public/app/entities/fnote.ts:209

### getBranchIds

- getBranchIds(): string[]

  #### Returns string[]

  #### Deprecated

  use getParentBranchIds() instead

  - Defined in src/public/app/entities/fnote.ts:196

### getChildBranches

- getChildBranches(): FBranch []

  #### Returns FBranch []

  - Defined in src/public/app/entities/fnote.ts:217

### getChildNoteIds

- getChildNoteIds(): string[]

  #### Returns string[]

  - Defined in src/public/app/entities/fnote.ts:256

### getChildNotes

- getChildNotes(): Promise< FNote []>

  #### Returns Promise< FNote []>

  - Defined in src/public/app/entities/fnote.ts:260

### getColorClass

- getColorClass(): string

  #### Returns string

  - Defined in src/public/app/entities/fnote.ts:561

### getContent

- getContent(): Promise<undefined | string>

  #### Returns Promise<undefined | string>

  - Defined in src/public/app/entities/fnote.ts:166

### getCssClass

- getCssClass(): string

  #### Returns string

  - Defined in src/public/app/entities/fnote.ts:910

### getFilteredChildBranches

- getFilteredChildBranches(): FBranch []

  #### Returns FBranch []

  - Defined in src/public/app/entities/fnote.ts:570

### getIcon

- getIcon(): string

  #### Returns string

  - Defined in src/public/app/entities/fnote.ts:535

### getJsonContent

- getJsonContent(): Promise<any>

  #### Returns Promise<any>

  - Defined in src/public/app/entities/fnote.ts:172

### getLabel

- getLabel(name: string): undefined | FAttribute

  #### Parameters

  - name: string

    label name

  #### Returns undefined | FAttribute

  label if it exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:724

### getLabels

- getLabels(name?: string): FAttribute []

  #### Parameters

  - `Optional` name: string

    label name to filter

  #### Returns FAttribute []

  all note's labels (attributes with type label), including inherited ones

  - Defined in src/public/app/entities/fnote.ts:531

### getLabelValue

- getLabelValue(name: string): null | string

  #### Parameters

  - name: string

    label name

  #### Returns null | string

  label value if label exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:756

### getMetadata

- getMetadata(): Promise< NoteMetaData >

  Provides note's date metadata.

  #### Returns Promise< NoteMetaData >

  - Defined in src/public/app/entities/fnote.ts:1013

### getNoteComplement

- getNoteComplement(): Promise<null | void | default >

  #### Returns Promise<null | void | default >

  #### Deprecated

  use getBlob() instead

  - Defined in src/public/app/entities/fnote.ts:891

### getNotesToInheritAttributesFrom

- getNotesToInheritAttributesFrom(): FNote []

  #### Returns FNote []

  - Defined in src/public/app/entities/fnote.ts:800

### getOwnedAttribute

- getOwnedAttribute(type: AttributeType , name: string): undefined | FAttribute

  #### Parameters

  - type: AttributeType

    attribute type (label, relation, etc.)

  - name: string

    attribute name

  #### Returns undefined | 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.

  - Defined in src/public/app/entities/fnote.ts:627

### getOwnedAttributes

- getOwnedAttributes(type?: AttributeType , name?: string): FAttribute []

  #### Parameters

  - `Optional` type: AttributeType

    attribute type to filter

  - `Optional` name: string

    attribute name to filter

  #### Returns FAttribute []

  all note's attributes, including inherited ones

  - Defined in src/public/app/entities/fnote.ts:310

### getOwnedAttributeValue

- getOwnedAttributeValue(type: AttributeType , name: string): null | string

  #### Parameters

  - type: AttributeType

    attribute type (label, relation, etc.)

  - name: string

    attribute name

  #### Returns null | string

  attribute value of the given type and name or null if no such attribute exists.

  - Defined in src/public/app/entities/fnote.ts:649

### getOwnedLabel

- getOwnedLabel(name: string): undefined | FAttribute

  #### Parameters

  - name: string

    label name

  #### Returns undefined | FAttribute

  label if it exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:716

### getOwnedLabels

- getOwnedLabels(name?: string): FAttribute []

  #### Parameters

  - `Optional` name: string

    label name to filter

  #### Returns FAttribute []

  all note's labels (attributes with type label), including inherited ones

  - Defined in src/public/app/entities/fnote.ts:523

### getOwnedLabelValue

- getOwnedLabelValue(name: string): null | string

  #### Parameters

  - name: string

    label name

  #### Returns null | string

  label value if label exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:748

### getOwnedRelation

- getOwnedRelation(name: string): undefined | FAttribute

  #### Parameters

  - name: string

    relation name

  #### Returns undefined | FAttribute

  relation if it exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:732

### getOwnedRelations

- getOwnedRelations(name?: string): FAttribute []

  #### Parameters

  - `Optional` name: string

    relation name to filter

  #### Returns FAttribute []

  all note's relations (attributes with type relation), including inherited ones

  - Defined in src/public/app/entities/fnote.ts:590

### getOwnedRelationValue

- getOwnedRelationValue(name: string): null | string

  #### Parameters

  - name: string

    relation name

  #### Returns null | string

  relation value if relation exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:764

### getParentBranches

- getParentBranches(): FBranch []

  #### Returns FBranch []

  - Defined in src/public/app/entities/fnote.ts:200

### getParentBranchIds

- getParentBranchIds(): string[]

  #### Returns string[]

  - Defined in src/public/app/entities/fnote.ts:189

### getParentNoteIds

- getParentNoteIds(): string[]

  #### Returns string[]

  - Defined in src/public/app/entities/fnote.ts:224

### getParentNotes

- getParentNotes(): FNote []

  #### Returns FNote []

  - Defined in src/public/app/entities/fnote.ts:228

### getPromotedDefinitionAttributes

- getPromotedDefinitionAttributes(): FAttribute []

  #### Returns FAttribute []

  - Defined in src/public/app/entities/fnote.ts:806

### getRelation

- getRelation(name: string): undefined | FAttribute

  #### Parameters

  - name: string

    relation name

  #### Returns undefined | FAttribute

  relation if it exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:740

### getRelations

- getRelations(name?: string): FAttribute []

  #### Parameters

  - `Optional` name: string

    relation name to filter

  #### Returns FAttribute []

  all note's relations (attributes with type relation), including inherited ones

  - Defined in src/public/app/entities/fnote.ts:598

### getRelationTarget

- getRelationTarget(name: string): Promise<null | FNote >

  #### Parameters

  - name: string

  #### Returns Promise<null | FNote >

  target note of the relation or null (if target is empty or note was not found)

  - Defined in src/public/app/entities/fnote.ts:780

### getRelationTargets

- getRelationTargets(name?: string): Promise<(null | FNote)[]>

  #### Parameters

  - `Optional` name: string

    relation name to filter

  #### Returns Promise<(null | FNote)[]>

  - Defined in src/public/app/entities/fnote.ts:789

### getRelationValue

- getRelationValue(name: string): null | string

  #### Parameters

  - name: string

    relation name

  #### Returns null | string

  relation value if relation exists, null otherwise

  - Defined in src/public/app/entities/fnote.ts:772

### getScriptEnv

- getScriptEnv(): null | "frontend" | "backend"

  #### Returns null | "frontend" | "backend"

  JS script environment - either "frontend" or "backend"

  - Defined in src/public/app/entities/fnote.ts:939

### getSortedNotePathRecords

- getSortedNotePathRecords(hoistedNoteId?: string): NotePathRecord []

  #### Parameters

  - hoistedNoteId: string = "root"

  #### Returns NotePathRecord []

  - Defined in src/public/app/entities/fnote.ts:406

### getTargetRelations

- getTargetRelations(): FAttribute []

  Get relations which target this note

  #### Returns FAttribute []

  - Defined in src/public/app/entities/fnote.ts:875

### getTargetRelationSourceNotes

- getTargetRelationSourceNotes(): Promise< FNote []>

  Get relations which target this note

  #### Returns Promise< FNote []>

  - Defined in src/public/app/entities/fnote.ts:882

### getWorkspaceIconClass

- getWorkspaceIconClass(): string

  #### Returns string

  - Defined in src/public/app/entities/fnote.ts:915

### getWorkspaceTabBackgroundColor

- getWorkspaceTabBackgroundColor(): string

  #### Returns string

  - Defined in src/public/app/entities/fnote.ts:920

### hasAncestor

- hasAncestor(
  ancestorNoteId: string,
  followTemplates?: boolean,
  visitedNoteIds?: null | Set<string>,
  ): boolean

  #### Parameters

  - ancestorNoteId: string
  - followTemplates: boolean = false
  - visitedNoteIds: null | Set<string> = null

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:832

### hasAttribute

- hasAttribute(type: AttributeType , name: string): boolean

  #### Parameters

  - type: AttributeType

    attribute type (label, relation, etc.)

  - name: string

    attribute name

  #### Returns boolean

  true if note has an attribute with given type and name (including inherited)

  - Defined in src/public/app/entities/fnote.ts:607

### hasChildren

- hasChildren(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:213

### hasLabel

- hasLabel(name: string): boolean

  #### Parameters

  - name: string

    label name

  #### Returns boolean

  true if label exists (including inherited)

  - Defined in src/public/app/entities/fnote.ts:678

### hasOwnedAttribute

- hasOwnedAttribute(type: AttributeType , name: string): boolean

  #### Parameters

  - type: AttributeType

    attribute type (label, relation, etc.)

  - name: string

    attribute name

  #### Returns boolean

  true if note has an attribute with given type and name (including inherited)

  - Defined in src/public/app/entities/fnote.ts:618

### hasOwnedLabel

- hasOwnedLabel(name: string): boolean

  #### Parameters

  - name: string

    label name

  #### Returns boolean

  true if label exists (excluding inherited)

  - Defined in src/public/app/entities/fnote.ts:670

### hasOwnedRelation

- hasOwnedRelation(name: string): boolean

  #### Parameters

  - name: string

    relation name

  #### Returns boolean

  true if relation exists (excluding inherited)

  - Defined in src/public/app/entities/fnote.ts:700

### hasRelation

- hasRelation(name: string): boolean

  #### Parameters

  - name: string

    relation name

  #### Returns boolean

  true if relation exists (including inherited)

  - Defined in src/public/app/entities/fnote.ts:708

### invalidateAttributeCache

- invalidateAttributeCache(): void

  #### Returns void

  #### Deprecated

  NOOP

  - Defined in src/public/app/entities/fnote.ts:870

### isContentAvailable

- isContentAvailable(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:998

### isEligibleForConversionToAttachment

- isEligibleForConversionToAttachment(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:282

### isFolder

- isFolder(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:566

### isHiddenCompletely

- isHiddenCompletely(): boolean

  #### Returns boolean

  boolean - true if there's no non-hidden path, note is not cloned to the visible tree

  - Defined in src/public/app/entities/fnote.ts:459

### isHtml

- isHtml(): boolean

  #### Returns boolean

  true if this note is HTML

  - Defined in src/public/app/entities/fnote.ts:934

### isInHiddenSubtree

- isInHiddenSubtree(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:863

### isJavaScript

- isJavaScript(): boolean

  #### Returns boolean

  true if this note is JavaScript (code or file)

  - Defined in src/public/app/entities/fnote.ts:926

### isJson

- isJson(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:162

### isLabelTruthy

- isLabelTruthy(name: string): boolean

  #### Parameters

  - name: string

    label name

  #### Returns boolean

  true if label exists (including inherited) and does not have "false" value.

  - Defined in src/public/app/entities/fnote.ts:686

### isLaunchBarConfig

- isLaunchBarConfig(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:1002

### isOptions

- isOptions(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:1006

### isRoot

- isRoot(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:378

### isShared

- isShared(): boolean

  #### Returns boolean

  - Defined in src/public/app/entities/fnote.ts:978

### sortChildren

- sortChildren(): void

  #### Returns void

  - Defined in src/public/app/entities/fnote.ts:149

### sortParents

- sortParents(): void

  #### Returns void

  - Defined in src/public/app/entities/fnote.ts:234

### toString

- toString(): string

  #### Returns string

  - Defined in src/public/app/entities/fnote.ts:899

### update

- update(row: FNoteRow ): void

  #### Parameters

  - row: FNoteRow

  #### Returns void

  - Defined in src/public/app/entities/fnote.ts:110