web-push-notifications
Version:
Pushwoosh web push notifications
11 lines (10 loc) • 563 B
TypeScript
import { type EventHandlerMap, type EventName } from '../../events.types';
export declare class EventBus {
private readonly handlers;
constructor();
addEventHandler: <Name extends EventName = EventName>(name: Name, handler: EventHandlerMap[Name]) => void;
removeEventHandler: <Name extends EventName = EventName>(name: Name, handler: EventHandlerMap[Name]) => void;
dispatchEvent: <Name extends EventName = EventName>(name: Name, payload: Omit<Parameters<EventHandlerMap[Name]>[0], "eventId"> & {
eventId?: string;
}) => string;
}