mwg API
    Preparing search index...

    Interface TweeChoice

    The Twee-notation parsing engine behind both two-d/stage.importTwee and rpg.importTwee - the passage/link parsing lives here once, in core (already the home of parseCSV, another generic text-format parser other modules build their own typed result around), so a bug fix or a format extension lands in one place instead of two silently-drifting copies. TweeCommand/TweeChoice are structurally compatible with both two-d/stage's StoryScript/StageChoice and rpg's EventStoryScript/EventChoice - each module's own importTwee wrapper only names its own return type, with no per-field conversion needed.

    Only structure is imported: each passage's text lines become say commands and its [[links]] become one closing ask whose choices jump ([[text]], [[text->target]] and [[target<-text]]) - the last text line doubles as the question, since a choice box needs a prompt and repeating it works. No story-format macro language (Harlowe, SugarCube, Chapbook) is interpreted - body text reaches the game untouched, and a link carrying a setter throws instead of silently dropping the behaviour the setter described.

    :: Start
    You stand at a crossroads.
    
    [[Take the left path->Left]]
    [[Take the right path->Right]]
    
    :: Left
    The path ends at a wall.
    [[Go back->Start]]
    
    import { parseTwee, type TweeStory } from '@datamoc/mwg/core';

    const story: TweeStory = parseTwee(`:: Start
    Pick a door.

    [[Left->A]]
    [[Right->B]]

    :: A
    Treasure.

    :: B
    Nothing.
    `);
    console.log(story.start); // 'Start'
    interface TweeChoice {
        goto?: string;
        text: string;
    }
    Index
    goto?: string
    text: string