Skip to content

WorkspaceParent

Official

Workspace parent.

Import:

import { WorkspaceParent } from 'obsidian';

Signature:

export class WorkspaceParent extends WorkspaceItem

Extends: WorkspaceItem

Constructor

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

Constructor.

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

Properties

PropertyTypeDescription
_Record<string, EventsEntry[]>Internal storage of registered event handlers by event name.
(Inherited from WorkspaceItem)
allowSingleChildbooleanWhether this parent is allowed to contain a single child (rather than collapsing it).
appAppReference to the app instance.
(Inherited from WorkspaceItem)
autoManageDOMbooleanWhether this parent automatically manages the DOM of its children.
childrenWorkspaceItem[]The child items contained in this parent.
componentComponentThe component managing the lifecycle of this workspace item.
(Inherited from WorkspaceItem)
containerElHTMLDivElementContainer element for this workspace item.
(Inherited from WorkspaceItem)
dimensionnull | numberThe flex-grow dimension of this item within its parent split.
(Inherited from WorkspaceItem)
idstringUnique identifier for this workspace item.
(Inherited from WorkspaceItem)
parentWorkspaceParentThe direct parent of the leaf.
(Inherited from WorkspaceItem)
resizeHandleElHTMLHRElementThe resize handle element used for adjusting item dimensions.
(Inherited from WorkspaceItem)
typestringThe type identifier for this workspace item (e.g. 'leaf', 'split', 'tabs').
(Inherited from WorkspaceItem)
workspaceWorkspaceReference to the workspace this item belongs to.
(Inherited from WorkspaceItem)

Methods

MethodReturnsDescription
detach()voidDetach this item from its parent.
(Inherited from WorkspaceItem)
getContainer()WorkspaceContainerGet the root container parent item, which can be one of:. - WorkspaceRoot - WorkspaceWindow
(Inherited from WorkspaceItem)
getIcon()IconNameGet the icon name for this workspace item.
(Inherited from WorkspaceItem)
getRoot()WorkspaceItemGet the root item.
(Inherited from WorkspaceItem)
insertChild(index, child)voidInserts a child at the given index.
off(name, callback)voidRemove an event listener.
(Inherited from WorkspaceItem)
offref(ref)voidRemove an event listener by reference.
(Inherited from WorkspaceItem)
on(name, callback, ctx?)EventRefAdd an event listener.
(Inherited from WorkspaceItem)
onResizeStart(evt)voidHandle the start of a resize operation on this item.
(Inherited from WorkspaceItem)
recomputeChildrenDimensions()voidRecomputes the dimensions of the children.
removeChild(child)voidRemoves a child.
replaceChild(index, child)voidReplaces the child at the given index.
serialize()SerializedWorkspaceItemSerialize this workspace item's state for persistence.
(Inherited from WorkspaceItem)
setDimension(dimension)voidSet the flex-grow dimension of this item within its parent split.
(Inherited from WorkspaceItem)
setParent(parent)voidSet the parent split for this workspace item.
(Inherited from WorkspaceItem)
trigger(name, data?)voidTrigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from WorkspaceItem)
tryTrigger(evt, args)voidTry to trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from WorkspaceItem)

Links to this page: