Be stricter with types

This commit is contained in:
Éric Lemoine
2014-08-14 10:56:48 +02:00
parent 5d31d2044a
commit a16a678ca7
6 changed files with 10 additions and 7 deletions

View File

@@ -23,7 +23,8 @@ ol.source.ImageCanvas = function(options) {
logo: options.logo, logo: options.logo,
projection: options.projection, projection: options.projection,
resolutions: options.resolutions, resolutions: options.resolutions,
state: options.state state: goog.isDef(options.state) ?
/** @type {ol.source.State} */ (options.state) : undefined
}); });
/** /**

View File

@@ -14,7 +14,7 @@ goog.require('ol.source.Source');
* logo: (string|olx.LogoOptions|undefined), * logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike, * projection: ol.proj.ProjectionLike,
* resolutions: (Array.<number>|undefined), * resolutions: (Array.<number>|undefined),
* state: (ol.source.State|string|undefined)}} * state: (ol.source.State|undefined)}}
*/ */
ol.source.ImageOptions; ol.source.ImageOptions;

View File

@@ -24,7 +24,7 @@ ol.source.State = {
* @typedef {{attributions: (Array.<ol.Attribution>|undefined), * @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* logo: (string|olx.LogoOptions|undefined), * logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike, * projection: ol.proj.ProjectionLike,
* state: (ol.source.State|string|undefined)}} * state: (ol.source.State|undefined)}}
*/ */
ol.source.SourceOptions; ol.source.SourceOptions;
@@ -69,7 +69,7 @@ ol.source.Source = function(options) {
* @type {ol.source.State} * @type {ol.source.State}
*/ */
this.state_ = goog.isDef(options.state) ? this.state_ = goog.isDef(options.state) ?
/** @type {ol.source.State} */ (options.state) : ol.source.State.READY; options.state : ol.source.State.READY;
}; };
goog.inherits(ol.source.Source, ol.Observable); goog.inherits(ol.source.Source, ol.Observable);

View File

@@ -29,7 +29,8 @@ ol.source.TileImage = function(options) {
logo: options.logo, logo: options.logo,
opaque: options.opaque, opaque: options.opaque,
projection: options.projection, projection: options.projection,
state: options.state, state: goog.isDef(options.state) ?
/** @type {ol.source.State} */ (options.state) : undefined,
tileGrid: options.tileGrid, tileGrid: options.tileGrid,
tilePixelRatio: options.tilePixelRatio tilePixelRatio: options.tilePixelRatio
}); });

View File

@@ -17,7 +17,7 @@ goog.require('ol.tilegrid.TileGrid');
* opaque: (boolean|undefined), * opaque: (boolean|undefined),
* tilePixelRatio: (number|undefined), * tilePixelRatio: (number|undefined),
* projection: ol.proj.ProjectionLike, * projection: ol.proj.ProjectionLike,
* state: (ol.source.State|string|undefined), * state: (ol.source.State|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined)}} * tileGrid: (ol.tilegrid.TileGrid|undefined)}}
*/ */
ol.source.TileOptions; ol.source.TileOptions;

View File

@@ -56,7 +56,8 @@ ol.source.Vector = function(opt_options) {
attributions: options.attributions, attributions: options.attributions,
logo: options.logo, logo: options.logo,
projection: options.projection, projection: options.projection,
state: options.state state: goog.isDef(options.state) ?
/** @type {ol.source.State} */ (options.state) : undefined
}); });
/** /**