@ngx-easy-i18n-js/http-loader
Version:
Http loader for ngx-easy-i18n-js
31 lines (30 loc) • 1.17 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { EasyI18nMessages } from 'easy-i18n-js';
import { EasyI18nLoader } from '@ngx-easy-i18n-js/core';
import { CanActivateFn } from '@angular/router';
export interface IScopedHttpEasyI18nLoaderScope {
/**
* Url prefix, Array of prefix
*/
prefix: string | string[];
/**
* Alias
*/
scope?: string;
}
export interface IScopedHttpEasyI18nLoaderOptions {
/**
* Url suffix, default '.json'
*/
suffix?: string;
}
export declare class ScopedHttpEasyI18nLoader extends EasyI18nLoader {
readonly httpClient: HttpClient;
readonly scopes: IScopedHttpEasyI18nLoaderScope[];
readonly options?: IScopedHttpEasyI18nLoaderOptions | undefined;
private readonly list;
constructor(httpClient: HttpClient, scopes: IScopedHttpEasyI18nLoaderScope[], options?: IScopedHttpEasyI18nLoaderOptions | undefined);
getMessages(locale: string): Observable<EasyI18nMessages>;
}
export declare function appendScopedHttpEasyI18nLoader(scopes: IScopedHttpEasyI18nLoaderScope[], options?: IScopedHttpEasyI18nLoaderOptions): CanActivateFn;