forked from elecfreaks/pxt-esp8266iot
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenums.ts
More file actions
31 lines (30 loc) · 692 Bytes
/
Copy pathenums.ts
File metadata and controls
31 lines (30 loc) · 692 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
/** Human-readable representation of numbers for different ESP8266 wifi modes. */
enum WifiMode {
client = 1,
hotspot = 2,
both = 3
}
/** Forces user to acknowledge there are only 4 connections max. */
enum connectionSlot {
alpha = 0,
beta = 1,
charlie = 2,
delta = 3
}
/** The four common http methods. */
enum httpMethod {
GET = 0,
POST = 1,
PUT = 2,
DELETE = 3
}
/** Component function for enum httpMethod */
function getHttpMethodFromEnum(method:httpMethod):string{
switch(method){
case 0: return 'GET'
case 1: return 'POST'
case 2: return 'PUT'
case 3: return 'DELETE'
default: return 'GET'
}
}