-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfrpc.d.ts
More file actions
77 lines (67 loc) · 2.25 KB
/
Copy pathfrpc.d.ts
File metadata and controls
77 lines (67 loc) · 2.25 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
export class Double {
number: number;
constructor(number: number);
}
export type RpcData =
null |
boolean |
number |
string |
Date |
readonly RpcData[] |
{readonly [property: string]: RpcData}
export type SerializableData =
null |
boolean |
number |
string |
ArrayBuffer |
Date |
Double |
readonly SerializableData[] |
{readonly [TKey: string]: SerializableData}
type RpcScalarDataTypeHint =
'binary' |
'boolean' |
'float' |
'int' |
'string' |
'datetime'
export type RpcDataTypeHint =
null |
RpcScalarDataTypeHint |
{readonly [propertyPath: string]: RpcScalarDataTypeHint}
/**
* @deprecated Do not treat FastRPC type `binary`, type `double` respectively, as native JS class `Array`,
* type `number` respectively, with hint. Treat FastRPC type `binary`, type `double` respectively, as native JS
* class `ArrayBuffer`, non-native JS class `Double` respectively, instead.
*/
export function serializeCall(procedure: string, args: readonly RpcData[], dataTypeHint: RpcDataTypeHint): number[]
export function serializeCall(procedure: string, args: readonly SerializableData[]): number[]
/**
* @deprecated Do not treat FastRPC type `binary`, type `double` respectively, as native JS class `Array`,
* type `number` respectively, with hint. Treat FastRPC type `binary`, type `double` respectively, as native JS
* class `ArrayBuffer`, non-native JS class `Double` respectively, instead.
*/
export function serialize(data: RpcData, typeHint: RpcDataTypeHint): number[]
export function serialize(data: SerializableData): number[]
export type ParseOptions = {readonly arrayBuffers?: boolean}
export type ParsedData =
null |
boolean |
number |
string |
ArrayBuffer |
Date |
readonly ParsedData[] |
{readonly [TKey: string]: ParsedData}
export type ParsedCall = {
method: string,
params: ParsedData[]
}
/**
* @deprecated Do not treat FastRPC type `binary` as native JS class `Array`. Treat FastRPC type `binary` as native JS
* class `ArrayBuffer` instead.
*/
export function parse(data: readonly number[]): RpcData | {method: string, params: RpcData[]}
export function parse(data: readonly number[], options?: ParseOptions): ParsedData | ParsedCall