The story definition to run
Optional options: RuntimeOptions<TState>Optional runtime configuration for condition evaluation
A runtime instance for navigating the story
const story: Story<{ health: number }> = {
version: 1,
entryKnot: 'start',
knots: { /* ... */ }
};
const runtime = createRuntime(story, {
conditionHooks: {
hasKey: (state) => state.hasKey === true
}
});
const step = runtime.current({ hasKey: false });
Creates a new story runtime instance.
The runtime manages the current position in the story and provides methods to navigate through nodes, make choices, and track effects.