Trying to create text string from interface to display into UI , Below code is creating separate file for each interface , How do i creat single file as i have given in the expected.
Also is there way to create UI to display typescript code as a sample instead of using text string ?
main.js
var path = "/filepath"
var data = [
{
name: "IParam"
},
{
name: "IError"
}
]
function createInterfaces(path, data) {
var _text = 'import { ';
$.each(data,function(id,val){
_text += val.name + '}' + 'from ' + path + ';\n\n';
});
return _text;
}
Expected Result should be
"import { IParam, IError} from '/filePath'";