Add more typecast for typescript

This commit is contained in:
Frederic Junod
2019-09-27 13:09:12 +02:00
parent 701dc3b54a
commit 0e402073da
5 changed files with 12 additions and 6 deletions

View File

@@ -375,9 +375,9 @@ class PluggableMap extends BaseObject {
* @param {import("./control/Control.js").default} control Control. * @param {import("./control/Control.js").default} control Control.
* @this {PluggableMap} * @this {PluggableMap}
*/ */
(function(control) { function(control) {
control.setMap(this); control.setMap(this);
}).bind(this)); }.bind(this));
this.controls.addEventListener(CollectionEventType.ADD, this.controls.addEventListener(CollectionEventType.ADD,
/** /**
@@ -400,9 +400,9 @@ class PluggableMap extends BaseObject {
* @param {import("./interaction/Interaction.js").default} interaction Interaction. * @param {import("./interaction/Interaction.js").default} interaction Interaction.
* @this {PluggableMap} * @this {PluggableMap}
*/ */
(function(interaction) { function(interaction) {
interaction.setMap(this); interaction.setMap(this);
}).bind(this)); }.bind(this));
this.interactions.addEventListener(CollectionEventType.ADD, this.interactions.addEventListener(CollectionEventType.ADD,
/** /**

View File

@@ -72,6 +72,9 @@ export const CLASS_COLLAPSED = 'ol-collapsed';
* @return {FontParameters} The font families (or null if the input spec is invalid). * @return {FontParameters} The font families (or null if the input spec is invalid).
*/ */
export const getFontParameters = (function() { export const getFontParameters = (function() {
/**
* @type {CSSStyleDeclaration}
*/
let style; let style;
/** /**
* @type {Object<string, FontParameters>} * @type {Object<string, FontParameters>}

View File

@@ -300,6 +300,9 @@ function getMeasureContext() {
* @return {import("../size.js").Size} Measurement. * @return {import("../size.js").Size} Measurement.
*/ */
export const measureTextHeight = (function() { export const measureTextHeight = (function() {
/**
* @type {HTMLDivElement}
*/
let div; let div;
const heights = textHeights; const heights = textHeights;
return function(font) { return function(font) {

View File

@@ -81,7 +81,7 @@ class TileWMS extends TileImage {
*/ */
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : /** @type {Options} */ ({});
const params = options.params || {}; const params = options.params || {};

View File

@@ -96,7 +96,7 @@ class LRUCache extends EventTarget {
/** /**
* @param {function(T, string, LRUCache): ?} f The function * @param {function(T, string, LRUCache<T>): ?} f The function
* to call for every entry from the oldest to the newer. This function takes * to call for every entry from the oldest to the newer. This function takes
* 3 arguments (the entry value, the entry key and the LRUCache object). * 3 arguments (the entry value, the entry key and the LRUCache object).
* The return value is ignored. * The return value is ignored.