import type Database from 'better-sqlite3';
import type { DependencyCounts, DependencyGraph, DependencyStatus, ImpactAnalysis, SectionDependency, SectionRelation } from '../../shared/entities.js';
export interface DependenciesListQuery {
    status?: DependencyStatus;
    relation?: SectionRelation;
    pagePath?: string;
}
export interface GraphQuery {
    relation?: SectionRelation[];
    status?: DependencyStatus[];
    pagePathPrefix?: string;
    includeIsolated?: boolean;
}
export interface CreateDependencyInput {
    sourceAnchor: string;
    targetAnchor: string;
    relation: SectionRelation;
    description?: string | null;
}
export declare class DependenciesService {
    private db;
    constructor(db: Database.Database);
    list(query?: DependenciesListQuery): SectionDependency[];
    getById(id: number): SectionDependency | null;
    listForAnchor(anchor: string): {
        asSource: SectionDependency[];
        asTarget: SectionDependency[];
    };
    create(input: CreateDependencyInput): SectionDependency;
    remove(id: number): void;
    verify(id: number): SectionDependency;
    impactAnalysis(targetAnchor: string): ImpactAnalysis | null;
    counts(): DependencyCounts;
    countByStatus(status: DependencyStatus): number;
    graph(query?: GraphQuery): DependencyGraph;
    suggest(anchor: string): Array<{
        targetAnchor: string;
        heading: string;
        pagePath: string;
        confidence: number;
        reason: string;
    }>;
    private hydrate;
}
export declare function detectCycles(edges: Array<[string, string]>): string[][];
