/** * Ticket reference auto-detection utility. * * Parses various ticket reference formats and returns a normalized TicketRef. * Supports GitHub, Jira, Shortcut, and local provider formats. * * @example * ```typescript * import { detectTicketRef } from './detect-ticket-ref.js'; * * // GitHub URLs * detectTicketRef('https://github.com/owner/repo/issues/123', 'github'); * // => { provider: 'github', id: '123', url: '...', raw: '...' } * * // GitHub shorthand * detectTicketRef('#123', 'github'); * // => { provider: 'github', id: '123', raw: '#123' } * * // Jira format * detectTicketRef('PROJ-123', 'github'); * // => { provider: 'jira', id: 'PROJ-123', raw: 'PROJ-123' } * ``` */ import type { TicketRef } from '../types/ticket.js'; import type { BacklogProviderName } from '../providers/types.js'; /** * Detect a ticket reference from user input. * * Parses various ticket reference formats and returns a normalized TicketRef. * Detection order: * 1. Full URLs (most specific) - check domain * 2. Provider-specific formats (e.g., PROJ-123 for Jira) * 3. Ambiguous formats (e.g., #123) - use default provider * * @param input - User-provided ticket reference string * @param defaultProvider - Provider to use for ambiguous references like #123 * @returns Parsed TicketRef or null if input is invalid * * @example * ```typescript * // GitHub URL * detectTicketRef('https://github.com/owner/repo/issues/123', 'github'); * // => { provider: 'github', id: '123', url: '...', raw: '...' } * * // Ambiguous shorthand uses default provider * detectTicketRef('#123', 'github'); * // => { provider: 'github', id: '123', raw: '#123' } * * // Invalid input * detectTicketRef('invalid', 'github'); * // => null * ``` */ export declare function detectTicketRef(input: string, defaultProvider: BacklogProviderName): TicketRef | null; //# sourceMappingURL=detect-ticket-ref.d.ts.map