/**
 * Linear Issue ↔ PMO Ticket Mapper
 *
 * Converts Linear issues to PMO tickets and manages the mapping table.
 * Handles import (Linear → PMO) and reverse lookup for sync operations.
 */
import Database from 'better-sqlite3';
import type { CreateTicketInput, PMOStorage, WorkflowStatus } from '../pmo/types.js';
import type { LinearIssue, LinearIssueMap, LinearSyncResult } from './types.js';
export declare class LinearMapper {
    private db;
    private externalMappingStore;
    constructor(db: Database.Database);
    /**
     * Ensure the linear_issue_map table exists.
     * Uses CREATE TABLE IF NOT EXISTS to match the schema defined in schema.ts.
     */
    private ensureTable;
    /**
     * Convert a Linear issue to a PMO ticket creation input.
     * Finds the matching workflow status in the project's workflow.
     */
    issueToTicketInput(issue: LinearIssue, statuses: WorkflowStatus[]): CreateTicketInput;
    /**
     * Import a single Linear issue into PMO as a ticket.
     * Returns the PMO ticket ID if created, null if already mapped.
     */
    importIssue(issue: LinearIssue, projectId: string, storage: PMOStorage, statuses: WorkflowStatus[]): Promise<{
        ticketId: string;
        created: boolean;
    }>;
    /**
     * Batch import multiple Linear issues into PMO.
     */
    importIssues(issues: LinearIssue[], projectId: string, storage: PMOStorage, statuses: WorkflowStatus[]): Promise<LinearSyncResult>;
    /**
     * Create a mapping record.
     */
    createMapping(map: Omit<LinearIssueMap, 'lastSyncedAt'>): void;
    /**
     * Get a mapping by PMO ticket ID.
     */
    getByTicketId(ticketId: string): LinearIssueMap | null;
    /**
     * Get a mapping by Linear issue ID.
     */
    getByLinearId(linearIssueId: string): LinearIssueMap | null;
    /**
     * Get a mapping by Linear identifier (e.g., "ENG-123").
     */
    getByIdentifier(identifier: string): LinearIssueMap | null;
    /**
     * List all mappings.
     */
    listMappings(): LinearIssueMap[];
    /**
     * Update the last synced timestamp for a mapping.
     */
    updateSyncTimestamp(pmoTicketId: string): void;
    /**
     * Delete a mapping by PMO ticket ID.
     */
    deleteMapping(pmoTicketId: string): void;
    /**
     * Convert a database row to a LinearIssueMap.
     */
    private rowToMap;
    private externalMappingToLinearMap;
}
