starpc 0.10.8 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/echo/echo.pb.d.ts +5 -5
- package/dist/echo/echo.pb.js +20 -20
- package/dist/rpcstream/rpcstream.pb.d.ts +7 -7
- package/dist/rpcstream/rpcstream.pb.js +64 -39
- package/dist/srpc/handler.d.ts +1 -1
- package/dist/srpc/handler.js +6 -2
- package/dist/srpc/rpcproto.pb.d.ts +6 -6
- package/dist/srpc/rpcproto.pb.js +75 -38
- package/echo/echo.pb.ts +144 -88
- package/echo/echo_srpc.pb.go +17 -6
- package/package.json +1 -1
- package/srpc/conn.ts +3 -1
- package/srpc/definition.ts +1 -0
- package/srpc/handler.ts +11 -2
- package/srpc/rpcproto.pb.ts +273 -183
- package/srpc/server.ts +1 -3
package/dist/echo/echo.pb.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Long from
|
|
2
|
-
import _m0 from
|
|
3
|
-
import { RpcStreamPacket } from
|
|
1
|
+
import Long from 'long';
|
|
2
|
+
import _m0 from 'protobufjs/minimal.js';
|
|
3
|
+
import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js';
|
|
4
4
|
export declare const protobufPackage = "echo";
|
|
5
5
|
/** EchoMsg is the message body for Echo. */
|
|
6
6
|
export interface EchoMsg {
|
|
@@ -322,9 +322,9 @@ declare type Builtin = Date | Function | Uint8Array | string | number | boolean
|
|
|
322
322
|
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
323
323
|
$case: string;
|
|
324
324
|
} ? {
|
|
325
|
-
[K in keyof Omit<T,
|
|
325
|
+
[K in keyof Omit<T, '$case'>]?: DeepPartial<T[K]>;
|
|
326
326
|
} & {
|
|
327
|
-
$case: T[
|
|
327
|
+
$case: T['$case'];
|
|
328
328
|
} : T extends {} ? {
|
|
329
329
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
330
330
|
} : Partial<T>;
|
package/dist/echo/echo.pb.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import Long from
|
|
3
|
-
import _m0 from
|
|
4
|
-
import { RpcStreamPacket } from
|
|
5
|
-
export const protobufPackage =
|
|
2
|
+
import Long from 'long';
|
|
3
|
+
import _m0 from 'protobufjs/minimal.js';
|
|
4
|
+
import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js';
|
|
5
|
+
export const protobufPackage = 'echo';
|
|
6
6
|
function createBaseEchoMsg() {
|
|
7
|
-
return { body:
|
|
7
|
+
return { body: '' };
|
|
8
8
|
}
|
|
9
9
|
export const EchoMsg = {
|
|
10
10
|
encode(message, writer = _m0.Writer.create()) {
|
|
11
|
-
if (message.body !==
|
|
11
|
+
if (message.body !== '') {
|
|
12
12
|
writer.uint32(10).string(message.body);
|
|
13
13
|
}
|
|
14
14
|
return writer;
|
|
@@ -59,7 +59,7 @@ export const EchoMsg = {
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
fromJSON(object) {
|
|
62
|
-
return { body: isSet(object.body) ? String(object.body) :
|
|
62
|
+
return { body: isSet(object.body) ? String(object.body) : '' };
|
|
63
63
|
},
|
|
64
64
|
toJSON(message) {
|
|
65
65
|
const obj = {};
|
|
@@ -68,7 +68,7 @@ export const EchoMsg = {
|
|
|
68
68
|
},
|
|
69
69
|
fromPartial(object) {
|
|
70
70
|
const message = createBaseEchoMsg();
|
|
71
|
-
message.body = object.body ??
|
|
71
|
+
message.body = object.body ?? '';
|
|
72
72
|
return message;
|
|
73
73
|
},
|
|
74
74
|
};
|
|
@@ -83,37 +83,37 @@ export class EchoerClientImpl {
|
|
|
83
83
|
}
|
|
84
84
|
Echo(request) {
|
|
85
85
|
const data = EchoMsg.encode(request).finish();
|
|
86
|
-
const promise = this.rpc.request(
|
|
86
|
+
const promise = this.rpc.request('echo.Echoer', 'Echo', data);
|
|
87
87
|
return promise.then((data) => EchoMsg.decode(new _m0.Reader(data)));
|
|
88
88
|
}
|
|
89
89
|
EchoServerStream(request) {
|
|
90
90
|
const data = EchoMsg.encode(request).finish();
|
|
91
|
-
const result = this.rpc.serverStreamingRequest(
|
|
91
|
+
const result = this.rpc.serverStreamingRequest('echo.Echoer', 'EchoServerStream', data);
|
|
92
92
|
return EchoMsg.decodeTransform(result);
|
|
93
93
|
}
|
|
94
94
|
EchoClientStream(request) {
|
|
95
95
|
const data = EchoMsg.encodeTransform(request);
|
|
96
|
-
const promise = this.rpc.clientStreamingRequest(
|
|
96
|
+
const promise = this.rpc.clientStreamingRequest('echo.Echoer', 'EchoClientStream', data);
|
|
97
97
|
return promise.then((data) => EchoMsg.decode(new _m0.Reader(data)));
|
|
98
98
|
}
|
|
99
99
|
EchoBidiStream(request) {
|
|
100
100
|
const data = EchoMsg.encodeTransform(request);
|
|
101
|
-
const result = this.rpc.bidirectionalStreamingRequest(
|
|
101
|
+
const result = this.rpc.bidirectionalStreamingRequest('echo.Echoer', 'EchoBidiStream', data);
|
|
102
102
|
return EchoMsg.decodeTransform(result);
|
|
103
103
|
}
|
|
104
104
|
RpcStream(request) {
|
|
105
105
|
const data = RpcStreamPacket.encodeTransform(request);
|
|
106
|
-
const result = this.rpc.bidirectionalStreamingRequest(
|
|
106
|
+
const result = this.rpc.bidirectionalStreamingRequest('echo.Echoer', 'RpcStream', data);
|
|
107
107
|
return RpcStreamPacket.decodeTransform(result);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
export const EchoerDefinition = {
|
|
111
|
-
name:
|
|
112
|
-
fullName:
|
|
111
|
+
name: 'Echoer',
|
|
112
|
+
fullName: 'echo.Echoer',
|
|
113
113
|
methods: {
|
|
114
114
|
/** Echo returns the given message. */
|
|
115
115
|
echo: {
|
|
116
|
-
name:
|
|
116
|
+
name: 'Echo',
|
|
117
117
|
requestType: EchoMsg,
|
|
118
118
|
requestStream: false,
|
|
119
119
|
responseType: EchoMsg,
|
|
@@ -122,7 +122,7 @@ export const EchoerDefinition = {
|
|
|
122
122
|
},
|
|
123
123
|
/** EchoServerStream is an example of a server -> client one-way stream. */
|
|
124
124
|
echoServerStream: {
|
|
125
|
-
name:
|
|
125
|
+
name: 'EchoServerStream',
|
|
126
126
|
requestType: EchoMsg,
|
|
127
127
|
requestStream: false,
|
|
128
128
|
responseType: EchoMsg,
|
|
@@ -131,7 +131,7 @@ export const EchoerDefinition = {
|
|
|
131
131
|
},
|
|
132
132
|
/** EchoClientStream is an example of client->server one-way stream. */
|
|
133
133
|
echoClientStream: {
|
|
134
|
-
name:
|
|
134
|
+
name: 'EchoClientStream',
|
|
135
135
|
requestType: EchoMsg,
|
|
136
136
|
requestStream: true,
|
|
137
137
|
responseType: EchoMsg,
|
|
@@ -140,7 +140,7 @@ export const EchoerDefinition = {
|
|
|
140
140
|
},
|
|
141
141
|
/** EchoBidiStream is an example of a two-way stream. */
|
|
142
142
|
echoBidiStream: {
|
|
143
|
-
name:
|
|
143
|
+
name: 'EchoBidiStream',
|
|
144
144
|
requestType: EchoMsg,
|
|
145
145
|
requestStream: true,
|
|
146
146
|
responseType: EchoMsg,
|
|
@@ -149,7 +149,7 @@ export const EchoerDefinition = {
|
|
|
149
149
|
},
|
|
150
150
|
/** RpcStream opens a nested rpc call stream. */
|
|
151
151
|
rpcStream: {
|
|
152
|
-
name:
|
|
152
|
+
name: 'RpcStream',
|
|
153
153
|
requestType: RpcStreamPacket,
|
|
154
154
|
requestStream: true,
|
|
155
155
|
responseType: RpcStreamPacket,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import Long from
|
|
2
|
-
import _m0 from
|
|
1
|
+
import Long from 'long';
|
|
2
|
+
import _m0 from 'protobufjs/minimal.js';
|
|
3
3
|
export declare const protobufPackage = "rpcstream";
|
|
4
4
|
/** RpcStreamPacket is a packet encapsulating data for a RPC stream. */
|
|
5
5
|
export interface RpcStreamPacket {
|
|
6
6
|
body?: {
|
|
7
|
-
$case:
|
|
7
|
+
$case: 'init';
|
|
8
8
|
init: RpcStreamInit;
|
|
9
9
|
} | {
|
|
10
|
-
$case:
|
|
10
|
+
$case: 'ack';
|
|
11
11
|
ack: RpcAck;
|
|
12
12
|
} | {
|
|
13
|
-
$case:
|
|
13
|
+
$case: 'data';
|
|
14
14
|
data: Uint8Array;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
@@ -116,9 +116,9 @@ declare type Builtin = Date | Function | Uint8Array | string | number | boolean
|
|
|
116
116
|
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
117
117
|
$case: string;
|
|
118
118
|
} ? {
|
|
119
|
-
[K in keyof Omit<T,
|
|
119
|
+
[K in keyof Omit<T, '$case'>]?: DeepPartial<T[K]>;
|
|
120
120
|
} & {
|
|
121
|
-
$case: T[
|
|
121
|
+
$case: T['$case'];
|
|
122
122
|
} : T extends {} ? {
|
|
123
123
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
124
124
|
} : Partial<T>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import Long from
|
|
3
|
-
import _m0 from
|
|
4
|
-
export const protobufPackage =
|
|
2
|
+
import Long from 'long';
|
|
3
|
+
import _m0 from 'protobufjs/minimal.js';
|
|
4
|
+
export const protobufPackage = 'rpcstream';
|
|
5
5
|
function createBaseRpcStreamPacket() {
|
|
6
6
|
return { body: undefined };
|
|
7
7
|
}
|
|
8
8
|
export const RpcStreamPacket = {
|
|
9
9
|
encode(message, writer = _m0.Writer.create()) {
|
|
10
|
-
if (message.body?.$case ===
|
|
10
|
+
if (message.body?.$case === 'init') {
|
|
11
11
|
RpcStreamInit.encode(message.body.init, writer.uint32(10).fork()).ldelim();
|
|
12
12
|
}
|
|
13
|
-
if (message.body?.$case ===
|
|
13
|
+
if (message.body?.$case === 'ack') {
|
|
14
14
|
RpcAck.encode(message.body.ack, writer.uint32(18).fork()).ldelim();
|
|
15
15
|
}
|
|
16
|
-
if (message.body?.$case ===
|
|
16
|
+
if (message.body?.$case === 'data') {
|
|
17
17
|
writer.uint32(26).bytes(message.body.data);
|
|
18
18
|
}
|
|
19
19
|
return writer;
|
|
@@ -26,13 +26,19 @@ export const RpcStreamPacket = {
|
|
|
26
26
|
const tag = reader.uint32();
|
|
27
27
|
switch (tag >>> 3) {
|
|
28
28
|
case 1:
|
|
29
|
-
message.body = {
|
|
29
|
+
message.body = {
|
|
30
|
+
$case: 'init',
|
|
31
|
+
init: RpcStreamInit.decode(reader, reader.uint32()),
|
|
32
|
+
};
|
|
30
33
|
break;
|
|
31
34
|
case 2:
|
|
32
|
-
message.body = {
|
|
35
|
+
message.body = {
|
|
36
|
+
$case: 'ack',
|
|
37
|
+
ack: RpcAck.decode(reader, reader.uint32()),
|
|
38
|
+
};
|
|
33
39
|
break;
|
|
34
40
|
case 3:
|
|
35
|
-
message.body = { $case:
|
|
41
|
+
message.body = { $case: 'data', data: reader.bytes() };
|
|
36
42
|
break;
|
|
37
43
|
default:
|
|
38
44
|
reader.skipType(tag & 7);
|
|
@@ -72,43 +78,60 @@ export const RpcStreamPacket = {
|
|
|
72
78
|
fromJSON(object) {
|
|
73
79
|
return {
|
|
74
80
|
body: isSet(object.init)
|
|
75
|
-
? { $case:
|
|
81
|
+
? { $case: 'init', init: RpcStreamInit.fromJSON(object.init) }
|
|
76
82
|
: isSet(object.ack)
|
|
77
|
-
? { $case:
|
|
83
|
+
? { $case: 'ack', ack: RpcAck.fromJSON(object.ack) }
|
|
78
84
|
: isSet(object.data)
|
|
79
|
-
? { $case:
|
|
85
|
+
? { $case: 'data', data: bytesFromBase64(object.data) }
|
|
80
86
|
: undefined,
|
|
81
87
|
};
|
|
82
88
|
},
|
|
83
89
|
toJSON(message) {
|
|
84
90
|
const obj = {};
|
|
85
|
-
message.body?.$case ===
|
|
86
|
-
(obj.init = message.body?.init
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
message.body?.$case === 'init' &&
|
|
92
|
+
(obj.init = message.body?.init
|
|
93
|
+
? RpcStreamInit.toJSON(message.body?.init)
|
|
94
|
+
: undefined);
|
|
95
|
+
message.body?.$case === 'ack' &&
|
|
96
|
+
(obj.ack = message.body?.ack
|
|
97
|
+
? RpcAck.toJSON(message.body?.ack)
|
|
98
|
+
: undefined);
|
|
99
|
+
message.body?.$case === 'data' &&
|
|
100
|
+
(obj.data =
|
|
101
|
+
message.body?.data !== undefined
|
|
102
|
+
? base64FromBytes(message.body?.data)
|
|
103
|
+
: undefined);
|
|
90
104
|
return obj;
|
|
91
105
|
},
|
|
92
106
|
fromPartial(object) {
|
|
93
107
|
const message = createBaseRpcStreamPacket();
|
|
94
|
-
if (object.body?.$case ===
|
|
95
|
-
|
|
108
|
+
if (object.body?.$case === 'init' &&
|
|
109
|
+
object.body?.init !== undefined &&
|
|
110
|
+
object.body?.init !== null) {
|
|
111
|
+
message.body = {
|
|
112
|
+
$case: 'init',
|
|
113
|
+
init: RpcStreamInit.fromPartial(object.body.init),
|
|
114
|
+
};
|
|
96
115
|
}
|
|
97
|
-
if (object.body?.$case ===
|
|
98
|
-
|
|
116
|
+
if (object.body?.$case === 'ack' &&
|
|
117
|
+
object.body?.ack !== undefined &&
|
|
118
|
+
object.body?.ack !== null) {
|
|
119
|
+
message.body = { $case: 'ack', ack: RpcAck.fromPartial(object.body.ack) };
|
|
99
120
|
}
|
|
100
|
-
if (object.body?.$case ===
|
|
101
|
-
|
|
121
|
+
if (object.body?.$case === 'data' &&
|
|
122
|
+
object.body?.data !== undefined &&
|
|
123
|
+
object.body?.data !== null) {
|
|
124
|
+
message.body = { $case: 'data', data: object.body.data };
|
|
102
125
|
}
|
|
103
126
|
return message;
|
|
104
127
|
},
|
|
105
128
|
};
|
|
106
129
|
function createBaseRpcStreamInit() {
|
|
107
|
-
return { componentId:
|
|
130
|
+
return { componentId: '' };
|
|
108
131
|
}
|
|
109
132
|
export const RpcStreamInit = {
|
|
110
133
|
encode(message, writer = _m0.Writer.create()) {
|
|
111
|
-
if (message.componentId !==
|
|
134
|
+
if (message.componentId !== '') {
|
|
112
135
|
writer.uint32(10).string(message.componentId);
|
|
113
136
|
}
|
|
114
137
|
return writer;
|
|
@@ -159,7 +182,9 @@ export const RpcStreamInit = {
|
|
|
159
182
|
}
|
|
160
183
|
},
|
|
161
184
|
fromJSON(object) {
|
|
162
|
-
return {
|
|
185
|
+
return {
|
|
186
|
+
componentId: isSet(object.componentId) ? String(object.componentId) : '',
|
|
187
|
+
};
|
|
163
188
|
},
|
|
164
189
|
toJSON(message) {
|
|
165
190
|
const obj = {};
|
|
@@ -168,16 +193,16 @@ export const RpcStreamInit = {
|
|
|
168
193
|
},
|
|
169
194
|
fromPartial(object) {
|
|
170
195
|
const message = createBaseRpcStreamInit();
|
|
171
|
-
message.componentId = object.componentId ??
|
|
196
|
+
message.componentId = object.componentId ?? '';
|
|
172
197
|
return message;
|
|
173
198
|
},
|
|
174
199
|
};
|
|
175
200
|
function createBaseRpcAck() {
|
|
176
|
-
return { error:
|
|
201
|
+
return { error: '' };
|
|
177
202
|
}
|
|
178
203
|
export const RpcAck = {
|
|
179
204
|
encode(message, writer = _m0.Writer.create()) {
|
|
180
|
-
if (message.error !==
|
|
205
|
+
if (message.error !== '') {
|
|
181
206
|
writer.uint32(10).string(message.error);
|
|
182
207
|
}
|
|
183
208
|
return writer;
|
|
@@ -228,7 +253,7 @@ export const RpcAck = {
|
|
|
228
253
|
}
|
|
229
254
|
},
|
|
230
255
|
fromJSON(object) {
|
|
231
|
-
return { error: isSet(object.error) ? String(object.error) :
|
|
256
|
+
return { error: isSet(object.error) ? String(object.error) : '' };
|
|
232
257
|
},
|
|
233
258
|
toJSON(message) {
|
|
234
259
|
const obj = {};
|
|
@@ -237,28 +262,28 @@ export const RpcAck = {
|
|
|
237
262
|
},
|
|
238
263
|
fromPartial(object) {
|
|
239
264
|
const message = createBaseRpcAck();
|
|
240
|
-
message.error = object.error ??
|
|
265
|
+
message.error = object.error ?? '';
|
|
241
266
|
return message;
|
|
242
267
|
},
|
|
243
268
|
};
|
|
244
269
|
var globalThis = (() => {
|
|
245
|
-
if (typeof globalThis !==
|
|
270
|
+
if (typeof globalThis !== 'undefined') {
|
|
246
271
|
return globalThis;
|
|
247
272
|
}
|
|
248
|
-
if (typeof self !==
|
|
273
|
+
if (typeof self !== 'undefined') {
|
|
249
274
|
return self;
|
|
250
275
|
}
|
|
251
|
-
if (typeof window !==
|
|
276
|
+
if (typeof window !== 'undefined') {
|
|
252
277
|
return window;
|
|
253
278
|
}
|
|
254
|
-
if (typeof global !==
|
|
279
|
+
if (typeof global !== 'undefined') {
|
|
255
280
|
return global;
|
|
256
281
|
}
|
|
257
|
-
throw
|
|
282
|
+
throw 'Unable to locate global object';
|
|
258
283
|
})();
|
|
259
284
|
function bytesFromBase64(b64) {
|
|
260
285
|
if (globalThis.Buffer) {
|
|
261
|
-
return Uint8Array.from(globalThis.Buffer.from(b64,
|
|
286
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, 'base64'));
|
|
262
287
|
}
|
|
263
288
|
else {
|
|
264
289
|
const bin = globalThis.atob(b64);
|
|
@@ -271,14 +296,14 @@ function bytesFromBase64(b64) {
|
|
|
271
296
|
}
|
|
272
297
|
function base64FromBytes(arr) {
|
|
273
298
|
if (globalThis.Buffer) {
|
|
274
|
-
return globalThis.Buffer.from(arr).toString(
|
|
299
|
+
return globalThis.Buffer.from(arr).toString('base64');
|
|
275
300
|
}
|
|
276
301
|
else {
|
|
277
302
|
const bin = [];
|
|
278
303
|
arr.forEach((byte) => {
|
|
279
304
|
bin.push(String.fromCharCode(byte));
|
|
280
305
|
});
|
|
281
|
-
return globalThis.btoa(bin.join(
|
|
306
|
+
return globalThis.btoa(bin.join(''));
|
|
282
307
|
}
|
|
283
308
|
}
|
|
284
309
|
if (_m0.util.Long !== Long) {
|
package/dist/srpc/handler.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export declare class StaticHandler implements Handler {
|
|
|
19
19
|
}
|
|
20
20
|
declare type MethodProto<R, O> = ((request: R) => Promise<O>) | ((request: R) => AsyncIterable<O>) | ((request: AsyncIterable<R>) => Promise<O>) | ((request: AsyncIterable<R>) => AsyncIterable<O>);
|
|
21
21
|
export declare function createInvokeFn<R, O>(methodInfo: MethodDefinition<R, O>, methodProto: MethodProto<R, O>): InvokeFn;
|
|
22
|
-
export declare function createHandler(definition: Definition, impl: any): Handler;
|
|
22
|
+
export declare function createHandler(definition: Definition, impl: any, serviceID?: string): Handler;
|
|
23
23
|
export {};
|
package/dist/srpc/handler.js
CHANGED
|
@@ -89,7 +89,11 @@ export function createInvokeFn(methodInfo, methodProto) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
// createHandler creates a handler from a definition and an implementation.
|
|
92
|
-
|
|
92
|
+
// if serviceID is not set, uses the fullName of the service as the identifier.
|
|
93
|
+
export function createHandler(definition, impl, serviceID) {
|
|
94
|
+
// serviceID defaults to the full name of the service from Protobuf.
|
|
95
|
+
serviceID = serviceID || definition.fullName;
|
|
96
|
+
// build map of method ID -> method prototype.
|
|
93
97
|
const methodMap = {};
|
|
94
98
|
for (const methodInfo of Object.values(definition.methods)) {
|
|
95
99
|
const methodName = methodInfo.name;
|
|
@@ -100,5 +104,5 @@ export function createHandler(definition, impl) {
|
|
|
100
104
|
methodProto = methodProto.bind(impl);
|
|
101
105
|
methodMap[methodName] = createInvokeFn(methodInfo, methodProto);
|
|
102
106
|
}
|
|
103
|
-
return new StaticHandler(
|
|
107
|
+
return new StaticHandler(serviceID, methodMap);
|
|
104
108
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import Long from
|
|
2
|
-
import _m0 from
|
|
1
|
+
import Long from 'long';
|
|
2
|
+
import _m0 from 'protobufjs/minimal.js';
|
|
3
3
|
export declare const protobufPackage = "srpc";
|
|
4
4
|
/** Packet is a message sent over a srpc packet connection. */
|
|
5
5
|
export interface Packet {
|
|
6
6
|
body?: {
|
|
7
|
-
$case:
|
|
7
|
+
$case: 'callStart';
|
|
8
8
|
callStart: CallStart;
|
|
9
9
|
} | {
|
|
10
|
-
$case:
|
|
10
|
+
$case: 'callData';
|
|
11
11
|
callData: CallData;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
@@ -162,9 +162,9 @@ declare type Builtin = Date | Function | Uint8Array | string | number | boolean
|
|
|
162
162
|
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
163
163
|
$case: string;
|
|
164
164
|
} ? {
|
|
165
|
-
[K in keyof Omit<T,
|
|
165
|
+
[K in keyof Omit<T, '$case'>]?: DeepPartial<T[K]>;
|
|
166
166
|
} & {
|
|
167
|
-
$case: T[
|
|
167
|
+
$case: T['$case'];
|
|
168
168
|
} : T extends {} ? {
|
|
169
169
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
170
170
|
} : Partial<T>;
|