@@ -14,8 +14,10 @@ export const isTouch: boolean = typeof window !== 'undefined' && typeof document
1414( 'ontouchstart' in document
1515 || 'ontouchstart' in window
1616 // || !!window.TouchEvent // true on Windows 10 Chrome desktop so don't use this
17+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1718 || ( ( window as any ) . DocumentTouch && document instanceof ( window as any ) . DocumentTouch )
1819 || navigator . maxTouchPoints > 0
20+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1921 || ( navigator as any ) . msMaxTouchPoints > 0
2022) ;
2123
@@ -114,7 +116,7 @@ function simulatePointerMouseEvent(e: PointerEvent, simulatedType: string) {
114116 * Handle the touchstart events
115117 * @param {Object } e The widget element's touchstart event
116118 */
117- export function touchstart ( e : TouchEvent ) {
119+ export function touchstart ( e : TouchEvent ) : void {
118120 // Ignore the event if another widget is already being handled
119121 if ( DDTouch . touchHandled ) return ; DDTouch . touchHandled = true ;
120122
@@ -128,7 +130,7 @@ export function touchstart(e: TouchEvent) {
128130 * Handle the touchmove events
129131 * @param {Object } e The document's touchmove event
130132 */
131- export function touchmove ( e : TouchEvent ) {
133+ export function touchmove ( e : TouchEvent ) : void {
132134 // Ignore event if not handled by us
133135 if ( ! DDTouch . touchHandled ) return ;
134136
@@ -139,7 +141,7 @@ export function touchmove(e: TouchEvent) {
139141 * Handle the touchend events
140142 * @param {Object } e The document's touchend event
141143 */
142- export function touchend ( e : TouchEvent ) {
144+ export function touchend ( e : TouchEvent ) : void {
143145
144146 // Ignore event if not handled
145147 if ( ! DDTouch . touchHandled ) return ;
@@ -170,11 +172,11 @@ export function touchend(e: TouchEvent) {
170172 * see https://stackoverflow.com/questions/27908339/js-touch-equivalent-for-mouseenter
171173 * so instead of PointerEvent to still get enter/leave and send the matching mouse event.
172174 */
173- export function pointerdown ( e : PointerEvent ) {
175+ export function pointerdown ( e : PointerEvent ) : void {
174176 ( e . target as HTMLElement ) . releasePointerCapture ( e . pointerId ) // <- Important!
175177}
176178
177- export function pointerenter ( e : PointerEvent ) {
179+ export function pointerenter ( e : PointerEvent ) : void {
178180 // ignore the initial one we get on pointerdown on ourself
179181 if ( ! DDManager . dragElement ) {
180182 // console.log('pointerenter ignored');
@@ -184,7 +186,7 @@ export function pointerenter(e: PointerEvent) {
184186 simulatePointerMouseEvent ( e , 'mouseenter' ) ;
185187}
186188
187- export function pointerleave ( e : PointerEvent ) {
189+ export function pointerleave ( e : PointerEvent ) : void {
188190 // ignore the leave on ourself we get before releasing the mouse over ourself
189191 // by delaying sending the event and having the up event cancel us
190192 if ( ! DDManager . dragElement ) {
0 commit comments