import * as i0 from '@angular/core'; import { OnChanges, OnDestroy, ElementRef, ChangeDetectorRef, NgZone, PipeTransform, Provider, ModuleWithProviders, EnvironmentProviders } from '@angular/core'; import { Observable, Subject } from 'rxjs'; declare abstract class TimeagoClock { abstract tick(then: number): Observable; } declare class TimeagoDefaultClock extends TimeagoClock { private platformId; constructor(platformId: Object); tick(then: number): Observable; private browserTick; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface IL10nsStrings { prefixAgo?: StringOrFn; prefixFromNow?: StringOrFn; suffixAgo?: StringOrFn; suffixFromNow?: StringOrFn; second?: StringOrFn; seconds?: StringOrFn; minute?: StringOrFn; minutes?: StringOrFn; hour?: StringOrFn; hours?: StringOrFn; day?: StringOrFn; days?: StringOrFn; week?: StringOrFn; weeks?: StringOrFn; month?: StringOrFn; months?: StringOrFn; year?: StringOrFn; years?: StringOrFn; wordSeparator?: string; numbers?: NumberArray; } /** * To modify the text displayed, create a new instance of TimeagoIntl and * include it in a custom provider */ declare class TimeagoIntl { strings: IL10nsStrings; /** * Stream that emits whenever the l10n strings are changed * Use this to notify directives if the l10n strings have changed after initialization. */ readonly changes: Subject; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type Unit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'; type Suffix = 'ago' | 'from now'; type StringOrFn = ((value: number, millisDelta: number) => string) | string; type NumberArray = [ string, string, string, string, string, string, string, string, string, string ]; declare abstract class TimeagoFormatter { abstract format(then: number): string; } declare class TimeagoDefaultFormatter extends TimeagoFormatter { format(then: number): string; private parse; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class TimeagoCustomFormatter extends TimeagoFormatter { private intl; constructor(intl: TimeagoIntl); format(then: number): string; private parse; /** * If the numbers array is present, format numbers with it, * otherwise just cast the number to a string and return it */ private normalizeNumber; /** * Take a string or a function that takes number of days and returns a string * and provide a uniform API to create string parts */ private normalizeFn; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class TimeagoDirective implements OnChanges, OnDestroy { private cd; private clock; private ngZone; private intlSubscription; private clockSubscription; /** * Emits on: * - Input change * - Intl change * - Clock tick */ stateChanges: Subject; /** The Date to display. An actual Date object or something that can be fed to new Date. */ get date(): any; set date(date: any); private _date; /** If the directive should update itself over time */ get live(): boolean; set live(live: boolean); private _live; constructor(intl: TimeagoIntl, formatter: TimeagoFormatter, element: ElementRef, cd: ChangeDetectorRef, clock: TimeagoClock, ngZone: NgZone); ngOnChanges(): void; setContent(node: any, content: string): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class TimeagoPipe implements PipeTransform, OnDestroy { private clock; private ngZone; private intlSubscription; private clockSubscription; private date; private value; private live; /** * Emits on: * - Input change * - Intl change * - Clock tick */ stateChanges: Subject; constructor(intl: TimeagoIntl, cd: ChangeDetectorRef, formatter: TimeagoFormatter, clock: TimeagoClock, ngZone: NgZone); transform(date: any, ...args: any[]): string; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface TimeagoModuleConfig { clock?: Provider; intl?: Provider; formatter?: Provider; } declare class TimeagoModule { /** * Use this method in your root module to provide the TimeagoModule */ static forRoot(config?: TimeagoModuleConfig): ModuleWithProviders; /** * Use this method in your other (non root) modules to import the directive/pipe */ static forChild(config?: TimeagoModuleConfig): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } interface TimeagoConfig { clock?: Provider; intl?: Provider; formatter?: Provider; } /** * Provides the TimeagoModule services for standalone components. * Use this function in your application config when using standalone components. * * @example * ```ts * import { provideTimeago } from 'ngx-timeago'; * * export const appConfig: ApplicationConfig = { * providers: [ * provideTimeago({ clock: { provide: TimeagoClock, useClass: MyClock } }) * ] * }; * ``` */ declare function provideTimeago(config?: TimeagoConfig): EnvironmentProviders; export { TimeagoClock, TimeagoCustomFormatter, TimeagoDefaultClock, TimeagoDefaultFormatter, TimeagoDirective, TimeagoFormatter, TimeagoIntl, TimeagoModule, TimeagoPipe, provideTimeago }; export type { IL10nsStrings, NumberArray, StringOrFn, Suffix, TimeagoConfig, TimeagoModuleConfig, Unit };