UNPKG

@ngneat/transloco

Version:

The internationalization (i18n) library for Angular

77 lines (76 loc) 3.3 kB
import { InjectionToken, ModuleWithProviders } from '@angular/core'; import { TranslocoLoader } from './transloco.loader'; import { HashMap, Translation } from './types'; import { Observable } from 'rxjs'; import { TranslocoConfig } from './transloco.config'; import { TranslocoService } from './transloco.service'; export interface TranslocoTestingOptions { translocoConfig?: Partial<TranslocoConfig>; preloadLangs?: boolean; langs?: HashMap<Translation>; } export declare class TestingLoader implements TranslocoLoader { private langs; constructor(langs: HashMap<Translation>); getTranslation(lang: string): Observable<Translation> | Promise<Translation>; } export declare function initTranslocoService(service: TranslocoService, langs: HashMap<Translation>, options: TranslocoTestingOptions): () => Promise<void> | Promise<HashMap<any>[]>; export declare class TranslocoTestingModule { static forRoot(options: TranslocoTestingOptions): { ngModule: typeof TranslocoTestingModule; providers: (({ provide: InjectionToken<{}>; useClass: typeof import("./transloco.transpiler").DefaultTranspiler; deps: InjectionToken<{}>[]; } | { provide: InjectionToken<{}>; useClass: typeof import("./transloco-missing-handler").DefaultHandler; deps?: undefined; } | { provide: InjectionToken<{}>; useClass: typeof import("./transloco.interceptor").DefaultInterceptor; deps?: undefined; } | { provide: InjectionToken<import("./transloco-fallback-strategy").TranslocoFallbackStrategy>; useClass: typeof import("./transloco-fallback-strategy").DefaultFallbackStrategy; deps: InjectionToken<{}>[]; })[] | { provide: InjectionToken<HashMap<HashMap<any>>>; useValue: HashMap<HashMap<any>>; useFactory?: undefined; deps?: undefined; multi?: undefined; useClass?: undefined; } | { provide: InjectionToken<TranslocoTestingOptions>; useValue: TranslocoTestingOptions; useFactory?: undefined; deps?: undefined; multi?: undefined; useClass?: undefined; } | { provide: InjectionToken<(() => void)[]>; useFactory: typeof initTranslocoService; deps: (typeof TranslocoService | InjectionToken<HashMap<HashMap<any>>>)[]; multi: boolean; useValue?: undefined; useClass?: undefined; } | { provide: InjectionToken<HashMap<any>>; useClass: typeof TestingLoader; useValue?: undefined; useFactory?: undefined; deps?: undefined; multi?: undefined; } | { provide: InjectionToken<{}>; useValue: TranslocoConfig; useFactory?: undefined; deps?: undefined; multi?: undefined; useClass?: undefined; })[]; }; /** @deprecated - use forRoot instead */ static withLangs(langs: HashMap<Translation>, config?: Partial<TranslocoConfig>, options?: TranslocoTestingOptions): ModuleWithProviders<TranslocoTestingModule>; }