-
Notifications
You must be signed in to change notification settings - Fork 10
/
global.d.ts
134 lines (124 loc) · 2.28 KB
/
global.d.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
type LocationGeoJSON = {
type: "Point";
coordinates: number[];
};
type LocationLatLng = {
lat: number;
lng: number;
};
interface Metadata {
color?: string;
x?: string | number;
y?: string | number;
label?: string;
file?: {
url: string;
md5: string;
path: string;
};
icon?: string;
fixed_position?: {
[key: string]: {
color: string;
icon: string;
value: string;
x: string;
y: string;
};
};
sentValues?: [
{
label: string;
value: string | number | boolean;
}
];
[key: string]: any;
}
interface Data {
/**
* Name of the variable for the data.
*/
variable: string;
/**
* Data value.
*/
value?: string | number | boolean;
/**
* Group for the data. Used for grouping different data values.
*/
group?: string;
/**
* Series for the data. Used for grouping different data values.
*
* @deprecated Deprecating this in favor of 'group'.
*/
serie?: string;
/**
* Unit for the data value.
*/
unit?: string;
/**
* Location for the data value.
*/
location?: LocationGeoJSON | LocationLatLng | null;
/**
* Metadata for the data value.
*/
metadata?: Metadata;
/**
* Timestamp for the data value.
*/
time?: string | Date;
}
interface TagsObj {
key: string;
value: string;
}
interface ConfigurationParams {
sent: boolean;
key: string;
value: string;
id?: string;
}
interface DeviceInfo {
id: string;
profile: string;
bucket: string;
tags: TagsObj[];
params: ConfigurationParams[];
}
declare let payload: Data[];
declare const device: DeviceInfo;
declare const raw_payload: any;
/**
* Intellisense for this lib is unavailable
*/
declare function dayjs(...args: any[]): any;
/**
* Intellisense for this lib is unavailable
*/
declare function loraPacket(...args: any[]): any;
/**
* @deprecated
* Not available for payload parser
*/
declare const async: unknown;
/**
* @deprecated
* Not available for payload parser
*/
declare const await: unknown;
/**
* @deprecated
* Not available for payload parser
*/
declare const yield: unknown;
/**
* @deprecated
* Not available for payload parser
*/
// declare const require: unknown;
/**
* @deprecated Use \`dayjs\` instead.
*/
declare function moment(...args: any[]): any;