import { InjectionToken } from '@angular/core'; /** * Describes a {@link RegExp} that matches and discovers context property names from a string. The * expression should bind the reference to the first captured group. It will always be executed * with a global `g` flag. * * @remarks See {@link STRING_INTERPOLATION_SCHEME} summary for more information */ export declare type StringInterpolationScheme = RegExp; /** * The {@link StringInterpolationScheme} used during the {@link StringInterpolator.interpolate} * operation. By default this regular expression will match any common unix environment variable * notation styled values in the form of `$parameter` while capturing the actual "context" property * name `parameter` inside the first expression group */ export declare const STRING_INTERPOLATION_SCHEME: InjectionToken; /** The {@link StringInterpolationReplaceFn} used during string interpolation operations */ export declare type StringInterpolationReplaceFn = (params: any, match: string, ...groups: string[]) => string; /** * The {@link StringInterpolationReplaceFn} used during the {@link StringInterpolator.interpolate} * operation. By default the replacer will exchange */ export declare const STRING_INTERPOLATION_REPLACER: InjectionToken; export declare class StringInterpolator { readonly interpolationScheme: StringInterpolationScheme; protected readonly replacer: StringInterpolationReplaceFn; constructor(interpolationScheme: StringInterpolationScheme, replacer: StringInterpolationReplaceFn); /** * Interpolates a given string value with any given context object. This * operation uses the provided {@link STRING_INTERPOLATION_SCHEME} expression to * properly discover and replace target values as desired * * @param value The string value that should be interpolated * @param params The context to use for the interpolation resolution * @param scheme Optional {@link StringInterpolationScheme} to use for the interpolation * @param replacer Optional {@link StringInterpolationReplaceFn} to use for the interpolation */ interpolate(value: string, params: any, scheme?: RegExp, replacer?: StringInterpolationReplaceFn): string; }