diff --git a/src/ol/events.js b/src/ol/events.js index 6bd280a1ea..718372adf1 100644 --- a/src/ol/events.js +++ b/src/ol/events.js @@ -61,40 +61,6 @@ ol.events.KeyCode = { ol.events.LISTENER_MAP_PROP_ = 'olm_' + ((Math.random() * 1e4) | 0); -/** - * @typedef {EventTarget|ol.events.EventTarget| - * {addEventListener: function(string, Function, boolean=), - * removeEventListener: function(string, Function, boolean=), - * dispatchEvent: function(string)}} - */ -ol.events.EventTargetLike; - - -/** - * Key to use with {@link ol.Observable#unByKey}. - * - * @typedef {{bindTo: (Object|undefined), - * boundListener: (ol.events.ListenerFunctionType|undefined), - * callOnce: boolean, - * deleteIndex: (number|undefined), - * listener: ol.events.ListenerFunctionType, - * target: (EventTarget|ol.events.EventTarget), - * type: string}} - * @api - */ -ol.events.Key; - - -/** - * Listener function. This function is called with an event object as argument. - * When the function returns `false`, event propagation will stop. - * - * @typedef {function(ol.events.Event)|function(ol.events.Event): boolean} - * @api - */ -ol.events.ListenerFunctionType; - - /** * @param {ol.events.Key} listenerObj Listener object. * @return {ol.events.ListenerFunctionType} Bound listener. diff --git a/src/ol/events/condition.js b/src/ol/events/condition.js index 1d0662b40c..144aa1464e 100644 --- a/src/ol/events/condition.js +++ b/src/ol/events/condition.js @@ -6,16 +6,6 @@ goog.require('ol.MapBrowserEvent.EventType'); goog.require('ol.MapBrowserPointerEvent'); -/** - * A function that takes an {@link ol.MapBrowserEvent} and returns a - * `{boolean}`. If the condition is met, true should be returned. - * - * @typedef {function(ol.MapBrowserEvent): boolean} - * @api stable - */ -ol.events.ConditionType; - - /** * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when * additionally the shift-key is pressed). diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index 9f77f216d7..8919459b14 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -41,20 +41,6 @@ goog.require('ol.style.Text'); goog.require('ol.xml'); -/** - * @typedef {{x: number, xunits: (ol.style.IconAnchorUnits|undefined), - * y: number, yunits: (ol.style.IconAnchorUnits|undefined)}} - */ -ol.format.KMLVec2_; - - -/** - * @typedef {{flatCoordinates: Array., - * whens: Array.}} - */ -ol.format.KMLGxTrackObject_; - - /** * @classdesc * Feature format for reading and writing data in the KML format. diff --git a/src/ol/format/wfsformat.js b/src/ol/format/wfsformat.js index fa9e660566..25b2a441d5 100644 --- a/src/ol/format/wfsformat.js +++ b/src/ol/format/wfsformat.js @@ -82,26 +82,6 @@ ol.format.WFS.FEATURE_PREFIX = 'feature'; ol.format.WFS.XMLNS = 'http://www.w3.org/2000/xmlns/'; -/** - * Number of features; bounds/extent. - * @typedef {{numberOfFeatures: number, - * bounds: ol.Extent}} - * @api stable - */ -ol.format.WFS.FeatureCollectionMetadata; - - -/** - * Total deleted; total inserted; total updated; array of insert ids. - * @typedef {{totalDeleted: number, - * totalInserted: number, - * totalUpdated: number, - * insertIds: Array.}} - * @api stable - */ -ol.format.WFS.TransactionResponse; - - /** * @const * @type {string} diff --git a/src/ol/interaction/dragboxinteraction.js b/src/ol/interaction/dragboxinteraction.js index 22a1feabdd..05f2db8d79 100644 --- a/src/ol/interaction/dragboxinteraction.js +++ b/src/ol/interaction/dragboxinteraction.js @@ -79,16 +79,6 @@ ol.DragBoxEvent = function(type, coordinate, mapBrowserEvent) { goog.inherits(ol.DragBoxEvent, ol.events.Event); -/** - * A function that takes a {@link ol.MapBrowserEvent} and two - * {@link ol.Pixel}s and returns a `{boolean}`. If the condition is met, - * true should be returned. - * @typedef {function(ol.MapBrowserEvent, ol.Pixel, ol.Pixel):boolean} - * @api - */ -ol.interaction.DragBoxEndConditionType; - - /** * @classdesc * Allows the user to draw a vector box by clicking and dragging on the map, diff --git a/src/ol/interaction/drawinteraction.js b/src/ol/interaction/drawinteraction.js index d085c883dc..6746eb08ed 100644 --- a/src/ol/interaction/drawinteraction.js +++ b/src/ol/interaction/drawinteraction.js @@ -850,19 +850,6 @@ ol.interaction.Draw.getMode_ = function(type) { }; -/** - * Function that takes coordinates and an optional existing geometry as - * arguments, and returns a geometry. The optional existing geometry is the - * geometry that is returned when the function is called without a second - * argument. - * @typedef {function(!(ol.Coordinate|Array.| - * Array.>), ol.geom.SimpleGeometry=): - * ol.geom.SimpleGeometry} - * @api - */ -ol.interaction.DrawGeometryFunctionType; - - /** * Draw mode. This collapses multi-part geometry types with their single-part * cousins. diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 705983893a..a2557e6248 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -82,16 +82,6 @@ ol.interaction.ModifyEvent = function(type, features, mapBrowserPointerEvent) { goog.inherits(ol.interaction.ModifyEvent, ol.events.Event); -/** - * @typedef {{depth: (Array.|undefined), - * feature: ol.Feature, - * geometry: ol.geom.SimpleGeometry, - * index: (number|undefined), - * segment: Array.}} - */ -ol.interaction.SegmentDataType; - - /** * @classdesc * Interaction for modifying feature geometries. diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index 516a432b75..8316e88be8 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -30,17 +30,6 @@ ol.interaction.SelectEventType = { }; -/** - * A function that takes an {@link ol.Feature} or {@link ol.render.Feature} and - * an {@link ol.layer.Layer} and returns `true` if the feature may be selected - * or `false` otherwise. - * @typedef {function((ol.Feature|ol.render.Feature), ol.layer.Layer): - * boolean} - * @api - */ -ol.interaction.SelectFilterFunction; - - /** * @classdesc * Events emitted by {@link ol.interaction.Select} instances are instances of diff --git a/src/ol/interaction/snapinteraction.js b/src/ol/interaction/snapinteraction.js index d5a3dbbec3..2aa222c5e0 100644 --- a/src/ol/interaction/snapinteraction.js +++ b/src/ol/interaction/snapinteraction.js @@ -591,25 +591,6 @@ ol.interaction.Snap.prototype.writePolygonGeometry_ = function(feature, geometry }; -/** - * @typedef {{ - * snapped: {boolean}, - * vertex: (ol.Coordinate|null), - * vertexPixel: (ol.Pixel|null) - * }} - */ -ol.interaction.Snap.ResultType; - - -/** - * @typedef {{ - * feature: ol.Feature, - * segment: Array. - * }} - */ -ol.interaction.Snap.SegmentDataType; - - /** * Handle all pointer events events. * @param {ol.MapBrowserEvent} evt A move event. diff --git a/src/ol/layer/layerbase.js b/src/ol/layer/layerbase.js index 30951a0449..e594f6d54c 100644 --- a/src/ol/layer/layerbase.js +++ b/src/ol/layer/layerbase.js @@ -22,20 +22,6 @@ ol.layer.LayerProperty = { }; -/** - * @typedef {{layer: ol.layer.Layer, - * opacity: number, - * sourceState: ol.source.State, - * visible: boolean, - * managed: boolean, - * extent: (ol.Extent|undefined), - * zIndex: number, - * maxResolution: number, - * minResolution: number}} - */ -ol.layer.LayerState; - - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/proj/proj.js b/src/ol/proj/proj.js index 0e739092d4..ef927199fc 100644 --- a/src/ol/proj/proj.js +++ b/src/ol/proj/proj.js @@ -10,15 +10,6 @@ goog.require('ol.object'); goog.require('ol.sphere.NORMAL'); -/** - * A projection as {@link ol.proj.Projection}, SRS identifier string or - * undefined. - * @typedef {ol.proj.Projection|string|undefined} ol.proj.ProjectionLike - * @api stable - */ -ol.proj.ProjectionLike; - - /** * Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, `'tile-pixels'` or * `'us-ft'`. diff --git a/src/ol/raster/operation.js b/src/ol/raster/operation.js index ec95350d46..0c2547d8b4 100644 --- a/src/ol/raster/operation.js +++ b/src/ol/raster/operation.js @@ -10,22 +10,3 @@ ol.raster.OperationType = { PIXEL: 'pixel', IMAGE: 'image' }; - - -/** - * A function that takes an array of input data, performs some operation, and - * returns an array of ouput data. For `'pixel'` type operations, functions - * will be called with an array of {@link ol.raster.Pixel} data and should - * return an array of the same. For `'image'` type operations, functions will - * be called with an array of {@link ImageData - * https://developer.mozilla.org/en-US/docs/Web/API/ImageData} and should return - * an array of the same. The operations are called with a second "data" - * argument, which can be used for storage. The data object is accessible - * from raster events, where it can be initialized in "beforeoperations" and - * accessed again in "afteroperations". - * - * @typedef {function((Array.|Array.), Object): - * (Array.|Array.)} - * @api - */ -ol.raster.Operation; diff --git a/src/ol/raster/pixel.js b/src/ol/raster/pixel.js deleted file mode 100644 index 58947f0523..0000000000 --- a/src/ol/raster/pixel.js +++ /dev/null @@ -1,10 +0,0 @@ -// goog.provide can't be removed from files which only contain a typedef -goog.provide('ol.raster.Pixel'); - - -/** - * An array of numbers representing pixel values. - * @typedef {Array.} ol.raster.Pixel - * @api - */ -ol.raster.Pixel; diff --git a/src/ol/render/canvas/canvas.js b/src/ol/render/canvas/canvas.js index 28644bc9da..8b8d5fcf5d 100644 --- a/src/ol/render/canvas/canvas.js +++ b/src/ol/render/canvas/canvas.js @@ -1,31 +1,6 @@ goog.provide('ol.render.canvas'); -/** - * @typedef {{fillStyle: ol.ColorLike}} - */ -ol.render.canvas.FillState; - - -/** - * @typedef {{lineCap: string, - * lineDash: Array., - * lineJoin: string, - * lineWidth: number, - * miterLimit: number, - * strokeStyle: string}} - */ -ol.render.canvas.StrokeState; - - -/** - * @typedef {{font: string, - * textAlign: string, - * textBaseline: string}} - */ -ol.render.canvas.TextState; - - /** * @const * @type {string} diff --git a/src/ol/renderer/webgl/webglmaprenderer.js b/src/ol/renderer/webgl/webglmaprenderer.js index 99d8b49d21..8a6b6dcc1b 100644 --- a/src/ol/renderer/webgl/webglmaprenderer.js +++ b/src/ol/renderer/webgl/webglmaprenderer.js @@ -33,12 +33,6 @@ goog.require('ol.webgl.Context'); goog.require('ol.webgl.WebGLContextEventType'); -/** - * @typedef {{magFilter: number, minFilter: number, texture: WebGLTexture}} - */ -ol.renderer.webgl.TextureCacheEntry; - - /** * @constructor * @extends {ol.renderer.Map} diff --git a/src/ol/reproj/image.js b/src/ol/reproj/image.js index 6d8c29f94e..087ec42c95 100644 --- a/src/ol/reproj/image.js +++ b/src/ol/reproj/image.js @@ -11,12 +11,6 @@ goog.require('ol.reproj'); goog.require('ol.reproj.Triangulation'); -/** - * @typedef {function(ol.Extent, number, number) : ol.ImageBase} - */ -ol.reproj.ImageFunctionType; - - /** * @classdesc * Class encapsulating single reprojected image. diff --git a/src/ol/reproj/tile.js b/src/ol/reproj/tile.js index 5c9566da57..28a2d69688 100644 --- a/src/ol/reproj/tile.js +++ b/src/ol/reproj/tile.js @@ -13,12 +13,6 @@ goog.require('ol.reproj'); goog.require('ol.reproj.Triangulation'); -/** - * @typedef {function(number, number, number, number) : ol.Tile} - */ -ol.reproj.TileFunctionType; - - /** * @classdesc * Class encapsulating single reprojected tile. diff --git a/src/ol/reproj/triangulation.js b/src/ol/reproj/triangulation.js index e893c134da..c4e9051824 100644 --- a/src/ol/reproj/triangulation.js +++ b/src/ol/reproj/triangulation.js @@ -6,15 +6,6 @@ goog.require('ol.math'); goog.require('ol.proj'); -/** - * Single triangle; consists of 3 source points and 3 target points. - * - * @typedef {{source: Array., - * target: Array.}} - */ -ol.reproj.Triangle; - - /** * @classdesc * Class containing triangulation of the given target extent. diff --git a/src/ol/source/imagesource.js b/src/ol/source/imagesource.js index 3881bc7184..0d1c24f5f3 100644 --- a/src/ol/source/imagesource.js +++ b/src/ol/source/imagesource.js @@ -11,17 +11,6 @@ goog.require('ol.reproj.Image'); goog.require('ol.source.Source'); -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * extent: (null|ol.Extent|undefined), - * logo: (string|olx.LogoOptions|undefined), - * projection: ol.proj.ProjectionLike, - * resolutions: (Array.|undefined), - * state: (ol.source.State|undefined)}} - */ -ol.source.ImageOptions; - - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/source/source.js b/src/ol/source/source.js index 9a4db1b021..4bb1e82ca7 100644 --- a/src/ol/source/source.js +++ b/src/ol/source/source.js @@ -20,16 +20,6 @@ ol.source.State = { }; -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * logo: (string|olx.LogoOptions|undefined), - * projection: ol.proj.ProjectionLike, - * state: (ol.source.State|undefined), - * wrapX: (boolean|undefined)}} - */ -ol.source.SourceOptions; - - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/source/tilesource.js b/src/ol/source/tilesource.js index a509eaebb7..dbd41fa803 100644 --- a/src/ol/source/tilesource.js +++ b/src/ol/source/tilesource.js @@ -14,21 +14,6 @@ goog.require('ol.tilecoord'); goog.require('ol.tilegrid.TileGrid'); -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * cacheSize: (number|undefined), - * extent: (ol.Extent|undefined), - * logo: (string|olx.LogoOptions|undefined), - * opaque: (boolean|undefined), - * tilePixelRatio: (number|undefined), - * projection: ol.proj.ProjectionLike, - * state: (ol.source.State|undefined), - * tileGrid: (ol.tilegrid.TileGrid|undefined), - * wrapX: (boolean|undefined)}} - */ -ol.source.TileOptions; - - /** * @classdesc * Abstract base class; normally only used for creating subclasses and not diff --git a/src/ol/source/urltilesource.js b/src/ol/source/urltilesource.js index f1dff5a971..6b87c687d5 100644 --- a/src/ol/source/urltilesource.js +++ b/src/ol/source/urltilesource.js @@ -7,25 +7,6 @@ goog.require('ol.source.Tile'); goog.require('ol.source.TileEvent'); -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * cacheSize: (number|undefined), - * extent: (ol.Extent|undefined), - * logo: (string|olx.LogoOptions|undefined), - * opaque: (boolean|undefined), - * projection: ol.proj.ProjectionLike, - * state: (ol.source.State|undefined), - * tileGrid: (ol.tilegrid.TileGrid|undefined), - * tileLoadFunction: ol.TileLoadFunctionType, - * tilePixelRatio: (number|undefined), - * tileUrlFunction: (ol.TileUrlFunctionType|undefined), - * url: (string|undefined), - * urls: (Array.|undefined), - * wrapX: (boolean|undefined)}} - */ -ol.source.UrlTileOptions; - - /** * @classdesc * Base class for sources providing tiles divided into a tile grid over http. diff --git a/src/ol/structs/lrucache.js b/src/ol/structs/lrucache.js index 9cdcf49bda..458ddd544e 100644 --- a/src/ol/structs/lrucache.js +++ b/src/ol/structs/lrucache.js @@ -259,12 +259,3 @@ ol.structs.LRUCache.prototype.set = function(key, value) { this.entries_[key] = entry; ++this.count_; }; - - -/** - * @typedef {{key_: string, - * newer: ol.structs.LRUCacheEntry, - * older: ol.structs.LRUCacheEntry, - * value_: *}} - */ -ol.structs.LRUCacheEntry; diff --git a/src/ol/style/imagestyle.js b/src/ol/style/imagestyle.js index 7de23bfc00..4858061a8a 100644 --- a/src/ol/style/imagestyle.js +++ b/src/ol/style/imagestyle.js @@ -13,16 +13,6 @@ ol.style.ImageState = { }; -/** - * @typedef {{opacity: number, - * rotateWithView: boolean, - * rotation: number, - * scale: number, - * snapToPixel: boolean}} - */ -ol.style.ImageOptions; - - /** * @classdesc * A base class used for creating subclasses and not instantiated in diff --git a/src/ol/style/style.js b/src/ol/style/style.js index d7f6c515fc..b9835060a1 100644 --- a/src/ol/style/style.js +++ b/src/ol/style/style.js @@ -191,18 +191,6 @@ ol.style.Style.prototype.setZIndex = function(zIndex) { }; -/** - * A function that takes an {@link ol.Feature} and a `{number}` representing - * the view's resolution. The function should return a {@link ol.style.Style} - * or an array of them. This way e.g. a vector layer can be styled. - * - * @typedef {function((ol.Feature|ol.render.Feature), number): - * (ol.style.Style|Array.)} - * @api - */ -ol.style.StyleFunction; - - /** * Convert the provided object into a style function. Functions passed through * unchanged. Arrays of ol.style.Style or single style objects wrapped in a @@ -349,17 +337,6 @@ ol.style.createDefaultEditingStyles = function() { }; -/** - * A function that takes an {@link ol.Feature} as argument and returns an - * {@link ol.geom.Geometry} that will be rendered and styled for the feature. - * - * @typedef {function((ol.Feature|ol.render.Feature)): - * (ol.geom.Geometry|ol.render.Feature|undefined)} - * @api - */ -ol.style.GeometryFunction; - - /** * Function that is called with a feature and returns its default geometry. * @param {ol.Feature|ol.render.Feature} feature Feature to get the geometry diff --git a/src/ol/typedefs.js b/src/ol/typedefs.js index 38863528d9..006c0b4a8e 100644 --- a/src/ol/typedefs.js +++ b/src/ol/typedefs.js @@ -288,3 +288,371 @@ ol.TileUrlFunctionType; * @api stable */ ol.TransformFunction; + + +/** + * A function that takes an {@link ol.MapBrowserEvent} and returns a + * `{boolean}`. If the condition is met, true should be returned. + * + * @typedef {function(ol.MapBrowserEvent): boolean} + * @api stable + */ +ol.events.ConditionType; + + +/** + * @typedef {EventTarget|ol.events.EventTarget| + * {addEventListener: function(string, Function, boolean=), + * removeEventListener: function(string, Function, boolean=), + * dispatchEvent: function(string)}} + */ +ol.events.EventTargetLike; + + +/** + * Key to use with {@link ol.Observable#unByKey}. + * + * @typedef {{bindTo: (Object|undefined), + * boundListener: (ol.events.ListenerFunctionType|undefined), + * callOnce: boolean, + * deleteIndex: (number|undefined), + * listener: ol.events.ListenerFunctionType, + * target: (EventTarget|ol.events.EventTarget), + * type: string}} + * @api + */ +ol.events.Key; + + +/** + * Listener function. This function is called with an event object as argument. + * When the function returns `false`, event propagation will stop. + * + * @typedef {function(ol.events.Event)|function(ol.events.Event): boolean} + * @api + */ +ol.events.ListenerFunctionType; + + +/** + * @typedef {{x: number, xunits: (ol.style.IconAnchorUnits|undefined), + * y: number, yunits: (ol.style.IconAnchorUnits|undefined)}} + */ +ol.format.KMLVec2_; + + +/** + * @typedef {{flatCoordinates: Array., + * whens: Array.}} + */ +ol.format.KMLGxTrackObject_; + + +/** + * Number of features; bounds/extent. + * @typedef {{numberOfFeatures: number, + * bounds: ol.Extent}} + * @api stable + */ +ol.format.WFS.FeatureCollectionMetadata; + + +/** + * Total deleted; total inserted; total updated; array of insert ids. + * @typedef {{totalDeleted: number, + * totalInserted: number, + * totalUpdated: number, + * insertIds: Array.}} + * @api stable + */ +ol.format.WFS.TransactionResponse; + + +/** + * A function that takes a {@link ol.MapBrowserEvent} and two + * {@link ol.Pixel}s and returns a `{boolean}`. If the condition is met, + * true should be returned. + * @typedef {function(ol.MapBrowserEvent, ol.Pixel, ol.Pixel):boolean} + * @api + */ +ol.interaction.DragBoxEndConditionType; + + +/** + * Function that takes coordinates and an optional existing geometry as + * arguments, and returns a geometry. The optional existing geometry is the + * geometry that is returned when the function is called without a second + * argument. + * @typedef {function(!(ol.Coordinate|Array.| + * Array.>), ol.geom.SimpleGeometry=): + * ol.geom.SimpleGeometry} + * @api + */ +ol.interaction.DrawGeometryFunctionType; + + +/** + * @typedef {{depth: (Array.|undefined), + * feature: ol.Feature, + * geometry: ol.geom.SimpleGeometry, + * index: (number|undefined), + * segment: Array.}} + */ +ol.interaction.SegmentDataType; + + +/** + * A function that takes an {@link ol.Feature} or {@link ol.render.Feature} and + * an {@link ol.layer.Layer} and returns `true` if the feature may be selected + * or `false` otherwise. + * @typedef {function((ol.Feature|ol.render.Feature), ol.layer.Layer): + * boolean} + * @api + */ +ol.interaction.SelectFilterFunction; + + +/** + * @typedef {{ + * snapped: {boolean}, + * vertex: (ol.Coordinate|null), + * vertexPixel: (ol.Pixel|null) + * }} + */ +ol.interaction.Snap.ResultType; + + +/** + * @typedef {{ + * feature: ol.Feature, + * segment: Array. + * }} + */ +ol.interaction.Snap.SegmentDataType; + + +/** + * @typedef {{layer: ol.layer.Layer, + * opacity: number, + * sourceState: ol.source.State, + * visible: boolean, + * managed: boolean, + * extent: (ol.Extent|undefined), + * zIndex: number, + * maxResolution: number, + * minResolution: number}} + */ +ol.layer.LayerState; + + +/** + * A projection as {@link ol.proj.Projection}, SRS identifier string or + * undefined. + * @typedef {ol.proj.Projection|string|undefined} ol.proj.ProjectionLike + * @api stable + */ +ol.proj.ProjectionLike; + + +/** + * A function that takes an array of input data, performs some operation, and + * returns an array of ouput data. For `'pixel'` type operations, functions + * will be called with an array of {@link ol.raster.Pixel} data and should + * return an array of the same. For `'image'` type operations, functions will + * be called with an array of {@link ImageData + * https://developer.mozilla.org/en-US/docs/Web/API/ImageData} and should return + * an array of the same. The operations are called with a second "data" + * argument, which can be used for storage. The data object is accessible + * from raster events, where it can be initialized in "beforeoperations" and + * accessed again in "afteroperations". + * + * @typedef {function((Array.|Array.), Object): + * (Array.|Array.)} + * @api + */ +ol.raster.Operation; + + +/** + * An array of numbers representing pixel values. + * @typedef {Array.} ol.raster.Pixel + * @api + */ +ol.raster.Pixel; + + +/** + * @typedef {{fillStyle: ol.ColorLike}} + */ +ol.render.canvas.FillState; + + +/** + * @typedef {{lineCap: string, + * lineDash: Array., + * lineJoin: string, + * lineWidth: number, + * miterLimit: number, + * strokeStyle: string}} + */ +ol.render.canvas.StrokeState; + + +/** + * @typedef {{font: string, + * textAlign: string, + * textBaseline: string}} + */ +ol.render.canvas.TextState; + + +/** + * @typedef {{magFilter: number, minFilter: number, texture: WebGLTexture}} + */ +ol.renderer.webgl.TextureCacheEntry; + + +/** + * @typedef {function(ol.Extent, number, number) : ol.ImageBase} + */ +ol.reproj.ImageFunctionType; + + +/** + * @typedef {function(number, number, number, number) : ol.Tile} + */ +ol.reproj.TileFunctionType; + + +/** + * Single triangle; consists of 3 source points and 3 target points. + * + * @typedef {{source: Array., + * target: Array.}} + */ +ol.reproj.Triangle; + + +/** + * @typedef {{attributions: (ol.AttributionLike|undefined), + * extent: (null|ol.Extent|undefined), + * logo: (string|olx.LogoOptions|undefined), + * projection: ol.proj.ProjectionLike, + * resolutions: (Array.|undefined), + * state: (ol.source.State|undefined)}} + */ +ol.source.ImageOptions; + + +/** + * @typedef {{attributions: (ol.AttributionLike|undefined), + * logo: (string|olx.LogoOptions|undefined), + * projection: ol.proj.ProjectionLike, + * state: (ol.source.State|undefined), + * wrapX: (boolean|undefined)}} + */ +ol.source.SourceOptions; + + +/** + * @typedef {{attributions: (ol.AttributionLike|undefined), + * cacheSize: (number|undefined), + * extent: (ol.Extent|undefined), + * logo: (string|olx.LogoOptions|undefined), + * opaque: (boolean|undefined), + * tilePixelRatio: (number|undefined), + * projection: ol.proj.ProjectionLike, + * state: (ol.source.State|undefined), + * tileGrid: (ol.tilegrid.TileGrid|undefined), + * wrapX: (boolean|undefined)}} + */ +ol.source.TileOptions; + + +/** + * @typedef {{attributions: (ol.AttributionLike|undefined), + * cacheSize: (number|undefined), + * extent: (ol.Extent|undefined), + * logo: (string|olx.LogoOptions|undefined), + * opaque: (boolean|undefined), + * projection: ol.proj.ProjectionLike, + * state: (ol.source.State|undefined), + * tileGrid: (ol.tilegrid.TileGrid|undefined), + * tileLoadFunction: ol.TileLoadFunctionType, + * tilePixelRatio: (number|undefined), + * tileUrlFunction: (ol.TileUrlFunctionType|undefined), + * url: (string|undefined), + * urls: (Array.|undefined), + * wrapX: (boolean|undefined)}} + */ +ol.source.UrlTileOptions; + + +/** + * @typedef {{key_: string, + * newer: ol.structs.LRUCacheEntry, + * older: ol.structs.LRUCacheEntry, + * value_: *}} + */ +ol.structs.LRUCacheEntry; + + +/** + * @typedef {{opacity: number, + * rotateWithView: boolean, + * rotation: number, + * scale: number, + * snapToPixel: boolean}} + */ +ol.style.ImageOptions; + + +/** + * A function that takes an {@link ol.Feature} as argument and returns an + * {@link ol.geom.Geometry} that will be rendered and styled for the feature. + * + * @typedef {function((ol.Feature|ol.render.Feature)): + * (ol.geom.Geometry|ol.render.Feature|undefined)} + * @api + */ +ol.style.GeometryFunction; + + +/** + * A function that takes an {@link ol.Feature} and a `{number}` representing + * the view's resolution. The function should return a {@link ol.style.Style} + * or an array of them. This way e.g. a vector layer can be styled. + * + * @typedef {function((ol.Feature|ol.render.Feature), number): + * (ol.style.Style|Array.)} + * @api + */ +ol.style.StyleFunction; + + +/** + * @typedef {{buf: ol.webgl.Buffer, + * buffer: WebGLBuffer}} + */ +ol.webgl.BufferCacheEntry; + + +/** + * When using {@link ol.xml.makeChildAppender} or + * {@link ol.xml.makeSimpleNodeFactory}, the top `objectStack` item needs to + * have this structure. + * @typedef {{node:Node}} + */ +ol.xml.NodeStackItem; + + +/** + * @typedef {function(Node, Array.<*>)} + */ +ol.xml.Parser; + + +/** + * @typedef {function(Node, *, Array.<*>)} + */ +ol.xml.Serializer; diff --git a/src/ol/webgl/context.js b/src/ol/webgl/context.js index b506251c3d..059175f3c1 100644 --- a/src/ol/webgl/context.js +++ b/src/ol/webgl/context.js @@ -10,13 +10,6 @@ goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.WebGLContextEventType'); -/** - * @typedef {{buf: ol.webgl.Buffer, - * buffer: WebGLBuffer}} - */ -ol.webgl.BufferCacheEntry; - - /** * @classdesc * A WebGL context for accessing low-level WebGL capabilities. diff --git a/src/ol/xml.js b/src/ol/xml.js index 9d16765c52..119ad799a5 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -5,27 +5,6 @@ goog.require('goog.dom.NodeType'); goog.require('ol.array'); -/** - * When using {@link ol.xml.makeChildAppender} or - * {@link ol.xml.makeSimpleNodeFactory}, the top `objectStack` item needs to - * have this structure. - * @typedef {{node:Node}} - */ -ol.xml.NodeStackItem; - - -/** - * @typedef {function(Node, Array.<*>)} - */ -ol.xml.Parser; - - -/** - * @typedef {function(Node, *, Array.<*>)} - */ -ol.xml.Serializer; - - /** * This document should be used when creating nodes for XML serializations. This * document is also used by {@link ol.xml.createElementNS} and