narraleaf-react
Version:
A React visual novel player framework
29 lines (28 loc) • 867 B
TypeScript
import { LiveGameEventToken } from "../../../../game/nlcore/types";
export declare class Router {
getCurrentId(): string | null;
/**
* Push a new page id to the router history
*/
push(id: string): this;
/**
* Go back to the previous page id in the router history
*/
back(): this;
/**
* Go forward to the next page id in the router history
*/
forward(): this;
/**
* Clear the current page id and history
*
* All pages will be removed from the stage
*/
clear(): this;
cleanHistory(): this;
onExitComplete(handler: () => void): LiveGameEventToken;
onceExitComplete(handler: () => void): LiveGameEventToken;
onPageMount(handler: () => void): LiveGameEventToken;
oncePageMount(handler: () => void): LiveGameEventToken;
}
export declare function useRouter(): Router;