/**
 * JIRA Duplicate Detector (v0.33.0)
 *
 * Implements 3-phase duplicate protection for JIRA issues:
 * 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 JiraIssue {
    key: string;
    summary: string;
    status: string;
    created: string;
    url?: string;
}
export interface DuplicateGroup {
    summary: string;
    issues: JiraIssue[];
    keepIssue: JiraIssue;
    duplicates: JiraIssue[];
}
export interface DetectionResult {
    found: boolean;
    existingIssue?: JiraIssue;
    count: number;
}
export interface VerificationResult {
    success: boolean;
    expectedCount: number;
    actualCount: number;
    duplicates: JiraIssue[];
}
export interface CleanupResult {
    closedCount: number;
    keptCount: number;
    errors: string[];
}
export declare class JiraDuplicateDetector {
    private domain;
    private auth;
    private logger;
    constructor(options?: {
        domain?: string;
        email?: string;
        token?: string;
        logger?: Logger;
    });
    /**
     * Phase 1: Check if issue exists before creating
     */
    checkBeforeCreate(summaryPattern: string, incrementId?: string): Promise<DetectionResult>;
    /**
     * Phase 2: Verify count after creation
     */
    verifyAfterCreate(summaryPattern: string, expectedCount?: number): Promise<VerificationResult>;
    /**
     * Phase 3: Auto-close duplicates
     */
    closeDuplicates(duplicates: JiraIssue[], keepIssueKey: string): Promise<CleanupResult>;
    /**
     * Full cleanup: Find and close all duplicates for a feature
     */
    cleanupFeatureDuplicates(featureId: string, dryRun?: boolean): Promise<{
        groups: DuplicateGroup[];
        totalIssues: number;
        duplicateCount: number;
        closedCount: number;
    }>;
    /**
     * Group issues by summary
     */
    private groupBySummary;
    /**
     * Search for issues using JQL
     */
    private searchIssues;
    /**
     * Close an issue with duplicate comment
     */
    private closeIssue;
    /**
     * Get available transitions for an issue
     */
    private getTransitions;
    /**
     * Add duplicate comment to issue
     */
    private addComment;
}
/**
 * Convenience function for quick duplicate cleanup
 */
export declare function cleanupJiraDuplicates(featureId: string, dryRun?: boolean): Promise<{
    groups: DuplicateGroup[];
    totalIssues: number;
    duplicateCount: number;
    closedCount: number;
}>;
export default JiraDuplicateDetector;
//# sourceMappingURL=jira-duplicate-detector.d.ts.map