import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from '@internationalized/date'; import type { DOMProps, RangeValue, SpectrumLabelableProps, StyleProps } from '@react-types/shared'; import React, { ReactElement, ReactNode } from 'react'; export interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit, DOMProps { /** The content to display as the label. */ label: ReactNode; } type NumberValue = number | RangeValue; interface NumberProps { /** The value to display. */ value: T; /** Formatting options for the value. */ formatOptions?: Intl.NumberFormatOptions; } export type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time; type RangeDateTime = RangeValue; type DateTimeValue = DateTime | RangeDateTime; interface DateProps { /** The value to display. */ value: T; /** Formatting options for the value. */ formatOptions?: Intl.DateTimeFormatOptions; } interface StringProps { /** The value to display. */ value: T; /** Formatting options for the value. */ formatOptions?: never; } interface StringListProps { /** The value to display. */ value: T; /** Formatting options for the value. */ formatOptions?: Intl.ListFormatOptions; } interface ReactElementProps { /** The value to display. */ value: T; /** Formatting options for the value. */ formatOptions?: never; } type LabeledValueProps = T extends NumberValue ? NumberProps : T extends DateTimeValue ? DateProps : T extends string[] ? StringListProps : T extends string ? StringProps : T extends ReactElement ? ReactElementProps : never; type SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue | RangeValue | ReactElement; export type SpectrumLabeledValueProps = LabeledValueProps & LabeledValueBaseProps; /** * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and * lists according to the user's locale. */ export declare const LabeledValue: React.ForwardRefExoticComponent & React.RefAttributes>>; export {};