lanjingling0510 / react-mobile-datepicker

🙊 👻 look a demo, Please imitate mobile environment.
https://codepen.io/lanjingling0510/pen/LRpOYp?editors=1010
MIT License
301 stars 145 forks source link

Typescript support #56

Closed ieow closed 4 years ago

ieow commented 4 years ago

请问有支持 typescript 吗

刚查到了。

netcore-jroger commented 3 years ago

@ieow typescript 中怎么用?没有找到声明文件

Martinnord commented 2 years ago

This might help someone,

declare module "react-mobile-datepicker" {
    type Props = {
        theme: string;
        value: Object;
        min: Object;
        max: Object;
        customHeader?: React.Element<*>;
        showHeader: boolean;
        showFooter: boolean;
        showCaption: boolean;
        dateConfig: Object | Array<string>;
        headerFormat: string;
        confirmText: string;
        cancelText: string;
        onChange: Function;
        onSelect: Function;
        onCancel: Function;
    };

    type State = {
        value: string;
    };

    class DatePicker extends React.Component<Partial<Props>, State> {}

    export default DatePicker;
}