import { LoggerService } from '@nestjs/common/services/logger.service'; import { Observable, ObservedValueOf, Subscription } from 'rxjs'; import { BaseRpcContext } from '../ctx-host/base-rpc.context'; import { ClientOptions, MessageHandler, MicroserviceOptions, MsPattern, ReadPacket, WritePacket } from '../interfaces'; import { ConsumerDeserializer } from '../interfaces/deserializer.interface'; import { ConsumerSerializer } from '../interfaces/serializer.interface'; /** * @publicApi */ export declare abstract class Server { protected readonly messageHandlers: Map>; protected readonly logger: LoggerService; protected serializer: ConsumerSerializer; protected deserializer: ConsumerDeserializer; addHandler(pattern: any, callback: MessageHandler, isEventHandler?: boolean, extras?: Record): void; getHandlers(): Map; getHandlerByPattern(pattern: string): MessageHandler | null; send(stream$: Observable, respond: (data: WritePacket) => unknown | Promise): Subscription; handleEvent(pattern: string, packet: ReadPacket, context: BaseRpcContext): Promise; transformToObservable(resultOrDeferred: Observable | Promise): Observable; transformToObservable(resultOrDeferred: T): never extends Observable> ? Observable : Observable>; getOptionsProp(obj: T, prop: K, defaultValue?: T[K]): T[K]; protected handleError(error: string): void; protected loadPackage(name: string, ctx: string, loader?: Function): T; protected initializeSerializer(options: ClientOptions['options']): void; protected initializeDeserializer(options: ClientOptions['options']): void; /** * Transforms the server Pattern to valid type and returns a route for him. * * @param {string} pattern - server pattern * @returns string */ protected getRouteFromPattern(pattern: string): string; protected normalizePattern(pattern: MsPattern): string; }