@codecademy/gamut
68.3.068.3.1-alpha.a2040c.0
dist/DatePicker/DatePickerCalendar/utils/dateSelect.d.ts+
dist/DatePicker/DatePickerCalendar/utils/dateSelect.d.tsNew file+26
Index: package/dist/DatePicker/DatePickerCalendar/utils/dateSelect.d.ts
===================================================================
--- package/dist/DatePicker/DatePickerCalendar/utils/dateSelect.d.ts
+++ package/dist/DatePicker/DatePickerCalendar/utils/dateSelect.d.ts
@@ -0,0 +1,26 @@
+import type { DatePickerRangeContextValue, DatePickerSingleContextValue } from '../../DatePickerContext/types';
+import { DatePickerSharedProps } from '../../sharedTypes';
+import type { DatePickerProps, DatePickerRangeProps } from '../../types';
+export declare const isRangeProps: (props: DatePickerProps) => props is DatePickerRangeProps;
+type RangeContainsDisabledParams = {
+ startDate: Date;
+ endDate: Date;
+} & Pick<DatePickerSharedProps, 'disableDate'>;
+export declare const rangeContainsDisabled: ({ startDate, endDate, disableDate, }: RangeContainsDisabledParams) => boolean;
+type HandleDateSelectSingleParams = {
+ date: Date;
+} & Pick<DatePickerSingleContextValue, 'onSelection' | 'selectedDate'>;
+export declare const handleDateSelectSingle: ({ date, selectedDate, onSelection, }: HandleDateSelectSingleParams) => void;
+type ApplyRangeOrNewStartParams = {
+ startDate: Date;
+ endDate: Date;
+ clickedDate: Date;
+} & Pick<DatePickerRangeContextValue, 'onRangeSelection' | 'disableDate'>;
+/** @returns whether a full startDate+endDate range was committed (calendar may close). */
+export declare const applyRangeOrNewStart: ({ startDate, endDate, clickedDate, disableDate, onRangeSelection, }: ApplyRangeOrNewStartParams) => boolean;
+type HandleDateSelectRangeParams = {
+ date: Date;
+} & Pick<DatePickerRangeContextValue, 'activeRangePart' | 'endDate' | 'onRangeSelection' | 'disableDate' | 'startDate'>;
+/** @returns whether the calendar should close (full range selected and committed). */
+export declare const handleDateSelectRange: ({ date, activeRangePart, startDate, endDate, onRangeSelection, disableDate, }: HandleDateSelectRangeParams) => boolean;
+export {};