rpc_ts
Version:
Remote Procedure Calls in TypeScript made simple
37 lines (36 loc) • 1.05 kB
TypeScript
/**
* @license
* Copyright (c) Aiden.ai
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { ModuleRpcServer } from '../../server';
import { NumberService } from './service';
export declare type NumberHandler = ModuleRpcServer.ServiceHandlerFor<NumberService>;
/**
* 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 getNumberHandler: () => ModuleRpcServer.ServiceHandlerFor<{
increment: {
request: {
value: number;
};
response: {
value: number;
};
};
streamNumbers: {
type: symbol;
request: {
max: number;
sleepMs: number;
};
response: {
counter: number;
};
};
}, undefined>;