import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn'; import { Difference } from 'microdiff'; import { a as StorageElementType } from './StorageElementType-DkJ394kq.js'; type CloseType = "close"; declare const Close: CloseType; /** * is a string containing the name of the label. * It is used to {@link narration.registeredLabels} to get the label class. */ type LabelIdType = string; type LabelRunModeType = "call" | "jump"; interface ChoiceOptionInterface extends Omit { /** * Label Id to be opened when the option is selected */ label: LabelIdType; /** * Type of the label to be opened */ type: LabelRunModeType; } interface CloseChoiceOptionInterface extends Omit { /** * Type of the label to be opened */ type: CloseType; /** * If true, the current label will be closed */ closeCurrentLabel?: boolean; } type StoredChoiceInterface = ChoiceOptionInterface | CloseChoiceOptionInterface; type StoredIndexedChoiceInterface = StoredChoiceInterface & { /** * Is the index of the choice in the menu. It is used to identify the choice when it is selected. */ choiceIndex: number; }; /** * Result of a {@link StepLabelType} execution. * * - `StepLabelResult`: a structured result consumed by the narration engine. * - `void`: the step completed without returning an explicit result. * - `string`: a simple token or message interpreted by higher-level logic. * * Prefer returning a well-typed {@link StepLabelResult} for anything that * needs to be consumed programmatically. Use plain strings only where a * lightweight, convention-based signal is sufficient and clearly documented * by the surrounding game logic. */ type StepLabelResultType = StepLabelResult | void | string; type StepLabelPropsType = StepLabelProps & T; /** * StepLabel is a function that will be executed as the game continues. */ type StepLabelType = (props: StepLabelPropsType, info: { /** * The id of the label. */ labelId: string; }) => StepLabelResultType | Promise; interface DialogueInterface { /** * The text of the dialogue. */ text: string | string[]; /** * The id of the character that is speaking. */ character?: CharacterInterface | string; } type StoredDialogue = Omit & { character: string | undefined; }; interface HistoryStep { /** * The difference between the previous step and the current step. */ diff?: Difference[]; /** * The label id of the current step. */ currentLabel?: LabelIdType; /** * The sha1 of the step function. */ stepSha1: string; /** * Equivalent to the narration.stepCounter */ index: number; /** * The data of the step of the label. */ labelStepIndex: number | null; /** * Dialogue to be shown in the game */ dialogue?: StoredDialogue; /** * List of choices asked of the player */ choices?: StoredChoiceInterface[]; /** * List of choices already made by the player */ alreadyMadeChoices?: number[]; /** * The input value of the player */ inputValue?: StorageElementType; /** * The choice made by the player */ choiceIndexMade?: number; /** * If true, the current dialogue will be glued to the previous one. */ isGlued?: boolean; /** * Opened Labels in the current step. */ openedLabels?: OpenedLabel[]; } interface OpenedLabel { label: LabelIdType; currentStepIndex: number; } interface NarrationHistory { /** * Dialogue to be shown in the game */ dialogue?: DialogueInterface; /** * List of choices asked of the player */ choices?: HistoryChoiceMenuOption[]; /** * The player made a choice */ playerMadeChoice?: boolean; /** * The index of the step in the history. */ stepIndex: number; /** * The input value of the player */ inputValue?: StorageElementType; } /** * HistoryChoiceMenuOption is a type that contains the history information of a choice menu option. */ type HistoryChoiceMenuOption = { /** * Text to be displayed in the menu */ text: string | string[]; /** * Method used to open the label, or close the menu. */ type: CloseType | LabelRunModeType; /** * This choice is a response */ isResponse: boolean; /** * The choice is hidden */ hidden: boolean; }; export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StepLabelType as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StepLabelPropsType as d, type StepLabelResultType as e, type StoredIndexedChoiceInterface as f, type StoredChoiceInterface as g, Close as h, type HistoryChoiceMenuOption as i };