pretty-ngx-translate
Version:
The internationalization (i18n) library for Angular 2+
26 lines (25 loc) • 903 B
TypeScript
export declare abstract class TranslateParser {
/**
* Interpolates a string to replace parameters
* "This is a {{ key }}" ==> "This is a value", with params = { key: "value" }
* @param expr
* @param params
* @returns {string}
*/
abstract interpolate(expr: string | Function, params?: any): string;
/**
* Gets a value from an object by composed key
* parser.getValue({ key1: { keyA: 'valueI' }}, 'key1.keyA') ==> 'valueI'
* @param target
* @param key
* @returns {string}
*/
abstract getValue(target: any, key: string): any;
}
export declare class TranslateDefaultParser extends TranslateParser {
templateMatcher: RegExp;
interpolate(expr: string | Function, params?: any): string;
getValue(target: any, key: string): any;
private interpolateFunction(fn, params?);
private interpolateString(expr, params?);
}