toolmark-monorepo / @toolmark/core / createStepwiseWizardTools
Function: createStepwiseWizardTools()
createStepwiseWizardTools(
tm,opts):object
Defined in: packages/core/src/wizard/wizard-tools.ts:953
Registers the stepwise fallback of a wizard that cannot expose parent state (spec §8.2): every tool carries mode: 'stepwise' in the manifest.
<name>.step.fill— the form fill of the current step's mounted form (as createFormTools'fill), with the current step's schema; its description ends with" (current step: <step>)". No mounted form →refusednot_allowed.<name>.next— callsnext()and returns the app's result.<name>.previous— callsprevious()→ok({ step })(the new current step).<name>.submit—consequential; refusedstalewhen the step form changed after the confirmation was requested.
refresh() re-registers <name>.step.fill for the current step (one revision bump) and is a no-op while the current step's name is unchanged; call it whenever the step changes.
Tour hooks (spec §13): <name>.step.fill anchors, state() and sensitivePaths() are those of the current step's mounted form (as createFormTools, plain paths), and its user interactions are emitted as <name>.step.fill events (followed on every anchor/state read and refresh()).
Parameters
tm
The registry.
opts
StepwiseWizardOptions & object
Stepwise wizard options plus an optional target scope.
Returns
object
A handle: dispose() removes the tools, refresh() follows the current step.
dispose()
dispose():
void
Returns
void
refresh()
refresh():
void
Returns
void