Skip to content

Commit

Permalink
UtteranceQueue is parameteric, #106
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 2, 2023
1 parent 3b465a0 commit 7d6aa74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/UtteranceQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ type SelfOptions = {
type UtteranceQueueOptions = SelfOptions & PhetioObjectOptions;


class UtteranceQueue extends PhetioObject {
class UtteranceQueue<MyAnnouncer extends Announcer = Announcer> extends PhetioObject {

// Sends browser requests to announce either through aria-live with a screen reader or
// SpeechSynthesis with Web Speech API (respectively), or any method that implements this interface. Use with caution,
// and only with the understanding that you know what Announcer this UtteranceQueue instance uses.
private readonly announcer: Announcer;
private readonly announcer: MyAnnouncer;

// Initialization is like utteranceQueue's constructor. No-ops all around if not
// initialized (cheers). See constructor()
Expand Down Expand Up @@ -90,7 +90,7 @@ class UtteranceQueue extends PhetioObject {
* which requests speech in some way (such as the Web Speech API or aria-live)
* @param [providedOptions]
*/
public constructor( announcer: Announcer, providedOptions?: UtteranceQueueOptions ) {
public constructor( announcer: MyAnnouncer, providedOptions?: UtteranceQueueOptions ) {

const options = optionize<UtteranceQueueOptions, SelfOptions, PhetioObjectOptions>()( {
debug: false,
Expand Down

0 comments on commit 7d6aa74

Please sign in to comment.