The return value is the error message of a string type created from the expressions given in the values.
Example usage
// Example usage.import { CommonError } from'@angular-package/error';constproblem='The given `age` parameter must be';constfix='Provided string type is not accepted, change to ';constid='AE: 427';consttemplate=`Issue({id}): {problem} of {type} between range {min} and {max}. {fix}{type}`;constadditional= { max:27, min:9, type:'number' };classTestError<Idextendsstring> extendsCommonError<Id> {publicstaticisError<Idextendsstring>( value:any, id?:Id ): value isCommonError<Id> {returnsuper.isError(value, id); }publicstaticdefineMessage( templateStringsArray:TemplateStringsArray,...values:any[] ):string {returnsuper.defineMessage(templateStringsArray,...values); }}// Returns// Issue(AE: 427): The given `age` parameter must be of number between range 9 and 27. Provided string type is not accepted, change to number
TestError.defineMessage`${problem}${fix}${id}${template}${additional}`;