narraleaf-react
Version:
A React visual novel player framework
25 lines (24 loc) • 922 B
TypeScript
import { GameState } from "./gameState";
export declare enum GuardWarningType {
invalidExposedStateUnmounting = "invalidExposedStateUnmounting",
unexpectedTimelineStatusChange = "unexpectedTimelineStatusChange"
}
export interface GuardConfig {
[GuardWarningType.invalidExposedStateUnmounting]: boolean;
[GuardWarningType.unexpectedTimelineStatusChange]: boolean;
}
/**
* Guard for the game state.
*
* After NarraLeaf-React 0.3.0, this class is designed to be used as a guard for the game state.
* With this feature, developers can easily find incorrect states or unexpected behaviors in the game.
*/
export declare class GameStateGuard {
readonly config: GuardConfig;
private watching;
private warnings;
constructor(config: GuardConfig);
observe(state: GameState): this;
warn(type: GuardWarningType, message: string): string;
getWarnings(): [GuardWarningType, string][];
}