import { ComponentInterface } from '../../stencil-public-runtime'; /** * @name Relative Time * @category Text * @summary Use for displaying time differences like "2 hours ago" or "in 3 days". */ export declare class Q2RelativeTime implements ComponentInterface { /** * @private * Used to manage the sync timer that updates the time since the component was connected to the DOM. * Will be set to null if a valid `baseDate` is provided. */ syncTimer: any; /** @private Will be set to true if a valid `baseDate` is provided. */ trimSuffix: boolean; hostElement: HTMLElement; displayedMessage: string; /** * If you want to display the length of time between two specific dates, you can provide a valid `date` and `baseDate`, and the component will display the length of time between the two dates. * * If `baseDate` is not provided, the date and time at render will be used instead and - if `sync` is true - updated every second to reflect the time between the `date` value and the time at render. * * @warning * - Requires a valid `date` value. * - If the provided `baseDate` is invalid, the component will display "Invalid Date" and a warning message will be printed in the console. * - Providing a valid `baseDate` will disable `sync` and remove the "in"/"ago" suffixes in the time message. * - Must be a valid ISO date string. */ baseDate: Date | string; /** * The date you want to calculate relative time from. * * @warning * - Must be a valid ISO date string. * - If the provided `date` is invalid, the component will display "Invalid Date" and a warning message will be printed in the console. */ date: Date | string; /** * The language used for the displayed message. * @info * It is recommended to use the BCP 47 Language Tags in the ["language-extlang" format](https://www.w3.org/International/articles/language-tags/). */ locale: string; /** The length of the relative time message. */ messageFormat: 'long' | 'short' | 'narrow'; /** * Determines if the displayed message will use numeric or relative values. *@info * Set this property to `always` to force the use of numeric values (e.g. "1 day ago") rather than relative ones (e.g. "yesterday"). */ numeric: 'always' | 'auto'; /** * Keep the displayed message updated as time passes in the webpage. * @warning * If a valid `baseDate` is provided, `sync` will be set to `false`. */ sync: boolean; /** Enforces the use of the provided unit of measurement in the displayed message. */ unit: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year'; connectedCallback(): void; disconnectedCallback(): void; componentWillLoad(): void | Promise; /** Retrieves the value of the displayed messages. */ displayedMessageValue(): Promise; /** Checks the provided baseDate prop is a valid date. */ validBaseDateProp(): Promise; /** Checks the provided date prop is a valid date. */ validDateProp(): Promise; updateMessage(): void; syncUpdated(): void; get baseDateObject(): Date; get dateObject(): Date; get handleNumeric(): 'always' | 'auto'; get isBaseDateProvided(): boolean; get isValidBaseDate(): boolean; get isValidDate(): boolean; get isValidUnit(): boolean; get shouldShow(): boolean; trimMessage(message: string): string; render(): any; }