import { Ticket, TicketFilter } from '../../types/index.js';
import { ContinuationTrackingData, IterationRecord, QualityGates, QualityGateStatus } from '../../types/task-tracking.types.js';
export interface Subtask {
    id: string;
    title: string;
    completed: boolean;
    createdAt: string;
    updatedAt: string;
}
export interface ExtendedTicket extends Omit<Ticket, 'projectId'> {
    tags?: string[];
    subtasks: Subtask[];
    dueDate?: string;
    estimatedHours?: number;
    actualHours?: number;
    /** Continuation tracking data */
    continuation?: ContinuationTrackingData;
    /** Quality gate statuses */
    qualityGates?: QualityGates;
}
export interface TicketTemplate {
    title: string;
    description: string;
    priority: 'low' | 'medium' | 'high' | 'critical';
    status: 'open' | 'in_progress' | 'review' | 'done' | 'blocked';
    assignedTo?: string;
    tags?: string[];
    subtasks?: Array<{
        title: string;
        completed: boolean;
    }>;
    dueDate?: string;
    estimatedHours?: number;
}
export declare class TicketEditorService {
    private ticketsDir;
    private readonly logger;
    constructor(projectPath?: string);
    ensureTicketsDirectory(): Promise<void>;
    createTicket(template: TicketTemplate): Promise<ExtendedTicket>;
    updateTicket(ticketId: string, updates: Partial<TicketTemplate>): Promise<ExtendedTicket>;
    getTicket(ticketId: string): Promise<ExtendedTicket | null>;
    getAllTickets(filter?: TicketFilter): Promise<ExtendedTicket[]>;
    deleteTicket(ticketId: string): Promise<boolean>;
    addSubtask(ticketId: string, subtaskTitle: string): Promise<ExtendedTicket | null>;
    toggleSubtask(ticketId: string, subtaskId: string): Promise<ExtendedTicket | null>;
    getTicketsByAssignee(assignedTo: string): Promise<ExtendedTicket[]>;
    getTicketsByStatus(status: string): Promise<ExtendedTicket[]>;
    getTicketsByPriority(priority: string): Promise<ExtendedTicket[]>;
    createTicketTemplate(name: string, template: TicketTemplate): Promise<void>;
    getTicketTemplate(name: string): Promise<TicketTemplate | null>;
    getAllTemplates(): Promise<string[]>;
    /**
     * Increment the iteration count for a ticket
     *
     * @param ticketId - Ticket identifier
     * @param record - Iteration record (timestamp will be added)
     * @returns New iteration count
     */
    incrementIteration(ticketId: string, record: Omit<IterationRecord, 'timestamp'>): Promise<number>;
    /**
     * Set the maximum iterations for a ticket
     *
     * @param ticketId - Ticket identifier
     * @param max - Maximum iterations allowed
     */
    setMaxIterations(ticketId: string, max: number): Promise<void>;
    /**
     * Get the iteration count for a ticket
     *
     * @param ticketId - Ticket identifier
     * @returns Current and max iteration counts
     */
    getIterationCount(ticketId: string): Promise<{
        current: number;
        max: number;
    }>;
    /**
     * Get the iteration history for a ticket
     *
     * @param ticketId - Ticket identifier
     * @returns Iteration history
     */
    getIterationHistory(ticketId: string): Promise<IterationRecord[]>;
    /**
     * Reset iterations for a ticket (e.g., when re-assigning)
     *
     * @param ticketId - Ticket identifier
     */
    resetIterations(ticketId: string): Promise<void>;
    /**
     * Update the status of a quality gate
     *
     * @param ticketId - Ticket identifier
     * @param gateName - Gate name (typecheck, tests, lint, build, or custom)
     * @param status - Gate status
     */
    updateQualityGate(ticketId: string, gateName: string, status: Omit<QualityGateStatus, 'lastRun'>): Promise<void>;
    /**
     * Get all quality gates for a ticket
     *
     * @param ticketId - Ticket identifier
     * @returns Quality gates
     */
    getQualityGates(ticketId: string): Promise<QualityGates>;
    /**
     * Check if all required quality gates are passing
     *
     * @param ticketId - Ticket identifier
     * @returns True if all required gates pass
     */
    areAllGatesPassing(ticketId: string): Promise<boolean>;
    /**
     * Get failed quality gates
     *
     * @param ticketId - Ticket identifier
     * @returns Array of failed gate names and statuses
     */
    getFailedGates(ticketId: string): Promise<Array<{
        name: string;
        status: QualityGateStatus;
    }>>;
    /**
     * Initialize quality gates with default values
     *
     * @param ticketId - Ticket identifier
     */
    initializeQualityGates(ticketId: string): Promise<void>;
}
//# sourceMappingURL=ticket-editor.service.d.ts.map