import type { BaseEvent, EventFlowMap } from '@schemeless/event-store-types'; import { AggregateLoader, ProcessedEventLifecycle } from './processEventLifecycle'; export type { AggregateLoader } from './processEventLifecycle'; export interface ProcessEventTreeOptions { maxDepth?: number; } export type ProcessedEvent = ProcessedEventLifecycle; export interface ProcessResult { events: ProcessedEvent[]; } export declare class EventTreeProcessError extends Error { originalError: unknown; appliedEvents: ProcessedEvent[]; constructor(originalError: unknown, appliedEvents: ProcessedEvent[]); } /** * Process an event and all its consequent events depth-first. * * This is a pure async function with no side effects beyond calling * the EventFlow lifecycle hooks (upcast, validate, preApply, apply, createConsequentEvents). * * Aggregate state is passed through a local map — no global cache needed. */ export declare function processEventTree(rootInput: BaseEvent, eventFlowMap: EventFlowMap, getAggregate: AggregateLoader | undefined, options?: ProcessEventTreeOptions): Promise;