/** * High-performance event manager using Maps for O(1) lookups. * Replaces React Native's EventEmitter which has significant overhead. */ export type EventHandler = (...args: T) => void; export interface EventSubscription { readonly unsubscribe: () => void; } declare class EventManager { private _handlers; private _nextId; /** * Subscribe to an event with a handler function. * Returns a subscription object with an unsubscribe method. */ subscribe(name: string, handler: EventHandler): EventSubscription; /** * Publish an event with optional arguments. * All subscribed handlers will be called synchronously. */ publish(name: string, ...args: T): void; /** * Publish an event asynchronously using microtasks for better performance. * Useful when you don't need immediate execution. */ publishAsync(name: string, ...args: T): void; /** * Check if an event has any subscribers. */ hasSubscribers(name: string): boolean; /** * Get the number of subscribers for an event. */ subscriberCount(name: string): number; /** * Remove all listeners for the specified event names. */ remove(...names: string[]): void; /** * Remove all event listeners. */ clear(): void; /** * Subscribe to an event that will only fire once. */ once(name: string, handler: EventHandler): EventSubscription; } export declare const eventManager: EventManager; export default EventManager; //# sourceMappingURL=events.d.ts.map