Create a new state machine with an optional initial state.
OptionalinitialState: AcEdPromptState<TPromptOptions, TResult>The first state to run, if any.
Run the state machine until a state returns finish or an error occurs.
Function that executes a prompt and returns its result.
Replace the current state.
The new state to activate.
A lightweight state machine for chaining editor prompts.
It repeatedly:
getResultfunction,The state itself can also mutate the machine by calling
setState(...)from withinhandleResult.Example