react-day-picker
Version:
Customizable Date Picker for React
36 lines (35 loc) • 1.7 kB
TypeScript
import React, { ReactNode } from 'react';
import { DayPickerBase } from '../../types/DayPickerBase';
import { DayPickerMultipleProps } from '../../types/DayPickerMultiple';
import { DayClickEventHandler } from '../../types/EventHandlers';
import { InternalModifier, Modifiers } from '../../types/Modifiers';
/** Represent the modifiers that are changed by the multiple selection. */
export declare type SelectMultipleModifiers = Pick<Modifiers, InternalModifier.Disabled>;
/** Represents the value of a [[SelectMultipleContext]]. */
export interface SelectMultipleContextValue {
/** The days that have been selected. */
selected: Date[] | undefined;
/** The modifiers for the corresponding selection. */
modifiers: SelectMultipleModifiers;
/** Event handler to attach to the day button to enable the multiple select. */
onDayClick?: DayClickEventHandler;
}
/**
* The SelectMultiple context shares details about the selected days when in
* multiple selection mode.
*
* Access this context from the [[useSelectMultiple]] hook.
*/
export declare const SelectMultipleContext: React.Context<SelectMultipleContextValue | undefined>;
export declare type SelectMultipleProviderProps = {
initialProps: DayPickerBase;
children: ReactNode;
};
/** Provides the values for the [[SelectMultipleContext]]. */
export declare function SelectMultipleProvider(props: SelectMultipleProviderProps): JSX.Element;
declare type SelectMultipleProviderInternalProps = {
initialProps: DayPickerMultipleProps;
children: ReactNode;
};
export declare function SelectMultipleProviderInternal({ initialProps, children }: SelectMultipleProviderInternalProps): JSX.Element;
export {};