angular-l10n
Version:
Angular library to translate texts, dates and numbers
34 lines (33 loc) • 1.61 kB
TypeScript
import { L10nNumberFormatOptions, L10nDateTimeFormatOptions, L10nLocale } from '../models/types';
import * as i0 from "@angular/core";
/**
* Implement this class-interface to create a validation service.
*/
export declare abstract class L10nValidation {
/**
* This method must contain the logic to convert a string to a number.
* @param value The string to be parsed
* @param options A L10n or Intl NumberFormatOptions object
* @param language The current language
* @return The parsed number
*/
abstract parseNumber(value: string, options?: L10nNumberFormatOptions, language?: string): number | null;
/**
* This method must contain the logic to convert a string to a date.
* @param value The string to be parsed
* @param options A L10n or Intl DateTimeFormatOptions object
* @param language The current language
* @return The parsed date
*/
abstract parseDate(value: string, options?: L10nDateTimeFormatOptions, language?: string): Date | null;
static ɵfac: i0.ɵɵFactoryDeclaration<L10nValidation, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<L10nValidation>;
}
export declare class L10nDefaultValidation {
private locale;
constructor(locale: L10nLocale);
parseNumber(value: string, options?: L10nNumberFormatOptions, language?: string): number | null;
parseDate(value: string, options?: L10nDateTimeFormatOptions, language?: string): Date | null;
static ɵfac: i0.ɵɵFactoryDeclaration<L10nDefaultValidation, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<L10nDefaultValidation>;
}