@hscmap/inertial-mouse
Advanced tools
Comparing version 3.4.0 to 3.5.0
@@ -11,5 +11,5 @@ import { V2 } from "./v2"; | ||
readonly clientCoord: V2; | ||
static onStart(target: HTMLElement | Document, cb: (e: SinglePointEvent) => void): () => void; | ||
static onMove(target: HTMLElement | Document, cb: (e: SinglePointEvent) => void): () => void; | ||
static onEnd(target: HTMLElement | Document, cb: (e: SinglePointEvent) => void): () => void; | ||
static onStart(target: HTMLElement | Document, cb: (e: SinglePointEvent) => void, useCapture?: boolean): () => void; | ||
static onMove(target: HTMLElement | Document, cb: (e: SinglePointEvent) => void, useCapture?: boolean): () => void; | ||
static onEnd(target: HTMLElement | Document, cb: (e: SinglePointEvent) => void, useCapture?: boolean): () => void; | ||
originalEvent({ mouse, touch }: Partial<{ | ||
@@ -16,0 +16,0 @@ mouse: (e: MouseEvent) => void; |
@@ -45,3 +45,4 @@ "use strict"; | ||
}); | ||
SinglePointEvent.onStart = function (target, cb) { | ||
SinglePointEvent.onStart = function (target, cb, useCapture) { | ||
if (useCapture === void 0) { useCapture = false; } | ||
var mouse = function (e) { | ||
@@ -55,10 +56,11 @@ cb(new SinglePointEvent(e)); | ||
}; | ||
target.addEventListener('mousedown', mouse); | ||
target.addEventListener('touchstart', touch); | ||
target.addEventListener('mousedown', mouse, useCapture); | ||
target.addEventListener('touchstart', touch, useCapture); | ||
return function () { | ||
target.removeEventListener('mousedown', mouse); | ||
target.removeEventListener('touchstart', touch); | ||
target.removeEventListener('mousedown', mouse, useCapture); | ||
target.removeEventListener('touchstart', touch, useCapture); | ||
}; | ||
}; | ||
SinglePointEvent.onMove = function (target, cb) { | ||
SinglePointEvent.onMove = function (target, cb, useCapture) { | ||
if (useCapture === void 0) { useCapture = false; } | ||
var mouse = function (e) { | ||
@@ -70,10 +72,11 @@ cb(new SinglePointEvent(e)); | ||
}; | ||
target.addEventListener('mousemove', mouse); | ||
target.addEventListener('touchmove', touch); | ||
target.addEventListener('mousemove', mouse, useCapture); | ||
target.addEventListener('touchmove', touch, useCapture); | ||
return function () { | ||
target.removeEventListener('mousemove', mouse); | ||
target.removeEventListener('touchend', touch); | ||
target.removeEventListener('mousemove', mouse, useCapture); | ||
target.removeEventListener('touchend', touch, useCapture); | ||
}; | ||
}; | ||
SinglePointEvent.onEnd = function (target, cb) { | ||
SinglePointEvent.onEnd = function (target, cb, useCapture) { | ||
if (useCapture === void 0) { useCapture = false; } | ||
var mouse = function (e) { | ||
@@ -86,7 +89,7 @@ cb(new SinglePointEvent(e)); | ||
}; | ||
target.addEventListener('mouseup', mouse); | ||
target.addEventListener('touchend', touch); | ||
target.addEventListener('mouseup', mouse, useCapture); | ||
target.addEventListener('touchend', touch, useCapture); | ||
return function () { | ||
target.removeEventListener('mouseup', mouse); | ||
target.removeEventListener('touchend', touch); | ||
target.removeEventListener('mouseup', mouse, useCapture); | ||
target.removeEventListener('touchend', touch, useCapture); | ||
}; | ||
@@ -93,0 +96,0 @@ }; |
{ | ||
"name": "@hscmap/inertial-mouse", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"main": "./lib/index.js", | ||
@@ -8,3 +8,3 @@ "types": "./lib/index.d.ts", | ||
"prepare": "tsc", | ||
"example-server": "webpack-dev-server --context example --config ./example/webpack.config.js --mode development --host 0.0.0.0", | ||
"example-server": "webpack-dev-server --context example --config ./example/webpack.config.js --mode development --host 0.0.0.0 --disableHostCheck", | ||
"example": "webpack --context example --config ./example/webpack.config.js --mode development" | ||
@@ -11,0 +11,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19783
498