- Name
current- Kind
- property
- Type
number- Requirement
- required
DocsAPI referenceUI machineswizard
wizard machine
The public state machine contract for @grassroot/ui-machines/wizard. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/wizard
Package
Service example
wizard.tsts
import { createService } from "@grassroot/statechart";import { wizardMachine } from "@grassroot/ui-machines/wizard"; const service = createService(wizardMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();10 of 10
Exports
WizardCommand
typeWizardCommandts
type WizardCommand = CommandObject & ({ readonly type: "STEP_CHANGE_REQUEST"; readonly index: number; readonly reason: WizardReason;} | { readonly type: "FINISH_REQUEST"; readonly reason: WizardReason;});WizardContext
typeWizardContextts
type WizardContext = { readonly current: number; readonly mode: BindingMode;};Name
Kind
Type
Requirement
currentproperty
numberrequired
modeproperty
BindingModerequired
- Name
mode- Kind
- property
- Type
BindingMode- Requirement
- required
WizardDiagnosticCodes
valueWizardDiagnosticCodests
export declare const WizardDiagnosticCodes: readonly DiagnosticCatalogueEntry[];WizardEvent
typeWizardEventts
type WizardEvent = { readonly type: "GO_TO"; readonly index: number; readonly reason: WizardReason;} | { readonly type: "NEXT"; readonly reason: WizardReason;} | { readonly type: "BACK"; readonly reason: WizardReason;} | { readonly type: "MOVE"; readonly direction: -1 | 1; readonly reason: WizardReason;} | { readonly type: "HOME"; readonly reason: WizardReason;} | { readonly type: "END"; readonly reason: WizardReason;} | { readonly type: "RESET";};WizardInput
typeWizardInputts
type WizardInput = { readonly stepCount: number; readonly step?: number; readonly defaultStep?: number;};Name
Kind
Type
Requirement
defaultStepproperty
numberoptional
stepproperty
numberoptional
stepCountproperty
numberrequired
- Name
defaultStep- Kind
- property
- Type
number- Requirement
- optional
- Name
step- Kind
- property
- Type
number- Requirement
- optional
- Name
stepCount- Kind
- property
- Type
number- Requirement
- required
wizardMachine
valuewizardMachinets
export declare const wizardMachine: Machine<WizardInput, "ready", WizardContext, WizardEvent, WizardCommand>;WizardReason
typeWizardReasonts
type WizardReason = "pointer" | "keyboard" | "programmatic";wizardReplaySequence
valuewizardReplaySequencets
export declare const wizardReplaySequence: readonly WizardEvent[];wizardSelectors
valuewizardSelectorsts
export declare const wizardSelectors: { current: (snapshot: WizardSnapshot) => number;};Name
Kind
Type
Requirement
currentproperty
(snapshot: WizardSnapshot) => numberrequired
- Name
current- Kind
- property
- Type
(snapshot: WizardSnapshot) => number- Requirement
- required
WizardSnapshot
typeWizardSnapshotts
type WizardSnapshot = Snapshot<"ready", WizardContext>;