Skip to content

Interface: UseHistoryResult

@roomful/solid


@roomful/solid / UseHistoryResult

Defined in: solid/src/index.ts:475

Describes the return value of useHistory.

canRedo: Accessor<boolean>

Defined in: solid/src/index.ts:490

Reports whether the local peer has an undone transaction to redo. Reactive.


canUndo: Accessor<boolean>

Defined in: solid/src/index.ts:485

Reports whether the local peer has a tracked transaction to undo. Reactive.


capture: (action, payload?) => void

Defined in: solid/src/index.ts:495

Records a timeline entry without wrapping a mutation.

Records a timeline entry without wrapping any mutation. Use this to log an action that the app applies itself; pair it with transaction when the action should also be undoable.

string

The action label for the entry.

unknown

Optional metadata; a string is used as the entry description, otherwise the description defaults to action.

void

Nothing.


redo: () => Promise<void>

Defined in: solid/src/index.ts:510

Redoes the local peer’s most recently undone transaction.

Redoes the local peer’s most recently undone transaction.

Promise<void>

A promise that resolves once the redo is applied.


timeline: Accessor<TimelineEntry[]>

Defined in: solid/src/index.ts:480

Exposes the shared timeline of every peer’s entries, oldest first. Reactive: updates on any local or remote timeline change.


transaction: (name, fn) => void

Defined in: solid/src/index.ts:500

Runs a function, capturing its shared-CRDT mutations as one undoable entry.

Runs fn, capturing every shared-CRDT mutation it makes as a single undoable timeline entry. The mutations are committed under the local peer’s tracked transaction origin so a later undo() reverts exactly this unit.

string

The action label recorded on the timeline entry.

() => void

The function whose mutations form one undoable unit.

void

Nothing.


undo: () => Promise<void>

Defined in: solid/src/index.ts:505

Undoes the local peer’s most recent tracked transaction.

Undoes the local peer’s most recent tracked transaction, reverting only that peer’s changes to the shared CRDT document.

Promise<void>

A promise that resolves once the undo is applied.