import { RawTimeRange, TimeRange, TimeZone, IntervalValues, RelativeTimeRange, TimeOption } from '../types/time'; import { DateTime } from './moment_wrapper'; export declare function describeTextRange(expr: string): TimeOption; /** * Use this function to get a properly formatted string representation of a {@link @grafana/data:RawTimeRange | range}. * * @category TimeUtils * @param range - a time range (usually specified by the TimePicker) * @param timeZone - optional time zone. * @param quickRanges - optional dashboard's custom quick ranges to pick range names from. * @alpha */ export declare function describeTimeRange(range: RawTimeRange, timeZone?: TimeZone, quickRanges?: TimeOption[]): string; export declare const isValidTimeSpan: (value: string) => boolean; export declare const describeTimeRangeAbbreviation: (range: TimeRange, timeZone?: TimeZone) => string; export declare const convertRawToRange: (raw: RawTimeRange, timeZone?: TimeZone, fiscalYearStartMonth?: number, format?: string) => TimeRange; export declare function isRelativeTime(v: DateTime | string): boolean; export declare function isFiscal(timeRange: TimeRange): boolean; export declare function isRelativeTimeRange(raw: RawTimeRange): boolean; export declare function secondsToHms(seconds: number): string; export declare function msRangeToTimeString(rangeMs: number): string; export declare function calculateInterval(range: TimeRange, resolution: number, lowLimitInterval?: string): IntervalValues; export declare function describeInterval(str: string): { sec: number; type: string; count: number; }; export declare function intervalToSeconds(str: string): number; export declare function intervalToMs(str: string): number; export declare function roundInterval(interval: number): 1 | 10 | 20 | 100 | 1000 | 60000 | 3600000 | 86400000 | 31536000000 | 10000 | 50 | 200 | 500 | 2000 | 5000 | 20000 | 15000 | 30000 | 120000 | 300000 | 600000 | 900000 | 1200000 | 1800000 | 7200000 | 10800000 | 21600000 | 43200000 | 604800000 | 2592000000; /** * Converts a TimeRange to a RelativeTimeRange that can be used in * e.g. alerting queries/rules. * * @internal */ export declare function timeRangeToRelative(timeRange: TimeRange, now?: DateTime): RelativeTimeRange; /** * Converts a RelativeTimeRange to a TimeRange * * @internal */ export declare function relativeToTimeRange(relativeTimeRange: RelativeTimeRange, now?: DateTime): TimeRange; /** * @internal * Returns a RawTimeRange that has been converted so that from and to are strings */ export declare function formatRawTimeRange(range: RawTimeRange): RawTimeRange;