import { t as Adapter } from "./adapter.types-CDV9mYni.js"; import { t as Grid } from "./grid.types-CRm-ZxMm.js"; import { t as Selection } from "./selection.types-0TRo8T6S.js"; //#region src/selection/selection.d.ts /** * Compute the next selection state when a day is clicked. * - **single**: click selects, click same deselects (returns null) * - **range**: 1st click = from, 2nd = to (auto-swap if before from), 3rd = reset * - **multi**: toggles the day in/out of the array */ declare function selectDay(adapter: Adapter.IDateAdapter, mode: M, currentValue: Selection.CalendarValue, clickedDay: TDate, options?: { shiftKey?: boolean; }): Selection.CalendarValue; /** * Decorate a grid with selection, disabled, and range flags. * Takes the raw output of `buildCalendarMonth()` and fills in * `isSelected`, `isDisabled`, `isRangeStart`, `isRangeEnd`, `isRangeMiddle`. * Returns a new array - never mutates the input. */ declare function applySelection(weeks: Grid.ICalendarWeek[], adapter: Adapter.IDateAdapter, mode: M, selected: Selection.CalendarValue, constraints?: Selection.ISelectionConstraints): Grid.ICalendarWeek[]; //#endregion //#region src/index.types.d.ts declare namespace Calendar { /** Which view the calendar is showing. */ type ViewMode = 'days' | 'months' | 'years'; /** Locale and direction settings for the calendar. */ interface ICalendarLocaleConfig { /** BCP 47 language tag, e.g. `'en-US'`, `'ar-SA'`, `'fa-IR'`. */ locale?: string | undefined; /** Which day starts the week. 0 = Sunday (default), 1 = Monday, etc. */ weekStartDay?: Adapter.WeekStartDay | undefined; /** Text direction. */ direction?: 'ltr' | 'rtl' | undefined; } /** * Full configuration for a calendar instance. * Generic over `TDate` (from the adapter) and `M` (selection mode). */ interface ICalendarConfig { /** The date adapter to use (e.g. `new NativeAdapter()`). */ adapter: Adapter.IDateAdapter; /** Selection mode. */ mode: M; /** Locale and direction settings. */ locale?: ICalendarLocaleConfig | undefined; /** Controlled month. */ month?: TDate | undefined; /** Default month for uncontrolled usage. */ defaultMonth?: TDate | undefined; /** Controlled selection value. Shape depends on `mode`. */ selected?: Selection.CalendarValue | undefined; /** Called when the selection changes. */ onSelect?: ((value: Selection.CalendarValue) => void) | undefined; /** Called when the displayed month changes. */ onMonthChange?: ((month: TDate) => void) | undefined; /** How many months to show side by side. Default `1`. */ numberOfMonths?: number | undefined; /** Show days from previous/next month to fill the grid. Default `true`. */ showOutsideDays?: boolean | undefined; /** Always show 6 weeks so the grid height doesn't jump. Default `false`. */ fixedWeeks?: boolean | undefined; /** Dates that cannot be selected. Array or predicate function. */ disabled?: TDate[] | ((date: TDate) => boolean) | undefined; /** Earliest selectable date. */ fromDate?: TDate | undefined; /** Latest selectable date. */ toDate?: TDate | undefined; /** Called when the user presses Escape. */ onDismiss?: (() => void) | undefined; } } //#endregion //#region src/grid/grid.d.ts /** * Build a 2D grid of day cells for a given month. * Returns weeks x 7 days. Selection flags default to `false` - use `applySelection()` to fill them. */ declare function buildCalendarMonth(adapter: Adapter.IDateAdapter, viewDate: TDate, config: Pick, 'showOutsideDays' | 'fixedWeeks' | 'locale'>): Grid.ICalendarMonth; /** * Build grids for multiple consecutive months. * Used when `numberOfMonths > 1` for multi-month calendar displays. */ declare function buildMultiMonth(adapter: Adapter.IDateAdapter, startMonth: TDate, count: number, config: Pick, 'showOutsideDays' | 'fixedWeeks' | 'locale'>): Grid.ICalendarMonth[]; /** Month entries for year picker. Adapter-driven count handles variable systems (Hebrew 13-month leap). */ declare function buildCalendarYear(adapter: Adapter.IDateAdapter, viewDate: TDate, locale?: string): Grid.IYearEntry[]; /** Build 12 year entries for the decade picker (decade + 1 before/after for context). */ declare function buildDecadeView(adapter: Adapter.IDateAdapter, viewDate: TDate): Grid.IDecadeEntry[]; //#endregion export { Calendar as a, buildMultiMonth as i, buildCalendarYear as n, applySelection as o, buildDecadeView as r, selectDay as s, buildCalendarMonth as t };