Skip to content

WorkspaceRoot

Official

Workspace root.

Import:

import { WorkspaceRoot } from 'obsidian';

Signature:

export class WorkspaceRoot extends WorkspaceContainer

Extends: WorkspaceContainer

Constructor

new WorkspaceRoot(workspace: Workspace, direction: string, id?: string | undefined)

Constructor.

To get the constructor instance, use getWorkspaceRootConstructor from obsidian-typings/implementations.

Properties

PropertyTypeDescription
direction'horizontal' | 'vertical'The layout direction of the split.
(Inherited from WorkspaceContainer)
docDocumentThe document object.
isResizingbooleanWhether a resize drag is currently in progress.
(Inherited from WorkspaceContainer)
originalSizesnull | number[]The child sizes captured at the start of a resize, or null when not resizing.
(Inherited from WorkspaceContainer)
parentWorkspaceParentThe parent of the split.
(Inherited from WorkspaceContainer)
resizeStartPosnull | PointThe pointer position captured at the start of a resize, or null when not resizing.
(Inherited from WorkspaceContainer)
winWindowThe window object.

Methods

MethodReturnsDescription
finishResize()voidFinishes the current resize, persisting the new child sizes.
(Inherited from WorkspaceContainer)
focus()voidFocuses the container's window (restoring it first if minimized, on desktop).
(Inherited from WorkspaceContainer)
getElSize(el)number | undefinedGets the size of an element along the split's direction.
(Inherited from WorkspaceContainer)
onChildResizeStart(child, event)voidHandles the start of a resize initiated by a child.
(Inherited from WorkspaceContainer)
onFocus()voidHandles the container's window gaining focus, updating the active leaf.
(Inherited from WorkspaceContainer)
onProximityResize(event)voidHandles a proximity-based resize pointer event.
(Inherited from WorkspaceContainer)
resizeItemsByDiff(items, diff, sign)numberResizes the given items by a pixel difference.
(Inherited from WorkspaceContainer)
setDirection(direction)voidSets the layout direction of the split.
(Inherited from WorkspaceContainer)
setElSize(el, size)voidSets the size of an element along the split's direction.
(Inherited from WorkspaceContainer)
unsetElSize(el)voidClears the explicit size of an element.
(Inherited from WorkspaceContainer)

Links to this page: