Skip to content

TypedWorkspaceLeaf

Defined in: src/obsidian/internals/TypedWorkspaceLeaf.d.ts:8

Extends

Type Parameters

TView extends View

Properties

_

_: Record<string, EventsEntry[]>

Defined in: src/obsidian/augmentations/Events.d.ts:5

Inherited from

WorkspaceLeaf._


activeTime?

optional activeTime: number

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:5

Inherited from

WorkspaceLeaf.activeTime


app

app: App

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:5

Inherited from

WorkspaceLeaf.app


component

component: Component

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:6

Inherited from

WorkspaceLeaf.component


containerEl

containerEl: HTMLDivElement

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:7

Inherited from

WorkspaceLeaf.containerEl


dimension

dimension: null | number

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:8

Inherited from

WorkspaceLeaf.dimension


id

id: string

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:9

Inherited from

WorkspaceLeaf.id


parent

parent: WorkspaceMobileDrawer | WorkspaceTabs

Defined in: obsidian.d.ts:5021

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

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:10

Inherited from

WorkspaceLeaf.parentSplit


resizeHandleEl

resizeHandleEl: HTMLHRElement

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:11

Inherited from

WorkspaceLeaf.resizeHandleEl


tabHeaderEl

tabHeaderEl: HTMLElement

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:6

Inherited from

WorkspaceLeaf.tabHeaderEl


tabHeaderInnerIconEl

tabHeaderInnerIconEl: HTMLElement

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:7

Inherited from

WorkspaceLeaf.tabHeaderInnerIconEl


tabHeaderInnerTitleEl

tabHeaderInnerTitleEl: HTMLElement

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:8

Inherited from

WorkspaceLeaf.tabHeaderInnerTitleEl


type

type: string

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:12

Inherited from

WorkspaceLeaf.type


view

view: MaybeDeferredView<TView>

Defined in: src/obsidian/internals/TypedWorkspaceLeaf.d.ts:9

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

Overrides

WorkspaceLeaf.view


workspace

workspace: Workspace

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:13

Inherited from

WorkspaceLeaf.workspace

Accessors

isDeferred

Get Signature

get isDeferred(): boolean

Defined in: node_modules/obsidian/obsidian.d.ts:5058

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

Defined in: obsidian.d.ts:5093

Returns

void

Inherited from

WorkspaceLeaf.detach


getContainer()

getContainer(): WorkspaceContainer

Defined in: obsidian.d.ts:5002

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

Returns

WorkspaceContainer

Inherited from

WorkspaceLeaf.getContainer


getDisplayText()

getDisplayText(): string

Defined in: obsidian.d.ts:5102

Returns

string

Inherited from

WorkspaceLeaf.getDisplayText


getEphemeralState()

getEphemeralState(): any

Defined in: obsidian.d.ts:5069

Returns

any

Inherited from

WorkspaceLeaf.getEphemeralState


getIcon()

getIcon(): string

Defined in: obsidian.d.ts:5098

Returns

string

Inherited from

WorkspaceLeaf.getIcon


getRoot()

getRoot(): WorkspaceItem

Defined in: obsidian.d.ts:4995

Returns

WorkspaceItem

Inherited from

WorkspaceLeaf.getRoot


getViewState()

getViewState(): ViewState

Defined in: obsidian.d.ts:5046

Returns

ViewState

Inherited from

WorkspaceLeaf.getViewState


loadIfDeferred()

loadIfDeferred(): Promise<void>

Defined in: obsidian.d.ts:5064

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

Defined in: obsidian.d.ts:1441

Parameters

name

string

callback

(…data) => unknown

Returns

void

Inherited from

WorkspaceLeaf.off


offref()

offref(ref): void

Defined in: obsidian.d.ts:1445

Parameters

ref

EventRef

Returns

void

Inherited from

WorkspaceLeaf.offref


on()

Call Signature

on(name, callback, ctx?): EventRef

Defined in: obsidian.d.ts:5112

Parameters
name

"pinned-change"

