1- import type { ActionDefaults } from '@interactjs/core/options'
21import type {
32 Element ,
43 EdgeOptions ,
@@ -14,6 +13,8 @@ import { warnOnce, copyAction } from '@interactjs/utils/misc'
1413import * as pointerUtils from '@interactjs/utils/pointerUtils'
1514import * as rectUtils from '@interactjs/utils/rect'
1615
16+ import type { ActionDefaults } from '@interactjs/core/options'
17+
1718import type { EventPhase } from './InteractEvent'
1819import { InteractEvent } from './InteractEvent'
1920import type { Interactable } from './Interactable'
@@ -110,18 +111,18 @@ let idCounter = 0
110111
111112export class Interaction < T extends ActionName | null = ActionName > {
112113 // current interactable being interacted with
113- interactable : Interactable = null
114+ interactable : Interactable | null = null
114115
115116 // the target element of the interactable
116- element : Element = null
117- rect : FullRect
117+ element : Element | null = null
118+ rect : FullRect | null = null
118119 _rects ?: {
119120 start : FullRect
120121 corrected : FullRect
121122 previous : FullRect
122123 delta : FullRect
123124 }
124- edges : EdgeOptions
125+ edges : EdgeOptions | null = null
125126
126127 _scopeFire : Scope [ 'fire' ]
127128
@@ -138,7 +139,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
138139 pointers : PointerInfo [ ] = [ ]
139140
140141 // pointerdown/mousedown/touchstart event
141- downEvent : PointerEventType = null
142+ downEvent : PointerEventType | null = null
142143
143144 downPointer : PointerType = { } as PointerType
144145
@@ -160,7 +161,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
160161 _interacting = false
161162 _ending = false
162163 _stopped = true
163- _proxy : InteractionProxy < T > = null
164+ _proxy : InteractionProxy < T > | null = null
164165
165166 simulation = null
166167
@@ -227,7 +228,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
227228 pointerIndex,
228229 pointerInfo,
229230 type : 'down' ,
230- interaction : ( this as unknown ) as Interaction < never > ,
231+ interaction : this as unknown as Interaction < never > ,
231232 } )
232233 }
233234
@@ -324,7 +325,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
324325 dx,
325326 dy,
326327 duplicate : duplicateMove ,
327- interaction : ( this as unknown ) as Interaction < never > ,
328+ interaction : this as unknown as Interaction < never > ,
328329 }
329330
330331 if ( ! duplicateMove ) {
@@ -403,7 +404,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
403404 eventTarget,
404405 type : type as any ,
405406 curEventTarget,
406- interaction : ( this as unknown ) as Interaction < never > ,
407+ interaction : this as unknown as Interaction < never > ,
407408 } )
408409
409410 if ( ! this . simulation ) {
@@ -418,7 +419,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
418419 this . _scopeFire ( 'interactions:blur' , {
419420 event,
420421 type : 'blur' ,
421- interaction : ( this as unknown ) as Interaction < never > ,
422+ interaction : this as unknown as Interaction < never > ,
422423 } )
423424 }
424425
@@ -538,7 +539,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
538539 down,
539540 pointerInfo,
540541 pointerIndex,
541- interaction : ( this as unknown ) as Interaction < never > ,
542+ interaction : this as unknown as Interaction < never > ,
542543 } )
543544
544545 return pointerIndex
@@ -557,7 +558,7 @@ export class Interaction<T extends ActionName | null = ActionName> {
557558 eventTarget : null ,
558559 pointerIndex,
559560 pointerInfo,
560- interaction : ( this as unknown ) as Interaction < never > ,
561+ interaction : this as unknown as Interaction < never > ,
561562 } )
562563
563564 this . pointers . splice ( pointerIndex , 1 )
0 commit comments