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

Property Type Description
_ Record<string, EventsEntry[]> Internal storage of registered event handlers by event name.
(Inherited from WorkspaceParent)
allowSingleChild boolean Whether this parent is allowed to contain a single child (rather than collapsing it).
(Inherited from WorkspaceParent)
app App Reference to the app instance.
(Inherited from WorkspaceParent)
autoManageDOM boolean Whether this parent automatically manages the DOM of its children.
(Inherited from WorkspaceParent)
children WorkspaceItem[] The child items contained in this parent.
(Inherited from WorkspaceParent)
component Component The component managing the lifecycle of this workspace item.
(Inherited from WorkspaceParent)
containerEl HTMLDivElement Container element for this workspace item.
(Inherited from WorkspaceParent)
dimension null | number The flex-grow dimension of this item within its parent split.
(Inherited from WorkspaceParent)
direction 'horizontal' | 'vertical' The layout direction of the split.
id string Unique identifier for this workspace item.
(Inherited from WorkspaceParent)
isResizing boolean Whether a resize drag is currently in progress.
originalSizes null | number[] The child sizes captured at the start of a resize, or null when not resizing.
parent WorkspaceParent The parent of the split.
resizeHandleEl HTMLHRElement The resize handle element used for adjusting item dimensions.
(Inherited from WorkspaceParent)
resizeStartPos null | Point The pointer position captured at the start of a resize, or null when not resizing.
type string The type identifier for this workspace item (e.g. 'leaf', 'split', 'tabs').
(Inherited from WorkspaceParent)
workspace Workspace Reference to the workspace this item belongs to.
(Inherited from WorkspaceParent)

Methods

Method Returns Description
detach() void Detach this item from its parent.
(Inherited from WorkspaceParent)
finishResize() void Finishes the current resize, persisting the new child sizes.
getContainer() WorkspaceContainer Get the root container parent item, which can be one of:. - WorkspaceRoot - WorkspaceWindow
(Inherited from WorkspaceParent)
getElSize(el) number | undefined Gets the size of an element along the split's direction.
getIcon() IconName Get the icon name for this workspace item.
(Inherited from WorkspaceParent)
getRoot() WorkspaceItem Get the root item.
(Inherited from WorkspaceParent)
insertChild(index, child) void Inserts a child at the given index.
(Inherited from WorkspaceParent)
off(name, callback) void Remove an event listener.
(Inherited from WorkspaceParent)
offref(ref) void Remove an event listener by reference.
(Inherited from WorkspaceParent)
on(name, callback, ctx?) EventRef Add an event listener.
(Inherited from WorkspaceParent)
onChildResizeStart(child, event) void Handles the start of a resize initiated by a child.
onProximityResize(event) void Handles a proximity-based resize pointer event.
onResizeStart(evt) void Handle the start of a resize operation on this item.
(Inherited from WorkspaceParent)
recomputeChildrenDimensions() void Recomputes the dimensions of the children.
(Inherited from WorkspaceParent)
removeChild(child) void Removes a child.
(Inherited from WorkspaceParent)
replaceChild(index, child) void Replaces the child at the given index.
(Inherited from WorkspaceParent)
resizeItemsByDiff(items, diff, sign) number Resizes the given items by a pixel difference.
serialize() SerializedWorkspaceItem Serialize this workspace item's state for persistence.
(Inherited from WorkspaceParent)
setDimension(dimension) void Set the flex-grow dimension of this item within its parent split.
(Inherited from WorkspaceParent)
setDirection(direction) void Sets the layout direction of the split.
setElSize(el, size) void Sets the size of an element along the split's direction.
setParent(parent) void Set the parent split for this workspace item.
(Inherited from WorkspaceParent)
trigger(name, data?) void Trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from WorkspaceParent)
tryTrigger(evt, args) void Try to trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from WorkspaceParent)
unsetElSize(el) void Clears the explicit size of an element.

Links to this page: