/** Zoom level of the timeline. Each mode is just a different px-per-day and tick granularity. */ export type ViewMode = "day" | "week" | "month" | "year"; export declare const MS_PER_DAY: number; /** * Horizontal zoom per mode. Bar geometry is always computed in px-per-day, so switching mode only * rescales the same linear axis — it never changes the bar maths (avoids variable-width month columns). */ export declare const PX_PER_DAY: Record; export interface DateRange { start: Date; end: Date; } /** A single header cell (a day/week/month for the minor row, a month/year for the major row). */ export interface Tick { key: string; /** Left offset in px from the range start. */ x: number; /** Cell width in px. */ width: number; label: string; } export interface TimeScale { mode: ViewMode; rangeStart: Date; rangeEnd: Date; pxPerDay: number; /** Total timeline width in px. */ width: number; /** Map a date to its x offset (px) from the range start. */ dateToX: (date: Date | number) => number; /** Inverse of `dateToX`. */ xToDate: (x: number) => Date; ticks: { minor: Tick[]; major: Tick[]; }; } /** Local-midnight start of the given day. */ export declare const startOfDay: (date: Date | number) => Date; /** * Parse a date input, reading date-only strings ("2026-07-01") as LOCAL midnight — `new Date()` * would read them as UTC midnight, which lands on the previous local day west of UTC. */ export declare const parseLocalDate: (value: string | number | Date) => Date; /** Last millisecond of the given day (23:59:59.999, local time). */ export declare const endOfDay: (date: Date | number) => Date; export declare const startOfMonth: (date: Date | number) => Date; export declare const startOfYear: (date: Date | number) => Date; export declare const addDays: (date: Date | number, days: number) => Date; /** Add calendar months, clamping to the last day of the target month (Jan 31 + 1 month → Feb 28/29). */ export declare const addMonths: (date: Date | number, months: number) => Date; /** Step a date by one `mode` unit (toolbar prev/next arrows). */ export declare const addViewModeStep: (date: Date, direction: 1 | -1, mode: ViewMode) => Date; /** Toolbar label for the focused date: "05 Jan 2026" (day/week), "January 2026" (month), "2026" (year). */ export declare const formatViewDateLabel: (date: Date, mode: ViewMode, locale?: string) => string; /** * Compute the visible date span: from the earliest start to the latest end, padded on both sides. * The end always keeps at least `horizonMonths` of runway after today, so a rental can be dragged / * extended well into the future even when every loaded booking ends sooner. Invalid dates (NaN) are * ignored — a single corrupt row must not poison the whole axis. Falls back to a window around today * when no valid date remains. */ export declare const computeRange: (tasks: { start: Date; end: Date; }[], padDays?: number, horizonMonths?: number) => DateRange; /** Map a date to its x offset (px) from `rangeStart`, at ms precision. */ export declare const dateToX: (date: Date | number, rangeStart: Date | number, pxPerDay: number) => number; /** Inverse of `dateToX`: map an x offset (px) back to a date. */ export declare const xToDate: (x: number, rangeStart: Date | number, pxPerDay: number) => Date; /** Snap a date to the nearest day boundary (midnight) — used when committing a dragged bar end. */ export declare const snapDateToDay: (date: Date | number) => Date; /** Build the two-tier header ticks (minor cells + their major groupings) for the given range and mode. */ export declare const getTicks: (rangeStart: Date, rangeEnd: Date, mode: ViewMode, locale?: string) => { minor: Tick[]; major: Tick[]; }; /** Build the full scale (range, zoom, width, converters, ticks) for a set of rows in a given mode. */ export declare const createTimeScale: (tasks: { start: Date; end: Date; }[], mode: ViewMode, locale?: string, padDays?: number) => TimeScale;