Skip to content

Commit

Permalink
Add isInteractiveHighlighting, see #1653
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Sep 3, 2024
1 parent dec428e commit aac48db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions js/accessibility/voicing/InteractiveHighlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,27 @@ export interface TInteractiveHighlighting<SuperType extends Node = Node> {
interactiveHighlightChangedEmitter: TEmitter;
readonly isInteractiveHighlightActiveProperty: TReadOnlyProperty<boolean>;
readonly isInteractiveHighlighting: boolean;

setInteractiveHighlight( interactiveHighlight: Highlight ): void;

interactiveHighlight: Highlight;

getInteractiveHighlight(): Highlight;

setInteractiveHighlightLayerable( interactiveHighlightLayerable: boolean ): void;

interactiveHighlightLayerable: boolean;

getInteractiveHighlightLayerable(): boolean;

setInteractiveHighlightEnabled( enabled: boolean ): void;

getInteractiveHighlightEnabled(): boolean;

interactiveHighlightEnabled: boolean;

handleHighlightActiveChange(): void;

onChangedInstance( instance: Instance, added: boolean ): void;

// @mixin-protected - made public for use in the mixin only
Expand Down Expand Up @@ -681,5 +692,9 @@ const InteractiveHighlighting = memoize( <SuperType extends Constructor<Node>>(

export type InteractiveHighlightingNode = Node & TInteractiveHighlighting;

export function isInteractiveHighlighting( something: IntentionalAny ): something is InteractiveHighlightingNode {
return something instanceof Node && ( something as InteractiveHighlightingNode ).isInteractiveHighlighting;
}

scenery.register( 'InteractiveHighlighting', InteractiveHighlighting );
export default InteractiveHighlighting;
2 changes: 1 addition & 1 deletion js/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export { default as Cursor } from './accessibility/reader/Cursor.js';
export { default as Reader } from './accessibility/reader/Reader.js';
export { default as KeyStateTracker } from './accessibility/KeyStateTracker.js';
export { default as globalKeyStateTracker } from './accessibility/globalKeyStateTracker.js';
export { default as InteractiveHighlighting } from './accessibility/voicing/InteractiveHighlighting.js';
export { default as InteractiveHighlighting, isInteractiveHighlighting } from './accessibility/voicing/InteractiveHighlighting.js';
export type { InteractiveHighlightingOptions, TInteractiveHighlighting } from './accessibility/voicing/InteractiveHighlighting.js';
export { default as InteractiveHighlightingNode } from './accessibility/voicing/nodes/InteractiveHighlightingNode.js';
export type { InteractiveHighlightingNodeOptions } from './accessibility/voicing/nodes/InteractiveHighlightingNode.js';
Expand Down

0 comments on commit aac48db

Please sign in to comment.