xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 726 forks source link

Add Types for typescript #386

Closed vinipachecov closed 4 years ago

vinipachecov commented 4 years ago

Issue

No support for typescript

Expected Behavior

To have types

Code

interface DatePickerProps {
    style: object;
    date?: Date | null;
    mode?: 'date'| 'datetime' | 'time';
    androidMode?: 'default' | 'calendar' | 'spinner';
    placeholder?: string;
    minDate?: string;
    maxDate?: string;
    format?: string;
    confirmBtnText?: string;
    cancelBtnText?: string;
    hideText?: boolean;
    customStyles?: object;
    onDateChange: Function;    
    showIcon: boolean;
    onOpenModal: Function;
    onCloseModal: Function;            
    height?: any;
    duration?: any;    
    iconSource?: any;
    iconComponent?: any;    
    disabled?: any;
    allowFontScaling?: any;    
    onPressMask?: any;    
    modalOnResponderTerminationRequest?: any;
    is24Hour?: any;
    getDateStr?: any;
    locale?: any;
}

export const DatePicker: React.ComponentClass<DatePickerProps>;

export default DatePicker

Environment

  1. react-native -0.61:
  2. node -13:
  3. npm -v:
  4. yarn --version: 1.19.2
  5. target platform: Android | iOS
  6. operating system: Mac OS Catalina