import * as grpc from '@grpc/grpc-js'; import { handleClientStreamingCall } from '@grpc/grpc-js/build/src/server-call'; import { ReactiveServerUnaryMethod, ReactiveServerRequestStreamMethod, ReactiveServerResponseStreamMethod, ReactiveServerBidirectionalStreamMethod } from './server_methods'; /** * Mapped type that transforms all gRPC method signatures within the `IService` template type * into their reactive counterparts so as to allow for type checking and inference. */ export declare type ReactiveServer = { [rpc in keyof IService]: IService[rpc] extends grpc.handleUnaryCall ? ReactiveServerUnaryMethod : IService[rpc] extends handleClientStreamingCall ? ReactiveServerRequestStreamMethod : IService[rpc] extends grpc.handleServerStreamingCall ? ReactiveServerResponseStreamMethod : IService[rpc] extends grpc.handleBidiStreamingCall ? ReactiveServerBidirectionalStreamMethod : unknown; }; /** * Wraps a reactive server instance so that it becomes a standard, * non-reactive server which can subsequently be used as a regular gRPC service. * Calling a method on the wrapping service will call the associated reactive method. * @param serviceDefinition The gRPC service definition. Usually generated from protocol buffer files. * @param service The reactive service that is to be dereactified. * @returns An object containing standard gRPC methods. */ export declare function defineService(serviceDefinition: grpc.ServiceDefinition, service: ReactiveServer): IServer;