@dqcai/sqlite
Version:
Universal SQLite adapter for Node.js, Browser, Deno, Bun, and React Native with a unified API and query builder.
81 lines • 2.93 kB
TypeScript
import { BaseModule, UniversalLogger } from "@dqcai/logger";
export { BaseModule };
export declare enum SQLiteModules {
DATABASE_MANAGER = "DatabaseManager",
DATABASE_FACTORY = "DatabaseFactory",
UNIVERSAL_DAO = "UniversalDAO",
BASE_SERVICE = "BaseService",
SERVICE_MANAGER = "ServiceManager",
QUERY_BUILDER = "QueryBuilder",
BASE_ADAPTER = "BaseAdapter",
UNIVERSAL_SQLITE = "UniversalSQLite",
TRANSACTION = "Transaction",
CONNECTION = "Connection"
}
interface ModuleLogger {
trace: (message: string, ...args: any[]) => void;
debug: (message: string, ...args: any[]) => void;
info: (message: string, ...args: any[]) => void;
warn: (message: string, ...args: any[]) => void;
error: (message: string, ...args: any[]) => void;
}
/**
* Logger Proxy - always delegates to current logger instance
*/
declare class LoggerProxy implements ModuleLogger {
private moduleName;
constructor(moduleName: string);
trace(message: string, ...args: any[]): void;
debug(message: string, ...args: any[]): void;
info(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
}
/**
* Enhanced SQLite Logger Configuration with automatic update support
*/
export declare class SQLiteLoggerConfig {
private static instance;
private static currentConfig;
static proxyInstances: Map<string, LoggerProxy>;
static createDefaultConfig(): import("@dqcai/logger").LoggerConfig;
static initialize(customConfig?: any): UniversalLogger;
static getInstance(): UniversalLogger;
/**
* Update configuration - proxy pattern automatically handles updates
*/
static updateConfiguration(newConfig: any): void;
static setEnabled(enabled: boolean): void;
static enableModule(moduleName: string, levels?: string[], appenders?: string[]): void;
static disableModule(moduleName: string): void;
static createDebugConfig(): import("@dqcai/logger").LoggerConfig;
static createProductionConfig(): import("@dqcai/logger").LoggerConfig;
static reset(): UniversalLogger;
/**
* Get active proxy modules
*/
static getActiveProxyModules(): string[];
/**
* Get current configuration (for debugging)
*/
static getCurrentConfig(): any;
}
export declare const sqliteLogger: UniversalLogger;
/**
* Create module logger using proxy pattern - automatically updates when configuration changes
*/
export declare const createModuleLogger: (moduleName: string) => ModuleLogger;
/**
* Utility functions for testing and debugging
*/
export declare const LoggerUtils: {
/**
* Test if a module logger responds to configuration changes
*/
testDynamicUpdate: (moduleName: string) => void;
/**
* Show current logger statistics
*/
showStats: () => void;
};
//# sourceMappingURL=logger-config.d.ts.map