Skip to content

Commit

Permalink
convert AlertableDef.ts to typescript, phetsims/scenery#1340
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 8, 2022
1 parent cee0972 commit ed4ca34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions js/accessibility/describers/Alerter.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Alerter {
/**
* Alert to both description and voicing utteranceQueues, depending on if both are supported by this instance
* @public
* @param {AlertableDef} alertable
* @param {TAlertableDef} alertable
*/
alert( alertable ) {
this.alertToVoicing && voicingUtteranceQueue.addToBack( alertable );
Expand All @@ -48,7 +48,7 @@ class Alerter {

/**
* Forward to provided Node for UtteranceQueue alerting logic. See ParallelDOM.alertDescriptionUtterance() for details.
* @param {AlertableDef} alertable
* @param {TAlertableDef} alertable
* @public
*/
alertDescriptionUtterance( alertable ) {
Expand Down
8 changes: 4 additions & 4 deletions js/accessibility/describers/BorderAlertsDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BorderAlertsDescriber {
// {Property<Bounds2>} - The bounds that makes the border we alert when against
boundsProperty: new Property( new Bounds2( Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY ) ),

// {null|AlertableDef} At left edge, right edge, top, and bottom with values to alert if you reach that bound.
// {null|TAlertableDef} At left edge, right edge, top, and bottom with values to alert if you reach that bound.
// Pass in null if you don't want that border alerted. By default, if these are non-Utterances, they will be wrapped
// in utterances, and for voicing classified as "object responses", if passing in a custom utterance, it is up to
// the client to divide into voicing response categories.
Expand Down Expand Up @@ -71,7 +71,7 @@ class BorderAlertsDescriber {
/**
* Wrap the direction property in an Utterance if not already one. Null is supported.
* @private
* @param {AlertableDef|null} alert
* @param {TAlertableDef|null} alert
* @param {DirectionEnum} direction
* @param {Object} [utteranceOptions] - if creating an Utterance, options to pass to it
*/
Expand Down Expand Up @@ -101,7 +101,7 @@ class BorderAlertsDescriber {
*
* @param {Vector2} position
* @param {string} [key] - prefer this direction key if provided
* @returns{null|AlertableDef} - null if there is nothing to alert
* @returns{null|TAlertableDef} - null if there is nothing to alert
*/
getAlertAtBorder( position, key ) {
let alertDirection;
Expand Down Expand Up @@ -160,7 +160,7 @@ class BorderAlertsDescriber {
* @public
* @param {Vector2} position
* @param {KeyboardEvent} [domEvent] - we don't get this from a mouse drag listener
* @returns{null|AlertableDef} - null if there is nothing to alert
* @returns{null|TAlertableDef} - null if there is nothing to alert
*/
getAlertOnEndDrag( position, domEvent ) {
let key;
Expand Down
4 changes: 2 additions & 2 deletions js/accessibility/describers/MovementAlerter.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class MovementAlerter extends Alerter {
// see BorderAlertsDescriber
borderAlertsOptions: null,

// {Object.<DIRECTION, AlertableDef> see DirectionEnum for allowed keys. Any missing keys will not be alerted.
// {Object.<DIRECTION, TAlertableDef> see DirectionEnum for allowed keys. Any missing keys will not be alerted.
// Use `{}` to omit movementAlerts.
movementAlerts: DEFAULT_MOVEMENT_DESCRIPTIONS,

Expand Down Expand Up @@ -147,7 +147,7 @@ class MovementAlerter extends Alerter {
* @public
* @override
*
* @param {AlertableDef} alertable - anything that can be passed to UtteranceQueue
* @param {TAlertableDef} alertable - anything that can be passed to UtteranceQueue
*/
alert( alertable ) {
super.alert( alertable );
Expand Down

0 comments on commit ed4ca34

Please sign in to comment.