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

PropertyTypeDescription
backHistoryWorkspaceLeafHistoryState[]List of previous navigation states.
forwardHistoryWorkspaceLeafHistoryState[]List of forward navigation states (after going back).
ownerWorkspaceLeafThe workspace leaf that owns this history.

Methods

MethodReturnsDescription
back()Promise<void>Navigate back to the previous state.
deserialize(e)voidRestore 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)voidPush a new state onto the back history stack.
serialize()SerializedWorkspaceLeafHistorySerialize the history for persistence.
updateState(state)Promise<void>Update the current state in the history.

Links to this page: