import { EventCallback } from '../types'; export declare class EventManager { /** * All active listener functions. */ private cache; /** * Has event listener or not. * @param name * The event name. * @eventProperty */ has(name: Name): boolean; /** * Syntax sugar for off and on. * @param name * The event name. * @param category * The event category that used to distinguish event sources. * @param fn * The listener instance. * @eventProperty */ onWithOff(name: Name, category: string, fn: Callback): void; /** * Register listener for specific event. * @see onWithOff */ on(name: Name, fn: Callback): void; on(name: Name, category: string, fn: Callback): void; /** * Register listener that will be destroy after fire. * @see onWithOff */ once(name: Name, fn: Callback): void; once(name: Name, category: string, fn: Callback): void; /** * Unregister listener for specific event. * @see onWithOff */ off(name: Name): void; off(name: Name, fn: Callback): void; off(name: Name, category: string): void; /** * Trigger registered listeners. * @param name * The event name. * @param args * The arguments for listener. * @eventProperty */ fire(name: Name, ...args: Parameters): void; } /** * Replay the events of the source on the target. * @param target * The target `EventManager`. * @param sources * The group of `EventManager`. * @param filter * Only the name that meet the conditions can be triggered in a chain. * @remarks * Note that source-related events cannot be triggered on the target, * otherwise it will fall into an infinite loop. */ export declare function bindEventManager(target: EventManager, sources: EventManager[], filter: (name: string) => boolean): void;