Automated class transform

npx lebab --replace src --transform class
This commit is contained in:
Tim Schaub
2018-07-16 16:18:16 -06:00
parent 60e85e7d89
commit 7b4a73f3b9
145 changed files with 32887 additions and 33714 deletions

View File

@@ -6,36 +6,37 @@
* @param {!Object.<string, function(Event)>} mapping Event mapping.
* @constructor
*/
const EventSource = function(dispatcher, mapping) {
/**
* @type {module:ol/pointer/PointerEventHandler}
*/
this.dispatcher = dispatcher;
class EventSource {
constructor(dispatcher, mapping) {
/**
* @type {module:ol/pointer/PointerEventHandler}
*/
this.dispatcher = dispatcher;
/**
* @private
* @const
* @type {!Object.<string, function(Event)>}
*/
this.mapping_ = mapping;
};
/**
* @private
* @const
* @type {!Object.<string, function(Event)>}
*/
this.mapping_ = mapping;
}
/**
* List of events supported by this source.
* @return {Array.<string>} Event names
*/
getEvents() {
return Object.keys(this.mapping_);
}
/**
* List of events supported by this source.
* @return {Array.<string>} Event names
*/
EventSource.prototype.getEvents = function() {
return Object.keys(this.mapping_);
};
/**
* Returns the handler that should handle a given event type.
* @param {string} eventType The event type.
* @return {function(Event)} Handler
*/
getHandlerForEvent(eventType) {
return this.mapping_[eventType];
}
}
/**
* Returns the handler that should handle a given event type.
* @param {string} eventType The event type.
* @return {function(Event)} Handler
*/
EventSource.prototype.getHandlerForEvent = function(eventType) {
return this.mapping_[eventType];
};
export default EventSource;