-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove invalid Pixi React props from JSX elements
- Loading branch information
Showing
15 changed files
with
111 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { | ||
Container, | ||
Filter, | ||
} from 'pixi.js'; | ||
import type { PixiReactNode } from './PixiReactNode.ts'; | ||
|
||
export type BasePixiReactNode<T extends new (...args: any) => any = typeof Container | typeof Filter> = PixiReactNode<T>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { ConstructorOverrides } from './ConstructorOverrides'; | ||
|
||
/** | ||
* 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 | ||
*/ | ||
export type ConstructorOptions<T extends new (...args: any[]) => any> = | ||
Extract<ConstructorOverrides, { 0: T }> extends [T, infer R] | ||
? unknown extends R | ||
? ConstructorParameters<T>[0] | ||
: R | ||
: never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { | ||
AlphaFilter, | ||
AlphaFilterOptions, | ||
BlurFilter, | ||
BlurFilterOptions, | ||
BlurFilterPass, | ||
BlurFilterPassOptions, | ||
DisplacementFilter, | ||
DisplacementFilterOptions, | ||
Filter, | ||
FilterOptions, | ||
NoiseFilter, | ||
NoiseFilterOptions, | ||
Text, | ||
TextOptions, | ||
} from 'pixi.js'; | ||
|
||
export type ConstructorOverrides = | ||
| [typeof AlphaFilter, AlphaFilterOptions] | ||
| [typeof BlurFilter, BlurFilterOptions] | ||
| [typeof BlurFilterPass, BlurFilterPassOptions] | ||
| [typeof DisplacementFilter, DisplacementFilterOptions] | ||
| [typeof Filter, FilterOptions] | ||
| [typeof NoiseFilter, NoiseFilterOptions] | ||
| [typeof Text, TextOptions]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import type { | ||
FederatedEventHandler, | ||
FederatedPointerEvent, | ||
FederatedWheelEvent, | ||
} from 'pixi.js'; | ||
import type { ReactToPixiEventPropNames } from '../constants/EventPropNames.ts'; | ||
|
||
export type EventHandlers = { | ||
-readonly [K in keyof typeof ReactToPixiEventPropNames]?: (event: FederatedPointerEvent | FederatedWheelEvent) => void | ||
-readonly [K in keyof typeof ReactToPixiEventPropNames]?: | ||
| FederatedEventHandler<FederatedPointerEvent> | ||
| FederatedEventHandler<FederatedWheelEvent> | ||
| null | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import type * as PIXI from 'pixi.js'; | ||
import type { NameOverrides } from '../constants/NameOverrides.ts'; | ||
import type { PixiComponents } from './PixiComponents.ts'; | ||
import type { PixiReactNode } from './PixiReactNode.ts'; | ||
import type { PixiReactElementProps } from './PixiReactNode.ts'; | ||
|
||
export type PixiElements = { | ||
[K in PixiComponents as K extends keyof typeof NameOverrides ? typeof NameOverrides[K] : Uncapitalize<K>]: PixiReactNode<typeof PIXI[K]> | ||
[K in PixiComponents as K extends keyof typeof NameOverrides ? typeof NameOverrides[K] : Uncapitalize<K>]: { | ||
[K2 in keyof PixiReactElementProps<typeof PIXI[K]> as K2]?: PixiReactElementProps<typeof PIXI[K]>[K2] extends (...args: any) => any | ||
? never | ||
: PixiReactElementProps<typeof PIXI[K]>[K2]; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { ReactNode } from 'react'; | ||
import type { BasePixiReactNode } from './BasePixiReactNode.ts'; | ||
|
||
export type PixiReactChildNode = BasePixiReactNode | Iterable<BasePixiReactNode> | ReactNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters