/**
 * Task Management Integration
 *
 * Provides integration with task management platforms:
 * - Jira (Atlassian)
 * - Linear
 *
 * Features:
 * - Create/update issues
 * - Link commits to issues
 * - Sync status
 * - Query issues
 */
import { EventEmitter } from 'events';
export type TaskPlatform = 'jira' | 'linear';
export interface TaskManagementConfig {
    platform: TaskPlatform;
    apiKey: string;
    baseUrl?: string;
    projectKey?: string;
    teamId?: string;
}
export interface Issue {
    id: string;
    key: string;
    title: string;
    description?: string;
    status: string;
    priority: IssuePriority;
    type: IssueType;
    assignee?: string;
    labels: string[];
    url: string;
    createdAt: Date;
    updatedAt: Date;
}
export type IssuePriority = 'urgent' | 'high' | 'medium' | 'low' | 'none';
export type IssueType = 'bug' | 'feature' | 'task' | 'story' | 'epic' | 'subtask';
export type IssueStatus = 'backlog' | 'todo' | 'in_progress' | 'review' | 'done' | 'canceled';
export interface CreateIssueOptions {
    title: string;
    description?: string;
    type?: IssueType;
    priority?: IssuePriority;
    labels?: string[];
    assignee?: string;
    parentKey?: string;
}
export interface UpdateIssueOptions {
    title?: string;
    description?: string;
    status?: IssueStatus;
    priority?: IssuePriority;
    labels?: string[];
    assignee?: string;
}
export interface IssueQuery {
    status?: IssueStatus | IssueStatus[];
    assignee?: string;
    labels?: string[];
    type?: IssueType;
    search?: string;
    limit?: number;
}
export interface Comment {
    id: string;
    body: string;
    author: string;
    createdAt: Date;
}
/**
 * Abstract base class for task management integrations
 */
declare abstract class TaskManagementClient extends EventEmitter {
    protected config: TaskManagementConfig;
    constructor(config: TaskManagementConfig);
    abstract getIssue(key: string): Promise<Issue | null>;
    abstract createIssue(options: CreateIssueOptions): Promise<Issue>;
    abstract updateIssue(key: string, options: UpdateIssueOptions): Promise<Issue>;
    abstract queryIssues(query: IssueQuery): Promise<Issue[]>;
    abstract addComment(key: string, body: string): Promise<Comment>;
    abstract linkCommit(key: string, commitSha: string, message: string): Promise<void>;
    abstract getStatuses(): Promise<string[]>;
    abstract testConnection(): Promise<boolean>;
}
/**
 * Jira Integration Client
 */
export declare class JiraClient extends TaskManagementClient {
    private baseUrl;
    constructor(config: TaskManagementConfig);
    private request;
    private mapPriority;
    private mapType;
    private parseIssue;
    getIssue(key: string): Promise<Issue | null>;
    createIssue(options: CreateIssueOptions): Promise<Issue>;
    updateIssue(key: string, options: UpdateIssueOptions): Promise<Issue>;
    private transitionIssue;
    queryIssues(query: IssueQuery): Promise<Issue[]>;
    addComment(key: string, body: string): Promise<Comment>;
    linkCommit(key: string, commitSha: string, message: string): Promise<void>;
    getStatuses(): Promise<string[]>;
    testConnection(): Promise<boolean>;
    private getJiraType;
}
/**
 * Linear Integration Client
 */
export declare class LinearClient extends TaskManagementClient {
    private readonly apiUrl;
    private graphql;
    private mapPriority;
    private parseIssue;
    getIssue(key: string): Promise<Issue | null>;
    createIssue(options: CreateIssueOptions): Promise<Issue>;
    updateIssue(key: string, options: UpdateIssueOptions): Promise<Issue>;
    queryIssues(query: IssueQuery): Promise<Issue[]>;
    addComment(key: string, body: string): Promise<Comment>;
    linkCommit(key: string, commitSha: string, message: string): Promise<void>;
    getStatuses(): Promise<string[]>;
    testConnection(): Promise<boolean>;
}
/**
 * Task Management Integration Manager
 */
export declare class TaskManagementIntegration extends EventEmitter {
    private client;
    private config;
    /**
     * Configure the task management integration
     */
    configure(config: TaskManagementConfig): void;
    /**
     * Get the current client
     */
    private getClient;
    /**
     * Get an issue by key
     */
    getIssue(key: string): Promise<Issue | null>;
    /**
     * Create a new issue
     */
    createIssue(options: CreateIssueOptions): Promise<Issue>;
    /**
     * Update an existing issue
     */
    updateIssue(key: string, options: UpdateIssueOptions): Promise<Issue>;
    /**
     * Query issues
     */
    queryIssues(query: IssueQuery): Promise<Issue[]>;
    /**
     * Add a comment to an issue
     */
    addComment(key: string, body: string): Promise<Comment>;
    /**
     * Link a commit to an issue
     */
    linkCommit(key: string, commitSha: string, message: string): Promise<void>;
    /**
     * Get available statuses
     */
    getStatuses(): Promise<string[]>;
    /**
     * Test the connection
     */
    testConnection(): Promise<boolean>;
    /**
     * Extract issue keys from commit message
     */
    extractIssueKeys(message: string): string[];
    /**
     * Get current platform
     */
    getPlatform(): TaskPlatform | null;
    /**
     * Check if configured
     */
    isConfigured(): boolean;
}
/**
 * Get the task management integration instance
 */
export declare function getTaskManagement(): TaskManagementIntegration;
export default TaskManagementIntegration;
