/** * 🌌 Complex Structure Analyzer - The Pattern Recognizer * * Detects and analyzes complex code patterns: * - Closures and scope chains * - Decorators and meta-programming * - Higher-order functions * - Generators and iterators * - Async patterns and promises * - Class hierarchies and inheritance */ import * as ts from 'typescript'; export interface ComplexPattern { type: PatternType; complexity: number; depth: number; signature: string; metadata?: Record; } export declare enum PatternType { CLOSURE = "closure", DECORATOR = "decorator", HIGHER_ORDER = "higher_order", GENERATOR = "generator", ASYNC_PATTERN = "async_pattern", CLASS_HIERARCHY = "class_hierarchy", FACTORY = "factory", SINGLETON = "singleton", OBSERVER = "observer", PROXY = "proxy", MEMOIZATION = "memoization", CURRY = "curry", COMPOSE = "compose", MONAD = "monad", RECURSION = "recursion", SELF_MODIFYING = "self_modifying" } export declare class ComplexStructureAnalyzer { private scopeChain; private closures; private patterns; /** * Analyze a source file for complex patterns */ analyzeStructures(sourceFile: ts.SourceFile): ComplexPattern[]; /** * Build scope chain for closure detection */ private buildScopeChain; /** * Detect all complex patterns */ private detectPatterns; /** * Check if node creates a new scope */ private createsScope; /** * Check if function is a closure */ private isClosure; /** * Analyze closure complexity */ private analyzeClosure; /** * Analyze decorator */ private analyzeDecorator; /** * Check if function is higher-order */ private isHigherOrderFunction; /** * Analyze higher-order function */ private analyzeHigherOrderFunction; /** * Check if node is a generator */ private isGenerator; /** * Analyze generator */ private analyzeGenerator; /** * Check for async patterns */ private isAsyncPattern; /** * Analyze async pattern */ private analyzeAsyncPattern; /** * Analyze class hierarchy */ private analyzeClassHierarchy; /** * Detect design patterns */ private detectDesignPatterns; /** * Detect functional patterns */ private detectFunctionalPatterns; private isSingleton; private isFactory; private isObserver; private isProxy; private isMemoization; private isCurry; private isCompose; private isMonadic; private isSelfModifying; private reset; } /** * Calculate pattern resonance (how "alive" is this pattern) */ export declare function calculatePatternResonance(patterns: ComplexPattern[]): number; //# sourceMappingURL=complex-structures.d.ts.map