-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
79 lines (73 loc) · 1.97 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
import { ReactElement } from "react";
import { StyleProp, ViewStyle } from "react-native";
interface Configurations {
/**
* Height of the bottom sheet.
*/
height?: number;
/**
* to hide the handle of the bottom sheet.
*/
hideHandle?: boolean;
/**
* to hide the background of the bottom sheet.
*/
hideBackground?: boolean;
/**
* to change the background color of the bottom sheet.
*/
backgroundColor?: string;
/**
* to change the container style of the bottom sheet.
*/
containerStyle?: StyleProp<ViewStyle>;
}
interface BottomSheetContextProps {
/**
* Call this function to show the bottom sheet.
* Don't forget to pass your ```component``` as argument to show in the bottom sheet.
*
* If you are passing a ```FlatList``` or ```ScrollView``` to the bottom sheet, make sure to import them from ```react-native-gesture-handler```.
*/
show: (component: React.ReactNode, config?: Configurations) => void;
/**
* Call this function to hide the bottom sheet.
*/
hide: () => void;
}
export interface BottomSheetProviderProps {
children: ReactElement;
/**
* to hide the handle of the bottom sheet.
*/
hideHandle?: boolean;
/**
* to hide the background of the bottom sheet.
*/
hideBackground?: boolean;
/**
* to change the background color of the bottom sheet.
*/
backgroundColor?: string;
/**
* to change the container style of the bottom sheet.
*/
containerStyle?: StyleProp<ViewStyle>;
/**
* Height of the bottom sheet.
*/
height?: number;
}
declare const SnackBarProvider: React.FC<BottomSheetProviderProps>;
declare const useSnackBar: () => {
/**
* To show the SnackBar component
* @param message Message to be displayed in the SnackBar
* @param type Type of the SnackBar. Can be "error", "success" or "info"
*/
showSnackBar: (message: string, type: "error" | "success" | "info") => void;
/**
* To hide the SnackBar component
*/
hideSnackBar: () => void;
};