UNPKG

datapilot-cli

Version:

Enterprise-grade streaming multi-format data analysis with comprehensive statistical insights and intelligent relationship detection - supports CSV, JSON, Excel, TSV, Parquet - memory-efficient, cross-platform

113 lines 3.55 kB
/** * Enhanced Dependency Injection System for CLI Analyzers * Manages complex dependencies between analysis sections with caching and validation */ import type { SectionResultMap, DependencyResolver, CLIOptions } from './types'; import type { LogContext } from '../utils/logger'; /** * Concrete implementation of dependency resolver with caching and validation */ export declare class AnalyzerDependencyResolver implements DependencyResolver { private dependencies; private resolutionOrder; private resolverFunctions; private context; constructor(context?: LogContext); /** * Define the canonical dependency resolution order */ private setupResolutionOrder; /** * Register resolver function for a section */ registerResolver<K extends keyof SectionResultMap>(sectionName: K, resolver: () => Promise<SectionResultMap[K]>): void; /** * Resolve a specific section dependency with error handling and retries */ resolve<K extends keyof SectionResultMap>(sectionName: K): Promise<SectionResultMap[K]>; /** * Execute resolver with timeout protection */ private executeWithTimeout; /** * Validate that a section result has the expected structure */ private validateSectionResult; /** * Get validation rules for a specific section */ private getSectionValidationRules; /** * Check if object has a property using safe property access */ private hasProperty; /** * Cache a section result with metadata */ cache<K extends keyof SectionResultMap>(sectionName: K, result: SectionResultMap[K]): void; /** * Clear all cached dependencies */ clear(): void; /** * Check if a section is already cached */ has(sectionName: string): boolean; /** * Get all cached section names */ getCachedSections(): string[]; /** * Get dependency resolution statistics */ getStats(): { totalCached: number; cachedSections: string[]; oldestCache?: Date; newestCache?: Date; }; /** * Resolve multiple dependencies in order */ resolveMultiple<K extends keyof SectionResultMap>(sectionNames: K[]): Promise<Record<K, SectionResultMap[K]>>; /** * Get the recommended resolution order for given sections */ getResolutionOrder(sectionNames: string[]): string[]; /** * Check if all dependencies for a section are available */ canResolve(sectionName: string): { canResolve: boolean; missingDependencies: string[]; }; /** * Get the dependencies for a specific section */ private getSectionDependencies; } /** * Factory function to create a configured dependency resolver */ export declare function createDependencyResolver(filePath: string, options: CLIOptions, context?: LogContext): AnalyzerDependencyResolver; /** * Dependency chain validator for complex analysis pipelines */ export declare class DependencyChainValidator { private dependencies; constructor(); private setupDependencyMap; /** * Validate that all dependencies can be resolved for the given sections */ validateChain(requestedSections: string[]): { isValid: boolean; errors: string[]; warnings: string[]; }; /** * Get the optimal execution order for the given sections */ getExecutionOrder(requestedSections: string[]): string[]; } //# sourceMappingURL=dependency-resolver.d.ts.map