Skip to content

Commit

Permalink
Fix adjacent overload signatures, see: phetsims/chipper#1250
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed May 26, 2022
1 parent ee807a6 commit b78a768
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
15 changes: 8 additions & 7 deletions js/ResponsePacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,47 +115,48 @@ class ResponsePacket {

get nameResponse(): ResolvedResponse { return this.getNameResponse(); }

set nameResponse( nameResponse: VoicingResponse ) { this.setNameResponse( nameResponse ); }

setNameResponse( nameResponse: VoicingResponse ): void {
this._nameResponse = nameResponse;
}

set nameResponse( nameResponse: VoicingResponse ) { this.setNameResponse( nameResponse ); }

getObjectResponse(): ResolvedResponse {
return ResponsePacket.getResponseText( this._objectResponse );
}

get objectResponse(): ResolvedResponse { return this.getObjectResponse(); }

set objectResponse( objectResponse: VoicingResponse ) { this.setObjectResponse( objectResponse ); }

setObjectResponse( objectResponse: VoicingResponse ): void {
this._objectResponse = objectResponse;
}

set objectResponse( objectResponse: VoicingResponse ) { this.setObjectResponse( objectResponse ); }

getContextResponse(): ResolvedResponse {
return ResponsePacket.getResponseText( this._contextResponse );
}

get contextResponse(): ResolvedResponse { return this.getContextResponse(); }

set contextResponse( contextResponse: VoicingResponse ) { this.setContextResponse( contextResponse ); }

setContextResponse( contextResponse: VoicingResponse ): void {
this._contextResponse = contextResponse;
}

set contextResponse( contextResponse: VoicingResponse ) { this.setContextResponse( contextResponse ); }

getHintResponse(): ResolvedResponse {
return ResponsePacket.getResponseText( this._hintResponse );
}

get hintResponse(): ResolvedResponse { return this.getHintResponse(); }

set hintResponse( hintResponse: VoicingResponse ) { this.setHintResponse( hintResponse ); }

setHintResponse( hintResponse: VoicingResponse ): void {
this._hintResponse = hintResponse;
}

set hintResponse( hintResponse: VoicingResponse ) { this.setHintResponse( hintResponse ); }

private static getResponseText( response: VoicingResponse ): ResolvedResponse {
return typeof response === 'function' ? response() : response;
Expand Down
8 changes: 4 additions & 4 deletions js/Utterance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ class Utterance {

get alert(): AlertableNoUtterance {return this.getAlert(); }

set alert( alert: AlertableNoUtterance ) { this.setAlert( alert ); }

setAlert( alert: AlertableNoUtterance ): void {
this._alert = alert;
}

set alert( alert: AlertableNoUtterance ) { this.setAlert( alert ); }

/**
* Set the alertStableDelay time, see alertStableDelay option for more information.
*
Expand Down Expand Up @@ -247,6 +247,8 @@ class Utterance {

set canAnnounceProperties( canAnnounceProperties: IProperty<boolean>[] ) { this.setCanAnnounceProperties( canAnnounceProperties ); }

get canAnnounceProperties() { return this.getCanAnnounceProperties(); }

/**
* Get the Properties that control whether the alert content for this Utterance can be announced.
* All must be true for the announcement to occur.
Expand All @@ -255,8 +257,6 @@ class Utterance {
return this._canAnnounceProperties.slice( 0 ); // defensive copy
}

get canAnnounceProperties() { return this.getCanAnnounceProperties(); }

/**
* Make eligible for garbage collection.
*/
Expand Down
8 changes: 4 additions & 4 deletions js/UtteranceQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ class UtteranceQueue extends PhetioObject {

set muted( isMuted: boolean ) { this.setMuted( isMuted ); }

get muted() { return this.getMuted(); }

/**
* Get whether or not the utteranceQueue is muted. When muted, Utterances will still
* move through the queue, but nothing will be read by asistive technology.
Expand All @@ -450,8 +452,6 @@ class UtteranceQueue extends PhetioObject {
return this._muted;
}

get muted() { return this.getMuted(); }

/**
* Set whether or not the utterance queue is enabled. When enabled, Utterances cannot be added to
* the queue, and the Queue cannot be cleared. Also nothing will be sent to assistive technology.
Expand All @@ -462,6 +462,8 @@ class UtteranceQueue extends PhetioObject {

set enabled( isEnabled ) { this.setEnabled( isEnabled ); }

get enabled(): boolean { return this.isEnabled(); }

/**
* Get whether or not the utterance queue is enabled. When enabled, Utterances cannot be added to
* the queue, and the Queue cannot be cleared. Also nothing will be sent to assistive technology.
Expand All @@ -470,8 +472,6 @@ class UtteranceQueue extends PhetioObject {
return this._enabled;
}

get enabled(): boolean { return this.isEnabled(); }

/**
* Step the queue, called by the timer.
* @param dt - time since last step, in seconds
Expand Down

0 comments on commit b78a768

Please sign in to comment.