/**
 * Advanced GitHub/GitLab Integration
 *
 * Provides comprehensive integration with GitHub and GitLab:
 * - PR creation and review
 * - Issue management
 * - Automated reviews via webhooks
 * - CI/CD integration
 */
import { EventEmitter } from 'events';
export interface GitProvider {
    type: 'github' | 'gitlab';
    host: string;
    apiUrl: string;
    token?: string;
}
export interface PullRequest {
    id: number;
    number: number;
    title: string;
    body: string;
    state: 'open' | 'closed' | 'merged';
    author: string;
    sourceBranch: string;
    targetBranch: string;
    url: string;
    createdAt: Date;
    updatedAt: Date;
    labels: string[];
    reviewers: string[];
    isDraft: boolean;
}
export interface Issue {
    id: number;
    number: number;
    title: string;
    body: string;
    state: 'open' | 'closed';
    author: string;
    labels: string[];
    assignees: string[];
    url: string;
    createdAt: Date;
}
export interface ReviewComment {
    id: number;
    body: string;
    path?: string;
    line?: number;
    author: string;
    createdAt: Date;
}
export interface PRReviewResult {
    approved: boolean;
    comments: ReviewComment[];
    summary: string;
    suggestedChanges: Array<{
        file: string;
        line: number;
        suggestion: string;
    }>;
}
export interface GitHubConfig {
    provider: GitProvider;
    defaultBranch: string;
    prTemplate?: string;
    issueTemplate?: string;
    autoLabels: boolean;
    requireReview: boolean;
}
/**
 * GitHub/GitLab Integration Manager
 */
export declare class GitHubIntegration extends EventEmitter {
    private config;
    private bash;
    private repoInfo;
    constructor(config?: Partial<GitHubConfig>);
    /**
     * Initialize and detect repository
     */
    initialize(): Promise<boolean>;
    /**
     * Parse git remote URL
     */
    private parseRemoteUrl;
    /**
     * Detect provider from URL
     */
    private detectProvider;
    /**
     * Create a Pull Request
     */
    createPullRequest(options: {
        title: string;
        body: string;
        sourceBranch?: string;
        targetBranch?: string;
        draft?: boolean;
        labels?: string[];
        reviewers?: string[];
    }): Promise<PullRequest | null>;
    /**
     * Create GitHub PR using gh CLI
     */
    private createGitHubPR;
    /**
     * Create GitLab MR using glab CLI
     */
    private createGitLabMR;
    /**
     * Get PR/MR diff
     */
    getPRDiff(prNumber: number): Promise<string | null>;
    /**
     * Get PR/MR details
     */
    getPRDetails(prNumber: number): Promise<PullRequest | null>;
    /**
     * Add comment to PR
     */
    addPRComment(prNumber: number, body: string): Promise<boolean>;
    /**
     * Add review to PR
     */
    addPRReview(prNumber: number, review: {
        event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT';
        body: string;
    }): Promise<boolean>;
    /**
     * List open PRs
     */
    listOpenPRs(): Promise<PullRequest[]>;
    /**
     * Create an issue
     */
    createIssue(options: {
        title: string;
        body: string;
        labels?: string[];
        assignees?: string[];
    }): Promise<Issue | null>;
    /**
     * List issues
     */
    listIssues(options?: {
        state?: 'open' | 'closed' | 'all';
        labels?: string[];
    }): Promise<Issue[]>;
    /**
     * Get CI/CD status
     */
    getCIStatus(ref?: string): Promise<{
        state: 'success' | 'failure' | 'pending' | 'unknown';
        checks: Array<{
            name: string;
            status: string;
            conclusion: string;
        }>;
    }>;
    /**
     * Generate PR description from commits
     */
    generatePRDescription(baseBranch?: string): Promise<string>;
    /**
     * Merge PR
     */
    mergePR(prNumber: number, options?: {
        method?: 'merge' | 'squash' | 'rebase';
        deleteAfter?: boolean;
    }): Promise<boolean>;
    /**
     * Format PR list for display
     */
    formatPRList(prs: PullRequest[]): string;
    /**
     * Get repo info
     */
    getRepoInfo(): {
        owner: string;
        repo: string;
    } | null;
    /**
     * Get provider
     */
    getProvider(): GitProvider;
    /**
     * Update config
     */
    updateConfig(config: Partial<GitHubConfig>): void;
}
export declare function getGitHubIntegration(config?: Partial<GitHubConfig>): GitHubIntegration;
export declare function resetGitHubIntegration(): void;
