narraleaf-react
Version:
A React visual novel player framework
23 lines (22 loc) • 917 B
TypeScript
import { Game } from "../game";
import { LogicAction } from "../action/logicAction";
import { Actionable } from "../action/actionable";
import { GameState } from "../../player/gameState";
import { Chained, Proxied } from "../action/chain";
import type { Namespace, Storable } from "../elements/persistent/storable";
import { LiveGame } from "../game/liveGame";
import { NameSpaceContent } from "./persistent/type";
export type NamespaceGetter = <T extends NameSpaceContent<keyof T>>(namespace: string) => Namespace<T>;
export interface ScriptCtx {
gameState: GameState;
game: Game;
liveGame: LiveGame;
storable: Storable;
$: NamespaceGetter;
}
type ScriptRun = (ctx: ScriptCtx) => ScriptCleaner | void;
export declare class Script extends Actionable<object> {
static execute(handler: ScriptRun): Proxied<Script, Chained<LogicAction.Actions>>;
constructor(handler: ScriptRun);
}
export {};