New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS Strict Calendar #6076
base: main
Are you sure you want to change the base?
TS Strict Calendar #6076
Conversation
hi can work on this if you 're not actively doing this. |
Thank you @ishank-s you're welcome to have a go at it |
Contributor help <3
# Conflicts: # packages/@react-stately/calendar/src/useCalendarState.ts
## API Changes
unknown top level export { type: 'any' } @internationalized/dateminDate minDate<A extends DateValue, B extends DateValue> {
- a: A
- b: B
+ a?: A
+ b?: B
returnVal: undefined
} maxDate maxDate<A extends DateValue, B extends DateValue> {
- a: A
- b: B
+ a?: A
+ b?: B
returnVal: undefined
} @react-aria/calendarCalendarProps-CalendarProps<T extends DateValue> {
- autoFocus?: boolean = false
- defaultFocusedValue?: DateValue
- errorMessage?: ReactNode
- focusedValue?: DateValue
- isDateUnavailable?: (DateValue) => boolean
- isDisabled?: boolean = false
- isInvalid?: boolean
- isReadOnly?: boolean = false
- maxValue?: DateValue
- minValue?: DateValue
- onFocusChange?: (CalendarDate) => void
- pageBehavior?: PageBehavior = visible
-}
+ RangeCalendarProps-RangeCalendarProps<T extends DateValue> {
- allowsNonContiguousRanges?: boolean
- autoFocus?: boolean = false
- defaultFocusedValue?: DateValue
- errorMessage?: ReactNode
- focusedValue?: DateValue
- isDateUnavailable?: (DateValue) => boolean
- isDisabled?: boolean = false
- isInvalid?: boolean
- isReadOnly?: boolean = false
- maxValue?: DateValue
- minValue?: DateValue
- onFocusChange?: (CalendarDate) => void
- pageBehavior?: PageBehavior = visible
-}
+ undefined-
+CalendarProps<T extends DateValue | null> {
+ autoFocus?: boolean = false
+ defaultFocusedValue?: DateValue
+ errorMessage?: ReactNode
+ focusedValue?: DateValue
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean = false
+ isInvalid?: boolean
+ isReadOnly?: boolean = false
+ maxValue?: DateValue
+ minValue?: DateValue
+ onFocusChange?: (CalendarDate) => void
+ pageBehavior?: PageBehavior = visible
+} undefined-
+RangeCalendarProps<T extends DateValue | null> {
+ allowsNonContiguousRanges?: boolean
+ autoFocus?: boolean = false
+ defaultFocusedValue?: DateValue
+ errorMessage?: ReactNode
+ focusedValue?: DateValue
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean = false
+ isInvalid?: boolean
+ isReadOnly?: boolean = false
+ maxValue?: DateValue
+ minValue?: DateValue
+ onFocusChange?: (CalendarDate) => void
+ pageBehavior?: PageBehavior = visible
+} @react-stately/calendarCalendarStateOptions-CalendarStateOptions<T extends DateValue = DateValue> {
- createCalendar: (string) => Calendar
- locale: string
- selectionAlignment?: 'start' | 'center' | 'end'
- visibleDuration?: DateDuration = {months: 1}
-}
+ it changed:
RangeCalendarState RangeCalendarState {
anchorDate: CalendarDate | null
focusNextDay: () => void
focusNextPage: () => void
focusNextRow: () => void
focusNextSection: (boolean) => void
focusPreviousDay: () => void
focusPreviousPage: () => void
focusPreviousRow: () => void
focusPreviousSection: (boolean) => void
focusSectionEnd: () => void
focusSectionStart: () => void
focusedDate: CalendarDate
getDatesInWeek: (number, CalendarDate) => Array<CalendarDate | null>
highlightDate: (CalendarDate) => void
- highlightedRange: RangeValue<CalendarDate>
+ highlightedRange: RangeValue<CalendarDate> | null
isCellDisabled: (CalendarDate) => boolean
isCellFocused: (CalendarDate) => boolean
isCellUnavailable: (CalendarDate) => boolean
isDisabled: boolean
isDragging: boolean
isFocused: boolean
isInvalid: (CalendarDate) => boolean
isNextVisibleRangeInvalid: () => boolean
isPreviousVisibleRangeInvalid: () => boolean
isReadOnly: boolean
isSelected: (CalendarDate) => boolean
isValueInvalid: boolean
maxValue?: DateValue
minValue?: DateValue
selectDate: (CalendarDate) => void
selectFocusedDate: () => void
setAnchorDate: (CalendarDate | null) => void
setDragging: (boolean) => void
setFocused: (boolean) => void
setFocusedDate: (CalendarDate) => void
- setValue: (RangeValue<DateValue>) => void
+ setValue: (RangeValue<DateValue> | null) => void
timeZone: string
- value: RangeValue<DateValue>
+ value: RangeValue<DateValue> | null
visibleRange: RangeValue<CalendarDate>
} undefined-
+CalendarStateOptions<T extends DateValue> {
+ createCalendar: (string) => Calendar
+ locale: string
+ selectionAlignment?: 'start' | 'center' | 'end'
+ visibleDuration?: DateDuration = {months: 1}
+} |
Closes
I need help figuring out
useRangeCalendarState
I'm getting caught up trying to get the types to work foruseControlledState
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: