@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.
Files changed (81) hide show
  1. package/API/Geography/Functions.d.ts +237 -0
  2. package/API/Geography/Interfaces.d.ts +151 -0
  3. package/API/Geography/LatLng.d.ts +87 -0
  4. package/API/Geography/LatLngBounds.d.ts +147 -0
  5. package/API/Geography/Position.d.ts +75 -0
  6. package/API/Geography/StreetAddress.d.ts +60 -0
  7. package/API/Geometry/Functions.d.ts +115 -0
  8. package/API/Geometry/Interfaces.d.ts +112 -0
  9. package/API/Geometry/Point.d.ts +82 -0
  10. package/API/Geometry/Radial.d.ts +111 -0
  11. package/API/Geometry/Rectangle.d.ts +160 -0
  12. package/API/Geometry/Size.d.ts +59 -0
  13. package/API/Interfaces/IAmCompany.d.ts +12 -0
  14. package/API/Interfaces/IBelongAsset.d.ts +16 -0
  15. package/API/Interfaces/IBelongBillingProfile.d.ts +16 -0
  16. package/API/Interfaces/IBelongCompany.d.ts +16 -0
  17. package/API/Interfaces/IDeserializable.d.ts +14 -0
  18. package/API/Interfaces/IEnabled.d.ts +11 -0
  19. package/API/Interfaces/IFileSize.d.ts +10 -0
  20. package/API/Interfaces/IGlobal.d.ts +12 -0
  21. package/API/Interfaces/IHavePermissions.d.ts +21 -0
  22. package/API/Interfaces/IHavePreferences.d.ts +30 -0
  23. package/API/Interfaces/IIconic.d.ts +16 -0
  24. package/API/Interfaces/IIdUlong.d.ts +11 -0
  25. package/API/Interfaces/ILabelled.d.ts +11 -0
  26. package/API/Interfaces/INamed.d.ts +14 -0
  27. package/API/Interfaces/IPictured.d.ts +16 -0
  28. package/API/Interfaces/IRequestable.d.ts +23 -0
  29. package/API/Interfaces/ISerializable.d.ts +11 -0
  30. package/API/Interfaces/ISuspendable.d.ts +17 -0
  31. package/API/Interfaces/IVisual.d.ts +19 -0
  32. package/Accounts/Permissions/Authorizer.d.ts +205 -0
  33. package/Accounts/Permissions/Permission.d.ts +57 -0
  34. package/Accounts/Permissions/PermissionEscalation.d.ts +42 -0
  35. package/Accounts/Permissions/PermissionEscalationState.d.ts +20 -0
  36. package/Accounts/Permissions/PermissionEscalationType.d.ts +14 -0
  37. package/Accounts/Permissions/PermissionLevel.d.ts +18 -0
  38. package/Accounts/Permissions/PermissionMethod.d.ts +14 -0
  39. package/Accounts/Permissions/PermissionType.d.ts +281 -0
  40. package/Billing/Hosting/BillableHostingBase.d.ts +42 -0
  41. package/Billing/Hosting/BillableHostingLicense.d.ts +31 -0
  42. package/Billing/Hosting/BillableHostingLicenseType.d.ts +21 -0
  43. package/Billing/Hosting/BillableHostingRule.d.ts +31 -0
  44. package/Billing/Hosting/BillableHostingType.d.ts +42 -0
  45. package/Billing/Report/BillingReport.d.ts +113 -0
  46. package/Billing/Report/BillingReportBreakdown.d.ts +35 -0
  47. package/Billing/Report/BillingReportHostingSummary.d.ts +37 -0
  48. package/Billing/Report/BillingReportLicenseBreakdown.d.ts +80 -0
  49. package/Billing/Report/BillingReportServiceBreakdown.d.ts +125 -0
  50. package/Billing/Report/BillingReportStatus.d.ts +26 -0
  51. package/Billing/Report/BillingReportSummary.d.ts +50 -0
  52. package/Hosting/Fields/FormFieldAttachments.d.ts +32 -0
  53. package/Hosting/Fields/FormFieldBase.d.ts +57 -0
  54. package/Hosting/Fields/FormFieldBase_fromJSON.d.ts +2 -0
  55. package/Hosting/Fields/FormFieldBoolean.d.ts +39 -0
  56. package/Hosting/Fields/FormFieldChoice.d.ts +47 -0
  57. package/Hosting/Fields/FormFieldDate.d.ts +27 -0
  58. package/Hosting/Fields/FormFieldNumeric.d.ts +55 -0
  59. package/Hosting/Fields/FormFieldNumericSize.d.ts +33 -0
  60. package/Hosting/Fields/FormFieldSignature.d.ts +18 -0
  61. package/Hosting/Fields/FormFieldText.d.ts +33 -0
  62. package/Hosting/Fields/FormFieldTime.d.ts +38 -0
  63. package/Hosting/Fields/FormFieldTimezone.d.ts +15 -0
  64. package/Providers/Config/ProviderConfig.d.ts +71 -0
  65. package/Providers/Config/ProviderRegistration.d.ts +120 -0
  66. package/Providers/Config/ProviderScript.d.ts +87 -0
  67. package/Providers/Config/ProviderScriptBlock.d.ts +42 -0
  68. package/Providers/Config/ProviderScriptParameter.d.ts +50 -0
  69. package/Providers/Config/ProviderScriptParameterType.d.ts +18 -0
  70. package/Providers/Configuration/ProviderConfiguration.d.ts +67 -0
  71. package/Providers/Configuration/ProviderConfigurationNode.d.ts +67 -0
  72. package/Providers/Configuration/ProviderConfigurationType.d.ts +63 -0
  73. package/Providers/Configuration/ProviderGeofenceBase.d.ts +30 -0
  74. package/Providers/Configuration/ProviderGeofenceBase_fromJSON.d.ts +2 -0
  75. package/Providers/Configuration/ProviderGeofenceCircular.d.ts +29 -0
  76. package/Providers/Configuration/ProviderGeofencePoint.d.ts +13 -0
  77. package/Providers/Configuration/ProviderGeofencePolygon.d.ts +24 -0
  78. package/Providers/Configuration/ProviderGeofenceRectangle.d.ts +29 -0
  79. package/index.d.ts +1 -1
  80. package/package.json +5 -7
  81. package/trakit-objects.min.js +1 -1
