Skip to content

Commit

Permalink
Cast GestureEventListeners.
Browse files Browse the repository at this point in the history
This improves the closure compiler type checking of GestureEventListeners. Upstreaming of cl/239878806
  • Loading branch information
rictic committed Apr 22, 2019
1 parent cc7702b commit 3437334
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/mixins/gesture-event-listeners.js
Expand Up @@ -27,7 +27,7 @@ import { addListener, removeListener } from '../utils/gestures.js';
* cross-platform
* gesture events to nodes
*/
export const GestureEventListeners = dedupingMixin(
const _GestureEventListeners = dedupingMixin(
/**
* @template T
* @param {function(new:T)} superClass Class to apply mixin to.
Expand Down Expand Up @@ -73,3 +73,14 @@ export const GestureEventListeners = dedupingMixin(

return GestureEventListeners;
});

// Somehow _GestureEventListeners is incorrectly typed as *. For now add this
// cast.
/**
* @template T
* @param {function(new:T)} superClass Class to apply mixin to.
* @return {function(new:T)} superClass with mixin applied.
*/
export const GestureEventListeners = function(superClass) {
return _GestureEventListeners(superClass);
};

0 comments on commit 3437334

Please sign in to comment.