Merge pull request #2795 from gingerik/externs

Externs
This commit is contained in:
Éric Lemoine
2014-10-03 17:16:43 +02:00
4 changed files with 135 additions and 29 deletions

View File

@@ -10,8 +10,10 @@ var oli;
/** @interface */
oli.CollectionEvent;
/**
* @interface
*/
oli.CollectionEvent = function() {};
/**
@@ -21,8 +23,10 @@ oli.CollectionEvent.prototype.element;
/** @interface */
oli.DragBoxEvent;
/**
* @interface
*/
oli.DragBoxEvent = function() {};
/**
@@ -32,8 +36,10 @@ oli.DragBoxEvent.prototype.coordinate;
/** @interface */
oli.DrawEvent;
/**
* @interface
*/
oli.DrawEvent = function() {};
/**
@@ -43,8 +49,10 @@ oli.DrawEvent.prototype.feature;
/** @interface */
oli.ObjectEvent;
/**
* @interface
*/
oli.ObjectEvent = function() {};
/** @type {string} */
@@ -52,8 +60,10 @@ oli.ObjectEvent.prototype.key;
/** @interface */
oli.MapBrowserEvent;
/**
* @interface
*/
oli.MapBrowserEvent = function() {};
/**
@@ -75,8 +85,10 @@ oli.MapBrowserEvent.prototype.pixel;
/** @interface */
oli.MapEvent;
/**
* @interface
*/
oli.MapEvent = function() {};
/**
@@ -91,11 +103,16 @@ oli.MapEvent.prototype.map;
oli.MapEvent.prototype.frameState;
/**
* @type {Object}
*/
oli.control;
/**
* @interface
*/
oli.control.Control;
oli.control.Control = function() {};
/**
@@ -105,9 +122,17 @@ oli.control.Control;
oli.control.Control.prototype.setMap = function(map) {};
/**
* @type {Object}
*/
oli.interaction;
/** @interface */
oli.interaction.DragAndDropEvent;
/**
* @interface
*/
oli.interaction.DragAndDropEvent = function() {};
/**
@@ -128,9 +153,17 @@ oli.interaction.DragAndDropEvent.prototype.projection;
oli.interaction.DragAndDropEvent.prototype.file;
/**
* @type {Object}
*/
oli.render;
/** @interface */
oli.render.Event;
/**
* @interface
*/
oli.render.Event = function() {};
/**
@@ -157,9 +190,17 @@ oli.render.Event.prototype.glContext;
oli.render.Event.prototype.vectorContext;
/**
* @type {Object}
*/
oli.source;
/** @interface */
oli.source.VectorEvent;
/**
* @interface
*/
oli.source.VectorEvent = function() {};
/**

View File

@@ -594,6 +594,13 @@ olx.ViewOptions.prototype.zoom;
olx.ViewOptions.prototype.zoomFactor;
/**
* Namespace.
* @type {Object}
*/
olx.animation;
/**
* @typedef {{resolution: number,
* start: (number|undefined),
@@ -779,6 +786,13 @@ olx.animation.ZoomOptions.prototype.duration;
olx.animation.ZoomOptions.prototype.easing;
/**
* Namespace.
* @type {Object}
*/
olx.control;
/**
* @typedef {{className: (string|undefined),
* target: (Element|undefined)}}
@@ -1279,6 +1293,13 @@ olx.control.ZoomToExtentOptions.prototype.tipLabel;
olx.control.ZoomToExtentOptions.prototype.extent;
/**
* Namespace.
* @type {Object}
*/
olx.format;
/**
* @typedef {{dataProjection: (ol.proj.ProjectionLike|undefined),
* featureProjection: (ol.proj.ProjectionLike|undefined)}}
@@ -1742,6 +1763,13 @@ olx.format.WKTOptions;
olx.format.WKTOptions.prototype.splitCollection;
/**
* Namespace.
* @type {Object}
*/
olx.interaction;
/**
* Interactions for the map. Default is `true` for all options.
* @typedef {{altShiftDragRotate: (boolean|undefined),
@@ -2307,6 +2335,13 @@ olx.interaction.SelectOptions.prototype.removeCondition;
olx.interaction.SelectOptions.prototype.toggleCondition;
/**
* Namespace.
* @type {Object}
*/
olx.layer;
/**
* @typedef {{brightness: (number|undefined),
* contrast: (number|undefined),
@@ -3097,6 +3132,13 @@ olx.FeatureOverlayOptions.prototype.map;
olx.FeatureOverlayOptions.prototype.style;
/**
* Namespace.
* @type {Object}
*/
olx.source;
/**
* @typedef {{culture: (string|undefined),
* key: string,
@@ -5241,6 +5283,13 @@ olx.source.ZoomifyOptions.prototype.tierSizeCalculation;
olx.source.ZoomifyOptions.prototype.size;
/**
* Namespace.
* @type {Object}
*/
olx.style;
/**
* @typedef {{fill: (ol.style.Fill|undefined),
* radius: number,
@@ -5662,6 +5711,13 @@ olx.style.StyleOptions.prototype.text;
olx.style.StyleOptions.prototype.zIndex;
/**
* Namespace.
* @type {Object}
*/
olx.tilegrid;
/**
* @typedef {{minZoom: (number|undefined),
* origin: (ol.Coordinate|undefined),
@@ -5847,6 +5903,13 @@ olx.tilegrid.ZoomifyOptions;
olx.tilegrid.ZoomifyOptions.prototype.resolutions;
/**
* Namespace.
* @type {Object}
*/
olx.view;
/**
* @typedef {{padding: !Array.<number>,
* constrainResolution: (boolean|undefined),
@@ -5854,7 +5917,7 @@ olx.tilegrid.ZoomifyOptions.prototype.resolutions;
* minResolution: (number|undefined)}}
* @api
*/
olx.View.fitGeometryOptions;
olx.view.FitGeometryOptions;
/**
@@ -5863,7 +5926,7 @@ olx.View.fitGeometryOptions;
* @type {!Array.<number>}
* @api
*/
olx.View.fitGeometryOptions.prototype.padding;
olx.view.FitGeometryOptions.prototype.padding;
/**
@@ -5871,7 +5934,7 @@ olx.View.fitGeometryOptions.prototype.padding;
* @type {boolean|undefined}
* @api
*/
olx.View.fitGeometryOptions.prototype.constrainResolution;
olx.view.FitGeometryOptions.prototype.constrainResolution;
/**
@@ -5879,7 +5942,7 @@ olx.View.fitGeometryOptions.prototype.constrainResolution;
* @type {boolean|undefined}
* @api
*/
olx.View.fitGeometryOptions.prototype.nearest;
olx.view.FitGeometryOptions.prototype.nearest;
/**
@@ -5887,7 +5950,7 @@ olx.View.fitGeometryOptions.prototype.nearest;
* @type {number|undefined}
* @api
*/
olx.View.fitGeometryOptions.prototype.minResolution;
olx.view.FitGeometryOptions.prototype.minResolution;
/**
@@ -5896,7 +5959,7 @@ olx.View.fitGeometryOptions.prototype.minResolution;
* @type {number|undefined}
* @api
*/
olx.View.fitGeometryOptions.prototype.maxZoom;
olx.view.FitGeometryOptions.prototype.maxZoom;
/* typedefs for object literals exposed by the library */

View File

@@ -11,8 +11,10 @@ These two files are special externs that belong to ol3, and this document explai
For events, we make properties available to the application. Methods can be made available by just marking them with the `@api` annotation directly where they are defined; properties should also be added to `oli.js`:
```js
/** @interface */
oli.MapBrowserEvent;
/**
* @interface
*/
oli.MapBrowserEvent = function() {};
/**
* @type {ol.Coordinate}
@@ -48,7 +50,7 @@ For custom subclasses in applications, which can be created using `ol.inherits`,
/**
* @interface
*/
oli.control.Control;
oli.control.Control = function() {};
/**
* @param {ol.Map} map Map.

View File

@@ -454,7 +454,7 @@ ol.View.prototype.fitExtent = function(extent, size) {
* Take care on the map angle.
* @param {ol.geom.SimpleGeometry} geometry Geometry.
* @param {ol.Size} size Box pixel size.
* @param {olx.View.fitGeometryOptions=} opt_options Options.
* @param {olx.view.FitGeometryOptions=} opt_options Options.
* @api
*/
ol.View.prototype.fitGeometry = function(geometry, size, opt_options) {