/** * Tickets Command Types * * Type definitions for the tickets list command. */ /** * Tickets command options from Commander */ export interface TicketsOptions { /** Filter by epic ID */ epic?: string; /** Filter by status */ status?: TicketStatus; /** Filter by priority */ priority?: TicketPriority; /** Limit number of results */ limit?: string; /** Output as JSON */ json?: boolean; /** Output as TOON format */ toon?: boolean; } /** * Valid ticket statuses (matches API 4-state model) */ export type TicketStatus = 'pending' | 'ready' | 'active' | 'done'; /** * All valid ticket statuses */ export declare const VALID_STATUSES: TicketStatus[]; /** * Valid ticket priorities */ export type TicketPriority = 'critical' | 'high' | 'medium' | 'low'; /** * All valid ticket priorities */ export declare const VALID_PRIORITIES: TicketPriority[]; /** * Ticket data from API */ export interface Ticket { /** Ticket ID */ id: string; /** Sequential ticket number within specification */ ticketNumber: number; /** Ticket title */ title: string; /** Ticket priority */ priority: TicketPriority; /** Ticket status */ status: TicketStatus; /** Epic ID this ticket belongs to (optional) */ epicId?: string; /** Reason why the ticket is blocked (from API) */ blockReason?: string; /** List of ticket IDs that block this ticket (from dependency expansion) */ blockedBy?: string[]; /** Ticket description (optional) */ description?: string; /** Estimated complexity (optional) */ complexity?: string; } /** * API request for list_tickets */ export interface ListTicketsRequest { /** Specification ID */ specificationId: string; /** Filter by epic ID */ epicId?: string; /** Filter by status */ status?: TicketStatus; /** Filter by priority */ priority?: TicketPriority; /** Limit number of results */ limit?: number; } /** * API response for list_tickets */ export interface ListTicketsApiResponse { /** Array of tickets */ items: Ticket[]; /** Total count (for pagination) */ total?: number; } /** * API response for get_specification (used for header) */ export interface GetSpecificationApiResponse { /** Specification ID */ id: string; /** Specification title */ title: string; /** Project ID */ projectId: string; } /** * Tickets list response for output */ export interface TicketsListResponse { /** Specification title for display */ specification: string; /** Array of tickets */ tickets: Ticket[]; /** Applied filters (for display) */ filters?: { epic?: string; status?: string; priority?: string; }; } /** * Table column configuration */ export interface TicketTableColumn { /** Column header */ header: string; /** Column width */ width?: number; /** Alignment */ align?: 'left' | 'right' | 'center'; } /** * Default table columns for tickets */ export declare const TICKET_TABLE_COLUMNS: TicketTableColumn[]; /** * Priority display colors (chalk color names) */ export declare const PRIORITY_COLORS: Record; /** * Status display colors (chalk color names) */ export declare const STATUS_COLORS: Record; /** * Maximum title length for table display */ export declare const MAX_TITLE_LENGTH = 38; /** * Ticket number padding width */ export declare const TICKET_NUMBER_WIDTH = 3; /** * Format ticket number with leading zeros * * @param num Ticket number * @returns Formatted ticket number (e.g., "001", "042") */ export declare function formatTicketNumber(num: number): string; /** * Truncate title if too long for display * * @param title Ticket title * @param maxLength Maximum length (default: MAX_TITLE_LENGTH) * @returns Truncated title with ellipsis if needed */ export declare function truncateTitle(title: string, maxLength?: number): string; /** * Check if a ticket is blocked * * @param ticket Ticket to check * @returns True if ticket has blockers or a block reason */ export declare function isTicketBlocked(ticket: Ticket): boolean; /** * Validate status filter * * @param status Status to validate * @returns True if valid status */ export declare function isValidStatus(status: string): status is TicketStatus; /** * Validate priority filter * * @param priority Priority to validate * @returns True if valid priority */ export declare function isValidPriority(priority: string): priority is TicketPriority; /** * Get count of blocked tickets * * @param tickets Array of tickets * @returns Number of blocked tickets */ export declare function countBlockedTickets(tickets: Ticket[]): number; /** * Get tickets by status * * @param tickets Array of tickets * @param status Status to filter by * @returns Filtered tickets */ export declare function getTicketsByStatus(tickets: Ticket[], status: TicketStatus): Ticket[]; /** * Get tickets by priority * * @param tickets Array of tickets * @param priority Priority to filter by * @returns Filtered tickets */ export declare function getTicketsByPriority(tickets: Ticket[], priority: TicketPriority): Ticket[]; //# sourceMappingURL=tickets.types.d.ts.map