forked from troberts-28/react-native-timer-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
52 lines (47 loc) · 1.61 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
import type { MutableRefObject } from "react";
import type { View, TouchableOpacity, Text } from "react-native";
import type Modal from "../Modal";
import type { TimerPickerProps } from "../TimerPicker/types";
import type { CustomTimerPickerModalStyles } from "./styles";
export interface TimerPickerModalRef {
latestDuration: {
hours: MutableRefObject<number> | undefined;
minutes: MutableRefObject<number> | undefined;
seconds: MutableRefObject<number> | undefined;
};
reset: (options?: { animated?: boolean }) => void;
setValue: (
value: {
hours: number;
minutes: number;
seconds: number;
},
options?: { animated?: boolean }
) => void;
}
export interface TimerPickerModalProps extends TimerPickerProps {
buttonContainerProps?: React.ComponentProps<typeof View>;
buttonTouchableOpacityProps?: React.ComponentProps<typeof TouchableOpacity>;
cancelButtonText?: string;
closeOnOverlayPress?: boolean;
confirmButtonText?: string;
containerProps?: React.ComponentProps<typeof View>;
contentContainerProps?: React.ComponentProps<typeof View>;
hideCancelButton?: boolean;
modalProps?: React.ComponentProps<typeof Modal>;
modalTitle?: string;
modalTitleProps?: React.ComponentProps<typeof Text>;
onCancel?: () => void;
onConfirm: ({
hours,
minutes,
seconds,
}: {
hours: number;
minutes: number;
seconds: number;
}) => void;
setIsVisible: (isVisible: boolean) => void;
styles?: CustomTimerPickerModalStyles;
visible: boolean;
}