Skip to content

Commit

Permalink
Chore: Remove Renderer cast in Accessibility (pixijs#8476)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Jul 10, 2022
1 parent 444194a commit 7c94608
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
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

0 comments on commit 7c94608

Please sign in to comment.