sicua
Version:
A tool for analyzing project structure and dependencies
79 lines (78 loc) • 2.15 kB
TypeScript
import { RouteStructure, RouteMetadata, SpecialFileCoverage } from "../types";
/**
* Scans Next.js app directory for routes and integrates special file coverage
*/
export declare class RouteScanner {
private appDirectory;
private specialFileScanner;
private validExtensions;
constructor(appDirectory: string);
/**
* Scans the entire app directory and returns all route structures
*/
scanAllRoutes(): RouteStructure[];
/**
* Scans a specific route path
*/
scanRoute(routePath: string): RouteStructure | null;
/**
* Gets all route paths in the app directory
*/
getAllRoutePaths(): string[];
/**
* Checks if a route exists
*/
routeExists(routePath: string): boolean;
/**
* Gets route metadata for a specific path
*/
getRouteMetadata(routePath: string): RouteMetadata | null;
/**
* Finds all page.js/page.tsx files in the app directory
*/
private findAllPageFiles;
/**
* Finds page file for a specific route path
*/
private findPageFile;
/**
* Builds complete route structure from a page file
*/
private buildRouteStructure;
/**
* Builds route segments with special file coverage
*/
private buildRouteSegments;
/**
* Builds route metadata from segments
*/
private buildRouteMetadata;
/**
* Extracts route path from page file path
*/
private extractRoutePathFromFile;
/**
* Finds page file in a specific directory
*/
private findPageFileInDirectory;
/**
* Finds dynamic route match in a directory
*/
private findDynamicRouteMatch;
/**
* Checks if a directory should be skipped during scanning
*/
private shouldSkipDirectory;
/**
* Gets special file coverage for a specific route
*/
getRouteSpecialFileCoverage(routePath: string): SpecialFileCoverage | null;
/**
* Gets coverage summary for all routes
*/
getAllRoutesCoverageSummary(): {
totalRoutes: number;
routesWithMissingFiles: string[];
averageCoverage: number;
};
}