import { IKosDataModel, IKosModel } from '../core/kosModel';
import { KosModelVisitor } from './kos-model-visitor';
/**
 * Generic visitor that finds the ancestor path to a target item.
 * Works with any KOS model hierarchy that implements the visitor pattern.
 *
 * Uses depth-first traversal, tracking the path as it goes.
 * When the target is found, the accumulated path IS the ancestor list.
 *
 * Backtracking logic is entirely self-contained - no model changes needed.
 * Works well for Studio's typical model sizes (dozens to ~100 items).
 *
 * @example
 * ```typescript
 * const visitor = new AncestorPathVisitor('target-item-id');
 * visitor.start(rootContainerModel);
 * const ancestors = visitor.getAncestorPath(); // ['root', 'parent', 'grandparent']
 * ```
 *
 * @category Core
 * @kosService core.utils
 * @kosApiLevel 20
 */
export declare class AncestorPathVisitor extends KosModelVisitor {
    private targetId;
    private currentPath;
    private foundPath;
    constructor(targetId: string);
    /**
     * Override visit() to wrap the entire visit lifecycle with path tracking.
     *
     * Flow:
     * 1. Check cycle detection (skip if already visited)
     * 2. Push model to path
     * 3. Call visitModel() to check if this is target
     * 4. If not target, visit children
     * 5. Pop from path if target not found in this subtree (backtrack)
     *
     * Note: We inline the base class logic rather than calling super.visit()
     * because we need to control exactly when push/pop happens relative to
     * the cycle detection and child traversal.
     */
    visit(model: IKosModel): void;
    /**
     * Called for each model during traversal.
     * Returns true to stop traversal when target is found.
     */
    visitModel<T extends IKosDataModel>(model: T): boolean | void;
    /**
     * Get the ancestor path (IDs from root to parent, not including target).
     * Returns empty array if target not found or target is at root level.
     */
    getAncestorPath(): string[];
    /**
     * Check if target was found during traversal.
     */
    wasFound(): boolean;
}
//# sourceMappingURL=ancestor-path-visitor.d.ts.map