Trilium Frontend API
    Preparing search index...

    Class default

    The editor can operate into two distinct modes:

    Hierarchy

    • default
      • default
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Returns default

    Properties

    _noteId: string
    _position: number
    $widget: any
    attrs: Record<string, string>
    children: default[]
    componentId: string
    initialized: Promise<void>
    noteContext?: NoteContext
    parent?: TypedComponent<any>
    spacedUpdate: default

    Accessors

    • get hoistedNoteId(): string

      Returns string

    • get note(): FNote

      Returns FNote

    • get noteId(): string

      Returns string

    • get notePath(): string

      Returns string

    • get ntxId(): string

      Returns string

    • get position(): number

      Returns number

    • set position(newPosition: number): void

      Parameters

      • newPosition: number

      Returns void

    • get sanitizedClassName(): string

      Returns string

    Methods

    • Returns Promise<void>

    • Parameters

      Returns Promise<void>

    • Returns void

    • Parameters

      • html: string

      Returns Promise<void>

    • Parameters

      • noteId: string

      Returns Promise<void>

    • Parameters

      • noteId: string
      • OptionalboxSize: BoxSize

      Returns void

    • Returns void

    • Parameters

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

      Returns Promise<void>

    • Parameters

      • linkHref: string
      • linkTitle: string

      Returns Promise<void>

    • Returns void

    • Parameters

      Returns void

    • Parameters

      • text: string

      Returns Promise<void>

    • Parameters

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

      Returns Promise<unknown>

    • Returns boolean

    • Parameters

      Returns this

    • Parameters

      • className: string

      Returns this

    • Returns void

    • Returns this

    • Returns this

    • Returns Promise<void>

    • Parameters

      • title: string

      Returns Promise<string>

    • Sets the CSS attribute of the given name to the given value.

      Parameters

      • name: string

        the name of the CSS attribute to set (e.g. padding-inline-start).

      • value: string

        the value of the CSS attribute to set (e.g. 12px).

      Returns this

      self for chaining.

    • Accepts a string of CSS to add with the widget.

      Parameters

      • block: string

      Returns this

      for chaining

    • Returns void

    • Parameters

      Returns Promise<void>

    • Returns void

    • Parameters

      Returns Promise<void>

    • Returns this

    • Returns any

    • Returns void

    • Returns Promise<void>

    • Returns Promise<void>

    • Returns string

    • Returns { content: string }

      promise resolving note data. Note data is an object with content.

    • Returns number

    • Returns string

    • Type Parameters

      Parameters

      Returns Promise<unknown>

    • By default:

      • activeContextChanged is intercepted and converted to a setNoteContext event to avoid refresh().
      • entitiesReloaded and refreshData are passed as-is.
      • any other event is not passed to the children.

      Type Parameters

      Parameters

      Returns Promise<unknown>

    • Returns boolean

    • Parameters

      • id: string

      Returns this

    • Returns Promise<void>

    • Returns void

    • Returns boolean

    • Returns boolean

    • Indicates if the widget is enabled. Widgets are enabled by default. Generally setting this to false will cause the widget not to be displayed, however it will still be available on the DOM but hidden.

      If the widget is not enabled, it will not receive `refreshWithNote` updates.

      Returns boolean

      true when an active note exists

    • Returns boolean

    • Returns boolean

    • Parameters

      • noteId: string

      Returns boolean

    • Parameters

      • ntxId: string | string[]

      Returns boolean | ""

    • Returns boolean

    • Parameters

      • noteId: string
      • $el: any

      Returns Promise<void>

    • Parameters

      • $el: any
      • Optionalhref: string

      Returns Promise<void>

    • Parameters

      • e: Error

      Returns void

    • Returns Promise<void>

    • Parameters

      Returns Promise<void>

    • Parameters

      Returns Promise<void>

    • Parameters

      • __namedParameters: { noteId: string }

      Returns Promise<void>

    • Returns Promise<void>

    • Parameters

      • $img: any

      Returns Promise<void>

    • Parameters

      • $img: any
      • Optionalactivate: boolean

      Returns Promise<void>

    • Conditionally adds the given components as children to this component.

      Parameters

      • condition: boolean

        whether to add the components.

      • ...components: (default | VNode<{}>)[]

        the components to be added as children to this component provided the condition is truthy.

      Returns this

      self for chaining.

    • Sets the CSS attribute of the given name to the given value, but only if the condition provided is truthy.

      Parameters

      • condition: boolean

        true in order to apply the CSS, false to ignore it.

      • name: string

        the name of the CSS attribute to set (e.g. padding-inline-start).

      • value: string

        the value of the CSS attribute to set (e.g. 12px).

      Returns this

      self for chaining.

    • Parameters

      • $img: any

      Returns Promise<{ noteId?: string; viewScope: ViewScope }>

    • Returns void

    • Parameters

      Returns Promise<void>

    • Returns Promise<void>

    • Returns void

    • Parameters

      • $container: any
      • noteId: string

      Returns void

    • Parameters

      • __namedParameters: { noteId: string }

      Returns Promise<void>

    • Override this method to be able to refresh your widget with each note.

      Parameters

      Returns Promise<void>

    • Type Parameters

      Parameters

      Returns void

    • Returns Promise<void>

    • Parameters

      • data: string

      Returns Promise<void>

    • Returns Promise<void>

    • Returns void

    • Type Parameters

      Parameters

      Returns void

    • Returns any

    • Returns void

    • Parameters

      Returns void

    • Parameters

      Returns this

    • Parameters

      • singleClickOpens: boolean

      Returns void

    • Returns void

    • Parameters

      • show: boolean | ""

      Returns void

    • Parameters

      • show: boolean

      Returns void

    • Type Parameters

      Parameters

      Returns Promise<unknown>

    • Type Parameters

      Parameters

      Returns Promise<unknown>

    • Returns string