From fe68a448fbefa2874d3cc2cf5890204016cb179e Mon Sep 17 00:00:00 2001 From: "h.naoufal" Date: Fri, 30 Nov 2018 13:16:38 +0100 Subject: [PATCH] Adding missing inputIconPosition to interface DateRangePickerShape --adjust code styling --- types/react-dates/index.d.ts | 110 ++++++++++------------------------- 1 file changed, 30 insertions(+), 80 deletions(-) diff --git a/types/react-dates/index.d.ts b/types/react-dates/index.d.ts index 911dfc75c8..5596dbef42 100644 --- a/types/react-dates/index.d.ts +++ b/types/react-dates/index.d.ts @@ -7,8 +7,8 @@ // Required fields are made according to 'minimum REQUIRED setup' in https://github.com/airbnb/react-dates/blob/master/README.md -import * as React from "react"; -import * as moment from "moment"; +import * as React from 'react'; +import * as moment from 'moment'; export = ReactDates; @@ -22,10 +22,10 @@ declare namespace ReactDates { // SHAPES // // shapes/AnchorDirectionShape.js - type AnchorDirectionShape = "left" | "right"; + type AnchorDirectionShape = 'left' | 'right'; // shapes/CalendarInfoPositionShape.js - type CalendarInfoPositionShape = "top" | "bottom" | "before" | "after"; + type CalendarInfoPositionShape = 'top' | 'bottom' | 'before' | 'after'; // shapes/DateRangePickerShape.js interface DateRangePickerShape { @@ -71,20 +71,12 @@ declare namespace ReactDates { keepFocusOnInput?: boolean; // calendar presentation and interaction related props - renderMonthText?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; + renderMonthText?: (day: momentPropTypes.momentObj) => string | JSX.Element; renderMonthElement?: ( props: { month: momentPropTypes.momentObj; - onMonthSelect: ( - currentMonth: momentPropTypes.momentObj, - newMonthVal: string - ) => void; - onYearSelect: ( - currentMonth: momentPropTypes.momentObj, - newYearVal: string - ) => void; + onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void; + onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void; } ) => string | JSX.Element; orientation?: OrientationShape; @@ -116,12 +108,8 @@ declare namespace ReactDates { onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void; // day presentation and interaction related props - renderCalendarDay?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; - renderDayContents?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; + renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element; + renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element; minimumNights?: number; enableOutsideDays?: boolean; isDayBlocked?: (day: any) => boolean; @@ -140,25 +128,22 @@ declare namespace ReactDates { type DayOfWeekShape = 0 | 1 | 2 | 3 | 4 | 5 | 6; // shapes/DisabledShape.js - type DisabledShape = boolean | "startDate" | "endDate"; + type DisabledShape = boolean | 'startDate' | 'endDate'; // shapes/FocusedInputShape.js - type FocusedInputShape = "startDate" | "endDate"; + type FocusedInputShape = 'startDate' | 'endDate'; // shape/IconPositionShape.js - type IconPositionShape = "before" | "after"; + type IconPositionShape = 'before' | 'after'; // type/OpenDirectionShape.js - type OpenDirectionShape = "down" | "up"; + type OpenDirectionShape = 'down' | 'up'; // shpae/OrientationShape.js - type OrientationShape = "horizontal" | "vertical"; + type OrientationShape = 'horizontal' | 'vertical'; // shape/ScrollableOrientationShape.js - type ScrollableOrientationShape = - | "horizontal" - | "vertical" - | "verticalScrollable"; + type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable'; // shapes/SingleDatePickerShape.js interface SingleDatePickerShape { @@ -190,20 +175,12 @@ declare namespace ReactDates { keepFocusOnInput?: boolean; // calendar presentation and interaction related props - renderMonthText?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; + renderMonthText?: (day: momentPropTypes.momentObj) => string | JSX.Element; renderMonthElement?: ( props: { month: momentPropTypes.momentObj; - onMonthSelect: ( - currentMonth: momentPropTypes.momentObj, - newMonthVal: string - ) => void; - onYearSelect: ( - currentMonth: momentPropTypes.momentObj, - newYearVal: string - ) => void; + onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void; + onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void; } ) => string | JSX.Element; orientation?: OrientationShape; @@ -240,12 +217,8 @@ declare namespace ReactDates { ) => void; // day presentation and interaction related props - renderCalendarDay?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; - renderDayContents?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; + renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element; + renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element; enableOutsideDays?: boolean; isDayBlocked?: (day: any) => boolean; isOutsideRange?: (day: any) => boolean; @@ -438,29 +411,17 @@ declare namespace ReactDates { isDayHighlighted?: (day: any) => boolean; } - type DayPickerRangeController = React.ClassicComponentClass< - DayPickerRangeControllerShape - >; - var DayPickerRangeController: React.ClassicComponentClass< - DayPickerRangeControllerShape - >; + type DayPickerRangeController = React.ClassicComponentClass; + var DayPickerRangeController: React.ClassicComponentClass; // components/DayPickerShape.jsx interface DayPickerShape { - renderMonthText?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; + renderMonthText?: (day: momentPropTypes.momentObj) => string | JSX.Element; renderMonthElement?: ( props: { month: momentPropTypes.momentObj; - onMonthSelect: ( - currentMonth: momentPropTypes.momentObj, - newMonthVal: string - ) => void; - onYearSelect: ( - currentMonth: momentPropTypes.momentObj, - newYearVal: string - ) => void; + onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void; + onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void; } ) => string | JSX.Element; enableOutsideDays?: boolean; @@ -481,12 +442,8 @@ declare namespace ReactDates { onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void; onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void; onOutsideClick?: (e: any) => void; - renderCalendarDay?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; - renderDayContents?: ( - day: momentPropTypes.momentObj - ) => string | JSX.Element; + renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element; + renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element; renderCalendarInfo?: () => string | JSX.Element; calendarInfoPosition?: CalendarInfoPositionShape; @@ -519,12 +476,8 @@ declare namespace ReactDates { isDayHighlighted?: (day: any) => boolean; } - type DayPickerSingleDateController = React.ClassicComponentClass< - DayPickerSingleDateControllerShape - >; - var DayPickerSingleDateController: React.ClassicComponentClass< - DayPickerSingleDateControllerShape - >; + type DayPickerSingleDateController = React.ClassicComponentClass; + var DayPickerSingleDateController: React.ClassicComponentClass; // components/SingleDatePicker.js type SingleDatePicker = React.ClassicComponentClass; @@ -541,10 +494,7 @@ declare namespace ReactDates { // utils/isSameDay.js var isSameDay: (a: moment.Moment, b: moment.Moment) => boolean; // utils/toISODateString.js - var toISODateString: ( - date: moment.MomentInput, - currentFormat: moment.MomentFormatSpecification - ) => string | null; + var toISODateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null; // utils/toLocalizedDateString.js var toLocalizedDateString: ( date: moment.MomentInput,