callback

(pinned) => any

ctx?

any

Returns

EventRef

Inherited from

WorkspaceLeaf.on

Call Signature

on(name, callback, ctx?): EventRef

Defined in: obsidian.d.ts:5116

Parameters
name

"group-change"

callback

(group) => any

ctx?

any

Returns

EventRef

Inherited from

WorkspaceLeaf.on

Call Signature

on(name, callback, ctx?): EventRef

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:14

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

Parameters
name

"history-change"

callback

() => void

ctx?

unknown

Returns

EventRef

Inherited from

WorkspaceLeaf.on

Call Signature

on(name, callback, ctx?): EventRef

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:18

Triggers when context menu action is executed on the leaf

Parameters
name

"leaf-menu"

callback

(menu, leaf) => void

ctx?

unknown

Returns

EventRef

Inherited from

WorkspaceLeaf.on


onResize()

onResize(): void

Defined in: obsidian.d.ts:5107

Returns

void

Inherited from

WorkspaceLeaf.onResize


onResizeStart()

onResizeStart(evt): void

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:17

Parameters

evt

MouseEvent

Returns

void

Inherited from

WorkspaceLeaf.onResizeStart


open()

open(view): Promise<View>

Defined in: obsidian.d.ts:5041

Parameters

view

View

Returns

Promise<View>

Inherited from

WorkspaceLeaf.open


openFile()

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

Defined in: obsidian.d.ts:5036

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


openLinkText()

openLinkText(linktext, sourcePath, openViewState?): Promise<void>

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:25

Open a link in the current leaf

Parameters

linktext

string

The link text to open

sourcePath

string

The path of the source file

openViewState?

OpenViewState

The view state to open the link in

Returns

Promise<void>

Inherited from

WorkspaceLeaf.openLinkText


serialize()

serialize(): SerializedWorkspaceItem

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:18

Returns

SerializedWorkspaceItem

Inherited from

WorkspaceLeaf.serialize


setDimension()

setDimension(flexgrow?): void

Defined in: src/obsidian/augmentations/WorkspaceLeaf.d.ts:35

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?

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

null | number

Returns

void

Inherited from

WorkspaceLeaf.setDimension


setEphemeralState()

setEphemeralState(state): void

Defined in: obsidian.d.ts:5073

Parameters

state

any

Returns

void

Inherited from

WorkspaceLeaf.setEphemeralState


setGroup()

setGroup(group): void

Defined in: obsidian.d.ts:5089

Parameters

group

string

Returns

void

Inherited from

WorkspaceLeaf.setGroup


setGroupMember()

setGroupMember(other): void

Defined in: obsidian.d.ts:5085

Parameters

other

WorkspaceLeaf

Returns

void

Inherited from

WorkspaceLeaf.setGroupMember


setParent()

setParent(parent): void

Defined in: src/obsidian/augmentations/WorkspaceItem.d.ts:20

Parameters

parent

WorkspaceParent

Returns

void

Inherited from

WorkspaceLeaf.setParent


setPinned()

setPinned(pinned): void

Defined in: obsidian.d.ts:5081

Parameters

pinned

boolean

Returns

void

Inherited from

WorkspaceLeaf.setPinned


setViewState()

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

Defined in: obsidian.d.ts:5050

Parameters

viewState

ViewState

eState?

any

Returns

Promise<void>

Inherited from

WorkspaceLeaf.setViewState


togglePinned()

togglePinned(): void

Defined in: obsidian.d.ts:5077

Returns

void

Inherited from

WorkspaceLeaf.togglePinned


trigger()

trigger(name, …data): void

Defined in: obsidian.d.ts:1449

Parameters

name

string

data

unknown[]

Returns

void

Inherited from

WorkspaceLeaf.trigger


tryTrigger()

tryTrigger(evt, args): void

Defined in: obsidian.d.ts:1453

Parameters

evt

EventRef

args

unknown[]

Returns

void

Inherited from

WorkspaceLeaf.tryTrigger