UNPKG

angular-l10n

Version:

An Angular library to translate messages, dates and numbers

28 lines (27 loc) 1.13 kB
import { L10nConfigRef } from "../models/l10n-config"; /** * Implement this class-interface to create a custom storage for default locale, currency & timezone. */ export declare abstract class LocaleStorage { /** * This method must contain the logic to read the storage. * @param name 'defaultLocale', 'currency' or 'timezone' * @return A promise with the value of the given name */ abstract read(name: 'defaultLocale' | 'currency' | 'timezone'): Promise<string | null>; /** * This method must contain the logic to write the storage. * @param name 'defaultLocale', 'currency' or 'timezone' * @param value The value for the given name */ abstract write(name: 'defaultLocale' | 'currency' | 'timezone', value: string): Promise<void>; } export declare class L10nStorage implements LocaleStorage { private configuration; private hasCookie; private hasStorage; constructor(configuration: L10nConfigRef); read(name: string): Promise<string | null>; write(name: string, value: string): Promise<void>; private getName; }