Skip to content

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.

  • EventDispatcher<{ 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]; }>

new Workspace(app): Workspace

Defined in: workspace.svelte.ts:2088

App

Workspace

EventDispatcher.constructor

_activeLeaf: WorkspaceLeaf | null

Defined in: workspace.svelte.ts:1438


readonly app: App

Defined in: workspace.svelte.ts:2088


containerEl: HTMLElement

Defined in: workspace.svelte.ts:1458


displayMode: WorkspaceDisplayMode

Defined in: workspace.svelte.ts:1437


readonly editorViews: EditorViewRegistry

Defined in: workspace.svelte.ts:1431


floating: WorkspaceFloating

Defined in: workspace.svelte.ts:1449


focusedHostId: string

Defined in: workspace.svelte.ts:1440


focusMode: WorkspaceFocusModeState | null

Defined in: workspace.svelte.ts:1439


layoutReady: boolean

Defined in: workspace.svelte.ts:1450


leftRibbon: WorkspaceRibbon

Defined in: workspace.svelte.ts:1456


leftSplit: WorkspaceSidedock

Defined in: workspace.svelte.ts:1441


rightRibbon: WorkspaceRibbon

Defined in: workspace.svelte.ts:1457


rightSplit: WorkspaceSidedock

Defined in: workspace.svelte.ts:1445


rootContainer: WorkspaceRoot

Defined in: workspace.svelte.ts:1435


rootSplit: WorkspaceView

Defined in: workspace.svelte.ts:1436


statusCompatEl: HTMLElement

Defined in: workspace.svelte.ts:1455


statusEl: HTMLElement

Defined in: workspace.svelte.ts:1454

get activeEditor(): MarkdownFileInfo | null

Defined in: workspace.svelte.ts:1940

MarkdownFileInfo | null


get activeLeaf(): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:1914

WorkspaceLeaf | null

set activeLeaf(leaf): void

Defined in: workspace.svelte.ts:1936

WorkspaceLeaf | null

void


get activeRootLeaf(): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:1925

WorkspaceLeaf | null


get isMobileMode(): boolean

Defined in: workspace.svelte.ts:1955

boolean

activateLeaf(leaf, options?): boolean

Defined in: workspace.svelte.ts:2760

WorkspaceLeaf | null

WorkspaceActivateLeafOptions = {}

boolean


changeLayout(workspace): Promise<void>

Defined in: workspace.svelte.ts:2162

any

Promise<void>


clearFocusModeForLeaf(leaf): boolean

Defined in: workspace.svelte.ts:1997

WorkspaceLeaf

boolean


closeFloatingWindow(window, options?): void

Defined in: workspace.svelte.ts:3383

WorkspaceWindow

boolean

string

void


closeLeafAndSelectFallback(leaf, options?): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:2808

WorkspaceLeaf

WorkspaceCloseLeafAndSelectFallbackOptions = {}

WorkspaceLeaf | null


collapseFloatingWindow(window): void

Defined in: workspace.svelte.ts:3335

WorkspaceWindow

void


commitFloatingWindowBounds(window, bounds, operation?): void

Defined in: workspace.svelte.ts:3374

WorkspaceWindow

Partial<Record<"x" | "y" | "width" | "height", number>>

string = "resize-floating-pane"

void


convertSidebarGroupToLeaves(group): WorkspaceLeaf[]

Defined in: workspace.svelte.ts:3032

WorkspaceSidebarGroup

WorkspaceLeaf[]


convertSidebarLeavesToGroup(side, leaves, options?): WorkspaceSidebarGroup

Defined in: workspace.svelte.ts:2988

SidebarSide

WorkspaceLeaf[]

SidebarGroupOptions & object = {}

WorkspaceSidebarGroup


createLeafBySplit(leaf, direction?, before?): WorkspaceLeaf

Defined in: workspace.svelte.ts:2856

WorkspaceLeaf

SplitDirection = "vertical"

boolean = false

WorkspaceLeaf


createLeafInParent(parent, index): WorkspaceLeaf

Defined in: workspace.svelte.ts:2850

WorkspaceSplit

number

WorkspaceLeaf


createOnDemandPluginInstallView(leaf, file, options?): Promise<OnDemandPluginInstallView | null>

