import { MtnaI18nDefaultOptions, MtnaI18nLanguageOption, MtnaLanguageId, MtnaLocaleId } from '../models'; import * as i0 from "@angular/core"; /** * A less opinionated, more generic version of the MtnaI18nService. It contains similar methods to the original, but allows for use of any types * of objects, as oppposed to strictly InternationalizedStrings. */ export declare class MtnaI18nGenericService { protected locale: string; protected _defaults?: MtnaI18nDefaultOptions | undefined; constructor(locale: string, _defaults?: MtnaI18nDefaultOptions | undefined); /** * Generates an array of internationalized objects from a list of available languages. * If no languages are provided, returns an array with 1 empty object. * @param options The available languages that can be generated * @param langPropName The property name matching the locales * @returns An array of default internationalized objects * @remarks the internationalized objects contain only the language property, no value properties */ createEmptyI18nObjects>(options?: MtnaI18nLanguageOption[], langPropName?: string): Array; /** * Generates an internationalized object for the current locale & sets the value, if provided. * @param value A value to set on the value property of the internationalized object. Defaults to undefined if not provided. * @returns An internationalized object for the current locale */ createI18nObjectForDefaultLocale>(value?: T[keyof T] | null): T; /** * Extracts a value from an internationalized object that matches the default locale. * If none match the locale, extracts from the i18n object with no defined language property, if it exists. * * @param i18nObjects The internationalized objects to search for a matching language * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the value for the default locale. */ getDefaultValue>(i18nObjects: T[] | null | undefined, langPropName?: string, valuePropName?: string): T[keyof T] | undefined; /** * Extracts a value from an internationalized object that matches a specific locale ID. * If none match the locale, extracts from the i18n object with no defined language property, if it exists. * * @param localeId The specific locale ID to extract, i.e. en-US * @param i18nStrings The internationalized objects to search for a matching language * @param fallbackToEmptyLanguage Whether to fall back to an i18n object without a defined language, defaults to false. * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the value for the specified locale */ getValue>(localeId: MtnaLocaleId | null | undefined, i18nObjects: T[] | null | undefined, fallbackToEmptyLanguage?: boolean, langPropName?: string, valuePropName?: string): T[keyof T] | undefined; /** * Get all the i18n objects that don't match a given localeId. * * @param localeId The specific locale ID to filter out, i.e. en-US * @param i18nObjects The internationalized objects to filter * @param includeEmptyLanguage Whether to include i18n objects without a specified language, defaults to false. * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the objects that don't match the given `localeId` */ getOtherI18nObjects>(localeId: MtnaLocaleId, i18nObjects: T[] | null | undefined, includeEmptyLanguage?: boolean, langPropName?: string, valuePropName?: string): T[]; /** * Given all the language options an application supports, * transform it into a unique array of language IDs. * * @param options all the i18n language options for an app * @returns a unique array of language IDs */ getUniqueLanguageIdsFromOptions(options: MtnaI18nLanguageOption[]): Array; /** * Sets a value on the internationalized object that matches the default locale, or has no locale. * If none match the conditions, appends a new i18n object for the default locale with the provided value. * @param newValue The value to set on the i18n object; Defaults to empty object if null or undefined. * @param i18nObjects The array of i18n objects for a given property * @returns An array of all provided i18n objects, with the new value set where relevant. */ setDefaultValue>(newValue: T[keyof T] | null | undefined, i18nObjects: T[] | null | undefined): T[]; /** * Sets a value on the internationalized object that matches the provided locale. * If none match the locale, creates a new internationalized object with the locale. * @param newValue The value to set on the internationalized object * @param localeId The specific locale ID to update, i.e. en-US * @param i18nObjects The internationalized objects to search for a matching language * @param fallbackToEmptyLanguage Whether to fall back to an i18n object without a defined language, defaults to false. * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the internationalized objects with relevant language updated/added */ setValue>(newValue: T[keyof T] | null | undefined, localeId: MtnaLocaleId, i18nObjects: T[] | null | undefined, fallbackToEmptyLanguage?: boolean, langPropName?: string, valuePropName?: string): T[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }