/**
 * Database Manager
 *
 * Central SQLite database manager for code-buddy.
 * Handles connection, migrations, and provides access to repositories.
 */
import Database from 'better-sqlite3';
import { TypedEventEmitter, DatabaseEvents } from '../events/index.js';
export interface DatabaseConfig {
    dbPath?: string;
    inMemory?: boolean;
    verbose?: boolean;
    walMode?: boolean;
}
export interface DatabaseStats {
    version: number;
    size: number;
    tables: string[];
    memoriesCount: number;
    sessionsCount: number;
    embeddingsCount: number;
    cacheSize: number;
}
/**
 * Database Manager
 *
 * Uses TypedEventEmitter for type-safe event handling.
 * Emits events: db:initialized, db:error, db:migration, db:vacuum,
 * db:backup, db:closed, db:cleared
 */
export declare class DatabaseManager extends TypedEventEmitter<DatabaseEvents> {
    private db;
    private config;
    private initialized;
    constructor(config?: Partial<DatabaseConfig>);
    /**
     * Initialize the database connection and run migrations
     */
    initialize(): Promise<void>;
    /**
     * Run database migrations
     */
    private runMigrations;
    /**
     * Get the database instance
     */
    getDatabase(): Database.Database;
    /**
     * Check if database is initialized
     */
    isInitialized(): boolean;
    /**
     * Get database statistics
     */
    getDatabaseStats(): DatabaseStats;
    /**
     * Format stats for display
     */
    formatStats(): string;
    /**
     * Execute a raw SQL query
     */
    exec(sql: string): void;
    /**
     * Prepare a statement
     */
    prepare(sql: string): Database.Statement;
    /**
     * Run in a transaction
     */
    transaction<T>(fn: () => T): T;
    /**
     * Vacuum the database to reclaim space
     */
    vacuum(): void;
    /**
     * Backup the database to a file
     */
    backup(destPath: string): Promise<void>;
    /**
     * Close the database connection
     */
    close(): void;
    /**
     * Clear all data (dangerous!)
     */
    clearAll(): void;
}
export declare function getDatabaseManager(config?: Partial<DatabaseConfig>): DatabaseManager;
export declare function initializeDatabase(config?: Partial<DatabaseConfig>): Promise<DatabaseManager>;
export declare function resetDatabaseManager(): void;
