@types/react-dates
Advanced tools
Comparing version 16.0.8 to 16.7.0
@@ -1,4 +0,4 @@ | ||
// Type definitions for react-dates v16.0.0 | ||
// Type definitions for react-dates v16.7.0 | ||
// Project: https://github.com/airbnb/react-dates | ||
// Definitions by: Artur Ampilogov <https://github.com/Artur-A> | ||
// Definitions by: Artur Ampilogov <https://github.com/ArturAmpilogov> | ||
// Nathan Holland <https://github.com/NathanNZ> | ||
@@ -8,4 +8,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
import * as React from "react"; | ||
import * as moment from "moment"; | ||
// 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'; | ||
@@ -22,85 +24,32 @@ export = ReactDates; | ||
declare namespace ReactDates { | ||
// SHAPES | ||
// | ||
// shapes/AnchorDirectionShape.js | ||
type AnchorDirectionShape = 'left' | 'right'; | ||
type FocusedInputShape = 'startDate' | 'endDate'; | ||
type OrientationShape = 'horizontal' | 'vertical'; | ||
type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable'; | ||
// shapes/CalendarInfoPositionShape.js | ||
type CalendarInfoPositionShape = 'top' | 'bottom' | 'before' | 'after'; | ||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/defaultPhrases.js | ||
type SingleDatePickerPhrases = { | ||
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, | ||
}; | ||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/defaultPhrases.js | ||
type DateRangePickerPhrases = { | ||
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 | ||
}; | ||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/shapes/DateRangePickerShape.js | ||
// shapes/DateRangePickerShape.js | ||
interface DateRangePickerShape { | ||
// REQUIRED props | ||
// required props for a functional interactive DateRangePicker | ||
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, | ||
focusedInput: FocusedInputShape | null, | ||
}) => void, | ||
onFocusChange: (arg: FocusedInputShape | null) => void, | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
// input related props | ||
startDateId?: string, | ||
startDatePlaceholderText?: string, | ||
endDateId?: string, | ||
endDatePlaceholderText?: string, | ||
disabled?: boolean, | ||
keepFocusOnInput?: boolean, | ||
required?: boolean, | ||
@@ -116,2 +65,5 @@ readOnly?: boolean, | ||
block?: boolean, | ||
small?: boolean, | ||
regular?: boolean, | ||
keepFocusOnInput?: boolean, | ||
@@ -122,7 +74,12 @@ // calendar presentation and interaction related props | ||
anchorDirection?: AnchorDirectionShape, | ||
openDirection?: OpenDirectionShape, | ||
horizontalMargin?: number, | ||
withPortal?: boolean, | ||
withFullScreenPortal?: boolean, | ||
appendToBody?: boolean, | ||
disableScroll?: boolean, | ||
daySize?: number, | ||
isRTL?: boolean, | ||
firstDayOfWeek?: DayOfWeekShape, | ||
initialVisibleMonth?: () => momentPropTypes.momentObj, | ||
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6, | ||
numberOfMonths?: number, | ||
@@ -132,5 +89,7 @@ keepOpenOnDateSelect?: boolean, | ||
renderCalendarInfo?: () => (string | JSX.Element), | ||
calendarInfoPosition?: CalendarInfoPositionShape, | ||
hideKeyboardShortcutsPanel?: boolean, | ||
daySize?: number, | ||
isRTL?: boolean, | ||
verticalHeight?: number, | ||
transitionDuration?: number, | ||
verticalSpacing?: number, | ||
@@ -142,4 +101,2 @@ // navigation related props | ||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
transitionDuration?: number, | ||
@@ -160,18 +117,39 @@ // day presentation and interaction related props | ||
weekDayFormat?: string, | ||
phrases?: DateRangePickerPhrases | ||
phrases?: DateRangePickerPhrases, | ||
dayAriaLabelFormat?: string | ||
} | ||
type DateRangePicker = React.ClassicComponentClass<DateRangePickerShape>; | ||
var DateRangePicker: React.ClassicComponentClass<DateRangePickerShape>; | ||
// shapes/DayOfWeekShape.js | ||
type DayOfWeekShape = 0 | 1 | 2 | 3 | 4 | 5 | 6; | ||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/shapes/SingleDatePickerShape.js | ||
// shapes/DisabledShape.js | ||
type DisabledShape = boolean | 'startDate' | 'endDate'; | ||
// shapes/FocusedInputShape.js | ||
type FocusedInputShape = 'startDate' | 'endDate'; | ||
// shape/IconPositionShape.js | ||
type IconPositionShape = 'before' | 'after'; | ||
// type/OpenDirectionShape.js | ||
type OpenDirectionShape = 'down' | 'up'; | ||
// shpae/OrientationShape.js | ||
type OrientationShape = 'horizontal' | 'vertical'; | ||
// shape/ScrollableOrientationShape.js | ||
type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable'; | ||
// shapes/SingleDatePickerShape.js | ||
interface SingleDatePickerShape { | ||
// REQUIRED props | ||
id: string, | ||
// required props for a functional interactive SingleDatePicker | ||
date: momentPropTypes.momentObj | null, | ||
focused: boolean, | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void, | ||
focused: boolean, | ||
onFocusChange: (arg: { focused: boolean | null }) => void, | ||
id: string, | ||
// input related props | ||
@@ -186,2 +164,3 @@ placeholder?: string, | ||
showDefaultInputIcon?: boolean, | ||
inputIconPosition?: IconPositionShape, | ||
customInputIcon?: string | JSX.Element, | ||
@@ -192,2 +171,3 @@ noBorder?: boolean, | ||
regular?: boolean, | ||
verticalSpacing?: number, | ||
keepFocusOnInput?: boolean, | ||
@@ -202,4 +182,6 @@ | ||
withFullScreenPortal?: boolean, | ||
appendToBody?: boolean, | ||
disableScroll?: boolean, | ||
initialVisibleMonth?: () => momentPropTypes.momentObj, | ||
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6, | ||
firstDayOfWeek?: DayOfWeekShape, | ||
numberOfMonths?: number, | ||
@@ -209,7 +191,8 @@ keepOpenOnDateSelect?: boolean, | ||
renderCalendarInfo?: () => (string | JSX.Element), | ||
calendarInfoPosition?: CalendarInfoPositionShape, | ||
hideKeyboardShortcutsPanel?: boolean, | ||
daySize?: number, | ||
isRTL?: boolean, | ||
verticalSpacing?: number, | ||
verticalHeight?: number | null, | ||
transitionDuration?: number, | ||
@@ -222,3 +205,2 @@ // navigation related props | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
transitionDuration?: number, | ||
@@ -236,9 +218,156 @@ // day presentation and interaction related props | ||
monthFormat?: string, | ||
phrases?: SingleDatePickerPhrases | ||
weekDayFormat?: string, | ||
phrases?: SingleDatePickerPhrases, | ||
dayAriaLabelFormat?: string, | ||
} | ||
type SingleDatePicker = React.ClassicComponentClass<SingleDatePickerShape>; | ||
var SingleDatePicker: React.ClassicComponentClass<SingleDatePickerShape>; | ||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/components/DayPickerRangeController.jsx | ||
interface DayPickerRangeControllerShape { | ||
// PHRASES | ||
// | ||
// defaultPhrases.js | ||
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 | ||
}; | ||
// defaultPhrases.js | ||
type DateRangePickerInputPhrases = { | ||
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, | ||
}; | ||
// defaultPhrases.js | ||
type SingleDatePickerInputPhrases = { | ||
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, | ||
}; | ||
// defaultPhrases.js | ||
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, | ||
}; | ||
// defaultPhrases.js | ||
type DayPickerNavigationPhrases = { | ||
jumpToPrevMonth?: string, | ||
jumpToNextMonth?: string, | ||
}; | ||
// defaultPhrases.js | ||
type CalendarDayPhrases = { | ||
chooseAvailableDate: (date: string) => string, | ||
dateIsUnavailable: (date: string) => string, | ||
dateIsSelected: (date: string) => string, | ||
}; | ||
// COMPONENTS | ||
// | ||
// components/DateRangePicker.js | ||
type DateRangePicker = React.ClassicComponentClass<DateRangePickerShape>; | ||
var DateRangePicker: React.ClassicComponentClass<DateRangePickerShape>; | ||
// components/DayPickerRangeController.jsx | ||
interface DayPickerRangeControllerShape extends DayPickerShape{ | ||
// REQUIRED props | ||
@@ -252,38 +381,16 @@ startDate: momentPropTypes.momentObj | null, | ||
) => void, | ||
focusedInput: FocusedInputShape | null, | ||
focusedInput: FocusedInputShape, | ||
onFocusChange: (arg: FocusedInputShape | null) => void, | ||
// calendar presentation and interaction related props | ||
enableOutsideDays?: boolean, | ||
numberOfMonths?: number, | ||
orientation?: ScrollableOrientationShape, | ||
withPortal?: boolean, | ||
initialVisibleMonth?: () => momentPropTypes.momentObj, | ||
renderCalendarInfo?: () => (string | JSX.Element), | ||
onOutsideClick?: (e: any) => void, | ||
keepOpenOnDateSelect?: boolean, | ||
hideKeyboardShortcutsPanel?: boolean; | ||
noBorder?: boolean, | ||
verticalBorderSpacing?: number, | ||
firstDayOfWeek? : 0 | 1 | 2 | 3 | 4 | 5 | 6, | ||
startDateOffset?: (day: any) => any, | ||
endDateOffset?: (day: any) => any, | ||
// navigation related props | ||
navPrev?: string | JSX.Element, | ||
navNext?: string | JSX.Element, | ||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void, | ||
transitionDuration?: number, | ||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void, | ||
// day presentation and interaction related props | ||
daySize?: number, | ||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element), | ||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element), | ||
keepOpenOnDateSelect?: boolean, | ||
minimumNights?: number, | ||
disabled?: DisabledShape, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
// internationalization props | ||
monthFormat?: string, | ||
phrases?: DateRangePickerPhrases | ||
} | ||
@@ -294,17 +401,4 @@ | ||
//https://github.com/airbnb/react-dates/blob/97bf16e72dbf5ce88f0181c49212080061a83f69/src/components/DayPickerSingleDateController.jsx | ||
interface DayPickerSingleDateControllerShape { | ||
date: momentPropTypes.momentObj | null, | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void, | ||
focused: boolean, | ||
onFocusChange: (arg: { focused: boolean | null }) => void, | ||
onClose?: (final: { date: momentPropTypes.momentObj }) => void, | ||
keepOpenOnDateSelect?: boolean, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
// DayPicker props | ||
// components/DayPickerShape.jsx | ||
interface DayPickerShape { | ||
renderMonth?: (day: momentPropTypes.momentObj) => (string | JSX.Element), | ||
@@ -345,4 +439,18 @@ enableOutsideDays?: boolean, | ||
isRTL?: boolean, | ||
isRTL?: boolean | ||
} | ||
// components/DayPickerSingleDateController.jsx | ||
interface DayPickerSingleDateControllerShape extends DayPickerShape { | ||
date: momentPropTypes.momentObj | null, | ||
onDateChange: (date: momentPropTypes.momentObj | null) => void, | ||
focused: boolean, | ||
onFocusChange: (arg: { focused: boolean | null }) => void, | ||
onClose?: (final: { date: momentPropTypes.momentObj }) => void, | ||
keepOpenOnDateSelect?: boolean, | ||
isOutsideRange?: (day: any) => boolean, | ||
isDayBlocked?: (day: any) => boolean, | ||
isDayHighlighted?: (day: any) => boolean, | ||
} | ||
@@ -353,11 +461,22 @@ | ||
// components/SingleDatePicker.js | ||
type SingleDatePicker = React.ClassicComponentClass<SingleDatePickerShape>; | ||
var SingleDatePicker: React.ClassicComponentClass<SingleDatePickerShape>; | ||
// UTILS | ||
// | ||
// utils/isInclusivelyAfterDay.js | ||
var isInclusivelyAfterDay: (a: moment.Moment, b: moment.Moment) => boolean; | ||
// utils/isInclusivelyBeforeDay.js | ||
var isInclusivelyBeforeDay: (a: moment.Moment, b: moment.Moment) => boolean; | ||
// utils/isNextDay.js | ||
var isNextDay: (a: moment.Moment, b: moment.Moment) => boolean; | ||
// 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; | ||
// utils/toLocalizedDateString.js | ||
var toLocalizedDateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null; | ||
// utils/toMomentObject.js | ||
var toMomentObject: (dateString: moment.MomentInput, customFormat: moment.MomentFormatSpecification) => moment.Moment | null; | ||
} |
{ | ||
"name": "@types/react-dates", | ||
"version": "16.0.8", | ||
"version": "16.7.0", | ||
"description": "TypeScript definitions for react-dates", | ||
@@ -9,4 +9,4 @@ "license": "MIT", | ||
"name": "Artur Ampilogov", | ||
"url": "https://github.com/Artur-A", | ||
"githubUsername": "Artur-A" | ||
"url": "https://github.com/ArturAmpilogov", | ||
"githubUsername": "ArturAmpilogov" | ||
}, | ||
@@ -29,4 +29,4 @@ { | ||
}, | ||
"typesPublisherContentHash": "24321ccf493e2458527ebffa7562c7fe7b40c36f22d7e0a15a21c2c0993eb38e", | ||
"typesPublisherContentHash": "62555e798f953e22d37131f1ca831d0201b45bed078f3cc86e25c020adb42bb5", | ||
"typeScriptVersion": "2.6" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 01 Jun 2018 22:02:05 GMT | ||
* Last updated: Wed, 13 Jun 2018 19:16:57 GMT | ||
* Dependencies: react, moment | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Artur Ampilogov <https://github.com/Artur-A>, Nathan Holland <https://github.com/NathanNZ>. | ||
These definitions were written by Artur Ampilogov <https://github.com/ArturAmpilogov>, Nathan Holland <https://github.com/NathanNZ>. |
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
19850
405
1