export type SessionData = {
// Your custom session data here
} & NavigationHistorySessionFlavor;import { history } from "./utils/history";
const main = new Menu("main")
// Add "main" menu to the history stack
.submenu("Go to submenu1", "submenu1", history.add("main"));
const submenu1 = new Menu("submenu1")
// Pop "main" menu from the stack and navigate back to it
.text("Back", history.back);
.row()
// Add "submenu1" menu to the history stack
.submenu("Go to submenu 2", "submenu2", history.add("submenu1"));
const submenu2 = new Menu("submenu2")
// Pop "submenu1" menu from the stack and navigate back to it
.text("Back", history.back);
main.register([submenu1, submenu2]);Under the hood it extends session object with _navigationHistory?: string[] array which acts as navigation history stack.