Trilium Frontend API
    Preparing search index...

    Interface AddLinkOpts

    interface AddLinkOpts {
        currentLink?: Suggestion;
        hasSelection: boolean;
        targetOnly?: boolean;
        text: string;
        addLink(
            notePath: string,
            linkTitle: string,
            externalLink?: boolean,
        ): Promise<void>;
    }
    Index
    currentLink?: Suggestion

    The link the dialog opens on, in the shape a pick comes back in.

    A caller changing a link that is already there says what it points at, and the field opens filled with it: changing a link is then the same gesture as making one, and a dialog left as it was applies what was already pointed at rather than refusing for want of a pick. The dialog says it is editing rather than adding, too.

    hasSelection: boolean
    targetOnly?: boolean

    Pick what the link points at and nothing else.

    For a caller that carries no text of its own to dress — a mind map node reads as its own topic — there is no title to write and no reference-or-hyperlink to choose between, and the anchor within a note is left out too: what it appends is a link only a rich text can follow. linkTitle is handed over all the same, so a caller minding it need not be told twice.

    text: string
    • Parameters

      • notePath: string
      • linkTitle: string
      • OptionalexternalLink: boolean

      Returns Promise<void>