ngx-timeago
Version:
Live updating timestamps in Angular 6+.
29 lines (28 loc) • 1.11 kB
TypeScript
import { TimeagoIntl } from './timeago.intl';
export type Unit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
export type Suffix = 'ago' | 'from now';
export type StringOrFn = ((value: number, millisDelta: number) => string) | string;
export type NumberArray = [string, string, string, string, string, string, string, string, string, string];
export declare abstract class TimeagoFormatter {
abstract format(then: number): string;
}
export declare class TimeagoDefaultFormatter extends TimeagoFormatter {
format(then: number): string;
private parse;
}
export 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;
}