Assuming from other posts that you compile your own variant and understand typescript, the send function in binding module all return a promise that contains the api response on resolve. Store it in a component variable and add the html code. Example from PrinterAction.ts
importFiles(slug: string, folder: RSBrowseFolder, files: ServerFolderState[], asJob: boolean) {
const arr = [];
for (const i of files) {
arr.push({name: i.name, url: "folder://" + folder.selectedFolder + i.path, job: asJob});
}
if (arr.length === 0) {
return;
}
const printer: PrinterState = this.printers.printers[slug];
this.connectionHandler.send("importURL", {files: arr, folder: printer.activeGroupId}).then((data) => {
if (data.ok) {
this.visualAid.bindProgressMsgToId(data.msgId, "Uploading Files");
this.visualAid.updateProgress({msgId: data.msgId, finished: false, progress: 0, ok: true});
}
}, () => {
});
}
You see call to importURL and later in then it gets the result of api call and from there you can do what you want.