chore: Introducing RotatedBounds
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
//
|
||||
// Generic markers
|
||||
//
|
||||
|
||||
/**
|
||||
* Can be used for any type of point-likes to mark them as rotated to enlist
|
||||
* the type checker to weed out subtle bugs due to rotated and non-rotated
|
||||
* versions of the same data point.
|
||||
*/
|
||||
export type Rotated<T> = T & { _brand_rotated: "excalimath_rotated" };
|
||||
|
||||
//
|
||||
// Measurements
|
||||
//
|
||||
@@ -23,12 +34,6 @@ export type Degrees = number & { _brand: "excalimath_degree" };
|
||||
*/
|
||||
export type InclusiveRange = [number, number] & { _brand: "excalimath_degree" };
|
||||
|
||||
/**
|
||||
* Can be used for any type of point-likes that are non-rotated, such as
|
||||
* non-AABB Bounds, or non-rotated Point.
|
||||
*/
|
||||
export type NonRotated<T> = T & { _brand_nonrotated: "excalimath_nonrotated" };
|
||||
|
||||
//
|
||||
// Point
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user