import { ResolvedEventRouting } from '../eventSources/ResolvedEventRouting.js'; import type { IEventSources } from '../eventSources/IEventSources.js'; import type { AppendOptions } from './AppendOptions.js'; import type { ConcurrencyScope } from './ConcurrencyScope.js'; import type { EventForEventSourceId } from './EventForEventSourceId.js'; import { EventSequenceNumber } from './EventSequenceNumber.js'; /** Resolves the definition routing of a single append, or undefined for a legacy append. */ export declare function resolveSingleRouting(eventSources: IEventSources | undefined, options?: AppendOptions): ResolvedEventRouting | undefined; /** Resolves the definition routing of one event of a batch; per-event values win over the shared options. */ export declare function resolveBatchRouting(eventSources: IEventSources | undefined, event: EventForEventSourceId, options?: AppendOptions): ResolvedEventRouting | undefined; /** A derived guard required by a registered-definition event of a batch. */ export interface RequiredGuard { /** The routing whose dimensions produce the guard. */ readonly routing: ResolvedEventRouting; /** The stream id the guard's stream-id dimension (if any) applies to. */ readonly streamId: string | undefined; } /** * Determines the single derived guard every event source id of a batch needs. * The Kernel accepts one concurrency scope per event source id, so equivalent predicates share one * scope (an unguarded event never suppresses a guarded one) and differing predicates are rejected * before anything is written. * @param routings - The resolved routing per event, aligned with {@link events}. * @param events - The batch events. * @param sharedStreamId - The shared stream id from the append options. * @param explicitIds - Event source ids that carry an explicit scope; they are never derived. * @returns The guard to derive per event source id. * @throws Error when one event source id needs differing guards. */ export declare function planDerivedGuards(routings: Array, events: EventForEventSourceId[], sharedStreamId: string | undefined, explicitIds?: ReadonlySet): Map; /** The tail reader a derived concurrency scope needs. */ export type TailReader = (eventSourceId?: string, sourceType?: string, streamType?: string, streamId?: string) => Promise; /** * Derives an optimistic concurrency scope from the dimensions a definition declares. * Only call this when no explicit scope exists; explicit scopes always win. * @returns The scope, or undefined when the definition declares no dimensions. */ export declare function deriveConcurrencyScope(routing: ResolvedEventRouting, eventSourceId: string, streamId: string | undefined, readTail: TailReader): Promise; //# sourceMappingURL=resolveEventSourceRouting.d.ts.map