/**
 * Per-US JIRA Sync (v0.34.0+)
 *
 * Syncs each User Story to its explicitly declared project's JIRA project.
 * Uses the **Project**: field in spec.md (NOT keyword-based classification).
 *
 * Key difference from multi-project-sync:
 * - Multi-project sync uses keyword/heuristic classification
 * - Per-US sync uses EXPLICIT **Project**: field from spec.md
 *
 * @module per-us-sync
 * @since v0.34.0
 */
import type { UserStoryData } from '../../../../../src/core/living-docs/types.js';
import type { ProjectMappings } from '../../../../../src/core/types/config.js';
import type { USExternalRefsMap } from '../../../../../src/core/types/increment-metadata.js';
import { Logger } from '../../../../../src/utils/logger.js';
/**
 * Result of syncing a single US to JIRA
 */
export interface USSyncResult {
    usId: string;
    projectId: string;
    jiraProject: string;
    issueKey: string;
    url: string;
    action: 'created' | 'updated' | 'skipped';
    error?: string;
}
/**
 * Result of syncing all USs in an increment
 */
export interface PerUSSyncResult {
    success: boolean;
    synced: USSyncResult[];
    failed: USSyncResult[];
    externalRefs: USExternalRefsMap;
    summary: {
        total: number;
        created: number;
        updated: number;
        skipped: number;
        failed: number;
    };
}
/**
 * Options for per-US sync
 */
export interface PerUSSyncOptions {
    dryRun?: boolean;
    force?: boolean;
    defaultProject?: string;
    logger?: Logger;
}
/**
 * JIRA client interface (to be injected)
 */
export interface JiraClient {
    createIssue(project: string, issueType: string, summary: string, description: string): Promise<{
        key: string;
        self: string;
    }>;
    updateIssue(issueKey: string, summary: string, description: string): Promise<void>;
    searchIssues(jql: string): Promise<Array<{
        key: string;
        fields: {
            summary: string;
        };
    }>>;
    getIssueUrl(issueKey: string): string;
}
/**
 * Per-US JIRA Sync
 *
 * Syncs each US to its declared project's JIRA project.
 */
export declare class PerUSJiraSync {
    private projectMappings;
    private jiraClient;
    private logger;
    constructor(jiraClient: JiraClient, projectMappings: ProjectMappings, options?: {
        logger?: Logger;
    });
    /**
     * Sync all user stories to their respective JIRA projects
     *
     * @param userStories - User stories with explicit project fields
     * @param featureId - Feature ID (e.g., "FS-137")
     * @param options - Sync options
     */
    syncUserStories(userStories: UserStoryData[], featureId: string, options?: PerUSSyncOptions): Promise<PerUSSyncResult>;
    /**
     * Sync a single user story to JIRA
     */
    private syncUserStory;
    /**
     * Find existing issue by US ID in summary
     */
    private findExistingIssue;
    /**
     * Build issue description from user story
     *
     * Includes full User Story format with description and Acceptance Criteria.
     * Uses `acceptanceCriteriaFull` if available (v1.0.59+) for AC descriptions,
     * otherwise falls back to AC IDs only.
     */
    private buildIssueDescription;
    /**
     * Group user stories by their explicit project field
     */
    private groupByProject;
}
/**
 * Format per-US sync results for display
 */
export declare function formatPerUSSyncResults(result: PerUSSyncResult): string;
//# sourceMappingURL=per-us-sync.d.ts.map