I have a javascript file called ui.js.
Inside ui.js is the UI installation code.
if (!("ontouchstart" in document.documentElement)) { document.documentElement.className += " no-touch"; var jScrollOptions = { autoReinitialise: true, autoReinitialiseDelay: 100 }; $('.box-typical-body').jScrollPane(jScrollOptions); $('.side-menu').jScrollPane(jScrollOptions); $('.scrollable-block').jScrollPane(jScrollOptions); }
}
I would like to be able to call this from typescript.
I do not want to convert the code to typescript, since there are hundreds of lines, and this is really not necessary. It just needs to be once after the user interface is ready.
It seems to me that I should be able to wrap it in a function and then call this function from typescript.
But I could not figure out how to do this.
Note. This is not a duplicate of an earlier question, as it was how to convert js, and not use it directly with minimal changes.
source share