-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.d.ts
104 lines (96 loc) · 3.23 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
declare module "@sekizlipenguen/react-native-popup-confirm-toast" {
import {FC, ReactNode} from "react";
import {LayoutChangeEvent, StyleProp, TextStyle, ViewStyle} from "react-native";
// Toast Config
export interface ToastConfig {
title?: string;
text?: string;
titleTextStyle?: StyleProp<TextStyle>;
descTextStyle?: StyleProp<TextStyle>;
backgroundColor?: string;
timeColor?: string;
position?: "top" | "bottom";
icon?: FC | ReactNode;
timing?: number;
statusBarType?: "default" | "dark-content" | "light-content";
statusBarTranslucent?: boolean;
statusBarHidden?: boolean;
statusBarAndroidHidden?: boolean;
statusBarAppleHidden?: boolean;
hiddenDuration?: number;
startDuration?: number;
onOpen?: () => void;
onOpenComplete?: () => void;
onClose?: () => void;
onCloseComplete?: () => void;
}
// Popup Config
export interface PopupConfig {
title?: string;
textBody?: string;
type?: "success" | "info" | "danger" | "warning" | "confirm";
buttonText?: string;
confirmText?: string;
cancelCallback?: () => void;
callback?: () => void;
icon?: FC | ReactNode;
iconHeaderStyle?: StyleProp<ViewStyle>;
containerStyle?: StyleProp<ViewStyle>;
modalContainerStyle?: StyleProp<ViewStyle>;
background?: string;
bodyComponent?: FC<{ popupProps: any; onLayout?: (event: LayoutChangeEvent) => void }>;
bodyComponentForce?: boolean;
timing?: number;
onOpen?: () => void;
onOpenComplete?: () => void;
onClose?: () => void;
onCloseComplete?: () => void;
}
// Sheet Config
export interface SheetConfig {
background?: string;
height?: number;
duration?: number;
closeDuration?: number;
closeOnDragDown?: boolean;
closeOnPressMask?: boolean;
closeOnPressBack?: boolean;
dragTopOnly?: boolean;
component?: FC<{ sheetProps: any }>;
onOpen?: () => void;
onOpenComplete?: () => void;
onClose?: () => void;
onCloseComplete?: () => void;
customStyles?: {
draggableIcon?: StyleProp<ViewStyle>;
container?: StyleProp<ViewStyle>;
draggableContainer?: StyleProp<ViewStyle>;
};
timing?: number;
keyboardHeightAdjustment?: boolean;
}
export interface Toast {
show: (config: ToastConfig) => void;
hide: () => void;
}
export interface Popup {
show: (config: PopupConfig) => void;
hide: () => void;
}
export interface SPSheet {
show: (config: SheetConfig) => void;
hide: () => void;
setHeight: (height: number, onComplete?: () => void) => void;
}
// Root Props Definition
export interface RootProps {
children?: ReactNode;
style?: StyleProp<ViewStyle>;
}
export const Toast: Toast;
export const Popup: Popup;
export const SPSheet: SPSheet;
export const Root: FC<RootProps>;
export const getStatusBarHeight: () => number;
export const isIPhoneWithMonobrow: () => boolean;
}