/** * Dependency resolver for DQL blocks. * * Performs topological sorting of blocks based on ref() calls and * SQL-extracted table dependencies. Detects circular dependencies. */ /** Minimal block info needed for dependency resolution */ export interface BlockDependencyInfo { /** Block name (unique identifier) */ name: string; /** Raw SQL query for the block */ sql: string; /** Domain the block belongs to */ domain?: string; /** Materialized table/view name (defaults to block name) */ materializedAs?: string; } /** Result of dependency resolution */ export interface DependencyResolutionResult { /** Blocks in execution order (dependencies first) */ executionOrder: string[]; /** Map of block name → its direct dependencies */ dependencyMap: Map; /** Map of block name → blocks that depend on it */ dependentsMap: Map; /** Circular dependency chains detected (empty if none) */ cycles: string[][]; } /** * Resolve dependencies among a set of blocks and return execution order. * * Uses both explicit ref() calls and implicit SQL table references to * build the dependency graph. Returns a topological sort or reports cycles. */ export declare function resolveDependencies(blocks: BlockDependencyInfo[]): DependencyResolutionResult; /** * Get all upstream dependencies (transitive) for a given block. */ export declare function getUpstream(blockName: string, dependencyMap: Map): string[]; /** * Get all downstream dependents (transitive) for a given block. */ export declare function getDownstream(blockName: string, dependentsMap: Map): string[]; //# sourceMappingURL=dependency-resolver.d.ts.map