So I have a 3d party library which is loaded from external url and places its class on the window. Simplified class definition is something like this:
type Th