1 | import * as React from 'react';
|
2 | import { Component } from 'react';
|
3 | import { Animated, StyleProp, ViewStyle } from 'react-native';
|
4 | import { PanGestureHandlerProps } from '../handlers/gestureHandlers';
|
5 | declare type SwipeableExcludes = Exclude<keyof PanGestureHandlerProps, 'onGestureEvent' | 'onHandlerStateChange'>;
|
6 | interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableExcludes> {
|
7 | enableTrackpadTwoFingerGesture?: boolean;
|
8 | friction?: number;
|
9 | leftThreshold?: number;
|
10 | rightThreshold?: number;
|
11 | overshootLeft?: boolean;
|
12 | overshootRight?: boolean;
|
13 | overshootFriction?: number;
|
14 | onSwipeableLeftOpen?: () => void;
|
15 | onSwipeableRightOpen?: () => void;
|
16 | onSwipeableOpen?: () => void;
|
17 | onSwipeableClose?: () => void;
|
18 | onSwipeableLeftWillOpen?: () => void;
|
19 | onSwipeableRightWillOpen?: () => void;
|
20 | onSwipeableWillOpen?: () => void;
|
21 | onSwipeableWillClose?: () => void;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | renderLeftActions?: (progressAnimatedValue: Animated.AnimatedInterpolation, dragAnimatedValue: Animated.AnimatedInterpolation) => React.ReactNode;
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | renderRightActions?: (progressAnimatedValue: Animated.AnimatedInterpolation, dragAnimatedValue: Animated.AnimatedInterpolation) => React.ReactNode;
|
44 | useNativeAnimations?: boolean;
|
45 | animationOptions?: Record<string, unknown>;
|
46 | containerStyle?: StyleProp<ViewStyle>;
|
47 | childrenContainerStyle?: StyleProp<ViewStyle>;
|
48 | }
|
49 | declare type SwipeableState = {
|
50 | dragX: Animated.Value;
|
51 | rowTranslation: Animated.Value;
|
52 | rowState: number;
|
53 | leftWidth?: number;
|
54 | rightOffset?: number;
|
55 | rowWidth?: number;
|
56 | };
|
57 | export default class Swipeable extends Component<SwipeableProps, SwipeableState> {
|
58 | static defaultProps: {
|
59 | friction: number;
|
60 | overshootFriction: number;
|
61 | useNativeAnimations: boolean;
|
62 | };
|
63 | constructor(props: SwipeableProps);
|
64 | UNSAFE_componentWillUpdate(props: SwipeableProps, state: SwipeableState): void;
|
65 | private onGestureEvent?;
|
66 | private transX?;
|
67 | private showLeftAction?;
|
68 | private leftActionTranslate?;
|
69 | private showRightAction?;
|
70 | private rightActionTranslate?;
|
71 | private updateAnimatedEvent;
|
72 | private onTapHandlerStateChange;
|
73 | private onHandlerStateChange;
|
74 | private handleRelease;
|
75 | private animateRow;
|
76 | private onRowLayout;
|
77 | private currentOffset;
|
78 | close: () => void;
|
79 | openLeft: () => void;
|
80 | openRight: () => void;
|
81 | render(): JSX.Element;
|
82 | }
|
83 | export {};
|