/** * Transport Test Interfaces * * Contract testing interfaces for transport layer implementations. * Tests ONLY message delivery mechanics and connection management. */ import { Effect, Stream, Scope, Schema } from 'effect'; import type { ConnectionState as CoreConnectionState, TransportError } from '@codeforbreakfast/eventsourcing-transport'; /** * Transport message schema for compile-time and runtime validation */ export declare const TransportMessageSchema: Schema.Struct<{ id: typeof Schema.NonEmptyString; type: typeof Schema.NonEmptyString; payload: typeof Schema.Unknown; metadata: Schema.optional>; }>; export interface TransportMessage extends Schema.Schema.Type { readonly id: string; } /** * Connection state from transport contracts */ export type ConnectionState = CoreConnectionState; /** * Transport test context for testing the simplified ConnectedTransport interface. * * IMPORTANT: This interface models the Effect.acquireRelease pattern. * The `createConnectedTransport` method should use Scope to manage lifecycle. * When the Scope closes, the transport should automatically disconnect. */ export interface TransportTestContext { readonly makeConnectedTransport: (url: string) => Effect.Effect; readonly simulateDisconnect?: () => Effect.Effect; readonly simulateReconnect?: () => Effect.Effect; } /** * Test interface that mirrors the simplified ConnectedTransport interface */ export interface ConnectedTransportTestInterface { readonly connectionState: Stream.Stream; readonly publish: (message: TransportMessage) => Effect.Effect; readonly subscribe: (filter?: (msg: TransportMessage) => boolean) => Effect.Effect, TransportError, never>; } /** * Test runner type for transport contract tests */ export type TransportTestRunner = (name: string, setup: () => Effect.Effect) => void; //# sourceMappingURL=test-layer-interfaces.d.ts.map