import { SWRKey } from './key';
export type SWRListener = (payload: any) => void;
export interface SWREventManager {
    subscribe(key: SWRKey, listener: SWRListener): void;
    unsubscribe(key: SWRKey, listener: SWRListener): void;
    emit<D = any>(key: SWRKey, payload: D): void;
}
/**
 * Default event manager class.
 */
export declare class DefaultSWREventManager implements SWREventManager {
    /**
     * Stores the list of active listener.s
     */
    protected readonly listeners: Map<SWRKey, SWRListener[]>;
    /**
     * Subscribes a given listener.
     */
    subscribe(key: SWRKey, listener: SWRListener): void;
    /**
     * Unsubscribes the given listener.
     */
    unsubscribe(key: SWRKey, listener: SWRListener): void;
    /**
     * Emits an event to all active listeners.
     */
    emit<D = any>(key: SWRKey, payload: D): void;
}
