import type { Disposable, HostEvent, JsonValue } from '../types.js'; /** * Framework-internal event bus。 * * 责任: * - `bindDeclaredEvents(events)`:在 Bind 阶段调;对每个声明的 HostEvent,调用 * framework binder,让该 event 的 `publish()` 走 bus。 * - `publish(name, payload)`:通知 `subscribe(name, ...)` 注册的所有 listener。 * - `subscribe(name, listener)`:返回 `Disposable`,dispose 后停止通知。 * - `unbindAll()`:解绑所有 declared event publisher + 清空 subscribers。 * * @internal */ export declare class EventBus { private readonly subscribers; private readonly allSubscribers; private readonly inFlight; private boundEvents; bindDeclaredEvents(events: readonly HostEvent[]): void; publish(name: string, payload: JsonValue): void; subscribe(name: string, listener: (payload: JsonValue) => void): Disposable; /** * 订阅所有 channel 的 publish —— framework wire-transport 把 declared * HostEvent.publish() 桥到 webContents.send 时用。 */ subscribeAll(listener: (name: string, payload: JsonValue) => void): Disposable; unbindAll(): void; } //# sourceMappingURL=event-bus.d.ts.map