Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -18,14 +18,14 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
|
||||
* @property {import("../extent.js").Extent} [extent] Initial extent. Defaults to no
|
||||
* initial extent.
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
|
||||
* @property {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction} [boxStyle]
|
||||
* Style for the drawn extent box. Defaults to
|
||||
* {@link module:ol/style/Style~createEditing()['Polygon']}
|
||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||
* pointer close enough to a segment or vertex for editing.
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
|
||||
* @property {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction} [pointerStyle]
|
||||
* Style for the cursor used to draw the extent. Defaults to
|
||||
* {@link module:ol/style/Style~createEditing()['Point']}
|
||||
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
|
||||
@@ -39,7 +39,7 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
const ExtentEventType = {
|
||||
/**
|
||||
* Triggered after the extent is changed
|
||||
* @event module:ol/interaction/Extent~ExtentEventType#extentchanged
|
||||
* @event ExtentEventType#extentchanged
|
||||
* @api
|
||||
*/
|
||||
EXTENTCHANGED: 'extentchanged'
|
||||
@@ -54,14 +54,14 @@ const ExtentEventType = {
|
||||
class ExtentInteractionEvent extends Event {
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent the new extent
|
||||
* @param {import("../extent.js").Extent} extent the new extent
|
||||
*/
|
||||
constructor(extent) {
|
||||
super(ExtentEventType.EXTENTCHANGED);
|
||||
|
||||
/**
|
||||
* The current extent.
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../extent.js").Extent}
|
||||
* @api
|
||||
*/
|
||||
this.extent = extent;
|
||||
@@ -76,12 +76,12 @@ class ExtentInteractionEvent extends Event {
|
||||
* Once drawn, the vector box can be modified by dragging its vertices or edges.
|
||||
* This interaction is only supported for mouse devices.
|
||||
*
|
||||
* @fires module:ol/interaction/Extent~Event
|
||||
* @fires Event
|
||||
* @api
|
||||
*/
|
||||
class ExtentInteraction extends PointerInteraction {
|
||||
/**
|
||||
* @param {module:ol/interaction/Extent~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
@@ -96,14 +96,14 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Extent of the drawn box
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../extent.js").Extent}
|
||||
* @private
|
||||
*/
|
||||
this.extent_ = null;
|
||||
|
||||
/**
|
||||
* Handler for pointer move events
|
||||
* @type {function (module:ol/coordinate~Coordinate): module:ol/extent~Extent|null}
|
||||
* @type {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent|null}
|
||||
* @private
|
||||
*/
|
||||
this.pointerHandler_ = null;
|
||||
@@ -125,14 +125,14 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Feature for displaying the visible extent
|
||||
* @type {module:ol/Feature}
|
||||
* @type {import("../Feature.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.extentFeature_ = null;
|
||||
|
||||
/**
|
||||
* Feature for displaying the visible pointer
|
||||
* @type {module:ol/Feature}
|
||||
* @type {import("../Feature.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.vertexFeature_ = null;
|
||||
@@ -143,7 +143,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Layer for the extentFeature
|
||||
* @type {module:ol/layer/Vector}
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.extentOverlay_ = new VectorLayer({
|
||||
@@ -158,7 +158,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Layer for the vertexFeature
|
||||
* @type {module:ol/layer/Vector}
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.vertexOverlay_ = new VectorLayer({
|
||||
@@ -177,9 +177,9 @@ class ExtentInteraction extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pixel~Pixel} pixel cursor location
|
||||
* @param {module:ol/PluggableMap} map map
|
||||
* @returns {module:ol/coordinate~Coordinate|null} snapped vertex on extent
|
||||
* @param {import("../pixel.js").Pixel} pixel cursor location
|
||||
* @param {import("../PluggableMap.js").default} map map
|
||||
* @returns {import("../coordinate.js").Coordinate|null} snapped vertex on extent
|
||||
* @private
|
||||
*/
|
||||
snapToVertex_(pixel, map) {
|
||||
@@ -219,7 +219,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent pointer move event
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent pointer move event
|
||||
* @private
|
||||
*/
|
||||
handlePointerMove_(mapBrowserEvent) {
|
||||
@@ -234,8 +234,8 @@ class ExtentInteraction extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent extent
|
||||
* @returns {module:ol/Feature} extent as featrue
|
||||
* @param {import("../extent.js").Extent} extent extent
|
||||
* @returns {import("../Feature.js").default} extent as featrue
|
||||
* @private
|
||||
*/
|
||||
createOrUpdateExtentFeature_(extent) {
|
||||
@@ -260,8 +260,8 @@ class ExtentInteraction extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} vertex location of feature
|
||||
* @returns {module:ol/Feature} vertex as feature
|
||||
* @param {import("../coordinate.js").Coordinate} vertex location of feature
|
||||
* @returns {import("../Feature.js").default} vertex as feature
|
||||
* @private
|
||||
*/
|
||||
createOrUpdatePointerFeature_(vertex) {
|
||||
@@ -271,7 +271,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
this.vertexFeature_ = vertexFeature;
|
||||
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
||||
} else {
|
||||
const geometry = /** @type {module:ol/geom/Point} */ (vertexFeature.getGeometry());
|
||||
const geometry = /** @type {import("../geom/Point.js").default} */ (vertexFeature.getGeometry());
|
||||
geometry.setCoordinates(vertex);
|
||||
}
|
||||
return vertexFeature;
|
||||
@@ -289,7 +289,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
/**
|
||||
* Returns the current drawn extent in the view projection
|
||||
*
|
||||
* @return {module:ol/extent~Extent} Drawn extent in the view projection.
|
||||
* @return {import("../extent.js").Extent} Drawn extent in the view projection.
|
||||
* @api
|
||||
*/
|
||||
getExtent() {
|
||||
@@ -299,7 +299,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
/**
|
||||
* Manually sets the drawn extent, using the view projection.
|
||||
*
|
||||
* @param {module:ol/extent~Extent} extent Extent
|
||||
* @param {import("../extent.js").Extent} extent Extent
|
||||
* @api
|
||||
*/
|
||||
setExtent(extent) {
|
||||
@@ -311,9 +311,9 @@ class ExtentInteraction extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Event.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Propagate event?
|
||||
* @this {module:ol/interaction/Extent~ExtentInteraction}
|
||||
* @this {ExtentInteraction}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
@@ -330,9 +330,9 @@ function handleEvent(mapBrowserEvent) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Event handled?
|
||||
* @this {module:ol/interaction/Extent~ExtentInteraction}
|
||||
* @this {ExtentInteraction}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
const pixel = mapBrowserEvent.pixel;
|
||||
@@ -389,9 +389,9 @@ function handleDownEvent(mapBrowserEvent) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Event handled?
|
||||
* @this {module:ol/interaction/Extent~ExtentInteraction}
|
||||
* @this {ExtentInteraction}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
if (this.pointerHandler_) {
|
||||
@@ -403,9 +403,9 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {module:ol/interaction/Extent~ExtentInteraction}
|
||||
* @this {ExtentInteraction}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
this.pointerHandler_ = null;
|
||||
@@ -420,7 +420,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* Returns the default style for the drawn bbox
|
||||
*
|
||||
* @return {module:ol/style/Style~StyleFunction} Default Extent style
|
||||
* @return {import("../style/Style.js").StyleFunction} Default Extent style
|
||||
*/
|
||||
function getDefaultExtentStyleFunction() {
|
||||
const style = createEditingStyle();
|
||||
@@ -432,7 +432,7 @@ function getDefaultExtentStyleFunction() {
|
||||
/**
|
||||
* Returns the default style for the pointer
|
||||
*
|
||||
* @return {module:ol/style/Style~StyleFunction} Default pointer style
|
||||
* @return {import("../style/Style.js").StyleFunction} Default pointer style
|
||||
*/
|
||||
function getDefaultPointerStyleFunction() {
|
||||
const style = createEditingStyle();
|
||||
@@ -442,8 +442,8 @@ function getDefaultPointerStyleFunction() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} fixedPoint corner that will be unchanged in the new extent
|
||||
* @returns {function (module:ol/coordinate~Coordinate): module:ol/extent~Extent} event handler
|
||||
* @param {import("../coordinate.js").Coordinate} fixedPoint corner that will be unchanged in the new extent
|
||||
* @returns {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent} event handler
|
||||
*/
|
||||
function getPointHandler(fixedPoint) {
|
||||
return function(point) {
|
||||
@@ -452,9 +452,9 @@ function getPointHandler(fixedPoint) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} fixedP1 first corner that will be unchanged in the new extent
|
||||
* @param {module:ol/coordinate~Coordinate} fixedP2 second corner that will be unchanged in the new extent
|
||||
* @returns {function (module:ol/coordinate~Coordinate): module:ol/extent~Extent|null} event handler
|
||||
* @param {import("../coordinate.js").Coordinate} fixedP1 first corner that will be unchanged in the new extent
|
||||
* @param {import("../coordinate.js").Coordinate} fixedP2 second corner that will be unchanged in the new extent
|
||||
* @returns {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent|null} event handler
|
||||
*/
|
||||
function getEdgeHandler(fixedP1, fixedP2) {
|
||||
if (fixedP1[0] == fixedP2[0]) {
|
||||
@@ -471,8 +471,8 @@ function getEdgeHandler(fixedP1, fixedP2) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent extent
|
||||
* @returns {Array<Array<module:ol/coordinate~Coordinate>>} extent line segments
|
||||
* @param {import("../extent.js").Extent} extent extent
|
||||
* @returns {Array<Array<import("../coordinate.js").Coordinate>>} extent line segments
|
||||
*/
|
||||
function getSegments(extent) {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user