/**
 * Per-US Azure DevOps Sync (v0.34.0+)
 *
 * Syncs each User Story to its explicitly declared project's ADO project/area.
 * Uses the **Project**: and **Board**: fields 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**: and **Board**: fields 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 ADO
 */
export interface USSyncResult {
    usId: string;
    projectId: string;
    adoProject: string;
    areaPath: string;
    workItemId: number;
    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;
    defaultBoard?: string;
    logger?: Logger;
}
/**
 * ADO client interface (to be injected)
 */
export interface AdoClient {
    createWorkItem(project: string, workItemType: string, title: string, description: string, areaPath?: string): Promise<{
        id: number;
        url: string;
    }>;
    updateWorkItem(project: string, workItemId: number, title: string, description: string, areaPath?: string): Promise<void>;
    searchWorkItems(project: string, query: string): Promise<Array<{
        id: number;
        fields: {
            'System.Title': string;
        };
    }>>;
    getWorkItemUrl(project: string, workItemId: number): string;
}
/**
 * Per-US ADO Sync
 *
 * Syncs each US to its declared project's ADO project/area path.
 * For 2-level structures, uses **Board**: to determine area path.
 */
export declare class PerUSAdoSync {
    private projectMappings;
    private adoClient;
    private logger;
    private workItemType;
    constructor(adoClient: AdoClient, projectMappings: ProjectMappings, options?: {
        logger?: Logger;
        workItemType?: string;
        processTemplate?: string;
    });
    /**
     * Sync all user stories to their respective ADO projects
     *
     * @param userStories - User stories with explicit project/board 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 ADO
     *
     * For 2-level structures:
     * - **Project**: maps to ADO project
     * - **Board**: maps to area path under the project
     */
    private syncUserStory;
    /**
     * Find existing work item by Feature ID + US ID in title.
     * Scoped to current feature to prevent cross-increment matches (FS-604).
     */
    private findExistingWorkItem;
    /**
     * Build work item 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 buildWorkItemDescription;
    /**
     * Escape HTML special characters
     */
    private escapeHtml;
    /**
     * 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