UNPKG

rpc_ts

Version:

Remote Procedure Calls in TypeScript made simple

26 lines (25 loc) 866 B
import { ModuleRpcServer } from '../../server'; import { BankingService } from './service'; import { AuthRequestContext } from './auth_context'; export declare type BankingHandler = ModuleRpcServer.ServiceHandlerFor<BankingService, AuthRequestContext>; /** * Return a handler where the methods of the BankingService are actually implemented. * * We wrap it in a function to allow for closures, so that you can have variables scoped * to the lifetime of the server (such as the mock store `users` in this instance). */ export declare const getBankingHandler: () => ModuleRpcServer.ServiceHandlerFor<{ getBalance: { request: {}; response: { value: number; }; }; transfer: { request: { toUserId: string; amount: number; }; response: {}; }; }, AuthRequestContext>;