/** * AST validation and analysis utilities * * Provides validation, optimization, and analysis of parsed path ASTs */ import { PathNode } from './types.js'; /** * Validation result */ export interface ValidationResult { valid: boolean; errors: string[]; warnings: string[]; } /** * AST analysis result */ export interface ASTAnalysis { /** * Total depth of the path (number of segments) */ depth: number; /** * Whether the path contains wildcards */ hasWildcard: boolean; /** * Whether the path contains recursive descent */ hasRecursive: boolean; /** * Whether the path contains filters */ hasFilter: boolean; /** * Whether the path is deterministic (returns single value) */ isDeterministic: boolean; /** * Estimated complexity score (1-10) */ complexity: number; /** * Node type distribution */ nodeTypes: Record; } /** * Validate an AST and return detailed results * * @param ast - The AST to validate * @returns Validation result with errors and warnings */ export declare function validate(ast: PathNode[]): ValidationResult; /** * Analyze an AST and return metrics * * @param ast - The AST to analyze * @returns Analysis result with metrics */ export declare function analyzeAST(ast: PathNode[]): ASTAnalysis; /** * Simplify/optimize an AST by removing redundant nodes * * @param ast - The AST to optimize * @returns Optimized AST */ export declare function optimizeAST(ast: PathNode[]): PathNode[]; /** * Convert AST back to string representation * * @param ast - The AST to stringify * @returns String representation of the path */ export declare function astToString(ast: PathNode[]): string; //# sourceMappingURL=validator.d.ts.map