Skip to content

WorkspaceLeafHistory

Unofficial

Navigation history for a workspace leaf, supporting back/forward navigation.

Import:

import type { WorkspaceLeafHistory } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface WorkspaceLeafHistory

Constructor

new WorkspaceLeafHistory(owner: WorkspaceLeaf)

Constructor.

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

Properties

Property Type Description
backHistory WorkspaceLeafHistoryState[] List of previous navigation states.
forwardHistory WorkspaceLeafHistoryState[] List of forward navigation states (after going back).
owner WorkspaceLeaf The workspace leaf that owns this history.

Methods

Method Returns Description
back() Promise<void> Navigate back to the previous state.
deserialize(e) void Restore history from a serialized representation.
forward() Promise<void> Navigate forward to the next state.
go(step) Promise<void> Navigate by the given number of steps (negative for back, positive for forward).
pushState(state) void Push a new state onto the back history stack.
serialize() SerializedWorkspaceLeafHistory Serialize the history for persistence.
updateState(state) Promise<void> Update the current state in the history.

Links to this page: