-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.js
More file actions
49 lines (41 loc) · 859 Bytes
/
types.js
File metadata and controls
49 lines (41 loc) · 859 Bytes
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
// @flow
import { TYPE_CALL, TYPE_RESOLVE, TYPE_REJECT, TYPE_DESCRIPTOR } from './constants'
export type SerialProp = {
path: string,
node: any
}
export type SerialMethod = {
path: string,
key: string
}
export type RemoteDescriptor = {
type: typeof TYPE_DESCRIPTOR,
methods: Array<SerialMethod>,
props: Array<SerialProp>,
nonce: string,
sessionId?: string,
}
export type CallPayload = {|
type: typeof TYPE_CALL,
callId: string,
methodKey: string,
args: Array<any>,
authentication: ?string,
signature: ?string,
sessionId: ?string
|}
export type ResolvePayload = {|
type: typeof TYPE_RESOLVE,
callId: string,
value: any
|}
export type RejectPayload = {|
type: typeof TYPE_REJECT,
callId: string,
error: Object
|}
export type Payload =
| RemoteDescriptor
| CallPayload
| ResolvePayload
| RejectPayload