@trakit/objects 0.0.1

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.
Files changed (219) hide show
  1. package/API/Arrays.d.ts +46 -0
  2. package/API/Base.d.ts +18 -0
  3. package/API/BaseComponent.d.ts +37 -0
  4. package/API/BaseCompound.d.ts +19 -0
  5. package/API/Codifier.d.ts +5 -0
  6. package/API/Component.d.ts +42 -0
  7. package/API/Compound.d.ts +19 -0
  8. package/API/Constants.d.ts +39 -0
  9. package/API/Conversion.d.ts +255 -0
  10. package/API/Files.d.ts +21 -0
  11. package/API/Functions.d.ts +191 -0
  12. package/API/Geography/Functions.d.ts +232 -0
  13. package/API/Geography/Interfaces.d.ts +145 -0
  14. package/API/Geography/LatLng.d.ts +78 -0
  15. package/API/Geography/LatLngBounds.d.ts +145 -0
  16. package/API/Geography/Position.d.ts +62 -0
  17. package/API/Geography/StreetAddress.d.ts +58 -0
  18. package/API/Geometry/Functions.d.ts +114 -0
  19. package/API/Geometry/Interfaces.d.ts +111 -0
  20. package/API/Geometry/Point.d.ts +80 -0
  21. package/API/Geometry/Radial.d.ts +109 -0
  22. package/API/Geometry/Rectangle.d.ts +163 -0
  23. package/API/Geometry/Size.d.ts +52 -0
  24. package/API/Guid.d.ts +4 -0
  25. package/API/Interfaces/IAmCompany.d.ts +11 -0
  26. package/API/Interfaces/IBelongAsset.d.ts +15 -0
  27. package/API/Interfaces/IBelongBillingProfile.d.ts +15 -0
  28. package/API/Interfaces/IBelongCompany.d.ts +15 -0
  29. package/API/Interfaces/IDeserializable.d.ts +12 -0
  30. package/API/Interfaces/IEnabled.d.ts +10 -0
  31. package/API/Interfaces/IFileSize.d.ts +9 -0
  32. package/API/Interfaces/IGlobal.d.ts +11 -0
  33. package/API/Interfaces/IHavePermissions.d.ts +20 -0
  34. package/API/Interfaces/IHavePreferences.d.ts +29 -0
  35. package/API/Interfaces/IIconic.d.ts +15 -0
  36. package/API/Interfaces/IIdUlong.d.ts +10 -0
  37. package/API/Interfaces/ILabelled.d.ts +9 -0
  38. package/API/Interfaces/INamed.d.ts +13 -0
  39. package/API/Interfaces/IPictured.d.ts +15 -0
  40. package/API/Interfaces/IRequestable.d.ts +18 -0
  41. package/API/Interfaces/ISerializable.d.ts +10 -0
  42. package/API/Interfaces/ISuspendable.d.ts +16 -0
  43. package/API/Interfaces/IVisual.d.ts +18 -0
  44. package/API/Maps.d.ts +28 -0
  45. package/API/Objects.d.ts +33 -0
  46. package/API/SearchPattern.d.ts +45 -0
  47. package/API/TimeSpan.d.ts +140 -0
  48. package/API/Timezone.d.ts +44 -0
  49. package/API/Timezones.d.ts +7 -0
  50. package/API/Types.d.ts +114 -0
  51. package/Accounts/Contact.d.ts +140 -0
  52. package/Accounts/Machine.d.ts +131 -0
  53. package/Accounts/NotificationMethod.d.ts +17 -0
  54. package/Accounts/Permissions/Authorizer.d.ts +204 -0
  55. package/Accounts/Permissions/Permission.d.ts +57 -0
  56. package/Accounts/Permissions/PermissionEscalation.d.ts +33 -0
  57. package/Accounts/Permissions/PermissionEscalationState.d.ts +17 -0
  58. package/Accounts/Permissions/PermissionEscalationType.d.ts +13 -0
  59. package/Accounts/Permissions/PermissionLevel.d.ts +17 -0
  60. package/Accounts/Permissions/PermissionMethod.d.ts +13 -0
  61. package/Accounts/Permissions/PermissionType.d.ts +280 -0
  62. package/Accounts/Session.d.ts +92 -0
  63. package/Accounts/SessionStatus.d.ts +29 -0
  64. package/Accounts/SystemsOfUnits.d.ts +13 -0
  65. package/Accounts/User.d.ts +147 -0
  66. package/Accounts/UserAdvanced.d.ts +54 -0
  67. package/Accounts/UserGeneral.d.ts +100 -0
  68. package/Accounts/UserGroup.d.ts +52 -0
  69. package/Accounts/UserNotifications.d.ts +76 -0
  70. package/Assets/Asset.d.ts +192 -0
  71. package/Assets/AssetAdvanced.d.ts +90 -0
  72. package/Assets/AssetAttribute.d.ts +71 -0
  73. package/Assets/AssetDispatch.d.ts +63 -0
  74. package/Assets/AssetGeneral.d.ts +109 -0
  75. package/Assets/AssetPlaceStatus.d.ts +31 -0
  76. package/Assets/AssetPlaceStatusType.d.ts +17 -0
  77. package/Assets/AssetType.d.ts +21 -0
  78. package/Assets/Person.d.ts +25 -0
  79. package/Assets/PersonGeneral.d.ts +35 -0
  80. package/Assets/Trailer.d.ts +42 -0
  81. package/Assets/TrailerGeneral.d.ts +47 -0
  82. package/Assets/Vehicle.d.ts +73 -0
  83. package/Assets/VehicleAdvanced.d.ts +25 -0
  84. package/Assets/VehicleGeneral.d.ts +33 -0
  85. package/Behaviours/Behaviour.d.ts +79 -0
  86. package/Behaviours/BehaviourLog.d.ts +97 -0
  87. package/Behaviours/BehaviourLogType.d.ts +21 -0
  88. package/Behaviours/BehaviourParameter.d.ts +37 -0
  89. package/Behaviours/BehaviourParameterType.d.ts +21 -0
  90. package/Behaviours/BehaviourScript.d.ts +84 -0
  91. package/Billing/BillableBase.d.ts +85 -0
  92. package/Billing/BillableSmsProfile.d.ts +26 -0
  93. package/Billing/BillingCurrency.d.ts +17 -0
  94. package/Billing/BillingCycle.d.ts +17 -0
  95. package/Billing/BillingProfile.d.ts +107 -0
  96. package/Billing/Hosting/BillableHostingBase.d.ts +41 -0
  97. package/Billing/Hosting/BillableHostingDiscount.d.ts +35 -0
  98. package/Billing/Hosting/BillableHostingLicense.d.ts +29 -0
  99. package/Billing/Hosting/BillableHostingLicenseType.d.ts +20 -0
  100. package/Billing/Hosting/BillableHostingRule.d.ts +29 -0
  101. package/Billing/Hosting/BillableHostingType.d.ts +41 -0
  102. package/Billing/Report/BillingReport.d.ts +114 -0
  103. package/Billing/Report/BillingReportBreakdown.d.ts +35 -0
  104. package/Billing/Report/BillingReportHostingSummary.d.ts +36 -0
  105. package/Billing/Report/BillingReportLicenseBreakdown.d.ts +80 -0
  106. package/Billing/Report/BillingReportServiceBreakdown.d.ts +126 -0
  107. package/Billing/Report/BillingReportStatus.d.ts +25 -0
  108. package/Billing/Report/BillingReportSummary.d.ts +51 -0
  109. package/Companies/ColourStyle.d.ts +25 -0
  110. package/Companies/Company.d.ts +150 -0
  111. package/Companies/CompanyDirectory.d.ts +49 -0
  112. package/Companies/CompanyGeneral.d.ts +51 -0
  113. package/Companies/CompanyPolicies.d.ts +62 -0
  114. package/Companies/CompanyReseller.d.ts +163 -0
  115. package/Companies/CompanyStyles.d.ts +46 -0
  116. package/Companies/LabelStyle.d.ts +46 -0
  117. package/Companies/NotificationServerEmail.d.ts +99 -0
  118. package/Companies/NotificationServerSms.d.ts +25 -0
  119. package/Companies/PasswordExpiryMode.d.ts +17 -0
  120. package/Companies/PasswordPolicy.d.ts +51 -0
  121. package/Companies/SessionMultiUser.d.ts +17 -0
  122. package/Companies/SessionPolicy.d.ts +47 -0
  123. package/Dispatch/DispatchDirection.d.ts +53 -0
  124. package/Dispatch/DispatchJob.d.ts +109 -0
  125. package/Dispatch/DispatchJobPriority.d.ts +25 -0
  126. package/Dispatch/DispatchStep.d.ts +99 -0
  127. package/Dispatch/DispatchStepState.d.ts +27 -0
  128. package/Dispatch/DispatchStepStatus.d.ts +21 -0
  129. package/Dispatch/DispatchTask.d.ts +156 -0
  130. package/Dispatch/DispatchTaskStatus.d.ts +50 -0
  131. package/Hosting/Document.d.ts +71 -0
  132. package/Hosting/Fields/FormFieldAttachments.d.ts +38 -0
  133. package/Hosting/Fields/FormFieldBase.d.ts +71 -0
  134. package/Hosting/Fields/FormFieldBoolean.d.ts +46 -0
  135. package/Hosting/Fields/FormFieldChoice.d.ts +48 -0
  136. package/Hosting/Fields/FormFieldDate.d.ts +33 -0
  137. package/Hosting/Fields/FormFieldNumeric.d.ts +61 -0
  138. package/Hosting/Fields/FormFieldNumericSize.d.ts +32 -0
  139. package/Hosting/Fields/FormFieldSignature.d.ts +17 -0
  140. package/Hosting/Fields/FormFieldText.d.ts +39 -0
  141. package/Hosting/Fields/FormFieldTime.d.ts +34 -0
  142. package/Hosting/Fields/FormFieldTimezone.d.ts +14 -0
  143. package/Hosting/FormFieldType.d.ts +127 -0
  144. package/Hosting/FormResult.d.ts +97 -0
  145. package/Hosting/FormTemplate.d.ts +81 -0
  146. package/Images/Dashcam.d.ts +70 -0
  147. package/Images/DashcamBase.d.ts +98 -0
  148. package/Images/DashcamLive.d.ts +43 -0
  149. package/Images/DashcamMediaType.d.ts +17 -0
  150. package/Images/Icon.d.ts +87 -0
  151. package/Images/IconGlyph.d.ts +54 -0
  152. package/Images/IconLabel.d.ts +32 -0
  153. package/Images/IconLayer.d.ts +33 -0
  154. package/Images/Picture.d.ts +73 -0
  155. package/Maintenance/MaintenanceInterval.d.ts +49 -0
  156. package/Maintenance/MaintenanceJob.d.ts +137 -0
  157. package/Maintenance/MaintenanceJobStatus.d.ts +21 -0
  158. package/Maintenance/MaintenanceSchedule.d.ts +119 -0
  159. package/Messaging/AlertPriority.d.ts +17 -0
  160. package/Messaging/AssetAlert.d.ts +28 -0
  161. package/Messaging/AssetMessage.d.ts +40 -0
  162. package/Messaging/MessageBase.d.ts +101 -0
  163. package/Messaging/MessageFolder.d.ts +13 -0
  164. package/Messaging/MessageStatus.d.ts +29 -0
  165. package/Messaging/MessageType.d.ts +33 -0
  166. package/Places/Place.d.ts +116 -0
  167. package/Places/PlaceType.d.ts +25 -0
  168. package/Providers/Config/ProviderConfig.d.ts +72 -0
  169. package/Providers/Config/ProviderRegistration.d.ts +123 -0
  170. package/Providers/Config/ProviderScript.d.ts +87 -0
  171. package/Providers/Config/ProviderScriptBlock.d.ts +40 -0
  172. package/Providers/Config/ProviderScriptParameter.d.ts +49 -0
  173. package/Providers/Config/ProviderScriptParameterType.d.ts +17 -0
  174. package/Providers/Configuration/ProviderConfiguration.d.ts +68 -0
  175. package/Providers/Configuration/ProviderConfigurationNode.d.ts +65 -0
  176. package/Providers/Configuration/ProviderConfigurationType.d.ts +62 -0
  177. package/Providers/Configuration/ProviderGeofenceBase.d.ts +31 -0
  178. package/Providers/Configuration/ProviderGeofenceCircular.d.ts +28 -0
  179. package/Providers/Configuration/ProviderGeofencePoint.d.ts +12 -0
  180. package/Providers/Configuration/ProviderGeofencePolygon.d.ts +23 -0
  181. package/Providers/Configuration/ProviderGeofenceRectangle.d.ts +28 -0
  182. package/Providers/Provider.d.ts +145 -0
  183. package/Providers/ProviderAdvanced.d.ts +51 -0
  184. package/Providers/ProviderCommand.d.ts +36 -0
  185. package/Providers/ProviderCommandStatus.d.ts +29 -0
  186. package/Providers/ProviderCommandType.d.ts +37 -0
  187. package/Providers/ProviderControl.d.ts +42 -0
  188. package/Providers/ProviderData.d.ts +30 -0
  189. package/Providers/ProviderGeneral.d.ts +117 -0
  190. package/Providers/ProviderType.d.ts +106 -0
  191. package/README.md +13 -0
  192. package/Reports/ReportBreakdown.d.ts +72 -0
  193. package/Reports/ReportBreakdownJob.d.ts +62 -0
  194. package/Reports/ReportBreakdownMessage.d.ts +65 -0
  195. package/Reports/ReportBreakdownTask.d.ts +71 -0
  196. package/Reports/ReportDataTotal.d.ts +50 -0
  197. package/Reports/ReportFilterMode.d.ts +17 -0
  198. package/Reports/ReportNotifications.d.ts +31 -0
  199. package/Reports/ReportOptions.d.ts +51 -0
  200. package/Reports/ReportParameter.d.ts +25 -0
  201. package/Reports/ReportParameterType.d.ts +59 -0
  202. package/Reports/ReportRecurrence.d.ts +54 -0
  203. package/Reports/ReportRecurrenceType.d.ts +34 -0
  204. package/Reports/ReportResult.d.ts +170 -0
  205. package/Reports/ReportResultData.d.ts +17 -0
  206. package/Reports/ReportSchedule.d.ts +112 -0
  207. package/Reports/ReportScorecard.d.ts +39 -0
  208. package/Reports/ReportScorecardParameter.d.ts +31 -0
  209. package/Reports/ReportScorecardRules.d.ts +26 -0
  210. package/Reports/ReportStatus.d.ts +29 -0
  211. package/Reports/ReportSummary.d.ts +119 -0
  212. package/Reports/ReportSummaryReason.d.ts +27 -0
  213. package/Reports/ReportTemplate.d.ts +82 -0
  214. package/Reports/ReportTotal.d.ts +48 -0
  215. package/Reports/ReportType.d.ts +42 -0
  216. package/Storage.d.ts +166 -0
  217. package/objects.d.ts +534 -0
  218. package/objects.min.js +7 -0
  219. package/package.json +22 -0
