import { IStorageEventData } from '../../types.ts'; /** * Callback function type for event listeners. * @template T - The type of data passed to the callback */ export type Callback = (event: IStorageEventData) => void; export declare class Observer { private static eventRegistry; private static getRegistry; /** * Adds an event listener for the specified event. */ static on(event: string, callback: Callback): void; /** * Adds a one-time event listener that fires at most once and is then removed. */ static once(event: string, callback: Callback): void; /** * Removes a specific listener (from both regular and once registries). */ static off(event: string, callback: Callback): void; /** * Emits an event to all registered listeners. * * Guarantees: * - A throwing listener never blocks other listeners. * - A throwing listener never propagates the error into the caller of `set/remove/clear`. * - Mutating listener sets during emission is safe (iteration uses a snapshot). * - A recursive `emit` from inside a `once` callback will NOT re-fire the same once-listeners. */ static emit(event: string, data: IStorageEventData): void; /** * Removes every listener for every event on this class. */ static removeAllListeners(): void; /** * Removes every listener for a single event. */ static removeListener(event: string): void; /** * Total number of listeners (regular + once) for an event. */ static listenerCount(event: string): number; /** * All event names with at least one listener. */ static eventNames(): string[]; }