Defined in: workspace.svelte.ts:2466

WorkspaceLeaf

TFile

boolean

Promise<OnDemandPluginInstallView | null>


detachLeavesOfType(viewType): void

Defined in: workspace.svelte.ts:2743

Remove all leaves of the given type.

string

void


determineViewType(type): string | undefined

Defined in: workspace.svelte.ts:2449

string

string | undefined


determineViewTypeForPath(path): string | undefined

Defined in: workspace.svelte.ts:2459

string

string | undefined


dispatch<T>(eventName, …args): boolean

Defined in: events.ts:105

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"

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">]

boolean

EventDispatcher.dispatch


dropWorkspaceItemOnTabs(parent, options): Promise<boolean>

Defined in: workspace.svelte.ts:1601

WorkspaceTabs | WorkspaceSplit<EventMap<T>>

TFile

WorkspaceLeaf

string

WorkspaceLayoutDropPosition

WorkspaceLayoutDropSource

Promise<boolean>


duplicateLeaf(leaf, leafType, direction?): Promise<WorkspaceLeaf>

Defined in: workspace.svelte.ts:3490

WorkspaceLeaf

boolean | PaneType

SplitDirection = "vertical"

Promise<WorkspaceLeaf>


emit<T>(eventName, …args): boolean

Defined in: events.ts:98

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"

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">]

boolean

EventDispatcher.emit


endLayoutDrag(options): WorkspaceLayoutDropEvent

Defined in: workspace.svelte.ts:1528

Omit<WorkspaceLayoutDropEvent, "defaultPrevented" | "preventDefault">

WorkspaceLayoutDropEvent


ensureSideLeaf(type, sideOrOptions?, options?): WorkspaceLeaf

Defined in: workspace.svelte.ts:3083

string

SidebarSide | EnsureSideLeafOptions

EnsureSideLeafOptions = {}

WorkspaceLeaf


enterFocusMode(leaf?): boolean

Defined in: workspace.svelte.ts:1977

WorkspaceLeaf | null

boolean


exitFocusMode(): boolean

Defined in: workspace.svelte.ts:1993

boolean


focusFloatingWindow(window): void

Defined in: workspace.svelte.ts:3302

WorkspaceWindow

void


focusRootHost(): void

Defined in: workspace.svelte.ts:1910

void


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.

TFile | null


getActiveViewOfType<T>(type): T | null

Defined in: workspace.svelte.ts:2595

Get the currently active view of a given type.

T extends View

Constructor<T>

T | null


getCommandHostDocument(hostId?): Document

Defined in: workspace.svelte.ts:1885

string = ...

Document


getCommandHostIdForLeaf(target): string

Defined in: workspace.svelte.ts:1872

WorkspaceLeaf | null

string


getCommandHostLeaf(hostId): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:1876

string

WorkspaceLeaf | null


getEditorAssociationForPath(path): { editorViewId: string; pattern: string; view?: RegisteredEditorViewContribution; } | undefined

Defined in: workspace.svelte.ts:2350

string

{ editorViewId: string; pattern: string; view?: RegisteredEditorViewContribution; } | undefined


getFocusedCommandHostId(): string

Defined in: workspace.svelte.ts:1898

string


getGroupLeaves(group): WorkspaceLeaf[]

Defined in: workspace.svelte.ts:2891

string

WorkspaceLeaf[]


getLastOpenFiles(): string[]

Defined in: workspace.svelte.ts:3048

string[]


getLayout(): Record<string, unknown>

Defined in: workspace.svelte.ts:2176

Record<string, unknown>


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.

boolean | PaneType

SplitDirection

WorkspaceLeaf


getLeafById(id): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:2582

Retrieve a leaf by its id.

string

Id of the leaf to retrieve.

WorkspaceLeaf | null


getLeavesOfType(viewType): WorkspaceLeaf[]

Defined in: workspace.svelte.ts:2749

string

WorkspaceLeaf[]


getLeftLeaf(split): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:3481

Create a new leaf inside the left sidebar.

boolean

Should the existing split be split up?

WorkspaceLeaf | null


getMostRecentLeaf(): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:2108

WorkspaceLeaf | null