@@ -0,0 +1,191 @@
1
+ import { ISerializable } from "./Interfaces/ISerializable";
2
+ import { datetime } from "./Types";
3
+ /**
4
+ * Checks for both null and undefined
5
+ * @param value The variable to check
6
+ */
7
+ export declare function IS_NOTHING(value: any): value is null | undefined;
8
+ /**
9
+ * Checks to see if the given parameter is a number object or number literal.
10
+ * @param value The variable to check
11
+ */
12
+ export declare function IS_BOOLEAN(value: any): value is boolean;
13
+ /**
14
+ * Checks to see if the given parameter is a number object or number literal.
15
+ * @param value The variable to check
16
+ */
17
+ export declare function IS_NUMBER(value: any): value is number;
18
+ /**
19
+ * Checks to see if the given parameter is a number object or number literal.
20
+ * @param value The variable to check
21
+ */
22
+ export declare function IS_STRING(value: any): value is string;
23
+ /**
24
+ * Checks to see if the given parameter is a function from this window or another.
25
+ * @param value The variable to check
26
+ */
27
+ export declare function IS_FUNCTION(value: any): value is Function;
28
+ /**
29
+ * Returns the name of the given value's type.
30
+ * @param value The variable to check
31
+ */
32
+ export declare function OBJECT_TYPE(value: any): string;
33
+ /**
34
+ * Almost the opposite of {@link isNaN}.
35
+ * Checks to see if the given parameter is a number object, or number literal, and that it is not {@code value|NaN|Infinity}.
36
+ * This method will return {@code value|false} for values: {@code value|""}, {@code value|"1234"}, {@code value|null}, {@code value|undefined}, {@code value|true}, and {@code value|false}.
37
+ * @param value The variable to check
38
+ */
39
+ export declare function IS_AN(value: any): value is number;
40
+ /**
41
+ * Rounds a number to the desired number of decimal places. Using a negative places value will round to the nearest ten.
42
+ * @param number The number to be rounded
43
+ * @param places The number of decimal places. Default is 0.
44
+ */
45
+ export declare function ROUND_TO(number: number, places?: number): number;
46
+ /**
47
+ * Clips a number to the specified minimum and maximum values.
48
+ * @param n The number to clip
49
+ * @param min Minimum allowable value
50
+ * @param max Maximum allowable value
51
+ */
52
+ export declare function CLIP(n: number, min: number, max: number): number;
53
+ /**
54
+ * Calculates the Pythagorean length of a triangle given the length of the other two sides.
55
+ * @param width
56
+ * @param height
57
+ */
58
+ export declare function PYTHAGORA(width: number, height: number): number;
59
+ /**
60
+ * Parses a base-10 integer number from the given value.
61
+ * @param value
62
+ */
63
+ export declare function ID(value: any): number;
64
+ /**
65
+ * Creates a Date object out of the given value.
66
+ * @param value
67
+ */
68
+ export declare function DATE(value?: Date | number | datetime): Date;
69
+ /**
70
+ * An implementation of the Douglas-Peucker path reduction algorithm.
71
+ * @template TCoord A type of coordinate like a pixel or lat/lng.
72
+ * @param source Array of coordinates.
73
+ * @param triangleHeight Callback which performs a triangle height calculation between first point, middle point, and last point.
74
+ * @param tolerance The "kink" threshold.
75
+ * @returns Elements in the array are true if they should be kept.
76
+ */
77
+ export declare function DOUGLASPEUCKER_INTERNAL<TCoord>(source: TCoord[], triangleHeight: (first: TCoord, middle: TCoord, last: TCoord) => number, tolerance: number): boolean[];
78
+ /**
79
+ * An implementation of the {@link https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm|Ramer-Douglas-Peucker} path reduction algorithm.
80
+ * The source array should be more than two items in length, otherwise reduction is pointless.
81
+ * The callback function returns a number (greater than zero) as the triangle height as defiend by three points; first point, middle point, and last point.
82
+ * The "kink" threshold is set using the tolerance argument which must be a number greater than or equal to zero.
83
+ * @template TCoord
84
+ * @param source Array of coordinates of type "T".
85
+ * @param triangleHeight Callback which performs a triangle height calculation between first point, middle point, and last point.
86
+ * @param tolerance The "kink" threshold
87
+ */
88
+ export declare function DOUGLASPEUCKER<TCoord>(source: TCoord[], triangleHeight: (first: TCoord, middle: TCoord, last: TCoord) => number, tolerance: number): TCoord[];
89
+ /**
90
+ * Encodes the given string as a Provider password.
91
+ */
92
+ export declare function PASSWORD_ENCODE(value: string): string;
93
+ /**
94
+ * Decodes the given Provider password as a human readable value.
95
+ */
96
+ export declare function PASSWORD_DECODE(value: string): string;
97
+ /**
98
+ * Parses the input and returns a valid phone number prefixed by 1, or NaN if invalid.
99
+ * @param phone
100
+ * */
101
+ export declare function PHONE_PARSE(phone: string | number | undefined): number;
102
+ /**
103
+ * Internal method for returning a string representation of the given number, padded with zeros.
104
+ * @param num
105
+ * @param length
106
+ * @param decimals
107
+ * @param radix
108
+ */
109
+ export declare function ZERO_PADDED(num: number, length: number, decimals?: number, radix?: number): string;
110
+ /**
111
+ *
112
+ * @param source
113
+ * @param deep
114
+ * @returns
115
+ */
116
+ export declare function MAP_TO_OBJECT(source: Map<any, any>, deep?: boolean): object;
117
+ /**
118
+ *
119
+ * @param source
120
+ * @param deep
121
+ * @returns
122
+ */
123
+ export declare function MAP_TO_OBJECT_PREDICATE<K, V>(source: Map<K, V>, predicate: (key: K, value: V) => [string, any]): object;
124
+ /**
125
+ *
126
+ * @param source
127
+ * @param deep
128
+ * @returns
129
+ */
130
+ export declare function MAP_TO_OBJECT_VALUE_JSON<V extends ISerializable>(source: Map<any, V>): object;
131
+ /**
132
+ *
133
+ * @param map
134
+ * @param deep
135
+ * @returns
136
+ */
137
+ export declare function OBJECT_TO_MAP_BY_PREDICATE<K, V>(source: object, predicate: (key: string, value: any) => [K, V]): Map<K, V>;
138
+ /**
139
+ *
140
+ * @param map
141
+ * @param deep
142
+ * @returns
143
+ */
144
+ export declare function OBJECT_TO_MAP(source: object, deep?: boolean): Map<string, any>;
145
+ /**
146
+ *
147
+ * @param map
148
+ * @param deep
149
+ * @returns
150
+ */
151
+ export declare function OBJECT_TO_MAP_KEY_CODIFIED(source: object, deep?: boolean): Map<string, any>;
152
+ /**
153
+ *
154
+ * @param map
155
+ * @param deep
156
+ * @returns
157
+ */
158
+ export declare function OBJECT_TO_MAP_KEY_ULONG(source: object, deep?: boolean): Map<number, any>;
159
+ /**
160
+ *
161
+ * @param this
162
+ * @param value
163
+ * @returns
164
+ */
165
+ export declare function STRING_TO_ENUM<T extends {
166
+ [key: string]: T;
167
+ }>(this: T, value: string): T;
168
+ /**
169
+ * Serializes a {@link Date} to an ISO string, or null (for use in {@link ISerializable.toJSON}).
170
+ * @param date
171
+ */
172
+ export declare function JSON_DATE(date: Date): string | null;
173
+ /**
174
+ * Serializes a {@link Number} as itself, or null instead of {@link NaN} (for use in {@link ISerializable.toJSON}).
175
+ * @param date
176
+ */
177
+ export declare function JSON_NUMBER(num: number): number | null;
178
+ /**
179
+ *
180
+ */
181
+ export declare const WEEKDAYS: boolean[];
182
+ /**
183
+ * Creates an array of 7 boolean values.
184
+ * Extra values from the input are ignored.
185
+ * @param days
186
+ */
187
+ export declare function WEEKDAYS_PARSE(days: string | boolean[]): boolean[];
188
+ /**
189
+ * Creates as string of 7 characters (either `1` or `0`).
190
+ */
191
+ export declare function WEEKDAYS_JSON(days: string | boolean[]): string;
@@ -0,0 +1,232 @@
1
+ import { IPoint } from '../Geometry/Interfaces';
2
+ import { int } from '../Types';
3
+ import { ILatLng, ILatLngBounds } from './Interfaces';
4
+ /**
5
+ * The radius of the Earth in meters taken from the GRS-80, NAD83, and WGS-84 standards.
6
+ */
7
+ export declare const EARTH_RADIUS: number;
8
+ /**
9
+ * The ellipsoid of the Earth taken from the WGS-84 standard.
10
+ * @default ~298.2572
11
+ */
12
+ export declare const EARTH_ELLIPSOID: number;
13
+ /**
14
+ * Inversion of the ellipsoid value for calculations.
15
+ */
16
+ export declare const EARTH_FLATENING: number;
17
+ /**
18
+ * The minor axis radius of an ellipsoid Earth as per WGS-84.
19
+ * @default ~6356752.3142
20
+ */
21
+ export declare const EARTH_RADIUS_MINOR: number;
22
+ /**
23
+ * The surface area of the Earth in meters squared.
24
+ * @default 511207893395811
25
+ */
26
+ export declare const EARTH_SURFACE: number;
27
+ /**
28
+ *
29
+ */
30
+ export declare const EARTH_RADIUS_RATIO: number;
31
+ /**
32
+ *
33
+ */
34
+ export declare const EARTH_RADIUS_ECCENT: number;
35
+ /**
36
+ *
37
+ */
38
+ export declare const EARTH_RADIUS_COM: number;
39
+ /**
40
+ *
41
+ */
42
+ export declare const TILE_SIZE_PX: number;
43
+ /**
44
+ *
45
+ */
46
+ export declare const MAX_TILE_LAT: number;
47
+ /**
48
+ *
49
+ */
50
+ export declare const MAX_TILE_LNG: number;
51
+ /**
52
+ * Determines the map width and height (in pixels) at a specified level of detail.
53
+ * @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
54
+ * @returns The map width and height in pixels.
55
+ */
56
+ export declare function tileMapSize(zoom: int): int;
57
+ /**
58
+ * Converts tile coordinates into pixel coordinates of the upper-left pixel of the specified tile.
59
+ * @param tile
60
+ */
61
+ export declare function tileToPixel(tile: IPoint): IPoint;
62
+ /**
63
+ * Converts pixel coordinates into tile coordinates of the tile containing the specified pixel.
64
+ * @param pixel
65
+ */
66
+ export declare function pixelToTile(pixel: IPoint): IPoint;
67
+ /**
68
+ * Converts a pixel coordinate into a LatLng at a specified level of detail.
69
+ * @param pixel
70
+ * @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
71
+ */
72
+ export declare function pixelToLatlng(pixel: IPoint, zoom: int): ILatLng;
73
+ /**
74
+ * Converts a LatLng into a pixel coordinate at a specified level of detail.
75
+ * @param latlng
76
+ * @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
77
+ */
78
+ export declare function latlngToPixel(latlng: ILatLng, zoom: int): IPoint;
79
+ /**
80
+ * Converts tile coordinates into a lat/lng boundary representing a complete tile.
81
+ * @param tile
82
+ * @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
83
+ * @param grow Number of pixels to grow the tilesize (helps with detecting stroke/border overlaps).
84
+ */
85
+ export declare function tileToBounds(tile: IPoint, zoom: int, grow?: number): ILatLngBounds;
86
+ /**
87
+ * Converts pixel coordinates of a tile into a lat/lng boundary.
88
+ * @param pixel
89
+ * @param zoom Level of detail, from 1 (lowest detail) to 23 (highest detail).
90
+ * @param grow Number of pixels to grow the tilesize (helps with detecting stroke/border overlaps).
91
+ */
92
+ export declare function pixelToBounds(pixel: IPoint, zoom: int, grow?: number): ILatLngBounds;
93
+ /**
94
+ * Returns the number of meters per pixel at the given latitude and zoom level.
95
+ * @param lat
96
+ * @param zoom
97
+ */
98
+ export declare function metresPerPixel(lat: number, zoom: int): number;
99
+ /**
100
+ * Checks to see if a given latitude is at one of the poles.
101
+ * @param latitude
102
+ */
103
+ export declare function LATITUDE_IS_POLE(latitude: number): boolean;
104
+ /**
105
+ * Normalizes a latitude value between +/- 90.
106
+ * Values of greater than 90 are returned as 90, and values less than -90 are returned as -90.
107
+ * @param latitude
108
+ * @param edge
109
+ */
110
+ export declare function LATITUDE_NORMALIZED(latitude: number, edge?: number): number;
111
+ /**
112
+ * Normalizes a longitude value between +/- 180.
113
+ * 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.
114
+ * @param longitude
115
+ * @param latitude When given, will check if the latitude is a pole, and converts the longitude to zero.
116
+ */
117
+ export declare function LONGITUDE_NORMALIZED(longitude: number, latitude?: number): number;
118
+ /**
119
+ * The distance in meters before considering to coordinates to have the same location.
120
+ * @default 0.000000001
121
+ */
122
+ export declare const MAX_SAME_DISTANCE = 1e-9;
123
+ /**
124
+ * Bearing from coordinate A to coordinate B in degrees from North.
125
+ * @param first The starting coordinate.
126
+ * @param last The ending coordinate.
127
+ * @return Degrees from North.
128
+ */
129
+ export declare function LATLNG_ANGLE(first: ILatLng, last: ILatLng): number;
130
+ /**
131
+ * Calculates the distance between two coordinates on a sphere.
132
+ * @param first The starting coordinate.
133
+ * @param last The ending coordinate.
134
+ */
135
+ export declare function LATLNG_DISTANCE(first: ILatLng, last: ILatLng): number;
136
+ /**
137
+ * Calculates the distance between two coordinates on a Bessel 1841 ellipsoid.
138
+ * @param start The starting coordinate.
139
+ * @param end The ending coordinate.
140
+ */
141
+ export declare function LATLNG_DISTANCE_VINCENTY(start: ILatLng, end: ILatLng): number;
142
+ /**
143
+ * Calculates the orthogonal height of a triangle. The orthogonal height is
144
+ * calculated by drawing a line between the coordinate A and coordinate B,
145
+ * then getting the length of a line drawn up from the line to the mid
146
+ * coordinate at a 90 degree angle.
147
+ * @param first Left-most coordinate on the great circle.
148
+ * @param middle Top-most coordinate's latitude.
149
+ * @param last Right-most coordinate's longitude on the great circle.
150
+ * @return Value is negative when distance is to the right, and positive when distance to the left.
151
+ */
152
+ export declare function LATLNG_GREAT_CIRCLE(first: ILatLng, middle: ILatLng, last: ILatLng): number;
153
+ /**
154
+ * Calculates the final coordinate based on the given starting coordinate and vector.
155
+ * @param pin The staring coordinate.
156
+ * @param meters The distance away from this LatLng.
157
+ * @param bearing The direction in which to calculate the new position in degrees from North.
158
+ * @throws {Error} Either latitude or longitude is NaN.
159
+ */
160
+ export declare function LATLNG_TRANSLATE(pin: ILatLng, meters: number, bearing: number): ILatLng;
161
+ /**
162
+ * Calculates the mid-point between to given coordinate.
163
+ * @param first Left-most coordinate.
164
+ * @param last Right-most coordinate.
165
+ * @throws {Error} Either latitude or longitude is NaN.
166
+ */
167
+ export declare function LATLNG_MIDPOINT(first: ILatLng, last: ILatLng): ILatLng;
168
+ /**
169
+ * Calculates the spherical-cap area occupied by the given radial distance.
170
+ * @param pin The coordinate at which to calculate the area.
171
+ * @param radius The distance from the centre of the circle to any point along the edge.
172
+ */
173
+ export declare function SPHERECAP_AREA(pin: ILatLng, radius: number): void;
174
+ /**
175
+ * Calculates the length of the given route.
176
+ * @param route
177
+ */
178
+ export declare function ROUTE_LENGTH(route: ILatLng[]): number;
179
+ /**
180
+ * Performs a Douglas-Peucker path reduction based on the given tolerance.
181
+ * @param route The array of coordinates representing a path.
182
+ * @param tolerance Distance (in meters) threshold for candidate coordinates. Default is 0.
183
+ */
184
+ export declare function ROUTE_PEUCKER(route: ILatLng[], tolerance: number): ILatLng[];
185
+ /**
186
+ * An implementation of Google's Encoded Polyline Algorithm format.
187
+ * https://developers.google.com/maps/documentation/utilities/polylinealgorithm
188
+ * @param route The array of coordinates representing a path.
189
+ * @param precision Optional number of decimal places to use to calculate the results. Default is 5.
190
+ */
191
+ export declare function ROUTE_ENCODE(route: ILatLng[], precision?: number): string;
192
+ /**
193
+ * An implementation of Google's Decoded Polyline Algorithm format.
194
+ * https://developers.google.com/maps/documentation/utilities/polylinealgorithm
195
+ * @param route The encoded string which represents the coordinates in a path.
196
+ * @param precision Optional number of decimal places used to recalculate the results. Default is 5.
197
+ */
198
+ export declare function ROUTE_DECODE(route: string, precision?: number): ILatLng[];
199
+ /**
200
+ * Finds the widest section of the given route.
201
+ * This is useful for path reduction and reorientation.
202
+ * @param route The array of coordinates representing a path
203
+ * @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.
204
+ */
205
+ export declare function GEOFENCE_WIDEST(route: ILatLng[]): [number, number, number];
206
+ /**
207
+ * Performs a Douglas-Peucker path reduction on a polygon for the given
208
+ * tolerance. The start/end coordinates are variable and the end coordinate
209
+ * is trimmed from the result.
210
+ * @param route The array of coordinates representing a path
211
+ * @param tolerance Distance (in meters) threshold for candidate coordinates. Default is 0.
212
+ */
213
+ export declare function GEOFENCE_PEUCKER(route: ILatLng[], tolerance?: number): ILatLng[];
214
+ /**
215
+ * Calculates the total area occupied by the given geofence.
216
+ * @param route The array of coordinates representing a geofence.
217
+ * @throws {Error} Not enough coordinates.
218
+ */
219
+ export declare function GEOFENCE_AREA(route: ILatLng[]): number;
220
+ /**
221
+ * A utility export function to determine if a given coordinate is inside the given geofence.
222
+ * @param route The array of coordinates represents the path of the polygon.
223
+ * @param pin The coordinate to be checked.
224
+ */
225
+ export declare function GEOFENCE_CONTAINS(route: ILatLng[], pin: ILatLng): boolean;
226
+ /**
227
+ * Wraps the given coordinates into a polygonal path.
228
+ * The given coordinates do not need to be a path.
229
+ * The returned path is not closed.
230
+ * @param coordinates The array of coordinates on which to create the non-closed path
231
+ */
232
+ export declare function GEOFENCE_WRAPPER(route: ILatLng[]): ILatLng[];
@@ -0,0 +1,145 @@
1
+ /**
2
+ * A coordinate on the Earth.
3
+ */
4
+ export interface ILatLng {
5
+ /**
6
+ * Latitude.
7
+ */
8
+ lat: number;
9
+ /**
10
+ * Longitude.
11
+ */
12
+ lng: number;
13
+ }
14
+ /**
15
+ * Returns true if the given pin conforms to the {@link ILatLng} interface.
16
+ * @param pin
17
+ * @returns
18
+ */
19
+ export declare function ILatLng_instanceOf(pin: any): pin is ILatLng;
20
+ /**
21
+ *
22
+ * @param dot
23
+ * @returns
24
+ */
25
+ export declare function ILatLng_clone(dot: ILatLng): ILatLng;
26
+ /**
27
+ * GPS position information.
28
+ */
29
+ export interface IPosition extends ILatLng {
30
+ /**
31
+ Speed
32
+ */
33
+ speed: number | null;
34
+ /**
35
+ Direction of travel
36
+ */
37
+ bearing: number | null;
38
+ /**
39
+ Distance in meters from the sea level
40
+ */
41
+ altitude: number | null;
42
+ /**
43
+ Threshold in meters for the accuracy of a position
44
+ */
45
+ accuracy: number | null;
46
+ /**
47
+ The Date/Time of the GPS reading
48
+ */
49
+ dts: string | Date;
50
+ /**
51
+ A better description of the current road-segment
52
+ */
53
+ streetAddress: IStreetAddress | null;
54
+ /**
55
+ The posted speed limit for the road segment
56
+ */
57
+ speedLimit: number | null;
58
+ }
59
+ /**
60
+ * Returns true if the given pin conforms to the {@link IPosition} interface.
61
+ * @param pin
62
+ * @returns
63
+ */
64
+ export declare function IPosition_instanceOf(pin: any): pin is IPosition;
65
+ /**
66
+ * A road segment description.
67
+ */
68
+ export interface IStreetAddress {
69
+ /**
70
+ * House number.
71
+ */
72
+ number: string | null;
73
+ /**
74
+ * Full street name.
75
+ */
76
+ street: string | null;
77
+ /**
78
+ * City name.
79
+ */
80
+ city: string | null;
81
+ /**
82
+ * Region name.
83
+ */
84
+ region: string | null;
85
+ /**
86
+ * Province or state code.
87
+ * Codes should be a value from ISO 3166-2.
88
+ */
89
+ province: string;
90
+ /**
91
+ * Country code.
92
+ * Codes should be a value from ISO 3166-1 alpha-2.
93
+ */
94
+ country: string;
95
+ /**
96
+ * Postal or zip code.
97
+ */
98
+ postal: string | null;
99
+ /**
100
+ * Indicates that there is a toll for the current road segment.
101
+ */
102
+ isToll: boolean | null;
103
+ }
104
+ /**
105
+ * Returns true if the given pin conforms to the {@link IStreetAddress} interface.
106
+ * @param address
107
+ * @returns
108
+ */
109
+ export declare function IStreetAddress_instanceOf(address: any): address is IStreetAddress;
110
+ /**
111
+ * A rectangular boundary on a flat surface.
112
+ */
113
+ export interface ILatLngBounds {
114
+ /**
115
+ * Northern latitude
116
+ */
117
+ north: number;
118
+ /**
119
+ * Eastern longitude
120
+ */
121
+ east: number;
122
+ /**
123
+ * Southern latitude
124
+ */
125
+ south: number;
126
+ /**
127
+ * Western longitude
128
+ */
129
+ west: number;
130
+ }
131
+ /**
132
+ * Returns true if the given box conforms to the {@link ILatLngBounds} interface.
133
+ * @param box
134
+ */
135
+ export declare function ILatLngBounds_instanceOf(box: any): box is ILatLngBounds;
136
+ /**
137
+ *
138
+ * @param box
139
+ * @returns
140
+ */
141
+ export declare function ILatLngBounds_clone(box: ILatLngBounds): ILatLngBounds;
142
+ /**
143
+ * The types used to extend a {@link LatLngBounds}'s edges.
144
+ */
145
+ export type LatLngBoundsExpansion = ILatLng | ILatLngBounds | LatLngBoundsExpansion[];
@@ -0,0 +1,78 @@
1
+ import { Point } from '../Geometry/Point';
2
+ import { ILatLng } from './Interfaces';
3
+ import { LatLngBounds } from './LatLngBounds';
4
+ /**
5
+ * A coordinate on the Earth.
6
+ */
7
+ export declare class LatLng implements ILatLng {
8
+ /**
9
+ * Let's consider the zero-zero coordinates to be invalid.
10
+ */
11
+ static readonly INVALID: LatLng;
12
+ /**
13
+ *
14
+ * @param json
15
+ */
16
+ static fromJSON(json: any): LatLng;
17
+ /**
18
+ * Latitude
19
+ */
20
+ readonly lat: number;
21
+ /**
22
+ * Longitude
23
+ */
24
+ readonly lng: number;
25
+ constructor(lat: number, lng: number);
26
+ /**
27
+ * Returns a string representation of this {@link LatLng}.
28
+ * @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value.
29
+ * @returns A string in the format of "lat,lng".
30
+ */
31
+ toString(delimiter?: string): string;
32
+ /**
33
+ * Creates a literal of this {@link LatLng}.
34
+ * Used internally by {@link JSON.stringify}.
35
+ */
36
+ toJSON(): ILatLng;
37
+ /**
38
+ * Compares this LatLng to another to see if they are equivalent.
39
+ * @param other The other LatLng to compare
40
+ * @param tolerance Distance tolerance before considering two nearly identical coordinates to be equal.
41
+ */
42
+ isEqual(other: ILatLng, tolerance?: number): boolean;
43
+ /**
44
+ * Returns true if this coordinate is not NaN and not zero-zero.
45
+ */
46
+ isValid(): boolean;
47
+ /**
48
+ * Calculates the distance across the surface of the globe to another coordinate
49
+ * @param pin
50
+ */
51
+ distanceTo(pin: ILatLng): number;
52
+ /**
53
+ * Calculates the starting bearing across the surface of the globe from the current coordinate to the given coordinate
54
+ * @param pin
55
+ */
56
+ bearingTo(pin: ILatLng): number;
57
+ /**
58
+ * Returns a new coordinate at the given distance and bearing from this coordinate
59
+ * @param meters
60
+ * @param bearing
61
+ */
62
+ toTranslated(meters: number, bearing: number): LatLng;
63
+ /**
64
+ * Returns a new LatLng at the half-way point between this and the given LatLng.
65
+ * @param pin The other coordinate.
66
+ * @throws {Error} Either latitude or longitude is NaN
67
+ */
68
+ toBetween(pin: ILatLng): LatLng;
69
+ /**
70
+ * Creates a Point based on the given magnifier.
71
+ */
72
+ toRadians(magnifier?: number): Point;
73
+ /**
74
+ * Creates a square LatLngBounds centred around this LatLng.
75
+ * @param radius The closest distance (in meters) from this coordinate to the edges of the new LatLngBounds.
76
+ */
77
+ toBounds(radius: number): LatLngBounds;
78
+ }