@trakit/objects 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API/Geography/Functions.d.ts +237 -0
- package/API/Geography/Interfaces.d.ts +151 -0
- package/API/Geography/LatLng.d.ts +87 -0
- package/API/Geography/LatLngBounds.d.ts +147 -0
- package/API/Geography/Position.d.ts +75 -0
- package/API/Geography/StreetAddress.d.ts +60 -0
- package/API/Geometry/Functions.d.ts +115 -0
- package/API/Geometry/Interfaces.d.ts +112 -0
- package/API/Geometry/Point.d.ts +82 -0
- package/API/Geometry/Radial.d.ts +111 -0
- package/API/Geometry/Rectangle.d.ts +160 -0
- package/API/Geometry/Size.d.ts +59 -0
- package/API/Interfaces/IAmCompany.d.ts +12 -0
- package/API/Interfaces/IBelongAsset.d.ts +16 -0
- package/API/Interfaces/IBelongBillingProfile.d.ts +16 -0
- package/API/Interfaces/IBelongCompany.d.ts +16 -0
- package/API/Interfaces/IDeserializable.d.ts +14 -0
- package/API/Interfaces/IEnabled.d.ts +11 -0
- package/API/Interfaces/IFileSize.d.ts +10 -0
- package/API/Interfaces/IGlobal.d.ts +12 -0
- package/API/Interfaces/IHavePermissions.d.ts +21 -0
- package/API/Interfaces/IHavePreferences.d.ts +30 -0
- package/API/Interfaces/IIconic.d.ts +16 -0
- package/API/Interfaces/IIdUlong.d.ts +11 -0
- package/API/Interfaces/ILabelled.d.ts +11 -0
- package/API/Interfaces/INamed.d.ts +14 -0
- package/API/Interfaces/IPictured.d.ts +16 -0
- package/API/Interfaces/IRequestable.d.ts +23 -0
- package/API/Interfaces/ISerializable.d.ts +11 -0
- package/API/Interfaces/ISuspendable.d.ts +17 -0
- package/API/Interfaces/IVisual.d.ts +19 -0
- package/Accounts/Permissions/Authorizer.d.ts +205 -0
- package/Accounts/Permissions/Permission.d.ts +57 -0
- package/Accounts/Permissions/PermissionEscalation.d.ts +42 -0
- package/Accounts/Permissions/PermissionEscalationState.d.ts +20 -0
- package/Accounts/Permissions/PermissionEscalationType.d.ts +14 -0
- package/Accounts/Permissions/PermissionLevel.d.ts +18 -0
- package/Accounts/Permissions/PermissionMethod.d.ts +14 -0
- package/Accounts/Permissions/PermissionType.d.ts +281 -0
- package/Billing/Hosting/BillableHostingBase.d.ts +42 -0
- package/Billing/Hosting/BillableHostingLicense.d.ts +31 -0
- package/Billing/Hosting/BillableHostingLicenseType.d.ts +21 -0
- package/Billing/Hosting/BillableHostingRule.d.ts +31 -0
- package/Billing/Hosting/BillableHostingType.d.ts +42 -0
- package/Billing/Report/BillingReport.d.ts +113 -0
- package/Billing/Report/BillingReportBreakdown.d.ts +35 -0
- package/Billing/Report/BillingReportHostingSummary.d.ts +37 -0
- package/Billing/Report/BillingReportLicenseBreakdown.d.ts +80 -0
- package/Billing/Report/BillingReportServiceBreakdown.d.ts +125 -0
- package/Billing/Report/BillingReportStatus.d.ts +26 -0
- package/Billing/Report/BillingReportSummary.d.ts +50 -0
- package/Hosting/Fields/FormFieldAttachments.d.ts +32 -0
- package/Hosting/Fields/FormFieldBase.d.ts +57 -0
- package/Hosting/Fields/FormFieldBase_fromJSON.d.ts +2 -0
- package/Hosting/Fields/FormFieldBoolean.d.ts +39 -0
- package/Hosting/Fields/FormFieldChoice.d.ts +47 -0
- package/Hosting/Fields/FormFieldDate.d.ts +27 -0
- package/Hosting/Fields/FormFieldNumeric.d.ts +55 -0
- package/Hosting/Fields/FormFieldNumericSize.d.ts +33 -0
- package/Hosting/Fields/FormFieldSignature.d.ts +18 -0
- package/Hosting/Fields/FormFieldText.d.ts +33 -0
- package/Hosting/Fields/FormFieldTime.d.ts +38 -0
- package/Hosting/Fields/FormFieldTimezone.d.ts +15 -0
- package/Providers/Config/ProviderConfig.d.ts +71 -0
- package/Providers/Config/ProviderRegistration.d.ts +120 -0
- package/Providers/Config/ProviderScript.d.ts +87 -0
- package/Providers/Config/ProviderScriptBlock.d.ts +42 -0
- package/Providers/Config/ProviderScriptParameter.d.ts +50 -0
- package/Providers/Config/ProviderScriptParameterType.d.ts +18 -0
- package/Providers/Configuration/ProviderConfiguration.d.ts +67 -0
- package/Providers/Configuration/ProviderConfigurationNode.d.ts +67 -0
- package/Providers/Configuration/ProviderConfigurationType.d.ts +63 -0
- package/Providers/Configuration/ProviderGeofenceBase.d.ts +30 -0
- package/Providers/Configuration/ProviderGeofenceBase_fromJSON.d.ts +2 -0
- package/Providers/Configuration/ProviderGeofenceCircular.d.ts +29 -0
- package/Providers/Configuration/ProviderGeofencePoint.d.ts +13 -0
- package/Providers/Configuration/ProviderGeofencePolygon.d.ts +24 -0
- package/Providers/Configuration/ProviderGeofenceRectangle.d.ts +29 -0
- package/index.d.ts +1 -1
- package/package.json +5 -7
- package/trakit-objects.min.js +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { IPoint } from '../Geometry/Interfaces';
|
|
2
|
+
import { int } from '../Types';
|
|
3
|
+
import { ILatLng, ILatLngBounds } from './Interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* The default precision used to serialize latlngs.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_PRECISION = 6;
|
|
8
|
+
/**
|
|
9
|
+
* The radius of the Earth in meters taken from the GRS-80, NAD83, and WGS-84 standards.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EARTH_RADIUS: number;
|
|
12
|
+
/**
|
|
13
|
+
* The ellipsoid of the Earth taken from the WGS-84 standard.
|
|
14
|
+
* @default ~298.2572
|
|
15
|
+
*/
|
|
16
|
+
export declare const EARTH_ELLIPSOID: number;
|
|
17
|
+
/**
|
|
18
|
+
* Inversion of the ellipsoid value for calculations.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EARTH_FLATENING: number;
|
|
21
|
+
/**
|
|
22
|
+
* The minor axis radius of an ellipsoid Earth as per WGS-84.
|
|
23
|
+
* @default ~6356752.3142
|
|
24
|
+
*/
|
|
25
|
+
export declare const EARTH_RADIUS_MINOR: number;
|
|
26
|
+
/**
|
|
27
|
+
* The surface area of the Earth in meters squared.
|
|
28
|
+
* @default 511207893395811
|
|
29
|
+
*/
|
|
30
|
+
export declare const EARTH_SURFACE: number;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare const EARTH_RADIUS_RATIO: number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare const EARTH_RADIUS_ECCENT: number;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export declare const EARTH_RADIUS_COM: number;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export declare const TILE_SIZE_PX: number;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
export declare const MAX_TILE_LAT: number;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
export declare const MAX_TILE_LNG: number;
|
|
55
|
+
/**
|
|
56
|
+
* Determines the map width and height (in pixels) at a specified level of detail.
|
|
57
|
+
* @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
|
|
58
|
+
* @returns The map width and height in pixels.
|
|
59
|
+
*/
|
|
60
|
+
export declare function tileMapSize(zoom: int): int;
|
|
61
|
+
/**
|
|
62
|
+
* Converts tile coordinates into pixel coordinates of the upper-left pixel of the specified tile.
|
|
63
|
+
* @param tile
|
|
64
|
+
*/
|
|
65
|
+
export declare function tileToPixel(tile: IPoint): IPoint;
|
|
66
|
+
/**
|
|
67
|
+
* Converts pixel coordinates into tile coordinates of the tile containing the specified pixel.
|
|
68
|
+
* @param pixel
|
|
69
|
+
*/
|
|
70
|
+
export declare function pixelToTile(pixel: IPoint): IPoint;
|
|
71
|
+
/**
|
|
72
|
+
* Converts a pixel coordinate into a LatLng at a specified level of detail.
|
|
73
|
+
* @param pixel
|
|
74
|
+
* @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
|
|
75
|
+
*/
|
|
76
|
+
export declare function pixelToLatlng(pixel: IPoint, zoom: int): ILatLng;
|
|
77
|
+
/**
|
|
78
|
+
* Converts a LatLng into a pixel coordinate at a specified level of detail.
|
|
79
|
+
* @param latlng
|
|
80
|
+
* @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
|
|
81
|
+
*/
|
|
82
|
+
export declare function latlngToPixel(latlng: ILatLng, zoom: int): IPoint;
|
|
83
|
+
/**
|
|
84
|
+
* Converts tile coordinates into a lat/lng boundary representing a complete tile.
|
|
85
|
+
* @param tile
|
|
86
|
+
* @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
|
|
87
|
+
* @param grow Number of pixels to grow the tilesize (helps with detecting stroke/border overlaps).
|
|
88
|
+
*/
|
|
89
|
+
export declare function tileToBounds(tile: IPoint, zoom: int, grow?: number): ILatLngBounds;
|
|
90
|
+
/**
|
|
91
|
+
* Converts pixel coordinates of a tile into a lat/lng boundary.
|
|
92
|
+
* @param pixel
|
|
93
|
+
* @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
|
|
94
|
+
* @param grow Number of pixels to grow the tilesize (helps with detecting stroke/border overlaps).
|
|
95
|
+
*/
|
|
96
|
+
export declare function pixelToBounds(pixel: IPoint, zoom: int, grow?: number): ILatLngBounds;
|
|
97
|
+
/**
|
|
98
|
+
* Returns the number of meters per pixel at the given latitude and zoom level.
|
|
99
|
+
* @param lat
|
|
100
|
+
* @param zoom
|
|
101
|
+
*/
|
|
102
|
+
export declare function metresPerPixel(lat: number, zoom: int): number;
|
|
103
|
+
/**
|
|
104
|
+
* Checks to see if a given latitude is at one of the poles.
|
|
105
|
+
* @param latitude
|
|
106
|
+
*/
|
|
107
|
+
export declare function LATITUDE_IS_POLE(latitude: number): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Normalizes a latitude value between +/- 90.
|
|
110
|
+
* Values of greater than 90 are returned as 90, and values less than -90 are returned as -90.
|
|
111
|
+
* @param latitude
|
|
112
|
+
* @param edge
|
|
113
|
+
*/
|
|
114
|
+
export declare function LATITUDE_NORMALIZED(latitude: number, edge?: number): number;
|
|
115
|
+
/**
|
|
116
|
+
* Normalizes a longitude value between +/- 180.
|
|
117
|
+
* Values of greater than 180 are returned as a negative difference of 360, and values less than -180 are returned as a positive difference of 360.
|
|
118
|
+
* @param longitude
|
|
119
|
+
* @param latitude When given, will check if the latitude is a pole, and converts the longitude to zero.
|
|
120
|
+
*/
|
|
121
|
+
export declare function LONGITUDE_NORMALIZED(longitude: number, latitude?: number): number;
|
|
122
|
+
/**
|
|
123
|
+
* The distance in meters before considering to coordinates to have the same location.
|
|
124
|
+
* @default 0.000000001
|
|
125
|
+
*/
|
|
126
|
+
export declare const MAX_SAME_DISTANCE = 1e-9;
|
|
127
|
+
/**
|
|
128
|
+
* Bearing from coordinate A to coordinate B in degrees from North.
|
|
129
|
+
* @param first The starting coordinate.
|
|
130
|
+
* @param last The ending coordinate.
|
|
131
|
+
* @return Degrees from North.
|
|
132
|
+
*/
|
|
133
|
+
export declare function LATLNG_ANGLE(first: ILatLng, last: ILatLng): number;
|
|
134
|
+
/**
|
|
135
|
+
* Calculates the distance between two coordinates on a sphere.
|
|
136
|
+
* @param first The starting coordinate.
|
|
137
|
+
* @param last The ending coordinate.
|
|
138
|
+
*/
|
|
139
|
+
export declare function LATLNG_DISTANCE(first: ILatLng, last: ILatLng): number;
|
|
140
|
+
/**
|
|
141
|
+
* Calculates the distance between two coordinates on a Bessel 1841 ellipsoid.
|
|
142
|
+
* @param start The starting coordinate.
|
|
143
|
+
* @param end The ending coordinate.
|
|
144
|
+
*/
|
|
145
|
+
export declare function LATLNG_DISTANCE_VINCENTY(start: ILatLng, end: ILatLng): number;
|
|
146
|
+
/**
|
|
147
|
+
* Calculates the orthogonal height of a triangle. The orthogonal height is
|
|
148
|
+
* calculated by drawing a line between the coordinate A and coordinate B,
|
|
149
|
+
* then getting the length of a line drawn up from the line to the mid
|
|
150
|
+
* coordinate at a 90 degree angle.
|
|
151
|
+
* @param first Left-most coordinate on the great circle.
|
|
152
|
+
* @param middle Top-most coordinate's latitude.
|
|
153
|
+
* @param last Right-most coordinate's longitude on the great circle.
|
|
154
|
+
* @return Value is negative when distance is to the right, and positive when distance to the left.
|
|
155
|
+
*/
|
|
156
|
+
export declare function LATLNG_GREAT_CIRCLE(first: ILatLng, middle: ILatLng, last: ILatLng): number;
|
|
157
|
+
/**
|
|
158
|
+
* Calculates the final coordinate based on the given starting coordinate and vector.
|
|
159
|
+
* @param pin The staring coordinate.
|
|
160
|
+
* @param meters The distance away from this LatLng.
|
|
161
|
+
* @param bearing The direction in which to calculate the new position in degrees from North.
|
|
162
|
+
* @throws {Error} Either latitude or longitude is NaN.
|
|
163
|
+
*/
|
|
164
|
+
export declare function LATLNG_TRANSLATE(pin: ILatLng, meters: number, bearing: number): ILatLng;
|
|
165
|
+
/**
|
|
166
|
+
* Calculates the mid-point between to given coordinate.
|
|
167
|
+
* @param first Left-most coordinate.
|
|
168
|
+
* @param last Right-most coordinate.
|
|
169
|
+
* @throws {Error} Either latitude or longitude is NaN.
|
|
170
|
+
*/
|
|
171
|
+
export declare function LATLNG_MIDPOINT(first: ILatLng, last: ILatLng): ILatLng;
|
|
172
|
+
/**
|
|
173
|
+
* Calculates the spherical-cap area occupied by the given radial distance.
|
|
174
|
+
* @param pin The coordinate at which to calculate the area.
|
|
175
|
+
* @param radius The distance from the centre of the circle to any point along the edge.
|
|
176
|
+
*/
|
|
177
|
+
export declare function SPHERECAP_AREA(pin: ILatLng, radius: number): void;
|
|
178
|
+
/**
|
|
179
|
+
* Calculates the length of the given route.
|
|
180
|
+
* @param route
|
|
181
|
+
*/
|
|
182
|
+
export declare function ROUTE_LENGTH(route: ILatLng[]): number;
|
|
183
|
+
/**
|
|
184
|
+
* Performs a Douglas-Peucker path reduction based on the given tolerance.
|
|
185
|
+
* @param route The array of coordinates representing a path.
|
|
186
|
+
* @param tolerance Distance (in meters) threshold for candidate coordinates. Default is 0.
|
|
187
|
+
*/
|
|
188
|
+
export declare function ROUTE_PEUCKER(route: ILatLng[], tolerance: number): ILatLng[];
|
|
189
|
+
/**
|
|
190
|
+
* An implementation of Google's Encoded Polyline Algorithm format.
|
|
191
|
+
* https://developers.google.com/maps/documentation/utilities/polylinealgorithm
|
|
192
|
+
* @param route The array of coordinates representing a path.
|
|
193
|
+
* @param precision Optional number of decimal places to use to calculate the results. Default is 5.
|
|
194
|
+
*/
|
|
195
|
+
export declare function ROUTE_ENCODE(route: ILatLng[], precision?: number): string;
|
|
196
|
+
/**
|
|
197
|
+
* An implementation of Google's Decoded Polyline Algorithm format.
|
|
198
|
+
* https://developers.google.com/maps/documentation/utilities/polylinealgorithm
|
|
199
|
+
* @param route The encoded string which represents the coordinates in a path.
|
|
200
|
+
* @param precision Optional number of decimal places used to recalculate the results. Default is 5.
|
|
201
|
+
*/
|
|
202
|
+
export declare function ROUTE_DECODE(route: string, precision?: number): ILatLng[];
|
|
203
|
+
/**
|
|
204
|
+
* Finds the widest section of the given route.
|
|
205
|
+
* This is useful for path reduction and reorientation.
|
|
206
|
+
* @param route The array of coordinates representing a path
|
|
207
|
+
* @return An array of three items; the first is the widest distance, and the others are the start and end index within the given route.
|
|
208
|
+
*/
|
|
209
|
+
export declare function GEOFENCE_WIDEST(route: ILatLng[]): [number, number, number];
|
|
210
|
+
/**
|
|
211
|
+
* Performs a Douglas-Peucker path reduction on a polygon for the given
|
|
212
|
+
* tolerance. The start/end coordinates are variable and the end coordinate
|
|
213
|
+
* is trimmed from the result.
|
|
214
|
+
* @param route The array of coordinates representing a path
|
|
215
|
+
* @param tolerance Distance (in meters) threshold for candidate coordinates. Default is 0.
|
|
216
|
+
*/
|
|
217
|
+
export declare function GEOFENCE_PEUCKER(route: ILatLng[], tolerance?: number): ILatLng[];
|
|
218
|
+
/**
|
|
219
|
+
* Calculates the total area occupied by the given geofence.
|
|
220
|
+
* @param route The array of coordinates representing a geofence.
|
|
221
|
+
* @throws {Error} Not enough coordinates.
|
|
222
|
+
*/
|
|
223
|
+
export declare function GEOFENCE_AREA(route: ILatLng[]): number;
|
|
224
|
+
/**
|
|
225
|
+
* A utility export function to determine if a given coordinate is inside the given geofence.
|
|
226
|
+
* @param route The array of coordinates represents the path of the polygon.
|
|
227
|
+
* @param pin The coordinate to be checked.
|
|
228
|
+
*/
|
|
229
|
+
export declare function GEOFENCE_CONTAINS(route: ILatLng[], pin: ILatLng): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Wraps the given coordinates into a polygonal path.
|
|
232
|
+
* The given coordinates do not need to be a path.
|
|
233
|
+
* The returned path is not closed.
|
|
234
|
+
* @param coordinates The array of coordinates on which to create the non-closed path
|
|
235
|
+
*/
|
|
236
|
+
export declare function GEOFENCE_WRAPPER(route: ILatLng[]): ILatLng[];
|
|
237
|
+
//# sourceMappingURL=Functions.d.ts.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { datetime, nothing } from '../Types';
|
|
2
|
+
/**
|
|
3
|
+
* A coordinate on the Earth.
|
|
4
|
+
*/
|
|
5
|
+
export interface ILatLng {
|
|
6
|
+
/**
|
|
7
|
+
* Latitude.
|
|
8
|
+
*/
|
|
9
|
+
lat: number;
|
|
10
|
+
/**
|
|
11
|
+
* Longitude.
|
|
12
|
+
*/
|
|
13
|
+
lng: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if the given pin conforms to the {@link ILatLng} interface.
|
|
17
|
+
* @param pin
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export declare function ILatLng_instanceOf(pin: any): pin is ILatLng;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param dot
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare function ILatLng_clone(dot: ILatLng): ILatLng;
|
|
27
|
+
/**
|
|
28
|
+
* GPS position information.
|
|
29
|
+
*/
|
|
30
|
+
export interface IPosition extends ILatLng {
|
|
31
|
+
/**
|
|
32
|
+
* Speed
|
|
33
|
+
*/
|
|
34
|
+
speed: number | nothing;
|
|
35
|
+
/**
|
|
36
|
+
* Direction of travel
|
|
37
|
+
*/
|
|
38
|
+
bearing: number | nothing;
|
|
39
|
+
/**
|
|
40
|
+
* Distance in meters from the sea level
|
|
41
|
+
*/
|
|
42
|
+
altitude: number | nothing;
|
|
43
|
+
/**
|
|
44
|
+
* Threshold in meters for the accuracy of a position
|
|
45
|
+
*/
|
|
46
|
+
accuracy: number | nothing;
|
|
47
|
+
/**
|
|
48
|
+
* The Date/Time of the GPS reading
|
|
49
|
+
*/
|
|
50
|
+
dts: datetime;
|
|
51
|
+
/**
|
|
52
|
+
* A description of the current road-segment
|
|
53
|
+
*/
|
|
54
|
+
address: string | nothing;
|
|
55
|
+
/**
|
|
56
|
+
* A better description of the current road-segment
|
|
57
|
+
*/
|
|
58
|
+
streetAddress: IStreetAddress | nothing;
|
|
59
|
+
/**
|
|
60
|
+
* The posted speed limit for the road segment
|
|
61
|
+
*/
|
|
62
|
+
speedLimit: number | nothing;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Returns true if the given pin conforms to the {@link IPosition} interface.
|
|
66
|
+
* @param pin
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
export declare function IPosition_instanceOf(pin: any): pin is IPosition;
|
|
70
|
+
/**
|
|
71
|
+
* A road segment description.
|
|
72
|
+
*/
|
|
73
|
+
export interface IStreetAddress {
|
|
74
|
+
/**
|
|
75
|
+
* House number.
|
|
76
|
+
*/
|
|
77
|
+
number: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* Full street name.
|
|
80
|
+
*/
|
|
81
|
+
street: string | null;
|
|
82
|
+
/**
|
|
83
|
+
* City name.
|
|
84
|
+
*/
|
|
85
|
+
city: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Region name.
|
|
88
|
+
*/
|
|
89
|
+
region: string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Province or state code.
|
|
92
|
+
* Codes should be a value from ISO 3166-2.
|
|
93
|
+
*/
|
|
94
|
+
province: string;
|
|
95
|
+
/**
|
|
96
|
+
* Country code.
|
|
97
|
+
* Codes should be a value from ISO 3166-1 alpha-2.
|
|
98
|
+
*/
|
|
99
|
+
country: string;
|
|
100
|
+
/**
|
|
101
|
+
* Postal or zip code.
|
|
102
|
+
*/
|
|
103
|
+
postal: string | null;
|
|
104
|
+
/**
|
|
105
|
+
* Indicates that there is a toll for the current road segment.
|
|
106
|
+
*/
|
|
107
|
+
isToll: boolean | null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns true if the given pin conforms to the {@link IStreetAddress} interface.
|
|
111
|
+
* @param address
|
|
112
|
+
* @returns
|
|
113
|
+
*/
|
|
114
|
+
export declare function IStreetAddress_instanceOf(address: any): address is IStreetAddress;
|
|
115
|
+
/**
|
|
116
|
+
* A rectangular boundary on a flat surface.
|
|
117
|
+
*/
|
|
118
|
+
export interface ILatLngBounds {
|
|
119
|
+
/**
|
|
120
|
+
* Northern latitude
|
|
121
|
+
*/
|
|
122
|
+
north: number;
|
|
123
|
+
/**
|
|
124
|
+
* Eastern longitude
|
|
125
|
+
*/
|
|
126
|
+
east: number;
|
|
127
|
+
/**
|
|
128
|
+
* Southern latitude
|
|
129
|
+
*/
|
|
130
|
+
south: number;
|
|
131
|
+
/**
|
|
132
|
+
* Western longitude
|
|
133
|
+
*/
|
|
134
|
+
west: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns true if the given box conforms to the {@link ILatLngBounds} interface.
|
|
138
|
+
* @param box
|
|
139
|
+
*/
|
|
140
|
+
export declare function ILatLngBounds_instanceOf(box: any): box is ILatLngBounds;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param box
|
|
144
|
+
* @returns
|
|
145
|
+
*/
|
|
146
|
+
export declare function ILatLngBounds_clone(box: ILatLngBounds): ILatLngBounds;
|
|
147
|
+
/**
|
|
148
|
+
* The types used to extend a {@link LatLngBounds}'s edges.
|
|
149
|
+
*/
|
|
150
|
+
export type LatLngBoundsExpansion = ILatLng | ILatLngBounds | LatLngBoundsExpansion[];
|
|
151
|
+
//# sourceMappingURL=Interfaces.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Point } from '../Geometry/Point';
|
|
2
|
+
import { JsonObject } from '../Types';
|
|
3
|
+
import { ILatLng } from './Interfaces';
|
|
4
|
+
import { LatLngBounds } from './LatLngBounds';
|
|
5
|
+
/**
|
|
6
|
+
* A coordinate on the Earth.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LatLng implements ILatLng {
|
|
9
|
+
/**
|
|
10
|
+
* Let's consider the zero-zero coordinates to be invalid.
|
|
11
|
+
*/
|
|
12
|
+
static readonly INVALID: LatLng;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param json
|
|
16
|
+
*/
|
|
17
|
+
static fromJSON(json: ILatLng | JsonObject): LatLng;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param latlng
|
|
21
|
+
* @param delimiter
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
static fromString(latlng: string, delimiter?: string): LatLng;
|
|
25
|
+
/**
|
|
26
|
+
* Latitude
|
|
27
|
+
*/
|
|
28
|
+
readonly lat: number;
|
|
29
|
+
/**
|
|
30
|
+
* Longitude
|
|
31
|
+
*/
|
|
32
|
+
readonly lng: number;
|
|
33
|
+
constructor(lat: number, lng: number);
|
|
34
|
+
/**
|
|
35
|
+
* Returns a string representation of this {@link LatLng}.
|
|
36
|
+
* @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value.
|
|
37
|
+
* @returns A string in the format of "lat,lng".
|
|
38
|
+
*/
|
|
39
|
+
toString(delimiter?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a literal of this {@link LatLng}.
|
|
42
|
+
* Used internally by {@link JSON.stringify}.
|
|
43
|
+
*/
|
|
44
|
+
toJSON(): ILatLng;
|
|
45
|
+
/**
|
|
46
|
+
* Compares this LatLng to another to see if they are equivalent.
|
|
47
|
+
* @param other The other LatLng to compare
|
|
48
|
+
* @param tolerance Distance tolerance before considering two nearly identical coordinates to be equal.
|
|
49
|
+
*/
|
|
50
|
+
isEqual(other: ILatLng, tolerance?: number): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Returns true if this coordinate is not NaN and not zero-zero.
|
|
53
|
+
*/
|
|
54
|
+
isValid(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Calculates the distance across the surface of the globe to another coordinate
|
|
57
|
+
* @param pin
|
|
58
|
+
*/
|
|
59
|
+
distanceTo(pin: ILatLng): number;
|
|
60
|
+
/**
|
|
61
|
+
* Calculates the starting bearing across the surface of the globe from the current coordinate to the given coordinate
|
|
62
|
+
* @param pin
|
|
63
|
+
*/
|
|
64
|
+
bearingTo(pin: ILatLng): number;
|
|
65
|
+
/**
|
|
66
|
+
* Returns a new coordinate at the given distance and bearing from this coordinate
|
|
67
|
+
* @param meters
|
|
68
|
+
* @param bearing
|
|
69
|
+
*/
|
|
70
|
+
toTranslated(meters: number, bearing: number): LatLng;
|
|
71
|
+
/**
|
|
72
|
+
* Returns a new LatLng at the half-way point between this and the given LatLng.
|
|
73
|
+
* @param pin The other coordinate.
|
|
74
|
+
* @throws {Error} Either latitude or longitude is NaN
|
|
75
|
+
*/
|
|
76
|
+
toBetween(pin: ILatLng): LatLng;
|
|
77
|
+
/**
|
|
78
|
+
* Creates a Point based on the given magnifier.
|
|
79
|
+
*/
|
|
80
|
+
toRadians(magnifier?: number): Point;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a square LatLngBounds centred around this LatLng.
|
|
83
|
+
* @param radius The closest distance (in meters) from this coordinate to the edges of the new LatLngBounds.
|
|
84
|
+
*/
|
|
85
|
+
toBounds(radius: number): LatLngBounds;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=LatLng.d.ts.map
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ISerializable } from '../Interfaces/ISerializable';
|
|
2
|
+
import { JsonObject } from '../Types';
|
|
3
|
+
import { ILatLng, ILatLngBounds, LatLngBoundsExpansion } from './Interfaces';
|
|
4
|
+
import { LatLng } from './LatLng';
|
|
5
|
+
/**
|
|
6
|
+
* A boundary on the globe
|
|
7
|
+
*/
|
|
8
|
+
export declare class LatLngBounds implements ILatLngBounds, ISerializable {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param json
|
|
12
|
+
*/
|
|
13
|
+
static fromJSON(json: ILatLngBounds | JsonObject): LatLngBounds;
|
|
14
|
+
/**
|
|
15
|
+
* Northern latitude
|
|
16
|
+
*/
|
|
17
|
+
north: number;
|
|
18
|
+
/**
|
|
19
|
+
* Eastern longitude
|
|
20
|
+
*/
|
|
21
|
+
east: number;
|
|
22
|
+
/**
|
|
23
|
+
* Southern latitude
|
|
24
|
+
*/
|
|
25
|
+
south: number;
|
|
26
|
+
/**
|
|
27
|
+
* Western longitude
|
|
28
|
+
*/
|
|
29
|
+
west: number;
|
|
30
|
+
constructor(...args: LatLngBoundsExpansion[]);
|
|
31
|
+
/**
|
|
32
|
+
* Returns a string representation of this {@link LatLng}.
|
|
33
|
+
* @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value.
|
|
34
|
+
* @returns A string in the format of "lat,lng".
|
|
35
|
+
*/
|
|
36
|
+
toString(delimiter?: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a literal of this {@link LatLngBounds}.
|
|
39
|
+
* Used internally by {@link JSON.stringify}.
|
|
40
|
+
*/
|
|
41
|
+
toJSON(): {
|
|
42
|
+
north: number;
|
|
43
|
+
east: number;
|
|
44
|
+
south: number;
|
|
45
|
+
west: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Compares this LatLng to another to see if they are equivalent.
|
|
49
|
+
* @param other The other LatLng to compare
|
|
50
|
+
* @param tolerance Distance tolerance before considering two nearly identical coordinates to be equal.
|
|
51
|
+
*/
|
|
52
|
+
isEqual(other: ILatLngBounds, tolerance?: number): boolean;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
isValid(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
isEmpty(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if a {@link LatLng} is contained within this boundary.
|
|
63
|
+
* @param pin The point to check
|
|
64
|
+
*/
|
|
65
|
+
contains(pin: ILatLng): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Checks if a {@link LatLngBounds} is contained within this boundary.
|
|
68
|
+
* @expose
|
|
69
|
+
* @this {LatLngBounds}
|
|
70
|
+
* @param bounds The other boundary to check
|
|
71
|
+
*/
|
|
72
|
+
encloses(bounds: ILatLngBounds): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Checks if a {@link LatLngBounds} overlaps this boundary.
|
|
75
|
+
* Also returns true if either boundary's {@link LatLngBounds#encloses} returns true.
|
|
76
|
+
* @param other The other boundary to check
|
|
77
|
+
*/
|
|
78
|
+
overlaps(other: ILatLngBounds): boolean;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param object
|
|
82
|
+
*/
|
|
83
|
+
private __expander;
|
|
84
|
+
/**
|
|
85
|
+
* Extends the boundary to envelop the given point(s) but does not automatically
|
|
86
|
+
* validate. This comes in efficient when doing many operations on a single
|
|
87
|
+
* PointBounds
|
|
88
|
+
*/
|
|
89
|
+
expand(latlngs: LatLngBoundsExpansion): this;
|
|
90
|
+
/**
|
|
91
|
+
* Extends the boundary to envelop the given point(s) and automatically validates
|
|
92
|
+
*/
|
|
93
|
+
extend(latlngs: LatLngBoundsExpansion): this;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
*/
|
|
97
|
+
getCentre(): LatLng;
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
getNorthEast(): LatLng;
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
getNorthWest(): LatLng;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
getSouthEast(): LatLng;
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
getSouthWest(): LatLng;
|
|
114
|
+
/**
|
|
115
|
+
* The mid-point coordinate between the north east and north west corners.
|
|
116
|
+
*/
|
|
117
|
+
getNorthMiddle(): LatLng;
|
|
118
|
+
/**
|
|
119
|
+
* The mid-point coordinate between the south east and south west corners.
|
|
120
|
+
*/
|
|
121
|
+
getSouthMiddle(): LatLng;
|
|
122
|
+
/**
|
|
123
|
+
* The mid-point coordinate between the north east and north west corners.
|
|
124
|
+
*/
|
|
125
|
+
getEastMiddle(): LatLng;
|
|
126
|
+
/**
|
|
127
|
+
* The mid-point coordinate between the south east and south west corners.
|
|
128
|
+
*/
|
|
129
|
+
getWestMiddle(): LatLng;
|
|
130
|
+
/**
|
|
131
|
+
* The distance in meters between the north-east corner and the south-west corner.
|
|
132
|
+
*/
|
|
133
|
+
getDiagonalDistance(): number;
|
|
134
|
+
/**
|
|
135
|
+
* The distance in meters between the north-most border and the south-most border.
|
|
136
|
+
*/
|
|
137
|
+
getLatitudinalDistance(): number;
|
|
138
|
+
/**
|
|
139
|
+
* The distance in meters between the east-most and the west-most points along the border closest to the equator.
|
|
140
|
+
*/
|
|
141
|
+
getLongitudinalDistance(): number;
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
validate(): this;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=LatLngBounds.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { datetime, JsonObject, nothing } from '../Types';
|
|
2
|
+
import { IPosition, IStreetAddress } from './Interfaces';
|
|
3
|
+
import { LatLng } from './LatLng';
|
|
4
|
+
import { StreetAddress } from './StreetAddress';
|
|
5
|
+
/**
|
|
6
|
+
* GPS position information
|
|
7
|
+
*/
|
|
8
|
+
export declare class Position extends LatLng implements IPosition {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param json
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
static fromJSON(json: IPosition | JsonObject): Position;
|
|
15
|
+
/**
|
|
16
|
+
* Speed
|
|
17
|
+
*/
|
|
18
|
+
readonly speed: number;
|
|
19
|
+
/**
|
|
20
|
+
* Direction of travel
|
|
21
|
+
*/
|
|
22
|
+
readonly bearing: number;
|
|
23
|
+
/**
|
|
24
|
+
* Distance in meters from the sea level
|
|
25
|
+
*/
|
|
26
|
+
readonly altitude: number;
|
|
27
|
+
/**
|
|
28
|
+
* Threshold in meters for the accuracy of a position
|
|
29
|
+
*/
|
|
30
|
+
readonly accuracy: number;
|
|
31
|
+
/**
|
|
32
|
+
* The Date/Time of the GPS reading
|
|
33
|
+
*/
|
|
34
|
+
readonly date: Date;
|
|
35
|
+
/**
|
|
36
|
+
* The Date/Time of the GPS reading
|
|
37
|
+
*/
|
|
38
|
+
get dts(): string;
|
|
39
|
+
/**
|
|
40
|
+
* A better description of the current road-segment
|
|
41
|
+
*/
|
|
42
|
+
readonly streetAddress: StreetAddress | null;
|
|
43
|
+
/**
|
|
44
|
+
* The posted speed limit for the road segment
|
|
45
|
+
*/
|
|
46
|
+
readonly speedLimit: number | nothing;
|
|
47
|
+
/**
|
|
48
|
+
* Provider Identifier
|
|
49
|
+
*/
|
|
50
|
+
readonly origin: string;
|
|
51
|
+
/**
|
|
52
|
+
* The road segment description
|
|
53
|
+
*/
|
|
54
|
+
readonly address: string;
|
|
55
|
+
constructor(lat?: number | nothing, lng?: number | nothing, speed?: number | nothing, bearing?: number | nothing, accuracy?: number | nothing, dts?: Date | number | datetime | nothing, address?: string | nothing, limit?: number | nothing, altitude?: number | nothing, street?: IStreetAddress | JsonObject | nothing);
|
|
56
|
+
/**
|
|
57
|
+
* Returns a text representation of this position.
|
|
58
|
+
* Returned strings cannot be converted back into {@link Position}
|
|
59
|
+
* objects, so don't use this for deserialization.
|
|
60
|
+
* @param delimiter
|
|
61
|
+
*/
|
|
62
|
+
toString(delimiter?: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a literal of this {@link Position}.
|
|
65
|
+
* Used internally by {@link JSON.stringify}.
|
|
66
|
+
*/
|
|
67
|
+
toJSON(): IPosition;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param position
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
isEqual(position: Position | IPosition): boolean;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=Position.d.ts.map
|