Create 'type' annotation for 'const' variables

From https://developers.google.com/closure/compiler/docs/js-for-compiler:
  "The type declaration and additional comment are optional. If you
  provide a type declaration, put the declaration on a separate line."
This commit is contained in:
Frederic Junod
2014-01-09 09:53:18 +01:00
parent 73fcff641e
commit 9f79d33486
8 changed files with 32 additions and 16 deletions

View File

@@ -32,7 +32,8 @@ ol.ENABLE_WEBGL = true;
/** /**
* The ratio between physical pixels and device-independent pixels * The ratio between physical pixels and device-independent pixels
* (dips) on the device (`window.devicePixelRatio`). * (dips) on the device (`window.devicePixelRatio`).
* @const {number} * @const
* @type {number}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1; ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1;
@@ -40,7 +41,8 @@ ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1;
/** /**
* True if browser supports Canvas. * True if browser supports Canvas.
* @const {boolean} * @const
* @type {boolean}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.HAS_CANVAS = ol.ENABLE_CANVAS && ( ol.BrowserFeature.HAS_CANVAS = ol.ENABLE_CANVAS && (
@@ -63,7 +65,8 @@ ol.BrowserFeature.HAS_CANVAS = ol.ENABLE_CANVAS && (
/** /**
* Indicates if DeviceOrientation is supported in the user's browser. * Indicates if DeviceOrientation is supported in the user's browser.
* @const {boolean} * @const
* @type {boolean}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.HAS_DEVICE_ORIENTATION = ol.BrowserFeature.HAS_DEVICE_ORIENTATION =
@@ -72,7 +75,8 @@ ol.BrowserFeature.HAS_DEVICE_ORIENTATION =
/** /**
* True if browser supports DOM. * True if browser supports DOM.
* @const {boolean} * @const
* @type {boolean}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.HAS_DOM = ol.ENABLE_DOM; ol.BrowserFeature.HAS_DOM = ol.ENABLE_DOM;
@@ -80,7 +84,8 @@ ol.BrowserFeature.HAS_DOM = ol.ENABLE_DOM;
/** /**
* Is HTML5 geolocation supported in the current browser? * Is HTML5 geolocation supported in the current browser?
* @const {boolean} * @const
* @type {boolean}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator; ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator;
@@ -88,7 +93,8 @@ ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator;
/** /**
* True if browser supports touch events. * True if browser supports touch events.
* @const {boolean} * @const
* @type {boolean}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.HAS_TOUCH = ol.ASSUME_TOUCH || ol.BrowserFeature.HAS_TOUCH = ol.ASSUME_TOUCH ||
@@ -99,7 +105,8 @@ ol.BrowserFeature.HAS_TOUCH = ol.ASSUME_TOUCH ||
/** /**
* True if browser supports WebGL. * True if browser supports WebGL.
* @const {boolean} * @const
* @type {boolean}
* @todo stability experimental * @todo stability experimental
*/ */
ol.BrowserFeature.HAS_WEBGL = ol.ENABLE_WEBGL && ( ol.BrowserFeature.HAS_WEBGL = ol.ENABLE_WEBGL && (

View File

@@ -4,7 +4,8 @@ goog.provide('ol.css');
/** /**
* The CSS class that we'll give the DOM elements to have them unselectable. * The CSS class that we'll give the DOM elements to have them unselectable.
* *
* @const {string} * @const
* @type {string}
*/ */
ol.css.CLASS_UNSELECTABLE = 'ol-unselectable'; ol.css.CLASS_UNSELECTABLE = 'ol-unselectable';
@@ -12,6 +13,7 @@ ol.css.CLASS_UNSELECTABLE = 'ol-unselectable';
/** /**
* The CSS class for unsupported feature. * The CSS class for unsupported feature.
* *
* @const {string} * @const
* @type {string}
*/ */
ol.css.CLASS_UNSUPPORTED = 'ol-unsupported'; ol.css.CLASS_UNSUPPORTED = 'ol-unsupported';

View File

@@ -20,7 +20,8 @@ ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS = 8;
/** /**
* @const {number} * @const
* @type {number}
*/ */
ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED = ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED =
ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS * ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS *

View File

@@ -19,7 +19,8 @@ ol.ENABLE_PROJ4JS = true;
/** /**
* Have Proj4js. * Have Proj4js.
* @const {boolean} * @const
* @type {boolean}
*/ */
ol.HAVE_PROJ4JS = ol.ENABLE_PROJ4JS && typeof Proj4js == 'object'; ol.HAVE_PROJ4JS = ol.ENABLE_PROJ4JS && typeof Proj4js == 'object';
@@ -47,7 +48,8 @@ ol.proj.Units = {
/** /**
* Meters per unit lookup table. * Meters per unit lookup table.
* @const {Object.<ol.proj.Units, number>} * @const
* @type {Object.<ol.proj.Units, number>}
*/ */
ol.METERS_PER_UNIT = {}; ol.METERS_PER_UNIT = {};
ol.METERS_PER_UNIT[ol.proj.Units.DEGREES] = ol.METERS_PER_UNIT[ol.proj.Units.DEGREES] =

View File

@@ -113,7 +113,8 @@ goog.inherits(ol.source.Stamen, ol.source.XYZ);
/** /**
* @const {Array.<ol.Attribution>} * @const
* @type {Array.<ol.Attribution>}
*/ */
ol.source.Stamen.ATTRIBUTIONS = [ ol.source.Stamen.ATTRIBUTIONS = [
new ol.Attribution({ new ol.Attribution({

View File

@@ -5,6 +5,7 @@ goog.require('ol.Sphere');
/** /**
* The normal sphere. * The normal sphere.
* @const {ol.Sphere} * @const
* @type {ol.Sphere}
*/ */
ol.sphere.NORMAL = new ol.Sphere(6370997); ol.sphere.NORMAL = new ol.Sphere(6370997);

View File

@@ -5,6 +5,7 @@ goog.require('ol.Sphere');
/** /**
* A sphere with radius equal to the semi-major axis of the WGS84 ellipsoid. * A sphere with radius equal to the semi-major axis of the WGS84 ellipsoid.
* @const {ol.Sphere} * @const
* @type {ol.Sphere}
*/ */
ol.sphere.WGS84 = new ol.Sphere(6378137); ol.sphere.WGS84 = new ol.Sphere(6378137);

View File

@@ -56,7 +56,8 @@ ol.structs.PriorityQueue = function(priorityFunction, keyFunction) {
/** /**
* @const {number} * @const
* @type {number}
*/ */
ol.structs.PriorityQueue.DROP = Infinity; ol.structs.PriorityQueue.DROP = Infinity;