import * as i0 from '@angular/core'; import { PipeTransform, OnDestroy, ChangeDetectorRef, InjectionToken } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { SkyAppAssetsService } from '@skyux/assets'; import { Observable } from 'rxjs'; /** * The currency symbol's location. */ type SkyI18nCurrencySymbolLocation = 'prefix' | 'suffix'; /** * Used to describe a locale-specific currency format. */ interface SkyI18nCurrencyFormat { /** * The ISO 4217 currency code. */ isoCurrencyCode: string; /** * The fractional decimal character. */ decimalCharacter: string; /** * The grouping character, e.g. '(1,000)'. */ groupCharacter: string; /** * The locale. */ locale: string; /** * The numeric precision (i.e., decimal places). */ precision: number; /** * The currency symbol (e.g., '$'). */ symbol: string; /** * The symbol's location relative to the number. */ symbolLocation: SkyI18nCurrencySymbolLocation; } /** * Used to format a currency within a given locale. */ declare class SkyI18nCurrencyFormatService { #private; /** * Gets a currency's format. * @param isoCurrencyCode the ISO 4217 Currency Code. Defaults to 'USD'. * @param locale the locale. Defaults to 'en-US'. Examples: 'en-US', 'en-GB', 'fr-FR'. */ getCurrencyFormat(isoCurrencyCode?: string, locale?: string): SkyI18nCurrencyFormat; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type SkyLibResources = Record; /** * @internal */ declare function getLibStringForLocale(resources: Record, preferredLocale: string, name: string): string | undefined; /** * @internal * @deprecated Use `getLibStringForLocale` instead. */ declare function getStringForLocale(resources: Record>, preferredLocale: string, name: string): string | undefined; interface SkyAppLocaleInfo { locale: string; } declare class SkyAppLocaleProvider { get defaultLocale(): string; getLocaleInfo(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class SkyAppResourceNameProvider { getResourceName(name: string): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type ResourceKey$1 = string; type TemplatedResource$1 = [ResourceKey$1, ...any[]]; type ResourceDictionary$1 = Record; /** * An Angular service for interacting with resource strings. */ declare class SkyAppResourcesService { #private; constructor(http: HttpClient, assets: SkyAppAssetsService, localeProvider: SkyAppLocaleProvider, resourceNameProvider: SkyAppResourceNameProvider); /** * Gets a resource string based on its name. * @param name The name of the resource string. * @param args Any templated args. */ getString(name: string, ...args: any[]): Observable; /** * Gets a Resource String Dictionary. * * This is similar to forkJoin's dictionary syntax. * * @param dictionary a Record of **SomeObjectKey** to a Value that is either * - (1) **ResourceKey** * - (2) or an **Array** where the first item is the **ResourceKey** and the other items are template args. * @return an `Observable` of a resource string dictionary in the same shape as the passed dictionary. * * @example * ```typescript * service.getStrings({ * simpleKey: 'hello', * arraySyntax: ['hi'], * arraySyntaxWithTemplateArgs: ['template', 'a', 'b'], * } * ``` */ getStrings(dictionary: T): Observable<{ [K in keyof T]: string; }>; /** * Gets a resource string for a specific locale based on its name. * @param localeInfo The locale to use. * @param name The name of the resource string. * @param args Any templated args. */ getStringForLocale(localeInfo: SkyAppLocaleInfo, name: string, ...args: any[]): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * An Angular pipe for displaying a resource string. */ declare class SkyAppResourcesPipe implements PipeTransform, OnDestroy { #private; constructor(changeDetector: ChangeDetectorRef, resourcesSvc: SkyAppResourcesService); /** * Transforms a named resource string into its value. * @param name The name of the resource string. */ transform(name: string, ...args: any[]): string; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * @deprecated `SkyLibResourcesProvider` is no longer needed and will be removed in a future major version of SKY UX. * @internal */ declare abstract class SkyLibResourcesProvider { abstract getString: (localeInfo: SkyAppLocaleInfo, name: string) => string | undefined; } type ResourceKey = string; type TemplatedResource = [ResourceKey, ...any[]]; type ResourceDictionary = Record; declare class SkyLibResourcesService { #private; private static resources; constructor(localeProvider: SkyAppLocaleProvider, providers?: SkyLibResourcesProvider[], resourceNameProvider?: SkyAppResourceNameProvider); /** * Adds locale resources to be used by library components. */ static addResources(localeResources: Record): void; /** * Gets a resource string based on its name. * @param name The name of the resource string. * @param args Any templated args. */ getString(name: string, ...args: any[]): Observable; /** * Gets a Resource String Dictionary. * * This is similar to forkJoin's dictionary syntax. * * @param dictionary a Record of **SomeObjectKey** to a Value that is either * - (1) **ResourceKey** * - (2) or an **Array** where the first item is the **ResourceKey** and the other items are template args. * @return an `Observable` of a resource string dictionary in the same shape as the passed dictionary. * * @example * ```typescript * service.getStrings({ * simpleKey: 'hello', * arraySyntax: ['hi'], * arraySyntaxWithTemplateArgs: ['template', 'a', 'b'], * } * ``` */ getStrings(dictionary: T): Observable<{ [K in keyof T]: string; }>; getStringForLocale(info: SkyAppLocaleInfo, name: string, ...args: any[]): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class SkyLibResourcesPipe implements PipeTransform, OnDestroy { #private; constructor(changeDetector: ChangeDetectorRef, resourcesService: SkyLibResourcesService); transform(name: string, ...args: any[]): string; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class SkyI18nModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class SkyIntlDateFormatter { static format(date: Date, locale: string, pattern: string): string; } declare enum SkyIntlNumberFormatStyle { Decimal = 0, Percent = 1, Currency = 2 } interface SkyIntlNumberFormatterOptions { minimumIntegerDigits?: number; minimumFractionDigits?: number; maximumFractionDigits?: number; currency?: string | null; currencySign?: 'standard' | 'accounting'; currencyDisplay?: 'code' | 'symbol' | 'narrowSymbol' | 'name'; } declare abstract class SkyIntlNumberFormatter { static format(num: number, locale: string, style: SkyIntlNumberFormatStyle, opts?: SkyIntlNumberFormatterOptions): string; } /** * @deprecated `SKY_LIB_RESOURCES_PROVIDERS` is no longer needed and will be removed in a future major version of SKY UX. * @internal */ declare const SKY_LIB_RESOURCES_PROVIDERS: InjectionToken; type SkyAppResources = Record; export { SKY_LIB_RESOURCES_PROVIDERS, SkyAppLocaleProvider, SkyAppResourceNameProvider, SkyAppResourcesPipe, SkyAppResourcesService, SkyI18nCurrencyFormatService, SkyI18nModule, SkyIntlDateFormatter, SkyIntlNumberFormatStyle, SkyIntlNumberFormatter, SkyLibResourcesPipe, SkyLibResourcesProvider, SkyLibResourcesService, getLibStringForLocale, getStringForLocale }; export type { SkyAppLocaleInfo, SkyAppResources, SkyI18nCurrencyFormat, SkyI18nCurrencySymbolLocation, SkyLibResources };