import { Server } from 'socket.io'; import { Identity } from 'ts-eventsourcing/ValueObject/Identity'; import { SerializerInterface } from '../../Serializer/SerializerInterface'; import { StoreRepositoryInterface } from '../../ReadModel/StoreRepositoryInterface'; import { ReadModelAction, ReadModelMetadata } from '../../ReadModel/ReadModelAction'; import { ProjectorGatewayFactory } from '../Projector/ProjectorGatewayFactory'; import { ProjectorGatewayInterface } from '../../ReadModel/ProjectorGatewayInterface'; import { SocketConnection } from './ValueObject/SocketConnection'; export interface SocketIoGatewayOptions { nsp: string; } /** * Namespace based gateway factory for projectors. */ export declare class SocketIoGatewayFactory = ReadModelMetadata, Action extends ReadModelAction = ReadModelAction> implements ProjectorGatewayFactory { private socketServer; private serializer; private repository; /** * Throw an error to prevent connection to the namespace. */ private onConnection; private openNamespace; constructor(socketServer: Server, serializer: SerializerInterface, repository: StoreRepositoryInterface, /** * Throw an error to prevent connection to the namespace. */ onConnection: (connection: SocketConnection) => void); open(options: SocketIoGatewayOptions): ProjectorGatewayInterface; close(options: SocketIoGatewayOptions): void; get(options: SocketIoGatewayOptions): ProjectorGatewayInterface; }