Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(usePointerSwipe)!: rename type PointerSwipeOptions to UsePointerSwipeOptions and PointerSwipeReturn to UsePointerSwipeReturn #1886

Merged
merged 1 commit into from Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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