UNPKG

@singleton-i18n/js-core-sdk

Version:

A JavaScript Singleton client library for internationalization and localization that leverage data from Singleton service. The library works both for the browser and as a Node.js module.

31 lines (30 loc) 786 B
export interface HttpRequestOptions { timeout?: number; withCredentials?: boolean; headers?: HttpHeaders; } export interface HttpHeaders { [key: string]: string; } export declare abstract class Loader { abstract getI18nResource(url: string, options: HttpRequestOptions): Promise<{ [key: string]: any; }>; } declare class RestLoader implements Loader { /** * Get the i18n resource from VIP server in async mode. * By default, timeout time 3 sec. * * @param {string} url * @returns {*} * @memberof VIPRestLoader */ private logger; constructor(); getI18nResource(url: string, options: HttpRequestOptions): Promise<{ [key: string]: any; }>; } export declare const defaultLoader: RestLoader; export {};