Skip to content

toolmark-monorepo / @toolmark/tour / Tour

Interface: Tour ​

Defined in: packages/tour/src/types.ts:114

A running tour (headless engine; render it with the overlay or useTour).

Properties ​

state ​

readonly state: TourState

Defined in: packages/tour/src/types.ts:116

Current state snapshot.

Methods ​

back() ​

back(): void

Defined in: packages/tour/src/types.ts:127

Moves to the previous step. Only the index moves: in do mode nothing is undone and no call is repeated (apps use tm.undo); a step that has not run yet (it was skipped) runs on the next next(), not on entry. Ignored while a do call is in flight.

Returns ​

void


next() ​

next(): Promise<void>

Defined in: packages/tour/src/types.ts:121

Moves to the next step (after the last: done). Ignored while a do call is in flight; skips a running do highlight sequence. Resolves once the next step has been entered.

Returns ​

Promise<void>


on() ​

on(fn): () => void

Defined in: packages/tour/src/types.ts:141

Subscribes to lifecycle events. Events emitted before the first listener subscribed (e.g. step_invalid from validation and the first step_entered) are delivered to that first listener when it subscribes.

Parameters ​

fn ​

(e) => void

Returns ​

The unsubscribe function.

() => void


stop() ​

stop(): void

Defined in: packages/tour/src/types.ts:129

Stops the tour (stopped) and releases every listener and timer. Idempotent.

Returns ​

void


subscribe() ​

subscribe(fn): () => void

Defined in: packages/tour/src/types.ts:134

Subscribes to state changes (not called with the current state).

Parameters ​

fn ​

(s) => void

Returns ​

The unsubscribe function.

() => void