Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
+24
-24
@@ -16,22 +16,22 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
|
||||
* @property {import("./Source.js").AttributionLike} [attributions] Attributions.
|
||||
* @property {number} [cacheSize=2048] Cache size.
|
||||
* @property {module:ol/extent~Extent} [extent]
|
||||
* @property {import("../extent.js").Extent} [extent]
|
||||
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
||||
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
* access pixel data with the Canvas renderer. See
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
||||
* @property {boolean} [opaque=true] Whether the layer is opaque.
|
||||
* @property {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @property {import("../proj.js").ProjectionLike} projection Projection.
|
||||
* @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
|
||||
* Higher values can increase reprojection performance, but decrease precision.
|
||||
* @property {module:ol/source/State} [state] Source state.
|
||||
* @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles.
|
||||
* @property {import("./State.js").default} [state] Source state.
|
||||
* @property {import("../ImageTile.js").TileClass} [tileClass] Class used to instantiate image tiles.
|
||||
* Default is {@link module:ol/ImageTile~ImageTile}.
|
||||
* @property {module:ol/tilegrid/TileGrid} [tileGrid] Tile grid.
|
||||
* @property {module:ol/Tile~LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is
|
||||
* @property {import("../tilegrid/TileGrid.js").default} [tileGrid] Tile grid.
|
||||
* @property {import("../Tile.js").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is
|
||||
* ```js
|
||||
* function(imageTile, src) {
|
||||
* imageTile.getImage().src = src;
|
||||
@@ -41,7 +41,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
* service advertizes 256px by 256px tiles but actually sends 512px
|
||||
* by 512px images (for retina/hidpi devices) then `tilePixelRatio`
|
||||
* should be set to `2`.
|
||||
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.
|
||||
* @property {import("../Tile.js").UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.
|
||||
* @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
|
||||
* A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be
|
||||
* used instead of defining each one separately in the `urls` option.
|
||||
@@ -59,12 +59,12 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
* @classdesc
|
||||
* Base class for sources providing images divided into a tile grid.
|
||||
*
|
||||
* @fires module:ol/source/Tile~TileSourceEvent
|
||||
* @fires import("./Tile.js").TileSourceEvent
|
||||
* @api
|
||||
*/
|
||||
class TileImage extends UrlTile {
|
||||
/**
|
||||
* @param {!module:ol/source/TileImage~Options} options Image tile options.
|
||||
* @param {!Options} options Image tile options.
|
||||
*/
|
||||
constructor(options) {
|
||||
|
||||
@@ -95,21 +95,21 @@ class TileImage extends UrlTile {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {function(new: module:ol/ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
||||
* ?string, module:ol/Tile~LoadFunction, module:ol/Tile~Options=)}
|
||||
* @type {function(new: import("../ImageTile.js").default, import("../tilecoord.js").TileCoord, import("../TileState.js").default, string,
|
||||
* ?string, import("../Tile.js").LoadFunction, import("../Tile.js").Options=)}
|
||||
*/
|
||||
this.tileClass = options.tileClass !== undefined ?
|
||||
options.tileClass : ImageTile;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Object<string, module:ol/TileCache>}
|
||||
* @type {!Object<string, import("../TileCache.js").default>}
|
||||
*/
|
||||
this.tileCacheForProjection = {};
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Object<string, module:ol/tilegrid/TileGrid>}
|
||||
* @type {!Object<string, import("../tilegrid/TileGrid.js").default>}
|
||||
*/
|
||||
this.tileGridForProjection = {};
|
||||
|
||||
@@ -209,7 +209,7 @@ class TileImage extends UrlTile {
|
||||
this.tileGridForProjection[projKey] = getTileGridForProjection(projection);
|
||||
}
|
||||
return (
|
||||
/** @type {!module:ol/tilegrid/TileGrid} */ (this.tileGridForProjection[projKey])
|
||||
/** @type {!import("../tilegrid/TileGrid.js").default} */ (this.tileGridForProjection[projKey])
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -237,9 +237,9 @@ class TileImage extends UrlTile {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {import("../proj/Projection.js").default} projection Projection.
|
||||
* @param {string} key The key set on the tile.
|
||||
* @return {!module:ol/Tile} Tile.
|
||||
* @return {!import("../Tile.js").default} Tile.
|
||||
* @private
|
||||
*/
|
||||
createTile_(z, x, y, pixelRatio, projection, key) {
|
||||
@@ -265,7 +265,7 @@ class TileImage extends UrlTile {
|
||||
* @inheritDoc
|
||||
*/
|
||||
getTile(z, x, y, pixelRatio, projection) {
|
||||
const sourceProjection = /** @type {!module:ol/proj/Projection} */ (this.getProjection());
|
||||
const sourceProjection = /** @type {!import("../proj/Projection.js").default} */ (this.getProjection());
|
||||
if (!ENABLE_RASTER_REPROJECTION ||
|
||||
!sourceProjection || !projection || equivalent(sourceProjection, projection)) {
|
||||
return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection);
|
||||
@@ -275,7 +275,7 @@ class TileImage extends UrlTile {
|
||||
let tile;
|
||||
const tileCoordKey = getKey(tileCoord);
|
||||
if (cache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!module:ol/Tile} */ (cache.get(tileCoordKey));
|
||||
tile = /** @type {!import("../Tile.js").default} */ (cache.get(tileCoordKey));
|
||||
}
|
||||
const key = this.getKey();
|
||||
if (tile && tile.key == key) {
|
||||
@@ -313,8 +313,8 @@ class TileImage extends UrlTile {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {!module:ol/proj/Projection} projection Projection.
|
||||
* @return {!module:ol/Tile} Tile.
|
||||
* @param {!import("../proj/Projection.js").default} projection Projection.
|
||||
* @return {!import("../Tile.js").default} Tile.
|
||||
* @protected
|
||||
*/
|
||||
getTileInternal(z, x, y, pixelRatio, projection) {
|
||||
@@ -372,8 +372,8 @@ class TileImage extends UrlTile {
|
||||
* (e.g. projection has no extent defined) or
|
||||
* for optimization reasons (custom tile size, resolutions, ...).
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @param {module:ol/tilegrid/TileGrid} tilegrid Tile grid to use for the projection.
|
||||
* @param {import("../proj.js").ProjectionLike} projection Projection.
|
||||
* @param {import("../tilegrid/TileGrid.js").default} tilegrid Tile grid to use for the projection.
|
||||
* @api
|
||||
*/
|
||||
setTileGridForProjection(projection, tilegrid) {
|
||||
@@ -391,7 +391,7 @@ class TileImage extends UrlTile {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/ImageTile} imageTile Image tile.
|
||||
* @param {import("../ImageTile.js").default} imageTile Image tile.
|
||||
* @param {string} src Source.
|
||||
*/
|
||||
function defaultTileLoadFunction(imageTile, src) {
|
||||
|
||||
Reference in New Issue
Block a user