Merge pull request #8175 from fredj/happy_compiler

More typing fixes
This commit is contained in:
Frédéric Junod
2018-05-10 06:37:30 +02:00
committed by GitHub
7 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ ImageCanvas.prototype.load = function() {
/** /**
* @inheritDoc * @return {HTMLCanvasElement} Canvas element.
*/ */
ImageCanvas.prototype.getImage = function() { ImageCanvas.prototype.getImage = function() {
return this.canvas_; return this.canvas_;
+2 -2
View File
@@ -10,14 +10,14 @@
* @return {CanvasRenderingContext2D} The context. * @return {CanvasRenderingContext2D} The context.
*/ */
export function createCanvasContext2D(opt_width, opt_height) { export function createCanvasContext2D(opt_width, opt_height) {
const canvas = document.createElement('CANVAS'); const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS'));
if (opt_width) { if (opt_width) {
canvas.width = opt_width; canvas.width = opt_width;
} }
if (opt_height) { if (opt_height) {
canvas.height = opt_height; canvas.height = opt_height;
} }
return canvas.getContext('2d'); return /** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d'));
} }
+10 -10
View File
@@ -54,7 +54,7 @@ const MsSource = function(dispatcher) {
/** /**
* @const * @const
* @type {!Object.<string, Event|Object>} * @type {!Object.<string, MSPointerEvent|Object>}
*/ */
this.pointerMap = dispatcher.pointerMap; this.pointerMap = dispatcher.pointerMap;
}; };
@@ -79,7 +79,7 @@ const POINTER_TYPES = [
* for the fake pointer event. * for the fake pointer event.
* *
* @private * @private
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
* @return {Object} The copied event. * @return {Object} The copied event.
*/ */
MsSource.prototype.prepareEvent_ = function(inEvent) { MsSource.prototype.prepareEvent_ = function(inEvent) {
@@ -105,7 +105,7 @@ MsSource.prototype.cleanup = function(pointerId) {
/** /**
* Handler for `msPointerDown`. * Handler for `msPointerDown`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msPointerDown = function(inEvent) { MsSource.prototype.msPointerDown = function(inEvent) {
this.pointerMap[inEvent.pointerId.toString()] = inEvent; this.pointerMap[inEvent.pointerId.toString()] = inEvent;
@@ -117,7 +117,7 @@ MsSource.prototype.msPointerDown = function(inEvent) {
/** /**
* Handler for `msPointerMove`. * Handler for `msPointerMove`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msPointerMove = function(inEvent) { MsSource.prototype.msPointerMove = function(inEvent) {
const e = this.prepareEvent_(inEvent); const e = this.prepareEvent_(inEvent);
@@ -128,7 +128,7 @@ MsSource.prototype.msPointerMove = function(inEvent) {
/** /**
* Handler for `msPointerUp`. * Handler for `msPointerUp`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msPointerUp = function(inEvent) { MsSource.prototype.msPointerUp = function(inEvent) {
const e = this.prepareEvent_(inEvent); const e = this.prepareEvent_(inEvent);
@@ -140,7 +140,7 @@ MsSource.prototype.msPointerUp = function(inEvent) {
/** /**
* Handler for `msPointerOut`. * Handler for `msPointerOut`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msPointerOut = function(inEvent) { MsSource.prototype.msPointerOut = function(inEvent) {
const e = this.prepareEvent_(inEvent); const e = this.prepareEvent_(inEvent);
@@ -151,7 +151,7 @@ MsSource.prototype.msPointerOut = function(inEvent) {
/** /**
* Handler for `msPointerOver`. * Handler for `msPointerOver`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msPointerOver = function(inEvent) { MsSource.prototype.msPointerOver = function(inEvent) {
const e = this.prepareEvent_(inEvent); const e = this.prepareEvent_(inEvent);
@@ -162,7 +162,7 @@ MsSource.prototype.msPointerOver = function(inEvent) {
/** /**
* Handler for `msPointerCancel`. * Handler for `msPointerCancel`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msPointerCancel = function(inEvent) { MsSource.prototype.msPointerCancel = function(inEvent) {
const e = this.prepareEvent_(inEvent); const e = this.prepareEvent_(inEvent);
@@ -174,7 +174,7 @@ MsSource.prototype.msPointerCancel = function(inEvent) {
/** /**
* Handler for `msLostPointerCapture`. * Handler for `msLostPointerCapture`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msLostPointerCapture = function(inEvent) { MsSource.prototype.msLostPointerCapture = function(inEvent) {
const e = this.dispatcher.makeEvent('lostpointercapture', const e = this.dispatcher.makeEvent('lostpointercapture',
@@ -186,7 +186,7 @@ MsSource.prototype.msLostPointerCapture = function(inEvent) {
/** /**
* Handler for `msGotPointerCapture`. * Handler for `msGotPointerCapture`.
* *
* @param {Event} inEvent The in event. * @param {MSPointerEvent} inEvent The in event.
*/ */
MsSource.prototype.msGotPointerCapture = function(inEvent) { MsSource.prototype.msGotPointerCapture = function(inEvent) {
const e = this.dispatcher.makeEvent('gotpointercapture', const e = this.dispatcher.makeEvent('gotpointercapture',
+1 -1
View File
@@ -29,7 +29,7 @@ const CanvasVectorLayerRenderer = function(vectorLayer) {
* Declutter tree. * Declutter tree.
* @private * @private
*/ */
this.declutterTree_ = vectorLayer.getDeclutter() ? rbush(9) : null; this.declutterTree_ = vectorLayer.getDeclutter() ? rbush(9, undefined) : null;
/** /**
* @private * @private
+1 -1
View File
@@ -66,7 +66,7 @@ const CanvasVectorTileLayerRenderer = function(layer) {
* Declutter tree. * Declutter tree.
* @private * @private
*/ */
this.declutterTree_ = layer.getDeclutter() ? rbush(9) : null; this.declutterTree_ = layer.getDeclutter() ? rbush(9, undefined) : null;
/** /**
* @private * @private
+1 -1
View File
@@ -107,7 +107,7 @@ TileSource.prototype.canExpireCache = function() {
/** /**
* @param {module:ol/proj/Projection} projection Projection. * @param {module:ol/proj/Projection} projection Projection.
* @param {Object.<string, module:ol/TileRange>} usedTiles Used tiles. * @param {!Object.<string, module:ol/TileRange>} usedTiles Used tiles.
*/ */
TileSource.prototype.expireCache = function(projection, usedTiles) { TileSource.prototype.expireCache = function(projection, usedTiles) {
const tileCache = this.getTileCacheForProjection(projection); const tileCache = this.getTileCacheForProjection(projection);
+1 -1
View File
@@ -29,7 +29,7 @@ const RBush = function(opt_maxEntries) {
/** /**
* @private * @private
*/ */
this.rbush_ = rbush(opt_maxEntries); this.rbush_ = rbush(opt_maxEntries, undefined);
/** /**
* A mapping between the objects added to this rbush wrapper * A mapping between the objects added to this rbush wrapper