@tspro/ts-utils-lib 1.20.0 → 1.21.0
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/CHANGELOG.md +8 -0
- package/dist/index.d.mts +406 -70
- package/dist/index.d.ts +406 -70
- package/dist/index.js +617 -74
- package/dist/index.mjs +615 -74
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -773,9 +773,65 @@ declare class Vec extends BaseContainer {
|
|
|
773
773
|
}
|
|
774
774
|
|
|
775
775
|
/**
|
|
776
|
-
*
|
|
776
|
+
* An immutable 2D rectangle defined by its top-left corner (x, y) and size (width, height).
|
|
777
|
+
* Provides geometric utilities like intersection, containment, scaling, etc.
|
|
777
778
|
*/
|
|
778
|
-
declare class
|
|
779
|
+
declare class Rect {
|
|
780
|
+
x: number;
|
|
781
|
+
y: number;
|
|
782
|
+
width: number;
|
|
783
|
+
height: number;
|
|
784
|
+
constructor();
|
|
785
|
+
constructor(width: number, height: number);
|
|
786
|
+
constructor(x: number, y: number, width: number, height: number);
|
|
787
|
+
set(): Rect;
|
|
788
|
+
set(width: number, height: number): Rect;
|
|
789
|
+
set(x: number, y: number, width: number, height: number): Rect;
|
|
790
|
+
static fromPoints(p1: {
|
|
791
|
+
x: number;
|
|
792
|
+
y: number;
|
|
793
|
+
}, p2: {
|
|
794
|
+
x: number;
|
|
795
|
+
y: number;
|
|
796
|
+
}): Rect;
|
|
797
|
+
static fromCenter(cx: number, cy: number, width: number, height: number): Rect;
|
|
798
|
+
get left(): number;
|
|
799
|
+
get top(): number;
|
|
800
|
+
get right(): number;
|
|
801
|
+
get bottom(): number;
|
|
802
|
+
get centerX(): number;
|
|
803
|
+
get centerY(): number;
|
|
804
|
+
get center(): {
|
|
805
|
+
x: number;
|
|
806
|
+
y: number;
|
|
807
|
+
};
|
|
808
|
+
get area(): number;
|
|
809
|
+
get isEmpty(): boolean;
|
|
810
|
+
containsPoint(px: number, py: number): boolean;
|
|
811
|
+
containsRect(other: Rect): boolean;
|
|
812
|
+
intersects(other: Rect): boolean;
|
|
813
|
+
intersectionCopy(other: Rect): Rect;
|
|
814
|
+
unionCopy(other: Rect): Rect;
|
|
815
|
+
insetCopy(dx: number, dy: number): Rect;
|
|
816
|
+
inflateCopy(dx: number, dy: number): Rect;
|
|
817
|
+
offsetInPlace(dx: number, dy: number): Rect;
|
|
818
|
+
offsetCopy(dx: number, dy: number): Rect;
|
|
819
|
+
scaleInPlace(scaleX: number, scaleY?: number): Rect;
|
|
820
|
+
scaleCopy(scaleX: number, scaleY?: number): Rect;
|
|
821
|
+
roundCopy(): Rect;
|
|
822
|
+
floorCopy(): Rect;
|
|
823
|
+
ceilCopy(): Rect;
|
|
824
|
+
expandCopy(px: number, py: number): Rect;
|
|
825
|
+
equals(other: Rect): boolean;
|
|
826
|
+
clone(): Rect;
|
|
827
|
+
toString(): string;
|
|
828
|
+
toAnchoredRect(): AnchoredRect;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* A mutable AnchoredRect class is a rectangle (left, top, right, bottom) with an anchor point (anchorX, anchorY).
|
|
833
|
+
*/
|
|
834
|
+
declare class AnchoredRect {
|
|
779
835
|
left: number;
|
|
780
836
|
anchorX: number;
|
|
781
837
|
right: number;
|
|
@@ -807,6 +863,31 @@ declare class DivRect {
|
|
|
807
863
|
* @param bottom - Bottom coordinate.
|
|
808
864
|
*/
|
|
809
865
|
constructor(left: number, anchorX: number, right: number, top: number, anchorY: number, bottom: number);
|
|
866
|
+
/**
|
|
867
|
+
* Set rectangle with all zero values.
|
|
868
|
+
*/
|
|
869
|
+
set(): AnchoredRect;
|
|
870
|
+
/**
|
|
871
|
+
* Set rectangle with left, right, top, bottom.
|
|
872
|
+
* Properties anchorX and anchorY will be centered in the middle.
|
|
873
|
+
*
|
|
874
|
+
* @param left - Left coordinate.
|
|
875
|
+
* @param right - Right coordinate.
|
|
876
|
+
* @param top - Top coordinate.
|
|
877
|
+
* @param bottom - Bottom coordinate.
|
|
878
|
+
*/
|
|
879
|
+
set(left: number, right: number, top: number, bottom: number): AnchoredRect;
|
|
880
|
+
/**
|
|
881
|
+
* Set rectangle with full arguments.
|
|
882
|
+
*
|
|
883
|
+
* @param left - Left coordinate.
|
|
884
|
+
* @param anchorX - Center x-coordinate.
|
|
885
|
+
* @param right - Right coordinate.
|
|
886
|
+
* @param top - Top coordinate.
|
|
887
|
+
* @param anchorY - Center y-coordinate.
|
|
888
|
+
* @param bottom - Bottom coordinate.
|
|
889
|
+
*/
|
|
890
|
+
set(left: number, anchorX: number, right: number, top: number, anchorY: number, bottom: number): AnchoredRect;
|
|
810
891
|
/**
|
|
811
892
|
* Create rect from basic left, top, width and height arguments.
|
|
812
893
|
*
|
|
@@ -814,9 +895,9 @@ declare class DivRect {
|
|
|
814
895
|
* @param top - Top coordinate.
|
|
815
896
|
* @param width - Width.
|
|
816
897
|
* @param height - Height.
|
|
817
|
-
* @returns -
|
|
898
|
+
* @returns - AnchoredRect.
|
|
818
899
|
*/
|
|
819
|
-
static create(left: number, top: number, width: number, height: number):
|
|
900
|
+
static create(left: number, top: number, width: number, height: number): AnchoredRect;
|
|
820
901
|
/**
|
|
821
902
|
* Create rect from anchorX, anchorY, width, height arguments.
|
|
822
903
|
*
|
|
@@ -824,9 +905,9 @@ declare class DivRect {
|
|
|
824
905
|
* @param centerY - Center y-coordinate.
|
|
825
906
|
* @param width - Width.
|
|
826
907
|
* @param height - Height.
|
|
827
|
-
* @returns -
|
|
908
|
+
* @returns - AnchoredRect.
|
|
828
909
|
*/
|
|
829
|
-
static createCentered(centerX: number, centerY: number, width: number, height: number):
|
|
910
|
+
static createCentered(centerX: number, centerY: number, width: number, height: number): AnchoredRect;
|
|
830
911
|
/**
|
|
831
912
|
* Create rect from sections.
|
|
832
913
|
*
|
|
@@ -834,29 +915,17 @@ declare class DivRect {
|
|
|
834
915
|
* @param rightw - Right section width.
|
|
835
916
|
* @param toph - Top section height.
|
|
836
917
|
* @param bottomh - Bottomsection height.
|
|
837
|
-
* @returns -
|
|
918
|
+
* @returns - AnchoredRect.
|
|
838
919
|
*/
|
|
839
|
-
static createSections(leftw: number, rightw: number, toph: number, bottomh: number):
|
|
920
|
+
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): AnchoredRect;
|
|
840
921
|
/**
|
|
841
|
-
*
|
|
842
|
-
|
|
843
|
-
* */
|
|
922
|
+
* Get center x-coordinate.
|
|
923
|
+
*/
|
|
844
924
|
get centerX(): number;
|
|
845
925
|
/**
|
|
846
|
-
*
|
|
847
|
-
|
|
848
|
-
* */
|
|
849
|
-
set centerX(x: number);
|
|
850
|
-
/**
|
|
851
|
-
* @deprecated - Renamed to anchorX. Will be removed in v2.0.0.
|
|
852
|
-
* @private
|
|
853
|
-
* */
|
|
926
|
+
* Get center ycoordinate.
|
|
927
|
+
*/
|
|
854
928
|
get centerY(): number;
|
|
855
|
-
/**
|
|
856
|
-
* @deprecated - Renamed to anchorX. Will be removed in v2.0.0.
|
|
857
|
-
* @private
|
|
858
|
-
* */
|
|
859
|
-
set centerY(y: number);
|
|
860
929
|
/**
|
|
861
930
|
* Width getter.
|
|
862
931
|
*/
|
|
@@ -892,123 +961,118 @@ declare class DivRect {
|
|
|
892
961
|
/**
|
|
893
962
|
* Do a and b rects overlap?
|
|
894
963
|
*
|
|
895
|
-
* @param a -
|
|
896
|
-
* @param b -
|
|
964
|
+
* @param a - AnchoredRect a.
|
|
965
|
+
* @param b - AnchoredRect b.
|
|
897
966
|
* @returns - True/false.
|
|
898
967
|
*/
|
|
899
|
-
static overlap(a:
|
|
968
|
+
static overlap(a: AnchoredRect, b: AnchoredRect): boolean;
|
|
900
969
|
/**
|
|
901
970
|
* Do horizontal measures of a and b rects overlap?
|
|
902
971
|
*
|
|
903
|
-
* @param a -
|
|
904
|
-
* @param b -
|
|
972
|
+
* @param a - AnchoredRect a.
|
|
973
|
+
* @param b - AnchoredRect b.
|
|
905
974
|
* @returns - True/false.
|
|
906
975
|
*/
|
|
907
|
-
static overlapX(a:
|
|
976
|
+
static overlapX(a: AnchoredRect, b: AnchoredRect): boolean;
|
|
908
977
|
/**
|
|
909
978
|
* Check if given rects are equal.
|
|
910
|
-
* @param a -
|
|
911
|
-
* @param b -
|
|
979
|
+
* @param a - AnchoredRect a.
|
|
980
|
+
* @param b - AnchoredRect b.
|
|
912
981
|
* @returns - True/false.
|
|
913
982
|
*/
|
|
914
|
-
static equals(a:
|
|
983
|
+
static equals(a: AnchoredRect | null | undefined, b: AnchoredRect | null | undefined): boolean;
|
|
915
984
|
/**
|
|
916
985
|
* Check if this rect equals with another rect.
|
|
917
986
|
* @param other - The other rect.
|
|
918
987
|
* @returns - True/false.
|
|
919
988
|
*/
|
|
920
|
-
equals(other:
|
|
989
|
+
equals(other: AnchoredRect): boolean;
|
|
921
990
|
/**
|
|
922
991
|
* Check if edges of given rects are equal, ignoring anchorX and anchorY.
|
|
923
992
|
*
|
|
924
|
-
* @param a -
|
|
925
|
-
* @param b -
|
|
993
|
+
* @param a - AnchoredRect a.
|
|
994
|
+
* @param b - AnchoredRect b.
|
|
926
995
|
* @returns - True/false.
|
|
927
996
|
*/
|
|
928
|
-
static equalsEdges(a:
|
|
997
|
+
static equalsEdges(a: AnchoredRect | null | undefined, b: AnchoredRect | null | undefined): boolean;
|
|
929
998
|
/**
|
|
930
999
|
* Check if edges of this Rect equals with given Rect, ignoring anchorX and anchorY.
|
|
931
1000
|
*
|
|
932
|
-
* @param other - The other
|
|
1001
|
+
* @param other - The other AnchoredRect.
|
|
933
1002
|
* @returns - True/false.
|
|
934
1003
|
*/
|
|
935
|
-
equalsEdges(other:
|
|
936
|
-
/**
|
|
937
|
-
* @deprecated - Use `DivRect.equalsEdges()` instead. Will be removed in v2.0.0.
|
|
938
|
-
* @private
|
|
939
|
-
*/
|
|
940
|
-
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
1004
|
+
equalsEdges(other: AnchoredRect): boolean;
|
|
941
1005
|
/**
|
|
942
1006
|
* Created duplicate of this Rect.
|
|
943
|
-
*
|
|
944
1007
|
* @returns - Duplicate.
|
|
945
1008
|
*/
|
|
946
|
-
|
|
1009
|
+
clone(): AnchoredRect;
|
|
947
1010
|
/**
|
|
948
1011
|
* Move this rect by (dx, dy). Modifies this Rect.
|
|
949
1012
|
*
|
|
950
1013
|
* @param dx - Offset amount in x-direction.
|
|
951
1014
|
* @param dy - Offset amount in y-direction.
|
|
952
|
-
* @returns - This
|
|
1015
|
+
* @returns - This AnchoredRect instance.
|
|
953
1016
|
*/
|
|
954
|
-
offsetInPlace(dx: number, dy: number):
|
|
1017
|
+
offsetInPlace(dx: number, dy: number): AnchoredRect;
|
|
955
1018
|
/**
|
|
956
1019
|
* Move this rect by (dx, dy). Immutable, returns modified copy.
|
|
957
1020
|
*
|
|
958
1021
|
* @param dx - Offset amount in x-direction.
|
|
959
1022
|
* @param dy - Offset amount in y-direction.
|
|
960
|
-
* @returns -
|
|
1023
|
+
* @returns - AnchoredRect copy with applied offset.
|
|
961
1024
|
*/
|
|
962
|
-
offsetCopy(dx: number, dy: number):
|
|
1025
|
+
offsetCopy(dx: number, dy: number): AnchoredRect;
|
|
963
1026
|
/**
|
|
964
1027
|
* Expand this Rect by given Rect. Modifies this Rect.
|
|
965
1028
|
*
|
|
966
|
-
* @param rect -
|
|
967
|
-
* @returns - This
|
|
1029
|
+
* @param rect - AnchoredRect to expand this instance with.
|
|
1030
|
+
* @returns - This AnchoredRect instance.
|
|
968
1031
|
*/
|
|
969
|
-
expandInPlace(rect:
|
|
1032
|
+
expandInPlace(rect: AnchoredRect): AnchoredRect;
|
|
970
1033
|
/**
|
|
971
1034
|
* Expand this Rect by given Rect. Immutable, returns modified copy.
|
|
972
1035
|
*
|
|
973
|
-
* @param rect -
|
|
974
|
-
* @returns - Expanded copy of this
|
|
1036
|
+
* @param rect - AnchoredRect to expand this instance with.
|
|
1037
|
+
* @returns - Expanded copy of this AnchoredRect.
|
|
975
1038
|
*/
|
|
976
|
-
expandCopy(rect:
|
|
1039
|
+
expandCopy(rect: AnchoredRect): AnchoredRect;
|
|
977
1040
|
/**
|
|
978
1041
|
* Clip this Rect by given Rect. Mmodifies this Rect.
|
|
979
1042
|
*
|
|
980
|
-
* @param clipRect -
|
|
981
|
-
* @returns - This
|
|
1043
|
+
* @param clipRect - AnchoredRect to clip this instance with.
|
|
1044
|
+
* @returns - This AnchoredRect instance.
|
|
982
1045
|
*/
|
|
983
|
-
clipInPlace(clipRect:
|
|
1046
|
+
clipInPlace(clipRect: AnchoredRect): AnchoredRect;
|
|
984
1047
|
/**
|
|
985
1048
|
* Clip this Rect by given Rect. Immutable, return modified copy.
|
|
986
1049
|
*
|
|
987
|
-
* @param clipRect -
|
|
988
|
-
* @returns - Clipped
|
|
1050
|
+
* @param clipRect - AnchoredRecto to clip this instance with.
|
|
1051
|
+
* @returns - Clipped AnchoredRect copy.
|
|
989
1052
|
*/
|
|
990
|
-
clipCopy(clipRect:
|
|
1053
|
+
clipCopy(clipRect: AnchoredRect): AnchoredRect;
|
|
991
1054
|
/**
|
|
992
1055
|
* Scale Rect. Anchor pos is (anchorX, anchorY). Modifies this Rect.
|
|
993
1056
|
*
|
|
994
1057
|
* @param scaleX - Scale x-amount.
|
|
995
1058
|
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
996
|
-
* @returns This
|
|
1059
|
+
* @returns This AnchoredRect instance.
|
|
997
1060
|
*/
|
|
998
|
-
scaleInPlace(scaleX: number, scaleY?: number):
|
|
1061
|
+
scaleInPlace(scaleX: number, scaleY?: number): AnchoredRect;
|
|
999
1062
|
/**
|
|
1000
1063
|
* Scale Rect. Anchor pos is (anchorX, anchorY). Immutable, returns modified copy.
|
|
1001
1064
|
*
|
|
1002
1065
|
* @param scaleX - Scale x-amount.
|
|
1003
1066
|
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
1004
|
-
* @returns Scaled copy of this
|
|
1067
|
+
* @returns Scaled copy of this AnchoredRect.
|
|
1005
1068
|
*/
|
|
1006
|
-
scaleCopy(scaleX: number, scaleY?: number):
|
|
1069
|
+
scaleCopy(scaleX: number, scaleY?: number): AnchoredRect;
|
|
1007
1070
|
/**
|
|
1008
|
-
* Get this
|
|
1009
|
-
* @returns - This
|
|
1071
|
+
* Get this AnchoredRect instance.
|
|
1072
|
+
* @returns - This AnchoredRect instance.
|
|
1010
1073
|
*/
|
|
1011
|
-
getRect():
|
|
1074
|
+
getRect(): AnchoredRect;
|
|
1075
|
+
toRect(): Rect;
|
|
1012
1076
|
}
|
|
1013
1077
|
|
|
1014
1078
|
/**
|
|
@@ -1737,4 +1801,276 @@ declare class DeepSet<VALUE> extends SetBase<VALUE, DeepSet<VALUE>> {
|
|
|
1737
1801
|
protected valueEquals(a: VALUE, b: VALUE): boolean;
|
|
1738
1802
|
}
|
|
1739
1803
|
|
|
1740
|
-
|
|
1804
|
+
/**
|
|
1805
|
+
* @deprecated - Use {@link AnchoredRect} instead. Will be removed in v2.0.0.
|
|
1806
|
+
* @private
|
|
1807
|
+
*
|
|
1808
|
+
* A mutable DivRect class is a rectangle (left, top, right, bottom) with an anchor point (anchorX, anchorY).
|
|
1809
|
+
*/
|
|
1810
|
+
declare class DivRect {
|
|
1811
|
+
left: number;
|
|
1812
|
+
anchorX: number;
|
|
1813
|
+
right: number;
|
|
1814
|
+
top: number;
|
|
1815
|
+
anchorY: number;
|
|
1816
|
+
bottom: number;
|
|
1817
|
+
/**
|
|
1818
|
+
* Create rectangle with all zero values.
|
|
1819
|
+
*/
|
|
1820
|
+
constructor();
|
|
1821
|
+
/**
|
|
1822
|
+
* Create rectangle with left, right, top, bottom.
|
|
1823
|
+
* Properties anchorX and anchorY will be centered in the middle.
|
|
1824
|
+
*
|
|
1825
|
+
* @param left - Left coordinate.
|
|
1826
|
+
* @param right - Right coordinate.
|
|
1827
|
+
* @param top - Top coordinate.
|
|
1828
|
+
* @param bottom - Bottom coordinate.
|
|
1829
|
+
*/
|
|
1830
|
+
constructor(left: number, right: number, top: number, bottom: number);
|
|
1831
|
+
/**
|
|
1832
|
+
* Create rectangle with full arguments.
|
|
1833
|
+
*
|
|
1834
|
+
* @param left - Left coordinate.
|
|
1835
|
+
* @param anchorX - Center x-coordinate.
|
|
1836
|
+
* @param right - Right coordinate.
|
|
1837
|
+
* @param top - Top coordinate.
|
|
1838
|
+
* @param anchorY - Center y-coordinate.
|
|
1839
|
+
* @param bottom - Bottom coordinate.
|
|
1840
|
+
*/
|
|
1841
|
+
constructor(left: number, anchorX: number, right: number, top: number, anchorY: number, bottom: number);
|
|
1842
|
+
/**
|
|
1843
|
+
* Set rectangle with all zero values.
|
|
1844
|
+
*/
|
|
1845
|
+
set(): DivRect;
|
|
1846
|
+
/**
|
|
1847
|
+
* Set rectangle with left, right, top, bottom.
|
|
1848
|
+
* Properties anchorX and anchorY will be centered in the middle.
|
|
1849
|
+
*
|
|
1850
|
+
* @param left - Left coordinate.
|
|
1851
|
+
* @param right - Right coordinate.
|
|
1852
|
+
* @param top - Top coordinate.
|
|
1853
|
+
* @param bottom - Bottom coordinate.
|
|
1854
|
+
*/
|
|
1855
|
+
set(left: number, right: number, top: number, bottom: number): DivRect;
|
|
1856
|
+
/**
|
|
1857
|
+
* Set rectangle with full arguments.
|
|
1858
|
+
*
|
|
1859
|
+
* @param left - Left coordinate.
|
|
1860
|
+
* @param anchorX - Center x-coordinate.
|
|
1861
|
+
* @param right - Right coordinate.
|
|
1862
|
+
* @param top - Top coordinate.
|
|
1863
|
+
* @param anchorY - Center y-coordinate.
|
|
1864
|
+
* @param bottom - Bottom coordinate.
|
|
1865
|
+
*/
|
|
1866
|
+
set(left: number, anchorX: number, right: number, top: number, anchorY: number, bottom: number): DivRect;
|
|
1867
|
+
/**
|
|
1868
|
+
* Create rect from basic left, top, width and height arguments.
|
|
1869
|
+
*
|
|
1870
|
+
* @param left - Left coordinate.
|
|
1871
|
+
* @param top - Top coordinate.
|
|
1872
|
+
* @param width - Width.
|
|
1873
|
+
* @param height - Height.
|
|
1874
|
+
* @returns - DivRect.
|
|
1875
|
+
*/
|
|
1876
|
+
static create(left: number, top: number, width: number, height: number): DivRect;
|
|
1877
|
+
/**
|
|
1878
|
+
* Create rect from anchorX, anchorY, width, height arguments.
|
|
1879
|
+
*
|
|
1880
|
+
* @param centerX - Center x-coordinate.
|
|
1881
|
+
* @param centerY - Center y-coordinate.
|
|
1882
|
+
* @param width - Width.
|
|
1883
|
+
* @param height - Height.
|
|
1884
|
+
* @returns - DivRect.
|
|
1885
|
+
*/
|
|
1886
|
+
static createCentered(centerX: number, centerY: number, width: number, height: number): DivRect;
|
|
1887
|
+
/**
|
|
1888
|
+
* Create rect from sections.
|
|
1889
|
+
*
|
|
1890
|
+
* @param leftw - Left section width.
|
|
1891
|
+
* @param rightw - Right section width.
|
|
1892
|
+
* @param toph - Top section height.
|
|
1893
|
+
* @param bottomh - Bottomsection height.
|
|
1894
|
+
* @returns - DivRect.
|
|
1895
|
+
*/
|
|
1896
|
+
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
|
|
1897
|
+
/**
|
|
1898
|
+
* @deprecated - Renamed to anchorX. Will be removed in v2.0.0.
|
|
1899
|
+
* @private
|
|
1900
|
+
* */
|
|
1901
|
+
get centerX(): number;
|
|
1902
|
+
/**
|
|
1903
|
+
* @deprecated - Renamed to anchorX. Will be removed in v2.0.0.
|
|
1904
|
+
* @private
|
|
1905
|
+
* */
|
|
1906
|
+
set centerX(x: number);
|
|
1907
|
+
/**
|
|
1908
|
+
* @deprecated - Renamed to anchorX. Will be removed in v2.0.0.
|
|
1909
|
+
* @private
|
|
1910
|
+
* */
|
|
1911
|
+
get centerY(): number;
|
|
1912
|
+
/**
|
|
1913
|
+
* @deprecated - Renamed to anchorX. Will be removed in v2.0.0.
|
|
1914
|
+
* @private
|
|
1915
|
+
* */
|
|
1916
|
+
set centerY(y: number);
|
|
1917
|
+
/**
|
|
1918
|
+
* Width getter.
|
|
1919
|
+
*/
|
|
1920
|
+
get width(): number;
|
|
1921
|
+
/**
|
|
1922
|
+
* Height getter.
|
|
1923
|
+
*/
|
|
1924
|
+
get height(): number;
|
|
1925
|
+
/**
|
|
1926
|
+
* Left section width getter.
|
|
1927
|
+
*/
|
|
1928
|
+
get leftw(): number;
|
|
1929
|
+
/**
|
|
1930
|
+
* Right section width getter.
|
|
1931
|
+
*/
|
|
1932
|
+
get rightw(): number;
|
|
1933
|
+
/**
|
|
1934
|
+
* Top section height getter.
|
|
1935
|
+
*/
|
|
1936
|
+
get toph(): number;
|
|
1937
|
+
/**
|
|
1938
|
+
* Bottom section height getter.
|
|
1939
|
+
*/
|
|
1940
|
+
get bottomh(): number;
|
|
1941
|
+
/**
|
|
1942
|
+
* Does this Rect contain given (x, y)-point?
|
|
1943
|
+
*
|
|
1944
|
+
* @param x - X-coordinate.
|
|
1945
|
+
* @param y - Y-coordinate.
|
|
1946
|
+
* @returns - True/false.
|
|
1947
|
+
*/
|
|
1948
|
+
contains(x: number, y: number): boolean;
|
|
1949
|
+
/**
|
|
1950
|
+
* Do a and b rects overlap?
|
|
1951
|
+
*
|
|
1952
|
+
* @param a - DivRect a.
|
|
1953
|
+
* @param b - DivRect b.
|
|
1954
|
+
* @returns - True/false.
|
|
1955
|
+
*/
|
|
1956
|
+
static overlap(a: DivRect, b: DivRect): boolean;
|
|
1957
|
+
/**
|
|
1958
|
+
* Do horizontal measures of a and b rects overlap?
|
|
1959
|
+
*
|
|
1960
|
+
* @param a - DivRect a.
|
|
1961
|
+
* @param b - DivRect b.
|
|
1962
|
+
* @returns - True/false.
|
|
1963
|
+
*/
|
|
1964
|
+
static overlapX(a: DivRect, b: DivRect): boolean;
|
|
1965
|
+
/**
|
|
1966
|
+
* Check if given rects are equal.
|
|
1967
|
+
* @param a - DivRect a.
|
|
1968
|
+
* @param b - DivRect b.
|
|
1969
|
+
* @returns - True/false.
|
|
1970
|
+
*/
|
|
1971
|
+
static equals(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
1972
|
+
/**
|
|
1973
|
+
* Check if this rect equals with another rect.
|
|
1974
|
+
* @param other - The other rect.
|
|
1975
|
+
* @returns - True/false.
|
|
1976
|
+
*/
|
|
1977
|
+
equals(other: DivRect): boolean;
|
|
1978
|
+
/**
|
|
1979
|
+
* Check if edges of given rects are equal, ignoring anchorX and anchorY.
|
|
1980
|
+
*
|
|
1981
|
+
* @param a - DivRect a.
|
|
1982
|
+
* @param b - DivRect b.
|
|
1983
|
+
* @returns - True/false.
|
|
1984
|
+
*/
|
|
1985
|
+
static equalsEdges(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
1986
|
+
/**
|
|
1987
|
+
* Check if edges of this Rect equals with given Rect, ignoring anchorX and anchorY.
|
|
1988
|
+
*
|
|
1989
|
+
* @param other - The other DivRect.
|
|
1990
|
+
* @returns - True/false.
|
|
1991
|
+
*/
|
|
1992
|
+
equalsEdges(other: DivRect): boolean;
|
|
1993
|
+
/**
|
|
1994
|
+
* @deprecated - Use {@link equalsEdges()} instead. Will be removed in v2.0.0.
|
|
1995
|
+
* @private
|
|
1996
|
+
*/
|
|
1997
|
+
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
1998
|
+
/**
|
|
1999
|
+
* @deprecated - Use {@link clone()} instead. Will be removed in v2.0.0.
|
|
2000
|
+
* @private
|
|
2001
|
+
*/
|
|
2002
|
+
copy(): DivRect;
|
|
2003
|
+
/**
|
|
2004
|
+
* Created duplicate of this Rect.
|
|
2005
|
+
* @returns - Duplicate.
|
|
2006
|
+
*/
|
|
2007
|
+
clone(): DivRect;
|
|
2008
|
+
/**
|
|
2009
|
+
* Move this rect by (dx, dy). Modifies this Rect.
|
|
2010
|
+
*
|
|
2011
|
+
* @param dx - Offset amount in x-direction.
|
|
2012
|
+
* @param dy - Offset amount in y-direction.
|
|
2013
|
+
* @returns - This DivRect instance.
|
|
2014
|
+
*/
|
|
2015
|
+
offsetInPlace(dx: number, dy: number): DivRect;
|
|
2016
|
+
/**
|
|
2017
|
+
* Move this rect by (dx, dy). Immutable, returns modified copy.
|
|
2018
|
+
*
|
|
2019
|
+
* @param dx - Offset amount in x-direction.
|
|
2020
|
+
* @param dy - Offset amount in y-direction.
|
|
2021
|
+
* @returns - DivRect copy with applied offset.
|
|
2022
|
+
*/
|
|
2023
|
+
offsetCopy(dx: number, dy: number): DivRect;
|
|
2024
|
+
/**
|
|
2025
|
+
* Expand this Rect by given Rect. Modifies this Rect.
|
|
2026
|
+
*
|
|
2027
|
+
* @param rect - DivRect to expand this instance with.
|
|
2028
|
+
* @returns - This DivRect instance.
|
|
2029
|
+
*/
|
|
2030
|
+
expandInPlace(rect: DivRect): DivRect;
|
|
2031
|
+
/**
|
|
2032
|
+
* Expand this Rect by given Rect. Immutable, returns modified copy.
|
|
2033
|
+
*
|
|
2034
|
+
* @param rect - DivRect to expand this instance with.
|
|
2035
|
+
* @returns - Expanded copy of this DivRect.
|
|
2036
|
+
*/
|
|
2037
|
+
expandCopy(rect: DivRect): DivRect;
|
|
2038
|
+
/**
|
|
2039
|
+
* Clip this Rect by given Rect. Mmodifies this Rect.
|
|
2040
|
+
*
|
|
2041
|
+
* @param clipRect - DivRect to clip this instance with.
|
|
2042
|
+
* @returns - This DivRect instance.
|
|
2043
|
+
*/
|
|
2044
|
+
clipInPlace(clipRect: DivRect): DivRect;
|
|
2045
|
+
/**
|
|
2046
|
+
* Clip this Rect by given Rect. Immutable, return modified copy.
|
|
2047
|
+
*
|
|
2048
|
+
* @param clipRect - DivRecto to clip this instance with.
|
|
2049
|
+
* @returns - Clipped DivRect copy.
|
|
2050
|
+
*/
|
|
2051
|
+
clipCopy(clipRect: DivRect): DivRect;
|
|
2052
|
+
/**
|
|
2053
|
+
* Scale Rect. Anchor pos is (anchorX, anchorY). Modifies this Rect.
|
|
2054
|
+
*
|
|
2055
|
+
* @param scaleX - Scale x-amount.
|
|
2056
|
+
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
2057
|
+
* @returns This DivRect instance.
|
|
2058
|
+
*/
|
|
2059
|
+
scaleInPlace(scaleX: number, scaleY?: number): DivRect;
|
|
2060
|
+
/**
|
|
2061
|
+
* Scale Rect. Anchor pos is (anchorX, anchorY). Immutable, returns modified copy.
|
|
2062
|
+
*
|
|
2063
|
+
* @param scaleX - Scale x-amount.
|
|
2064
|
+
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
2065
|
+
* @returns Scaled copy of this DivRect.
|
|
2066
|
+
*/
|
|
2067
|
+
scaleCopy(scaleX: number, scaleY?: number): DivRect;
|
|
2068
|
+
/**
|
|
2069
|
+
* Get this DivRect instance.
|
|
2070
|
+
* @returns - This DivRect instance.
|
|
2071
|
+
*/
|
|
2072
|
+
getRect(): DivRect;
|
|
2073
|
+
toRect(): Rect;
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
export { AnchoredRect, index$7 as Assert, BaseContainer, BiMap, cookies as Cookies, DeepSet, DefaultArray, DefaultEqualityFn, device as Device, DivRect, type EqualityFn, Guard, IndexArray, type KVComponent, LRUCache, LinkedList, Map1, Map2, Map3, MultiContainer, Rect, Set1, SetBase, SignedIndexArray, SmallIntCache, Stack, TriMap, UniMap, index as Utils, ValueSet, Vec, Vec2, asMulti };
|