Skip to content

Commit 3b70125

Browse files
MichielDeMeymmazzarolo
authored andcommitted
fix: Updated TypeScript definitions for v8.0.0 (#307)
1 parent 0397d15 commit 3b70125

File tree

1 file changed

+7
-61
lines changed

1 file changed

+7
-61
lines changed

typings/index.d.ts

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// Type definitions for react-native-modal-datetime-picker
22
// Project: https://github.com/mmazzarolo/react-native-modal-datetime-picker
3-
// Definitions by: Kyle Roach <https://github.com/iRoachie>
3+
// Definitions by:
4+
// Kyle Roach <https://github.com/iRoachie>
5+
// Michiel De Mey <https://github.com/MichielDeMey>
46
// TypeScript Version: 2.3.2
57

68
import * as React from "react";
79
import { ViewStyle, TextStyle } from "react-native";
8-
import { ModalProps } from "react-native-modal";
9-
10-
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
11-
type ReactNativeModalProps = Omit<ModalProps, "children" | "isVisible">;
1210

1311
interface DateTimePickerProps {
1412
/**
@@ -52,65 +50,20 @@ interface DateTimePickerProps {
5250
*/
5351
cancelButtonContainerStyleIOS?: ViewStyle;
5452

55-
/**
56-
* Ref function for the React Native DatePickerIOS or a customDatePickerIOS
57-
*/
58-
pickerRefCb?(ref: any): void;
59-
60-
/**
61-
* Props for ReactNativeModal
62-
*/
63-
reactNativeModalPropsIOS?: ReactNativeModalProps;
64-
6553
/**
6654
* A custom style for the titleIOS (Default is 'Pick a Date')
6755
*/
6856
titleStyle?: TextStyle;
6957

70-
/**
71-
* A custom style for the confirmTextIOS (Default is 'Confirm')
72-
*
73-
* Doesn't work with the customConfirmButtonIOS
74-
*/
75-
confirmTextStyle?: TextStyle;
76-
77-
/**
78-
* A custom style for cancelTextIOS (Default is 'Cancel')
79-
*
80-
* Doesn't work with the customCancelButtonIOS
81-
*/
82-
cancelTextStyle?: TextStyle;
83-
84-
/**
85-
* Never disable the confirm button on iOS, even on fling (see #82)
86-
*
87-
* Default is false
88-
*/
89-
neverDisableConfirmIOS?: boolean;
90-
9158
/**
9259
* A custom component for the title container on iOS
9360
*/
94-
customTitleContainerIOS?: JSX.Element;
95-
96-
/**
97-
* Dismiss the date-picker/time-picker when pressing on the backdrop (on iOS)?
98-
*
99-
* Default is true
100-
*/
101-
dismissOnBackdropPressIOS?: boolean;
102-
103-
/**
104-
* Hide the title container on iOS
105-
*
106-
* Default is false
107-
*/
108-
hideTitleContainerIOS?: boolean;
61+
customHeaderIOS?: JSX.Element;
10962

11063
/**
11164
* A custom component that will replace the default DatePicker on iOS
11265
*/
113-
customDatePickerIOS?: JSX.Element;
66+
customPickerIOS?: JSX.Element;
11467

11568
/**
11669
* The style of the container on iOS
@@ -163,13 +116,6 @@ interface DateTimePickerProps {
163116
*/
164117
mode?: "date" | "time" | "datetime";
165118

166-
/**
167-
* Toggles the date mode on Android between spinner and calendar views
168-
*
169-
* Default is 'default' which shows either spinner or calendar based on Android version
170-
*/
171-
datePickerModeAndroid?: "spinner" | "calendar" | "default";
172-
173119
/**
174120
* Toggles the time mode on Android between spinner and clock views
175121
*
@@ -182,7 +128,7 @@ interface DateTimePickerProps {
182128
*
183129
* Default is 'Pick a Date'
184130
*/
185-
titleIOS?: string;
131+
headerTextIOS?: string;
186132

187133
/**
188134
* Minimum date the picker can go back to
@@ -236,7 +182,7 @@ interface DateTimePickerProps {
236182
* Called when the underlying modal finishes its' closing animation
237183
* after Confirm was pressed.
238184
*/
239-
onHideAfterConfirm?(date: Date): void;
185+
onHide?(date: Date): void;
240186
}
241187

242188
export default class DateTimePicker extends React.Component<

0 commit comments

Comments
 (0)