Do not document object literals as interfaces

Instead, object literals with properties that should not be
renamed can go in externs/olx.js.
This commit is contained in:
Andreas Hocevar
2014-05-15 12:10:32 +02:00
parent e050c905e2
commit eb6a938062
21 changed files with 108 additions and 167 deletions

View File

@@ -22,7 +22,7 @@ ol.animation.bounce = function(options) {
return (
/**
* @param {ol.Map} map Map.
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
*/
function(map, frameState) {
if (frameState.time < start) {
@@ -59,7 +59,7 @@ ol.animation.pan = function(options) {
return (
/**
* @param {ol.Map} map Map.
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
*/
function(map, frameState) {
if (frameState.time < start) {
@@ -99,7 +99,7 @@ ol.animation.rotate = function(options) {
return (
/**
* @param {ol.Map} map Map.
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
*/
function(map, frameState) {
if (frameState.time < start) {
@@ -141,7 +141,7 @@ ol.animation.zoom = function(options) {
return (
/**
* @param {ol.Map} map Map.
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
*/
function(map, frameState) {
if (frameState.time < start) {

View File

@@ -66,7 +66,7 @@ goog.inherits(ol.control.Attribution, ol.control.Control);
/**
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
* @return {Array.<Object.<string, ol.Attribution>>} Attributions.
*/
ol.control.Attribution.prototype.getSourceAttributions =
@@ -118,7 +118,7 @@ ol.control.Attribution.prototype.handleMapPostrender = function(mapEvent) {
/**
* @private
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
*/
ol.control.Attribution.prototype.updateElement_ = function(frameState) {

View File

@@ -65,7 +65,7 @@ ol.control.Logo.prototype.handleMapPostrender = function(mapEvent) {
/**
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
* @private
*/
ol.control.Logo.prototype.updateElement_ = function(frameState) {

View File

@@ -76,7 +76,7 @@ ol.control.ScaleLine = function(opt_options) {
/**
* @private
* @type {?oli.View2DState}
* @type {?olx.View2DState}
*/
this.view2DState_ = null;

View File

@@ -6,17 +6,17 @@ goog.provide('ol.PreRenderFunction');
/**
* @typedef {function(ol.Map, ?oli.FrameState): boolean}
* @typedef {function(ol.Map, ?olx.FrameState): boolean}
*/
ol.PostRenderFunction;
/**
* Function to perform manipulations before rendering. This function is called
* with the {@link ol.Map} as first and an optional {@link oli.FrameState} as
* with the {@link ol.Map} as first and an optional {@link olx.FrameState} as
* second argument. Return `true` to keep this function for the next frame,
* `false` to remove it.
* @typedef {function(ol.Map, ?oli.FrameState): boolean}
* @typedef {function(ol.Map, ?olx.FrameState): boolean}
* @todo api
*/
ol.PreRenderFunction;

View File

@@ -41,7 +41,7 @@ ol.IView2D.prototype.getRotation = function() {
/**
* @return {oli.View2DState} View2D state.
* @return {olx.View2DState} View2D state.
*/
ol.IView2D.prototype.getView2DState = function() {
};

View File

@@ -209,7 +209,7 @@ ol.Map = function(options) {
/**
* @private
* @type {?oli.FrameState}
* @type {?olx.FrameState}
*/
this.frameState_ = null;
@@ -1178,7 +1178,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
var size = this.getSize();
var view = this.getView();
var view2D = goog.isDef(view) ? this.getView().getView2D() : undefined;
/** @type {?oli.FrameState} */
/** @type {?olx.FrameState} */
var frameState = null;
if (goog.isDef(size) && hasArea(size) &&
goog.isDef(view2D) && view2D.isDef()) {
@@ -1189,7 +1189,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
layerStates[goog.getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
}
view2DState = view2D.getView2DState();
frameState = /** @type {oli.FrameState} */ ({
frameState = /** @type {olx.FrameState} */ ({
animate: false,
attributions: {},
coordinateToPixelMatrix: this.coordinateToPixelMatrix_,

View File

@@ -26,7 +26,7 @@ goog.require('ol.pointer.PointerEventHandler');
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {goog.events.BrowserEvent} browserEvent Browser event.
* @param {?oli.FrameState=} opt_frameState Frame state.
* @param {?olx.FrameState=} opt_frameState Frame state.
*/
ol.MapBrowserEvent = function(type, map, browserEvent, opt_frameState) {
@@ -89,7 +89,7 @@ ol.MapBrowserEvent.prototype.stopPropagation = function() {
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {ol.pointer.PointerEvent} pointerEvent Pointer event.
* @param {?oli.FrameState=} opt_frameState Frame state.
* @param {?olx.FrameState=} opt_frameState Frame state.
*/
ol.MapBrowserPointerEvent = function(type, map, pointerEvent, opt_frameState) {

View File

@@ -29,7 +29,7 @@ ol.MapEventType = {
* @extends {goog.events.Event}
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {?oli.FrameState=} opt_frameState Frame state.
* @param {?olx.FrameState=} opt_frameState Frame state.
*/
ol.MapEvent = function(type, map, opt_frameState) {
@@ -41,7 +41,7 @@ ol.MapEvent = function(type, map, opt_frameState) {
this.map = map;
/**
* @type {?oli.FrameState}
* @type {?olx.FrameState}
*/
this.frameState = goog.isDef(opt_frameState) ? opt_frameState : null;

View File

@@ -35,7 +35,7 @@ ol.render.EventType = {
* @param {ol.render.EventType} type Type.
* @param {Object=} opt_target Target.
* @param {ol.render.IVectorContext=} opt_vectorContext Vector context.
* @param {oli.FrameState=} opt_frameState Frame state.
* @param {olx.FrameState=} opt_frameState Frame state.
* @param {?CanvasRenderingContext2D=} opt_context Context.
* @param {?ol.webgl.Context=} opt_glContext WebGL Context.
*/
@@ -51,7 +51,7 @@ ol.render.Event = function(
this.vectorContext = opt_vectorContext;
/**
* @type {oli.FrameState|undefined}
* @type {olx.FrameState|undefined}
*/
this.frameState = opt_frameState;

View File

@@ -33,7 +33,7 @@ goog.inherits(ol.renderer.canvas.Layer, ol.renderer.Layer);
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {ol.layer.LayerState} layerState Layer state.
* @param {CanvasRenderingContext2D} context Context.
*/
@@ -77,7 +77,7 @@ ol.renderer.canvas.Layer.prototype.composeFrame =
/**
* @param {ol.render.EventType} type Event type.
* @param {CanvasRenderingContext2D} context Context.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
* @private
*/
@@ -100,7 +100,7 @@ ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ =
/**
* @param {CanvasRenderingContext2D} context Context.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
* @protected
*/
@@ -113,7 +113,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent =
/**
* @param {CanvasRenderingContext2D} context Context.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
* @protected
*/
@@ -126,7 +126,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent =
/**
* @param {CanvasRenderingContext2D} context Context.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
* @protected
*/
@@ -150,7 +150,7 @@ ol.renderer.canvas.Layer.prototype.getImageTransform = goog.abstractMethod;
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @protected
* @return {!goog.vec.Mat4.Number} Transform.
*/

View File

@@ -87,7 +87,7 @@ ol.renderer.canvas.Map.prototype.createLayerRenderer = function(layer) {
/**
* @param {ol.render.EventType} type Event type.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @private
*/
ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ =

View File

@@ -45,7 +45,7 @@ goog.inherits(ol.renderer.Layer, goog.Disposable);
/**
* @param {ol.Coordinate} coordinate Coordinate.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {function(this: S, ol.Feature, ol.layer.Layer): T} callback Feature
* callback.
* @param {S} thisArg Value to use as `this` when executing `callback`.
@@ -96,7 +96,7 @@ ol.renderer.Layer.prototype.handleImageChange = function(event) {
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {ol.layer.LayerState} layerState Layer state.
*/
ol.renderer.Layer.prototype.prepareFrame = goog.abstractMethod;
@@ -114,7 +114,7 @@ ol.renderer.Layer.prototype.renderIfReadyAndVisible = function() {
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {ol.source.Tile} tileSource Tile source.
* @protected
*/
@@ -126,7 +126,7 @@ ol.renderer.Layer.prototype.scheduleExpireCache =
/**
* @param {ol.source.Tile} tileSource Tile source.
* @param {ol.Map} map Map.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
*/
function(tileSource, map, frameState) {
var tileSourceKey = goog.getUid(tileSource).toString();
@@ -155,7 +155,7 @@ ol.renderer.Layer.prototype.updateAttributions =
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {ol.source.Source} source Source.
* @protected
*/
@@ -241,7 +241,7 @@ ol.renderer.Layer.prototype.snapCenterToPixel =
* - registers idle tiles in frameState.wantedTiles so that they are not
* discarded by the tile queue
* - enqueues missing tiles
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {ol.source.Tile} tileSource Tile source.
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
* @param {number} pixelRatio Pixel ratio.

View File

@@ -41,7 +41,7 @@ goog.inherits(ol.renderer.Map, goog.Disposable);
/**
* @param {oli.FrameState} frameState FrameState.
* @param {olx.FrameState} frameState FrameState.
* @protected
*/
ol.renderer.Map.prototype.calculateMatrices2D = function(frameState) {
@@ -82,7 +82,7 @@ ol.renderer.Map.prototype.disposeInternal = function() {
/**
* @param {ol.Coordinate} coordinate Coordinate.
* @param {oli.FrameState} frameState FrameState.
* @param {olx.FrameState} frameState FrameState.
* @param {function(this: S, ol.Feature, ol.layer.Layer): T} callback Feature
* callback.
* @param {S} thisArg Value to use as `this` when executing `callback`.
@@ -176,14 +176,14 @@ ol.renderer.Map.prototype.removeLayerRendererByKey_ = function(layerKey) {
/**
* Render.
* @param {?oli.FrameState} frameState Frame state.
* @param {?olx.FrameState} frameState Frame state.
*/
ol.renderer.Map.prototype.renderFrame = goog.nullFunction;
/**
* @param {ol.Map} map Map.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @private
*/
ol.renderer.Map.prototype.removeUnusedLayerRenderers_ =
@@ -198,14 +198,14 @@ ol.renderer.Map.prototype.removeUnusedLayerRenderers_ =
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @protected
*/
ol.renderer.Map.prototype.scheduleExpireIconCache = function(frameState) {
frameState.postRenderFunctions.push(
/**
* @param {ol.Map} map Map.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
*/
function(map, frameState) {
ol.style.IconImageCache.getInstance().expire();
@@ -214,7 +214,7 @@ ol.renderer.Map.prototype.scheduleExpireIconCache = function(frameState) {
/**
* @param {!oli.FrameState} frameState Frame state.
* @param {!olx.FrameState} frameState Frame state.
* @protected
*/
ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers =

View File

@@ -88,7 +88,7 @@ goog.inherits(ol.renderer.webgl.Layer, ol.renderer.Layer);
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {number} framebufferDimension Framebuffer dimension.
* @protected
*/
@@ -142,7 +142,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer =
/**
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @param {ol.layer.LayerState} layerState Layer state.
* @param {ol.webgl.Context} context Context.
*/
@@ -230,7 +230,7 @@ ol.renderer.webgl.Layer.prototype.composeFrame =
/**
* @param {ol.render.EventType} type Event type.
* @param {ol.webgl.Context} context WebGL context.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @private
*/
ol.renderer.webgl.Layer.prototype.dispatchComposeEvent_ =

View File

@@ -257,7 +257,7 @@ ol.renderer.webgl.Map.prototype.createLayerRenderer = function(layer) {
/**
* @param {ol.render.EventType} type Event type.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @private
*/
ol.renderer.webgl.Map.prototype.dispatchComposeEvent_ =
@@ -297,7 +297,7 @@ ol.renderer.webgl.Map.prototype.disposeInternal = function() {
/**
* @param {ol.Map} map Map.
* @param {oli.FrameState} frameState Frame state.
* @param {olx.FrameState} frameState Frame state.
* @private
*/
ol.renderer.webgl.Map.prototype.expireCache_ = function(map, frameState) {

View File

@@ -27,7 +27,6 @@ ol.source.TileOptions;
* @constructor
* @extends {ol.source.Source}
* @param {ol.source.TileOptions} options Tile source options.
* @todo api
*/
ol.source.Tile = function(options) {

View File

@@ -379,7 +379,7 @@ ol.View2D.prototype.getView2DState = function() {
var projection = this.getProjection();
var resolution = /** @type {number} */ (this.getResolution());
var rotation = this.getRotation();
return /** @type {oli.View2DState} */ ({
return /** @type {olx.View2DState} */ ({
center: center.slice(),
projection: goog.isDef(projection) ? projection : null,
resolution: resolution,