import { Alias } from 'vite'; import PathNormalize from "./path-normalize.js"; import ServerConfig from "./server-config.js"; type TRoutesTree = { index: number; import: string; children: TRoutesTree[]; }; /** * Parse react router routes array */ declare class ParseRoutes { /** * Path normalize service */ protected readonly pathNormalize: PathNormalize; /** * Server config */ protected readonly config: ServerConfig; /** * @constructor */ /** * @constructor */ constructor(config: ServerConfig, viteAliases?: Alias[]); /** * Parse routes */ /** * Parse routes */ parse(): TRoutesTree[]; /** * Parse file and return ast */ /** * Parse file and return ast */ private parseFile; /** * Find route import filepath */ /** * Find route import filepath */ private getImportPath; /** * Find routes array inside code */ /** * Find routes array inside code */ private findRoutesDefinition; /** * Entrypoint routes file */ /** * Entrypoint routes file */ private findRoutesEntrypoint; /** * Resolve route filename import */ /** * Resolve route filename import */ private resolveFilename; /** * Parse ast array routes objects */ /** * Parse ast array routes objects */ private parseRoutesArray; /** * Parse imports map from ast */ /** * Parse imports map from ast */ private static parseImportsMap; /** * Recursive build routes tree with dynamic imports */ /** * Recursive build routes tree with dynamic imports */ private recursiveBuildRoutesTree; /** * Add pathId to static routes */ /** * Add pathId to static routes */ private static processRouteFileCode; /** * Inject pathId to sync/async routes * Add async wrapper (see import-routes) */ /** * Inject pathId to sync/async routes * Add async wrapper (see import-routes) */ static handleRoutes(code: string, shouldAddPathId: boolean): string; } export { ParseRoutes as default, TRoutesTree };