forked from aiden/rpc_ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.ts
32 lines (30 loc) · 923 Bytes
/
service.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @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 { ModuleRpcCommon } from '../../common';
export type NumberService = typeof numberServiceDefinition;
/** Defines the banking service, giving all the methods and the request and response types. */
export const numberServiceDefinition = {
increment: {
request: {} as { value: number },
response: {} as {
value: number;
},
},
/**
* An example of a server stream that returns a message at regular intervals.
*/
streamNumbers: {
// This property indicates that the method serves a stream of messages
// rather than a unary response.
type: ModuleRpcCommon.ServiceMethodType.serverStream,
request: {} as { max: number; sleepMs: number },
response: {} as {
counter: number;
},
},
};