View

View class

Signature:

export abstract class View extends Component 

Extends: Component

Constructors

ConstructorModifiersDescription
(constructor)(leaf)Constructs a new instance of the View class

Properties

PropertyModifiersTypeDescription
appApp
containerElHTMLElement
iconIconName
leafWorkspaceLeaf
navigationbooleanWhether or not the view is intended for navigation. If your view is a static view that is not intended to be navigated away, set this to false. (For example: File explorer, calendar, etc.) If your view opens a file or can be otherwise navigated, set this to true. (For example: Markdown editor view, Kanban view, PDF view, etc.)
scopeScope | nullAssign an optional scope to your view to register hotkeys for when the view is in focus.

Methods

MethodModifiersDescription
addChild(component)

Adds a child component, loading it if this component is loaded

(Inherited from Component)

getDisplayText()abstract
getEphemeralState()
getIcon()
getState()
getViewType()abstract
load()

Load this component and its children

(Inherited from Component)

onClose()protected
onload()

Override this to load your component

(Inherited from Component)

onOpen()protected
onPaneMenu(menu, source)

Populates the pane menu.

(Replaces the previously removed onHeaderMenu and onMoreOptionsMenu)

onResize()Called when the size of this view is changed.
onunload()

Override this to unload your component

(Inherited from Component)

register(cb)

Registers a callback to be called when unloading

(Inherited from Component)

registerDomEvent(el, type, callback, options)

Registers an DOM event to be detached when unloading

(Inherited from Component)

registerDomEvent(el, type, callback, options)

Registers an DOM event to be detached when unloading

(Inherited from Component)

registerDomEvent(el, type, callback, options)

Registers an DOM event to be detached when unloading

(Inherited from Component)

registerEvent(eventRef)

Registers an event to be detached when unloading

(Inherited from Component)

registerInterval(id)

Registers an interval (from setInterval) to be cancelled when unloading Use instead of to avoid TypeScript confusing between NodeJS vs Browser API

(Inherited from Component)

removeChild(component)

Removes a child component, unloading it

(Inherited from Component)

setEphemeralState(state)
setState(state, result)
unload()

Unload this component and its children

(Inherited from Component)