getOpenLeafEntries(options?): WorkspaceOpenLeafEntry[]

Defined in: workspace.svelte.ts:2647

WorkspaceOpenLeafEntryOptions = {}

WorkspaceOpenLeafEntry[]


getOrCreateSidebarGroup(side, group, options?): WorkspaceSidebarGroup

Defined in: workspace.svelte.ts:2959

SidebarSide

string

SidebarGroupOptions = {}

WorkspaceSidebarGroup


getRightLeaf(split): WorkspaceLeaf | null

Defined in: workspace.svelte.ts:3466

Create a new leaf inside the right sidebar.

boolean

Should the existing split be split up?

WorkspaceLeaf | null


getSidebarGroup(side, group): WorkspaceSidebarGroup | null

Defined in: workspace.svelte.ts:2947

SidebarSide

string

WorkspaceSidebarGroup | null


getSidebarGroupLeaves(side, group): WorkspaceLeaf[]

Defined in: workspace.svelte.ts:2984

SidebarSide

string

WorkspaceLeaf[]


getSidebarGroups(side?): WorkspaceSidebarGroup[]

Defined in: workspace.svelte.ts:2930

SidebarSide

WorkspaceSidebarGroup[]


getUnpinnedLeaf(): WorkspaceLeaf

Defined in: workspace.svelte.ts:2887

WorkspaceLeaf


getVisibleHintTargets(): WorkspaceHintTarget[]

Defined in: workspace.svelte.ts:2112

WorkspaceHintTarget[]


handleLinkContextMenu(menu, linktext, sourcePath, event?): void

Defined in: workspace.svelte.ts:3128

Menu

string

string

MouseEvent

void


isFocusModeForTabs(tabs): boolean

Defined in: workspace.svelte.ts:2005

WorkspaceTabs

boolean


iterateAllLeaves<T>(callback): void | T

Defined in: workspace.svelte.ts:2632

Iterate through all leaves, including main area leaves, floating leaves, and sidebar leaves.

T = any

(leaf) => T

void | T


iterateRootLeaves(callback): void

Defined in: workspace.svelte.ts:2608

Iterate through all leaves in the main area of the workspace.

(leaf) => any

void


loadLayout(file?): Promise<void>

Defined in: workspace.svelte.ts:2044

string = "workspace.json"

Promise<void>


maximizeFloatingWindow(window): void

Defined in: workspace.svelte.ts:3351

WorkspaceWindow

void


minimizeFloatingWindow(window): void

Defined in: workspace.svelte.ts:3343

WorkspaceWindow

void


moveLeafToPopout(leaf, data?): WorkspaceWindow

Defined in: workspace.svelte.ts:3141

WorkspaceLeaf

WorkspaceWindowInitData

WorkspaceWindow


moveLeafToSidebarGroup(leaf, group, options?): boolean

Defined in: workspace.svelte.ts:1791

WorkspaceLeaf

WorkspaceSidebarGroup

string

WorkspaceLayoutDropSource

boolean


moveLeafToSidebarGroupIndex(leaf, group, index, options): boolean

Defined in: workspace.svelte.ts:1740

WorkspaceLeaf

WorkspaceSidebarGroup

number

string

"bottom" | "top"

WorkspaceLayoutDropSource

boolean


moveWorkspaceChildToFloating(item, data?, options?): WorkspaceWindow

Defined in: workspace.svelte.ts:3197

WorkspaceTabsChild

WorkspaceWindowInitData

string

WorkspaceLayoutDropSource

WorkspaceWindow


moveWorkspaceChildToPopout(item, data?): WorkspaceWindow

Defined in: workspace.svelte.ts:3152

WorkspaceTabsChild

WorkspaceWindowInitData

WorkspaceWindow


moveWorkspaceChildToTabIndex(item, target, index, options): boolean

Defined in: workspace.svelte.ts:1537

WorkspaceLeaf | WorkspaceSidebarGroup

WorkspaceTabs

number

string

"right" | "left"

WorkspaceLayoutDropSource

boolean


off<T>(eventName, listener, context?, once?): void

Defined in: events.ts:78

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"

T

(…args) => void

any

boolean

void

EventDispatcher.off