@@ -0,0 +1,60 @@
1
+ import { ISerializable } from "../Interfaces/ISerializable";
2
+ import { JsonObject, nothing } from "../Types";
3
+ import { IStreetAddress } from "./Interfaces";
4
+ /**
5
+ * A road segment description
6
+ */
7
+ export declare class StreetAddress implements IStreetAddress, ISerializable {
8
+ /**
9
+ *
10
+ * @param street
11
+ */
12
+ static fromJSON(json: IStreetAddress | JsonObject): StreetAddress;
13
+ /**
14
+ * House number.
15
+ */
16
+ number: string;
17
+ /**
18
+ * Full street name.
19
+ */
20
+ street: string;
21
+ /**
22
+ * City name.
23
+ */
24
+ city: string;
25
+ /**
26
+ * Region name.
27
+ */
28
+ region: string;
29
+ /**
30
+ * Province or state code.
31
+ * Codes should be a value from ISO 3166-2.
32
+ */
33
+ province: string;
34
+ /**
35
+ * Country code.
36
+ * Codes should be a value from ISO 3166-1 alpha-2.
37
+ */
38
+ country: string;
39
+ /**
40
+ * Postal or zip code.
41
+ */
42
+ postal: string;
43
+ /**
44
+ * Indicates that there is a toll for the current road segment.
45
+ */
46
+ isToll: boolean;
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);
48
+ /**
49
+ * Returns a text representation of this address.
50
+ * Returned strings cannot be converted back into {@link StreetAddress}
51
+ * objects, so don't use this for deserialization.
52
+ */
53
+ toString(): string;
54
+ /**
55
+ * Creates a literal of this {@link StreetAddress}.
56
+ * Used internally by {@link JSON.stringify}.
57
+ */
58
+ toJSON(): IStreetAddress;
59
+ }
60
+ //# sourceMappingURL=StreetAddress.d.ts.map
@@ -0,0 +1,115 @@
1
+ import { IPoint, IRadial, IRectangle } from './Interfaces';
2
+ /**
3
+ * Calculates the starting angle (in degrees) between two Points using the top as zero. Does not return negative values.
4
+ * @param starting Starting coordinate
5
+ * @param ending Other coordinate
6
+ * @returns A number between 0 and 360.
7
+ */
8
+ export declare function POINT_ANGLE(starting: IPoint, ending: IPoint): number;
9
+ /**
10
+ * Calculates the distance between two points using Pythagorean theorem.
11
+ * @param starting Starting coordinate
12
+ * @param ending Other coordinate
13
+ */
14
+ export declare function POINT_DISTANCE(starting: IPoint, ending: IPoint): number;
15
+ /**
16
+ * Sorts points by left-most, then by top-most.
17
+ */
18
+ export declare function POINT_SORT(a: IPoint, b: IPoint): number;
19
+ /**
20
+ * Calculates the vector which can be used to find the point based on the given direction and distance
21
+ * @param distance
22
+ * @param degrees
23
+ */
24
+ export declare function POINT_VECTOR(distance: number, degrees: number): IPoint;
25
+ /**
26
+ * Calculates the total length of the given path
27
+ * @param path The array of points representing a path
28
+ * */
29
+ export declare function PATH_LENGTH(path: IPoint[]): number;
30
+ /**
31
+ * Calculates the orthogonal height of a triangle. The orthogonal height is
32
+ * calculated by drawing a line between the firstPoint and lastPoint, then
33
+ * getting the length of a line drawn up from the line to the midPoint at a 90
34
+ * degree angle.
35
+ * @param first Left-most coordinate of the triangle
36
+ * @param mid Top-most coordinate of the triangle
37
+ * @param last Right-most coordinate of the triangle
38
+ */
39
+ export declare function PATH_ORTHOGONAL(first: IPoint, mid: IPoint, last: IPoint): number;
40
+ /**
41
+ * Performs a Douglas-Peucker path reduction based on the given tolerance.
42
+ * @param path The array of points representing a path
43
+ * @param tolerance Orthogonal height threshold for candidate points. Default is 0.
44
+ * */
45
+ export declare function PATH_PEUCKER(path: IPoint[], tolerance?: number): IPoint[];
46
+ /**
47
+ * Calculates the total area occupied by the given path. Treats non-closed paths as closed paths.
48
+ * @param path The array of points representing a path
49
+ * */
50
+ export declare function POLY_AREA(path: IPoint[]): number;
51
+ /**
52
+ * A utility export function to determine if a given point is inside the given polygon path.
53
+ * @param poly The array of points represents the path of the polygon.
54
+ * @param dot The coordinate of the point to be checked.
55
+ * */
56
+ export declare function POLY_CONTAINS(poly: IPoint[], dot: IPoint): boolean;
57
+ /**
58
+ * Performs a Douglas-Peucker path reduction on a polygon for the given tolerance.
59
+ * The start/end points are variable and the end point is trimmed from the result.
60
+ * @param path The array of points representing a path
61
+ * @param tolerance Orthogonal height threshold for candidate points. Default is 0.
62
+ * */
63
+ export declare function POLY_PEUCKER(path: IPoint[], tolerance?: number): IPoint[];
64
+ /**
65
+ * Wraps the given points into a polygonal path. The given points do not need to be a path. The returned path is not closed.
66
+ * @param points The array of points on which to create the non-closed path
67
+ * @returns Non-closed path.
68
+ */
69
+ export declare function POLY_WRAPPER(points: IPoint[]): IPoint[];
70
+ /**
71
+ * Calculates the area of a circle based on the given radius.
72
+ * @param radius
73
+ * */
74
+ export declare function RADIAL_AREA(radius: number): number;
75
+ /**
76
+ * Solves the Minimum Enclosing Circle problem using Badoiu Clarkson's algorithm.
77
+ * @param points The array of points on which to create the Radial
78
+ * @param iterations The higher the iterations the slower and more accurate the Radial. Default is 10,000.
79
+ * */
80
+ export declare function RADIAL_BADOIU_CLARKSON(points: IPoint[], iterations?: number): IRadial;
81
+ /**
82
+ * Calculates the circumference of a circle based on the given radius.
83
+ * @param radius
84
+ * */
85
+ export declare function RADIAL_CIRCUMFERENCE(radius: number): number;
86
+ /**
87
+ * Creates an {@link IRectangle} which contains the given list of {@link IPoint}s.
88
+ * @param dots
89
+ */
90
+ export declare function RECTANGLE_FROM_POINTS(dots: IPoint[]): IRectangle;
91
+ /**
92
+ * Returns true if the given {@link Radial} overlaps the given {@link Rectangle}.
93
+ * @param circle
94
+ * @param rect
95
+ * */
96
+ export declare function RADIAL_OVERLAP_RECTANGLE(circle: IRadial, rect: IRectangle): boolean;
97
+ /**
98
+ *
99
+ * @param rect
100
+ */
101
+ export declare function RECTANGLE_CENTRE(rect: IRectangle): IPoint;
102
+ /**
103
+ * Determines if the given {@link IPoint} is contained by the given {@link Rectangle}.
104
+ * @param rect
105
+ * @param dot
106
+ * @returns
107
+ */
108
+ export declare function RECTANGLE_CONTAINS_POINT(rect: IRectangle, dot: IPoint): boolean;
109
+ /**
110
+ *
111
+ * @param rect
112
+ * @param clip
113
+ */
114
+ export declare function RECTANGLE_TO_RADIAL(rect: IRectangle, clip: boolean): IRadial;
115
+ //# sourceMappingURL=Functions.d.ts.map
@@ -0,0 +1,112 @@
1
+ /**
2
+ * A coordinate on a flat surface.
3
+ */
4
+ export interface IPoint {
5
+ /**
6
+ * Horizontal coordinate.
7
+ */
8
+ x: number;
9
+ /**
10
+ * Vertical coordinate.
11
+ */
12
+ y: number;
13
+ }
14
+ /**
15
+ * Returns true if the given point conforms to the {@link IPoint} interface.
16
+ * @param dot
17
+ * @returns
18
+ */
19
+ export declare function IPoint_instanceOf(dot: any): dot is IPoint;
20
+ /**
21
+ *
22
+ * @param dot
23
+ * @returns
24
+ */
25
+ export declare function IPoint_clone(dot: IPoint): IPoint;
26
+ /**
27
+ * A boundary on a flat surface based on a centre point and a radius.
28
+ */
29
+ export interface IRadial extends IPoint {
30
+ /**
31
+ * Radius.
32
+ */
33
+ r: number;
34
+ }
35
+ /**
36
+ * The types used to extend a {@link Radial}'s radius.
37
+ */
38
+ export type RadialExpansion = IPoint | IRadial | RadialExpansion[];
39
+ /**
40
+ * Returns true if the given radial conforms to the {@link IRadial} interface.
41
+ * @param radial
42
+ * @returns
43
+ */
44
+ export declare function IRadial_instanceOf(radial: any): radial is IRadial;
45
+ /**
46
+ *
47
+ * @param circle
48
+ * @returns
49
+ */
50
+ export declare function IRadial_clone(circle: IRadial): IRadial;
51
+ /**
52
+ * A rectangular boundary on a flat surface.
53
+ */
54
+ export interface IRectangle {
55
+ /**
56
+ * Left-most horizontal coordinate
57
+ */
58
+ left: number;
59
+ /**
60
+ * Highest vertical coordinate.
61
+ */
62
+ top: number;
63
+ /**
64
+ * Right-most horizontal coordinate
65
+ */
66
+ right: number;
67
+ /**
68
+ * Lowest vertical coordinate
69
+ */
70
+ bottom: number;
71
+ }
72
+ /**
73
+ * Returns true if the given rect conforms to the {@link Rectangle} interface.
74
+ * @param rect
75
+ */
76
+ export declare function IRectangle_instanceOf(rect: any): rect is IRectangle;
77
+ /**
78
+ *
79
+ * @param rect
80
+ * @returns
81
+ */
82
+ export declare function IRectangle_clone(rect: IRectangle): IRectangle;
83
+ /**
84
+ * The types used to extend a {@link Rectangle}'s edges.
85
+ */
86
+ export type RectangleExpansion = IPoint | IRectangle | IRadial | RectangleExpansion[];
87
+ /**
88
+ * Dimensions on a flat surface.
89
+ */
90
+ export interface ISize {
91
+ /**
92
+ * Width.
93
+ */
94
+ width: number;
95
+ /**
96
+ * Height.
97
+ */
98
+ height: number;
99
+ }
100
+ /**
101
+ * Returns true if the given size conforms to the {@link Size} interface.
102
+ * @param size
103
+ * @returns
104
+ */
105
+ export declare function ISize_instanceOf(size: any): size is ISize;
106
+ /**
107
+ *
108
+ * @param size
109
+ * @returns
110
+ */
111
+ export declare function ISize_clone(size: ISize): ISize;
112
+ //# sourceMappingURL=Interfaces.d.ts.map
@@ -0,0 +1,82 @@
1
+ import { ISerializable } from '../Interfaces/ISerializable';
2
+ import { JsonObject } from '../Types';
3
+ import { IPoint } from './Interfaces';
4
+ import { Radial } from './Radial';
5
+ /**
6
+ * A coordinate on a flat surface.
7
+ */
8
+ export declare class Point implements IPoint, ISerializable {
9
+ /**
10
+ * Returns a new {@link Radial} from the given object.
11
+ * @param json
12
+ */
13
+ static fromJSON(json: IPoint | JsonObject): Point;
14
+ /**
15
+ * Horizontal coordinate.
16
+ */
17
+ x: number;
18
+ /**
19
+ * Vertical coordinate.
20
+ */
21
+ y: number;
22
+ constructor(x: number, y: number);
23
+ /**
24
+ * Returns a string representation of this {@link Point}.
25
+ * @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value.
26
+ * @returns A string in the format of "x,y".
27
+ */
28
+ toString(delimiter?: string): string;
29
+ /**
30
+ * Creates a literal of this {@link Point}.
31
+ * Used internally by {@link JSON.stringify}.
32
+ */
33
+ toJSON(): IPoint;
34
+ /**
35
+ * Creates a duplicate of this {@link Point}.
36
+ */
37
+ copy(): Point;
38
+ /**
39
+ * Compares this {@link Point} to another to see if they are equal.
40
+ * @param point The other {@link Point} to compare.
41
+ * @param precision The degree of precision to use; default is full precision.
42
+ */
43
+ isEqual(point: IPoint, precision?: number): point is IPoint;
44
+ /**
45
+ * Calculates the distance between two {@link Point}s.
46
+ * @param point The other {@link Point} to compare
47
+ */
48
+ distanceTo(point: IPoint): number;
49
+ /**
50
+ * Calculates the angle (in degrees) to the given {@link Point}.
51
+ * @param point
52
+ */
53
+ angleTo(point: IPoint): number;
54
+ /**
55
+ * Updates this {@link Point} with the given angle and distance.
56
+ * @param distance
57
+ * @param degrees
58
+ */
59
+ translateTo(distance: number, degrees: number): this;
60
+ /**
61
+ * Updates this {@link Point} with the given offset.
62
+ * @param dot
63
+ */
64
+ offsetTo(dot: IPoint): this;
65
+ /**
66
+ * Creates a new {@link Point} at the given angle and distance.
67
+ * @param distance
68
+ * @param degrees
69
+ */
70
+ toTranslated(distance: number, degrees: number): Point;
71
+ /**
72
+ * Creates a new {@link Point} based on the given offset.
73
+ * @param offset
74
+ */
75
+ toOffset(offset: IPoint): Point;
76
+ /**
77
+ * Creates a new {@link Radial} based on the given radius.
78
+ * @param radius
79
+ */
80
+ toRadial(radius: number): Radial;
81
+ }
82
+ //# sourceMappingURL=Point.d.ts.map
@@ -0,0 +1,111 @@
1
+ import { ISerializable } from '../Interfaces/ISerializable';
2
+ import { JsonObject } from '../Types';
3
+ import { IPoint, IRadial, RadialExpansion } from './Interfaces';
4
+ import { Point } from './Point';
5
+ import { Rectangle } from './Rectangle';
6
+ import { Size } from './Size';
7
+ /**
8
+ * A boundary on a flat surface based on a centre point and a radius.
9
+ */
10
+ export declare class Radial implements IRadial, IPoint, ISerializable {
11
+ /**
12
+ * Returns a new {@link Radial} from the given object.
13
+ * @param object
14
+ */
15
+ static fromJSON(json: IRadial | JsonObject): Radial;
16
+ /**
17
+ * Left coordinate.
18
+ */
19
+ x: number;
20
+ /**
21
+ * Top coordinate.
22
+ */
23
+ y: number;
24
+ /**
25
+ * Radial distance.
26
+ */
27
+ r: number;
28
+ constructor(x?: number, y?: number, r?: number);
29
+ /**
30
+ * Returns a string representation of this {@link Radial}.
31
+ * @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value.
32
+ * @returns A string in the format of "x,y,r".
33
+ */
34
+ toString(delimiter?: string): string;
35
+ /**
36
+ * Creates a literal of this {@link Radial}.
37
+ * Used internally by {@link JSON.stringify}.
38
+ */
39
+ toJSON(): IRadial;
40
+ /**
41
+ * Creates a duplicate of this {@link Radial}.
42
+ */
43
+ copy(): Radial;
44
+ /**
45
+ * Compares this Point to another to see if they are equal.
46
+ * @param circle The other {@link IRadial} to compare
47
+ * @param precision The degree of precision to use; default is full precision.
48
+ */
49
+ isEqual(circle: IRadial, precision?: number): boolean;
50
+ /**
51
+ * Determines if the given {@link IPoint} is contained by this Radial
52
+ * @param point
53
+ */
54
+ contains(point: IPoint): boolean;
55
+ /**
56
+ * Determines if the given {@link IRadial} is overlaps this {@link Radial} in any way
57
+ * @param circle
58
+ */
59
+ overlaps(circle: IRadial): boolean;
60
+ /**
61
+ * Returns the centre point representation.
62
+ */
63
+ getCentre(): Point;
64
+ /**
65
+ * Returns the {@link Size} of the diameter.
66
+ */
67
+ getSize(): Size;
68
+ /**
69
+ * Worker function that actually extends the boundary to envelop the given point(s)/boundary(s).
70
+ * @param object
71
+ */
72
+ __expander(object: RadialExpansion): void;
73
+ /**
74
+ * Extends the boundary to envelop the given point(s).
75
+ * @param object The objects used to extend the radius.
76
+ */
77
+ extend(object: RadialExpansion): this;
78
+ /**
79
+ * Increases the boundary radius.
80
+ * @param length
81
+ */
82
+ grow(length: number): this;
83
+ /**
84
+ * Updates this {@link Radial} with the given angle and distance.
85
+ * @param distance
86
+ * @param degrees
87
+ */
88
+ translateTo(distance: number, degrees: number): this;
89
+ /**
90
+ * Updates this {@link Radial} with the given offset.
91
+ * @param dot
92
+ */
93
+ offsetTo(dot: IPoint): this;
94
+ /**
95
+ * Creates a new {@link Radial} at the given distance and direction.
96
+ * @param distance
97
+ * @param degrees
98
+ */
99
+ toTranslated(distance: number, degrees: number): Radial;
100
+ /**
101
+ * Creates a new {@link Radial} offset by the given amounts.
102
+ * @param point
103
+ */
104
+ toOffset(point: IPoint): Radial;
105
+ /**
106
+ * Converts this radial boundary into a {@link Rectangle}.
107
+ * @param clip If true, [()], if false ([]).
108
+ */
109
+ toRectangle(clip?: boolean): Rectangle;
110
+ }
111
+ //# sourceMappingURL=Radial.d.ts.map
@@ -0,0 +1,160 @@
1
+ import { IPoint, IRectangle, RectangleExpansion } from './Interfaces';
2
+ import { Point } from './Point';
3
+ import { Radial } from './Radial';
4
+ import { Size } from './Size';
5
+ /**
6
+ * A four-sided box on a flat surface.
7
+ */
8
+ export declare class Rectangle implements IRectangle {
9
+ #private;
10
+ /**
11
+ * Returns a new {@link Radial} from the given object.
12
+ */
13
+ static fromJSON(rectangle: any): Rectangle;
14
+ /**
15
+ * Left-most horizontal coordinate
16
+ */
17
+ left: number;
18
+ /**
19
+ * Highest vertical coordinate.
20
+ */
21
+ top: number;
22
+ /**
23
+ * Right-most horizontal coordinate
24
+ */
25
+ right: number;
26
+ /**
27
+ * Lowest vertical coordinate
28
+ */
29
+ bottom: number;
30
+ /**
31
+ * The absolute width of this Rectangle.
32
+ */
33
+ get width(): number;
34
+ /**
35
+ * The absolute height of this Rectangle.
36
+ */
37
+ get height(): number;
38
+ constructor(left?: number | RectangleExpansion, top?: number | RectangleExpansion, right?: number | RectangleExpansion, bottom?: number | RectangleExpansion);
39
+ /**
40
+ * Validates the boundary and returns a string representation
41
+ * @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value (optional)
42
+ * @returns A string in the format of "left,top,right,bottom".
43
+ */
44
+ toString(delimiter?: string): string;
45
+ /**
46
+ * Creates a literal of this {@link Rectangle}.
47
+ * Used internally by {@link JSON.stringify}.
48
+ */
49
+ toJSON(): IRectangle;
50
+ /**
51
+ * Compares this Rectangle to another to see if they are equal.
52
+ * @param rect The other Rectangle to compare.
53
+ * @param precision The degree of precision to use; default is full precision.
54
+ */
55
+ isEqual(rect: IRectangle, precision?: number): rect is IRectangle;
56
+ /**
57
+ * Checks to see if the bounds are valid (not inside-out).
58
+ */
59
+ isValid(): boolean;
60
+ /**
61
+ * Checks to see if the bounds are valid, and that the corners are different coordinates.
62
+ */
63
+ isEmpty(): boolean;
64
+ /**
65
+ * Determines if the given {@link IPoint} is contained by this {@link Rectangle}.
66
+ * @param dot
67
+ */
68
+ contains(dot: IPoint): boolean;
69
+ /**
70
+ * Determines if the given {@link IRectangle} is overlaps this {@link Rectangle} in any way
71
+ * @param rect
72
+ */
73
+ overlaps(rect: IRectangle): boolean;
74
+ /**
75
+ * Validates the boundary and creates a duplicate of this {@link Rectangle}.
76
+ */
77
+ copy(): Rectangle;
78
+ /**
79
+ * Returns the {@link Point} at the centre.
80
+ */
81
+ getCentre(): Point;
82
+ /**
83
+ * Validates the boundary and creates a {@link Size} representation.
84
+ */
85
+ getSize(): Size;
86
+ /**
87
+ * Returns the {@link Point} at the top-most/left-most corner.
88
+ */
89
+ getTopLeft(): Point;
90
+ /**
91
+ * Returns the {@link Point} at the top-most/right-most corner.
92
+ */
93
+ getTopRight(): Point;
94
+ /**
95
+ * Returns the {@link Point} at the bottom-most/left-most corner.
96
+ */
97
+ getBottomLeft(): Point;
98
+ /**
99
+ * Returns the {@link Point} at the bottom-most/right-most corner.
100
+ */
101
+ getBottomRight(): Point;
102
+ /**
103
+ * Validates the boundary by ensuring the top value is less than the bottom value,
104
+ * and the left value is less than the right value.
105
+ * Also adjusts the width and height values.
106
+ */
107
+ validate(): this;
108
+ /**
109
+ * Extends the boundary to envelop the given point(s) but does not automatically validate.
110
+ * This comes in efficient when doing many operations on a single {@link Rectangle}.
111
+ * @param object The objects used to extend the boundary
112
+ */
113
+ expand(object: RectangleExpansion): this;
114
+ /**
115
+ * Extends the boundary to envelop the given point(s) and automatically validates
116
+ * @param object The objects used to extend the boundary
117
+ */
118
+ extend(object: RectangleExpansion): this;
119
+ /**
120
+ * Increases the size of the boundary by the given width and height.
121
+ * If the direction contains the word "top", the {@link Rectangle#top} decreases by the given height.
122
+ * If the direction contains the word "bottom", the {@link Rectangle#bottom} increases by the given height.
123
+ * If the direction does not contain either "top" or "bottom", the {@link Rectangle#top} decreases by half the given height, and the {@link Rectangle#bottom} increases by half the given height.
124
+ * If the direction contains the word "left", the {@link Rectangle#left} decreases by the given width.
125
+ * If the direction contains the word "right", the {@link Rectangle#right} increases by the given width.
126
+ * If the direction does not contain either "left" or "right", the {@link Rectangle#left} decreases by half the given width, and the {@link Rectangle#right} increases by half the given height.
127
+ * @param width
128
+ * @param height
129
+ * @param direction
130
+ */
131
+ grow(width?: number, height?: number, direction?: string): this;
132
+ /**
133
+ * Updates this {@link Rectangle} with the given angle and distance.
134
+ * @param distance
135
+ * @param degrees
136
+ */
137
+ translateTo(distance: number, degrees: number): this;
138
+ /**
139
+ * Updates this {@link Rectangle} with the given offset.
140
+ * @param dot
141
+ */
142
+ offsetTo(dot: IPoint): this;
143
+ /**
144
+ * Creates a new {@link Rectangle} at the given angle and distance.
145
+ * @param distance
146
+ * @param degrees
147
+ */
148
+ toTranslated(distance: number, degrees: number): Rectangle;
149
+ /**
150
+ * Creates a new {@link Rectangle} offset by the given amounts.
151
+ * @param dot
152
+ */
153
+ toOffset(dot: IPoint): Rectangle;
154
+ /**
155
+ * Validates the boundary and returns a {@link Radial}.
156
+ * @param clip If true, [()], if false ([]).
157
+ */
158
+ toRadial(clip?: boolean): Radial;
159
+ }
160
+ //# sourceMappingURL=Rectangle.d.ts.map
@@ -0,0 +1,59 @@
1
+ import { JsonObject } from '../Types';
2
+ import { ISize } from './Interfaces';
3
+ /**
4
+ * Dimensions on a flat surface.
5
+ */
6
+ export declare class Size implements ISize {
7
+ /**
8
+ *
9
+ * @param json
10
+ * @returns
11
+ */
12
+ static fromJSON(json: ISize | JsonObject): Size;
13
+ /**
14
+ * Width.
15
+ */
16
+ width: number;
17
+ /**
18
+ * Height.
19
+ */
20
+ height: number;
21
+ constructor(width: number, height: number);
22
+ /**
23
+ * Returns a string representation.
24
+ * @param delimiter The boundary is delimited by a comma (,) by default, but you can override with your own value.
25
+ * @returns A string in the format of "width,height".
26
+ */
27
+ toString(delimiter?: string): string;
28
+ /**
29
+ * Creates a literal of this {@link Size}.
30
+ * Used internally by {@link JSON.stringify}.
31
+ */
32
+ toJSON(): ISize;
33
+ /**
34
+ * Compares this Size to another to see if they are equal
35
+ * @param size The other Size to compare
36
+ * @param precision The degree of precision to use; default is full precision
37
+ */
38
+ isEqual(size: ISize, precision?: number): size is ISize;
39
+ /**
40
+ * Returns a new instance of a {@link Size} where the width and height are adjusted to the given ratios.
41
+ * If the second ratio is not given, then the first value is used for both.
42
+ * The ratios are given as a percentage between 0 and 1.
43
+ * To double the size of the Size, give a ratio of 2, and to shrink it to half size use 0.5.
44
+ * @param ratioX
45
+ * @param ratioY
46
+ */
47
+ resize(ratioX?: number, ratioY?: number): Size;
48
+ /**
49
+ * Returns a new {@link Size} where the width is the same as the given value, and the height is resized to preserve aspect ratio.
50
+ * @param width
51
+ */
52
+ resizeToWidth(width: number): Size;
53
+ /**
54
+ * Returns a new {@link Size} where the height is the same as the given value, and the width is resized to preserve aspect ratio.
55
+ * @param height
56
+ */
57
+ resizeToHeight(height: number): Size;
58
+ }
59
+ //# sourceMappingURL=Size.d.ts.map