import { DateValue } from "react-aria-components/Calendar"; import { DateRange } from "react-aria-components/DateRangePicker"; export type BuiltInDatePresetKey = 'today' | 'yesterday' | 'tomorrow'; export type BuiltInDateRangePresetKey = BuiltInDatePresetKey | 'this-week' | 'next-7-days' | 'next-30-days' | 'last-7-days' | 'last-30-days' | 'this-month' | 'this-quarter'; export interface CustomPreset { /** * Identifier used to key the preset. Defaults to the label. Must be * unique among the given presets: colliding ids make the selection * ambiguous. */ id?: string; label: string; /** * The value the preset selects. Pass a function to resolve the value at * selection time, so relative presets stay correct in long-lived views. * Resolvers also run on every render of the preset list (to derive the * active and disabled options and the small-screen sublabels), so they * must be pure and cheap. */ value: T | (() => T); } export type CustomDatePreset = CustomPreset; export type CustomDateRangePreset = CustomPreset; export type DatePreset = BuiltInDatePresetKey | CustomDatePreset; export type DateRangePreset = BuiltInDateRangePresetKey | CustomDateRangePreset; export type { DateRange };