-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinterfaces.ts
More file actions
186 lines (182 loc) · 4.12 KB
/
interfaces.ts
File metadata and controls
186 lines (182 loc) · 4.12 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/**
* Location methods according to https://www.iana.org/assignments/method-tokens/method-tokens.xhtml
*/
export enum LocationMethod {
/**
* Global Positioning System
*/
'GPS' = 'GPS',
/**
* GPS with assistance
*/
'A-GPS' = 'A-GPS',
/**
* entered manually by an operator or user, e.g., based on subscriber billing or service location information
*/
'Manual' = 'Manual',
/**
* provided by DHCP (used for wireline access networks)
*/
'DHCP' = 'DHCP',
/**
* triangulated from time-of-arrival, signal strength, or similar measurements
*/
'Triangulation' = 'Triangulation',
/**
* location of the cellular radio antenna
*/
'Cell' = 'Cell',
/**
* 802.11 access point (used for DHCP-based provisioning over wireless access networks)
*/
'AP-802.11' = '802.11',
}
/**
* https://tools.ietf.org/html/rfc4119
*
* Hints for Austria: \
* https://datatracker.ietf.org/doc/html/rfc5774
*/
export interface CivicAddress {
/**
* The country is identified by the two-letter ISO 3166 code \
* Example: US
*/
country?: string,
/**
* national subdivisions (state, region, province, prefecture) \
* Example: New York
*/
A1?: string,
/**
* county parish, gun (JP), district (IN) \
* https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.4.2: political district name \
* Example: King's County
*/
A2?: string,
/**
* city, township, shi (JP) \
* https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.4.2: commune name \
* Example: New York
*/
A3?: string,
/**
* city division, borough, city district, ward, chou (JP) \
* https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.4.2: village name \
* Example: Manhattan
*/
A4?: string,
/**
* neighborhood, block \
* https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.4.2: cadastral municipality name \
* Example: Morningside Heights
*/
A5?: string
/**
* street \
* Example: Broadway
*/
A6?: string,
/**
* Leading street direction \
* Example: N, W
*/
PRD?: string,
/**
* Trailing street suffix \
* Example: SW
*/
POD?: string,
/**
* Street suffix \
* Example: Avenue, Platz, Street
*/
STS?: string,
/**
* House nmber, numberic part only. \
* Example: 123
*/
HNO?: string,
/**
* House number suffix \
* Example: A, 1/2
*/
HNS?: string,
/**
* Landmark or vanity address \
* https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.1: Hofname \
* Example: Low Library
*/
LMK?: string,
/**
* Additional location information \
* Example: Room 543
*/
LOC?: string,
/**
* Floor \
* Example: 5
*/
FLR?: string,
/**
* Name (residence, business or office occupant) \
* https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.1: Volgoname \
* Example: Joe's Barbershop
*/
NAM?: string,
/**
* Unit (apartment, suite) \
* https://datatracker.ietf.org/doc/html/rfc5139#page-4 \
* Example: 12a
*/
UNIT?: string,
/**
* Postal code \
* Example: 10027-0401
*/
PC?: string,
/**
* New PIDF-LO elements
* https://datatracker.ietf.org/doc/html/rfc5139
*
* Some of the elements are used in Austria \
* Defined in https://datatracker.ietf.org/doc/html/rfc5774#appendix-A.1
*/
/**
* Street name and identifier
*/
RD?: string,
}
/**
* An interface that allows simple interaction with the more advanced PidfLo locations
*/
export interface SimpleLocation {
/**
* Latitude as WGS84 compatible decimal number
*/
latitude?: number,
/**
* Longitude as WGS84 compatible decimal number
*/
longitude?: number,
/**
* Altitude as WGS84 compatible decimal number
*/
altitude?: number,
/**
* Radius (accuracy) of the given location in meters
*/
radius?: number,
/**
* The method how the location was obtained by the caller's device
*/
method?: LocationMethod | string,
/**
* The timestamp when the location was initially retreived (e.g. from the GPS sensors)
*/
timestamp?: Date,
/**
* A civic address according to https://tools.ietf.org/html/rfc4119
*/
civic?: CivicAddress,
}