Skip to content

Commit

Permalink
feat(core): introduce SwipeEvent type extending MovementEvent
Browse files Browse the repository at this point in the history
Added the SwipeEvent type in the swiperia-core package, extending the MovementEvent to include additional properties specific to swipe interactions, such as the original UI event and the swipe phase (start, move, end). This enhancement facilitates more granular event handling during swipe gestures.
  • Loading branch information
samavati committed Apr 13, 2024
1 parent deb980a commit d865e4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/swiperia-core/src/lib/event/SwipeEvent.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { MovementEvent } from '../movement/MovementEvent.type';

export interface SwipeEvent extends MovementEvent {
/**
* original touch event from element
*/
event: UIEvent;
/**
* type of the event
*/
type: 'start' | 'move' | 'end';
}
1 change: 1 addition & 0 deletions packages/swiperia-core/src/lib/event/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type { SwipeEvent } from './SwipeEvent.type';

0 comments on commit d865e4b

Please sign in to comment.