Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -12,7 +12,7 @@ import SourceState from '../source/State.js';
|
||||
* A function that returns a string or an array of strings representing source
|
||||
* attributions.
|
||||
*
|
||||
* @typedef {function(module:ol/PluggableMap~FrameState): (string|Array<string>)} Attribution
|
||||
* @typedef {function(import("../PluggableMap.js").FrameState): (string|Array<string>)} Attribution
|
||||
*/
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ import SourceState from '../source/State.js';
|
||||
* * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)
|
||||
* * a function that returns a string or array of strings (`{@link module:ol/source/Source~Attribution}`)
|
||||
*
|
||||
* @typedef {string|Array<string>|module:ol/source/Source~Attribution} AttributionLike
|
||||
* @typedef {string|Array<string>|Attribution} AttributionLike
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/source/Source~AttributionLike} [attributions]
|
||||
* @property {module:ol/proj~ProjectionLike} projection
|
||||
* @property {module:ol/source/State} [state]
|
||||
* @property {AttributionLike} [attributions]
|
||||
* @property {import("../proj.js").ProjectionLike} projection
|
||||
* @property {import("./State.js").default} [state]
|
||||
* @property {boolean} [wrapX]
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ import SourceState from '../source/State.js';
|
||||
*/
|
||||
class Source extends BaseObject {
|
||||
/**
|
||||
* @param {module:ol/source/Source~Options} options Source options.
|
||||
* @param {Options} options Source options.
|
||||
*/
|
||||
constructor(options) {
|
||||
|
||||
@@ -56,13 +56,13 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("../proj/Projection.js").default}
|
||||
*/
|
||||
this.projection_ = getProjection(options.projection);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/source/Source~Attribution}
|
||||
* @type {?Attribution}
|
||||
*/
|
||||
this.attributions_ = this.adaptAttributions_(options.attributions);
|
||||
|
||||
@@ -75,7 +75,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/source/State}
|
||||
* @type {import("./State.js").default}
|
||||
*/
|
||||
this.state_ = options.state !== undefined ?
|
||||
options.state : SourceState.READY;
|
||||
@@ -90,8 +90,8 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* Turns the attributions option into an attributions function.
|
||||
* @param {module:ol/source/Source~AttributionLike|undefined} attributionLike The attribution option.
|
||||
* @return {?module:ol/source/Source~Attribution} An attribution function (or null).
|
||||
* @param {AttributionLike|undefined} attributionLike The attribution option.
|
||||
* @return {?Attribution} An attribution function (or null).
|
||||
*/
|
||||
adaptAttributions_(attributionLike) {
|
||||
if (!attributionLike) {
|
||||
@@ -114,7 +114,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the attribution function for the source.
|
||||
* @return {?module:ol/source/Source~Attribution} Attribution function.
|
||||
* @return {?Attribution} Attribution function.
|
||||
*/
|
||||
getAttributions() {
|
||||
return this.attributions_;
|
||||
@@ -122,7 +122,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the projection of the source.
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
* @api
|
||||
*/
|
||||
getProjection() {
|
||||
@@ -137,7 +137,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the state of the source, see {@link module:ol/source/State~State} for possible states.
|
||||
* @return {module:ol/source/State} State.
|
||||
* @return {import("./State.js").default} State.
|
||||
* @api
|
||||
*/
|
||||
getState() {
|
||||
@@ -161,7 +161,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the attributions of the source.
|
||||
* @param {module:ol/source/Source~AttributionLike|undefined} attributions Attributions.
|
||||
* @param {AttributionLike|undefined} attributions Attributions.
|
||||
* Can be passed as `string`, `Array<string>`, `{@link module:ol/source/Source~Attribution}`,
|
||||
* or `undefined`.
|
||||
* @api
|
||||
@@ -173,7 +173,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the state of the source.
|
||||
* @param {module:ol/source/State} state State.
|
||||
* @param {import("./State.js").default} state State.
|
||||
* @protected
|
||||
*/
|
||||
setState(state) {
|
||||
@@ -183,12 +183,12 @@ class Source extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {Object<string, boolean>} skippedFeatureUids Skipped feature uids.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T} callback Feature callback.
|
||||
* @param {function((import("../Feature.js").default|import("../render/Feature.js").default)): T} callback Feature callback.
|
||||
* @return {T|void} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user