import { Effect, Layer, Stream } from 'effect'; import { EventStreamId, EventStreamPosition, EventStoreError, type StreamEvent } from '@codeforbreakfast/eventsourcing-store'; /** * SubscriptionManager service for managing subscriptions to event streams */ export interface SubscriptionManagerService { /** * Subscribe to a specific event stream and return a Stream of events */ readonly subscribeToStream: (streamId: EventStreamId) => Effect.Effect, EventStoreError, never>; /** * Unsubscribe from a specific event stream */ readonly unsubscribeFromStream: (streamId: EventStreamId) => Effect.Effect; /** * Publish an event to all subscribers of a stream */ readonly publishEvent: (streamId: EventStreamId, event: string) => Effect.Effect; /** * Subscribe to all events from all streams */ readonly subscribeToAllEvents: () => Effect.Effect, never>, EventStoreError, never>; /** * Publish an event to all-events subscribers */ readonly publishToAllEvents: (position: EventStreamPosition, event: string) => Effect.Effect; } declare const SubscriptionManager_base: import("effect/Context").TagClass & Effect.Tag.Proxy & { use: (body: (_: SubscriptionManagerService) => X) => [X] extends [Effect.Effect] ? Effect.Effect : [X] extends [PromiseLike] ? Effect.Effect : Effect.Effect; }; export declare class SubscriptionManager extends SubscriptionManager_base { } /** * Implementation of SubscriptionManager service */ export declare const SubscriptionManagerLive: Layer.Layer; export {}; //# sourceMappingURL=subscriptionManager.d.ts.map