import type { FactoryPayload } from '../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/lib' import type { EmotionSx } from '@mantine/emotion' import type { EmotionStyles } from '../emotion/index.mjs' import type { ShadingColor } from '../theme/colors.mjs' import type { Color } from '../theme/theme.mjs' declare module '../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/lib' { interface MantineThemeColorsOverride { colors: Record } interface StylesApiPropsOverride { styles?: EmotionStyles } interface BoxProps { sx?: EmotionSx } } declare module '@mantine/core' { interface MantineThemeColorsOverride { colors: Record } interface StylesApiPropsOverride { styles?: EmotionStyles } interface BoxProps { sx?: EmotionSx } } export type TimeRange = RelativeTimeRange | AbsoluteTimeRange; export interface RelativeTimeRange { type: 'relative'; value: number; isFuture?: boolean; utcOffset?: number | string; } export interface AbsoluteTimeRange { type: 'absolute'; value: TimeRangeValue; } export type TimeRangeValue = [from: number, to: number]; export declare const DEFAULT_QUICK_RANGES: number[]; export declare const DEFAULT_TIME_RANGE: TimeRange; export declare const formatDuration: (seconds: number, short?: boolean) => string; export declare const toTimeRangeValue: (timeRange: TimeRange, offset?: number) => TimeRangeValue; export declare function fromTimeRangeValue(v: TimeRangeValue): AbsoluteTimeRange; export type URLTimeRange = { from: string; to: string; }; export declare const toURLTimeRange: (timeRange: TimeRange) => URLTimeRange; export declare const urlToTimeRange: (urlTimeRange: URLTimeRange) => TimeRange; export declare const urlToTimeRangeValue: (urlTimeRange: URLTimeRange) => TimeRangeValue; export declare const DEFAULT_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss"; export declare const DEFAULT_TIME_FORMAT_WITH_TIMEZONE = "YYYY-MM-DD HH:mm:ss Z"; export declare function addOffsetUTC(time: string | number | Date, utcOffset: number): Date; export declare const getUTCString: (offset: number) => string; export declare const timeFormatter: (timeValue: number | string | Date, utcOffset?: number | null, format?: string) => string; export interface UseTimeRangePickerProps { value: TimeRange; onChange?: (value?: TimeRange) => void; minDateTime?: () => Date; maxDateTime?: () => Date; maxDuration?: number; relativeFormatter?: (relativeRange: RelativeTimeRange) => string; absoluteFormatter?: (absoluteRange: AbsoluteTimeRange) => string; dateInputFormat?: (date: Date) => string; /** * the UTC offset in minutes. * User selected time will be treated as time in that timezone * If the input is less than 16 and greater than -16, it will interpret your input as hours instead. * It also can be a string like '+09:00' or '-01:00' * @see https://day.js.org/docs/en/manipulate/utc-offset */ utcOffset?: number | string; } /** * Hook for timezone-aware TimeRangePicker * * @example * ```tsx * const Component = () => { * const [value, setValue] = useState() * * // UTC+8 timezone (480 minutes) * const utcOffset = 480 * * // Use hook to convert timezone * const timeRangePickerProps = useTimeRangePicker({ * value, * onChange: setValue, * minDateTime: () => dayjs().subtract(1, 'day').toDate(), * maxDateTime: () => dayjs().add(1, 'day').toDate(), * utcOffset * }) * * // Use spread operator to pass converted props * return * } * ``` */ export declare const useTimeRangePicker: ({ value, onChange, minDateTime, maxDateTime, maxDuration, relativeFormatter, absoluteFormatter, dateInputFormat, utcOffset }: UseTimeRangePickerProps) => { value: AbsoluteTimeRange | { type: "relative"; value: number; isFuture?: boolean; utcOffset?: number | string; }; onChange: (localTimeRange?: TimeRange) => void; minDateTime: (() => Date) | undefined; maxDateTime: (() => Date) | undefined; maxDuration: number | undefined; relativeFormatter: ((relativeRange: RelativeTimeRange) => string) | undefined; absoluteFormatter: ((absoluteRange: AbsoluteTimeRange) => string) | undefined; dateInputFormat: ((date: Date) => string) | undefined; timezone: number | undefined; };