forked from gorhom/react-native-bottom-sheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
73 lines (68 loc) · 1.71 KB
/
types.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
import type { FC } from 'react';
import type { FlatList, ScrollView, SectionList } from 'react-native';
import type { BottomSheetProps } from './components/bottomSheet';
import type { BottomSheetOverlayProps } from './components/overlay';
export type BottomSheetMethods = {
/**
* Snap to one of the provided points from `snapPoints`.
* @type (index: number) => void
*/
snapTo: (index: number) => void;
/**
* Snap to the maximum provided point from `snapPoints`.
* @type () => void
*/
expand: () => void;
/**
* Snap to the minimum provided point from `snapPoints`.
* @type () => void
*/
collapse: () => void;
/**
* Close the bottom sheet.
* @type () => void
*/
close: () => void;
};
export type Scrollable = FlatList | ScrollView | SectionList;
export type ScrollableType = 'FlatList' | 'ScrollView' | 'SectionList' | 'View';
export type ScrollableRef = {
id: number;
node: Scrollable;
type: ScrollableType;
};
/**
* Modal types
*/
export type BottomSheetModalConfigs = {
/**
* Allow touch through overlay component.
* @type boolean
* @default false
*/
allowTouchThroughOverlay?: boolean;
/**
* Overlay component.
* @type (props: [BottomSheetOverlayProps](./components/overlay/types.d.ts)) => ReactNode
* @default null
*/
overlayComponent?: FC<BottomSheetOverlayProps>;
/**
* Overlay opacity.
* @type number
* @default 0.5
*/
overlayOpacity?: number;
/**
* Dismiss modal when press on overlay.
* @type boolean
* @default true
*/
dismissOnOverlayPress?: boolean;
/**
* Dismiss modal when scroll down.
* @type boolean
* @default true
*/
dismissOnScrollDown?: boolean;
} & Omit<BottomSheetProps, 'children'>;