/**
 * Ticket operations for PMO.
 * Tickets reference workflow statuses directly via status_id.
 * Tickets have a position column for force-ranked ordering within a status.
 * Positions use gapped integers (1000, 2000, 3000...) for stable reordering.
 *
 * This module uses Drizzle ORM for type-safe database queries.
 */
import { CreateTicketInput, Ticket, TicketFilter } from '../types.js';
import { StorageContext } from './types.js';
export declare class TicketStorage {
    private ctx;
    constructor(ctx: StorageContext);
    /**
     * Validate a category against the DB.
     * Returns the valid category name if found, throws error if invalid.
     */
    private validateCategory;
    /**
     * Resolve a project identifier to its actual ID.
     * Tries multiple strategies:
     * 1. Exact ID match
     * 2. Case-insensitive ID match
     * 3. Exact name match
     * 4. Case-insensitive name match
     * 5. Slugified name match
     */
    private resolveProjectId;
    /**
     * Create a new ticket.
     * Gets default status from the project's workflow.
     */
    createTicket(projectId: string, ticket: CreateTicketInput): Promise<Ticket>;
    /**
     * Get a ticket by ID.
     */
    getTicket(id: string): Promise<Ticket | null>;
    /**
     * Get a ticket by ID (internal).
     * Looks up by ticket ID only - no project scoping required since ticket IDs are globally unique.
     * Joins workflow_statuses to get column name (status name is the column).
     */
    getTicketById(id: string): Promise<Ticket | null>;
    /**
     * Update a ticket.
     * Works with ticket ID only - no project context required since ticket IDs are globally unique.
     */
    updateTicket(id: string, changes: Partial<Ticket>): Promise<Ticket>;
    /**
     * Update the timestamp for a specific project.
     */
    private updateProjectTimestamp;
    /**
     * Move a ticket to a different status (column).
     * In the workflow-based system, columns ARE statuses.
     * If position is provided, the ticket is placed at that position.
     * Otherwise, the ticket is appended to the end of the target status.
     */
    moveTicket(projectId: string, id: string, column: string, position?: number): Promise<Ticket>;
    /**
     * Reorder a ticket within its current status.
     * Supports two modes:
     * 1. Direct position: set ticket to a specific position value
     * 2. After ticket: place ticket immediately after another ticket
     */
    reorderTicket(id: string, opts: {
        position?: number;
        afterTicketId?: string;
    }): Promise<Ticket>;
    /**
     * Re-gap positions for all tickets in a status using 1000-gaps.
     * Optionally excludes a ticket (e.g., the one being moved).
     */
    private regapPositions;
    /**
     * Delete a ticket.
     * Works with ticket ID only - no project context required since ticket IDs are globally unique.
     */
    deleteTicket(id: string): Promise<void>;
    /**
     * List tickets with optional filters.
     * @param projectIdOrName - The project ID, name, or slug to filter by. Pass undefined to list all tickets across all projects.
     * @param filter - Additional filters to apply.
     */
    listTickets(projectIdOrName: string | undefined, filter?: TicketFilter): Promise<Ticket[]>;
    /**
     * Move a ticket to a different project.
     * The ticket will get the default status from the target project's workflow.
     */
    moveTicketToProject(ticketId: string, newProjectId: string): Promise<Ticket>;
}
