@@ -145,6 +145,7 @@ import type {
145
145
} from "./math/math" ;
146
146
import type { NavMesh } from "./math/navigationmesh" ;
147
147
import type { Vec2 } from "./math/Vec2" ;
148
+ import type { Defined , MergeObj } from "./utils/types" ;
148
149
149
150
/**
150
151
* Context handle that contains every KAPLAY function.
@@ -5835,31 +5836,6 @@ export type Tag = string;
5835
5836
*/
5836
5837
export type GameObj < T = any > = GameObjRaw & MergeComps < T > ;
5837
5838
5838
- export type UnionToIntersection < U > = (
5839
- U extends any ? ( k : U ) => void : never
5840
- ) extends ( k : infer I ) => void ? I
5841
- : never ;
5842
-
5843
- // What defined does is remove prop: never types for left types clean.
5844
- // This could work for the proccess of remove Comp properties in XXXXComp types
5845
- export type Defined < T > = T extends any
5846
- ? Pick < T , { [ K in keyof T ] -?: T [ K ] extends undefined ? never : K } [ keyof T ] >
5847
- : never ;
5848
-
5849
- /**
5850
- * It obligates to TypeScript to Expand the type.
5851
- *
5852
- * Instead of being `{ id: 1 } | { name: "hi" }`
5853
- * makes
5854
- * It's `{ id: 1, name: "hi" }`
5855
- *
5856
- * https://www.totaltypescript.com/concepts/the-prettify-helper
5857
- *
5858
- * Previously Expand<T>
5859
- */
5860
- export type Prettify < T > = T extends infer U ? { [ K in keyof U ] : U [ K ] } : never ;
5861
- export type MergeObj < T > = Prettify < UnionToIntersection < Defined < T > > > ;
5862
-
5863
5839
type RemoveCompProps < T > = Defined <
5864
5840
{
5865
5841
[ K in keyof T ] : K extends keyof Comp ? never : T [ K ] ;
0 commit comments