see module preferred license /** */ import { grpc } from '@improbable-eng/grpc-web' ; import { ModuleRpcContextClient } from '../../context/client' ; import { ModuleRpcProtocolGrpcWebClient } from '../grpc_web/client' ; import { ModuleRpcCommon } from '../../common' ; import { ModuleRpcClient } from '../../client' ; export interface RpcClientOptions { /** The remote address to connect to (example: https://test.com:8000). */ remoteAddress : string ; ignore getGrpcWebTransport ? : ( options : grpc . TransportOptions ) => grpc . Transport | Error ; } export function getRpcClient < serviceDefinition extends ModuleRpcCommon . ServiceDefinition > ( serviceDefinition , options ) ; export function getRpcClient < serviceDefinition extends ModuleRpcCommon . ServiceDefinition , ResponseContext > ( serviceDefinition , options ) ; export function getRpcClient < serviceDefinition extends ModuleRpcCommon . ServiceDefinition , ResponseContext > ( serviceDefinition , options ) { const clientContextConnector = options . clientContextConnector || new ModuleRpcContextClient . EmptyClientContextConnector ( ) ; return ( ModuleRpcProtocolGrpcWebClient . getGrpcWebClient ( serviceDefinition , clientContextConnector , { remoteAddress : options . remoteAddress , getTransport : options . getGrpcWebTransport , } ) as ModuleRpcClient . Service < serviceDefinition , ResponseContext > ) . methodMap ( ) ; }