/**
 * GraphTopology — topology and component algorithms.
 *
 * Contains: connectedComponent, topologicalSort, commonAncestors,
 * weightedLongestPath. Receives a BfsFn callback from the facade
 * to avoid circular imports.
 *
 * @module domain/services/query/GraphTopology
 */
import type { Direction, NeighborEdge, NeighborOptions } from '../../../ports/NeighborProviderPort.ts';
import { type BfsFn, type TraversalStats, type WeightFn, type default as TraversalContext } from './TraversalContext.ts';
export default class GraphTopology {
    private readonly _ctx;
    private readonly _bfs;
    constructor(ctx: TraversalContext, bfs: BfsFn);
    connectedComponent(params: {
        start: string;
        options?: NeighborOptions;
        maxNodes?: number;
        maxDepth?: number;
        signal?: AbortSignal;
    }): Promise<{
        nodes: string[];
        stats: TraversalStats;
    }>;
    topologicalSort(params: {
        start: string | string[];
        direction?: Direction | undefined;
        options?: NeighborOptions | undefined;
        maxNodes?: number | undefined;
        throwOnCycle?: boolean | undefined;
        signal?: AbortSignal | undefined;
        _returnAdjList?: boolean | undefined;
        _lightweight?: boolean | undefined;
    }): Promise<{
        sorted: string[];
        hasCycle: boolean;
        stats: TraversalStats;
        _neighborEdgeMap?: Map<string, NeighborEdge[]>;
    }>;
    commonAncestors(params: {
        nodes: string[];
        options?: NeighborOptions;
        maxDepth?: number;
        maxResults?: number;
        signal?: AbortSignal;
    }): Promise<{
        ancestors: string[];
        stats: TraversalStats;
    }>;
    weightedLongestPath(params: {
        start: string;
        goal: string;
        direction?: Direction;
        options?: NeighborOptions;
        weightFn?: WeightFn;
        nodeWeightFn?: (nodeId: string) => number | Promise<number>;
        maxNodes?: number;
        signal?: AbortSignal;
    }): Promise<{
        path: string[];
        totalCost: number;
        stats: TraversalStats;
    }>;
    private _loadTopoNeighborIds;
    private _createTopoNeighborIdReader;
    _findTopoCycleWitness(params: {
        discovered: Set<string>;
        sorted: string[];
        getNeighborIds: (nodeId: string) => Promise<string[]>;
    }): Promise<{
        from?: string;
        to?: string;
    }>;
}
