trilium
    Preparing search index...

    Abstract class for all components in the Trilium's frontend.

    Contains also event implementation with following properties:

    • event / command distribution is synchronous which among others mean that events are well-ordered - event which was sent out first will also be processed first by the component
    • execution of the event / command is asynchronous - each component executes the event on its own without regard for other components.
    • although the execution is async, we are collecting all the promises, and therefore it is possible to wait until the event / command is executed in all components - by simply awaiting the triggerEvent().

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _position: number
    $widget: JQuery<HTMLElement>
    children: default[]
    componentId: string
    hoistedNoteId: string
    initialized: null | Promise<void>
    mainNtxId: null | string
    noteId?: null | string
    notePath?: null | string
    ntxId: null | string
    parent?: TypedComponent<any>
    parentNoteId?: null | string
    viewScope?: ViewScope

    Accessors

    Methods

    • Parameters

      • fun: (arg: unknown) => Promise<unknown>
      • data: unknown

      Returns undefined | Promise<unknown>

    • Returns a promise which will retrieve the JQuery element of the content of this note context.

      Do note that retrieving the content element needs to be handled by the type widget, which is the one which provides the content element by listening to the executeWithContentElement event. Not all note types support this.

      If no content could be determined null is returned instead.

      Returns Promise<JQuery<HTMLElement>>

    • Returns
          | null
          | {
              active: boolean;
              hoistedNoteId: string;
              mainNtxId: null
              | string;
              notePath: undefined | null | string;
              ntxId: null | string;
              viewScope: undefined | ViewScope;
          }

    • A main context represents a tab and also the first split. Further splits are the children contexts of the main context. Imagine you have a tab with 3 splits, each showing notes A, B, C (in this order). In such a scenario, A context is the main context (also representing the tab as a whole), and B, C are the children of context A.

      Returns boolean

      true if the context is main (= tab)