I try to create a library using typescript and I would like to use a static method that allows me to render some HTML content that is returned to me by an api rest call based on the parameters I pass to that function now there is a way to create it using a architecture eg pattern repository, compile it and then use it as in the code below (in js format of course)?
<div id="test"></div>
<script scr="../myLybrary.js"></script>
<script type="module">
MyLibrary.render({
param: "test",
param1: "test",
param2: "test"
}, "test")
</script>
at the moment to create this situation I have to use an import in the script where the call to the static method resides in this way:
import MyLibrary from './myLybrary.js'
is there any way to avoid this last step?
Thanks to anyone who wants to help me.