Trilium Frontend API
    Preparing search index...

    Interface FNote

    Note is the main node and concept in Trilium.

    interface FNote {
        attachments: FAttachment[];
        attributes: string[];
        blobId: string;
        children: string[];
        childToBranch: Record<string, string>;
        highlightedTokens?: string[];
        isProtected: boolean;
        mime: string;
        noteId: string;
        parents: string[];
        parentToBranch: Record<string, string>;
        searchResultsLoaded?: 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;
        addChild(childNoteId: string, branchId: string, sort?: boolean): void;
        addParent(parentNoteId: string, branchId: string, sort?: boolean): void;
        executeScript(): Promise<any>;
        getAllNotePaths(): string[][];
        getAttachmentById(attachmentId: string): Promise<FAttachment>;
        getAttachments(): Promise<FAttachment[]>;
        getAttachmentsByRole(role: string): Promise<FAttachment[]>;
        getAttribute(type: AttributeType, name: string): FAttribute;
        getAttributes(type?: AttributeType, name?: string): FAttribute[];
        getAttributeValue(type: AttributeType, name: string): string;
        getBestNotePath(hoistedNoteId?: string, activeNotePath?: string): string[];
        getBestNotePathString(hoistedNoteId?: string): string;
        getBlob(): Promise<default>;
        getBranches(): FBranch[];
        getBranchIds(): string[];
        getChildBranches(): FBranch[];
        getChildNoteIds(): string[];
        getChildNotes(): Promise<FNote[]>;
        getColorClass(): string;
        getContent(): Promise<string>;
        getCssClass(): string;
        getFilteredChildBranches(): FBranch[];
        getIcon(): string;
        getJsonContent(): Promise<any>;
        getLabel(name: string): FAttribute;
        getLabels(name?: string): FAttribute[];
        getLabelValue(name: string): string;
        getMetadata(): Promise<NoteMetaData>;
        getNoteComplement(): Promise<default>;
        getNotesToInheritAttributesFrom(): FNote[];
        getOwnedAttribute(type: AttributeType, name: string): FAttribute;
        getOwnedAttributes(type?: AttributeType, name?: string): FAttribute[];
        getOwnedAttributeValue(type: AttributeType, name: string): string;
        getOwnedLabel(name: string): FAttribute;
        getOwnedLabels(name?: string): FAttribute[];
        getOwnedLabelValue(name: string): string;
        getOwnedRelation(name: string): FAttribute;
        getOwnedRelations(name?: string): FAttribute[];
        getOwnedRelationValue(name: string): string;
        getParentBranches(): FBranch[];
        getParentBranchIds(): string[];
        getParentNoteIds(): string[];
        getParentNotes(): FNote[];
        getPromotedDefinitionAttributes(): FAttribute[];
        getRelation(name: string): FAttribute;
        getRelations(name?: string): FAttribute[];
        getRelationTarget(name: string): Promise<FNote>;
        getRelationTargets(name?: string): Promise<FNote[]>;
        getRelationValue(name: string): string;
        getScriptEnv(): "backend" | "frontend";
        getSortedNotePathRecords(
            hoistedNoteId?: string,
            activeNotePath?: string,
        ): NotePathRecord[];
        getSubtreeNoteIds(includeArchived?: boolean): Promise<string[]>;
        getSubtreeNotes(): Promise<FNote[]>;
        getTargetRelations(): FAttribute[];
        getTargetRelationSourceNotes(): Promise<FNote[]>;
        getWorkspaceIconClass(): string;
        getWorkspaceTabBackgroundColor(): string;
        hasAncestor(
            ancestorNoteId: string,
            followTemplates?: boolean,
            visitedNoteIds?: Set<string>,
        ): boolean;
        hasAttribute(type: AttributeType, name: string): boolean;
        hasChildren(): boolean;
        hasLabel(name: string): boolean;
        hasOwnedAttribute(type: AttributeType, name: string): boolean;
        hasOwnedLabel(name: string): boolean;
        hasOwnedRelation(name: string): boolean;
        hasRelation(name: string): boolean;
        invalidateAttributeCache(): void;
        isContentAvailable(): boolean;
        isEligibleForConversionToAttachment(): boolean;
        isFolder(): boolean;
        isHiddenCompletely(): boolean;
        isHtml(): boolean;
        isInHiddenSubtree(): boolean;
        isJavaScript(): boolean;
        isJson(): boolean;
        isLabelTruthy(name: string): boolean;
        isLaunchBarConfig(): boolean;
        isOptions(): boolean;
        isRoot(): boolean;
        isShared(): boolean;
        isTriliumScript(): boolean;
        isTriliumSqlite(): boolean;
        sortChildren(): void;
        sortParents(): void;
        toString(): string;
        update(row: FNoteRow): void;
    }
    Index

    Properties

    Accessors

    Methods

    Properties

    attachments: FAttachment[]
    attributes: string[]
    blobId: string
    children: string[]
    childToBranch: Record<string, string>
    highlightedTokens?: string[]
    isProtected: boolean
    mime: string

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

    noteId: string
    parents: string[]
    parentToBranch: Record<string, string>
    searchResultsLoaded?: boolean
    targetRelations: string[]
    title: string
    type: NoteType

    Accessors

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

      Returns Omit<FNote, "froca">

    • get isArchived(): boolean

      Returns boolean

    Methods

    • Parameters

      • path: string[]

      Returns FAttribute[]

    • Parameters

      • Optionaltype: string
      • Optionalname: string

      Returns void

    • Parameters

      • childNoteId: string
      • branchId: string
      • Optionalsort: boolean

      Returns void

    • Parameters

      • parentNoteId: string
      • branchId: string
      • Optionalsort: boolean

      Returns void

    • 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.

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

    • 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)

    • Parameters

      • attachmentId: string

      Returns Promise<FAttachment>

    • Returns Promise<FAttachment[]>

    • Parameters

      • role: string

      Returns Promise<FAttachment[]>

    • Parameters

      • type: AttributeType

        attribute type (label, relation, etc.)

      • name: string

        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.

    • Parameters

      • Optionaltype: AttributeType

        attribute type to filter

      • Optionalname: string

        attribute name to filter

      Returns FAttribute[]

      all note's attributes, including inherited ones

    • Parameters

      • type: AttributeType

        attribute type (label, relation, etc.)

      • name: string

        attribute name

      Returns string

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

    • Returns the note path considered to be the "best"

      Parameters

      • OptionalhoistedNoteId: string
      • OptionalactiveNotePath: string

      Returns string[]

      array of noteIds constituting the particular note path

    • Returns the note path considered to be the "best"

      Parameters

      • OptionalhoistedNoteId: string

      Returns string

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

    • Returns Promise<default>

    • Returns FBranch[]

      use getParentBranches() instead

    • Returns string[]

      use getParentBranchIds() instead

    • Returns FBranch[]

    • Returns string[]

    • Returns Promise<FNote[]>

    • Returns string

    • Returns Promise<string>

    • Returns string

    • Returns FBranch[]

    • Returns string

    • Returns Promise<any>

    • Parameters

      • name: string

        label name

      Returns FAttribute

      label if it exists, null otherwise

    • Parameters

      • Optionalname: string

        label name to filter

      Returns FAttribute[]

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

    • Parameters

      • name: string

        label name

      Returns string

      label value if label exists, null otherwise

    • Provides note's date metadata.

      Returns Promise<NoteMetaData>

    • Returns Promise<default>

      use getBlob() instead

    • Returns FNote[]

    • Parameters

      • type: AttributeType

        attribute type (label, relation, etc.)

      • name: string

        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.

    • Parameters

      • Optionaltype: AttributeType

        attribute type to filter

      • Optionalname: string

        attribute name to filter

      Returns FAttribute[]

      all note's attributes, including inherited ones

    • Parameters

      • type: AttributeType

        attribute type (label, relation, etc.)

      • name: string

        attribute name

      Returns string

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

    • Parameters

      • name: string

        label name

      Returns FAttribute

      label if it exists, null otherwise

    • Parameters

      • Optionalname: string

        label name to filter

      Returns FAttribute[]

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

    • Parameters

      • name: string

        label name

      Returns string

      label value if label exists, null otherwise

    • Parameters

      • name: string

        relation name

      Returns FAttribute

      relation if it exists, null otherwise

    • Parameters

      • Optionalname: string

        relation name to filter

      Returns FAttribute[]

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

    • Parameters

      • name: string

        relation name

      Returns string

      relation value if relation exists, null otherwise

    • Returns FBranch[]

    • Returns string[]

    • Returns string[]

    • Returns FNote[]

    • Returns FAttribute[]

    • Parameters

      • name: string

        relation name

      Returns FAttribute

      relation if it exists, null otherwise

    • Parameters

      • Optionalname: string

        relation name to filter

      Returns FAttribute[]

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

    • Parameters

      • name: string

      Returns Promise<FNote>

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

    • Parameters

      • Optionalname: string

        relation name to filter

      Returns Promise<FNote[]>

    • Parameters

      • name: string

        relation name

      Returns string

      relation value if relation exists, null otherwise

    • Returns "backend" | "frontend"

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

    • Parameters

      • OptionalhoistedNoteId: string
      • OptionalactiveNotePath: string

      Returns NotePathRecord[]

    • Parameters

      • OptionalincludeArchived: boolean

      Returns Promise<string[]>

    • Returns Promise<FNote[]>

    • Get relations which target this note

      Returns FAttribute[]

    • Get relations which target this note

      Returns Promise<FNote[]>

    • Returns string

    • Returns string

    • Parameters

      • ancestorNoteId: string
      • OptionalfollowTemplates: boolean
      • OptionalvisitedNoteIds: Set<string>

      Returns 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)

    • Returns boolean

    • Parameters

      • name: string

        label name

      Returns boolean

      true if label exists (including inherited)

    • 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)

    • Parameters

      • name: string

        label name

      Returns boolean

      true if label exists (excluding inherited)

    • Parameters

      • name: string

        relation name

      Returns boolean

      true if relation exists (excluding inherited)

    • Parameters

      • name: string

        relation name

      Returns boolean

      true if relation exists (including inherited)

    • Returns void

      NOOP

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns boolean

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

    • Returns boolean

      true if this note is HTML

    • Returns boolean

    • Returns boolean

      true if this note is JavaScript (code or file)

    • Returns boolean

    • Parameters

      • name: string

        label name

      Returns boolean

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

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns void

    • Returns void

    • Returns string

    • Parameters

      Returns void