@ordojs/core
Version:
Core compiler and runtime for OrdoJS framework
59 lines • 1.43 kB
TypeScript
/**
* @fileoverview OrdoJS File System Router - Route definitions and file system routing
*/
import type { ComponentAST } from '../types/index.js';
/**
* Route configuration
*/
export interface Route {
/** Route path */
path: string;
/** Component name for this route */
componentName: string;
/** Route metadata */
meta?: Record<string, any>;
/** Child routes */
children?: Route[];
}
/**
* Router options
*/
export interface RouterOptions {
/** Base directory for route files */
baseDir?: string;
/** File extensions to scan */
extensions?: string[];
/** Whether to enable dynamic imports */
dynamicImports?: boolean;
/** Route file naming convention */
namingConvention?: 'kebab-case' | 'camelCase' | 'snake_case';
}
/**
* File system router for automatic route generation
*/
export declare class FileSystemRouter {
private options;
private routes;
constructor(options?: RouterOptions);
/**
* Scan file system for routes
*/
scanRoutes(): Route[];
/**
* Generate routes from component ASTs
*/
generateRoutes(components: ComponentAST[]): Route[];
/**
* Get all routes
*/
getRoutes(): Route[];
/**
* Add a route
*/
addRoute(route: Route): void;
/**
* Find route by path
*/
findRoute(path: string): Route | undefined;
}
//# sourceMappingURL=fs-router.d.ts.map