import type { AggregateEventObserver, BaseEvent, BaseEventInput, CreatedEvent, EventFlow, IEventStoreRepo, SuccessEventObserver } from '@schemeless/event-store-types'; import { AggregateLoader } from './processEventTree'; import type { EventOutput } from '../EventStore.types'; export interface EventProcessorOptions { mainConcurrency?: number; sideEffectConcurrency?: number; maxEventDepth?: number; } export declare class EventProcessor { private repo; private observers; private getAggregate; private options; private partitions; private sideEffectPartitions; private eventFlowMap; private eventHandlers; private _shutdown; constructor(repo: IEventStoreRepo, eventFlows: EventFlow[], observers: Array | AggregateEventObserver>, getAggregate: AggregateLoader | undefined, options?: EventProcessorOptions); /** * Submit an event for full processing: * 1. Route to partition (by shard key) * 2. Process event tree (validate → apply → consequent events) * 3. Persist all events * 4. Run side effects (may cascade new events) * 5. Run observers */ submit(flow: EventFlow, input: BaseEventInput): Promise<[CreatedEvent, ...Array>]>; /** * Push a raw BaseEvent (used internally by side effects). */ pushRaw(event: BaseEvent): Promise; onProcessed(handler: (output: EventOutput) => void): () => void; shutdown(timeout?: number): Promise; private getPartition; private runSideEffectsInPartition; private cancelAppliedEvents; private notifyHandlers; }