@types/react-dates
Advanced tools
Comparing version 17.1.4 to 17.1.5
// Type definitions for react-dates v17.1.0 | ||
// Project: https://github.com/airbnb/react-dates | ||
// Definitions by: Artur Ampilogov <https://github.com/ArturAmpilogov> | ||
// Definitions by: Artur Ampilogov <https://github.com/ArturAmpilogov> | ||
// Nathan Holland <https://github.com/NathanNZ> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.8 | ||
// Required fields are made according to 'minimum REQUIRED setup' in https://github.com/airbnb/react-dates/blob/master/README.md | ||
// 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'; | ||
@@ -21,5 +20,4 @@ import * as moment from 'moment'; | ||
declare namespace ReactDates { | ||
// SHAPES | ||
// SHAPES | ||
// | ||
@@ -32,92 +30,96 @@ // shapes/AnchorDirectionShape.js | ||
// shapes/DateRangePickerShape.js | ||
interface DateRangePickerShape { | ||
// required props for a functional interactive DateRangePicker | ||
startDate: momentPropTypes.momentObj | null, | ||
startDateId: string, | ||
endDate: momentPropTypes.momentObj | null, | ||
endDateId: string, | ||
focusedInput: FocusedInputShape | null, | ||
startDate: momentPropTypes.momentObj | null; | ||
startDateId: string; | ||
endDate: momentPropTypes.momentObj | null; | ||
endDateId: string; | ||
focusedInput: FocusedInputShape | null; | ||
onDatesChange: (arg: { | ||
startDate: momentPropTypes.momentObj | null, | ||
endDate: momentPropTypes.momentObj | null | ||
}) => void, | ||
onFocusChange: (arg: FocusedInputShape | null) => void, | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
onDatesChange: ( | ||
arg: { | ||
startDate: momentPropTypes.momentObj | null; | ||
endDate: momentPropTypes.momentObj | null; | ||
} | ||
) => void; | ||
onFocusChange: (arg: FocusedInputShape | null) => void; | ||
onClose?: ( | ||
final: { | ||
startDate: momentPropTypes.momentObj; | ||
endDate: momentPropTypes.momentObj; | ||
} | ||
) => void; | ||
// input related props | ||
startDatePlaceholderText?: string, | ||
endDatePlaceholderText?: string, | ||
disabled?: DisabledShape, | ||
required?: boolean, | ||
readOnly?: boolean, | ||
screenReaderInputMessage?: string, | ||
showClearDates?: boolean, | ||
showDefaultInputIcon?: boolean, | ||
inputIconPosition?: IconPositionShape, | ||
customInputIcon?: string | JSX.Element, | ||
customArrowIcon?: string | JSX.Element, | ||
customCloseIcon?: string | JSX.Element, | ||
noBorder?: boolean, | ||
block?: boolean, | ||
small?: boolean, | ||
regular?: boolean, | ||
keepFocusOnInput?: boolean, | ||
startDatePlaceholderText?: string; | ||
endDatePlaceholderText?: string; | ||
disabled?: DisabledShape; | ||
required?: boolean; | ||
readOnly?: boolean; | ||
screenReaderInputMessage?: string; | ||
showClearDates?: boolean; | ||
showDefaultInputIcon?: boolean; | ||
inputIconPosition?: IconPositionShape; | ||
customInputIcon?: string | JSX.Element; | ||
customArrowIcon?: string | JSX.Element; | ||
customCloseIcon?: string | JSX.Element; | ||
noBorder?: boolean; | ||
block?: boolean; | ||
small?: boolean; | ||
regular?: boolean; | ||
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; | ||
month: momentPropTypes.momentObj; | ||
onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void; | ||
onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void; | ||
} | ||
) => string | JSX.Element, | ||
orientation?: OrientationShape, | ||
anchorDirection?: AnchorDirectionShape, | ||
openDirection?: OpenDirectionShape, | ||
horizontalMargin?: number, | ||
withPortal?: boolean, | ||
withFullScreenPortal?: boolean, | ||
appendToBody?: boolean, | ||
disableScroll?: boolean, | ||
daySize?: number, | ||
isRTL?: boolean, | ||
firstDayOfWeek?: DayOfWeekShape, | ||
initialVisibleMonth?: () => momentPropTypes.momentObj, | ||
numberOfMonths?: number, | ||
keepOpenOnDateSelect?: boolean, | ||
reopenPickerOnClearDates?: boolean, | ||
renderCalendarInfo?: () => (string | JSX.Element), | ||
calendarInfoPosition?: CalendarInfoPositionShape, | ||
hideKeyboardShortcutsPanel?: boolean, | ||
verticalHeight?: number, | ||
transitionDuration?: number, | ||
verticalSpacing?: number, | ||
) => string | JSX.Element; | ||
orientation?: OrientationShape; | ||
anchorDirection?: AnchorDirectionShape; | ||
openDirection?: OpenDirectionShape; | ||
horizontalMargin?: number; | ||
withPortal?: boolean; | ||
withFullScreenPortal?: boolean; | ||
appendToBody?: boolean; | ||
disableScroll?: boolean; | ||
daySize?: number; | ||
isRTL?: boolean; | ||
firstDayOfWeek?: DayOfWeekShape; | ||
initialVisibleMonth?: () => momentPropTypes.momentObj; | ||
numberOfMonths?: number; | ||
keepOpenOnDateSelect?: boolean; | ||
reopenPickerOnClearDates?: boolean; | ||
renderCalendarInfo?: () => string | JSX.Element; | ||
calendarInfoPosition?: CalendarInfoPositionShape; | ||
hideKeyboardShortcutsPanel?: boolean; | ||
verticalHeight?: number; | ||
transitionDuration?: number; | ||
verticalSpacing?: number; | ||
// navigation related props | ||
navPrev?: string | JSX.Element, | ||
navNext?: string | JSX.Element, | ||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
navPrev?: string | JSX.Element; | ||
navNext?: string | JSX.Element; | ||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void; | ||
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), | ||
minimumNights?: number, | ||
enableOutsideDays?: boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element; | ||
renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element; | ||
minimumNights?: number; | ||
enableOutsideDays?: boolean; | ||
isDayBlocked?: (day: any) => boolean; | ||
isOutsideRange?: (day: any) => boolean; | ||
isDayHighlighted?: (day: any) => boolean; | ||
// internationalization props | ||
displayFormat?: (string | (() => string)), | ||
monthFormat?: string, | ||
weekDayFormat?: string, | ||
phrases?: DateRangePickerPhrases, | ||
dayAriaLabelFormat?: string | ||
displayFormat?: string | (() => string); | ||
monthFormat?: string; | ||
weekDayFormat?: string; | ||
phrases?: DateRangePickerPhrases; | ||
dayAriaLabelFormat?: string; | ||
} | ||
@@ -146,83 +148,87 @@ | ||
// shapes/SingleDatePickerShape.js | ||
interface SingleDatePickerShape { | ||
id: string, | ||
id: string; | ||
// required props for a functional interactive SingleDatePicker | ||
date: momentPropTypes.momentObj | null, | ||
focused: boolean, | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void, | ||
onFocusChange: (arg: { focused: boolean | null }) => void, | ||
date: momentPropTypes.momentObj | null; | ||
focused: boolean; | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void; | ||
onFocusChange: (arg: { focused: boolean | null }) => void; | ||
// input related props | ||
placeholder?: string, | ||
disabled?: boolean, | ||
required?: boolean, | ||
readOnly?: boolean, | ||
screenReaderInputMessage?: string, | ||
showClearDate?: boolean, | ||
customCloseIcon?: string | JSX.Element, | ||
showDefaultInputIcon?: boolean, | ||
inputIconPosition?: IconPositionShape, | ||
customInputIcon?: string | JSX.Element, | ||
noBorder?: boolean, | ||
block?: boolean, | ||
small?: boolean, | ||
regular?: boolean, | ||
verticalSpacing?: number, | ||
keepFocusOnInput?: boolean, | ||
placeholder?: string; | ||
disabled?: boolean; | ||
required?: boolean; | ||
readOnly?: boolean; | ||
screenReaderInputMessage?: string; | ||
showClearDate?: boolean; | ||
customCloseIcon?: string | JSX.Element; | ||
showDefaultInputIcon?: boolean; | ||
inputIconPosition?: IconPositionShape; | ||
customInputIcon?: string | JSX.Element; | ||
noBorder?: boolean; | ||
block?: boolean; | ||
small?: boolean; | ||
regular?: boolean; | ||
verticalSpacing?: number; | ||
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; | ||
month: momentPropTypes.momentObj; | ||
onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void; | ||
onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void; | ||
} | ||
) => string | JSX.Element, | ||
orientation?: OrientationShape, | ||
anchorDirection?: AnchorDirectionShape, | ||
openDirection?: OpenDirectionShape, | ||
horizontalMargin?: number, | ||
withPortal?: boolean, | ||
withFullScreenPortal?: boolean, | ||
appendToBody?: boolean, | ||
disableScroll?: boolean, | ||
initialVisibleMonth?: () => momentPropTypes.momentObj, | ||
firstDayOfWeek?: DayOfWeekShape, | ||
numberOfMonths?: number, | ||
keepOpenOnDateSelect?: boolean, | ||
reopenPickerOnClearDates?: boolean, | ||
renderCalendarInfo?: () => (string | JSX.Element), | ||
calendarInfoPosition?: CalendarInfoPositionShape, | ||
hideKeyboardShortcutsPanel?: boolean, | ||
daySize?: number, | ||
isRTL?: boolean, | ||
verticalHeight?: number | null, | ||
transitionDuration?: number, | ||
) => string | JSX.Element; | ||
orientation?: OrientationShape; | ||
anchorDirection?: AnchorDirectionShape; | ||
openDirection?: OpenDirectionShape; | ||
horizontalMargin?: number; | ||
withPortal?: boolean; | ||
withFullScreenPortal?: boolean; | ||
appendToBody?: boolean; | ||
disableScroll?: boolean; | ||
initialVisibleMonth?: () => momentPropTypes.momentObj; | ||
firstDayOfWeek?: DayOfWeekShape; | ||
numberOfMonths?: number; | ||
keepOpenOnDateSelect?: boolean; | ||
reopenPickerOnClearDates?: boolean; | ||
renderCalendarInfo?: () => string | JSX.Element; | ||
calendarInfoPosition?: CalendarInfoPositionShape; | ||
hideKeyboardShortcutsPanel?: boolean; | ||
daySize?: number; | ||
isRTL?: boolean; | ||
verticalHeight?: number | null; | ||
transitionDuration?: number; | ||
// navigation related props | ||
navPrev?: string | JSX.Element, | ||
navNext?: string | JSX.Element, | ||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
navPrev?: string | JSX.Element; | ||
navNext?: string | JSX.Element; | ||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void; | ||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void; | ||
onClose?: ( | ||
final: { | ||
startDate: momentPropTypes.momentObj; | ||
endDate: momentPropTypes.momentObj; | ||
} | ||
) => void; | ||
// day presentation and interaction related props | ||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element), | ||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element), | ||
enableOutsideDays?: boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element; | ||
renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element; | ||
enableOutsideDays?: boolean; | ||
isDayBlocked?: (day: any) => boolean; | ||
isOutsideRange?: (day: any) => boolean; | ||
isDayHighlighted?: (day: any) => boolean; | ||
// internationalization props | ||
displayFormat?: (string | (() => string)), | ||
monthFormat?: string, | ||
weekDayFormat?: string, | ||
phrases?: SingleDatePickerPhrases, | ||
dayAriaLabelFormat?: string, | ||
displayFormat?: string | (() => string); | ||
monthFormat?: string; | ||
weekDayFormat?: string; | ||
phrases?: SingleDatePickerPhrases; | ||
dayAriaLabelFormat?: string; | ||
} | ||
@@ -234,30 +240,30 @@ | ||
type DateRangePickerPhrases = { | ||
calendarLabel?: string, | ||
closeDatePicker?: string, | ||
clearDates?: string, | ||
focusStartDate?: string, | ||
jumpToPrevMonth?: string, | ||
jumpToNextMonth?: string, | ||
keyboardShortcuts?: string, | ||
showKeyboardShortcutsPanel?: string, | ||
hideKeyboardShortcutsPanel?: string, | ||
openThisPanel?: string, | ||
enterKey?: string, | ||
leftArrowRightArrow?: string, | ||
upArrowDownArrow?: string, | ||
pageUpPageDown?: string, | ||
homeEnd?: string, | ||
escape?: string, | ||
questionMark?: string, | ||
selectFocusedDate?: string, | ||
moveFocusByOneDay?: string, | ||
moveFocusByOneWeek?: string, | ||
moveFocusByOneMonth?: string, | ||
moveFocustoStartAndEndOfWeek?: string, | ||
returnFocusToInput?: string, | ||
keyboardNavigationInstructions?: string, | ||
chooseAvailableStartDate?: (date: string) => string, | ||
chooseAvailableEndDate?: (date: string) => string, | ||
dateIsUnavailable?: (date: string) => string, | ||
dateIsSelected?: (date: string) => string | ||
calendarLabel?: string; | ||
closeDatePicker?: string; | ||
clearDates?: string; | ||
focusStartDate?: string; | ||
jumpToPrevMonth?: string; | ||
jumpToNextMonth?: string; | ||
keyboardShortcuts?: string; | ||
showKeyboardShortcutsPanel?: string; | ||
hideKeyboardShortcutsPanel?: string; | ||
openThisPanel?: string; | ||
enterKey?: string; | ||
leftArrowRightArrow?: string; | ||
upArrowDownArrow?: string; | ||
pageUpPageDown?: string; | ||
homeEnd?: string; | ||
escape?: string; | ||
questionMark?: string; | ||
selectFocusedDate?: string; | ||
moveFocusByOneDay?: string; | ||
moveFocusByOneWeek?: string; | ||
moveFocusByOneMonth?: string; | ||
moveFocustoStartAndEndOfWeek?: string; | ||
returnFocusToInput?: string; | ||
keyboardNavigationInstructions?: string; | ||
chooseAvailableStartDate?: (date: string) => string; | ||
chooseAvailableEndDate?: (date: string) => string; | ||
dateIsUnavailable?: (date: string) => string; | ||
dateIsSelected?: (date: string) => string; | ||
}; | ||
@@ -267,35 +273,35 @@ | ||
type DateRangePickerInputPhrases = { | ||
focusStartDate?: string, | ||
clearDates?: string, | ||
keyboardNavigationInstructions?: string, | ||
} | ||
focusStartDate?: string; | ||
clearDates?: string; | ||
keyboardNavigationInstructions?: string; | ||
}; | ||
// defaultPhrases.js | ||
type SingleDatePickerPhrases = { | ||
calendarLabel?: string, | ||
closeDatePicker?: string, | ||
clearDate?: string, | ||
jumpToPrevMonth?: string, | ||
jumpToNextMonth?: string, | ||
keyboardShortcuts?: string, | ||
showKeyboardShortcutsPanel?: string, | ||
hideKeyboardShortcutsPanel?: string, | ||
openThisPanel?: string, | ||
enterKey?: string, | ||
leftArrowRightArrow?: string, | ||
upArrowDownArrow?: string, | ||
pageUpPageDown?: string, | ||
homeEnd?: string, | ||
escape?: string, | ||
questionMark?: string, | ||
selectFocusedDate?: string, | ||
moveFocusByOneDay?: string, | ||
moveFocusByOneWeek?: string, | ||
moveFocusByOneMonth?: string, | ||
moveFocustoStartAndEndOfWeek?: string, | ||
returnFocusToInput?: string, | ||
keyboardNavigationInstructions?: string, | ||
chooseAvailableDate?: (date: string) => string, | ||
dateIsUnavailable?: (date: string) => string, | ||
dateIsSelected?: (date: string) => string, | ||
type SingleDatePickerPhrases = { | ||
calendarLabel?: string; | ||
closeDatePicker?: string; | ||
clearDate?: string; | ||
jumpToPrevMonth?: string; | ||
jumpToNextMonth?: string; | ||
keyboardShortcuts?: string; | ||
showKeyboardShortcutsPanel?: string; | ||
hideKeyboardShortcutsPanel?: string; | ||
openThisPanel?: string; | ||
enterKey?: string; | ||
leftArrowRightArrow?: string; | ||
upArrowDownArrow?: string; | ||
pageUpPageDown?: string; | ||
homeEnd?: string; | ||
escape?: string; | ||
questionMark?: string; | ||
selectFocusedDate?: string; | ||
moveFocusByOneDay?: string; | ||
moveFocusByOneWeek?: string; | ||
moveFocusByOneMonth?: string; | ||
moveFocustoStartAndEndOfWeek?: string; | ||
returnFocusToInput?: string; | ||
keyboardNavigationInstructions?: string; | ||
chooseAvailableDate?: (date: string) => string; | ||
dateIsUnavailable?: (date: string) => string; | ||
dateIsSelected?: (date: string) => string; | ||
}; | ||
@@ -305,33 +311,33 @@ | ||
type SingleDatePickerInputPhrases = { | ||
clearDate?: string, | ||
keyboardNavigationInstructions?: string, | ||
} | ||
clearDate?: string; | ||
keyboardNavigationInstructions?: string; | ||
}; | ||
// defaultPhrases.js | ||
type DayPickerPhrases = { | ||
calendarLabel?: string, | ||
jumpToPrevMonth?: string, | ||
jumpToNextMonth?: string, | ||
keyboardShortcuts?: string, | ||
showKeyboardShortcutsPanel?: string, | ||
hideKeyboardShortcutsPanel?: string, | ||
openThisPanel?: string, | ||
enterKey?: string, | ||
leftArrowRightArrow?: string, | ||
upArrowDownArrow?: string, | ||
pageUpPageDown?: string, | ||
homeEnd?: string, | ||
escape?: string, | ||
questionMark?: string, | ||
selectFocusedDate?: string, | ||
moveFocusByOneDay?: string, | ||
moveFocusByOneWeek?: string, | ||
moveFocusByOneMonth?: string, | ||
moveFocustoStartAndEndOfWeek?: string, | ||
returnFocusToInput?: string, | ||
chooseAvailableStartDate?: (date: string) => string, | ||
chooseAvailableEndDate?: (date: string) => string, | ||
chooseAvailableDate?: (date: string) => string, | ||
dateIsUnavailable?: (date: string) => string, | ||
dateIsSelected?: (date: string) => string, | ||
calendarLabel?: string; | ||
jumpToPrevMonth?: string; | ||
jumpToNextMonth?: string; | ||
keyboardShortcuts?: string; | ||
showKeyboardShortcutsPanel?: string; | ||
hideKeyboardShortcutsPanel?: string; | ||
openThisPanel?: string; | ||
enterKey?: string; | ||
leftArrowRightArrow?: string; | ||
upArrowDownArrow?: string; | ||
pageUpPageDown?: string; | ||
homeEnd?: string; | ||
escape?: string; | ||
questionMark?: string; | ||
selectFocusedDate?: string; | ||
moveFocusByOneDay?: string; | ||
moveFocusByOneWeek?: string; | ||
moveFocusByOneMonth?: string; | ||
moveFocustoStartAndEndOfWeek?: string; | ||
returnFocusToInput?: string; | ||
chooseAvailableStartDate?: (date: string) => string; | ||
chooseAvailableEndDate?: (date: string) => string; | ||
chooseAvailableDate?: (date: string) => string; | ||
dateIsUnavailable?: (date: string) => string; | ||
dateIsSelected?: (date: string) => string; | ||
}; | ||
@@ -341,19 +347,19 @@ | ||
type DayPickerKeyboardShortcutsPhrases = { | ||
keyboardShortcuts?: string, | ||
showKeyboardShortcutsPanel?: string, | ||
hideKeyboardShortcutsPanel?: string, | ||
openThisPanel?: string, | ||
enterKey?: string, | ||
leftArrowRightArrow?: string, | ||
upArrowDownArrow?: string, | ||
pageUpPageDown?: string, | ||
homeEnd?: string, | ||
escape?: string, | ||
questionMark?: string, | ||
selectFocusedDate?: string, | ||
moveFocusByOneDay?: string, | ||
moveFocusByOneWeek?: string, | ||
moveFocusByOneMonth?: string, | ||
moveFocustoStartAndEndOfWeek?: string, | ||
returnFocusToInput?: string, | ||
keyboardShortcuts?: string; | ||
showKeyboardShortcutsPanel?: string; | ||
hideKeyboardShortcutsPanel?: string; | ||
openThisPanel?: string; | ||
enterKey?: string; | ||
leftArrowRightArrow?: string; | ||
upArrowDownArrow?: string; | ||
pageUpPageDown?: string; | ||
homeEnd?: string; | ||
escape?: string; | ||
questionMark?: string; | ||
selectFocusedDate?: string; | ||
moveFocusByOneDay?: string; | ||
moveFocusByOneWeek?: string; | ||
moveFocusByOneMonth?: string; | ||
moveFocustoStartAndEndOfWeek?: string; | ||
returnFocusToInput?: string; | ||
}; | ||
@@ -363,15 +369,15 @@ | ||
type DayPickerNavigationPhrases = { | ||
jumpToPrevMonth?: string, | ||
jumpToNextMonth?: string, | ||
jumpToPrevMonth?: string; | ||
jumpToNextMonth?: string; | ||
}; | ||
// defaultPhrases.js | ||
type CalendarDayPhrases = { | ||
chooseAvailableDate: (date: string) => string, | ||
dateIsUnavailable: (date: string) => string, | ||
dateIsSelected: (date: string) => string, | ||
chooseAvailableDate: (date: string) => string; | ||
dateIsUnavailable: (date: string) => string; | ||
dateIsSelected: (date: string) => string; | ||
}; | ||
// COMPONENTS | ||
// | ||
// | ||
// components/DateRangePicker.js | ||
@@ -383,25 +389,31 @@ | ||
// components/DayPickerRangeController.jsx | ||
interface DayPickerRangeControllerShape extends DayPickerShape{ | ||
interface DayPickerRangeControllerShape extends DayPickerShape { | ||
// REQUIRED props | ||
startDate: momentPropTypes.momentObj | null, | ||
endDate: momentPropTypes.momentObj | null, | ||
onDatesChange: (arg: { | ||
startDate: momentPropTypes.momentObj | null, | ||
endDate: momentPropTypes.momentObj | null | ||
} | ||
) => void, | ||
focusedInput: FocusedInputShape, | ||
onFocusChange: (arg: FocusedInputShape | null) => void, | ||
startDate: momentPropTypes.momentObj | null; | ||
endDate: momentPropTypes.momentObj | null; | ||
onDatesChange: ( | ||
arg: { | ||
startDate: momentPropTypes.momentObj | null; | ||
endDate: momentPropTypes.momentObj | null; | ||
} | ||
) => void; | ||
focusedInput: FocusedInputShape; | ||
onFocusChange: (arg: FocusedInputShape | null) => void; | ||
startDateOffset?: (day: any) => any, | ||
endDateOffset?: (day: any) => any, | ||
startDateOffset?: (day: any) => any; | ||
endDateOffset?: (day: any) => any; | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
onClose?: ( | ||
final: { | ||
startDate: momentPropTypes.momentObj; | ||
endDate: momentPropTypes.momentObj; | ||
} | ||
) => void; | ||
keepOpenOnDateSelect?: boolean, | ||
minimumNights?: number, | ||
disabled?: DisabledShape, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
keepOpenOnDateSelect?: boolean; | ||
minimumNights?: number; | ||
disabled?: DisabledShape; | ||
isOutsideRange?: (day: any) => boolean; | ||
isDayBlocked?: (day: any) => boolean; | ||
isDayHighlighted?: (day: any) => boolean; | ||
} | ||
@@ -414,45 +426,45 @@ | ||
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; | ||
month: momentPropTypes.momentObj; | ||
onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void; | ||
onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void; | ||
} | ||
) => string | JSX.Element, | ||
enableOutsideDays?: boolean, | ||
numberOfMonths?: number, | ||
orientation?: ScrollableOrientationShape, | ||
withPortal?: boolean, | ||
initialVisibleMonth?: () => momentPropTypes.momentObj, | ||
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6, | ||
hideKeyboardShortcutsPanel?: boolean, | ||
daySize?: number, | ||
verticalHeight?: number, | ||
noBorder?: boolean, | ||
transitionDuration?: number, | ||
) => string | JSX.Element; | ||
enableOutsideDays?: boolean; | ||
numberOfMonths?: number; | ||
orientation?: ScrollableOrientationShape; | ||
withPortal?: boolean; | ||
initialVisibleMonth?: () => momentPropTypes.momentObj; | ||
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6; | ||
hideKeyboardShortcutsPanel?: boolean; | ||
daySize?: number; | ||
verticalHeight?: number; | ||
noBorder?: boolean; | ||
transitionDuration?: number; | ||
navPrev?: string | JSX.Element, | ||
navNext?: string | JSX.Element, | ||
navPrev?: string | JSX.Element; | ||
navNext?: string | JSX.Element; | ||
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), | ||
renderCalendarInfo?: () => (string | JSX.Element), | ||
calendarInfoPosition?: CalendarInfoPositionShape, | ||
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; | ||
renderCalendarInfo?: () => string | JSX.Element; | ||
calendarInfoPosition?: CalendarInfoPositionShape; | ||
// accessibility | ||
onBlur?: () => void, | ||
isFocused?: boolean, | ||
showKeyboardShortcuts?: boolean, | ||
onBlur?: () => void; | ||
isFocused?: boolean; | ||
showKeyboardShortcuts?: boolean; | ||
// i18n | ||
monthFormat?: string, | ||
weekDayFormat?: string, | ||
phrases?: SingleDatePickerPhrases, | ||
dayAriaLabelFormat?: string, | ||
monthFormat?: string; | ||
weekDayFormat?: string; | ||
phrases?: SingleDatePickerPhrases; | ||
dayAriaLabelFormat?: string; | ||
isRTL?: boolean | ||
isRTL?: boolean; | ||
} | ||
@@ -462,13 +474,13 @@ | ||
interface DayPickerSingleDateControllerShape extends DayPickerShape { | ||
date: momentPropTypes.momentObj | null, | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void, | ||
focused: boolean, | ||
onFocusChange: (arg: { focused: boolean | null }) => void, | ||
date: momentPropTypes.momentObj | null; | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void; | ||
focused: boolean; | ||
onFocusChange: (arg: { focused: boolean | null }) => void; | ||
onClose?: (final: { date: momentPropTypes.momentObj }) => void, | ||
onClose?: (final: { date: momentPropTypes.momentObj }) => void; | ||
keepOpenOnDateSelect?: boolean, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
keepOpenOnDateSelect?: boolean; | ||
isOutsideRange?: (day: any) => boolean; | ||
isDayBlocked?: (day: any) => boolean; | ||
isDayHighlighted?: (day: any) => boolean; | ||
} | ||
@@ -496,5 +508,11 @@ | ||
// utils/toLocalizedDateString.js | ||
var toLocalizedDateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null; | ||
var toLocalizedDateString: ( | ||
date: moment.MomentInput, | ||
currentFormat: moment.MomentFormatSpecification | ||
) => string | null; | ||
// utils/toMomentObject.js | ||
var toMomentObject: (dateString: moment.MomentInput, customFormat: moment.MomentFormatSpecification) => moment.Moment | null; | ||
var toMomentObject: ( | ||
dateString: moment.MomentInput, | ||
customFormat: moment.MomentFormatSpecification | ||
) => moment.Moment | null; | ||
} |
{ | ||
"name": "@types/react-dates", | ||
"version": "17.1.4", | ||
"version": "17.1.5", | ||
"description": "TypeScript definitions for react-dates", | ||
@@ -29,4 +29,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "655238bd7315d12e5b9c16a2ac3e7a3d2f89d2cc0aecea8785c4ad89798f89c4", | ||
"typesPublisherContentHash": "2e201ac82606cff8fd3cdb4d6741417ab422b17b8436d37d3eb79d05f95673c4", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 03 Dec 2018 00:30:46 GMT | ||
* Last updated: Fri, 14 Dec 2018 22:26:14 GMT | ||
* Dependencies: @types/react, @types/moment | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21317
452
1