UNPKG

@team-internet/apiconnector

Version:
33 lines (32 loc) 1.39 kB
/** * ResponseTranslator class */ export declare class ResponseTranslator { /** * Regular Expression Mapping for API DESCRIPTION Property translation */ private static descriptionRegexMap; /** * translate a raw api response * @param raw API raw response * @param cmd requested API command * @param ph list of place holder vars * @returns new translated raw response */ static translate(raw: string, cmd: any, ph?: any): string; /** * Finds a match in the given text and performs replacements based on patterns and placeholders. * * This function searches for a specified regular expression pattern in the provided text and * performs replacements based on the matched pattern, command data, and placeholder values. * * @param regex The regular expression pattern to search for. * @param newraw The input text where the match will be searched for. * @param val The value to be used in replacement if a match is found. * @param cmd The command data containing replacements, if applicable. * @param ph An array of placeholder values for further replacements. * * @return Returns non-empty string if replacements were performed, empty string otherwise. */ protected static findMatch(regex: string, newraw: string, val: string, cmd?: any, ph?: any): string; }