import type { StateFlowGraph, ComponentNode, StateNode, StateFlowEdge, ContextBoundary, PropDrillingPath, ComponentPropMetrics, ComponentRole, PropBundle, BundleWarning, ContextLeak, ContextLeakSeverity, PropChain, PropRename } from '../types.js'; export interface ComponentStats { totalComponents: number; componentsWithState: number; componentsWithContext: number; averageStatePerComponent: number; } export interface StateStats { totalStateNodes: number; byType: Record; } export interface FlowStats { totalEdges: number; propFlows: number; contextFlows: number; hookFlows: number; averageHops: number; } export interface GraphSummary { components: ComponentStats; state: StateStats; flow: FlowStats; contextBoundaries: number; propDrillingPaths: number; worstDrillingPath: PropDrillingPath | null; } export declare class GraphAnalyzer { private graph; constructor(graph: StateFlowGraph); getSummary(): GraphSummary; getComponentStats(): ComponentStats; getStateStats(): StateStats; getFlowStats(): FlowStats; getWorstDrillingPath(): PropDrillingPath | null; getComponentById(id: string): ComponentNode | undefined; getStateById(id: string): StateNode | undefined; getComponentsByFile(filePath: string): ComponentNode[]; getStateOrigins(): ComponentNode[]; getStateConsumers(stateId: string): ComponentNode[]; getContextProviders(): ContextBoundary[]; getContextConsumers(contextName: string): ComponentNode[]; getIncomingEdges(componentId: string): StateFlowEdge[]; getOutgoingEdges(componentId: string): StateFlowEdge[]; getDrillingPathsForState(stateId: string): PropDrillingPath[]; findComponentByName(name: string): ComponentNode | undefined; /** * Get all component prop metrics */ getComponentMetrics(): ComponentPropMetrics[]; /** * Get metrics for a specific component */ getMetricsForComponent(componentId: string): ComponentPropMetrics | undefined; /** * Get components with high passthrough ratio (primarily forwarding props) * @param threshold - Minimum passthrough ratio (0-1), default 0.7 */ getPassthroughComponents(threshold?: number): ComponentPropMetrics[]; /** * Get components by their role classification */ getComponentsByRole(role: ComponentRole): ComponentPropMetrics[]; /** * Get role distribution summary */ getRoleDistribution(): Record; /** * Get components with unused/ignored props * @param minIgnored - Minimum number of ignored props */ getComponentsWithIgnoredProps(minIgnored?: number): ComponentPropMetrics[]; /** * Get passthrough summary for analysis output */ getPassthroughSummary(): { totalComponentsWithProps: number; passthroughCount: number; consumerCount: number; transformerCount: number; mixedCount: number; worstPassthrough: ComponentPropMetrics | null; }; /** * Get all detected prop bundles */ getBundles(): PropBundle[]; /** * Get bundles above a certain size threshold * @param minSize - Minimum number of properties (default: 5) */ getLargeBundles(minSize?: number): PropBundle[]; /** * Get bundles that are passed through multiple components * @param minPassthroughs - Minimum number of pass-through components (default: 2) */ getBundlesWithPassthrough(minPassthroughs?: number): PropBundle[]; /** * Get warnings for problematic bundles */ getBundleWarnings(): BundleWarning[]; private generateBundleRecommendation; /** * Get bundle summary for analysis output */ getBundleSummary(): { totalBundles: number; largeBundles: number; bundlesWithPassthrough: number; warningCount: number; largestBundle: PropBundle | null; }; /** * Get all detected context leaks */ getContextLeaks(): ContextLeak[]; /** * Get context leaks by severity */ getContextLeaksBySeverity(severity: ContextLeakSeverity): ContextLeak[]; /** * Get context leaks for a specific context */ getLeaksForContext(contextName: string): ContextLeak[]; /** * Get context leaks originating from a specific component */ getLeaksFromComponent(componentId: string): ContextLeak[]; /** * Get context leak summary for analysis output */ getContextLeakSummary(): { totalLeaks: number; highSeverity: number; mediumSeverity: number; lowSeverity: number; affectedContexts: string[]; worstLeak: ContextLeak | null; }; /** * Get all prop chains (rename tracking) */ getPropChains(): PropChain[]; /** * Get prop chains with multiple renames * @param minDepth - Minimum number of renames (default: 2) */ getComplexPropChains(minDepth?: number): PropChain[]; /** * Get prop chain for a specific original prop name */ getChainForProp(originalName: string): PropChain | undefined; /** * Get all renames in a specific component */ getRenamesInComponent(componentId: string): PropRename[]; /** * Get prop chain summary for analysis output */ getPropChainSummary(): { totalChains: number; complexChains: number; totalRenames: number; deepestChain: PropChain | null; mostRenamedProp: PropChain | null; }; /** * Trace a prop through all its renames to find the final name */ tracePropToFinalName(originalName: string): string; /** * Get all names a prop has had through the component tree */ getAllNamesForProp(originalName: string): string[]; } //# sourceMappingURL=analyzer.d.ts.map