import { type PageMetadata } from "@evjs/shared/manifest"; import type { ErrorRouteComponent, NotFoundRouteComponent, RouteComponent, RouterHistory } from "@tanstack/react-router"; import { type ComponentType, type ReactNode } from "react"; import { type App } from "../../standalone/app.js"; /** Framework-generated SPA bootstrap contract. */ export interface PageModule { default?: RouteComponent; beforeLoad?: (...args: unknown[]) => unknown; loader?: (...args: unknown[]) => unknown; validateSearch?: (...args: unknown[]) => unknown; pendingComponent?: RouteComponent; errorComponent?: ErrorRouteComponent; notFoundComponent?: NotFoundRouteComponent; } /** Framework-generated SPA bootstrap contract. */ export interface RootLayoutModule { default?: ComponentType<{ children?: ReactNode; }>; } export interface PageWrapperModule { default?: ComponentType<{ children?: ReactNode; }>; } export type PageRouteRedirect = { kind: "path"; path: string; } | { kind: "url"; href: string; }; export type PageRouteKind = "page" | "layout" | "group" | "redirect"; /** Framework-generated SPA bootstrap contract. */ export interface PageDefinition { id?: string; path: string; parentId?: string; kind?: PageRouteKind; module?: PageModule; redirect?: PageRouteRedirect; wrappers?: PageWrapperModule[]; /** Bypass the generated Application/root layout for this route branch. */ layout?: false; /** Static Page-owned title and named meta values. */ metadata?: PageMetadata; } /** Framework-generated SPA bootstrap contract. */ export interface CreatePagesAppOptions { routes: PageDefinition[]; rootModule?: RootLayoutModule; /** Application-root wrappers applied outside all CSR providers and routes. */ wrappers?: PageWrapperModule[]; basepath?: string; history?: PagesAppHistoryInput; } export type PagesAppHistoryDescriptor = { type: "browser"; } | { type: "hash"; } | { type: "memory"; initialEntries?: string[]; initialIndex?: number; }; export type PagesAppHistoryInput = RouterHistory | PagesAppHistoryDescriptor; /** Framework-only runtime projection layered over generated SPA routes. */ export interface PagesAppRuntimeOptions { /** * Replace the complete runtime Route overlay. Runtime Routes take precedence * over matching generated branches; all other generated Routes stay intact. */ routes?: PageDefinition[]; basepath?: string; history?: PagesAppHistoryInput; } /** Framework-generated SPA bootstrap contract. */ export interface PagesApp { app: App; updateRuntime(options: PagesAppRuntimeOptions): Promise; } /** Framework-generated SPA bootstrap. */ export declare function createPagesApp(options: CreatePagesAppOptions): PagesApp; //# sourceMappingURL=page-route.d.ts.map