import { EventEmitter } from 'events';
/**
 * Git Event Types
 */
export declare enum GitEventType {
    COMMIT = "commit",
    PUSH = "push",
    PULL = "pull",
    BRANCH_CREATE = "branch_create",
    BRANCH_DELETE = "branch_delete",
    BRANCH_CHECKOUT = "branch_checkout",
    MERGE = "merge",
    TAG = "tag",
    PR_OPEN = "pr_open",
    PR_CLOSE = "pr_close",
    PR_MERGE = "pr_merge"
}
/**
 * Git Event Configuration
 */
export interface GitEventConfig {
    event: GitEventType;
    pattern?: RegExp;
    action: string;
    conditions?: {
        branch?: string | RegExp;
        author?: string;
        message?: RegExp;
    };
    metadata?: Record<string, any>;
}
/**
 * Task-Git Mapping
 */
export interface TaskGitMapping {
    taskId: string;
    branch?: string;
    commitPrefix?: string;
    prNumber?: number;
    issueNumber?: number;
}
/**
 * Git Event Handler Service
 * Integrates Git operations with task status workflow
 */
export declare class GitEventHandler extends EventEmitter {
    private git;
    private client;
    private repoPath;
    private eventConfigs;
    private taskMappings;
    private watchInterval;
    private lastCommitHash;
    constructor(repoPath?: string);
    private initializeClient;
    /**
     * Load event configurations from database or config
     */
    private loadEventConfigs;
    /**
     * Load task-git mappings from database
     */
    private loadTaskMappings;
    /**
     * Start watching for Git events
     */
    startWatching(intervalMs?: number): Promise<void>;
    /**
     * Stop watching for Git events
     */
    stopWatching(): void;
    /**
     * Check for new commits
     */
    private checkForNewCommits;
    /**
     * Process a Git commit
     */
    private processCommit;
    /**
     * Extract task ID from commit message
     */
    private extractTaskId;
    /**
     * Find matching event configuration
     */
    private findMatchingConfig;
    /**
     * Get current branch name
     */
    private getCurrentBranch;
    /**
     * Trigger status transition based on Git event
     */
    private triggerStatusTransition;
    /**
     * Set up branch watcher
     */
    private setupBranchWatcher;
    /**
     * Handle branch change
     */
    private handleBranchChange;
    /**
     * Extract task ID from branch name
     */
    private extractTaskIdFromBranch;
    /**
     * Handle pull request events (webhook receiver)
     */
    handlePullRequestEvent(event: any): Promise<void>;
    /**
     * Create branch for task
     */
    createTaskBranch(taskId: string, taskTitle: string): Promise<string>;
    /**
     * Get Git information for task
     */
    getTaskGitInfo(taskId: string): Promise<any>;
    /**
     * Clean up service
     */
    cleanup(): Promise<void>;
}
export declare const gitEventHandler: GitEventHandler;
//# sourceMappingURL=gitEventHandler.d.ts.map