import { DateTimeFormatOptions } from 'luxon'; import { Observable } from 'rxjs'; import { ChangeDetectorRef, ElementRef, InjectionToken, NgZone, Renderer2 } from '@angular/core'; import { UiFormatDirective } from '@uipath/angular/directives/internal'; import * as i0 from "@angular/core"; /** * The date format display type options. */ export type DisplayType = 'absolute' | 'relative'; /** * Timezone resolver type. */ export type TimezoneResolver = () => string; /** * The date format options schema. */ export interface IDateFormatOptions { /** * Stream that triggers a re-render of the component. * */ redraw$: Observable; /** * The timezone in which the date should be displayed. * */ timezone: string | TimezoneResolver; /** * Overwrites the default content type. * */ contentType?: DisplayType; /** * Overwrites the default title type. * */ titleType?: DisplayType; /** * Overwrites the default dateformat. * */ format?: string | DateTimeFormatOptions; } /** * `ui-dateformat` injection token for the `options`. * */ export declare const UI_DATEFORMAT_OPTIONS: InjectionToken; export declare const resolveTimezone: (options: IDateFormatOptions) => string; /** * A directive that formats a given `Date` input in a `relative` or `absolute` format. * * Depends On: * - [luxon](https://www.npmjs.com/package/luxon) * - [humanize-duration](https://www.npmjs.com/package/humanize-duration) * * @export */ export declare class UiDateFormatDirective extends UiFormatDirective { private _options; private _cd; private _zone; /** * What format should the content have, `absolute` or `relative`. * */ contentType: DisplayType; /** * What format should the `[data-title]` attribute have, `absolute` or `relative`. * * This title attribute is exposed in order to easily integrate with `tooltip` components. * * eg: * `` */ titleType: DisplayType; /** * The `timezone` for which the current date is displayed. * */ timezone?: string; /** * The input `Date` that needs to be formatted. * */ set date(date: Date | string | undefined | null); get date(): Date | string | undefined | null; /** * The `luxon` format defaults to `DateTime.DATETIME_SHORT_WITH_SECONDS. * */ dateFormat: string | DateTimeFormatOptions; protected _text?: HTMLElement; private get _relativeTime(); private get _absoluteTime(); private _lastAbsoluteTime?; private _lastRelativeTime?; private _lastContentType?; private _lastTitleType?; private _date?; /** * @ignore */ constructor(_options: IDateFormatOptions, _cd: ChangeDetectorRef, _zone: NgZone, renderer: Renderer2, elementRef: ElementRef); private _evaluate; private _updateContent; private _updateTitle; private _isStringFormat; private _isRelative; private _timeForTypeChanged; private _timeForType; private _isDifferentValue; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }