/**
 * Service for DAG traversal operations: BFS, DFS, ancestor/descendant
 * enumeration, and reachability checks.
 *
 * All traversal methods use async generators for memory-efficient
 * processing of arbitrarily large graphs.
 *
 * @module domain/services/dag/DagTraversal
 */
import type LoggerPort from '../../../ports/LoggerPort.ts';
type TraversalDirection = 'forward' | 'reverse';
type TraversalNode = {
    readonly sha: string;
    readonly depth: number;
    readonly parent: string | null;
};
type TraversalOptions = {
    readonly start: string;
    readonly maxNodes?: number | undefined;
    readonly maxDepth?: number | undefined;
    readonly direction?: TraversalDirection | undefined;
    readonly signal?: AbortSignal | undefined;
};
/** Minimal contract for the index reader. */
type DagIndexReader = {
    readonly getChildren: (sha: string) => Promise<string[]>;
    readonly getParents: (sha: string) => Promise<string[]>;
};
/** Minimal contract for the path finder (set via _setPathFinder). */
type PathFinder = {
    readonly findPath: (opts: {
        from: string;
        to: string;
        maxDepth?: number | undefined;
        signal?: AbortSignal | undefined;
    }) => Promise<{
        found: boolean;
    }>;
};
export default class DagTraversal {
    private readonly _indexReader;
    private readonly _logger;
    private _pathFinder;
    constructor(deps: {
        indexReader: DagIndexReader;
        logger?: LoggerPort;
    });
    private _getNeighbors;
    bfs(opts: TraversalOptions): AsyncGenerator<TraversalNode>;
    dfs(opts: TraversalOptions): AsyncGenerator<TraversalNode>;
    ancestors(opts: {
        sha: string;
        maxNodes?: number | undefined;
        maxDepth?: number | undefined;
        signal?: AbortSignal | undefined;
    }): AsyncGenerator<TraversalNode>;
    descendants(opts: {
        sha: string;
        maxNodes?: number | undefined;
        maxDepth?: number | undefined;
        signal?: AbortSignal | undefined;
    }): AsyncGenerator<TraversalNode>;
    isReachable(opts: {
        from: string;
        to: string;
        maxDepth?: number | undefined;
        signal?: AbortSignal | undefined;
    }): Promise<boolean>;
    /** @internal */
    _setPathFinder(pathFinder: PathFinder): void;
}
export type { TraversalDirection, TraversalNode, TraversalOptions, DagIndexReader, PathFinder };
