import type { EventForEventSourceId } from '../eventSequences/EventForEventSourceId.js'; import type { IEventLog } from '../eventSequences/IEventLog.js'; import type { EventContext } from '../events/EventContext.js'; import type { ReactorResultHandler } from './ReactorResultHandler.js'; /** * Represents the outcome of appending a reactor handler's returned side-effect events. */ export interface ReactorSideEffectResult { /** Whether every side-effect event appended successfully. */ readonly isSuccess: boolean; /** Constraint violation and error messages, populated when {@link isSuccess} is false. */ readonly errors: string[]; } /** Dispatch to the optional application hook first, preserving the SDK event append when it declines. */ export declare function dispatchReactorSideEffects(eventLog: IEventLog, result: unknown, context: EventContext, reactorType: Function, eventStore: string, namespace: string, handler?: ReactorResultHandler): Promise; /** * Appends the events a `@reactor`-decorated class's handler method returned as side effects, in * a single atomic `AppendMany` call — never one append per item, which would neither be atomic * nor efficient. * @param eventLog - The {@link IEventLog} to append the side effects to. * @param handlerResult - Whatever the reactor handler method returned: `undefined`/`void`, a * single event object, an array of events, a single {@link EventForEventSourceId}, an array of * them, or a mix of bare events and {@link EventForEventSourceId} entries. * @param triggeringEventSourceId - The event source id of the event that triggered the reactor, * used as the target for bare event returns. * @param triggeringEventStreamType - The event stream type of the triggering event, used for bare * event returns. * @param triggeringEventStreamId - The event stream identifier of the triggering event, used for * bare event returns. * @param reactorEventSourceType - Non-empty reactor source type metadata for bare event returns. * @param reactorEventStreamType - Non-empty declared reactor stream type metadata for bare event returns, * overriding the triggering stream type. Omitted metadata preserves the triggering stream type. * @returns The outcome of the append. Each {@link EventForEventSourceId} entry keeps its own * target metadata; bare events use the triggering target with the reactor's declared types. */ export declare function appendReactorSideEffects(eventLog: IEventLog, handlerResult: unknown, triggeringEventSourceId: string, triggeringEventStreamType: string, triggeringEventStreamId: string, reactorEventSourceType?: string, reactorEventStreamType?: string): Promise; /** Production return-shape normalization; unknown values are ignored by production dispatch. */ export declare function normalizeReactorSideEffects(handlerResult: unknown, triggeringEventSourceId: string, triggeringEventStreamType: string, triggeringEventStreamId: string, reactorEventSourceType?: string, reactorEventStreamType?: string): EventForEventSourceId[]; //# sourceMappingURL=ReactorSideEffects.d.ts.map