@@ -11,7 +11,7 @@ import type {
11
11
export type NgtNonFunctionKeys < T > = { [ K in keyof T ] -?: T [ K ] extends Function ? never : K } [ keyof T ] ;
12
12
export type NgtOverwrite < T , O > = Omit < T , NgtNonFunctionKeys < O > > & O ;
13
13
export type NgtProperties < T > = Pick < T , NgtNonFunctionKeys < T > > ;
14
- export type NgtMutable < P > = { [ K in keyof P ] : P [ K ] | Readonly < P [ K ] > } ;
14
+ export type NgtMutable < P > = { [ K in keyof P ] : P [ K ] extends Array < any > ? P [ K ] : P [ K ] | Readonly < P [ K ] > } ;
15
15
16
16
export interface NgtMathRepresentation {
17
17
set ( ...args : number [ ] ) : any ;
@@ -33,6 +33,15 @@ export type NgtMathProperties<P> = {
33
33
[ K in keyof P as P [ K ] extends NgtMathTypes ? K : never ] : P [ K ] extends NgtMathTypes ? NgtMathType < P [ K ] > : never ;
34
34
} ;
35
35
36
+ export type NgtIsProperties < P > = {
37
+ [ K in keyof P as P [ K ] extends true ? K : never ] : true ;
38
+ } ;
39
+
40
+ export type NgtNonMutableProperties = 'id' | 'uuid' | 'name' | 'type' | 'parent' | 'children' ;
41
+ export type NgtNonPartialProperties < P > = {
42
+ [ K in keyof P as K extends NgtNonMutableProperties ? K : never ] : P [ K ] ;
43
+ } ;
44
+
36
45
export type NgtNullableRaycast < P > = {
37
46
[ K in keyof P as K extends 'raycast' ? K : never ] : K extends 'raycast' ? P [ K ] | null : never ;
38
47
} ;
@@ -109,6 +118,8 @@ export type NgtElementProperties<
109
118
TConstructor extends NgtConstructorRepresentation ,
110
119
TInstance = InstanceType < TConstructor > ,
111
120
> = Partial < NgtOverwrite < TInstance , NgtMathProperties < TInstance > & NgtNullableRaycast < TInstance > > > &
121
+ NgtIsProperties < TInstance > &
122
+ NgtNonPartialProperties < TInstance > &
112
123
NgtNodeElement < TConstructor , TInstance > ;
113
124
114
125
export type NgtThreeElement < TConstructor extends NgtConstructorRepresentation > = NgtMutable <
0 commit comments