@notjustcoders/ioc-arise
Version:
Arise type-safe IoC containers from your code. Zero overhead, zero coupling.
17 lines • 732 B
TypeScript
export interface TopologicalSortResult {
sorted: string[];
cycles: string[][];
}
export declare class TopologicalSorter {
/**
* Performs topological sorting on a dependency graph with cycle detection
* @param graph - A map where keys are nodes and values are their dependencies
* @param order - Sort order: 'asc' for ascending (default) or 'desc' for descending
* @returns Object containing sorted nodes and any detected cycles
*/
static sort(graph: Map<string, string[]> | Record<string, string[]>, order?: 'asc' | 'desc'): TopologicalSortResult;
private static getDependencies;
private static hasNode;
private static getNodes;
}
//# sourceMappingURL=topological-sorter.d.ts.map