Skip to content

BasesController

Unofficial

Controller for the view.

Import:

import type { BasesController } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface BasesController extends Component

Extends: Component

Constructor

new BasesController()

Constructor.

To extract the constructor type, use ExtractConstructor<Component>.

Properties

Property Type Description
_children Component[] Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from Component)
_events EventRef[] Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from Component)
_loaded boolean Whether the component and its children are loaded.
(Inherited from Component)
app App The Obsidian app instance.
ctx BasesContext The context of the view controller.
currentFile null | TFile The current file.
error null | string The current error.
errorEl HTMLDivElement The error element.
errors Set<string> The errors.
events Events The events.
filterMenu BasesFilterMenu The filter menu.
initialScan boolean Whether the initial scan has been completed.
mockContext BasesMockContext The mock context.
newItemMenu BasesNewItemMenu The new item menu.
plugin BasesPluginInstance The plugin instance.
propertyMenu BasesPropertyMenu The property menu.
query BasesQuery | null The query.
queryState string The query state.
queue PromisedQueue The queue.
relevantProperties Set<string> The relevant properties.
requestNotifyView Debouncer<[], void> The request to notify the view.
results Map<unknown, unknown> The results.
resultsMenu BasesResultsMenu The results menu.
sortMenu BasesSortMenu The sort menu.
view View The view.
viewContainerEl HTMLDivElement The view container element.
viewEstates Record<string, unknown> The view states.
viewHeaderEl HTMLDivElement The view header element.
viewMenu BasesViewMenu The view menu.
viewName string The view name.

Methods

Method Returns Description
addChild(component) T Adds a child component, loading it if this component is loaded.
(Inherited from Component)
addResult(result, arg2) unknown Adds a result to the results.
buildBasesContext(filter) BasesContext Builds the bases context.
clear() void Clears the view controller.
clearError() void Clears the error.
displayError(error, arg2) void Displays an error.
evaluateRelevantProperties(relevantProperties) void Evaluates the relevant properties.
getActiveBasesViewOfType(viewType) null | View Gets the active bases view of a given type.
getCurrentFile() null | TFile Gets the current file.
getEditorLanguageSupport() EditorLanguageSupport Gets the editor language support.
getMockValue(arg1) unknown Gets the mock value.
getMockValueForIdent(arg1) unknown Gets the mock value for an ident.
getProperties() unknown[] Gets the properties.
getQueryViewNames() string[] Gets the query view names.
getViewConfig() unknown Gets the view config.
getWidgetForIdent(type) string Gets the widget for an ident.
load() void Load this component and its children.
(Inherited from Component)
notifyView() void Notifies the view.
onConfigChanged(configKey) void On config changed.
onload() void Override this to load your component.
(Inherited from Component)
onResize() void On resize.
onunload() void Override this to unload your component
(Inherited from Component)
promptForAddView() void Prompt for add view.
register(cb) void Registers a callback to be called when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?) void Registers a DOM event to be detached when unloading.
(Inherited from Component)
registerDomEvent(el, type, callback, options?) void Registers a DOM event to be detached when unloading
(Inherited from Component)
registerDomEvent(el, type, callback, options?) void Registers a DOM event to be detached when unloading
(Inherited from Component)
registerEvent(eventRef) void Registers an event to be detached when unloading.
(Inherited from Component)
registerInterval(id) number Registers an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
(Inherited from Component)
registerScopeEvent(keymapEventHandler) void Register a scope keymap event handler to be removed on unload.
(Inherited from Component)
removeChild(component) T Removes a child component, unloading it.
(Inherited from Component)
removeResult(arg1) unknown Removes a result.
runQuery(arg1) void Runs a query.
selectView(viewName) void Selects a view.
setQuery(queryOrError) void Sets the query.
setQueryAndView(queryOrError, viewName) void Sets the query and view.
startLoader() void Starts the loader.
stopLoader() void Stops the loader.
unload() void Override this to unload your component.
(Inherited from Component)
update() void Updates the view.
updateCurrentFile(file) void Updates the current file.

Links to this page: