import * as plugins from '../plugins.js'; /** * Configuration options for the unified DCRouter database */ export interface IDcRouterDbConfig { /** External MongoDB connection URL. If absent, uses embedded LocalSmartDb. */ mongoDbUrl?: string; /** Storage path for embedded LocalSmartDb data (default: ~/.serve.zone/dcrouter/tsmdb) */ storagePath?: string; /** Database name (default: dcrouter) */ dbName?: string; /** Enable debug logging */ debug?: boolean; } /** * DcRouterDb - Unified database layer for DCRouter * * Replaces both StorageManager (flat-file key-value) and CacheDb (embedded MongoDB). * All data is stored as smartdata document classes in a single database. * * Two modes: * - **Embedded** (default): Spawns a LocalSmartDb (Rust-based MongoDB-compatible engine) * - **External**: Connects to a provided MongoDB URL */ export declare class DcRouterDb { private static instance; private localSmartDb; private smartdataDb; private options; private isStarted; constructor(options?: IDcRouterDbConfig); /** * Get or create the singleton instance */ static getInstance(options?: IDcRouterDbConfig): DcRouterDb; /** * Reset the singleton instance (useful for testing) */ static resetInstance(): void; /** * Start the database * - If mongoDbUrl is provided, connects directly to external MongoDB * - Otherwise, starts an embedded LocalSmartDb instance */ start(): Promise; /** * Stop the database */ stop(): Promise; /** * Get the smartdata database instance for @Collection decorators */ getDb(): plugins.smartdata.SmartdataDb; /** * Check if the database is ready */ isReady(): boolean; /** * Whether running in embedded mode (LocalSmartDb) vs external MongoDB */ isEmbedded(): boolean; /** * Get the storage path (only relevant for embedded mode) */ getStoragePath(): string; /** * Get the database name */ getDbName(): string; }