Transformed types

Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e):

    jscodeshift --transform ts.js src
This commit is contained in:
Tim Schaub
2018-09-05 08:05:29 -06:00
parent f2aaaa19e1
commit ccfacc5ee6
239 changed files with 3999 additions and 3999 deletions

View File

@@ -13,7 +13,7 @@ import Triangulation from '../reproj/Triangulation.js';
/**
* @typedef {function(module:ol/extent~Extent, number, number) : module:ol/ImageBase} FunctionType
* @typedef {function(import("../extent.js").Extent, number, number) : import("../ImageBase.js").default} FunctionType
*/
@@ -24,12 +24,12 @@ import Triangulation from '../reproj/Triangulation.js';
*/
class ReprojImage extends ImageBase {
/**
* @param {module:ol/proj/Projection} sourceProj Source projection (of the data).
* @param {module:ol/proj/Projection} targetProj Target projection.
* @param {module:ol/extent~Extent} targetExtent Target extent.
* @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../extent.js").Extent} targetExtent Target extent.
* @param {number} targetResolution Target resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {module:ol/reproj/Image~FunctionType} getImageFunction
* @param {FunctionType} getImageFunction
* Function returning source images (extent, resolution, pixelRatio).
*/
constructor(sourceProj, targetProj, targetExtent, targetResolution, pixelRatio, getImageFunction) {
@@ -61,19 +61,19 @@ class ReprojImage extends ImageBase {
/**
* @private
* @type {module:ol/proj/Projection}
* @type {import("../proj/Projection.js").default}
*/
this.targetProj_ = targetProj;
/**
* @private
* @type {module:ol/extent~Extent}
* @type {import("../extent.js").Extent}
*/
this.maxSourceExtent_ = maxSourceExtent;
/**
* @private
* @type {!module:ol/reproj/Triangulation}
* @type {!import("./Triangulation.js").default}
*/
this.triangulation_ = triangulation;
@@ -85,13 +85,13 @@ class ReprojImage extends ImageBase {
/**
* @private
* @type {module:ol/extent~Extent}
* @type {import("../extent.js").Extent}
*/
this.targetExtent_ = targetExtent;
/**
* @private
* @type {module:ol/ImageBase}
* @type {import("../ImageBase.js").default}
*/
this.sourceImage_ = sourceImage;
@@ -109,7 +109,7 @@ class ReprojImage extends ImageBase {
/**
* @private
* @type {?module:ol/events~EventsKey}
* @type {?import("../events.js").EventsKey}
*/
this.sourceListenerKey_ = null;
}
@@ -132,7 +132,7 @@ class ReprojImage extends ImageBase {
}
/**
* @return {module:ol/proj/Projection} Projection.
* @return {import("../proj/Projection.js").default} Projection.
*/
getProjection() {
return this.targetProj_;
@@ -187,7 +187,7 @@ class ReprojImage extends ImageBase {
* @private
*/
unlistenSource_() {
unlistenByKey(/** @type {!module:ol/events~EventsKey} */ (this.sourceListenerKey_));
unlistenByKey(/** @type {!import("../events.js").EventsKey} */ (this.sourceListenerKey_));
this.sourceListenerKey_ = null;
}
}

View File

@@ -14,7 +14,7 @@ import Triangulation from '../reproj/Triangulation.js';
/**
* @typedef {function(number, number, number, number) : module:ol/Tile} FunctionType
* @typedef {function(number, number, number, number) : import("../Tile.js").default} FunctionType
*/
@@ -26,15 +26,15 @@ import Triangulation from '../reproj/Triangulation.js';
*/
class ReprojTile extends Tile {
/**
* @param {module:ol/proj/Projection} sourceProj Source projection.
* @param {module:ol/tilegrid/TileGrid} sourceTileGrid Source tile grid.
* @param {module:ol/proj/Projection} targetProj Target projection.
* @param {module:ol/tilegrid/TileGrid} targetTileGrid Target tile grid.
* @param {module:ol/tilecoord~TileCoord} tileCoord Coordinate of the tile.
* @param {module:ol/tilecoord~TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
* @param {import("../tilegrid/TileGrid.js").default} sourceTileGrid Source tile grid.
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../tilegrid/TileGrid.js").default} targetTileGrid Target tile grid.
* @param {import("../tilecoord.js").TileCoord} tileCoord Coordinate of the tile.
* @param {import("../tilecoord.js").TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
* @param {number} pixelRatio Pixel ratio.
* @param {number} gutter Gutter of the source tiles.
* @param {module:ol/reproj/Tile~FunctionType} getTileFunction
* @param {FunctionType} getTileFunction
* Function returning source tiles (z, x, y, pixelRatio).
* @param {number=} opt_errorThreshold Acceptable reprojection error (in px).
* @param {boolean=} opt_renderEdges Render reprojection edges.
@@ -80,31 +80,31 @@ class ReprojTile extends Tile {
/**
* @private
* @type {module:ol/tilegrid/TileGrid}
* @type {import("../tilegrid/TileGrid.js").default}
*/
this.sourceTileGrid_ = sourceTileGrid;
/**
* @private
* @type {module:ol/tilegrid/TileGrid}
* @type {import("../tilegrid/TileGrid.js").default}
*/
this.targetTileGrid_ = targetTileGrid;
/**
* @private
* @type {module:ol/tilecoord~TileCoord}
* @type {import("../tilecoord.js").TileCoord}
*/
this.wrappedTileCoord_ = wrappedTileCoord ? wrappedTileCoord : tileCoord;
/**
* @private
* @type {!Array<module:ol/Tile>}
* @type {!Array<import("../Tile.js").default>}
*/
this.sourceTiles_ = [];
/**
* @private
* @type {Array<module:ol/events~EventsKey>}
* @type {Array<import("../events.js").EventsKey>}
*/
this.sourcesListenerKeys_ = null;
@@ -156,7 +156,7 @@ class ReprojTile extends Tile {
/**
* @private
* @type {!module:ol/reproj/Triangulation}
* @type {!import("./Triangulation.js").default}
*/
this.triangulation_ = new Triangulation(
sourceProj, targetProj, limitedTargetExtent, maxSourceExtent,

View File

@@ -10,8 +10,8 @@ import {getTransform} from '../proj.js';
/**
* Single triangle; consists of 3 source points and 3 target points.
* @typedef {Object} Triangle
* @property {Array<module:ol/coordinate~Coordinate>} source
* @property {Array<module:ol/coordinate~Coordinate>} target
* @property {Array<import("../coordinate.js").Coordinate>} source
* @property {Array<import("../coordinate.js").Coordinate>} target
*/
@@ -44,33 +44,33 @@ const MAX_TRIANGLE_WIDTH = 0.25;
class Triangulation {
/**
* @param {module:ol/proj/Projection} sourceProj Source projection.
* @param {module:ol/proj/Projection} targetProj Target projection.
* @param {module:ol/extent~Extent} targetExtent Target extent to triangulate.
* @param {module:ol/extent~Extent} maxSourceExtent Maximal source extent that can be used.
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../extent.js").Extent} targetExtent Target extent to triangulate.
* @param {import("../extent.js").Extent} maxSourceExtent Maximal source extent that can be used.
* @param {number} errorThreshold Acceptable error (in source units).
*/
constructor(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold) {
/**
* @type {module:ol/proj/Projection}
* @type {import("../proj/Projection.js").default}
* @private
*/
this.sourceProj_ = sourceProj;
/**
* @type {module:ol/proj/Projection}
* @type {import("../proj/Projection.js").default}
* @private
*/
this.targetProj_ = targetProj;
/** @type {!Object<string, module:ol/coordinate~Coordinate>} */
/** @type {!Object<string, import("../coordinate.js").Coordinate>} */
let transformInvCache = {};
const transformInv = getTransform(this.targetProj_, this.sourceProj_);
/**
* @param {module:ol/coordinate~Coordinate} c A coordinate.
* @return {module:ol/coordinate~Coordinate} Transformed coordinate.
* @param {import("../coordinate.js").Coordinate} c A coordinate.
* @return {import("../coordinate.js").Coordinate} Transformed coordinate.
* @private
*/
this.transformInv_ = function(c) {
@@ -82,7 +82,7 @@ class Triangulation {
};
/**
* @type {module:ol/extent~Extent}
* @type {import("../extent.js").Extent}
* @private
*/
this.maxSourceExtent_ = maxSourceExtent;
@@ -94,7 +94,7 @@ class Triangulation {
this.errorThresholdSquared_ = errorThreshold * errorThreshold;
/**
* @type {Array<module:ol/reproj/Triangulation~Triangle>}
* @type {Array<Triangle>}
* @private
*/
this.triangles_ = [];
@@ -188,12 +188,12 @@ class Triangulation {
/**
* Adds triangle to the triangulation.
* @param {module:ol/coordinate~Coordinate} a The target a coordinate.
* @param {module:ol/coordinate~Coordinate} b The target b coordinate.
* @param {module:ol/coordinate~Coordinate} c The target c coordinate.
* @param {module:ol/coordinate~Coordinate} aSrc The source a coordinate.
* @param {module:ol/coordinate~Coordinate} bSrc The source b coordinate.
* @param {module:ol/coordinate~Coordinate} cSrc The source c coordinate.
* @param {import("../coordinate.js").Coordinate} a The target a coordinate.
* @param {import("../coordinate.js").Coordinate} b The target b coordinate.
* @param {import("../coordinate.js").Coordinate} c The target c coordinate.
* @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
* @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
* @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
* @private
*/
addTriangle_(a, b, c, aSrc, bSrc, cSrc) {
@@ -208,14 +208,14 @@ class Triangulation {
* (and reprojects the vertices) if valid.
* Performs quad subdivision if needed to increase precision.
*
* @param {module:ol/coordinate~Coordinate} a The target a coordinate.
* @param {module:ol/coordinate~Coordinate} b The target b coordinate.
* @param {module:ol/coordinate~Coordinate} c The target c coordinate.
* @param {module:ol/coordinate~Coordinate} d The target d coordinate.
* @param {module:ol/coordinate~Coordinate} aSrc The source a coordinate.
* @param {module:ol/coordinate~Coordinate} bSrc The source b coordinate.
* @param {module:ol/coordinate~Coordinate} cSrc The source c coordinate.
* @param {module:ol/coordinate~Coordinate} dSrc The source d coordinate.
* @param {import("../coordinate.js").Coordinate} a The target a coordinate.
* @param {import("../coordinate.js").Coordinate} b The target b coordinate.
* @param {import("../coordinate.js").Coordinate} c The target c coordinate.
* @param {import("../coordinate.js").Coordinate} d The target d coordinate.
* @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
* @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
* @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
* @param {import("../coordinate.js").Coordinate} dSrc The source d coordinate.
* @param {number} maxSubdivision Maximal allowed subdivision of the quad.
* @private
*/
@@ -327,7 +327,7 @@ class Triangulation {
/**
* Calculates extent of the 'source' coordinates from all the triangles.
*
* @return {module:ol/extent~Extent} Calculated extent.
* @return {import("../extent.js").Extent} Calculated extent.
*/
calculateSourceExtent() {
const extent = createEmpty();
@@ -343,7 +343,7 @@ class Triangulation {
}
/**
* @return {Array<module:ol/reproj/Triangulation~Triangle>} Array of the calculated triangles.
* @return {Array<Triangle>} Array of the calculated triangles.
*/
getTriangles() {
return this.triangles_;