-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.d.ts
65 lines (57 loc) · 1.65 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
import {ForwardRefExoticComponent, ReactNode, Ref} from 'react';
import {ViewStyle} from 'react-native/types';
export type SnapToPosition = (
sheetHeight: number,
config?: SnapToPositionConfig,
) => void;
export type UseBottomDrawerKeyboard = {keyboardOpen: boolean};
export interface BottomDrawerMethods {
open(sheetHeight?: number): void;
close(): void;
snapToPosition: SnapToPosition;
snapToIndex: (index: number) => void;
}
export interface BottomDrawerWithRef extends BottomDrawerProps {
ref: Ref<BottomDrawerMethods>;
}
export type BottomDrawerProps = {
onBackdropPress?: () => void;
openDuration?: number;
closeDuration?: number;
closeOnDragDown?: boolean;
closeOnBackdropPress?: boolean;
closeOnPressBack?: boolean;
customStyles?: {
handle?: ViewStyle;
handleContainer?: ViewStyle;
container?: ViewStyle;
};
onClose?: () => void;
onOpen?: () => void;
onBackPress?: () => void;
children: ReactNode;
openOnMount?: boolean;
initialHeight?: number;
backdropOpacity?: number;
backdropColor?: string;
snapPoints?: number[];
initialIndex?: number;
enableSnapping?: boolean;
gestureMode?: 'content' | 'handle' | 'none';
overDrag?: boolean;
safeTopOffset?: number;
// enableDragWhenKeyboardOpened?: boolean;
};
export type SnapToPositionConfig = {
resetLastPosition?: boolean;
};
export type UseKeyboardDrawerProps = {
modalVisible: boolean;
lastPosition: {current: number};
handleSnapToPosition: SnapToPosition;
safeTopOffset: number;
};
declare const BottomDrawer: ForwardRefExoticComponent<
Omit<BottomDrawerWithRef, 'ref'> & React.RefAttributes<BottomDrawerMethods>
>;
export default BottomDrawer;