bare-rpc 0.1.3 → 0.1.4
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/index.d.ts +10 -5
- package/index.js +1 -1
- package/lib/outgoing-request.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -24,11 +24,11 @@ declare const constants: {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
interface RPCIncomingRequest {
|
|
27
|
-
rpc: RPC
|
|
28
|
-
id: number
|
|
29
|
-
command: string
|
|
30
|
-
data: Buffer
|
|
31
|
-
sent: boolean
|
|
27
|
+
readonly rpc: RPC
|
|
28
|
+
readonly id: number
|
|
29
|
+
readonly command: string
|
|
30
|
+
readonly data: Buffer
|
|
31
|
+
readonly sent: boolean
|
|
32
32
|
|
|
33
33
|
reply(data: Buffer | string, encoding?: BufferEncoding): void
|
|
34
34
|
|
|
@@ -41,6 +41,11 @@ declare class RPCIncomingRequest {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
interface RPCOutgoingRequest {
|
|
44
|
+
readonly rpc: RPC
|
|
45
|
+
readonly id: number
|
|
46
|
+
readonly command: string
|
|
47
|
+
readonly sent: boolean
|
|
48
|
+
|
|
44
49
|
send(data: Buffer | string, encoding?: BufferEncoding): void
|
|
45
50
|
|
|
46
51
|
reply(encoding?: BufferEncoding): Promise<Buffer>
|
package/index.js
CHANGED
package/lib/outgoing-request.js
CHANGED
|
@@ -2,9 +2,9 @@ const b4a = require('b4a')
|
|
|
2
2
|
const errors = require('./errors')
|
|
3
3
|
|
|
4
4
|
module.exports = class RPCOutgoingRequest {
|
|
5
|
-
constructor(
|
|
6
|
-
this.id = id
|
|
5
|
+
constructor(rpc, id, command) {
|
|
7
6
|
this.rpc = rpc
|
|
7
|
+
this.id = id
|
|
8
8
|
this.command = command
|
|
9
9
|
this.sent = false
|
|
10
10
|
|