/**
 * Jira ↔ SpecWeave Bidirectional Mapper
 *
 * Handles conversion between Jira issues and SpecWeave documentation structure:
 * - Jira Epic → SpecWeave Increment (RFC folder)
 * - Jira Story → SpecWeave User Story (RFC document)
 * - Jira Sub-task → SpecWeave Task (tasks.md)
 *
 * Syncs with:
 * - .specweave/increments/{id}/ - Increment folder
 * - .specweave/docs/internal/architecture/rfc/ - RFC documents for detailed specs
 * - .specweave/docs/internal/architecture/adr/ - Architecture decisions (ADRs)
 */
import { JiraClient } from './jira-client.js';
import { Logger } from '../../utils/logger.js';
/**
 * Set the logger for this module
 */
export declare function setJiraMapperLogger(logger: Logger): void;
export interface SpecWeaveIncrement {
    id: string;
    title: string;
    description: string;
    status: 'planned' | 'in-progress' | 'completed' | 'cancelled';
    priority: 'P1' | 'P2' | 'P3';
    created_at: string;
    updated_at: string;
    jira?: {
        epic_key: string;
        epic_id: string;
        epic_url: string;
        last_sync: string;
        sync_direction: 'import' | 'export' | 'bidirectional';
    };
    user_stories: SpecWeaveUserStory[];
}
export interface SpecWeaveUserStory {
    id: string;
    title: string;
    description: string;
    acceptance_criteria: string[];
    jira?: {
        key: string;
        id: string;
        url: string;
    };
    tasks: SpecWeaveTask[];
}
export interface SpecWeaveTask {
    id: string;
    description: string;
    completed: boolean;
    jira?: {
        key: string;
        id: string;
    };
}
export interface SyncResult {
    success: boolean;
    operation: 'import' | 'export' | 'sync';
    direction: 'jira-to-specweave' | 'specweave-to-jira' | 'bidirectional';
    changes: {
        created: number;
        updated: number;
        deleted: number;
    };
    conflicts: SyncConflict[];
    summary: string;
}
export interface SyncConflict {
    type: 'title' | 'description' | 'status' | 'priority';
    jira_value: string;
    specweave_value: string;
    resolution?: 'jira' | 'specweave' | 'manual';
}
/**
 * Configuration options for JiraMapper
 * Domain should come from ConfigManager (config.json), not process.env
 */
export interface JiraMapperConfig {
    /** JIRA domain (e.g., "company.atlassian.net") - from config.json */
    domain: string;
}
export declare class JiraMapper {
    private client;
    private projectRoot;
    private domain;
    private targetProjectId?;
    /**
     * Create a JiraMapper
     *
     * @param client - JiraClient instance
     * @param config - Configuration with domain from ConfigManager
     * @param projectRoot - Project root path
     * @param targetProjectId - Target SpecWeave project ID for per-project collision prevention
     */
    constructor(client: JiraClient, config: JiraMapperConfig, projectRoot?: string, targetProjectId?: string);
    /**
     * Import Jira Epic as SpecWeave Increment with RFC documentation
     */
    importEpicAsIncrement(epicKey: string): Promise<SyncResult>;
    /**
     * Export SpecWeave Increment to Jira Epic
     */
    exportIncrementAsEpic(incrementId: string, projectKey: string): Promise<SyncResult>;
    /**
     * Three-permission sync between SpecWeave Increment and Jira Epic
     */
    syncIncrement(incrementId: string): Promise<SyncResult>;
    private getNextIncrementId;
    private ensureDir;
    private generateSpecMd;
    private generateTasksMd;
    private generateRFC;
    private parseMarkdownWithFrontmatter;
    private serializeMarkdownWithFrontmatter;
    private extractTextFromJiraDescription;
    private extractDescription;
    private extractUserStories;
    private parseTasksMd;
    private updateSpecWithJiraMetadata;
    private mapJiraStatusToSpecWeave;
    private mapJiraPriorityToSpecWeave;
    private mapPriorityToJira;
    private slugify;
}
//# sourceMappingURL=jira-mapper.d.ts.map