-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): define SwipeCallback and SwipeConfig types
Introduced the SwipeCallback type to handle swipe events and the SwipeConfig type to configure swipe behavior in the swiperia-core package. These types will facilitate customized swipe handling and configuration, enhancing the library's flexibility and usability.
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import type { SwipeEvent } from '../event/SwipeEvent.type'; | ||
|
||
export type SwipeCallback = (event: SwipeEvent) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export type SwipeConfig = { | ||
/** | ||
* required min distance(px) traveled to be considered swipe | ||
*/ | ||
threshold?: number; | ||
/** | ||
* prevents scroll during swipe | ||
*/ | ||
preventScrollOnSwipe?: boolean; | ||
/** | ||
* maximum time(ms) allowed to travel that distance | ||
*/ | ||
allowedTime?: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export type { SwipeConfig } from './SwipeConfig.type'; | ||
export type { SwipeCallback } from './SwipeCallback.type'; |