-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.js
83 lines (83 loc) · 1.72 KB
/
types.js
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
78
79
80
81
82
83
module.exports = {
1: {
qxType: 'Number',
pbType: 'Double',
emptyComparison: ' !== 0',
defaultValue: 0,
packed: true
},
2: {
qxType: 'Number',
pbType: 'Float',
emptyComparison: ' !== 0',
defaultValue: 0,
packed: true
},
3: {
qxType: 'String',
pbType: 'Int64String',
transform: '_toString',
emptyComparison: '.length > 0',
defaultValue: '\'\'',
writerTransform: `f = f.startsWith('0x') ? '' + parseInt(f, 16) : f`,
packed: true
},
4: {
qxType: 'String',
pbType: 'Uint64String',
transform: '_toString',
emptyComparison: '.length > 0',
defaultValue: '\'\'',
writerTransform: `f = f.startsWith('0x') ? '' + parseInt(f, 16) : f`,
packed: true
},
5: {
qxType: 'Number',
pbType: 'Int32',
emptyComparison: ' !== 0',
defaultValue: 0,
packed: true
},
6: {
qxType: 'String',
pbType: 'Fixed64String',
transform: '_toString',
emptyComparison: '.length > 0',
defaultValue: '\'\'',
writerTransform: `f = f.startsWith('0x') ? '' + parseInt(f, 16) : f`,
packed: true
},
7: {
qxType: 'Number',
pbType: 'Fixed32',
emptyComparison: ' !== 0',
defaultValue: 0,
packed: true
},
8: {
qxType: 'Boolean',
pbType: 'Bool',
emptyComparison: ' !== false',
defaultValue: false
},
9: {
qxType: 'String',
pbType: 'String',
emptyComparison: '.length > 0',
defaultValue: '\'\''
},
// 11: reference see message.js
12: {
qxType: 'Uint8Array',
pbType: 'Bytes',
emptyComparison: ' !== 0'
},
13: {
qxType: 'Number',
pbType: 'Uint32',
emptyComparison: ' !== 0',
defaultValue: 0,
packed: true
}
// 14: enum see message.js
}