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; /** * Base observer class that provides event emitter functionality for state management classes. * Uses a registry pattern to maintain separate event systems for each inheriting class. */ export declare class Observer { private static eventRegistry; /** * Gets or creates the event registry for a specific class * @param target - The class constructor function * @returns The event registry for the target class */ private static getRegistry; /** * Adds an event listener for the specified event * @template T - The type of data passed to the callback * @param event - The name of the event to listen for * @param callback - The callback function to execute when the event is emitted */ static on(event: string, callback: Callback): void; /** * Adds a one-time event listener for the specified event * @template T - The type of data passed to the callback * @param event - The name of the event to listen for * @param callback - The callback function to execute once when the event is emitted */ static once(event: string, callback: Callback): void; /** * Removes an event listener for the specified event * @template T - The type of data passed to the callback * @param event - The name of the event * @param callback - The callback function to remove */ static off(event: string, callback: Callback): void; /** * Emits an event with the given data to all registered listeners * @template T - The type of data being emitted * @param event - The name of the event to emit * @param data - The data to pass to the event listeners */ static emit(event: string, data: IStorageEventData): void; /** * Removes all event listeners for all events */ static removeAllListeners(): void; /** * Removes all listeners for a specific event * @param event - The name of the event */ static removeListener(event: string): void; /** * Gets the number of listeners for a specific event * @param event - The name of the event * @returns The total number of listeners (regular + once) */ static listenerCount(event: string): number; /** * Gets an array of all event names that have listeners * @returns Array of event names */ static eventNames(): (string | symbol)[]; }