@trakit/objects 0.0.1 → 0.0.5
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/Base.d.ts +3 -2
- package/API/BaseComponent.d.ts +9 -6
- package/API/Codifier.d.ts +11 -1
- package/API/Encoding.d.ts +9 -0
- package/API/Files.d.ts +4 -4
- package/API/Functions.d.ts +26 -21
- package/API/Geography/Functions.d.ts +4 -0
- package/API/Geography/Interfaces.d.ts +19 -14
- package/API/Geography/LatLng.d.ts +9 -1
- package/API/Geography/LatLngBounds.d.ts +2 -1
- package/API/Geography/Position.d.ts +23 -11
- package/API/Geography/StreetAddress.d.ts +3 -2
- package/API/Geometry/Functions.d.ts +1 -1
- package/API/Geometry/Point.d.ts +4 -3
- package/API/Geometry/Radial.d.ts +5 -4
- package/API/Geometry/Rectangle.d.ts +3 -7
- package/API/Geometry/Size.d.ts +8 -2
- package/API/Interfaces/IAuditable.d.ts +31 -0
- package/API/Interfaces/IDeserializable.d.ts +2 -1
- package/API/Interfaces/ILabelled.d.ts +2 -1
- package/API/Interfaces/IRequestable.d.ts +5 -1
- package/API/Objects.d.ts +0 -28
- package/API/SearchPattern.d.ts +3 -2
- package/API/TimeSpan.d.ts +7 -38
- package/API/Timezone.d.ts +3 -3
- package/API/Types.d.ts +18 -0
- package/Accounts/Contact.d.ts +10 -10
- package/Accounts/Machine.d.ts +14 -6
- package/Accounts/Permissions/Permission.d.ts +3 -3
- package/Accounts/Permissions/PermissionEscalation.d.ts +11 -3
- package/Accounts/Permissions/PermissionEscalationState.d.ts +5 -3
- package/Accounts/Session.d.ts +2 -2
- package/Accounts/User.d.ts +10 -10
- package/Accounts/UserAdvanced.d.ts +2 -2
- package/Accounts/UserGeneral.d.ts +5 -5
- package/Accounts/UserGroup.d.ts +3 -3
- package/Accounts/UserNotifications.d.ts +2 -2
- package/Assets/Asset.d.ts +56 -24
- package/Assets/AssetAdvanced.d.ts +8 -20
- package/Assets/AssetAttribute.d.ts +2 -2
- package/Assets/AssetDispatch.d.ts +5 -12
- package/Assets/AssetGeneral.d.ts +44 -24
- package/Assets/AssetPlaceStatus.d.ts +2 -2
- package/Behaviours/Behaviour.d.ts +4 -4
- package/Behaviours/BehaviourLog.d.ts +3 -3
- package/Behaviours/BehaviourParameter.d.ts +2 -1
- package/Behaviours/BehaviourScript.d.ts +4 -4
- package/Billing/BillableBase.d.ts +3 -3
- package/Billing/BillableSmsProfile.d.ts +2 -2
- package/Billing/BillingProfile.d.ts +3 -3
- package/Billing/Hosting/BillableHostingBase.d.ts +2 -2
- package/Billing/Hosting/BillableHostingDiscount.d.ts +2 -1
- package/Billing/Hosting/BillableHostingLicense.d.ts +2 -1
- package/Billing/Hosting/BillableHostingRule.d.ts +2 -1
- package/Billing/Report/BillingReport.d.ts +3 -3
- package/Billing/Report/BillingReportBreakdown.d.ts +2 -2
- package/Billing/Report/BillingReportHostingSummary.d.ts +2 -2
- package/Billing/Report/BillingReportLicenseBreakdown.d.ts +2 -2
- package/Billing/Report/BillingReportServiceBreakdown.d.ts +2 -2
- package/Billing/Report/BillingReportSummary.d.ts +2 -2
- package/Companies/ColourStyle.d.ts +2 -2
- package/Companies/Company.d.ts +48 -33
- package/Companies/CompanyDirectory.d.ts +10 -5
- package/Companies/CompanyGeneral.d.ts +10 -5
- package/Companies/{CompanyPolicies.d.ts → CompanyPolicy.d.ts} +9 -4
- package/Companies/CompanyReseller.d.ts +14 -9
- package/Companies/{CompanyStyles.d.ts → CompanyStyle.d.ts} +11 -6
- package/Companies/LabelStyle.d.ts +2 -2
- package/Companies/NotificationServerEmail.d.ts +2 -2
- package/Companies/NotificationServerSms.d.ts +3 -3
- package/Companies/PasswordPolicy.d.ts +2 -2
- package/Companies/SessionPolicy.d.ts +2 -2
- package/Dispatch/DispatchDirection.d.ts +3 -3
- package/Dispatch/DispatchJob.d.ts +4 -4
- package/Dispatch/DispatchStep.d.ts +4 -4
- package/Dispatch/DispatchStepState.d.ts +3 -3
- package/Dispatch/DispatchTask.d.ts +5 -5
- package/Hosting/Document.d.ts +3 -3
- package/Hosting/Fields/FormFieldAttachments.d.ts +4 -11
- package/Hosting/Fields/FormFieldBase.d.ts +8 -23
- package/Hosting/Fields/FormFieldBase_fromJSON.d.ts +1 -0
- package/Hosting/Fields/FormFieldBoolean.d.ts +4 -12
- package/Hosting/Fields/FormFieldChoice.d.ts +10 -12
- package/Hosting/Fields/FormFieldDate.d.ts +2 -9
- package/Hosting/Fields/FormFieldNumeric.d.ts +2 -9
- package/Hosting/Fields/FormFieldSignature.d.ts +2 -2
- package/Hosting/Fields/FormFieldText.d.ts +2 -9
- package/Hosting/Fields/FormFieldTime.d.ts +12 -9
- package/Hosting/Fields/FormFieldTimezone.d.ts +2 -2
- package/Hosting/FormResult.d.ts +4 -4
- package/Hosting/FormTemplate.d.ts +3 -3
- package/Images/Dashcam.d.ts +3 -3
- package/Images/DashcamBase.d.ts +2 -2
- package/Images/DashcamLive.d.ts +3 -3
- package/Images/Icon.d.ts +7 -27
- package/Images/IconGlyph.d.ts +5 -12
- package/Images/IconLabel.d.ts +5 -8
- package/Images/Picture.d.ts +3 -3
- package/Maintenance/MaintenanceInterval.d.ts +2 -2
- package/Maintenance/MaintenanceJob.d.ts +3 -3
- package/Maintenance/MaintenanceSchedule.d.ts +4 -4
- package/Messaging/AssetAlert.d.ts +2 -1
- package/Messaging/AssetMessage.d.ts +2 -2
- package/Messaging/MessageBase.d.ts +3 -3
- package/Places/Place.d.ts +4 -4
- package/Providers/Config/ProviderConfig.d.ts +4 -4
- package/Providers/Config/ProviderRegistration.d.ts +2 -2
- package/Providers/Config/ProviderScript.d.ts +4 -4
- package/Providers/Config/ProviderScriptBlock.d.ts +2 -1
- package/Providers/Config/ProviderScriptParameter.d.ts +2 -2
- package/Providers/Configuration/ProviderConfiguration.d.ts +4 -4
- package/Providers/Configuration/ProviderConfigurationNode.d.ts +4 -3
- package/Providers/Configuration/ProviderConfigurationType.d.ts +4 -4
- package/Providers/Configuration/ProviderGeofenceBase.d.ts +6 -8
- package/Providers/Configuration/ProviderGeofenceBase_fromJSON.d.ts +1 -0
- package/Providers/Provider.d.ts +80 -14
- package/Providers/ProviderAdvanced.d.ts +4 -4
- package/Providers/ProviderCommand.d.ts +2 -2
- package/Providers/ProviderControl.d.ts +3 -3
- package/Providers/ProviderData.d.ts +2 -2
- package/Providers/ProviderGeneral.d.ts +18 -10
- package/Reports/ReportBreakdown.d.ts +9 -32
- package/Reports/ReportBreakdownJob.d.ts +6 -31
- package/Reports/ReportBreakdownMessage.d.ts +7 -32
- package/Reports/ReportBreakdownTask.d.ts +6 -31
- package/Reports/ReportBreakdown_fromJSON.d.ts +1 -0
- package/Reports/ReportNotifications.d.ts +3 -3
- package/Reports/ReportOptions.d.ts +3 -2
- package/Reports/ReportParameter.d.ts +2 -1
- package/Reports/ReportRecurrence.d.ts +2 -2
- package/Reports/ReportResult.d.ts +9 -9
- package/Reports/ReportSchedule.d.ts +3 -3
- package/Reports/ReportScorecard.d.ts +3 -3
- package/Reports/ReportScorecardParameter.d.ts +2 -2
- package/Reports/ReportScorecardRules.d.ts +2 -2
- package/Reports/ReportSummary.d.ts +5 -33
- package/Reports/ReportTemplate.d.ts +3 -3
- package/Reports/ReportTotal.d.ts +2 -2
- package/index.d.ts +406 -0
- package/package.json +31 -22
- package/{Storage.d.ts → storage.d.ts} +11 -1
- package/trakit-objects.min.js +8 -0
- package/API/Component.d.ts +0 -42
- package/API/Compound.d.ts +0 -19
- package/Assets/Person.d.ts +0 -25
- package/Assets/PersonGeneral.d.ts +0 -35
- package/Assets/Trailer.d.ts +0 -42
- package/Assets/TrailerGeneral.d.ts +0 -47
- package/Assets/Vehicle.d.ts +0 -73
- package/Assets/VehicleAdvanced.d.ts +0 -25
- package/Assets/VehicleGeneral.d.ts +0 -33
- package/README.md +0 -13
- package/Reports/ReportDataTotal.d.ts +0 -50
- package/objects.d.ts +0 -534
- package/objects.min.js +0 -7
package/API/Base.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IDeserializable } from './Interfaces/IDeserializable';
|
|
2
|
+
import { JsonObject, nothing } from './Types';
|
|
2
3
|
/**
|
|
3
4
|
* A base class used to construct objects from the sync system.
|
|
4
5
|
*/
|
|
@@ -7,12 +8,12 @@ export declare abstract class Base implements IDeserializable {
|
|
|
7
8
|
* Almost all objects can be constructed using a simple JSON object.
|
|
8
9
|
* @param json
|
|
9
10
|
*/
|
|
10
|
-
constructor(json?:
|
|
11
|
+
constructor(json?: JsonObject | nothing);
|
|
11
12
|
/**
|
|
12
13
|
* Updates this class from the given input.
|
|
13
14
|
* @param json A JSON value used to update this class.
|
|
14
15
|
* @param forced When true, forces the update.
|
|
15
16
|
* @returns True when an update was completed.
|
|
16
17
|
*/
|
|
17
|
-
abstract fromJSON(json:
|
|
18
|
+
abstract fromJSON(json: JsonObject, force?: boolean): boolean;
|
|
18
19
|
}
|
package/API/BaseComponent.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Base } from './Base';
|
|
2
2
|
import { IRequestable } from './Interfaces/IRequestable';
|
|
3
3
|
import { ISerializable } from './Interfaces/ISerializable';
|
|
4
|
-
import { int } from './Types';
|
|
4
|
+
import { email, guid, int, ulong } from './Types';
|
|
5
5
|
/**
|
|
6
6
|
* Any derived class can/should be serialized and given to a user.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class BaseComponent extends Base implements IRequestable, ISerializable {
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Object version keys used to validate synchronization for all object properties.
|
|
11
|
+
*/
|
|
12
|
+
private _version;
|
|
10
13
|
/**
|
|
11
14
|
* Object version keys used to validate synchronization for all object properties.
|
|
12
15
|
*/
|
|
@@ -24,11 +27,11 @@ export declare abstract class BaseComponent extends Base implements IRequestable
|
|
|
24
27
|
*/
|
|
25
28
|
protected updateVersions(versions?: int[]): boolean[];
|
|
26
29
|
/**
|
|
27
|
-
* Returns a
|
|
28
|
-
*
|
|
29
|
-
* @returns A
|
|
30
|
+
* Returns a value which can be used as a unique identifier for this object.
|
|
31
|
+
* Values are unique for each type of object, but can be identical for different object types.
|
|
32
|
+
* @returns A value unique for this type of object.
|
|
30
33
|
*/
|
|
31
|
-
abstract getKey(): string;
|
|
34
|
+
abstract getKey(): ulong | email | guid | string;
|
|
32
35
|
/**
|
|
33
36
|
* Creates a literal of this {@link BaseComponent}.
|
|
34
37
|
* Used internally by {@link JSON.stringify}.
|
package/API/Codifier.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { codified } from "./Types";
|
|
1
2
|
/**
|
|
2
3
|
* Creates a searchable/coded string based on a user inputted string. Quotation marks, apostrophes, and accents are removed.
|
|
3
4
|
* @param input
|
|
4
5
|
*/
|
|
5
|
-
export declare function CODIFY(input: string):
|
|
6
|
+
export declare function CODIFY(input: string): codified;
|
|
7
|
+
/**
|
|
8
|
+
* Wraps the {@code input} using the codified {@code terms} with the {@code prefix}s and {@code suffix}s.
|
|
9
|
+
* When a term is found beside a quotation mark or apostrophe, the mark is included inside the highlight.
|
|
10
|
+
* @param input The string to add HTML highlights to.
|
|
11
|
+
* @param terms Codified search terms from {@link CODIFY}.
|
|
12
|
+
* @param prefix Added to the beginning of each of the {@code terms}.
|
|
13
|
+
* @param suffix Added to the end of each of the {@code terms}.
|
|
14
|
+
*/
|
|
15
|
+
export declare function HIGHLIGHT(input: string, terms: codified[], [prefix, suffix]?: [string, string]): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes the given string as a {@link Provider#password}.
|
|
3
|
+
*/
|
|
4
|
+
export declare function PASSWORD_ENCODE(value: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Decodes the given {@link Provider#password} as a human readable value.
|
|
7
|
+
* @param value
|
|
8
|
+
* */
|
|
9
|
+
export declare function PASSWORD_DECODE(value: string): string;
|
package/API/Files.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ export declare function NUMBER_GROUPS(number: number, size?: number, delimiter?:
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates a more human readable string representation of the filesize.
|
|
13
13
|
* @param bytes
|
|
14
|
-
* @param places
|
|
15
|
-
* @param maxScale Largest size-scale to use for representing the file-size. Default is
|
|
14
|
+
* @param places The number of decimal places. Default is 0.
|
|
15
|
+
* @param maxScale Largest size-scale to use for representing the file-size. Default is "MB" (Megabyte), can be a value between 0 (Byte) and 6 (Exabyte).
|
|
16
16
|
* @param groupSize Quantity of digits per number group. The default is 3.
|
|
17
|
-
* @param groupDelimiter
|
|
17
|
+
* @param groupDelimiter Character(s) to use to divide the integer groups. The detauls is ",".
|
|
18
18
|
* @param decimalDelimiter Character(s) to use to divide the decimal groups. The detauls is same as delimiter.
|
|
19
19
|
* @param point Character(s) to use to divide the integer groups from the decimal groups. The detauls is ".".
|
|
20
20
|
* */
|
|
21
|
-
export declare function FILESIZE_HELPER(bytes: number, places?: number, maxScale?:
|
|
21
|
+
export declare function FILESIZE_HELPER(bytes: number, places?: number, maxScale?: string, groupSize?: number, groupDelimiter?: string, decimalDelimiter?: string, point?: string): string;
|
package/API/Functions.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { datetime } from "./Types";
|
|
1
|
+
import { datetime, JsonObject, nothing } from "./Types";
|
|
3
2
|
/**
|
|
4
3
|
* Checks for both null and undefined
|
|
5
4
|
* @param value The variable to check
|
|
6
5
|
*/
|
|
7
|
-
export declare function IS_NOTHING(value: any): value is
|
|
6
|
+
export declare function IS_NOTHING(value: any): value is nothing;
|
|
8
7
|
/**
|
|
9
8
|
* Checks to see if the given parameter is a number object or number literal.
|
|
10
9
|
* @param value The variable to check
|
|
@@ -65,7 +64,7 @@ export declare function ID(value: any): number;
|
|
|
65
64
|
* Creates a Date object out of the given value.
|
|
66
65
|
* @param value
|
|
67
66
|
*/
|
|
68
|
-
export declare function DATE(value?: Date | number | datetime): Date;
|
|
67
|
+
export declare function DATE(value?: Date | number | datetime | nothing): Date;
|
|
69
68
|
/**
|
|
70
69
|
* An implementation of the Douglas-Peucker path reduction algorithm.
|
|
71
70
|
* @template TCoord A type of coordinate like a pixel or lat/lng.
|
|
@@ -87,13 +86,26 @@ export declare function DOUGLASPEUCKER_INTERNAL<TCoord>(source: TCoord[], triang
|
|
|
87
86
|
*/
|
|
88
87
|
export declare function DOUGLASPEUCKER<TCoord>(source: TCoord[], triangleHeight: (first: TCoord, middle: TCoord, last: TCoord) => number, tolerance: number): TCoord[];
|
|
89
88
|
/**
|
|
90
|
-
*
|
|
89
|
+
* Returns a plural version of the given word.
|
|
90
|
+
* This obviously doesn't work for every word imaginable, but covers the standard object names in the Trak-iT APIs.
|
|
91
|
+
* @param word
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
export declare function PLURALIZE(word: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* Returns a singular version of the given word.
|
|
97
|
+
* This obviously doesn't work for every word imaginable, but covers the standard object names in the Trak-iT APIs.
|
|
98
|
+
* @param word
|
|
99
|
+
* @returns
|
|
91
100
|
*/
|
|
92
|
-
export declare function
|
|
101
|
+
export declare function SINGULARIZE(word: string): string;
|
|
93
102
|
/**
|
|
94
|
-
*
|
|
103
|
+
* Returns the given word with the first letter capitalized (or lower-cased).
|
|
104
|
+
* @param word
|
|
105
|
+
* @param upper
|
|
106
|
+
* @returns
|
|
95
107
|
*/
|
|
96
|
-
export declare function
|
|
108
|
+
export declare function CAPITALIZE(word: string, upper?: boolean): string;
|
|
97
109
|
/**
|
|
98
110
|
* Parses the input and returns a valid phone number prefixed by 1, or NaN if invalid.
|
|
99
111
|
* @param phone
|
|
@@ -113,49 +125,42 @@ export declare function ZERO_PADDED(num: number, length: number, decimals?: numb
|
|
|
113
125
|
* @param deep
|
|
114
126
|
* @returns
|
|
115
127
|
*/
|
|
116
|
-
export declare function
|
|
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;
|
|
128
|
+
export declare function MAP_TO_JSON(source: Map<any, any>, deep?: boolean): JsonObject;
|
|
124
129
|
/**
|
|
125
130
|
*
|
|
126
131
|
* @param source
|
|
127
132
|
* @param deep
|
|
128
133
|
* @returns
|
|
129
134
|
*/
|
|
130
|
-
export declare function
|
|
135
|
+
export declare function MAP_TO_JSON_PREDICATE<K, V>(source: Map<K, V>, predicate: (key: K, value: V) => [string, any]): JsonObject;
|
|
131
136
|
/**
|
|
132
137
|
*
|
|
133
138
|
* @param map
|
|
134
139
|
* @param deep
|
|
135
140
|
* @returns
|
|
136
141
|
*/
|
|
137
|
-
export declare function
|
|
142
|
+
export declare function JSON_TO_MAP_PREDICATE<K, V>(source: object, predicate: (key: string, value: any) => [K, V]): Map<K, V>;
|
|
138
143
|
/**
|
|
139
144
|
*
|
|
140
145
|
* @param map
|
|
141
146
|
* @param deep
|
|
142
147
|
* @returns
|
|
143
148
|
*/
|
|
144
|
-
export declare function
|
|
149
|
+
export declare function JSON_TO_MAP(source: object, deep?: boolean): Map<string, any>;
|
|
145
150
|
/**
|
|
146
151
|
*
|
|
147
152
|
* @param map
|
|
148
153
|
* @param deep
|
|
149
154
|
* @returns
|
|
150
155
|
*/
|
|
151
|
-
export declare function
|
|
156
|
+
export declare function JSON_TO_MAP_KEY_CODIFIED(source: object, deep?: boolean): Map<string, any>;
|
|
152
157
|
/**
|
|
153
158
|
*
|
|
154
159
|
* @param map
|
|
155
160
|
* @param deep
|
|
156
161
|
* @returns
|
|
157
162
|
*/
|
|
158
|
-
export declare function
|
|
163
|
+
export declare function JSON_TO_MAP_KEY_ULONG(source: object, deep?: boolean): Map<number, any>;
|
|
159
164
|
/**
|
|
160
165
|
*
|
|
161
166
|
* @param this
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IPoint } from '../Geometry/Interfaces';
|
|
2
2
|
import { int } from '../Types';
|
|
3
3
|
import { ILatLng, ILatLngBounds } from './Interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* The default precision used to serialize latlngs.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_PRECISION = 6;
|
|
4
8
|
/**
|
|
5
9
|
* The radius of the Earth in meters taken from the GRS-80, NAD83, and WGS-84 standards.
|
|
6
10
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { datetime, nothing } from '../Types';
|
|
1
2
|
/**
|
|
2
3
|
* A coordinate on the Earth.
|
|
3
4
|
*/
|
|
@@ -28,33 +29,37 @@ export declare function ILatLng_clone(dot: ILatLng): ILatLng;
|
|
|
28
29
|
*/
|
|
29
30
|
export interface IPosition extends ILatLng {
|
|
30
31
|
/**
|
|
31
|
-
|
|
32
|
+
* Speed
|
|
32
33
|
*/
|
|
33
|
-
speed: number |
|
|
34
|
+
speed: number | nothing;
|
|
34
35
|
/**
|
|
35
|
-
|
|
36
|
+
* Direction of travel
|
|
36
37
|
*/
|
|
37
|
-
bearing: number |
|
|
38
|
+
bearing: number | nothing;
|
|
38
39
|
/**
|
|
39
|
-
|
|
40
|
+
* Distance in meters from the sea level
|
|
40
41
|
*/
|
|
41
|
-
altitude: number |
|
|
42
|
+
altitude: number | nothing;
|
|
42
43
|
/**
|
|
43
|
-
|
|
44
|
+
* Threshold in meters for the accuracy of a position
|
|
44
45
|
*/
|
|
45
|
-
accuracy: number |
|
|
46
|
+
accuracy: number | nothing;
|
|
46
47
|
/**
|
|
47
|
-
|
|
48
|
+
* The Date/Time of the GPS reading
|
|
48
49
|
*/
|
|
49
|
-
dts:
|
|
50
|
+
dts: datetime;
|
|
50
51
|
/**
|
|
51
|
-
|
|
52
|
+
* A description of the current road-segment
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
address: string | nothing;
|
|
54
55
|
/**
|
|
55
|
-
|
|
56
|
+
* A better description of the current road-segment
|
|
56
57
|
*/
|
|
57
|
-
|
|
58
|
+
streetAddress: IStreetAddress | nothing;
|
|
59
|
+
/**
|
|
60
|
+
* The posted speed limit for the road segment
|
|
61
|
+
*/
|
|
62
|
+
speedLimit: number | nothing;
|
|
58
63
|
}
|
|
59
64
|
/**
|
|
60
65
|
* Returns true if the given pin conforms to the {@link IPosition} interface.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Point } from '../Geometry/Point';
|
|
2
|
+
import { JsonObject } from '../Types';
|
|
2
3
|
import { ILatLng } from './Interfaces';
|
|
3
4
|
import { LatLngBounds } from './LatLngBounds';
|
|
4
5
|
/**
|
|
@@ -13,7 +14,14 @@ export declare class LatLng implements ILatLng {
|
|
|
13
14
|
*
|
|
14
15
|
* @param json
|
|
15
16
|
*/
|
|
16
|
-
static fromJSON(json:
|
|
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;
|
|
17
25
|
/**
|
|
18
26
|
* Latitude
|
|
19
27
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISerializable } from '../Interfaces/ISerializable';
|
|
2
|
+
import { JsonObject } from '../Types';
|
|
2
3
|
import { ILatLng, ILatLngBounds, LatLngBoundsExpansion } from './Interfaces';
|
|
3
4
|
import { LatLng } from './LatLng';
|
|
4
5
|
/**
|
|
@@ -9,7 +10,7 @@ export declare class LatLngBounds implements ILatLngBounds, ISerializable {
|
|
|
9
10
|
*
|
|
10
11
|
* @param json
|
|
11
12
|
*/
|
|
12
|
-
static fromJSON(json:
|
|
13
|
+
static fromJSON(json: ILatLngBounds | JsonObject): LatLngBounds;
|
|
13
14
|
/**
|
|
14
15
|
* Northern latitude
|
|
15
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { datetime } from '../Types';
|
|
1
|
+
import { datetime, JsonObject, nothing } from '../Types';
|
|
2
2
|
import { IPosition, IStreetAddress } from './Interfaces';
|
|
3
3
|
import { LatLng } from './LatLng';
|
|
4
4
|
import { StreetAddress } from './StreetAddress';
|
|
@@ -6,26 +6,32 @@ import { StreetAddress } from './StreetAddress';
|
|
|
6
6
|
* GPS position information
|
|
7
7
|
*/
|
|
8
8
|
export declare class Position extends LatLng implements IPosition {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param json
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
static fromJSON(json: IPosition | JsonObject): Position;
|
|
9
15
|
/**
|
|
10
16
|
* Speed
|
|
11
17
|
*/
|
|
12
|
-
speed: number;
|
|
18
|
+
readonly speed: number;
|
|
13
19
|
/**
|
|
14
20
|
* Direction of travel
|
|
15
21
|
*/
|
|
16
|
-
bearing: number;
|
|
22
|
+
readonly bearing: number;
|
|
17
23
|
/**
|
|
18
24
|
* Distance in meters from the sea level
|
|
19
25
|
*/
|
|
20
|
-
altitude: number;
|
|
26
|
+
readonly altitude: number;
|
|
21
27
|
/**
|
|
22
28
|
* Threshold in meters for the accuracy of a position
|
|
23
29
|
*/
|
|
24
|
-
accuracy: number;
|
|
30
|
+
readonly accuracy: number;
|
|
25
31
|
/**
|
|
26
32
|
* The Date/Time of the GPS reading
|
|
27
33
|
*/
|
|
28
|
-
date: Date;
|
|
34
|
+
readonly date: Date;
|
|
29
35
|
/**
|
|
30
36
|
* The Date/Time of the GPS reading
|
|
31
37
|
*/
|
|
@@ -33,20 +39,20 @@ export declare class Position extends LatLng implements IPosition {
|
|
|
33
39
|
/**
|
|
34
40
|
* A better description of the current road-segment
|
|
35
41
|
*/
|
|
36
|
-
streetAddress: StreetAddress | null;
|
|
42
|
+
readonly streetAddress: StreetAddress | null;
|
|
37
43
|
/**
|
|
38
44
|
* The posted speed limit for the road segment
|
|
39
45
|
*/
|
|
40
|
-
speedLimit: number;
|
|
46
|
+
readonly speedLimit: number | nothing;
|
|
41
47
|
/**
|
|
42
48
|
* Provider Identifier
|
|
43
49
|
*/
|
|
44
|
-
origin: string;
|
|
50
|
+
readonly origin: string;
|
|
45
51
|
/**
|
|
46
52
|
* The road segment description
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
constructor(lat?: number, lng?: number, speed?: number, bearing?: number, accuracy?: number, dts?: Date | number | datetime, limit?: number, altitude?: number, street?: IStreetAddress);
|
|
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);
|
|
50
56
|
/**
|
|
51
57
|
* Returns a text representation of this position.
|
|
52
58
|
* Returned strings cannot be converted back into {@link Position}
|
|
@@ -59,4 +65,10 @@ export declare class Position extends LatLng implements IPosition {
|
|
|
59
65
|
* Used internally by {@link JSON.stringify}.
|
|
60
66
|
*/
|
|
61
67
|
toJSON(): IPosition;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param position
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
isEqual(position: Position | IPosition): boolean;
|
|
62
74
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISerializable } from "../Interfaces/ISerializable";
|
|
2
|
+
import { JsonObject, nothing } from "../Types";
|
|
2
3
|
import { IStreetAddress } from "./Interfaces";
|
|
3
4
|
/**
|
|
4
5
|
* A road segment description
|
|
@@ -8,7 +9,7 @@ export declare class StreetAddress implements IStreetAddress, ISerializable {
|
|
|
8
9
|
*
|
|
9
10
|
* @param street
|
|
10
11
|
*/
|
|
11
|
-
static fromJSON(json:
|
|
12
|
+
static fromJSON(json: IStreetAddress | JsonObject): StreetAddress;
|
|
12
13
|
/**
|
|
13
14
|
* House number.
|
|
14
15
|
*/
|
|
@@ -43,7 +44,7 @@ export declare class StreetAddress implements IStreetAddress, ISerializable {
|
|
|
43
44
|
* Indicates that there is a toll for the current road segment.
|
|
44
45
|
*/
|
|
45
46
|
isToll: boolean;
|
|
46
|
-
constructor(number?: string |
|
|
47
|
+
constructor(number?: string | nothing, street?: string | nothing, city?: string | nothing, region?: string | nothing, province?: string | nothing, country?: string | nothing, postal?: string | nothing, isToll?: boolean | nothing);
|
|
47
48
|
/**
|
|
48
49
|
* Returns a text representation of this address.
|
|
49
50
|
* Returned strings cannot be converted back into {@link StreetAddress}
|
|
@@ -77,7 +77,7 @@ export declare function RADIAL_AREA(radius: number): number;
|
|
|
77
77
|
* @param points The array of points on which to create the Radial
|
|
78
78
|
* @param iterations The higher the iterations the slower and more accurate the Radial. Default is 10,000.
|
|
79
79
|
* */
|
|
80
|
-
export declare function RADIAL_BADOIU_CLARKSON(points: IPoint[], iterations
|
|
80
|
+
export declare function RADIAL_BADOIU_CLARKSON(points: IPoint[], iterations?: number): IRadial;
|
|
81
81
|
/**
|
|
82
82
|
* Calculates the circumference of a circle based on the given radius.
|
|
83
83
|
* @param radius
|
package/API/Geometry/Point.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ISerializable } from '../Interfaces/ISerializable';
|
|
2
|
+
import { JsonObject } from '../Types';
|
|
1
3
|
import { IPoint } from './Interfaces';
|
|
2
4
|
import { Radial } from './Radial';
|
|
3
|
-
import { ISerializable } from '../Interfaces/ISerializable';
|
|
4
5
|
/**
|
|
5
6
|
* A coordinate on a flat surface.
|
|
6
7
|
*/
|
|
@@ -9,7 +10,7 @@ export declare class Point implements IPoint, ISerializable {
|
|
|
9
10
|
* Returns a new {@link Radial} from the given object.
|
|
10
11
|
* @param json
|
|
11
12
|
*/
|
|
12
|
-
static fromJSON(json:
|
|
13
|
+
static fromJSON(json: IPoint | JsonObject): Point;
|
|
13
14
|
/**
|
|
14
15
|
* Horizontal coordinate.
|
|
15
16
|
*/
|
|
@@ -39,7 +40,7 @@ export declare class Point implements IPoint, ISerializable {
|
|
|
39
40
|
* @param point The other {@link Point} to compare.
|
|
40
41
|
* @param precision The degree of precision to use; default is full precision.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
isEqual(point: IPoint, precision?: number): point is IPoint;
|
|
43
44
|
/**
|
|
44
45
|
* Calculates the distance between two {@link Point}s.
|
|
45
46
|
* @param point The other {@link Point} to compare
|
package/API/Geometry/Radial.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ISerializable } from '../Interfaces/ISerializable';
|
|
2
|
+
import { JsonObject } from '../Types';
|
|
1
3
|
import { IPoint, IRadial, RadialExpansion } from './Interfaces';
|
|
2
4
|
import { Point } from './Point';
|
|
3
|
-
import { Size } from './Size';
|
|
4
5
|
import { Rectangle } from './Rectangle';
|
|
5
|
-
import {
|
|
6
|
+
import { Size } from './Size';
|
|
6
7
|
/**
|
|
7
8
|
* A boundary on a flat surface based on a centre point and a radius.
|
|
8
9
|
*/
|
|
@@ -11,7 +12,7 @@ export declare class Radial implements IRadial, IPoint, ISerializable {
|
|
|
11
12
|
* Returns a new {@link Radial} from the given object.
|
|
12
13
|
* @param object
|
|
13
14
|
*/
|
|
14
|
-
static
|
|
15
|
+
static fromJSON(json: IRadial | JsonObject): Radial;
|
|
15
16
|
/**
|
|
16
17
|
* Left coordinate.
|
|
17
18
|
*/
|
|
@@ -45,7 +46,7 @@ export declare class Radial implements IRadial, IPoint, ISerializable {
|
|
|
45
46
|
* @param circle The other {@link IRadial} to compare
|
|
46
47
|
* @param precision The degree of precision to use; default is full precision.
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
isEqual(circle: IRadial, precision?: number): boolean;
|
|
49
50
|
/**
|
|
50
51
|
* Determines if the given {@link IPoint} is contained by this Radial
|
|
51
52
|
* @param point
|
|
@@ -6,10 +6,11 @@ import { Size } from './Size';
|
|
|
6
6
|
* A four-sided box on a flat surface.
|
|
7
7
|
*/
|
|
8
8
|
export declare class Rectangle implements IRectangle {
|
|
9
|
+
#private;
|
|
9
10
|
/**
|
|
10
11
|
* Returns a new {@link Radial} from the given object.
|
|
11
12
|
*/
|
|
12
|
-
static
|
|
13
|
+
static fromJSON(rectangle: any): Rectangle;
|
|
13
14
|
/**
|
|
14
15
|
* Left-most horizontal coordinate
|
|
15
16
|
*/
|
|
@@ -41,7 +42,7 @@ export declare class Rectangle implements IRectangle {
|
|
|
41
42
|
* @returns A string in the format of "left,top,right,bottom".
|
|
42
43
|
*/
|
|
43
44
|
toString(delimiter?: string): string;
|
|
44
|
-
|
|
45
|
+
/**
|
|
45
46
|
* Creates a literal of this {@link Rectangle}.
|
|
46
47
|
* Used internally by {@link JSON.stringify}.
|
|
47
48
|
*/
|
|
@@ -98,11 +99,6 @@ export declare class Rectangle implements IRectangle {
|
|
|
98
99
|
* Returns the {@link Point} at the bottom-most/right-most corner.
|
|
99
100
|
*/
|
|
100
101
|
getBottomRight(): Point;
|
|
101
|
-
/**
|
|
102
|
-
* Worker function that actually extends the boundary to envelop the given point(s)/boundary(s).
|
|
103
|
-
* @param object The objects used to extend the boundary
|
|
104
|
-
*/
|
|
105
|
-
private __expander;
|
|
106
102
|
/**
|
|
107
103
|
* Validates the boundary by ensuring the top value is less than the bottom value,
|
|
108
104
|
* and the left value is less than the right value.
|
package/API/Geometry/Size.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { JsonObject } from '../Types';
|
|
1
2
|
import { ISize } from './Interfaces';
|
|
2
3
|
/**
|
|
3
4
|
* Dimensions on a flat surface.
|
|
4
5
|
*/
|
|
5
6
|
export declare class Size implements ISize {
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param json
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
static fromJSON(json: ISize | JsonObject): Size;
|
|
7
13
|
/**
|
|
8
14
|
* Width.
|
|
9
15
|
*/
|
|
@@ -29,7 +35,7 @@ export declare class Size implements ISize {
|
|
|
29
35
|
* @param size The other Size to compare
|
|
30
36
|
* @param precision The degree of precision to use; default is full precision
|
|
31
37
|
*/
|
|
32
|
-
|
|
38
|
+
isEqual(size: ISize, precision?: number): size is ISize;
|
|
33
39
|
/**
|
|
34
40
|
* Returns a new instance of a {@link Size} where the width and height are adjusted to the given ratios.
|
|
35
41
|
* If the second ratio is not given, then the first value is used for both.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For auditable objects, a record of who and what mad the changes.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAuditable {
|
|
5
|
+
/**
|
|
6
|
+
* Details about the change to an object.
|
|
7
|
+
*/
|
|
8
|
+
updated: IAuditableUpdated;
|
|
9
|
+
/**
|
|
10
|
+
* When the was change procesed.
|
|
11
|
+
*/
|
|
12
|
+
processedUtc: Date;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* This class used in conjunction with the {@link version} member help with synchronization.
|
|
16
|
+
*/
|
|
17
|
+
export declare class IAuditableUpdated {
|
|
18
|
+
/**
|
|
19
|
+
* The {@link User.login} or {@link Machine.key} when the object is updated,
|
|
20
|
+
* or {@link Service.UserAgent} if a service updates the object itself.
|
|
21
|
+
*/
|
|
22
|
+
by: string;
|
|
23
|
+
/**
|
|
24
|
+
* A {@link Service.UserAgent} that handled the update.
|
|
25
|
+
*/
|
|
26
|
+
from: string;
|
|
27
|
+
/**
|
|
28
|
+
* Timestamp from when the change was made.
|
|
29
|
+
*/
|
|
30
|
+
dts: Date;
|
|
31
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JsonObject } from "../../API/Types";
|
|
1
2
|
/**
|
|
2
3
|
* An interface for types that are updated using JSON values.
|
|
3
4
|
*/
|
|
@@ -8,5 +9,5 @@ export interface IDeserializable {
|
|
|
8
9
|
* @param forced When true, forces the update.
|
|
9
10
|
* @returns True when an update was completed.
|
|
10
11
|
*/
|
|
11
|
-
fromJSON(json:
|
|
12
|
+
fromJSON(json: JsonObject, force?: boolean): boolean;
|
|
12
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { email, guid, ulong } from "../Types";
|
|
1
2
|
/**
|
|
2
3
|
* The main interface for an object in the Trak-iT system.
|
|
3
4
|
*/
|
|
@@ -8,11 +9,14 @@ export interface IRequestable {
|
|
|
8
9
|
* {@link IIdUlong.id}
|
|
9
10
|
* {@link Machine.key}
|
|
10
11
|
* {@link Provider.id}
|
|
12
|
+
* {@link ProviderGeneral.id}
|
|
13
|
+
* {@link ProviderAdvanced.id}
|
|
14
|
+
* {@link ProviderControl.id}
|
|
11
15
|
* {@link ProviderRegistration.code}
|
|
12
16
|
* {@link User.login}
|
|
13
17
|
* {@link UserGeneral.login}
|
|
14
18
|
* {@link UserAdvanced.login}
|
|
15
19
|
* {@link Timezone.code}
|
|
16
20
|
*/
|
|
17
|
-
getKey(): string;
|
|
21
|
+
getKey(): ulong | email | guid | string;
|
|
18
22
|
}
|
package/API/Objects.d.ts
CHANGED
|
@@ -1,33 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://stackoverflow.com/questions/49682569/typescript-merge-object-types#answer-49683575
|
|
3
|
-
* This is how you get TypeScript to properly infer the keys and values from the objects given to the {@link MERGE} function.
|
|
4
|
-
*/
|
|
5
|
-
type OptionalPropertyNames<T> = {
|
|
6
|
-
[K in keyof T]-?: ({} extends {
|
|
7
|
-
[P in K]: T[K];
|
|
8
|
-
} ? K : never);
|
|
9
|
-
}[keyof T];
|
|
10
|
-
type SpreadProperties<L, R, K extends keyof L & keyof R> = {
|
|
11
|
-
[P in K]: L[P] | Exclude<R[P], undefined>;
|
|
12
|
-
};
|
|
13
|
-
type Id<T> = T extends infer U ? {
|
|
14
|
-
[K in keyof U]: U[K];
|
|
15
|
-
} : never;
|
|
16
|
-
type SpreadTwo<R, L> = Id<// L/R reversed because we don't overwrite properties
|
|
17
|
-
Pick<L, Exclude<keyof L, keyof R>> & Pick<R, Exclude<keyof R, OptionalPropertyNames<R>>> & Pick<R, Exclude<OptionalPropertyNames<R>, keyof L>> & SpreadProperties<L, R, OptionalPropertyNames<R> & keyof L>>;
|
|
18
|
-
type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R] ? SpreadTwo<L, Spread<R>> : unknown;
|
|
19
|
-
/**
|
|
20
|
-
* Does a deep copy of values from one object to another.
|
|
21
|
-
* If multiple objects are given, properties are not overwritten.
|
|
22
|
-
* @param target
|
|
23
|
-
* @param sources
|
|
24
|
-
* @returns target
|
|
25
|
-
*/
|
|
26
|
-
export declare function MERGE<A extends object[]>(...sources: [...A]): Spread<A>;
|
|
27
1
|
/**
|
|
28
2
|
* Used internally by {@link MERGE}.
|
|
29
3
|
* @param value
|
|
30
|
-
* @param goDeep
|
|
31
4
|
*/
|
|
32
5
|
export declare function MERGE_INTERNAL(value: any): any;
|
|
33
|
-
export {};
|