narraleaf-react
Version:
A React visual novel player framework
30 lines (29 loc) • 1.38 kB
TypeScript
import { LogicAction } from "./logicAction";
import { ContentNode } from "../action/tree/actionTree";
import type { CalledActionResult } from "../gameTypes";
import { Awaitable } from "../../../util/data";
import { GameState } from "../../player/gameState";
import { Story } from "../elements/story";
import { ActionSearchOptions } from "../types";
import type { StackModel } from "./stackModel";
export type ActionExecutionInjection = {
stackModel: StackModel;
};
export type ExecutedActionResult = CalledActionResult | Awaitable<CalledActionResult, any> | (CalledActionResult | Awaitable<CalledActionResult, any>)[] | null;
export declare class Action<ContentNodeType = any, Callee = LogicAction.GameElement, Type extends string = any> {
static ActionTypes: {
action: string;
};
callee: Callee;
type: Type;
contentNode: ContentNode<ContentNodeType>;
_id: string;
readonly __stack: string;
constructor(callee: Callee, type: Type, contentNode: ContentNode<ContentNodeType>);
executeAction(_state: GameState, _injection: ActionExecutionInjection): ExecutedActionResult;
getId(): string;
setId(id: string): void;
setContent(content: ContentNodeType): this;
setContentNode(contentNode: ContentNode<ContentNodeType>): this;
getFutureActions(_story: Story, _options: ActionSearchOptions): LogicAction.Actions[];
}