import type { EVENTS } from "./constants"; import type { ToastOptionsAndRequiredContent, ToastID, ToastContent, ToastOptions, PluginOptions } from "../types/index"; declare type EventData = { [EVENTS.ADD]: ToastOptionsAndRequiredContent & { id: ToastID; }; [EVENTS.CLEAR]: undefined; [EVENTS.DISMISS]: ToastID; [EVENTS.UPDATE]: { id: ToastID; options: Partial & { content?: ToastContent; }; create: false; } | { id: ToastID; options: Partial & { content: ToastContent; }; create: true; }; [EVENTS.UPDATE_DEFAULTS]: PluginOptions; }; declare type Handler = (event: EventData[E]) => void; export interface EventBusInterface { on(eventType: E, handler: Handler): void; off(eventType: E, handler: Handler): void; emit(eventType: E, event: EventData[E]): void; } declare type HandlerList = Handler[]; declare type HandlerMap = { [E in EVENTS]?: HandlerList; }; export declare class EventBus implements EventBusInterface { protected allHandlers: HandlerMap; protected getHandlers(eventType: E): HandlerList; on(eventType: E, handler: Handler): void; off(eventType: E, handler: Handler): void; emit(eventType: E, event: EventData[E]): void; } export declare const isEventBusInterface: (e: unknown) => e is EventBusInterface; export {};