Open History to see the last commit
1import type { FileRoutesByTo } from "@/routeTree.gen";
2
3import type { AppActionMatcher } from "./app-actions";
4
5/**
6 * The Notes app's screens, as route paths. Checked against the route tree,
7 * so a renamed route breaks the build.
8 */
9export const APP_SCREENS = [
10 "/",
11 "/folders/$folderId",
12 "/folders/$folderId/notes/$noteId",
13 "/settings",
14 "/analytics",
15] as const satisfies readonly (keyof FileRoutesByTo)[];
16
17export type AppScreen = (typeof APP_SCREENS)[number];
18
19/**
20 * A state of the Notes app that a guide section is about: a screen, what
21 * the reader just did there, or both. Phase 4 highlights the section whose
22 * states match the app; nothing reads these yet.
23 */
24export interface AppState {
25 /** The screen. Omitted: any screen. */
26 screen?: AppScreen;
27 /** Narrows the screen to some route params, e.g. `{ folderId: "all" }`. */
28 params?: { folderId?: string; noteId?: string };
29 /** The reader's last action (see `app-actions.ts`). Omitted: any, or none. */
30 lastAction?: AppActionMatcher;
31}