diff --git a/src/typedefs/ConstructorOptions.ts b/src/typedefs/ConstructorOptions.ts index ec457644..2c22f5d6 100644 --- a/src/typedefs/ConstructorOptions.ts +++ b/src/typedefs/ConstructorOptions.ts @@ -1,5 +1,8 @@ +import { type GraphicsContext, type Texture } from 'pixi.js'; import { type ConstructorOverrides } from './ConstructorOverrides'; +type ConstructorOptionExcludes = GraphicsContext | Texture; + /** * We're adding a specific options type overrides for some components because their deprecated overloads get in the way. * @see https://github.com/pixijs/pixi-react/issues/500 @@ -7,6 +10,6 @@ import { type ConstructorOverrides } from './ConstructorOverrides'; export type ConstructorOptions any> = Extract extends [T, infer R] ? unknown extends R - ? ConstructorParameters[0] + ? NonNullable[0], ConstructorOptionExcludes>> : R : unknown; diff --git a/src/typedefs/ConstructorOverrides.ts b/src/typedefs/ConstructorOverrides.ts index fcc76137..36322847 100644 --- a/src/typedefs/ConstructorOverrides.ts +++ b/src/typedefs/ConstructorOverrides.ts @@ -16,7 +16,6 @@ import { type PlaneGeometryOptions, type Text, type TextOptions, - type Texture, type TilingSprite, type TilingSpriteOptions, } from 'pixi.js'; @@ -28,8 +27,8 @@ export type ConstructorOverrides = | [typeof HTMLText, HTMLTextOptions] | [typeof Mesh, MeshOptions] | [typeof MeshGeometry, MeshGeometryOptions] - | [typeof NineSliceSprite, NineSliceSpriteOptions | Texture] + | [typeof NineSliceSprite, NineSliceSpriteOptions] | [typeof PlaneGeometry, PlaneGeometryOptions] - | [typeof TilingSprite, TilingSpriteOptions | Texture] + | [typeof TilingSprite, TilingSpriteOptions] | [typeof Text, TextOptions];