Interface StepResult<TEffect>

Result returned when querying the current step or making a choice.

Contains all information about the current story position, including available choices (after condition filtering), text to display, and any effects that were triggered.

interface StepResult<TEffect> {
    choices: {
        id: string;
        label: string;
    }[];
    effects: TEffect[];
    ending?: {
        id: string;
        label?: string;
    };
    knotId: string;
    nodeId: string;
    tags: string[];
    text: string[];
}

Type Parameters

  • TEffect

    The type of effects in this result

Properties

choices: {
    id: string;
    label: string;
}[]

Type declaration

  • id: string
  • label: string
effects: TEffect[]
ending?: {
    id: string;
    label?: string;
}

Type declaration

  • id: string
  • Optional label?: string
knotId: string
nodeId: string
tags: string[]
text: string[]