-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Invoke.ts
64 lines (57 loc) · 1.09 KB
/
Invoke.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
57
58
59
60
61
62
63
64
/**
* Message structure for RPC (Remote Procedure Call).
*
* @author Jeongho Nam - https://github.com/samchon
*/
export type Invoke = Invoke.IFunction | Invoke.IReturn;
export namespace Invoke {
/**
* Message for Requesting RPC.
*/
export interface IFunction {
/**
* Unique identifier.
*/
uid: number;
/**
* Target function (sometimes calsuled in objects) to call.
*/
listener: string;
/**
* Parameters for the function call.
*/
parameters: IParameter[];
}
/**
* Parameter for the function call.
*/
export interface IParameter {
/**
* Type of the {@link value}.
*
* Actually, it stores result of the `typeof` statement.
*/
type: string;
/**
* Value of the parameter.
*/
value: any;
}
/**
* Message for Returning RPC.
*/
export interface IReturn {
/**
* Unique identifier.
*/
uid: number;
/**
* `true` -> return, `false` -> exception.
*/
success: boolean;
/**
* Returned value or thrown exception.
*/
value: any;
}
}