diff --git a/config/jsdoc/api/plugins/api.js b/config/jsdoc/api/plugins/api.js
index a3fa37f445..16a67593fe 100644
--- a/config/jsdoc/api/plugins/api.js
+++ b/config/jsdoc/api/plugins/api.js
@@ -11,6 +11,7 @@ exports.defineTags = function(dictionary) {
canHaveType: false,
canHaveName: false,
onTagged: function(doclet, tag) {
+ includeTypes(doclet);
var level = tag.text || "experimental";
if (levels.indexOf(level) >= 0) {
doclet.stability = level;
@@ -25,11 +26,15 @@ exports.defineTags = function(dictionary) {
/*
- * Based on @stability annotations, and assuming that items with no @stability
- * annotation should not be documented, this plugin removes undocumented symbols
+ * Based on @api annotations, and assuming that items with no @api annotation
+ * should not be documented, this plugin removes undocumented symbols
* from the documentation.
*/
+var api = [];
+var classes = {};
+var types = {};
+
function hasApiMembers(doclet) {
return doclet.longname.split('#')[0] == this.longname;
}
@@ -71,8 +76,30 @@ function includeAugments(doclet) {
}
}
-var api = [];
-var classes = {};
+function extractTypes(item) {
+ item.type.names.forEach(function(type) {
+ var match = type.match(/^(.*<)?([^>]*)>?$/);
+ if (match) {
+ types[match[2]] = true;
+ }
+ });
+}
+
+function includeTypes(doclet) {
+ if (doclet.params && doclet.kind != 'class') {
+ doclet.params.forEach(extractTypes);
+ }
+ if (doclet.returns) {
+ doclet.returns.forEach(extractTypes);
+ }
+ if (doclet.isEnum) {
+ types[doclet.meta.code.name] = true;
+ }
+ if (doclet.type && doclet.meta.code.type == 'MemberExpression') {
+ // types in olx.js
+ extractTypes(doclet);
+ }
+}
exports.handlers = {
@@ -80,6 +107,9 @@ exports.handlers = {
var doclet = e.doclet;
// Keep track of api items - needed in parseComplete to determine classes
// with api members.
+ if (doclet.meta.filename == 'olx.js' && doclet.kind == 'typedef') {
+ doclet.undocumented = false;
+ }
if (doclet.stability) {
api.push(doclet);
}
@@ -120,7 +150,7 @@ exports.handlers = {
// constructor from the docs.
doclet._hideConstructor = true;
includeAugments(doclet);
- } else if (!doclet._hideConstructor) {
+ } else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
// Remove all other undocumented symbols
doclet.undocumented = true;
}
diff --git a/config/jsdoc/api/plugins/typedefs.js b/config/jsdoc/api/plugins/typedefs.js
index 8d12e424b0..67fe8ad4df 100644
--- a/config/jsdoc/api/plugins/typedefs.js
+++ b/config/jsdoc/api/plugins/typedefs.js
@@ -89,10 +89,6 @@ exports.handlers = {
newDoclet: function(e) {
var doclet = e.doclet;
if (doclet.meta.filename == 'olx.js') {
- // do nothing if not marked @api
- if (!doclet.stability) {
- return;
- }
if (doclet.kind == 'typedef') {
lastOlxTypedef = doclet;
olxTypeNames.push(doclet.longname);
diff --git a/config/jsdoc/api/template/tmpl/navigation.tmpl b/config/jsdoc/api/template/tmpl/navigation.tmpl
index e5fb726d14..2fe64ace28 100644
--- a/config/jsdoc/api/template/tmpl/navigation.tmpl
+++ b/config/jsdoc/api/template/tmpl/navigation.tmpl
@@ -39,7 +39,7 @@ var self = this;
-
|
diff --git a/config/jsdoc/api/template/tmpl/stability.tmpl b/config/jsdoc/api/template/tmpl/stability.tmpl
index b169bbef46..12037661e3 100644
--- a/config/jsdoc/api/template/tmpl/stability.tmpl
+++ b/config/jsdoc/api/template/tmpl/stability.tmpl
@@ -2,6 +2,6 @@
var data = obj;
var self = this;
-if (data.stability != 'stable') { ?>
+if (data.stability && data.stability != 'stable') { ?>
diff --git a/config/jsdoc/api/template/tmpl/tutorial.tmpl b/config/jsdoc/api/template/tmpl/tutorial.tmpl
index b0c79c1dd7..88a0ad52aa 100644
--- a/config/jsdoc/api/template/tmpl/tutorial.tmpl
+++ b/config/jsdoc/api/template/tmpl/tutorial.tmpl
@@ -1,5 +1,5 @@
+
diff --git a/examples/color-manipulation.js b/examples/color-manipulation.js
index 6e6f8565b3..2cd424efa3 100644
--- a/examples/color-manipulation.js
+++ b/examples/color-manipulation.js
@@ -22,8 +22,8 @@ var twoPi = 2 * Math.PI;
/**
* Convert an RGB pixel into an HCL pixel.
- * @param {ol.raster.Pixel} pixel A pixel in RGB space.
- * @return {ol.raster.Pixel} A pixel in HCL space.
+ * @param {Array.} pixel A pixel in RGB space.
+ * @return {Array.} A pixel in HCL space.
*/
function rgb2hcl(pixel) {
var red = rgb2xyz(pixel[0]);
@@ -57,8 +57,8 @@ function rgb2hcl(pixel) {
/**
* Convert an HCL pixel into an RGB pixel.
- * @param {ol.raster.Pixel} pixel A pixel in HCL space.
- * @return {ol.raster.Pixel} A pixel in RGB space.
+ * @param {Array.} pixel A pixel in HCL space.
+ * @return {Array.} A pixel in RGB space.
*/
function hcl2rgb(pixel) {
var h = pixel[0];
diff --git a/examples/raster.js b/examples/raster.js
index e4a38ae29f..395ac7dcbd 100644
--- a/examples/raster.js
+++ b/examples/raster.js
@@ -15,7 +15,7 @@ var bins = 10;
/**
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
* is a rough estimate assuming that pixel values correspond to reflectance.
- * @param {ol.raster.Pixel} pixel An array of [R, G, B, A] values.
+ * @param {Array.} pixel An array of [R, G, B, A] values.
* @return {number} The VGI value for the given pixel.
*/
function vgi(pixel) {
diff --git a/externs/olx.js b/externs/olx.js
index 8fbdcb7ffa..26b8e4a7f3 100644
--- a/externs/olx.js
+++ b/externs/olx.js
@@ -11,7 +11,6 @@ var olx;
/**
* @typedef {{html: string,
* tileRanges: (Object.>|undefined)}}
- * @api
*/
olx.AttributionOptions;
@@ -26,7 +25,6 @@ olx.AttributionOptions.prototype.html;
/**
* @typedef {{tracking: (boolean|undefined)}}
- * @api
*/
olx.DeviceOrientationOptions;
@@ -43,7 +41,6 @@ olx.DeviceOrientationOptions.prototype.tracking;
* @typedef {{tracking: (boolean|undefined),
* trackingOptions: (GeolocationPositionOptions|undefined),
* projection: ol.proj.ProjectionLike}}
- * @api
*/
olx.GeolocationOptions;
@@ -76,7 +73,6 @@ olx.GeolocationOptions.prototype.projection;
/**
* Object literal with config options for the map logo.
* @typedef {{href: (string), src: (string)}}
- * @api
*/
olx.LogoOptions;
@@ -102,7 +98,6 @@ olx.LogoOptions.prototype.src;
* maxLines: (number|undefined),
* strokeStyle: (ol.style.Stroke|undefined),
* targetSize: (number|undefined)}}
- * @api
*/
olx.GraticuleOptions;
@@ -150,7 +145,6 @@ olx.GraticuleOptions.prototype.targetSize;
/**
* Object literal with config options for interactions.
* @typedef {{handleEvent: function(ol.MapBrowserEvent):boolean}}
- * @api
*/
olx.interaction.InteractionOptions;
@@ -180,7 +174,6 @@ olx.interaction.InteractionOptions.prototype.handleEvent;
* renderer: (ol.RendererType|Array.|string|undefined),
* target: (Element|string|undefined),
* view: (ol.View|undefined)}}
- * @api
*/
olx.MapOptions;
@@ -321,7 +314,6 @@ olx.MapOptions.prototype.view;
* autoPan: (boolean|undefined),
* autoPanAnimation: (olx.animation.PanOptions|undefined),
* autoPanMargin: (number|undefined)}}
- * @api stable
*/
olx.OverlayOptions;
@@ -434,7 +426,6 @@ olx.OverlayOptions.prototype.autoPanMargin;
* metersPerUnit: (number|undefined),
* worldExtent: (ol.Extent|undefined),
* getPointResolution: (function(number, ol.Coordinate):number|undefined) }}
- * @api
*/
olx.ProjectionOptions;
@@ -522,7 +513,6 @@ olx.ProjectionOptions.prototype.getPointResolution;
* rotation: (number|undefined),
* zoom: (number|undefined),
* zoomFactor: (number|undefined)}}
- * @api
*/
olx.ViewOptions;
@@ -683,7 +673,6 @@ olx.animation;
* start: (number|undefined),
* duration: (number|undefined),
* easing: (function(number):number|undefined)}}
- * @api
*/
olx.animation.BounceOptions;
@@ -727,7 +716,6 @@ olx.animation.BounceOptions.prototype.easing;
* start: (number|undefined),
* duration: (number|undefined),
* easing: (function(number):number|undefined)}}
- * @api
*/
olx.animation.PanOptions;
@@ -771,7 +759,6 @@ olx.animation.PanOptions.prototype.easing;
* start: (number|undefined),
* duration: (number|undefined),
* easing: (function(number):number|undefined)}}
- * @api
*/
olx.animation.RotateOptions;
@@ -824,7 +811,6 @@ olx.animation.RotateOptions.prototype.easing;
* start: (number|undefined),
* duration: (number|undefined),
* easing: (function(number):number|undefined)}}
- * @api
*/
olx.animation.ZoomOptions;
@@ -879,7 +865,6 @@ olx.control;
* collapseLabel: (string|Node|undefined),
* render: (function(ol.MapEvent)|undefined),
* target: (Element|undefined)}}
- * @api
*/
olx.control.AttributionOptions;
@@ -958,7 +943,6 @@ olx.control.AttributionOptions.prototype.render;
* @typedef {{element: (Element|undefined),
* render: (function(ol.MapEvent)|undefined),
* target: (Element|string|undefined)}}
- * @api stable
*/
olx.control.ControlOptions;
@@ -997,7 +981,6 @@ olx.control.ControlOptions.prototype.target;
* rotateOptions: (olx.control.RotateOptions|undefined),
* zoom: (boolean|undefined),
* zoomOptions: (olx.control.ZoomOptions|undefined)}}
- * @api
*/
olx.control.DefaultsOptions;
@@ -1058,7 +1041,6 @@ olx.control.DefaultsOptions.prototype.zoomOptions;
* keys: (boolean|undefined),
* target: (Element|undefined),
* source: (Element|string|undefined)}}
- * @api
*/
olx.control.FullScreenOptions;
@@ -1127,7 +1109,6 @@ olx.control.FullScreenOptions.prototype.source;
* render: (function(ol.MapEvent)|undefined),
* target: (Element|undefined),
* undefinedHTML: (string|undefined)}}
- * @api stable
*/
olx.control.MousePositionOptions;
@@ -1191,7 +1172,6 @@ olx.control.MousePositionOptions.prototype.undefinedHTML;
* target: (Element|undefined),
* tipLabel: (string|undefined),
* view: (ol.View|undefined)}}
- * @api
*/
olx.control.OverviewMapOptions;
@@ -1281,7 +1261,6 @@ olx.control.OverviewMapOptions.prototype.view;
* render: (function(ol.MapEvent)|undefined),
* target: (Element|undefined),
* units: (ol.control.ScaleLineUnits|string|undefined)}}
- * @api stable
*/
olx.control.ScaleLineOptions;
@@ -1336,7 +1315,6 @@ olx.control.ScaleLineOptions.prototype.units;
* render: (function(ol.MapEvent)|undefined),
* resetNorth: (function()|undefined),
* autoHide: (boolean|undefined)}}
- * @api stable
*/
olx.control.RotateOptions;
@@ -1417,7 +1395,6 @@ olx.control.RotateOptions.prototype.target;
* zoomOutTipLabel: (string|undefined),
* delta: (number|undefined),
* target: (Element|undefined)}}
- * @api stable
*/
olx.control.ZoomOptions;
@@ -1494,7 +1471,6 @@ olx.control.ZoomOptions.prototype.target;
* maxResolution: (number|undefined),
* minResolution: (number|undefined),
* render: (function(ol.MapEvent)|undefined)}}
- * @api
*/
olx.control.ZoomSliderOptions;
@@ -1546,7 +1522,6 @@ olx.control.ZoomSliderOptions.prototype.render;
* label: (string|Node|undefined),
* tipLabel: (string|undefined),
* extent: (ol.Extent|undefined)}}
- * @api stable
*/
olx.control.ZoomToExtentOptions;
@@ -1604,7 +1579,6 @@ olx.format;
* @typedef {{dataProjection: ol.proj.ProjectionLike,
* featureProjection: ol.proj.ProjectionLike,
* rightHanded: (boolean|undefined)}}
- * @api
*/
olx.format.ReadOptions;
@@ -1635,7 +1609,6 @@ olx.format.ReadOptions.prototype.featureProjection;
* featureProjection: ol.proj.ProjectionLike,
* rightHanded: (boolean|undefined),
* decimals: (number|undefined)}}
- * @api
*/
olx.format.WriteOptions;
@@ -1694,7 +1667,6 @@ olx.format.WriteOptions.prototype.decimals;
/**
* @typedef {{defaultDataProjection: ol.proj.ProjectionLike,
* geometryName: (string|undefined)}}
- * @api
*/
olx.format.GeoJSONOptions;
@@ -1717,7 +1689,6 @@ olx.format.GeoJSONOptions.prototype.geometryName;
/**
* @typedef {{geometryName: (string|undefined)}}
- * @api
*/
olx.format.EsriJSONOptions;
@@ -1738,7 +1709,6 @@ olx.format.EsriJSONOptions.prototype.geometryName;
* geometryName: (string|undefined),
* layers: (Array.|undefined),
* layerName: (string|undefined)}}
- * @api
*/
olx.format.MVTOptions;
@@ -1784,7 +1754,6 @@ olx.format.MVTOptions.prototype.layers;
/**
* @typedef {{factor: (number|undefined),
* geometryLayout: (ol.geom.GeometryLayout|undefined)}}
- * @api
*/
olx.format.PolylineOptions;
@@ -1809,7 +1778,6 @@ olx.format.PolylineOptions.prototype.geometryLayout;
/**
* @typedef {{defaultDataProjection: ol.proj.ProjectionLike}}
- * @api
*/
olx.format.TopoJSONOptions;
@@ -1824,7 +1792,6 @@ olx.format.TopoJSONOptions.prototype.defaultDataProjection;
/**
* @typedef {{altitudeMode: (ol.format.IGCZ|undefined)}}
- * @api
*/
olx.format.IGCOptions;
@@ -1843,7 +1810,6 @@ olx.format.IGCOptions.prototype.altitudeMode;
* defaultStyle: (Array.|undefined),
* showPointNames: (boolean|undefined),
* writeStyles: (boolean|undefined)}}
- * @api
*/
olx.format.KMLOptions;
@@ -1889,7 +1855,6 @@ olx.format.KMLOptions.prototype.writeStyles;
* multiCurve: (boolean|undefined),
* multiSurface: (boolean|undefined),
* schemaLocation: (string|undefined)}}
- * @api
*/
olx.format.GMLOptions;
@@ -1977,7 +1942,6 @@ olx.format.GMLOptions.prototype.schemaLocation;
/**
* @typedef {{readExtensions: (function(ol.Feature, Node)|undefined)}}
- * @api
*/
olx.format.GPXOptions;
@@ -2000,7 +1964,6 @@ olx.format.GPXOptions.prototype.readExtensions;
* featureType: (Array.|string|undefined),
* gmlFormat: (ol.format.GMLBase|undefined),
* schemaLocation: (string|undefined)}}
- * @api
*/
olx.format.WFSOptions;
@@ -2052,7 +2015,6 @@ olx.format.WFSOptions.prototype.schemaLocation;
* count: (number|undefined),
* bbox: (ol.Extent|undefined),
* filter: (ol.format.ogc.filter.Filter|undefined)}}
- * @api
*/
olx.format.WFSWriteGetFeatureOptions;
@@ -2173,7 +2135,6 @@ olx.format.WFSWriteGetFeatureOptions.prototype.filter;
* handle: (string|undefined),
* nativeElements: Array. |