import { type OutboxEvent, type OutboxStore } from "../outbox/store.js"; import { type RuntimeComposition } from "../runtime/composition.js"; import { type EventPayloadMap, type OmsEventKind } from "./kinds.js"; declare const EVENT_BUS: unique symbol; export interface RuntimeEventIdentity { readonly sourceId: string; readonly sourceVersion: number; readonly dedupeKey: string; readonly occurredAt: string; } export type TypedOutboxEvent = Omit & { readonly event_kind: K; readonly payload: Readonly; }; export interface RuntimeEventBus { readonly [EVENT_BUS]: true; publish(kind: K, identity: RuntimeEventIdentity, payload: EventPayloadMap[K]): Readonly<{ status: "created" | "replayed"; event: TypedOutboxEvent; }>; read(eventId: string, kind: K): TypedOutboxEvent; find(kind: K, identity: RuntimeEventIdentity): TypedOutboxEvent | undefined; pending(consumerId: string, kind: K): readonly TypedOutboxEvent[]; } export declare function createRuntimeEventBus(options: { outbox: OutboxStore; packageRoot: string; composition?: RuntimeComposition; }): RuntimeEventBus; export declare function assertRuntimeEventBus(value: unknown): asserts value is RuntimeEventBus; export declare function assertTypedRuntimeEvent(value: unknown, kind: K): asserts value is TypedOutboxEvent; export {};