Simon Egersand
2017-07-29 b8d07e854fd368d56ecf918212757b9c8d667feb
Add TS definitions for onViewModeChange callback

Original commit by josefernand:
https://github.com/YouCanBookMe/react-datetime/pull/302/commits/8ea6ea853a9f5057cfa5b5ffefd3a9d66eebefbe
3 files modified
13 ■■■■■ changed files
DateTime.d.ts 5 ●●●●● patch | view | raw | blame | history
react-datetime.d.ts 5 ●●●●● patch | view | raw | blame | history
typings/react-datetime-tests.tsx 3 ●●●●● patch | view | raw | blame | history
DateTime.d.ts
@@ -89,6 +89,11 @@
         */
        onBlur?: EventOrValueHandler<FocusEvent<any>>;
        /*
         Callback trigger when the view mode changes. The callback receives the selected view mode
         string ('years', 'months', 'days', 'time') as only parameter.
         */
        onViewModeChange?: (viewMode: string) => void;
        /*
         The default view to display when the picker is shown. ('years', 'months', 'days', 'time')
         */
        viewMode?: ViewMode|number;
react-datetime.d.ts
@@ -70,6 +70,11 @@
     */
    onBlur?: (momentOrInputString : string|any) => void;
    /*
     Callback trigger when the view mode changes. The callback receives the selected view mode
     string ('years', 'months', 'days', 'time') as only parameter.
    */
    onViewModeChange?: (viewMode: string) => void;
    /*
     The default view to display when the picker is shown. ('years', 'months', 'days', 'time')
     */
    viewMode?: string|number;
typings/react-datetime-tests.tsx
@@ -81,6 +81,9 @@
        onBlur={
            (momentOrInputString:string) => {}
        }
        onViewModeChange={
             (viewMode:string) => {}
         }
     />;
const TEST_EVENT_HANDLERS_WITH_MOMENT: JSX.Element = <ReactDatetime