Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Timestamp/Timestamp.d.ts

raw
1 /// <reference types="react" />
2 export declare enum TimestampFormat {
3 full = "full",
4 long = "long",
5 medium = "medium",
6 short = "short"
7 }
8 export declare enum TimestampTooltipVariant {
9 default = "default",
10 custom = "custom"
11 }
12 export interface TimestampTooltip {
13 /** The variant of the tooltip. The "default" variant displays the date passed into
14 * the timestamp's date prop as a UTC string.
15 */
16 variant: 'default' | 'custom';
17 /** Content displayed in the tooltip when using the "custom" variant. */
18 content?: React.ReactNode;
19 /** Additional props passed to the tooltip. */
20 tooltipProps?: any;
21 /** A custom suffix to apply to a "default" variant tooltip. */
22 suffix?: string;
23 }
24 export interface TimestampProps extends React.HTMLProps<HTMLSpanElement> {
25 /** Displays custom content inside the timestamp, such as a relative time. This prop will
26 * override the default content that is displayed. Custom content will not be affected by
27 * any props that format or add to displayed content.
28 */
29 children?: React.ReactNode;
30 /** Class to add to the outer span. */
31 className?: string;
32 /** Applies custom formatting to the displayed date and/or time. Passing this prop in will
33 * override the dateFormat and timeFormat props.
34 */
35 customFormat?: {
36 [key: string]: string;
37 };
38 /** Determines the default content that is displayed inside the timestamp and the value of
39 * the inner time element's datetime attribute. */
40 date?: Date;
41 /** Determines the format of the displayed date in the timestamp and UTC tooltip. Examples:
42 * "Full" => Tuesday, August 9, 2022;
43 * "Long" => August 9, 2022;
44 * "Medium" => Aug 9, 2022;
45 * "Short" => 8/9/22
46 */
47 dateFormat?: 'full' | 'long' | 'medium' | 'short';
48 /** Applies a custom suffix to the displayed content, usually after the time, such as a
49 * custom time zone.
50 */
51 displaySuffix?: string;
52 /** Flag for displaying the time in a 12 hour format. If this prop is not passed in,
53 * the hour format will be based on the locale prop's value.
54 */
55 is12Hour?: boolean;
56 /** Determines which locale to use in the displayed content. Defaults to the current locale
57 * when this prop is not passed in. For more information about locale's:
58 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation
59 */
60 locale?: string;
61 /** Flag indicating whether the default content should be displayed as a UTC string
62 * instead of a local string.
63 */
64 shouldDisplayUTC?: boolean;
65 /** Determines the format of the displayed time in the timestamp and UTC tooltip. Examples:
66 * "Full" => 11:25:00 AM Eastern Daylight Time
67 * "Long" => 11:25:00 AM EDT
68 * "Medium" => 11:25:00 AM
69 * "Short" => 11:25 AM
70 */
71 timeFormat?: 'full' | 'long' | 'medium' | 'short';
72 /** Adds a tooltip to the timestamp. */
73 tooltip?: TimestampTooltip;
74 }
75 export declare const Timestamp: React.FunctionComponent<TimestampProps>;
76 //# sourceMappingURL=Timestamp.d.ts.map