narraleaf-react
Version:
A React visual novel player framework
21 lines (20 loc) • 1.44 kB
TypeScript
import { ContentNode } from "../action/tree/actionTree";
import { LogicAction } from "../action/logicAction";
import { Action } from "../action/action";
import { Chained, Proxied } from "../action/chain";
import { Awaitable } from "../../../util/data";
import { CalledActionResult } from "../gameTypes";
import type { Story } from "../elements/story";
export declare class TypedAction<ContentType extends Record<string, any> = Record<string, any>, T extends keyof ContentType & string = keyof ContentType & string, Callee extends LogicAction.GameElement = LogicAction.GameElement> extends Action<ContentType[T], Callee, T> {
callee: Callee;
constructor(callee: Proxied<Callee, Chained<LogicAction.Actions, Callee>>, type: T, contentNode: ContentNode<ContentType[T]>);
unknownTypeError(): void;
resolveAwaitable<T extends CalledActionResult = any>(handler: (resolve: ((value: T) => void), awaitable: Awaitable<CalledActionResult, T>) => Promise<void> | void, awaitable?: Awaitable<CalledActionResult, T>): Awaitable<CalledActionResult, T>;
is<T extends LogicAction.Actions>(parent: new (...args: any[]) => T, type: string): this is T;
/**
* {Action Name}#{Action ID}(Action Type){{Action Content}}
*/
stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
stringifyWithName(name: string): string;
stringifyWithContent(name: string, content: string): string;
}