File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ import { type GraphicsContext , type Texture } from 'pixi.js' ;
1
2
import { type ConstructorOverrides } from './ConstructorOverrides' ;
2
3
4
+ type ConstructorOptionExcludes = GraphicsContext | Texture ;
5
+
3
6
/**
4
7
* We're adding a specific options type overrides for some components because their deprecated overloads get in the way.
5
8
* @see https://github.com/pixijs/pixi-react/issues/500
6
9
*/
7
10
export type ConstructorOptions < T extends new ( ...args : any [ ] ) => any > =
8
11
Extract < ConstructorOverrides , { 0 : T } > extends [ T , infer R ]
9
12
? unknown extends R
10
- ? ConstructorParameters < T > [ 0 ]
13
+ ? NonNullable < Exclude < ConstructorParameters < T > [ 0 ] , ConstructorOptionExcludes > >
11
14
: R
12
15
: unknown ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
16
16
type PlaneGeometryOptions ,
17
17
type Text ,
18
18
type TextOptions ,
19
- type Texture ,
20
19
type TilingSprite ,
21
20
type TilingSpriteOptions ,
22
21
} from 'pixi.js' ;
@@ -28,8 +27,8 @@ export type ConstructorOverrides =
28
27
| [ typeof HTMLText , HTMLTextOptions ]
29
28
| [ typeof Mesh , MeshOptions ]
30
29
| [ typeof MeshGeometry , MeshGeometryOptions ]
31
- | [ typeof NineSliceSprite , NineSliceSpriteOptions | Texture ]
30
+ | [ typeof NineSliceSprite , NineSliceSpriteOptions ]
32
31
| [ typeof PlaneGeometry , PlaneGeometryOptions ]
33
- | [ typeof TilingSprite , TilingSpriteOptions | Texture ]
32
+ | [ typeof TilingSprite , TilingSpriteOptions ]
34
33
| [ typeof Text , TextOptions ] ;
35
34
You can’t perform that action at this time.
0 commit comments