I have a javascript file called ui.js.
Inside ui.js is UI setup 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 don't want to convert the code to typescript as there are hundreds of lines and it's not really necessary. It just needs to be one once after the UI is ready.
It seems to me that I should be able to wrap it in a function, and then call that function from typescript.
But I have not been able to figure out how to do that.
Note: Not a duplicate of earlier question, as that was how to convert js, not use it directly with as little modification as possible.