/
types.ts
56 lines (49 loc) · 1.5 KB
/
types.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export interface Options {
/**
* Library with gRPC protocol implementation.
*
* - '@grpc/grpc-js' for nodejs or 'grpc-web' in the browser
*/
readonly grpcLib: any
/**
* Custom options for gRPC clients
*
* - **grpc-js** : https://github.com/grpc/grpc-node/blob/b05caec/packages/grpc-js/src/client.ts#L67
* - `credentials` can be supplied as part of `clientOptions` for `grpc-js`
* - **grpc-web**: https://github.com/grpc/grpc-web/blob/8b501a96f/javascript/net/grpc/web/grpcwebclientbase.js#L45
*/
readonly clientOptions?: any,
/**
* RNode host (gRPC method prefix).
*/
readonly host: string,
/**
* Generated JSON schema (default in _rnode-grpc-gen/js/rnode-api-schema.json_).
*/
readonly protoSchema: Object
}
/**
* Represents direct and easy access to protobuf serializer.
*/
export interface BinaryOp<T> {
/**
* Serializes plain JS object with `google-protobuf` serializer.
*/
serialize(_: T): Uint8Array
/**
* Deserializes bytes to plain JS object with `google-protobuf` deserializer.
*/
deserialize(_: Uint8Array): T
/**
* Creates underlying message object generated by `protoc`.
* https://github.com/protocolbuffers/protobuf/tree/master/js#api
*/
create(opt_data?: any[]): any
}
/**
* Nested protobuf message definition (used in Var type).
*/
// TODO: add support to generate nested types
export interface WildcardMsg { }
// TODO: check if still necessary, all gRPC methods have return types
export interface Unit { }