Merge pull request #11472 from ahocevar/typescript-4.0.2
Typescript 4.0.2
This commit is contained in:
6
package-lock.json
generated
6
package-lock.json
generated
@@ -12638,9 +12638,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.9.7",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
|
||||
"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
|
||||
"integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ua-parser-js": {
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"shx": "^0.3.2",
|
||||
"sinon": "^9.0.0",
|
||||
"terser-webpack-plugin": "^4.0.0",
|
||||
"typescript": "^3.8.3",
|
||||
"typescript": "^4.0.2",
|
||||
"url-polyfill": "^1.1.5",
|
||||
"walk": "^2.3.9",
|
||||
"webpack": "4.44.1",
|
||||
|
||||
@@ -140,6 +140,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
} else {
|
||||
// click
|
||||
this.clickTimeoutId_ = setTimeout(
|
||||
/** @this {MapBrowserEventHandler} */
|
||||
function () {
|
||||
this.clickTimeoutId_ = undefined;
|
||||
const newEvent = new MapBrowserEvent(
|
||||
|
||||
@@ -187,7 +187,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
this.animationDelay_ = function () {
|
||||
this.animationDelay_ = /** @this {PluggableMap} */ function () {
|
||||
this.animationDelayKey_ = undefined;
|
||||
this.renderFrame_(Date.now());
|
||||
}.bind(this);
|
||||
|
||||
@@ -109,8 +109,8 @@ import {squaredDistance as squaredCoordinateDistance} from '../coordinate.js';
|
||||
* and a projection as arguments, and returns a geometry. The optional existing
|
||||
* geometry is the geometry that is returned when the function is called without
|
||||
* a second argument.
|
||||
* @typedef {function(!SketchCoordType, import("../geom/SimpleGeometry.js").default=,
|
||||
* import("../proj/Projection.js").default=):
|
||||
* @typedef {function(!SketchCoordType, import("../geom/SimpleGeometry.js").default,
|
||||
* import("../proj/Projection.js").default):
|
||||
* import("../geom/SimpleGeometry.js").default} GeometryFunction
|
||||
*/
|
||||
|
||||
@@ -299,13 +299,13 @@ class Draw extends PointerInteraction {
|
||||
if (this.type_ === GeometryType.CIRCLE) {
|
||||
/**
|
||||
* @param {!LineCoordType} coordinates The coordinates.
|
||||
* @param {import("../geom/SimpleGeometry.js").default=} opt_geometry Optional geometry.
|
||||
* @param {import("../geom/SimpleGeometry.js").default|undefined} geometry Optional geometry.
|
||||
* @param {import("../proj/Projection.js").default} projection The view projection.
|
||||
* @return {import("../geom/SimpleGeometry.js").default} A geometry.
|
||||
*/
|
||||
geometryFunction = function (coordinates, opt_geometry, projection) {
|
||||
const circle = opt_geometry
|
||||
? /** @type {Circle} */ (opt_geometry)
|
||||
geometryFunction = function (coordinates, geometry, projection) {
|
||||
const circle = geometry
|
||||
? /** @type {Circle} */ (geometry)
|
||||
: new Circle([NaN, NaN]);
|
||||
const center = fromUserCoordinate(coordinates[0], projection);
|
||||
const squaredLength = squaredCoordinateDistance(
|
||||
@@ -331,12 +331,11 @@ class Draw extends PointerInteraction {
|
||||
}
|
||||
/**
|
||||
* @param {!LineCoordType} coordinates The coordinates.
|
||||
* @param {import("../geom/SimpleGeometry.js").default=} opt_geometry Optional geometry.
|
||||
* @param {import("../geom/SimpleGeometry.js").default|undefined} geometry Optional geometry.
|
||||
* @param {import("../proj/Projection.js").default} projection The view projection.
|
||||
* @return {import("../geom/SimpleGeometry.js").default} A geometry.
|
||||
*/
|
||||
geometryFunction = function (coordinates, opt_geometry, projection) {
|
||||
let geometry = opt_geometry;
|
||||
geometryFunction = function (coordinates, geometry, projection) {
|
||||
if (geometry) {
|
||||
if (mode === Mode.POLYGON) {
|
||||
if (coordinates[0].length) {
|
||||
|
||||
@@ -338,7 +338,11 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
*/
|
||||
getFeatures(pixel) {
|
||||
return new Promise(
|
||||
function (resolve, reject) {
|
||||
/**
|
||||
* @param {function(Array<import("../../Feature").default|import("../../render/Feature").default>): void} resolve Resolver function.
|
||||
* @this {CanvasVectorLayerRenderer}
|
||||
*/
|
||||
function (resolve) {
|
||||
if (!this.hitDetectionImageData_ && !this.animatingOrInteracting_) {
|
||||
const size = [this.context.canvas.width, this.context.canvas.height];
|
||||
apply(this.pixelTransform, size);
|
||||
@@ -622,28 +626,29 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
const squaredTolerance = getSquaredRenderTolerance(resolution, pixelRatio);
|
||||
|
||||
/**
|
||||
* @param {import("../../Feature.js").default} feature Feature.
|
||||
* @this {CanvasVectorLayerRenderer}
|
||||
*/
|
||||
const render = function (feature) {
|
||||
let styles;
|
||||
const styleFunction =
|
||||
feature.getStyleFunction() || vectorLayer.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction(feature, resolution);
|
||||
}
|
||||
if (styles) {
|
||||
const dirty = this.renderFeature(
|
||||
feature,
|
||||
squaredTolerance,
|
||||
styles,
|
||||
replayGroup,
|
||||
userTransform
|
||||
);
|
||||
this.dirty_ = this.dirty_ || dirty;
|
||||
}
|
||||
}.bind(this);
|
||||
const render =
|
||||
/**
|
||||
* @param {import("../../Feature.js").default} feature Feature.
|
||||
* @this {CanvasVectorLayerRenderer}
|
||||
*/
|
||||
function (feature) {
|
||||
let styles;
|
||||
const styleFunction =
|
||||
feature.getStyleFunction() || vectorLayer.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction(feature, resolution);
|
||||
}
|
||||
if (styles) {
|
||||
const dirty = this.renderFeature(
|
||||
feature,
|
||||
squaredTolerance,
|
||||
styles,
|
||||
replayGroup,
|
||||
userTransform
|
||||
);
|
||||
this.dirty_ = this.dirty_ || dirty;
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
const userExtent = toUserExtent(extent, projection);
|
||||
/** @type {Array<import("../../Feature.js").default>} */
|
||||
|
||||
@@ -267,6 +267,10 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||
this.worker_ = createWebGLWorker();
|
||||
this.worker_.addEventListener(
|
||||
'message',
|
||||
/**
|
||||
* @param {*} event Event.
|
||||
* @this {WebGLPointsLayerRenderer}
|
||||
*/
|
||||
function (event) {
|
||||
const received = event.data;
|
||||
if (received.type === WebGLWorkerMessageType.GENERATE_BUFFERS) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {linearFindNearest} from './array.js';
|
||||
* Returns a modified resolution taking into account the viewport size and maximum
|
||||
* allowed extent.
|
||||
* @param {number} resolution Resolution
|
||||
* @param {import("./extent.js").Extent=} maxExtent Maximum allowed extent.
|
||||
* @param {import("./extent.js").Extent} maxExtent Maximum allowed extent.
|
||||
* @param {import("./size.js").Size} viewportSize Viewport size.
|
||||
* @param {boolean} showFullExtent Whether to show the full extent.
|
||||
* @return {number} Capped resolution.
|
||||
|
||||
Reference in New Issue
Block a user