Skip to content

Commit

Permalink
rename Emitter's argumentTypes -> validators, phetsims/axon#212
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 23, 2019
1 parent 6ec2890 commit 60c1021
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
42 changes: 21 additions & 21 deletions js/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ define( require => {
tandem: options.tandem.createTandem( 'mouseUpEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'point', type: Vector2IO },
{ name: 'event', type: DOMEventIO }
Expand All @@ -263,7 +263,7 @@ define( require => {
tandem: options.tandem.createTandem( 'mouseDownEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'point', type: Vector2IO },
{ name: 'event', type: DOMEventIO }
Expand All @@ -283,7 +283,7 @@ define( require => {
tandem: options.tandem.createTandem( 'mouseMovedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'point', type: Vector2IO },
{ name: 'event', type: DOMEventIO }
Expand All @@ -304,7 +304,7 @@ define( require => {
tandem: options.tandem.createTandem( 'mouseOverEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'point', type: Vector2IO },
{ name: 'event', type: DOMEventIO }
Expand All @@ -324,7 +324,7 @@ define( require => {
tandem: options.tandem.createTandem( 'mouseOutEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'point', type: Vector2IO },
{ name: 'event', type: DOMEventIO }
Expand All @@ -344,7 +344,7 @@ define( require => {
tandem: options.tandem.createTandem( 'wheelScrolledEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand All @@ -370,7 +370,7 @@ define( require => {
tandem: options.tandem.createTandem( 'touchStartedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -391,7 +391,7 @@ define( require => {
tandem: options.tandem.createTandem( 'touchEndedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -415,7 +415,7 @@ define( require => {
tandem: options.tandem.createTandem( 'touchMovedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -439,7 +439,7 @@ define( require => {
tandem: options.tandem.createTandem( 'touchCanceledEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -463,7 +463,7 @@ define( require => {
tandem: options.tandem.createTandem( 'penStartedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -484,7 +484,7 @@ define( require => {
tandem: options.tandem.createTandem( 'penEndedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -508,7 +508,7 @@ define( require => {
tandem: options.tandem.createTandem( 'penMovedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand All @@ -532,7 +532,7 @@ define( require => {
tandem: options.tandem.createTandem( 'penCanceledEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
validators: [ { valueType: 'number' }, { valueType: Vector2 }, { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'id', type: NumberIO },
{ name: 'point', type: Vector2IO },
Expand Down Expand Up @@ -583,7 +583,7 @@ define( require => {
tandem: options.tandem.createTandem( 'focusinEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand Down Expand Up @@ -618,7 +618,7 @@ define( require => {
tandem: options.tandem.createTandem( 'focusoutEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand Down Expand Up @@ -675,7 +675,7 @@ define( require => {
tandem: options.tandem.createTandem( 'clickEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand All @@ -699,7 +699,7 @@ define( require => {
tandem: options.tandem.createTandem( 'inputEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand All @@ -723,7 +723,7 @@ define( require => {
tandem: options.tandem.createTandem( 'changeEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand All @@ -747,7 +747,7 @@ define( require => {
tandem: options.tandem.createTandem( 'keydownEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand All @@ -771,7 +771,7 @@ define( require => {
tandem: options.tandem.createTandem( 'keyupEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: window.Event } ],
validators: [ { valueType: window.Event } ],
phetioType: EmitterIO( [
{ name: 'event', type: DOMEventIO }
] ),
Expand Down
6 changes: 3 additions & 3 deletions js/input/SimpleDragHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ define( function( require ) {
tandem: options.tandem.createTandem( 'dragStartedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [ { valueType: Vector2 }, { isValidValue: function( value ) { return value === null || value instanceof Event; } } ],
validators: [ { valueType: Vector2 }, { isValidValue: function( value ) { return value === null || value instanceof Event; } } ],
phetioType: EmitterIO(
[ { name: 'point', type: Vector2IO, documentation: 'the position of the drag start in view coordinates' },
{ name: 'event', type: VoidIO, documentation: 'the scenery pointer Event' } ] ),
Expand Down Expand Up @@ -137,7 +137,7 @@ define( function( require ) {
tandem: options.tandem.createTandem( 'draggedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [
validators: [
{ valueType: Vector2 },
{ isValidValue: function( value ) { return value === null || value instanceof Event; } }
],
Expand Down Expand Up @@ -193,7 +193,7 @@ define( function( require ) {
tandem: options.tandem.createTandem( 'dragEndedEmitter' ),

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [
validators: [
{ valueType: Vector2 },
{
isValidValue: function( value ) {
Expand Down
2 changes: 1 addition & 1 deletion js/listeners/DragListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ define( function( require ) {
phetioReadOnly: options.phetioReadOnly,
phetioEventType: PhetioObject.EventType.USER,

argumentTypes: [ { valueType: Event } ],
validators: [ { valueType: Event } ],
phetioType: DraggedEmitterIO,
first: function( event ) {

Expand Down
4 changes: 2 additions & 2 deletions js/listeners/PressListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ define( function( require ) {
phetioEventType: PhetioObject.EventType.USER,

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [
validators: [
{ valueType: Event },
{ isValidValue: function( v ) { return v === null || v instanceof Node; } },
{ isValidValue: function( v ) { return v === null || typeof v === 'function'; } }
Expand All @@ -248,7 +248,7 @@ define( function( require ) {
phetioEventType: PhetioObject.EventType.USER,

// TODO: use of both of these is redundant, and should get fixed with https://github.com/phetsims/axon/issues/194
argumentTypes: [
validators: [
{ isValidValue: v => v instanceof Event || v === null },
{ isValidValue: function( v ) { return v === null || typeof v === 'function'; } }
],
Expand Down

0 comments on commit 60c1021

Please sign in to comment.