-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathindex.d.ts
56 lines (56 loc) · 1.76 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
/**
* * https://github.com/tongyy/react-native-draggable
*
*/
import React from 'react';
import { GestureResponderEvent, PanResponderGestureState } from 'react-native';
export interface IDraggableProps {
/**** props that should probably be removed in favor of "children" */
renderText?: string;
isCircle?: boolean;
renderSize?: number;
imageSource?: number;
renderColor?: string;
/**** */
children?: React.ReactNode;
shouldReverse?: boolean;
disabled?: boolean;
debug?: boolean;
animatedViewProps?: object;
touchableOpacityProps?: object;
onDrag?: (event: GestureResponderEvent, gestureState: PanResponderGestureState) => void;
onShortPressRelease?: (event: GestureResponderEvent) => void;
onDragRelease?: (event: GestureResponderEvent, gestureState: PanResponderGestureState, bounds:
{left: number, top: number, right: number, bottom: number}) => void;
onLongPress?: (event: GestureResponderEvent) => void;
onPressIn?: (event: GestureResponderEvent) => void;
onPressOut?: (event: GestureResponderEvent) => void;
onRelease?: (event: GestureResponderEvent, wasDragging: boolean) => void;
onReverse?: () => {x: number, y: number};
x?: number;
y?: number;
z?: number;
minX?: number;
minY?: number;
maxX?: number;
maxY?: number;
}
declare function Draggable(props: IDraggableProps): JSX.Element;
Draggable.defaultProps = {
renderText: '+',
renderSize: 36,
shouldReverse: false,
disabled: false,
debug: false,
onDrag: () => {},
onShortPressRelease: () => {},
onDragRelease: () => {},
onLongPress: () => {},
onPressIn: () => {},
onPressOut: () => {},
onRelease: () => {},
x: 0,
y: 0,
z: 1,
}
export default Draggable;