Skip to content

WorkspaceSplit

Official

Workspace split.

Import:

import { WorkspaceSplit } from 'obsidian';

Signature:

export class WorkspaceSplit extends WorkspaceParent

Extends: WorkspaceParent

Constructor

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

Constructor.

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

Properties

PropertyTypeDescription
_Record<string, EventsEntry[]>Internal storage of registered event handlers by event name.
(Inherited from WorkspaceParent)
allowSingleChildbooleanWhether this parent is allowed to contain a single child (rather than collapsing it).
(Inherited from WorkspaceParent)
appAppReference to the app instance.
(Inherited from WorkspaceParent)
autoManageDOMbooleanWhether this parent automatically manages the DOM of its children.
(Inherited from WorkspaceParent)
childrenWorkspaceItem[]The child items contained in this parent.
(Inherited from WorkspaceParent)
componentComponentThe component managing the lifecycle of this workspace item.
(Inherited from WorkspaceParent)
containerElHTMLDivElementContainer element for this workspace item.
(Inherited from WorkspaceParent)
dimensionnull | numberThe flex-grow dimension of this item within its parent split.
(Inherited from WorkspaceParent)
direction'horizontal' | 'vertical'The layout direction of the split.
idstringUnique identifier for this workspace item.
(Inherited from WorkspaceParent)
isResizingbooleanWhether a resize drag is currently in progress.
originalSizesnull | number[]The child sizes captured at the start of a resize, or null when not resizing.
parentWorkspaceParentThe parent of the split.
resizeHandleElHTMLHRElementThe resize handle element used for adjusting item dimensions.
(Inherited from WorkspaceParent)
resizeStartPosnull | PointThe pointer position captured at the start of a resize, or null when not resizing.
typestringThe type identifier for this workspace item (e.g. 'leaf', 'split', 'tabs').
(Inherited from WorkspaceParent)
workspaceWorkspaceReference to the workspace this item belongs to.
(Inherited from WorkspaceParent)

Methods

MethodReturnsDescription
detach()voidDetach this item from its parent.
(Inherited from WorkspaceParent)
finishResize()voidFinishes the current resize, persisting the new child sizes.
getContainer()WorkspaceContainerGet the root container parent item, which can be one of:. - WorkspaceRoot - WorkspaceWindow
(Inherited from WorkspaceParent)
getElSize(el)number | undefinedGets the size of an element along the split's direction.
getIcon()IconNameGet the icon name for this workspace item.
(Inherited from WorkspaceParent)
getRoot()WorkspaceItemGet the root item.
(Inherited from WorkspaceParent)
insertChild(index, child)voidInserts a child at the given index.
(Inherited from WorkspaceParent)
off(name, callback)voidRemove an event listener.
(Inherited from WorkspaceParent)
offref(ref)voidRemove an event listener by reference.
(Inherited from WorkspaceParent)
on(name, callback, ctx?)EventRefAdd an event listener.
(Inherited from WorkspaceParent)
onChildResizeStart(child, event)voidHandles the start of a resize initiated by a child.
onProximityResize(event)voidHandles a proximity-based resize pointer event.
onResizeStart(evt)voidHandle the start of a resize operation on this item.
(Inherited from WorkspaceParent)
recomputeChildrenDimensions()voidRecomputes the dimensions of the children.
(Inherited from WorkspaceParent)
removeChild(child)voidRemoves a child.
(Inherited from WorkspaceParent)
replaceChild(index, child)voidReplaces the child at the given index.
(Inherited from WorkspaceParent)
resizeItemsByDiff(items, diff, sign)numberResizes the given items by a pixel difference.
serialize()SerializedWorkspaceItemSerialize this workspace item's state for persistence.
(Inherited from WorkspaceParent)
setDimension(dimension)voidSet the flex-grow dimension of this item within its parent split.
(Inherited from WorkspaceParent)
setDirection(direction)voidSets the layout direction of the split.
setElSize(el, size)voidSets the size of an element along the split's direction.
setParent(parent)voidSet the parent split for this workspace item.
(Inherited from WorkspaceParent)
trigger(name, data?)voidTrigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from WorkspaceParent)
tryTrigger(evt, args)voidTry to trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from WorkspaceParent)
unsetElSize(el)voidClears the explicit size of an element.

Links to this page: