From 7c35139e900322962dac013d369e4f6be4955614 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 19 Apr 2018 18:22:04 -0600 Subject: [PATCH] Remove ol/typedefs.js --- doc/tutorials/closure.md | 2 -- src/ol/source/Vector.js | 13 +++++++++++-- src/ol/typedefs.js | 31 ------------------------------- 3 files changed, 11 insertions(+), 35 deletions(-) delete mode 100644 src/ol/typedefs.js diff --git a/doc/tutorials/closure.md b/doc/tutorials/closure.md index d3422b8ae3..500c6e2ccc 100644 --- a/doc/tutorials/closure.md +++ b/doc/tutorials/closure.md @@ -176,7 +176,6 @@ The minimum config file looks like this: "ol.ENABLE_WEBGL=false" ], "js": [ - "node_modules/openlayers/src/ol/typedefs.js", "node_modules/openlayers/externs/oli.js" ], "extra_annotation_name": [ @@ -227,7 +226,6 @@ Here is a version of `config.json` with more compilation checks enabled: "ol.ENABLE_WEBGL=false" ], "js": [ - "node_modules/openlayers/src/ol/typedefs.js", "node_modules/openlayers/externs/oli.js" ], "jscomp_error": [ diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index ce6b842395..22fe1e1d76 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -21,6 +21,15 @@ import SourceState from '../source/State.js'; import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; +/** + * A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and + * returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this + * is one of the standard {@link ol.loadingstrategy} strategies. + * + * @typedef {function(module:ol/extent~Extent, number): Array.} LoadingStrategy + * @api + */ + /** * @classdesc @@ -95,7 +104,7 @@ inherits(VectorSourceEvent, Event); * Setting this to `false` (e.g. for sources with polygons that represent administrative * boundaries or TopoJSON sources) allows the renderer to optimise fill and * stroke operations. - * @property {ol.LoadingStrategy} [strategy] The loading strategy to use. + * @property {module:ol/source/Vector~LoadingStrategy} [strategy] The loading strategy to use. * By default an {@link ol.loadingstrategy.all} * strategy is used, a one-off strategy which loads all features at once. * @property {string|module:ol/Feature~FeatureUrlFunction} [url] @@ -191,7 +200,7 @@ const VectorSource = function(opt_options) { /** * @private - * @type {ol.LoadingStrategy} + * @type {module:ol/source/Vector~LoadingStrategy} */ this.strategy_ = options.strategy !== undefined ? options.strategy : allStrategy; diff --git a/src/ol/typedefs.js b/src/ol/typedefs.js deleted file mode 100644 index 666a15b52d..0000000000 --- a/src/ol/typedefs.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @module ol/typedefs - */ - -//FIXME Remove when reworking typedefs, export typedefs as variables instead -const ol = {}; - -/** - * File for all typedefs used by the compiler, and referenced by JSDoc. - * - * These look like vars (or var properties), but in fact are simply identifiers - * for the Closure compiler. Originally they were included in the appropriate - * namespace file, but with the move away from Closure namespaces and towards - * self-contained standard modules are now all in this file. - * Unlike the other type definitions - enums and constructor functions - they - * are not code and so are not imported or exported. They are only referred to - * in type-defining comments used by the Closure compiler, and so should not - * appear in module code. - * - * They are now all in the `ol` namespace. - */ - - -/** - * A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and - * returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this - * is one of the standard {@link ol.loadingstrategy} strategies. - * - * @typedef {function(module:ol/extent~Extent, number): Array.} - */ -ol.LoadingStrategy;