BasesSearchMenu
Unofficial
The search menu of a obsidian#QueryController’s toolbar, providing the in-view search bar that filters results by a full-text query.
Import:
import type { BasesSearchMenu } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface BasesSearchMenu extends ComponentExtends: Component
Constructor
new BasesSearchMenu()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) | |
| _isOpen | boolean | Whether the search bar is currently open. | |
| _loaded | boolean | Whether the component and its children are loaded. (Inherited from Component) | |
| app | App | The app instance. | |
| button | unknown | The toolbar button that toggles the search bar. | |
| countEl | HTMLDivElement | The element displaying the search result count. | |
| inputEl | HTMLInputElement | The search input element. | |
| queryController | QueryController | The owning query controller. | |
| scope | Scope | The keyboard scope active while the search bar is open (registers Escape to close it). | |
| searchBarEl | HTMLDivElement | The search bar container element. | |
| update | Debouncer<[string], void> | Debounced update that pushes the typed query to the controller via obsidian#QueryController.updateSearchQuery. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| addChild(component) | T | Adds a child component, loading it if this component is loaded. (Inherited from Component) | |
| close() | void | Closes the search bar. | |
| load() | void | Load this component and its children. (Inherited from Component) | |
| onload() | void | Override this to load your component. (Inherited from Component) | |
| onunload() | void | Override this to unload your component (Inherited from Component) | |
| open() | void | Opens the search bar, focuses the input, and pushes the keyboard scope. | |
| 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) | |
| toggle() | void | Toggles the search bar open or closed. | |
| unload() | void | Override this to unload your component. (Inherited from Component) | |
| updateCount(entries) | void | Updates the displayed result count. |
Links to this page: