import { type IntlShape } from 'react-intl'; import type { RequireAtLeastOne } from 'type-fest'; import type { TimeValue, TimeframeV2 } from '../../../core/types/time.js'; import type { TimeframeSelectorPresetItemProps } from '../../../filters/timeframe-selector/Item.js'; import type { TimeframeSelectorProps } from '../../../filters/timeframe-selector/TimeframeSelector.js'; import { DateTimePickerType } from '../../date-time-picker/types.js'; /** @internal */ export declare const messages: { ms: { description: string; defaultMessage: string; id: string; }; s: { description: string; defaultMessage: string; id: string; }; m: { description: string; defaultMessage: string; id: string; }; h: { description: string; defaultMessage: string; id: string; }; d: { description: string; defaultMessage: string; id: string; }; w: { description: string; defaultMessage: string; id: string; }; M: { description: string; defaultMessage: string; id: string; }; q: { description: string; defaultMessage: string; id: string; }; y: { description: string; defaultMessage: string; id: string; }; requiredTimeframe: { defaultMessage: string; id: string; description: string; }; requiredFrom: { defaultMessage: string; id: string; description: string; }; requiredTo: { defaultMessage: string; id: string; description: string; }; invalid: { description: string; defaultMessage: string; id: string; }; invalidFrom: { defaultMessage: string; description: string; id: string; }; invalidTo: { defaultMessage: string; id: string; description: string; }; invalidTimeframe: { defaultMessage: string; id: string; description: string; }; invalidOrder: { defaultMessage: string; id: string; description: string; }; outsideRange: { defaultMessage: string; id: string; description: string; }; now: { description: string; defaultMessage: string; id: string; }; to: { description: string; defaultMessage: string; id: string; }; tomorrow: { description: string; defaultMessage: string; id: string; }; today: { description: string; defaultMessage: string; id: string; }; yesterday: { description: string; defaultMessage: string; id: string; }; 'roundDown-s': { description: string; defaultMessage: string; id: string; }; 'roundDown-m': { description: string; defaultMessage: string; id: string; }; 'roundDown-h': { description: string; defaultMessage: string; id: string; }; 'roundDown-d': { description: string; defaultMessage: string; id: string; }; 'roundDown-w': { description: string; defaultMessage: string; id: string; }; 'roundDown-M': { description: string; defaultMessage: string; id: string; }; 'roundDown-q': { description: string; defaultMessage: string; id: string; }; 'roundDown-y': { description: string; defaultMessage: string; id: string; }; 'full-day': { description: string; defaultMessage: string; id: string; }; 'remaining-day': { description: string; defaultMessage: string; id: string; }; }; /**@internal */ export declare function isExpressionString(candidate: string): boolean; /** @internal */ export declare function getTimeValue(candidate?: TimeValue | string | null, precision?: 'minutes' | 'seconds' | 'milliseconds', type?: DateTimePickerType, relativeNow?: number): TimeValue | undefined | null; /** @internal */ export declare function mapToTimeframeV2(value: RequireAtLeastOne<{ from: string; to: string; }> | RequireAtLeastOne, precision?: 'minutes' | 'seconds' | 'milliseconds'): RequireAtLeastOne | null; /** * You can use the `_parseValue` utility function to convert a Timeframe or TimeframeV2 value into an object containing `from` and `to` * `TimeValue`s or null values. If `fallbackToNow` is set to true, the `to` value falls back to `now` in case the to value is empty. * @internal */ export declare function parseValue(value: RequireAtLeastOne<{ from: string; to: string; }> | RequireAtLeastOne | null, fallbackToNow?: boolean, precision?: 'minutes' | 'seconds' | 'milliseconds'): { from: TimeValue | null; to: TimeValue | null; }; /** * Formatter that displays sanitized time value strings. * @internal */ export declare function formatTimeValue(input: TimeValue | Omit | string | null, precision?: TimeframeSelectorProps['precision']): string; /** * Formatter that gets the formatted time value strings. * @internal */ export declare function getFormattedTimeValue(timeValue: TimeValue | null, precision?: TimeframeSelectorProps['precision'], showTimeOnly?: boolean): string; /** * Returns the from and to string values from a TimeframeV2 or its shorthand version. * @internal */ export declare function getFromToValues(value?: Partial<{ from: string; to: string; }> | RequireAtLeastOne | null): { valueFrom?: undefined; valueTo?: undefined; } | { valueFrom: string | undefined; valueTo: string | undefined; }; /** * Returns the display value string for a given timeframe. * @internal */ export declare function formatTimeframe(value: TimeframeV2 | TimeframeSelectorPresetItemProps['value'] | null, intl: IntlShape, precision?: 'minutes' | 'seconds' | 'milliseconds'): { displayValue: string; isInvalid: boolean; hint: string; }; /** * Extracts the display value string from the from and to time values. * @internal */ export declare function extractDisplayValueFromTimeValues(from: TimeValue | null, to: TimeValue | null, intl: IntlShape, precision?: 'minutes' | 'seconds' | 'milliseconds', valueFrom?: string, valueTo?: string): { displayValue: string; isInvalid: boolean; hint: string; }; /** * @internal */ export declare function formatDetails(details: TimeValue, intl: IntlShape, precision?: TimeframeSelectorProps['precision'], showTimeOnly?: boolean, isRelativeToNow?: boolean): string; /** * Gets the formatted min and max values that are used in the translated messages. * @internal */ export declare function getFormattedMinMax(min?: string, max?: string, precision?: TimeframeSelectorProps['precision']): { min: string; max: string; }; /** * Gets the translated message to show when a value is outside the min and/or max * @internal */ export declare function getOutsideRangeMessage(intl: IntlShape, min?: string, max?: string, precision?: TimeframeSelectorProps['precision']): string;