forked from alexbrillant/react-native-deck-swiper
-
Notifications
You must be signed in to change notification settings - Fork 84
/
index.d.ts
87 lines (85 loc) · 3.39 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
declare module 'react-native-deck-swiper' {
import {StyleProp, ViewStyle} from 'react-native';
export interface SwiperProps<T> {
animateCardOpacity?: boolean;
animateOverlayLabelsOpacity?: boolean;
backgroundColor?: string;
cardHorizontalMargin?: number;
cardIndex?: number;
cards: T[];
cardStyle?: number | object;
cardVerticalMargin?: number;
childrenOnTop?: boolean;
containerStyle?: object;
disableBottomSwipe?: boolean;
disableLeftSwipe?: boolean;
disableRightSwipe?: boolean;
disableTopSwipe?: boolean;
horizontalSwipe?: boolean;
horizontalThreshold?: number;
goBackToPreviousCardOnSwipeBottom?: boolean;
goBackToPreviousCardOnSwipeLeft?: boolean;
goBackToPreviousCardOnSwipeRight?: boolean;
goBackToPreviousCardOnSwipeTop?: boolean;
infinite?: boolean;
inputCardOpacityRangeX?: [number, number, number, number, number];
inputCardOpacityRangeY?: [number, number, number, number, number];
inputOverlayLabelsOpacityRangeX?: [number, number, number, number, number];
inputOverlayLabelsOpacityRangeY?: [number, number, number, number, number];
inputRotationRange?: [number, number, number];
keyExtractor?: (cardData: T) => string;
marginBottom?: number;
marginTop?: number;
onSwiped?: (cardIndex: number) => void;
onSwipedAborted?: () => void;
onSwipedAll?: () => void;
onSwipedBottom?: (cardIndex: number) => void;
onSwipedLeft?: (cardIndex: number) => void;
onSwipedRight?: (cardIndex: number) => void;
onSwipedTop?: (cardIndex: number) => void;
onSwiping?: (x: number, y: number) => void;
onTapCard?: (cardIndex: number) => void;
onTapCardDeadZone?: number;
outputCardOpacityRangeX?: [number, number, number, number, number];
outputCardOpacityRangeY?: [number, number, number, number, number];
outputOverlayLabelsOpacityRangeX?: [number, number, number];
outputOverlayLabelsOpacityRangeY?: [number, number, number];
outputRotationRange?: [string, string, string];
overlayLabels?: object;
overlayLabelStyle?: StyleProp<ViewStyle>;
overlayLabelWrapperStyle?: StyleProp<ViewStyle>;
overlayOpacityHorizontalThreshold?: number;
overlayOpacityVerticalThreshold?: number;
pointerEvents?: string;
previousCardDefaultPositionX?: number;
previousCardDefaultPositionY?: number;
renderCard: (cardData: T, cardIndex: number) => JSX.Element | null;
secondCardZoom?: number;
showSecondCard?: boolean;
stackAnimationFriction?: number;
stackAnimationTension?: number;
stackScale?: number;
stackSeparation?: number;
stackSize?: number;
swipeAnimationDuration?: number;
swipeBackCard?: boolean;
testID?: string;
topCardResetAnimationFriction?: number;
topCardResetAnimationTension?: number;
useViewOverflow?: boolean;
verticalSwipe?: boolean;
verticalThreshold?: number;
zoomAnimationDuration?: number;
zoomFriction?: number;
}
export default class Swiper<T> extends React.Component<SwiperProps<T>> {
swipeLeft: (mustDecrementCardIndex?: boolean) => void;
swipeRight: (mustDecrementCardIndex?: boolean) => void;
swipeTop: (mustDecrementCardIndex?: boolean) => void;
swipeBottom: (mustDecrementCardIndex?: boolean) => void;
jumpToCardIndex: (cardIndex: number) => void;
swipeBack: (
cb?: (previousCardIndex: number, previousCard: T) => void
) => void;
}
}