FileExplorerLeaf
Extends
Properties
_
_:
Record
<string
,EventsEntry
[]>
Inherited from
activeTime?
optional
activeTime:number
Inherited from
app
app:
App
Inherited from
component
component:
Component
Inherited from
containerEl
containerEl:
HTMLDivElement
Inherited from
dimension
dimension:
null
|number
Inherited from
id
id:
string
Inherited from
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
parentSplit?
readonly
optional
parentSplit:WorkspaceParent
Inherited from
resizeHandleEl
resizeHandleEl:
HTMLHRElement
Inherited from
tabHeaderEl
tabHeaderEl:
HTMLElement
Inherited from
tabHeaderInnerIconEl
tabHeaderInnerIconEl:
HTMLElement
Inherited from
WorkspaceLeaf
.tabHeaderInnerIconEl
tabHeaderInnerTitleEl
tabHeaderInnerTitleEl:
HTMLElement
Inherited from
WorkspaceLeaf
.tabHeaderInnerTitleEl
type
type:
string
Inherited from
view
view:
FileExplorerView
The view associated with this leaf. Do not attempt to cast this to your
custom View
without first checking instanceof
.
Overrides
workspace
workspace:
Workspace
Inherited from
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
Methods
detach()
detach():
void
Returns
void
Inherited from
getContainer()
getContainer():
WorkspaceContainer
Get the root container parent item, which can be one of:
Returns
Inherited from
getDisplayText()
getDisplayText():
string
Returns
string
Inherited from
getEphemeralState()
getEphemeralState():
any
Returns
any
Inherited from
WorkspaceLeaf
.getEphemeralState
getIcon()
getIcon():
string
Returns
string
Inherited from
getRoot()
getRoot():
WorkspaceItem
Returns
Inherited from
getViewState()
getViewState():
ViewState
Returns
Inherited from
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
off()
off(
name
,callback
):void
Parameters
• name: string
• callback
Returns
void
Inherited from
offref()
offref(
ref
):void
Parameters
• ref: EventRef
Returns
void
Inherited from
on()
on(name, callback, ctx)
on(
name
,callback
,ctx
?):EventRef
Parameters
• name: "pinned-change"
• callback
• ctx?: any
Returns
Inherited from
on(name, callback, ctx)
on(
name
,callback
,ctx
?):EventRef
Parameters
• name: "group-change"
• callback
• ctx?: any
Returns
Inherited from
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
Inherited from
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
Inherited from
onResize()
onResize():
void
Returns
void
Inherited from
onResizeStart()
onResizeStart(
evt
):void
Parameters
• evt: MouseEvent
Returns
void
Inherited from
open()
Parameters
• view: View
Returns
Inherited from
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
serialize()
serialize():
SerializedWorkspaceItem
Returns
Inherited from
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
setEphemeralState()
setEphemeralState(
state
):void
Parameters
• state: any
Returns
void
Inherited from
WorkspaceLeaf
.setEphemeralState
setGroup()
setGroup(
group
):void
Parameters
• group: string
Returns
void
Inherited from
setGroupMember()
setGroupMember(
other
):void
Parameters
• other: WorkspaceLeaf
Returns
void
Inherited from
setParent()
setParent(
parent
):void
Parameters
• parent: WorkspaceParent
Returns
void
Inherited from
setPinned()
setPinned(
pinned
):void
Parameters
• pinned: boolean
Returns
void
Inherited from
setViewState()
setViewState(
viewState
,eState
?):Promise
<void
>
Parameters
• viewState: ViewState
• eState?: any
Returns
Promise
<void
>
Inherited from
togglePinned()
togglePinned():
void
Returns
void
Inherited from
trigger()
trigger(
name
, …data
):void
Parameters
• name: string
• …data: unknown
[]
Returns
void
Inherited from
tryTrigger()
tryTrigger(
evt
,args
):void
Parameters
• evt: EventRef
• args: unknown
[]
Returns
void