Trilium Frontend API
    Preparing search index...

    Interface RightPanelWidget

    This widget manages rendering panels in the right-hand pane.

    interface RightPanelWidget {
        _noteId: string;
        _position: number;
        $body: any;
        $widget: any;
        attrs: Record<string, string>;
        children: default[];
        componentId: string;
        initialized: Promise<void>;
        noteContext?: NoteContext;
        parent?: TypedComponent<any>;
        get help(): {};
        get hoistedNoteId(): string;
        get note(): FNote;
        get noteId(): string;
        get notePath(): string;
        get ntxId(): string;
        get position(): number;
        set position(newPosition: number): void;
        get sanitizedClassName(): string;
        get widgetButtons(): default<any>[];
        get widgetTitle(): string;
        activeContextChanged(): Promise<void>;
        activeContextChangedEvent(
            __namedParameters: { noteContext: NoteContext },
        ): Promise<void>;
        callMethod(
            fun: (arg: unknown) => Promise<unknown>,
            data: unknown,
        ): Promise<unknown>;
        canBeShown(): boolean;
        child(..._components: (default | VNode<{}>)[]): this;
        class(className: string): this;
        cleanup(): void;
        collapsible(): this;
        contentSized(): this;
        css(name: string, value: string): this;
        cssBlock(block: string): this;
        doRender(): void;
        doRenderBody(): Promise<void>;
        filling(): this;
        frocaReloadedEvent(): Promise<void>;
        getClosestNtxId(): string;
        getPosition(): number;
        handleEvent<T extends EventNames>(
            name: T,
            data: EventData<T>,
        ): Promise<unknown>;
        handleEventInChildren<T extends EventNames>(
            name: T,
            data: EventData<T>,
        ): Promise<unknown>;
        id(id: string): this;
        isActiveNoteContext(): boolean;
        isEnabled(): boolean;
        isHiddenExt(): boolean;
        isHiddenInt(): boolean;
        isNote(noteId: string): boolean;
        isNoteContext(ntxId: string | string[]): boolean | "";
        isVisible(): boolean;
        logRenderingError(e: Error): void;
        noteSwitched(): Promise<void>;
        noteSwitchedAndActivatedEvent(
            __namedParameters: NoteSwitchedContext,
        ): Promise<void>;
        noteSwitchedEvent(__namedParameters: NoteSwitchedContext): Promise<void>;
        noteTypeMimeChangedEvent(
            __namedParameters: { noteId: string },
        ): Promise<void>;
        optChild(condition: boolean, ...components: (default | VNode<{}>)[]): this;
        optCss(condition: boolean, name: string, value: string): this;
        refresh(): Promise<void>;
        refreshWithNote(note: FNote): Promise<void>;
        registerHandler<T extends EventNames>(name: T, handler: EventHandler): void;
        remove(): void;
        removeHandler<T extends EventNames>(name: T, handler: EventHandler): void;
        render(): any;
        setNoteContextEvent(__namedParameters: { noteContext: NoteContext }): void;
        setParent(parent: TypedComponent<any>): this;
        toggleExt(show: boolean | ""): void;
        toggleInt(show: boolean): void;
        triggerCommand<K extends keyof CommandMappings>(
            name: K,
            data?: CommandMappings[K],
        ): Promise<unknown>;
        triggerEvent<T extends EventNames>(
            name: T,
            data: EventData<T>,
        ): Promise<unknown>;
    }

    Hierarchy (View Summary)

    Index

    Properties

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

    Accessors

    • get help(): {}

      Returns {}

    • 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

    • get widgetButtons(): default<any>[]

      Returns default<any>[]

    • get widgetTitle(): string

      Title to show in the panel.

      Returns string

    Methods

    • Parameters

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

      Returns Promise<unknown>

    • Parameters

      • className: string

      Returns this

    • 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

    • Do not override this method unless you know what you're doing. Do not override this method unless you know what you're doing.

      Returns void

    • Method used for rendering the body of the widget (via existing this.$body)

      Your class should override this method.

      Returns Promise<void>

      if widget needs async operation to initialize, it can return a Promise

    • Parameters

      • id: string

      Returns this

    • 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

    • Parameters

      • noteId: string

      Returns boolean

    • Parameters

      • ntxId: string | string[]

      Returns boolean | ""

    • Parameters

      • __namedParameters: { noteId: string }

      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.

    • Returns Promise<void>

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

      Parameters

      Returns Promise<void>

    • Parameters

      • show: boolean | ""

      Returns void

    • Parameters

      • show: boolean

      Returns void