import type { IPluginStorage } from "../types"; /** * JsonPluginStorage con soporte singleton para evitar múltiples instancias del mismo plugin. * Usa un Map estático para almacenar las instancias por nombre de plugin y basePath. */ export declare class JsonPluginStorage implements IPluginStorage { private static instances; private filePath; private data; private lastModified; private watcher; private watchDebounceTimer; private onDataChangeCallbacks; /** * Obtiene una instancia singleton de JsonPluginStorage. * Si la instancia ya existe para el plugin dado, la reutiliza. * @param basePath Ruta base del storage * @param pluginName Nombre del plugin * @returns Instancia de JsonPluginStorage */ static getInstance(basePath: string, pluginName: string): JsonPluginStorage; /** * Obtiene todas las instancias registradas. */ static getAllInstances(): Map; /** * Obtiene una instancia específica por nombre de plugin. * @param pluginName Nombre del plugin * @returns Instancia o undefined si no existe */ static getInstanceByName(pluginName: string): JsonPluginStorage | undefined; /** * Elimina una instancia específica. * @param basePath Ruta base del storage * @param pluginName Nombre del plugin */ static removeInstance(basePath: string, pluginName: string): void; /** * Limpia todas las instancias (útil para testing). */ static clearAllInstances(): void; private constructor(); private ensureLoaded; private save; get(key: string, defaultValue?: T): Promise; set(key: string, value: T): Promise; delete(key: string): Promise; clear(): Promise; reload(): Promise; /** * init watch for storage file changes * When the file changes externally, the data will be reloaded automatically. * @param debounceMs Time to wait in ms before reloading (default: 100ms) */ startWatching(debounceMs?: number): void; /** * stop watching for storage file changes */ stopWatching(): void; /** * register a callback that will be called when the storage data changes. * @param callback function to call when the data changes * @returns function to cancel the subscription */ onDataChange(callback: (data: Record) => void): () => void; /** * notify all subscribers about data changes. */ private notifyDataChange; /** * check if the storage is being watched. */ isWatching(): boolean; } //# sourceMappingURL=JsonPluginStorage.d.ts.map