Skip to content

Commit

Permalink
fix(usePointerSwipe)!: rename type PointerSwipeOptions to `UsePoint…
Browse files Browse the repository at this point in the history
…erSwipeOptions` and `PointerSwipeReturn` to `UsePointerSwipeReturn` (#1886)
  • Loading branch information
okxiaoliang4 committed Jul 13, 2022
1 parent e4b5bf2 commit 81ff5b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/core/usePointerSwipe/index.test.ts
@@ -1,5 +1,5 @@
import { SwipeDirection } from '../useSwipe'
import type { PointerSwipeOptions } from './index'
import type { UsePointerSwipeOptions } from './index'
import { usePointerSwipe } from './index'

const mockPointerEventInit = (x: number, y: number): PointerEventInit => ({
Expand Down Expand Up @@ -34,7 +34,7 @@ describe('usePointerSwipe', () => {
let onSwipe: any
let onSwipeEnd: any

const options = (): PointerSwipeOptions => ({
const options = (): UsePointerSwipeOptions => ({
threshold,
onSwipeStart,
onSwipe,
Expand Down
8 changes: 4 additions & 4 deletions packages/core/usePointerSwipe/index.ts
Expand Up @@ -6,7 +6,7 @@ import { useEventListener } from '../useEventListener'
import { SwipeDirection } from '../useSwipe/index'
import type { PointerType, Position } from '../types'

export interface PointerSwipeOptions {
export interface UsePointerSwipeOptions {
/**
* @default 50
*/
Expand Down Expand Up @@ -35,7 +35,7 @@ export interface PointerSwipeOptions {
pointerTypes?: PointerType[]
}

export interface PointerSwipeReturn {
export interface UsePointerSwipeReturn {
readonly isSwiping: Ref<boolean>
direction: Readonly<Ref<SwipeDirection | null>>
readonly posStart: Position
Expand All @@ -54,8 +54,8 @@ export interface PointerSwipeReturn {
*/
export function usePointerSwipe(
target: MaybeComputedRef<HTMLElement | null | undefined>,
options: PointerSwipeOptions = {},
): PointerSwipeReturn {
options: UsePointerSwipeOptions = {},
): UsePointerSwipeReturn {
const targetRef = resolveRef(target)
const {
threshold = 50,
Expand Down

0 comments on commit 81ff5b4

Please sign in to comment.