offref<T>(ref): void

Defined in: events.ts:87

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"

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>

void

EventDispatcher.offref


on<T>(eventName, listener, context?): 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>

Defined in: events.ts:48

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"

T

(…args) => void

any

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>

EventDispatcher.on


once<T>(eventName, listener, context?): 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>

Defined in: events.ts:63

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"

T

(…args) => void

any

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>

EventDispatcher.once


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.

() => any

void


openFloatingLeaf(data?): WorkspaceLeaf

Defined in: workspace.svelte.ts:3180

WorkspaceWindowInitData

WorkspaceLeaf


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

Defined in: workspace.svelte.ts:3058

string

string

boolean | PaneType

OpenViewState

Promise<void>


openPopoutLeaf(data?): WorkspaceLeaf

Defined in: workspace.svelte.ts:3163

WorkspaceWindowInitData

WorkspaceLeaf


registerEditorView(contribution): () => void

Defined in: workspace.svelte.ts:2215

EditorViewContribution

() => void


registerExtensions(extensions, viewType): void

Defined in: workspace.svelte.ts:2400

string[]

string

void


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.

string

HoverLinkSource

void


registerSidebarView(type, options?): void

Defined in: workspace.svelte.ts:2219

string

SidebarViewPlacementOptions = {}

void


registerView(type, viewCreator): void

Defined in: workspace.svelte.ts:2211

string

ViewCreator

void


requestSaveLayout(event?): void

Defined in: workspace.svelte.ts:1472

WorkspaceLayoutChangeEvent = ...

void


restoreFloatingWindow(window): void

Defined in: workspace.svelte.ts:3359

WorkspaceWindow

void


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.

WorkspaceLeaf

Promise<void>


setActiveLeaf(leaf, params?): void

Defined in: workspace.svelte.ts:2565

WorkspaceLeaf

boolean

void


setDisplayMode(mode, reason?): void

Defined in: workspace.svelte.ts:1960

WorkspaceDisplayMode

WorkspaceDisplayModeReason = "manual"

void


setFloatingWindowBounds(window, bounds): void

Defined in: workspace.svelte.ts:3367

WorkspaceWindow

Partial<Record<"x" | "y" | "width" | "height", number>>

void


setFloatingWindowDisplayState(window, displayState, operation?): void

Defined in: workspace.svelte.ts:3321

WorkspaceWindow

WorkspaceWindowDisplayState

string = ...

void


splitActiveLeaf(direction?): WorkspaceLeaf

Defined in: workspace.svelte.ts:2883

SplitDirection

WorkspaceLeaf


startLayoutDrag(options): WorkspaceLayoutDropEvent

Defined in: workspace.svelte.ts:1519

Omit<WorkspaceLayoutDropEvent, "defaultPrevented" | "preventDefault">

WorkspaceLayoutDropEvent


supportsPopoutWindows(): boolean

Defined in: workspace.svelte.ts:3211

boolean


toJson(): WorkspaceJson

Defined in: workspace.svelte.ts:2009

WorkspaceJson


trigger<T>(eventName, …args): boolean

Defined in: events.ts:91

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"

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">]

boolean

EventDispatcher.trigger


tryTrigger<T>(evt, …args): void

Defined in: events.ts:112

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"

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">]

void

EventDispatcher.tryTrigger


unregisterExtensions(extensions, viewType): void

Defined in: workspace.svelte.ts:2432

string[]

string

void


unregisterHoverLinkSource(id): void

Defined in: workspace.svelte.ts:2240

string

void


unregisterSidebarView(type): void

Defined in: workspace.svelte.ts:2226

string

void


unregisterView(type): boolean

Defined in: workspace.svelte.ts:2262

string

boolean


updateOptions(): void

Defined in: workspace.svelte.ts:2244

void


viewCreator(type): ViewCreator | undefined

Defined in: workspace.svelte.ts:2549

string | TFile

ViewCreator | undefined


willShowLayoutDropOverlay(options): WorkspaceLayoutDropEvent

Defined in: workspace.svelte.ts:1510

Omit<WorkspaceLayoutDropEvent, "defaultPrevented" | "preventDefault">

WorkspaceLayoutDropEvent