How would one go about loading a module from npm, which when imported provides a single function that acts as a factory, returning a class implementation rather than an instance?
By way of example, I have included npm module thinbus-srp in Gradle. I create an external function in Kotlin with appropriate JsModule & JsNonModule annotations (I use the browser method, rather the client method), returning a type.
Per the test code for thinbus-srp, after calling this factory function, you create an instance. Said type is defined as an external class, which I populate with applicable methods, including generateRandomSalt.
My code loads correctly loads the factory and seems to correctly create an instance. But I get told there is no such function, when I call browserClientInstance.generateRandomSalt().
Using a breakpoint in chrome, I can see I do indeed have an instance, but it is not present in the properties list of the object. It is defined in the prototype of the instance though.
This seems to imply that it may also be a problem even when not doing this Kotlin.
Why would this be experienced?
How would one go about using such a module like thinbus-srp and correctly expose these methods that do exist?