/**
 * SQLite Storage Implementation for PMO
 *
 * This is the main facade that delegates to domain-specific storage modules.
 * Uses the unified workspace.db database with pmo_ prefixed tables.
 *
 * This module now supports Drizzle ORM for type-safe queries while maintaining
 * backward compatibility with raw SQL queries during the migration period.
 */
import Database from 'better-sqlite3';
import { DrizzleDB } from '../../database/drizzle.js';
import { AcceptanceCriterion, Board, BoardConfig, BoardView, BoardViewFilter, BoardViewFilters, Category, CategoryFilter, CategoryType, Column, CreateTicketInput, Epic, EpicDependency, EpicDependencyType, EpicFilter, PhaseFilter, PhaseTemplate, PhaseTemplateFilter, PMOStorage, Project, ProjectFilter, ProjectPhase, Roadmap, RoadmapFilter, RoadmapProject, Spec, SpecDependency, SpecDependencyType, SpecFilter, StateCategory, Subtask, SyncResult, SyncStatus, Ticket, TicketDependency, TicketDependencyType, TicketFilter, TicketTemplate, TicketTemplateFilter, WorkAction, WorkActionFilter, Workflow, WorkflowFilter, WorkflowStatus, Label, LabelFilter, LabelGroup, LabelGroupFilter } from '../types.js';
export declare class SQLiteStorage implements PMOStorage {
    readonly type: "sqlite";
    private db;
    private drizzle;
    private dbPath;
    private projectStorage;
    private ticketStorage;
    private subtaskStorage;
    private acceptanceCriteriaStorage;
    private specStorage;
    private epicStorage;
    private dependencyStorage;
    private statusStorage;
    private templateStorage;
    private phaseStorage;
    private actionStorage;
    private viewStorage;
    private roadmapStorage;
    private categoryStorage;
    private labelStorage;
    constructor(dbPath: string);
    /**
     * Get the underlying database connection.
     */
    getDatabase(): Database.Database;
    /**
     * Get the Drizzle ORM database connection for type-safe queries.
     */
    getDrizzle(): DrizzleDB;
    /**
     * Ensure PMO tables exist in the database.
     */
    private ensurePMOTables;
    init(projectId: string, config: BoardConfig): Promise<Board>;
    getBoard(projectId: string): Promise<Board>;
    getBoardMarkdown(projectId: string): Promise<string>;
    getColumnNames(projectId: string): string[];
    createColumn(projectId: string, name: string, position?: number): Promise<Column>;
    renameColumn(projectId: string, id: string, name: string): Promise<Column>;
    moveColumn(projectId: string, id: string, position: number): Promise<Column>;
    deleteColumn(projectId: string, id: string, _cascade?: boolean): Promise<void>;
    createTicket(projectId: string, ticket: CreateTicketInput): Promise<Ticket>;
    getTicket(id: string): Promise<Ticket | null>;
    getTicketById(id: string): Promise<Ticket | null>;
    updateTicket(id: string, changes: Partial<Ticket>): Promise<Ticket>;
    moveTicket(projectId: string, id: string, column: string, position?: number): Promise<Ticket>;
    reorderTicket(id: string, opts: {
        position?: number;
        afterTicketId?: string;
    }): Promise<Ticket>;
    moveTicketToProject(ticketId: string, newProjectId: string): Promise<Ticket>;
    deleteTicket(id: string): Promise<void>;
    listTickets(projectId: string | undefined, filter?: TicketFilter): Promise<Ticket[]>;
    addSubtask(ticketId: string, title: string): Promise<Subtask>;
    toggleSubtask(ticketId: string, subtaskId: string): Promise<Subtask>;
    removeSubtask(ticketId: string, subtaskId: string): Promise<void>;
    addAcceptanceCriterion(ticketId: string, criterion: string): Promise<AcceptanceCriterion>;
    removeAcceptanceCriterion(ticketId: string, criterionId: string): Promise<void>;
    clearAcceptanceCriteria(ticketId: string): Promise<void>;
    createSpec(spec: Partial<Spec>): Promise<Spec>;
    getSpec(id: string): Promise<Spec | null>;
    listSpecs(filter?: SpecFilter): Promise<Spec[]>;
    updateSpec(id: string, changes: Partial<Spec>): Promise<Spec>;
    deleteSpec(id: string): Promise<void>;
    linkTicketToSpec(ticketId: string, specId: string): Promise<void>;
    unlinkTicketFromSpec(ticketId: string, specId: string): Promise<void>;
    getTicketsForSpec(projectId: string, specId: string): Promise<Ticket[]>;
    getSpecsForTicket(ticketId: string): Promise<Spec[]>;
    addSpecDependency(specId: string, dependsOnId: string): Promise<void>;
    removeSpecDependency(specId: string, dependsOnId: string): Promise<void>;
    getSpecDependencies(specId: string): Promise<Spec[]>;
    getSpecDependents(specId: string): Promise<Spec[]>;
    linkProjectToSpec(projectId: string, specId: string): Promise<void>;
    unlinkProjectFromSpec(projectId: string, specId: string): Promise<void>;
    getSpecsForProject(projectId: string): Promise<Spec[]>;
    getProjectsForSpec(specId: string): Promise<Project[]>;
    createEpic(projectId: string, epic: Partial<Epic>): Promise<Epic>;
    getEpic(id: string): Promise<Epic | null>;
    listEpics(projectId: string, filter?: EpicFilter): Promise<Epic[]>;
    reorderEpic(projectId: string, epicId: string, newPosition: number): Promise<Epic>;
    updateEpic(id: string, changes: Partial<Epic>): Promise<Epic>;
    deleteEpic(id: string): Promise<void>;
    getTicketsForEpic(projectId: string, epicId: string): Promise<Ticket[]>;
    linkTicketToEpic(ticketId: string, epicId: string): Promise<void>;
    unlinkTicketFromEpic(ticketId: string): Promise<void>;
    createTicketDependency(ticketId: string, dependsOnId: string, type?: TicketDependencyType): Promise<TicketDependency>;
    deleteTicketDependency(ticketId: string, dependsOnId: string, type?: TicketDependencyType): Promise<void>;
    listTicketDependencies(ticketId: string): Promise<TicketDependency[]>;
    getTicketBlockers(ticketId: string): Promise<Ticket[]>;
    getTicketsBlockedBy(ticketId: string): Promise<Ticket[]>;
    isTicketBlocked(ticketId: string): Promise<boolean>;
    createSpecDependency(specId: string, dependsOnId: string, type?: SpecDependencyType): Promise<SpecDependency>;
    deleteSpecDependency(specId: string, dependsOnId: string, type?: SpecDependencyType): Promise<void>;
    listSpecDependencies(specId: string): Promise<SpecDependency[]>;
    createEpicDependency(epicId: string, dependsOnId: string, type?: EpicDependencyType): Promise<EpicDependency>;
    deleteEpicDependency(epicId: string, dependsOnId: string, type?: EpicDependencyType): Promise<void>;
    listEpicDependencies(epicId: string): Promise<EpicDependency[]>;
    isEpicBlocked(epicId: string): Promise<boolean>;
    listWorkflows(filter?: WorkflowFilter): Promise<Workflow[]>;
    getWorkflow(id: string): Promise<Workflow | null>;
    createWorkflow(workflow: Partial<Workflow>): Promise<Workflow>;
    updateWorkflow(id: string, changes: Partial<Workflow>): Promise<Workflow>;
    deleteWorkflow(id: string): Promise<void>;
    getProjectWorkflow(projectId: string): Promise<Workflow | null>;
    listStatuses(workflowId: string): Promise<WorkflowStatus[]>;
    getStatus(id: string): Promise<WorkflowStatus | null>;
    createStatus(workflowId: string, status: Partial<WorkflowStatus>): Promise<WorkflowStatus>;
    updateStatus(id: string, changes: Partial<WorkflowStatus>): Promise<WorkflowStatus>;
    deleteStatus(id: string): Promise<void>;
    reorderStatus(id: string, newPosition: number): Promise<WorkflowStatus>;
    getDefaultStatus(workflowId: string): Promise<WorkflowStatus | null>;
    listTicketTemplates(filter?: TicketTemplateFilter): Promise<TicketTemplate[]>;
    getTicketTemplate(id: string): Promise<TicketTemplate | null>;
    createTicketTemplate(template: Partial<TicketTemplate> & {
        name: string;
    }): Promise<TicketTemplate>;
    createTicketTemplateFromTicket(ticketId: string, name: string, description?: string): Promise<TicketTemplate>;
    updateTicketTemplate(id: string, changes: Partial<TicketTemplate>): Promise<TicketTemplate>;
    deleteTicketTemplate(id: string): Promise<void>;
    listPhases(filter?: PhaseFilter): Promise<ProjectPhase[]>;
    getPhase(id: string): Promise<ProjectPhase | null>;
    createPhase(phase: Partial<ProjectPhase>): Promise<ProjectPhase>;
    updatePhase(id: string, changes: Partial<ProjectPhase>): Promise<ProjectPhase>;
    deletePhase(id: string): Promise<void>;
    reorderPhase(id: string, newPosition: number): Promise<ProjectPhase>;
    getDefaultPhase(): Promise<ProjectPhase | null>;
    listPhaseTemplates(filter?: PhaseTemplateFilter): Promise<PhaseTemplate[]>;
    getPhaseTemplate(id: string): Promise<PhaseTemplate | null>;
    applyPhaseTemplate(templateId: string): Promise<ProjectPhase[]>;
    savePhaseTemplate(name: string, description?: string): Promise<PhaseTemplate>;
    updatePhaseTemplate(id: string, changes: {
        name?: string;
        description?: string;
    }): Promise<PhaseTemplate>;
    deletePhaseTemplate(id: string): Promise<void>;
    listActions(filter?: WorkActionFilter): Promise<WorkAction[]>;
    getAction(id: string): Promise<WorkAction | null>;
    createAction(action: Partial<WorkAction>): Promise<WorkAction>;
    updateAction(id: string, changes: Partial<WorkAction>): Promise<WorkAction>;
    deleteAction(id: string): Promise<void>;
    getSuggestedAction(category: StateCategory): Promise<WorkAction | null>;
    createProject(project: {
        id?: string;
        name: string;
        template?: string;
        description?: string;
    }): Promise<Board>;
    getProjectBoard(projectId: string): Promise<Board | null>;
    listProjectSummaries(): Promise<Array<{
        id: string;
        name: string;
        template: string | null;
        description: string | null;
        ticketCount: number;
    }>>;
    deleteProject(projectId: string): Promise<void>;
    getProject(id: string): Promise<Project | null>;
    updateProject(id: string, changes: Partial<Project>): Promise<Project>;
    listProjects(filter?: ProjectFilter): Promise<Project[]>;
    archiveProject(id: string): Promise<Project>;
    unarchiveProject(id: string): Promise<Project>;
    listBoardViews(filter?: BoardViewFilter): Promise<BoardView[]>;
    getBoardView(id: string): Promise<BoardView | null>;
    createBoardView(view: Partial<BoardView>): Promise<BoardView>;
    updateBoardView(id: string, changes: Partial<BoardView>): Promise<BoardView>;
    deleteBoardView(id: string): Promise<void>;
    getDefaultBoardView(projectId: string): Promise<BoardView | null>;
    getBoardWithView(projectId: string, viewId?: string, filters?: BoardViewFilters): Promise<Board>;
    listRoadmaps(filter?: RoadmapFilter): Promise<Roadmap[]>;
    getRoadmap(id: string): Promise<Roadmap | null>;
    createRoadmap(roadmap: Partial<Roadmap> & {
        name: string;
    }): Promise<Roadmap>;
    updateRoadmap(id: string, changes: Partial<Roadmap>): Promise<Roadmap>;
    deleteRoadmap(id: string): Promise<void>;
    getDefaultRoadmap(): Promise<Roadmap | null>;
    setDefaultRoadmap(id: string): Promise<Roadmap>;
    listRoadmapProjects(roadmapId: string): Promise<Project[]>;
    addProjectToRoadmap(roadmapId: string, projectId: string, position?: number): Promise<RoadmapProject>;
    removeProjectFromRoadmap(roadmapId: string, projectId: string): Promise<void>;
    reorderRoadmapProject(roadmapId: string, projectId: string, newPosition: number): Promise<RoadmapProject>;
    getRoadmapsForProject(projectId: string): Promise<Roadmap[]>;
    listCategories(filter?: CategoryFilter): Promise<Category[]>;
    getCategory(id: string): Promise<Category | null>;
    getCategoryByName(name: string, type: CategoryType): Promise<Category | null>;
    createCategory(category: Partial<Category> & {
        name: string;
        type: CategoryType;
    }): Promise<Category>;
    updateCategory(id: string, changes: Partial<Category>): Promise<Category>;
    renameCategory(id: string, newName: string): Promise<Category>;
    deleteCategory(id: string): Promise<void>;
    getCategoryNames(type: CategoryType): Promise<string[]>;
    isValidCategory(name: string, type: CategoryType): Promise<boolean>;
    listLabelGroups(filter?: LabelGroupFilter): Promise<LabelGroup[]>;
    getLabelGroup(id: string): Promise<LabelGroup | null>;
    getLabelGroupByName(name: string): Promise<LabelGroup | null>;
    createLabelGroup(group: Partial<LabelGroup> & {
        name: string;
    }): Promise<LabelGroup>;
    updateLabelGroup(id: string, changes: Partial<LabelGroup>): Promise<LabelGroup>;
    deleteLabelGroup(id: string): Promise<void>;
    listLabels(filter?: LabelFilter): Promise<Label[]>;
    getLabel(id: string): Promise<Label | null>;
    getLabelByName(name: string, groupId?: string): Promise<Label | null>;
    createLabel(label: Partial<Label> & {
        name: string;
    }): Promise<Label>;
    updateLabel(id: string, changes: Partial<Label>): Promise<Label>;
    deleteLabel(id: string): Promise<void>;
    addLabelToTicket(ticketId: string, labelId: string): Promise<void>;
    removeLabelFromTicket(ticketId: string, labelId: string): Promise<void>;
    getLabelsForTicket(ticketId: string): Promise<Label[]>;
    addLabelToTicketByName(ticketId: string, labelName: string): Promise<void>;
    removeLabelFromTicketByName(ticketId: string, labelName: string): Promise<void>;
    pull(): Promise<SyncResult>;
    push(): Promise<SyncResult>;
    status(): Promise<SyncStatus>;
    rebuildFromBoard(board: Board): void;
    /**
     * Infer a status category from column name or position.
     */
    private inferCategoryFromColumnName;
    close(): Promise<void>;
    getCacheMetadata(): {
        boardMtime: number;
        cacheBuiltAt: number;
        contentHash?: string;
    } | null;
    setCacheMetadata(metadata: {
        boardMtime: number;
        cacheBuiltAt: number;
        contentHash?: string;
    }): void;
    clearCache(): void;
}
export { SQLiteStorage as default };
