import { TZDate } from '@date-fns/tz'; import { EachDayOfIntervalOptions } from 'date-fns'; import type { Precision } from '../../../core/time/shared.types.js'; import type { StringTimeOffset } from '../../../core/time/timeframeStore/calendar.types.js'; import { type TimeValue } from '../../../core/types/time.js'; import type { CalendarState } from '../../calendar/types/shared-types.js'; /** * Returns an array of dates within the specified time interval. * * @returns An array with starts of days from the day of the interval start to the day of the interval end * * @example * Each day between 6 October 2014 and 10 October 2014: * const result = eachDayOfInterval({ * start: new Date(2014, 9, 6), * end: new Date(2014, 9, 10) * }) * => [ * Mon Oct 06 2014 00:00:00, * Tue Oct 07 2014 00:00:00, * Wed Oct 08 2014 00:00:00, * Thu Oct 09 2014 00:00:00, * Fri Oct 10 2014 00:00:00 * ] * * @internal */ export declare function eachDayOfInterval(interval: { start: TZDate | number | string; end: TZDate | number | string; }, options?: EachDayOfIntervalOptions): TZDate[]; /** * Sanitizes Timeframe to have a from date that comes before the to date and ensures the times are applied properly. * @internal */ export declare function sortTimeframeValues(value: { from: TimeValue | null; to: TimeValue | null; }, min?: TimeValue | null, max?: TimeValue | null, precision?: 'minutes' | 'seconds' | 'milliseconds'): { from: TimeValue | null; to: TimeValue | null; }; export declare function resetRegionalFormatErrorFlag(): void; /** * Returns a "safe" regional format string by replacing problematic language codes * with 'en' (English) while preserving the region, and by removing any extra subtags. * This is used to avoid issues with certain languages or day period formats that may * not be supported or may cause formatting errors. * * - If the language part of the locale is in a known problematic list, it is replaced with 'en'. * - If the locale contains more than two subtags (e.g., 'ja-JP-u-ca-japanese'), it is truncated to 'ja-JP'. * * @internal */ export declare function getSafeRegionalFormat(): string; /** * Gets the dayPeriod values such as AM/PM, a.m./p.m. etc. depending on the user's region. * @internal */ export declare const getDayPeriodValues: () => string[]; /** * parses a timeValue and converts it to a TZDate. * @internal */ export declare function timeValueToDate(timeValue: TimeValue | undefined, relativeDate: number): TZDate | null; /** * Converts a given Date or ISO string to the TimeValue structure for the calendar value. * @internal */ export declare const getTimeValueFromSimpleValue: (candidate?: string | Date | null, timeOffset?: StringTimeOffset, position?: CalendarState["position"], isExpression?: boolean, min?: TimeValue | null, max?: TimeValue | null, precision?: "day" | "minutes" | "seconds" | "milliseconds") => TimeValue | null; /** * For 'date' type, it adjusts the time by the timezone offset to ensure the * date is correct without time information. * For 'time' and 'datetime' types, it returns the ISO string as is. */ export declare const convertDateOnlyToDateTime: (isoString: string | undefined, type: "time" | "date" | "datetime" | undefined) => string; /** * Converts a raw TimeValue to the correct calendarValue shape. * When precision is 'day', the absoluteDate/value fields must contain a full * ISO datetime string (produced by convertDateOnlyToDateTime) rather than the * date-only string stored in dateTimePickerValue. */ export declare function toCalendarValue(value: TimeValue | null | undefined, precision: Precision | undefined): TimeValue | null; /** * Filters the Grail min or max date. * Returns `undefined` if the provided limit is the default Grail min or max and the value is not outside the Grail range. * Otherwise, returns the custom min or max limit. * @internal */ export declare function filterOutGrailLimit(value: { from: string | null | TimeValue; to: string | null | TimeValue; } | null, limit?: string): string | undefined;