Workspace
Class: Workspace
Section titled “Class: Workspace”Defined in: workspace.svelte.ts:1397
Owns the workspace layout tree, leaf registry, and view-type routing.
Workspace coordinates default file navigation, sidebar placement, layout
persistence, and the active editor/leaf state that plugins interact with.
Extends
Section titled “Extends”EventDispatcher<{active-leaf-change: [WorkspaceLeaf|null];display-mode-change: [WorkspaceDisplayModeChangeEvent];editor-menu: [Menu,Editor];editor-updated: [Editor, readonlyTransactionSpec[]];file-change: [TFile,string];file-menu: [Menu,TAbstractFile,string,WorkspaceLeaf];file-open: [TFile|null];files-menu: [Menu,TAbstractFile[],string,WorkspaceLeaf];focus-mode-change: [WorkspaceFocusModeState|null];layout-change: [WorkspaceLayoutChangeEvent];layout-did-drop: [WorkspaceLayoutDropEvent];layout-drag-end: [WorkspaceLayoutDropEvent];layout-drag-start: [WorkspaceLayoutDropEvent];layout-ready: [];layout-will-drop: [WorkspaceLayoutDropEvent];layout-will-show-overlay: [WorkspaceLayoutDropEvent];quick-preview: [TFile,string];resize: [any]; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Workspace(
app):Workspace
Defined in: workspace.svelte.ts:2088
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Workspace
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_activeLeaf
Section titled “_activeLeaf”_activeLeaf:
WorkspaceLeaf|null
Defined in: workspace.svelte.ts:1438
readonlyapp:App
Defined in: workspace.svelte.ts:2088
containerEl
Section titled “containerEl”containerEl:
HTMLElement
Defined in: workspace.svelte.ts:1458
displayMode
Section titled “displayMode”displayMode:
WorkspaceDisplayMode
Defined in: workspace.svelte.ts:1437
editorViews
Section titled “editorViews”
readonlyeditorViews:EditorViewRegistry
Defined in: workspace.svelte.ts:1431
floating
Section titled “floating”floating:
WorkspaceFloating
Defined in: workspace.svelte.ts:1449
focusedHostId
Section titled “focusedHostId”focusedHostId:
string
Defined in: workspace.svelte.ts:1440
focusMode
Section titled “focusMode”focusMode:
WorkspaceFocusModeState|null
Defined in: workspace.svelte.ts:1439
layoutReady
Section titled “layoutReady”layoutReady:
boolean
Defined in: workspace.svelte.ts:1450
leftRibbon
Section titled “leftRibbon”leftRibbon:
WorkspaceRibbon
Defined in: workspace.svelte.ts:1456
leftSplit
Section titled “leftSplit”leftSplit:
WorkspaceSidedock
Defined in: workspace.svelte.ts:1441
rightRibbon
Section titled “rightRibbon”rightRibbon:
WorkspaceRibbon
Defined in: workspace.svelte.ts:1457
rightSplit
Section titled “rightSplit”rightSplit:
WorkspaceSidedock
Defined in: workspace.svelte.ts:1445
rootContainer
Section titled “rootContainer”rootContainer:
WorkspaceRoot
Defined in: workspace.svelte.ts:1435
rootSplit
Section titled “rootSplit”rootSplit:
WorkspaceView
Defined in: workspace.svelte.ts:1436
statusCompatEl
Section titled “statusCompatEl”statusCompatEl:
HTMLElement
Defined in: workspace.svelte.ts:1455
statusEl
Section titled “statusEl”statusEl:
HTMLElement
Defined in: workspace.svelte.ts:1454
Accessors
Section titled “Accessors”activeEditor
Section titled “activeEditor”Get Signature
Section titled “Get Signature”get activeEditor():
MarkdownFileInfo|null
Defined in: workspace.svelte.ts:1940
Returns
Section titled “Returns”MarkdownFileInfo | null
activeLeaf
Section titled “activeLeaf”Get Signature
Section titled “Get Signature”get activeLeaf():
WorkspaceLeaf|null
Defined in: workspace.svelte.ts:1914
Returns
Section titled “Returns”WorkspaceLeaf | null
Set Signature
Section titled “Set Signature”set activeLeaf(
leaf):void
Defined in: workspace.svelte.ts:1936
Parameters
Section titled “Parameters”WorkspaceLeaf | null
Returns
Section titled “Returns”void
activeRootLeaf
Section titled “activeRootLeaf”Get Signature
Section titled “Get Signature”get activeRootLeaf():
WorkspaceLeaf|null
Defined in: workspace.svelte.ts:1925
Returns
Section titled “Returns”WorkspaceLeaf | null
isMobileMode
Section titled “isMobileMode”Get Signature
Section titled “Get Signature”get isMobileMode():
boolean
Defined in: workspace.svelte.ts:1955
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”activateLeaf()
Section titled “activateLeaf()”activateLeaf(
leaf,options?):boolean
Defined in: workspace.svelte.ts:2760
Parameters
Section titled “Parameters”WorkspaceLeaf | null
options?
Section titled “options?”WorkspaceActivateLeafOptions = {}
Returns
Section titled “Returns”boolean
changeLayout()
Section titled “changeLayout()”changeLayout(
workspace):Promise<void>
Defined in: workspace.svelte.ts:2162
Parameters
Section titled “Parameters”workspace
Section titled “workspace”any
Returns
Section titled “Returns”Promise<void>
clearFocusModeForLeaf()
Section titled “clearFocusModeForLeaf()”clearFocusModeForLeaf(
leaf):boolean
Defined in: workspace.svelte.ts:1997
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
closeFloatingWindow()
Section titled “closeFloatingWindow()”closeFloatingWindow(
window,options?):void
Defined in: workspace.svelte.ts:3383
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
options?
Section titled “options?”closeHost?
Section titled “closeHost?”boolean
operation?
Section titled “operation?”string
Returns
Section titled “Returns”void
closeLeafAndSelectFallback()
Section titled “closeLeafAndSelectFallback()”closeLeafAndSelectFallback(
leaf,options?):WorkspaceLeaf|null
Defined in: workspace.svelte.ts:2808
Parameters
Section titled “Parameters”options?
Section titled “options?”WorkspaceCloseLeafAndSelectFallbackOptions = {}
Returns
Section titled “Returns”WorkspaceLeaf | null
collapseFloatingWindow()
Section titled “collapseFloatingWindow()”collapseFloatingWindow(
window):void
Defined in: workspace.svelte.ts:3335
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
Returns
Section titled “Returns”void
commitFloatingWindowBounds()
Section titled “commitFloatingWindowBounds()”commitFloatingWindowBounds(
window,bounds,operation?):void
Defined in: workspace.svelte.ts:3374
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
bounds
Section titled “bounds”Partial<Record<"x" | "y" | "width" | "height", number>>
operation?
Section titled “operation?”string = "resize-floating-pane"
Returns
Section titled “Returns”void
convertSidebarGroupToLeaves()
Section titled “convertSidebarGroupToLeaves()”convertSidebarGroupToLeaves(
group):WorkspaceLeaf[]
Defined in: workspace.svelte.ts:3032
Parameters
Section titled “Parameters”Returns
Section titled “Returns”convertSidebarLeavesToGroup()
Section titled “convertSidebarLeavesToGroup()”convertSidebarLeavesToGroup(
side,leaves,options?):WorkspaceSidebarGroup
Defined in: workspace.svelte.ts:2988
Parameters
Section titled “Parameters”SidebarSide
leaves
Section titled “leaves”options?
Section titled “options?”SidebarGroupOptions & object = {}
Returns
Section titled “Returns”createLeafBySplit()
Section titled “createLeafBySplit()”createLeafBySplit(
leaf,direction?,before?):WorkspaceLeaf
Defined in: workspace.svelte.ts:2856
Parameters
Section titled “Parameters”direction?
Section titled “direction?”SplitDirection = "vertical"
before?
Section titled “before?”boolean = false
Returns
Section titled “Returns”createLeafInParent()
Section titled “createLeafInParent()”createLeafInParent(
parent,index):WorkspaceLeaf
Defined in: workspace.svelte.ts:2850
Parameters
Section titled “Parameters”parent
Section titled “parent”number
Returns
Section titled “Returns”createOnDemandPluginInstallView()
Section titled “createOnDemandPluginInstallView()”createOnDemandPluginInstallView(
leaf,file,options?):Promise<OnDemandPluginInstallView|null>
Defined in: workspace.svelte.ts:2466
Parameters
Section titled “Parameters”options?
Section titled “options?”confirm?
Section titled “confirm?”boolean
Returns
Section titled “Returns”Promise<OnDemandPluginInstallView | null>
detachLeavesOfType()
Section titled “detachLeavesOfType()”detachLeavesOfType(
viewType):void
Defined in: workspace.svelte.ts:2743
Remove all leaves of the given type.
Parameters
Section titled “Parameters”viewType
Section titled “viewType”string
Returns
Section titled “Returns”void
determineViewType()
Section titled “determineViewType()”determineViewType(
type):string|undefined
Defined in: workspace.svelte.ts:2449
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | undefined
determineViewTypeForPath()
Section titled “determineViewTypeForPath()”determineViewTypeForPath(
path):string|undefined
Defined in: workspace.svelte.ts:2459
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | undefined
dispatch()
Section titled “dispatch()”dispatch<
T>(eventName, …args):boolean
Defined in: events.ts:105
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…ArgumentMap<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }>[Extract<T, "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu">]
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”dropWorkspaceItemOnTabs()
Section titled “dropWorkspaceItemOnTabs()”dropWorkspaceItemOnTabs(
parent,options):Promise<boolean>
Defined in: workspace.svelte.ts:1601
Parameters
Section titled “Parameters”parent
Section titled “parent”WorkspaceTabs | WorkspaceSplit<EventMap<T>>
options
Section titled “options”operation?
Section titled “operation?”string
position
Section titled “position”WorkspaceLayoutDropPosition
source?
Section titled “source?”WorkspaceLayoutDropSource
Returns
Section titled “Returns”Promise<boolean>
duplicateLeaf()
Section titled “duplicateLeaf()”duplicateLeaf(
leaf,leafType,direction?):Promise<WorkspaceLeaf>
Defined in: workspace.svelte.ts:3490
Parameters
Section titled “Parameters”leafType
Section titled “leafType”boolean | PaneType
direction?
Section titled “direction?”SplitDirection = "vertical"
Returns
Section titled “Returns”Promise<WorkspaceLeaf>
emit()
Section titled “emit()”emit<
T>(eventName, …args):boolean
Defined in: events.ts:98
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…ArgumentMap<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }>[Extract<T, "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu">]
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”endLayoutDrag()
Section titled “endLayoutDrag()”endLayoutDrag(
options):WorkspaceLayoutDropEvent
Defined in: workspace.svelte.ts:1528
Parameters
Section titled “Parameters”options
Section titled “options”Omit<WorkspaceLayoutDropEvent, "defaultPrevented" | "preventDefault">
Returns
Section titled “Returns”WorkspaceLayoutDropEvent
ensureSideLeaf()
Section titled “ensureSideLeaf()”ensureSideLeaf(
type,sideOrOptions?,options?):WorkspaceLeaf
Defined in: workspace.svelte.ts:3083
Parameters
Section titled “Parameters”string
sideOrOptions?
Section titled “sideOrOptions?”SidebarSide | EnsureSideLeafOptions
options?
Section titled “options?”EnsureSideLeafOptions = {}
Returns
Section titled “Returns”enterFocusMode()
Section titled “enterFocusMode()”enterFocusMode(
leaf?):boolean
Defined in: workspace.svelte.ts:1977
Parameters
Section titled “Parameters”WorkspaceLeaf | null
Returns
Section titled “Returns”boolean
exitFocusMode()
Section titled “exitFocusMode()”exitFocusMode():
boolean
Defined in: workspace.svelte.ts:1993
Returns
Section titled “Returns”boolean
focusFloatingWindow()
Section titled “focusFloatingWindow()”focusFloatingWindow(
window):void
Defined in: workspace.svelte.ts:3302
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
Returns
Section titled “Returns”void
focusRootHost()
Section titled “focusRootHost()”focusRootHost():
void
Defined in: workspace.svelte.ts:1910
Returns
Section titled “Returns”void
getActiveFile()
Section titled “getActiveFile()”getActiveFile():
TFile|null
Defined in: workspace.svelte.ts:2618
Returns the file for the current view if it’s a FileView. Otherwise, it
will return the most recently active file.
Returns
Section titled “Returns”TFile | null
getActiveViewOfType()
Section titled “getActiveViewOfType()”getActiveViewOfType<
T>(type):T|null
Defined in: workspace.svelte.ts:2595
Get the currently active view of a given type.
Type Parameters
Section titled “Type Parameters”T extends View
Parameters
Section titled “Parameters”Constructor<T>
Returns
Section titled “Returns”T | null
getCommandHostDocument()
Section titled “getCommandHostDocument()”getCommandHostDocument(
hostId?):Document
Defined in: workspace.svelte.ts:1885
Parameters
Section titled “Parameters”hostId?
Section titled “hostId?”string = ...
Returns
Section titled “Returns”Document
getCommandHostIdForLeaf()
Section titled “getCommandHostIdForLeaf()”getCommandHostIdForLeaf(
target):string
Defined in: workspace.svelte.ts:1872
Parameters
Section titled “Parameters”target
Section titled “target”WorkspaceLeaf | null
Returns
Section titled “Returns”string
getCommandHostLeaf()
Section titled “getCommandHostLeaf()”getCommandHostLeaf(
hostId):WorkspaceLeaf|null
Defined in: workspace.svelte.ts:1876
Parameters
Section titled “Parameters”hostId
Section titled “hostId”string
Returns
Section titled “Returns”WorkspaceLeaf | null
getEditorAssociationForPath()
Section titled “getEditorAssociationForPath()”getEditorAssociationForPath(
path): {editorViewId:string;pattern:string;view?:RegisteredEditorViewContribution; } |undefined
Defined in: workspace.svelte.ts:2350
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”{ editorViewId: string; pattern: string; view?: RegisteredEditorViewContribution; } | undefined
getFocusedCommandHostId()
Section titled “getFocusedCommandHostId()”getFocusedCommandHostId():
string
Defined in: workspace.svelte.ts:1898
Returns
Section titled “Returns”string
getGroupLeaves()
Section titled “getGroupLeaves()”getGroupLeaves(
group):WorkspaceLeaf[]
Defined in: workspace.svelte.ts:2891
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”getLastOpenFiles()
Section titled “getLastOpenFiles()”getLastOpenFiles():
string[]
Defined in: workspace.svelte.ts:3048
Returns
Section titled “Returns”string[]
getLayout()
Section titled “getLayout()”getLayout():
Record<string,unknown>
Defined in: workspace.svelte.ts:2176
Returns
Section titled “Returns”Record<string, unknown>
getLeaf()
Section titled “getLeaf()”getLeaf(
newLeaf?,direction?):WorkspaceLeaf
Defined in: workspace.svelte.ts:3550
If newLeaf is false (or not set) then an existing leaf which can be navigated is returned, or a new leaf will be created if there was no leaf available.
If newLeaf is 'tab' or true then a new leaf will be created in the
preferred location within the root split and returned.
If newLeaf is 'split' then a new leaf will be created adjacent to the
currently active leaf.
If newLeaf is 'window' then a popout window will be created with a new
leaf inside.
Parameters
Section titled “Parameters”newLeaf?
Section titled “newLeaf?”boolean | PaneType
direction?
Section titled “direction?”SplitDirection
Returns
Section titled “Returns”getLeafById()
Section titled “getLeafById()”getLeafById(
id):WorkspaceLeaf|null
Defined in: workspace.svelte.ts:2582
Retrieve a leaf by its id.
Parameters
Section titled “Parameters”string
Id of the leaf to retrieve.
Returns
Section titled “Returns”WorkspaceLeaf | null
getLeavesOfType()
Section titled “getLeavesOfType()”getLeavesOfType(
viewType):WorkspaceLeaf[]
Defined in: workspace.svelte.ts:2749
Parameters
Section titled “Parameters”viewType
Section titled “viewType”string
Returns
Section titled “Returns”getLeftLeaf()
Section titled “getLeftLeaf()”getLeftLeaf(
split):WorkspaceLeaf|null
Defined in: workspace.svelte.ts:3481
Create a new leaf inside the left sidebar.
Parameters
Section titled “Parameters”boolean
Should the existing split be split up?
Returns
Section titled “Returns”WorkspaceLeaf | null
getMostRecentLeaf()
Section titled “getMostRecentLeaf()”getMostRecentLeaf():
WorkspaceLeaf|null
Defined in: workspace.svelte.ts:2108
Returns
Section titled “Returns”WorkspaceLeaf | null
getOpenLeafEntries()
Section titled “getOpenLeafEntries()”getOpenLeafEntries(
options?):WorkspaceOpenLeafEntry[]
Defined in: workspace.svelte.ts:2647
Parameters
Section titled “Parameters”options?
Section titled “options?”WorkspaceOpenLeafEntryOptions = {}
Returns
Section titled “Returns”WorkspaceOpenLeafEntry[]
getOrCreateSidebarGroup()
Section titled “getOrCreateSidebarGroup()”getOrCreateSidebarGroup(
side,group,options?):WorkspaceSidebarGroup
Defined in: workspace.svelte.ts:2959
Parameters
Section titled “Parameters”SidebarSide
string
options?
Section titled “options?”SidebarGroupOptions = {}
Returns
Section titled “Returns”getRightLeaf()
Section titled “getRightLeaf()”getRightLeaf(
split):WorkspaceLeaf|null
Defined in: workspace.svelte.ts:3466
Create a new leaf inside the right sidebar.
Parameters
Section titled “Parameters”boolean
Should the existing split be split up?
Returns
Section titled “Returns”WorkspaceLeaf | null
getSidebarGroup()
Section titled “getSidebarGroup()”getSidebarGroup(
side,group):WorkspaceSidebarGroup|null
Defined in: workspace.svelte.ts:2947
Parameters
Section titled “Parameters”SidebarSide
string
Returns
Section titled “Returns”WorkspaceSidebarGroup | null
getSidebarGroupLeaves()
Section titled “getSidebarGroupLeaves()”getSidebarGroupLeaves(
side,group):WorkspaceLeaf[]
Defined in: workspace.svelte.ts:2984
Parameters
Section titled “Parameters”SidebarSide
string
Returns
Section titled “Returns”getSidebarGroups()
Section titled “getSidebarGroups()”getSidebarGroups(
side?):WorkspaceSidebarGroup[]
Defined in: workspace.svelte.ts:2930
Parameters
Section titled “Parameters”SidebarSide
Returns
Section titled “Returns”getUnpinnedLeaf()
Section titled “getUnpinnedLeaf()”getUnpinnedLeaf():
WorkspaceLeaf
Defined in: workspace.svelte.ts:2887
Returns
Section titled “Returns”getVisibleHintTargets()
Section titled “getVisibleHintTargets()”getVisibleHintTargets():
WorkspaceHintTarget[]
Defined in: workspace.svelte.ts:2112
Returns
Section titled “Returns”handleLinkContextMenu()
Section titled “handleLinkContextMenu()”handleLinkContextMenu(
menu,linktext,sourcePath,event?):void
Defined in: workspace.svelte.ts:3128
Parameters
Section titled “Parameters”linktext
Section titled “linktext”string
sourcePath
Section titled “sourcePath”string
event?
Section titled “event?”MouseEvent
Returns
Section titled “Returns”void
isFocusModeForTabs()
Section titled “isFocusModeForTabs()”isFocusModeForTabs(
tabs):boolean
Defined in: workspace.svelte.ts:2005
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
iterateAllLeaves()
Section titled “iterateAllLeaves()”iterateAllLeaves<
T>(callback):void|T
Defined in: workspace.svelte.ts:2632
Iterate through all leaves, including main area leaves, floating leaves, and sidebar leaves.
Type Parameters
Section titled “Type Parameters”T = any
Parameters
Section titled “Parameters”callback
Section titled “callback”(leaf) => T
Returns
Section titled “Returns”void | T
iterateRootLeaves()
Section titled “iterateRootLeaves()”iterateRootLeaves(
callback):void
Defined in: workspace.svelte.ts:2608
Iterate through all leaves in the main area of the workspace.
Parameters
Section titled “Parameters”callback
Section titled “callback”(leaf) => any
Returns
Section titled “Returns”void
loadLayout()
Section titled “loadLayout()”loadLayout(
file?):Promise<void>
Defined in: workspace.svelte.ts:2044
Parameters
Section titled “Parameters”string = "workspace.json"
Returns
Section titled “Returns”Promise<void>
maximizeFloatingWindow()
Section titled “maximizeFloatingWindow()”maximizeFloatingWindow(
window):void
Defined in: workspace.svelte.ts:3351
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
Returns
Section titled “Returns”void
minimizeFloatingWindow()
Section titled “minimizeFloatingWindow()”minimizeFloatingWindow(
window):void
Defined in: workspace.svelte.ts:3343
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
Returns
Section titled “Returns”void
moveLeafToPopout()
Section titled “moveLeafToPopout()”moveLeafToPopout(
leaf,data?):WorkspaceWindow
Defined in: workspace.svelte.ts:3141
Parameters
Section titled “Parameters”WorkspaceWindowInitData
Returns
Section titled “Returns”WorkspaceWindow
moveLeafToSidebarGroup()
Section titled “moveLeafToSidebarGroup()”moveLeafToSidebarGroup(
leaf,group,options?):boolean
Defined in: workspace.svelte.ts:1791
Parameters
Section titled “Parameters”options?
Section titled “options?”operation?
Section titled “operation?”string
source?
Section titled “source?”WorkspaceLayoutDropSource
Returns
Section titled “Returns”boolean
moveLeafToSidebarGroupIndex()
Section titled “moveLeafToSidebarGroupIndex()”moveLeafToSidebarGroupIndex(
leaf,group,index,options):boolean
Defined in: workspace.svelte.ts:1740
Parameters
Section titled “Parameters”number
options
Section titled “options”operation?
Section titled “operation?”string
position
Section titled “position”"bottom" | "top"
source?
Section titled “source?”WorkspaceLayoutDropSource
Returns
Section titled “Returns”boolean
moveWorkspaceChildToFloating()
Section titled “moveWorkspaceChildToFloating()”moveWorkspaceChildToFloating(
item,data?,options?):WorkspaceWindow
Defined in: workspace.svelte.ts:3197
Parameters
Section titled “Parameters”WorkspaceTabsChild
WorkspaceWindowInitData
options?
Section titled “options?”operation?
Section titled “operation?”string
source?
Section titled “source?”WorkspaceLayoutDropSource
Returns
Section titled “Returns”WorkspaceWindow
moveWorkspaceChildToPopout()
Section titled “moveWorkspaceChildToPopout()”moveWorkspaceChildToPopout(
item,data?):WorkspaceWindow
Defined in: workspace.svelte.ts:3152
Parameters
Section titled “Parameters”WorkspaceTabsChild
WorkspaceWindowInitData
Returns
Section titled “Returns”WorkspaceWindow
moveWorkspaceChildToTabIndex()
Section titled “moveWorkspaceChildToTabIndex()”moveWorkspaceChildToTabIndex(
item,target,index,options):boolean
Defined in: workspace.svelte.ts:1537
Parameters
Section titled “Parameters”WorkspaceLeaf | WorkspaceSidebarGroup
target
Section titled “target”number
options
Section titled “options”operation?
Section titled “operation?”string
position
Section titled “position”"right" | "left"
source?
Section titled “source?”WorkspaceLayoutDropSource
Returns
Section titled “Returns”boolean
off<
T>(eventName,listener,context?,once?):void
Defined in: events.ts:78
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”(…args) => void
context?
Section titled “context?”any
boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”offref()
Section titled “offref()”offref<
T>(ref):void
Defined in: events.ts:87
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”EventRef<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }, T>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”on<
T>(eventName,listener,context?):EventRef<{active-leaf-change: [WorkspaceLeaf|null];display-mode-change: [WorkspaceDisplayModeChangeEvent];editor-menu: [Menu,Editor];editor-updated: [Editor, readonlyTransactionSpec[]];file-change: [TFile,string];file-menu: [Menu,TAbstractFile,string,WorkspaceLeaf];file-open: [TFile|null];files-menu: [Menu,TAbstractFile[],string,WorkspaceLeaf];focus-mode-change: [WorkspaceFocusModeState|null];layout-change: [WorkspaceLayoutChangeEvent];layout-did-drop: [WorkspaceLayoutDropEvent];layout-drag-end: [WorkspaceLayoutDropEvent];layout-drag-start: [WorkspaceLayoutDropEvent];layout-ready: [];layout-will-drop: [WorkspaceLayoutDropEvent];layout-will-show-overlay: [WorkspaceLayoutDropEvent];quick-preview: [TFile,string];resize: [any]; },T,any>
Defined in: events.ts:48
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”(…args) => void
context?
Section titled “context?”any
Returns
Section titled “Returns”EventRef<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }, T, any>
Inherited from
Section titled “Inherited from”once()
Section titled “once()”once<
T>(eventName,listener,context?):EventRef<{active-leaf-change: [WorkspaceLeaf|null];display-mode-change: [WorkspaceDisplayModeChangeEvent];editor-menu: [Menu,Editor];editor-updated: [Editor, readonlyTransactionSpec[]];file-change: [TFile,string];file-menu: [Menu,TAbstractFile,string,WorkspaceLeaf];file-open: [TFile|null];files-menu: [Menu,TAbstractFile[],string,WorkspaceLeaf];focus-mode-change: [WorkspaceFocusModeState|null];layout-change: [WorkspaceLayoutChangeEvent];layout-did-drop: [WorkspaceLayoutDropEvent];layout-drag-end: [WorkspaceLayoutDropEvent];layout-drag-start: [WorkspaceLayoutDropEvent];layout-ready: [];layout-will-drop: [WorkspaceLayoutDropEvent];layout-will-show-overlay: [WorkspaceLayoutDropEvent];quick-preview: [TFile,string];resize: [any]; },T,any>
Defined in: events.ts:63
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”(…args) => void
context?
Section titled “context?”any
Returns
Section titled “Returns”EventRef<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }, T, any>
Inherited from
Section titled “Inherited from”onLayoutReady()
Section titled “onLayoutReady()”onLayoutReady(
callback):void
Defined in: workspace.svelte.ts:2080
Runs the callback function right away if layout is already ready, or push it to a queue to be called later when layout is ready.
Parameters
Section titled “Parameters”callback
Section titled “callback”() => any
Returns
Section titled “Returns”void
openFloatingLeaf()
Section titled “openFloatingLeaf()”openFloatingLeaf(
data?):WorkspaceLeaf
Defined in: workspace.svelte.ts:3180
Parameters
Section titled “Parameters”WorkspaceWindowInitData
Returns
Section titled “Returns”openLinkText()
Section titled “openLinkText()”openLinkText(
linktext,sourcePath,newLeaf?,openState?):Promise<void>
Defined in: workspace.svelte.ts:3058
Parameters
Section titled “Parameters”linktext
Section titled “linktext”string
sourcePath
Section titled “sourcePath”string
newLeaf?
Section titled “newLeaf?”boolean | PaneType
openState?
Section titled “openState?”Returns
Section titled “Returns”Promise<void>
openPopoutLeaf()
Section titled “openPopoutLeaf()”openPopoutLeaf(
data?):WorkspaceLeaf
Defined in: workspace.svelte.ts:3163
Parameters
Section titled “Parameters”WorkspaceWindowInitData
Returns
Section titled “Returns”registerEditorView()
Section titled “registerEditorView()”registerEditorView(
contribution): () =>void
Defined in: workspace.svelte.ts:2215
Parameters
Section titled “Parameters”contribution
Section titled “contribution”EditorViewContribution
Returns
Section titled “Returns”() => void
registerExtensions()
Section titled “registerExtensions()”registerExtensions(
extensions,viewType):void
Defined in: workspace.svelte.ts:2400
Parameters
Section titled “Parameters”extensions
Section titled “extensions”string[]
viewType
Section titled “viewType”string
Returns
Section titled “Returns”void
registerHoverLinkSource()
Section titled “registerHoverLinkSource()”registerHoverLinkSource(
id,info):void
Defined in: workspace.svelte.ts:2236
Registers a view with the ‘Page preview’ core plugin as an emitter of the ‘hover-link’ event.
Parameters
Section titled “Parameters”string
HoverLinkSource
Returns
Section titled “Returns”void
registerSidebarView()
Section titled “registerSidebarView()”registerSidebarView(
type,options?):void
Defined in: workspace.svelte.ts:2219
Parameters
Section titled “Parameters”string
options?
Section titled “options?”SidebarViewPlacementOptions = {}
Returns
Section titled “Returns”void
registerView()
Section titled “registerView()”registerView(
type,viewCreator):void
Defined in: workspace.svelte.ts:2211
Parameters
Section titled “Parameters”string
viewCreator
Section titled “viewCreator”ViewCreator
Returns
Section titled “Returns”void
requestSaveLayout()
Section titled “requestSaveLayout()”requestSaveLayout(
event?):void
Defined in: workspace.svelte.ts:1472
Parameters
Section titled “Parameters”event?
Section titled “event?”WorkspaceLayoutChangeEvent = ...
Returns
Section titled “Returns”void
restoreFloatingWindow()
Section titled “restoreFloatingWindow()”restoreFloatingWindow(
window):void
Defined in: workspace.svelte.ts:3359
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
Returns
Section titled “Returns”void
revealLeaf()
Section titled “revealLeaf()”revealLeaf(
leaf):Promise<void>
Defined in: workspace.svelte.ts:2187
Bring a given leaf to the foreground. If the leaf is in a sidebar, the
sidebar will be uncollapsed. await this function to ensure your view has
been fully loaded and is not deferred.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
setActiveLeaf()
Section titled “setActiveLeaf()”setActiveLeaf(
leaf,params?):void
Defined in: workspace.svelte.ts:2565
Parameters
Section titled “Parameters”params?
Section titled “params?”focus?
Section titled “focus?”boolean
Returns
Section titled “Returns”void
setDisplayMode()
Section titled “setDisplayMode()”setDisplayMode(
mode,reason?):void
Defined in: workspace.svelte.ts:1960
Parameters
Section titled “Parameters”WorkspaceDisplayMode
reason?
Section titled “reason?”WorkspaceDisplayModeReason = "manual"
Returns
Section titled “Returns”void
setFloatingWindowBounds()
Section titled “setFloatingWindowBounds()”setFloatingWindowBounds(
window,bounds):void
Defined in: workspace.svelte.ts:3367
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
bounds
Section titled “bounds”Partial<Record<"x" | "y" | "width" | "height", number>>
Returns
Section titled “Returns”void
setFloatingWindowDisplayState()
Section titled “setFloatingWindowDisplayState()”setFloatingWindowDisplayState(
window,displayState,operation?):void
Defined in: workspace.svelte.ts:3321
Parameters
Section titled “Parameters”window
Section titled “window”WorkspaceWindow
displayState
Section titled “displayState”WorkspaceWindowDisplayState
operation?
Section titled “operation?”string = ...
Returns
Section titled “Returns”void
splitActiveLeaf()
Section titled “splitActiveLeaf()”splitActiveLeaf(
direction?):WorkspaceLeaf
Defined in: workspace.svelte.ts:2883
Parameters
Section titled “Parameters”direction?
Section titled “direction?”SplitDirection
Returns
Section titled “Returns”startLayoutDrag()
Section titled “startLayoutDrag()”startLayoutDrag(
options):WorkspaceLayoutDropEvent
Defined in: workspace.svelte.ts:1519
Parameters
Section titled “Parameters”options
Section titled “options”Omit<WorkspaceLayoutDropEvent, "defaultPrevented" | "preventDefault">
Returns
Section titled “Returns”WorkspaceLayoutDropEvent
supportsPopoutWindows()
Section titled “supportsPopoutWindows()”supportsPopoutWindows():
boolean
Defined in: workspace.svelte.ts:3211
Returns
Section titled “Returns”boolean
toJson()
Section titled “toJson()”toJson():
WorkspaceJson
Defined in: workspace.svelte.ts:2009
Returns
Section titled “Returns”WorkspaceJson
trigger()
Section titled “trigger()”trigger<
T>(eventName, …args):boolean
Defined in: events.ts:91
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…ArgumentMap<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }>[Extract<T, "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu">]
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”tryTrigger()
Section titled “tryTrigger()”tryTrigger<
T>(evt, …args):void
Defined in: events.ts:112
Type Parameters
Section titled “Type Parameters”T extends "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu"
Parameters
Section titled “Parameters”EventRef<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }, T>
…ArgumentMap<{ active-leaf-change: [WorkspaceLeaf | null]; display-mode-change: [WorkspaceDisplayModeChangeEvent]; editor-menu: [Menu, Editor]; editor-updated: [Editor, readonly TransactionSpec[]]; file-change: [TFile, string]; file-menu: [Menu, TAbstractFile, string, WorkspaceLeaf]; file-open: [TFile | null]; files-menu: [Menu, TAbstractFile[], string, WorkspaceLeaf]; focus-mode-change: [WorkspaceFocusModeState | null]; layout-change: [WorkspaceLayoutChangeEvent]; layout-did-drop: [WorkspaceLayoutDropEvent]; layout-drag-end: [WorkspaceLayoutDropEvent]; layout-drag-start: [WorkspaceLayoutDropEvent]; layout-ready: []; layout-will-drop: [WorkspaceLayoutDropEvent]; layout-will-show-overlay: [WorkspaceLayoutDropEvent]; quick-preview: [TFile, string]; resize: [any]; }>[Extract<T, "editor-updated" | "resize" | "active-leaf-change" | "display-mode-change" | "focus-mode-change" | "layout-ready" | "layout-change" | "layout-drag-start" | "layout-drag-end" | "layout-will-show-overlay" | "layout-will-drop" | "layout-did-drop" | "quick-preview" | "file-open" | "file-change" | "file-menu" | "files-menu" | "editor-menu">]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”unregisterExtensions()
Section titled “unregisterExtensions()”unregisterExtensions(
extensions,viewType):void
Defined in: workspace.svelte.ts:2432
Parameters
Section titled “Parameters”extensions
Section titled “extensions”string[]
viewType
Section titled “viewType”string
Returns
Section titled “Returns”void
unregisterHoverLinkSource()
Section titled “unregisterHoverLinkSource()”unregisterHoverLinkSource(
id):void
Defined in: workspace.svelte.ts:2240
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
unregisterSidebarView()
Section titled “unregisterSidebarView()”unregisterSidebarView(
type):void
Defined in: workspace.svelte.ts:2226
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
unregisterView()
Section titled “unregisterView()”unregisterView(
type):boolean
Defined in: workspace.svelte.ts:2262
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
updateOptions()
Section titled “updateOptions()”updateOptions():
void
Defined in: workspace.svelte.ts:2244
Returns
Section titled “Returns”void
viewCreator()
Section titled “viewCreator()”viewCreator(
type):ViewCreator|undefined
Defined in: workspace.svelte.ts:2549
Parameters
Section titled “Parameters”string | TFile
Returns
Section titled “Returns”ViewCreator | undefined
willShowLayoutDropOverlay()
Section titled “willShowLayoutDropOverlay()”willShowLayoutDropOverlay(
options):WorkspaceLayoutDropEvent
Defined in: workspace.svelte.ts:1510
Parameters
Section titled “Parameters”options
Section titled “options”Omit<WorkspaceLayoutDropEvent, "defaultPrevented" | "preventDefault">
Returns
Section titled “Returns”WorkspaceLayoutDropEvent