vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
30 lines (29 loc) • 998 B
TypeScript
export { loadPageRoutes };
export type { PageRoutes };
export type { RouteType };
import type { PageFile } from '../getPageFiles.js';
import type { PageConfigRuntime, PageConfigGlobalRuntime } from '../page-configs/PageConfig.js';
import { type Hook } from '../hooks/getHook.js';
type PageRoute = {
pageId: string;
comesFromV1PageConfig: boolean;
} & ({
routeString: string;
routeDefinedAtString: null;
routeType: 'FILESYSTEM';
routeFilesystemDefinedBy: string;
} | {
routeString: string;
routeDefinedAtString: string;
routeType: 'STRING';
} | {
routeFunction: Function;
routeDefinedAtString: string;
routeType: 'FUNCTION';
});
type PageRoutes = PageRoute[];
type RouteType = 'STRING' | 'FUNCTION' | 'FILESYSTEM';
declare function loadPageRoutes(pageFilesAll: PageFile[], pageConfigs: PageConfigRuntime[], pageConfigGlobal: PageConfigGlobalRuntime, allPageIds: string[]): Promise<{
pageRoutes: PageRoutes;
onBeforeRouteHook: null | Hook;
}>;