/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { EventEmitter, EventParameters } from "@workglow/util"; /** * Emit an event without letting a throwing listener crash the caller. * * The shared {@link EventEmitter.emit} rethrows listener errors * synchronously (or as an `AggregateError`). Storage write paths use * that signal to trigger rollback, so they must not be derailed by a * misbehaving subscriber. Listener errors are surfaced via * `getLogger().warn` so observability tooling still sees the bug; the * synchronous caller keeps running. * * The error is intentionally NOT re-thrown onto the unhandled-rejection * channel: Node's default mode (`--unhandled-rejections=throw`, the * default since Node 15) terminates the process on an unhandled * rejection, which would turn a misbehaving subscriber into a crash — * the exact failure this helper exists to prevent. */ export declare function safeEmit any>, Event extends keyof Events>(emitter: EventEmitter, event: Event, ...args: EventParameters): void; //# sourceMappingURL=safeEmit.d.ts.map