SearchView
Extends
Properties
_children
_children:
Component
[]
Child Components attached to current component, will be unloaded on unloading parent component
Inherited from
_events
_events:
EventRef
[]
Events that are attached to the current component, will be detached on unloading parent component
Inherited from
_loaded
_loaded:
boolean
Whether the component and its children are loaded
Inherited from
app
app:
App
Inherited from
closeable
closeable:
boolean
Whether the leaf may close the view
Inherited from
containerEl
containerEl:
HTMLElement
Inherited from
icon
icon:
string
Inherited from
leaf
leaf:
WorkspaceLeaf
Inherited from
navigation
navigation:
boolean
Whether 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.)
Inherited from
scope
scope:
null
|Scope
Assign an optional scope to your view to register hotkeys for when the view is in focus.
Example
Default
Inherited from
Methods
addChild()
addChild<
T
>(component
):T
Adds a child component, loading it if this component is loaded
Type Parameters
• T extends Component
Parameters
• component: T
Returns
T
Inherited from
close()
close():
Promise
<void
>
Closes the view
Returns
Promise
<void
>
Inherited from
getDisplayText()
abstract
getDisplayText():string
Returns
string
Inherited from
getEphemeralState()
getEphemeralState()
getEphemeralState():
Record
<string
,unknown
>
Returns
Record
<string
, unknown
>
Inherited from
getEphemeralState()
getEphemeralState():
object
Gets the ephemeral (non-persistent) state of the editor
Returns
object
Inherited from
getIcon()
getIcon()
getIcon():
string
Returns
string
Inherited from
getIcon()
getIcon():
string
Returns the icon name
Returns
string
Inherited from
getQuery()
getQuery():
string
Returns the value of the search element
Returns
string
getSideTooltipPlacement()
getSideTooltipPlacement():
undefined
|"left"
|"right"
Returns the placement of the tooltip
Returns
undefined
| "left"
| "right"
Inherited from
getState()
getState()
getState():
Record
<string
,unknown
>
Returns
Record
<string
, unknown
>
Inherited from
getState()
getState():
object
Returns the current state of the view
Returns
object
Inherited from
getViewType()
getViewType():
"search"
Get the current view type
Returns
"search"
Overrides
handleCopy()
handleCopy(
event
):void
Handle copy event on metadata editor and serialize properties
Parameters
• event: ClipboardEvent
Returns
void
Inherited from
handleCut()
handleCut(
event
):void
Handle cut event on metadata editor and serialize and remove properties
Parameters
• event: ClipboardEvent
Returns
void
Inherited from
handlePaste()
handlePaste(
event
):void
Handle paste event of properties on metadata editor
Parameters
• event: ClipboardEvent
Returns
void
Inherited from
load()
load():
void
Load this component and its children
Returns
void
Inherited from
onClose()
onClose():
Promise
<void
>
Returns
Promise
<void
>
Inherited from
onCopyResultsClick()
onCopyResultsClick(
event
):void
Parameters
• event: MouseEvent
Returns
void
onHeaderMenu()
onHeaderMenu(
e
):void
Parameters
• e: unknown
Returns
void
Inherited from
onKeyArrowDownInFocus()
onKeyArrowDownInFocus(
event
):void
Parameters
• event: KeyboardEvent
Returns
void
onKeyArrowLeftInFocus()
onKeyArrowLeftInFocus(
event
):void
Parameters
• event: KeyboardEvent
Returns
void
onKeyArrowRightInFocus()
onKeyArrowRightInFocus(
event
):void
Parameters
• event: KeyboardEvent
Returns
void
onKeyArrowUpInFocus()
onKeyArrowUpInFocus(
event
):void
Parameters
• event: KeyboardEvent
Returns
void
onKeyEnterInFocus()
onKeyEnterInFocus(
event
):void
Parameters
• event: KeyboardEvent
Returns
void
onKeyShowMoreAfter()
onKeyShowMoreAfter(
e
):void
Parameters
• e: unknown
Returns
void
onKeyShowMoreBefore()
onKeyShowMoreBefore(
e
):void
Parameters
• e: unknown
Returns
void
onload()
onload():
void
Override this to load your component
Returns
void
Inherited from
onOpen()
onOpen():
Promise
<void
>
Returns
Promise
<void
>
Inherited from
onPaneMenu()
onPaneMenu(
menu
,source
):void
Populates the pane menu.
(Replaces the previously removed onHeaderMenu
and onMoreOptionsMenu
)
Parameters
• menu: Menu
• source: string
Returns
void
Inherited from
onResize()
onResize():
void
Called when the size of this view is changed.
Returns
void
Inherited from
onTabHeaderClick()
onTabHeaderClick():
void
Called when the tap header is clicked. Brings this tab to the front
Returns
void
onTabMenu()
onTabMenu(
menu
):void
Adds the menu items to the menu
Parameters
• menu: Menu
the menu to fill
Returns
void
Inherited from
onunload()
onunload():
void
Override this to unload your component
Returns
void
Inherited from
open()
open(
parentEl
):Promise
<void
>
Opens the view
Parameters
• parentEl: Node
The node the view get attached to
Returns
Promise
<void
>
Inherited from
register()
register(
cb
):void
Registers a callback to be called when unloading
Parameters
• cb
Returns
void
Inherited from
registerDomEvent()
registerDomEvent(el, type, callback, options)
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof WindowEventMap
Parameters
• el: Window
• type: K
• callback
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
registerDomEvent(el, type, callback, options)
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof DocumentEventMap
Parameters
• el: Document
• type: K
• callback
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
registerDomEvent(el, type, callback, options)
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof HTMLElementEventMap
Parameters
• el: HTMLElement
• type: K
• callback
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
registerEvent()
registerEvent(
eventRef
):void
Registers an event to be detached when unloading
Parameters
• eventRef: EventRef
Returns
void
Inherited from
registerInterval()
registerInterval(
id
):number
Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
Parameters
• id: number
Returns
number
Inherited from
registerScopeEvent()
registerScopeEvent(
keymapEventHandler
):void
Parameters
• keymapEventHandler: KeymapEventHandler
Returns
void
Inherited from
removeChild()
removeChild<
T
>(component
):T
Removes a child component, unloading it
Type Parameters
• T extends Component
Parameters
• component: T
Returns
T
Inherited from
renderSearchInfo()
renderSearchInfo(
e
,parentEl
):void
Parameters
• e: unknown
• parentEl: HTMLElement
Returns
void
saveSearch()
saveSearch():
void
Saves the current search string to the recent searches in Local Storage
Returns
void
setCollapseAll()
setCollapseAll(
e
):void
Parameters
• e: unknown
Returns
void
setEphemeralState()
setEphemeralState(state)
setEphemeralState(
state
):void
Parameters
• state: unknown
Returns
void
Inherited from
setEphemeralState(state)
setEphemeralState(
state
):void
Set the ephemeral (non-persistent) state of the editor
Parameters
• state: any
Returns
void
Inherited from
setExplainSearch()
setExplainSearch(
e
):void
Parameters
• e: unknown
Returns
void
setExtraContext()
setExtraContext(
e
):void
Parameters
• e: unknown
Returns
void
setMatchingCase()
setMatchingCase(
e
):void
Parameters
• e: unknown
Returns
void
setQuery()
setQuery(
value
):void
Sets the value of the search element
Parameters
• value: string
The search string
Returns
void
setSortOrder()
setSortOrder(
sortOrder
):void
Parameters
• sortOrder: unknown
Returns
void
setState()
setState(state, result)
setState(
state
,result
):Promise
<void
>
Parameters
• state: unknown
• result: ViewStateResult
Returns
Promise
<void
>
Inherited from
setState(state, result)
setState(
state
,result
):Promise
<void
>
Parameters
• state: any
• result: ViewStateResult
Returns
Promise
<void
>
Inherited from
startSearch()
startSearch():
void
Starts the search and renders the results
Returns
void
stopSearch()
stopSearch():
void
Stops the search and clears the results
Returns
void
toggleFilterSection()
toggleFilterSection():
void
Toggles the visibility of the filter section. Called if clicked on ‘Search settings’
Returns
void
unload()
unload():
void
Unload this component and its children
Returns
void