/************************** * Router Detection * * Determines whether to use App Router or Pages Router based on: * - Explicit configuration (config.router) * - Directory structure analysis * - Route file presence detection **************************/ import type { RuntimeAdapter } from "../platform/adapters/base.js"; import type { VeryfrontConfig } from "../config/index.js"; export { getAppRouteEntity } from "./app-route-resolver.js"; /** * Clear the router detection cache. Call when filesystem changes. * @deprecated Use clearRouterDetectionCacheForProject for multi-tenant deployments */ export declare function clearRouterDetectionCache(): void; /** * Clear the router detection cache for a specific project. * Use this in multi-tenant deployments to avoid clearing other projects' caches. * * @param projectId - The project ID used as cache key. Falls back to projectDir for local dev. */ export declare function clearRouterDetectionCacheForProject(projectId: string): void; export declare function primeRouterDetectionCache(projectKey: string, mode: "app" | "pages"): void; export interface DetectAppRouterOptions { /** Project ID for cache isolation in multi-tenant deployments */ projectId?: string; } /** * Resolve the router that owns an already-resolved page. * * Auto-detection decides which router to try first, but mixed projects can * legitimately fall back to the other router. Per-page rendering must follow * the route that actually resolved instead of the project-wide preference. * * Pages routes can also resolve from the project root. App routes cannot * resolve outside their configured root, so an unmatched resolved path belongs * to the Pages router. */ export declare function resolveRouterModeForPage(projectDir: string, pagePath: string, config: VeryfrontConfig): "app" | "pages"; /** * Detect if app router should be used based on config and directory structure. * * In multi-tenant proxy mode, `projectDir` is the same for all projects ("/app"), * so the cache key must use `projectId` to avoid cross-project cache poisoning. */ export declare function detectAppRouter(projectDir: string, config: VeryfrontConfig, adapter: RuntimeAdapter, options?: DetectAppRouterOptions): Promise; //# sourceMappingURL=router-detection.d.ts.map