Skip to content

GlobalSearchLeaf

Extends

Properties

_

_: Record<string, EventsEntry[]>

Inherited from

WorkspaceLeaf._


activeTime?

optional activeTime: number

Inherited from

WorkspaceLeaf.activeTime


app

app: App

Inherited from

WorkspaceLeaf.app


component

component: Component

Inherited from

WorkspaceLeaf.component


containerEl

containerEl: HTMLDivElement

Inherited from

WorkspaceLeaf.containerEl


dimension

dimension: null | number

Inherited from

WorkspaceLeaf.dimension


id

id: string

Inherited from

WorkspaceLeaf.id


parent

parent: WorkspaceMobileDrawer | WorkspaceTabs

The direct parent of the leaf.

On desktop, a leaf is always a child of a WorkspaceTabs component. On mobile, a leaf might be a child of a WorkspaceMobileDrawer. Perform an instanceof check before making an assumption about the parent.

Inherited from

WorkspaceLeaf.parent


parentSplit?

readonly optional parentSplit: WorkspaceParent

Inherited from

WorkspaceLeaf.parentSplit


resizeHandleEl

resizeHandleEl: HTMLHRElement

Inherited from

WorkspaceLeaf.resizeHandleEl


tabHeaderEl

tabHeaderEl: HTMLElement

Inherited from

WorkspaceLeaf.tabHeaderEl


tabHeaderInnerIconEl

tabHeaderInnerIconEl: HTMLElement

Inherited from

WorkspaceLeaf.tabHeaderInnerIconEl


tabHeaderInnerTitleEl

tabHeaderInnerTitleEl: HTMLElement

Inherited from

WorkspaceLeaf.tabHeaderInnerTitleEl


type

type: string

Inherited from

WorkspaceLeaf.type


view

view: View

The view associated with this leaf. Do not attempt to cast this to your custom View without first checking instanceof.

Inherited from

WorkspaceLeaf.view


workspace

workspace: Workspace

Inherited from

WorkspaceLeaf.workspace

Accessors

isDeferred

get isDeferred(): boolean

Returns true if this leaf is currently deferred because it is in the background. A deferred leaf will have a DeferredView as its view, instead of the View that it should normally have for its type (like MarkdownView for the markdown type).

Since

1.7.2

Returns

boolean

Inherited from

WorkspaceLeaf.isDeferred

Methods

detach()

detach(): void

Returns

void

Inherited from

WorkspaceLeaf.detach


getContainer()

getContainer(): WorkspaceContainer

Get the root container parent item, which can be one of:

Returns

WorkspaceContainer

Inherited from

WorkspaceLeaf.getContainer


getDisplayText()

getDisplayText(): string

Returns

string

Inherited from

WorkspaceLeaf.getDisplayText


getEphemeralState()

getEphemeralState(): any

Returns

any

Inherited from

WorkspaceLeaf.getEphemeralState


getIcon()

getIcon(): string

Returns

string

Inherited from

WorkspaceLeaf.getIcon


getRoot()

getRoot(): WorkspaceItem

Returns

WorkspaceItem

Inherited from

WorkspaceLeaf.getRoot


getViewState()

getViewState(): ViewState

Returns

ViewState

Inherited from

WorkspaceLeaf.getViewState


loadIfDeferred()

loadIfDeferred(): Promise<void>

If this view is currently deferred, load it and await that it has fully loaded.

Returns

Promise<void>

Since

1.7.2

Inherited from

WorkspaceLeaf.loadIfDeferred


off()

off(name, callback): void

Parameters

name: string

callback

Returns

void

Inherited from

WorkspaceLeaf.off


offref()

offref(ref): void

Parameters

ref: EventRef

Returns

void

Inherited from

WorkspaceLeaf.offref


on()

on(name, callback, ctx)

on(name, callback, ctx?): EventRef

Parameters

name: "pinned-change"

callback

ctx?: any

Returns

EventRef

Inherited from

WorkspaceLeaf.on

on(name, callback, ctx)

on(name, callback, ctx?): EventRef

Parameters

name: "group-change"

callback

ctx?: any

Returns

EventRef

Inherited from

WorkspaceLeaf.on

on(name, callback, ctx)

on(name, callback, ctx?): EventRef

Triggers when the leaf’s history gets updated (e.g. when new file is opened, or moving through history)

Parameters

name: "history-change"

callback

ctx?: unknown

Returns

EventRef

Inherited from

WorkspaceLeaf.on

on(name, callback, ctx)

on(name, callback, ctx?): EventRef

Triggers when context menu action is executed on the leaf

Parameters

name: "leaf-menu"

callback

ctx?: unknown

Returns

EventRef

Inherited from

WorkspaceLeaf.on


onResize()

onResize(): void

Returns

void

Inherited from

WorkspaceLeaf.onResize


onResizeStart()

onResizeStart(evt): void

Parameters

evt: MouseEvent

Returns

void

Inherited from

WorkspaceLeaf.onResizeStart


open()

open(view): Promise<View>

Parameters

view: View

Returns

Promise<View>

Inherited from

WorkspaceLeaf.open


openFile()

openFile(file, openState?): Promise<void>

By default, openFile will also make the leaf active. Pass in { active: false } to override.

Parameters

file: TFile

openState?: OpenViewState

Returns

Promise<void>

Inherited from

WorkspaceLeaf.openFile


serialize()

serialize(): SerializedWorkspaceItem

Returns

SerializedWorkspaceItem

Inherited from

WorkspaceLeaf.serialize


setDimension()

setDimension(flexgrow?): void

Set the vertical height a leaf may occupy if it is in a split. The height is not set directly, but by setting the flex-grow (css) of the element. This means to predictably affect the height, you also need to use setDimension on the other leafs of the column. (The flex-grow values of every leaf work basically like a ratio, e.g. 1:2 meaning the first leaf takes 33% of the height, and the second 67%.)

Parameters

flexgrow?: null | number

Sets the flex-grow of the leaf. (0-100)

Returns

void

Inherited from

WorkspaceLeaf.setDimension


setEphemeralState()

setEphemeralState(state): void

Parameters

state: any

Returns

void

Inherited from

WorkspaceLeaf.setEphemeralState


setGroup()

setGroup(group): void

Parameters

group: string

Returns

void

Inherited from

WorkspaceLeaf.setGroup


setGroupMember()

setGroupMember(other): void

Parameters

other: WorkspaceLeaf

Returns

void

Inherited from

WorkspaceLeaf.setGroupMember


setParent()

setParent(parent): void

Parameters

parent: WorkspaceParent

Returns

void

Inherited from

WorkspaceLeaf.setParent


setPinned()

setPinned(pinned): void

Parameters

pinned: boolean

Returns

void

Inherited from

WorkspaceLeaf.setPinned


setViewState()

setViewState(viewState, eState?): Promise<void>

Parameters

viewState: ViewState

eState?: any

Returns

Promise<void>

Inherited from

WorkspaceLeaf.setViewState


togglePinned()

togglePinned(): void

Returns

void

Inherited from

WorkspaceLeaf.togglePinned


trigger()

trigger(name, …data): void

Parameters

name: string

• …data: unknown[]

Returns

void

Inherited from

WorkspaceLeaf.trigger


tryTrigger()

tryTrigger(evt, args): void

Parameters

evt: EventRef

args: unknown[]

Returns

void

Inherited from

WorkspaceLeaf.tryTrigger