Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
class EventSource {
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||
* @param {import("./PointerEventHandler.js").default} dispatcher Event handler.
|
||||
* @param {!Object<string, function(Event)>} mapping Event mapping.
|
||||
*/
|
||||
constructor(dispatcher, mapping) {
|
||||
|
||||
/**
|
||||
* @type {module:ol/pointer/PointerEventHandler}
|
||||
* @type {import("./PointerEventHandler.js").default}
|
||||
*/
|
||||
this.dispatcher = dispatcher;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ const DEDUP_DIST = 25;
|
||||
/**
|
||||
* Handler for `mousedown`.
|
||||
*
|
||||
* @this {module:ol/pointer/MouseSource}
|
||||
* @this {import("./MouseSource.js").default}
|
||||
* @param {MouseEvent} inEvent The in event.
|
||||
*/
|
||||
function mousedown(inEvent) {
|
||||
@@ -76,7 +76,7 @@ function mousedown(inEvent) {
|
||||
/**
|
||||
* Handler for `mousemove`.
|
||||
*
|
||||
* @this {module:ol/pointer/MouseSource}
|
||||
* @this {import("./MouseSource.js").default}
|
||||
* @param {MouseEvent} inEvent The in event.
|
||||
*/
|
||||
function mousemove(inEvent) {
|
||||
@@ -89,7 +89,7 @@ function mousemove(inEvent) {
|
||||
/**
|
||||
* Handler for `mouseup`.
|
||||
*
|
||||
* @this {module:ol/pointer/MouseSource}
|
||||
* @this {import("./MouseSource.js").default}
|
||||
* @param {MouseEvent} inEvent The in event.
|
||||
*/
|
||||
function mouseup(inEvent) {
|
||||
@@ -107,7 +107,7 @@ function mouseup(inEvent) {
|
||||
/**
|
||||
* Handler for `mouseover`.
|
||||
*
|
||||
* @this {module:ol/pointer/MouseSource}
|
||||
* @this {import("./MouseSource.js").default}
|
||||
* @param {MouseEvent} inEvent The in event.
|
||||
*/
|
||||
function mouseover(inEvent) {
|
||||
@@ -120,7 +120,7 @@ function mouseover(inEvent) {
|
||||
/**
|
||||
* Handler for `mouseout`.
|
||||
*
|
||||
* @this {module:ol/pointer/MouseSource}
|
||||
* @this {import("./MouseSource.js").default}
|
||||
* @param {MouseEvent} inEvent The in event.
|
||||
*/
|
||||
function mouseout(inEvent) {
|
||||
@@ -134,7 +134,7 @@ function mouseout(inEvent) {
|
||||
class MouseSource extends EventSource {
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||
* @param {import("./PointerEventHandler.js").default} dispatcher Event handler.
|
||||
*/
|
||||
constructor(dispatcher) {
|
||||
const mapping = {
|
||||
@@ -154,7 +154,7 @@ class MouseSource extends EventSource {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array<module:ol/pixel~Pixel>}
|
||||
* @type {Array<import("../pixel.js").Pixel>}
|
||||
*/
|
||||
this.lastTouches = [];
|
||||
}
|
||||
@@ -223,7 +223,7 @@ class MouseSource extends EventSource {
|
||||
* for the fake pointer event.
|
||||
*
|
||||
* @param {Event} inEvent The in event.
|
||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||
* @param {import("./PointerEventHandler.js").default} dispatcher Event handler.
|
||||
* @return {Object} The copied event.
|
||||
*/
|
||||
function prepareEvent(inEvent, dispatcher) {
|
||||
|
||||
@@ -49,7 +49,7 @@ const POINTER_TYPES = [
|
||||
/**
|
||||
* Handler for `msPointerDown`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msPointerDown(inEvent) {
|
||||
@@ -61,7 +61,7 @@ function msPointerDown(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerMove`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msPointerMove(inEvent) {
|
||||
@@ -72,7 +72,7 @@ function msPointerMove(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerUp`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msPointerUp(inEvent) {
|
||||
@@ -84,7 +84,7 @@ function msPointerUp(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerOut`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msPointerOut(inEvent) {
|
||||
@@ -95,7 +95,7 @@ function msPointerOut(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerOver`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msPointerOver(inEvent) {
|
||||
@@ -106,7 +106,7 @@ function msPointerOver(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerCancel`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msPointerCancel(inEvent) {
|
||||
@@ -118,7 +118,7 @@ function msPointerCancel(inEvent) {
|
||||
/**
|
||||
* Handler for `msLostPointerCapture`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msLostPointerCapture(inEvent) {
|
||||
@@ -129,7 +129,7 @@ function msLostPointerCapture(inEvent) {
|
||||
/**
|
||||
* Handler for `msGotPointerCapture`.
|
||||
*
|
||||
* @this {module:ol/pointer/MsSource}
|
||||
* @this {import("./MsSource.js").default}
|
||||
* @param {MSPointerEvent} inEvent The in event.
|
||||
*/
|
||||
function msGotPointerCapture(inEvent) {
|
||||
@@ -140,7 +140,7 @@ function msGotPointerCapture(inEvent) {
|
||||
class MsSource extends EventSource {
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||
* @param {import("./PointerEventHandler.js").default} dispatcher Event handler.
|
||||
*/
|
||||
constructor(dispatcher) {
|
||||
const mapping = {
|
||||
|
||||
@@ -37,7 +37,7 @@ import EventSource from '../pointer/EventSource.js';
|
||||
/**
|
||||
* Handler for `pointerdown`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function pointerDown(inEvent) {
|
||||
@@ -47,7 +47,7 @@ function pointerDown(inEvent) {
|
||||
/**
|
||||
* Handler for `pointermove`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function pointerMove(inEvent) {
|
||||
@@ -57,7 +57,7 @@ function pointerMove(inEvent) {
|
||||
/**
|
||||
* Handler for `pointerup`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function pointerUp(inEvent) {
|
||||
@@ -67,7 +67,7 @@ function pointerUp(inEvent) {
|
||||
/**
|
||||
* Handler for `pointerout`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function pointerOut(inEvent) {
|
||||
@@ -77,7 +77,7 @@ function pointerOut(inEvent) {
|
||||
/**
|
||||
* Handler for `pointerover`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function pointerOver(inEvent) {
|
||||
@@ -87,7 +87,7 @@ function pointerOver(inEvent) {
|
||||
/**
|
||||
* Handler for `pointercancel`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function pointerCancel(inEvent) {
|
||||
@@ -97,7 +97,7 @@ function pointerCancel(inEvent) {
|
||||
/**
|
||||
* Handler for `lostpointercapture`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function lostPointerCapture(inEvent) {
|
||||
@@ -107,7 +107,7 @@ function lostPointerCapture(inEvent) {
|
||||
/**
|
||||
* Handler for `gotpointercapture`.
|
||||
*
|
||||
* @this {module:ol/pointer/NativeSource}
|
||||
* @this {import("./NativeSource.js").default}
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
function gotPointerCapture(inEvent) {
|
||||
@@ -117,7 +117,7 @@ function gotPointerCapture(inEvent) {
|
||||
class NativeSource extends EventSource {
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||
* @param {import("./PointerEventHandler.js").default} dispatcher Event handler.
|
||||
*/
|
||||
constructor(dispatcher) {
|
||||
const mapping = {
|
||||
|
||||
@@ -111,7 +111,7 @@ class PointerEventHandler extends EventTarget {
|
||||
this.eventMap_ = {};
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/pointer/EventSource>}
|
||||
* @type {Array<import("./EventSource.js").default>}
|
||||
* @private
|
||||
*/
|
||||
this.eventSourceList_ = [];
|
||||
@@ -145,7 +145,7 @@ class PointerEventHandler extends EventTarget {
|
||||
* Add a new event source that will generate pointer events.
|
||||
*
|
||||
* @param {string} name A name for the event source
|
||||
* @param {module:ol/pointer/EventSource} source The source event.
|
||||
* @param {import("./EventSource.js").default} source The source event.
|
||||
*/
|
||||
registerSource(name, source) {
|
||||
const s = source;
|
||||
@@ -366,7 +366,7 @@ class PointerEventHandler extends EventTarget {
|
||||
* @param {string} inType A string representing the type of event to create.
|
||||
* @param {Object} data Pointer event data.
|
||||
* @param {Event} event The event.
|
||||
* @return {module:ol/pointer/PointerEvent} A PointerEvent of type `inType`.
|
||||
* @return {import("./PointerEvent.js").default} A PointerEvent of type `inType`.
|
||||
*/
|
||||
makeEvent(inType, data, event) {
|
||||
return new PointerEvent(inType, event, data);
|
||||
@@ -398,7 +398,7 @@ class PointerEventHandler extends EventTarget {
|
||||
* This proxy method is required for the legacy IE support.
|
||||
* @param {string} eventType The pointer event type.
|
||||
* @param {Event} event The event.
|
||||
* @return {module:ol/pointer/PointerEvent} The wrapped event.
|
||||
* @return {import("./PointerEvent.js").default} The wrapped event.
|
||||
*/
|
||||
wrapMouseEvent(eventType, event) {
|
||||
const pointerEvent = this.makeEvent(
|
||||
|
||||
@@ -51,7 +51,7 @@ const POINTER_TYPE = 'touch';
|
||||
* Handler for `touchstart`, triggers `pointerover`,
|
||||
* `pointerenter` and `pointerdown` events.
|
||||
*
|
||||
* @this {module:ol/pointer/TouchSource}
|
||||
* @this {import("./TouchSource.js").default}
|
||||
* @param {TouchEvent} inEvent The in event.
|
||||
*/
|
||||
function touchstart(inEvent) {
|
||||
@@ -65,7 +65,7 @@ function touchstart(inEvent) {
|
||||
/**
|
||||
* Handler for `touchmove`.
|
||||
*
|
||||
* @this {module:ol/pointer/TouchSource}
|
||||
* @this {import("./TouchSource.js").default}
|
||||
* @param {TouchEvent} inEvent The in event.
|
||||
*/
|
||||
function touchmove(inEvent) {
|
||||
@@ -76,7 +76,7 @@ function touchmove(inEvent) {
|
||||
* Handler for `touchend`, triggers `pointerup`,
|
||||
* `pointerout` and `pointerleave` events.
|
||||
*
|
||||
* @this {module:ol/pointer/TouchSource}
|
||||
* @this {import("./TouchSource.js").default}
|
||||
* @param {TouchEvent} inEvent The event.
|
||||
*/
|
||||
function touchend(inEvent) {
|
||||
@@ -88,7 +88,7 @@ function touchend(inEvent) {
|
||||
* Handler for `touchcancel`, triggers `pointercancel`,
|
||||
* `pointerout` and `pointerleave` events.
|
||||
*
|
||||
* @this {module:ol/pointer/TouchSource}
|
||||
* @this {import("./TouchSource.js").default}
|
||||
* @param {TouchEvent} inEvent The in event.
|
||||
*/
|
||||
function touchcancel(inEvent) {
|
||||
@@ -99,8 +99,8 @@ function touchcancel(inEvent) {
|
||||
class TouchSource extends EventSource {
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher The event handler.
|
||||
* @param {module:ol/pointer/MouseSource} mouseSource Mouse source.
|
||||
* @param {import("./PointerEventHandler.js").default} dispatcher The event handler.
|
||||
* @param {import("./MouseSource.js").default} mouseSource Mouse source.
|
||||
*/
|
||||
constructor(dispatcher, mouseSource) {
|
||||
const mapping = {
|
||||
@@ -119,7 +119,7 @@ class TouchSource extends EventSource {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/pointer/MouseSource}
|
||||
* @type {import("./MouseSource.js").default}
|
||||
*/
|
||||
this.mouseSource = mouseSource;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user