/**
 * Azure DevOps Duplicate Detector (v0.33.0)
 *
 * Implements 3-phase duplicate protection for ADO work items:
 * 1. Detection: Check before create
 * 2. Verification: Count check after create
 * 3. Reflection: Auto-close duplicates
 *
 * Mirrors the GitHub DuplicateDetector pattern for consistency.
 */
import { Logger } from '../../../../../src/utils/logger.js';
export interface AdoWorkItem {
    id: number;
    title: string;
    state: string;
    createdDate: string;
    url?: string;
}
export interface DuplicateGroup {
    title: string;
    items: AdoWorkItem[];
    keepItem: AdoWorkItem;
    duplicates: AdoWorkItem[];
}
export interface DetectionResult {
    found: boolean;
    existingItem?: AdoWorkItem;
    count: number;
}
export interface VerificationResult {
    success: boolean;
    expectedCount: number;
    actualCount: number;
    duplicates: AdoWorkItem[];
}
export interface CleanupResult {
    closedCount: number;
    keptCount: number;
    errors: string[];
}
export declare class AdoDuplicateDetector {
    private org;
    private project;
    private pat;
    private logger;
    constructor(options?: {
        org?: string;
        project?: string;
        pat?: string;
        logger?: Logger;
    });
    /**
     * Phase 1: Check if work item exists before creating
     */
    checkBeforeCreate(titlePattern: string, incrementId?: string): Promise<DetectionResult>;
    /**
     * Phase 2: Verify count after creation
     */
    verifyAfterCreate(titlePattern: string, expectedCount?: number): Promise<VerificationResult>;
    /**
     * Phase 3: Auto-close duplicates
     */
    closeDuplicates(duplicates: AdoWorkItem[], keepItemId: number): Promise<CleanupResult>;
    /**
     * Full cleanup: Find and close all duplicates for a feature
     */
    cleanupFeatureDuplicates(featureId: string, dryRun?: boolean): Promise<{
        groups: DuplicateGroup[];
        totalItems: number;
        duplicateCount: number;
        closedCount: number;
    }>;
    /**
     * Group work items by title
     */
    private groupByTitle;
    /**
     * Search for work items using WIQL
     */
    private searchWorkItems;
    /**
     * Get work item details by IDs
     */
    private getWorkItemDetails;
    /**
     * Close a work item with duplicate comment
     */
    private closeWorkItem;
}
/**
 * Convenience function for quick duplicate cleanup
 */
export declare function cleanupAdoDuplicates(featureId: string, dryRun?: boolean): Promise<{
    groups: DuplicateGroup[];
    totalItems: number;
    duplicateCount: number;
    closedCount: number;
}>;
export default AdoDuplicateDetector;
//# sourceMappingURL=ado-duplicate-detector.d.ts.map