I'm using URL utility: https://developer.mozilla.org/en-US/docs/Web/API/URL and I have a problem using it in Typescript code.
Whereas I can open the console in the browser and type:
error TS2351: Cannot use 'new' with an expression whose type lacks a
call or construct signature.
That should be supported by TypeScript, actually that's included on lib.dom.d.ts which is included by default if your target is es5.
You can also configure it on tsconfig.json (that is the default config when using es5, but you can try to add it explicitly):
"lib": [ "dom", "es5", "scripthost" ],