Skip to content

Commit

Permalink
add a VoicingCircle, for phetsims/trig-tour#108
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Jan 7, 2025
1 parent 8ec1799 commit e7b7f94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions js/accessibility/voicing/nodes/VoicingCircle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2025, University of Colorado Boulder

/**
* A Circle that mixes Voicing.
*
* @author Jesse Greenberg (PhET Interactive Simulations)
*/

import { EmptySelfOptions } from '../../../../../phet-core/js/optionize.js';
import { Circle, CircleOptions, ReadingBlockOptions, scenery, Voicing } from '../../../imports.js';

type SelfOptions = EmptySelfOptions;
type ParentOptions = ReadingBlockOptions & CircleOptions;
export type VoicingTextOptions = SelfOptions & ParentOptions;

class VoicingCircle extends Voicing( Circle ) {
public constructor( radius?: number | CircleOptions, options?: CircleOptions ) {
if ( typeof radius === 'object' || radius === undefined ) {
super( options );
}
else {
super( radius, options );
}
}
}

scenery.register( 'VoicingCircle', VoicingCircle );
export default VoicingCircle;
1 change: 1 addition & 0 deletions js/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export { default as voicingManager } from './accessibility/voicing/voicingManage
export { default as voicingUtteranceQueue } from './accessibility/voicing/voicingUtteranceQueue.js';
export { default as Voicing, isVoicing } from './accessibility/voicing/Voicing.js';
export type { VoicingOptions, VoicingNode, SpeakingOptions, TVoicing } from './accessibility/voicing/Voicing.js';
export { default as VoicingCircle } from './accessibility/voicing/nodes/VoicingCircle.js';
export { default as ReadingBlockUtterance } from './accessibility/voicing/ReadingBlockUtterance.js';
export type { ReadingBlockUtteranceOptions } from './accessibility/voicing/ReadingBlockUtterance.js';
export { default as FocusDisplayedController } from './accessibility/FocusDisplayedController.js';
Expand Down

0 comments on commit e7b7f94

Please sign in to comment.