Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Remove Renderer cast in Accessibility #8476

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/accessibility/src/AccessibilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Rectangle } from '@pixi/math';
import type { Container } from '@pixi/display';
import { ExtensionType } from '@pixi/core';
import type { IAccessibleHTMLElement } from './accessibleTarget';
import type { IRenderer, ExtensionMetadata, Renderer } from '@pixi/core';
import type { IRenderer, ExtensionMetadata } from '@pixi/core';
import { FederatedEvent } from '@pixi/events';

// add some extra variables to the container..
Expand Down Expand Up @@ -504,7 +504,7 @@ export class AccessibilityManager
private _dispatchEvent(e: UIEvent, type: string[]): void
{
const { displayObject: target } = e.target as IAccessibleHTMLElement;
const boundry = (this.renderer as Renderer).events.rootBoundary;
const boundry = this.renderer.events.rootBoundary;
const event: FederatedEvent = Object.assign(new FederatedEvent(boundry), { target });

boundry.rootTarget = this.renderer.lastObjectRendered as DisplayObject;
Expand Down
6 changes: 6 additions & 0 deletions packages/core/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ declare namespace GlobalMixins

}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface IRenderer
{

}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface IRendererPlugins
{
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/IRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface IRendererRenderOptions
* Starard Interface for a Pixi renderer.
* @memberof PIXI
*/
export interface IRenderer extends SystemManager
export interface IRenderer extends SystemManager, GlobalMixins.IRenderer
{

resize(width: number, height: number): void;
Expand Down
5 changes: 5 additions & 0 deletions packages/events/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ declare namespace GlobalMixins

}

interface IRenderer
{
readonly events: import('@pixi/events').EventSystem;
}

interface Renderer
{
readonly events: import('@pixi/events').EventSystem;
Expand Down