import type { Dispatch, FC, ReactNode } from "react"; import type { DateRangePickerDisplayProps } from "./DateRangePickerDisplay"; import type { DateRangePickerReducerAction, DateRangePickerReducerState } from "./dateRangePickerReducer"; import { dateRangePickerReducer } from "./dateRangePickerReducer"; import type { DateRangePickerTimeRange } from "./dateRangePickerTimeRange"; import type { DatePickerCalendarProps } from "../../../Fields/DatePicker/components"; import type { SharedDatePickerProps } from "../../../Fields/DatePicker/types"; interface LeftFooterComponentArgs { state: DateRangePickerReducerState; dispatch: Dispatch; } interface RightSidePanelComponentArgs { state: DateRangePickerReducerState; dispatch: Dispatch; } interface RenderTargetParams { toggle: () => void; isOpen: boolean; } export type DateRangePickerProps = { /** * The id of the `DateRangePicker`. */ id?: string; /** * The range of the `DateRangePicker`. * @deprecated Use `value` instead to make the component controlled. * Otherwise, use `defaultValue` to make the component uncontrolled. */ range?: DateRangePickerTimeRange | null; /** * The value of the `DateRangePicker`. */ value?: DateRangePickerTimeRange | null; /** * The default value of the `DateRangePicker` (uncontrolled mode). */ defaultValue?: DateRangePickerTimeRange | null; /** * The ranges to only display in the `DateRangePicker`. */ displayOnlyRanges?: DateRangePickerTimeRange[]; /** * The props of the `DateRangePicker` calendar. */ calendarProps?: Pick; /** * The reducer of the `DateRangePicker`. */ stateReducer?: (state: DateRangePickerReducerState, action: DateRangePickerReducerAction, defaultReducer: typeof dateRangePickerReducer) => DateRangePickerReducerState; /** * The initial state of the `DateRangePicker`. */ initialState?: Partial; /** * The callback function that is called when the `DateRangePicker` is changed. */ onAction?: (action: DateRangePickerReducerAction, state: DateRangePickerReducerState) => void; /** * The callback function that is called to validate the `DateRangePicker`. */ validate?: (state: DateRangePickerReducerState) => Error[] | null; /** * The callback function that is called to render the target of the `DateRangePicker`. */ renderTarget?: (args: RenderTargetParams) => ReactNode; /** * The callback function that is called to render the left footer of the `DateRangePicker`. */ renderLeftFooter?: (args: LeftFooterComponentArgs) => ReactNode; /** * The callback function that is called to render the right panel of the `DateRangePicker`. */ renderRightPanel?: (args: RightSidePanelComponentArgs) => ReactNode; /** * The size of the `DateRangePicker` button. */ buttonSize?: DateRangePickerDisplayProps["buttonSize"]; } & SharedDatePickerProps; /** * The `DateRangePicker` component allows selection of start and end dates using two calendars, ideal for planning and scheduling. * * See the [Date Range Picker documentation page](https://satellite.algolia.com/8261d6576/p/324e0b-date-range-picker) for more information. */ export declare const DateRangePicker: FC; export {};