import "reflect-metadata"; import type { IPCBridge } from "./IPCBridge"; type EdenEventListener = (payload: T) => void | Promise; /** * Base class for managers that emit events within a specific namespace. * * Provides type-safe event emission where: * - Event names are constrained to the namespace's events * - Payload types are automatically inferred * - Namespace is extracted from the @EdenNamespace decorator * * @example * ```typescript * interface ProcessNamespaceEvents { * "launched": { instance: AppInstance }; * "stopped": { appId: string }; * } * * @EdenNamespace("process") * class ProcessManager extends EdenEmitter { * constructor(ipcBridge: IPCBridge) { * super(ipcBridge); * } * * async launchApp() { * this.notify("launched", { instance }); // Fully typed! * } * } * ``` */ export declare abstract class EdenEmitter { protected ipcBridge: IPCBridge; private readonly listeners; constructor(ipcBridge: IPCBridge); /** * Register an in-process notification listener. * * Local listeners are fire-and-forget. Use an explicit awaited manager call * for lifecycle transactions whose failure must affect the caller. */ on(event: K, listener: EdenEventListener): () => void; /** * Emit an event within this manager's namespace. * * The namespace is automatically extracted from the @EdenNamespace decorator. * Event names and payloads are type-checked based on the TEvents generic parameter. * * @param event - Event name (without namespace prefix) * @param data - Event payload data */ protected notify(event: K, data: TEvents[K]): void; /** * Emit an event to a specific subscriber within this manager's namespace. * * Similar to notify(), but targets a specific view instead of broadcasting. * * @param viewId - The view ID to send the event to * @param event - Event name (without namespace prefix) * @param data - Event payload data */ protected notifySubscriber(viewId: number, event: K, data: TEvents[K]): void; /** Release every in-process subscription owned by this emitter. */ dispose(): void; } export {}; //# sourceMappingURL=EdenEmitter.d.ts.map