/**
 * Per-US GitHub Sync (v0.34.0+)
 *
 * Syncs each User Story to its explicitly declared project's GitHub repo.
 * 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 GitHub
 */
export interface USSyncResult {
    usId: string;
    projectId: string;
    repo: string;
    issueNumber: 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;
    logger?: Logger;
}
/**
 * Per-US GitHub Sync
 *
 * Syncs each US to its declared project's GitHub repository.
 */
export declare class PerUSGitHubSync {
    private token;
    private projectMappings;
    private octokit;
    private logger;
    constructor(token: string, projectMappings: ProjectMappings, options?: {
        logger?: Logger;
    });
    /**
     * Sync all user stories to their respective GitHub repos
     *
     * @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 GitHub
     */
    private syncUserStory;
    /**
     * Find existing issue by US ID in title
     *
     * Paginates through all issues to avoid missing matches on repos with 100+ issues.
     * Deduplicates by issue number before returning.
     */
    private findExistingIssue;
    /**
     * Build issue body 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 buildIssueBody;
    /**
     * Group user stories by their explicit project field
     */
    private groupByProject;
}
/**
 * Sync AC checkbox status from spec.md to an existing GitHub issue.
 *
 * CRITICAL FIX (v1.0.59): This method specifically updates AC checkboxes
 * in GitHub issues when tasks are completed locally. Handles concurrency
 * by using atomic issue body updates.
 *
 * @param token - GitHub token
 * @param owner - Repo owner
 * @param repo - Repo name
 * @param issueNumber - GitHub issue number
 * @param acStatus - Map of AC ID to completed status
 * @returns Success/failure result
 */
export declare function syncACCheckboxesToGitHub(token: string, owner: string, repo: string, issueNumber: number, acStatus: Map<string, boolean>, options?: {
    logger?: Logger;
    addComment?: boolean;
}): Promise<{
    success: boolean;
    error?: string;
    updated: string[];
}>;
/**
 * Format per-US sync results for display
 */
export declare function formatPerUSSyncResults(result: PerUSSyncResult): string;
//# sourceMappingURL=per-us-sync.d.ts.map