Trilium Backend API
    Preparing search index...

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

    interface BBranch {
        blobId?: string;
        branchId?: string;
        dateCreated?: string;
        dateModified?: string;
        isExpanded: boolean;
        isProtected?: boolean;
        isSynced?: boolean;
        noteId: string;
        notePosition: number;
        parentNoteId: string;
        prefix: string;
        utcDateCreated: string;
        utcDateModified?: string;
        get becca(): default;
        get childNote(): BNote;
        get isDeleted(): boolean;
        get isWeak(): boolean;
        get parentNote(): BNote;
        _getContent(): string | Buffer<ArrayBufferLike>;
        _setContent(
            content: string | Buffer<ArrayBufferLike>,
            opts?: ContentOpts,
        ): void;
        beforeSaving(): void;
        createClone(parentNoteId: string, notePosition?: number): BBranch;
        deleteBranch(
            deleteId?: string,
            taskContext?: TaskContext<"deleteNotes">,
        ): boolean;
        generateHash(isDeleted?: boolean): string;
        getNote(): BNote;
        getParentNote(): BNote;
        getPojo(): {
            branchId: string;
            isDeleted: boolean;
            isExpanded: boolean;
            noteId: string;
            notePosition: number;
            parentNoteId: string;
            prefix: string;
            utcDateModified: string;
        };
        getPojoToSave(): {};
        getUtcDateChanged(): string;
        hasStringContent(): boolean;
        init(): void;
        markAsDeleted(deleteId?: string): void;
        markAsDeletedSimple(): void;
        putEntityChange(isDeleted: boolean): void;
        save(opts?: {}): this;
        update(__namedParameters: any): this;
        updateFromRow(row: BranchRow): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    blobId?: string
    branchId?: string
    dateCreated?: string
    dateModified?: string
    isExpanded: boolean
    isProtected?: boolean
    isSynced?: boolean
    noteId: string
    notePosition: number
    parentNoteId: string
    prefix: string
    utcDateCreated: string
    utcDateModified?: string

    Accessors

    • get becca(): default

      Returns default

    • get childNote(): BNote

      Returns BNote

    • get isDeleted(): boolean

      Returns boolean

    • get isWeak(): boolean

      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.

      Returns boolean

    • get parentNote(): BNote

      Returns BNote

      root branch will have undefined parent, all other branches have to have a parent note

    Methods

    • Parameters

      • parentNoteId: string
      • OptionalnotePosition: number

      Returns BBranch

    • Delete a branch. If this is a last note's branch, delete the note as well.

      Parameters

      • OptionaldeleteId: string

        optional delete identified

      • OptionaltaskContext: TaskContext<"deleteNotes">

      Returns boolean

      true if note has been deleted, false otherwise

    • Parameters

      • OptionalisDeleted: boolean

      Returns string

    • Returns BNote

    • Returns BNote

    • Returns {
          branchId: string;
          isDeleted: boolean;
          isExpanded: boolean;
          noteId: string;
          notePosition: number;
          parentNoteId: string;
          prefix: string;
          utcDateModified: string;
      }

    • Returns void

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

      Parameters

      • OptionaldeleteId: string

      Returns void

    • Parameters

      • isDeleted: boolean

      Returns void

    • Saves entity - executes SQL, but doesn't commit the transaction on its own

      Parameters

      • Optionalopts: {}

      Returns this

    • Parameters

      • __namedParameters: any

      Returns this