Using,
import { XMLHttpRequest } from \'xmlhttprequest\';
On Node I get the following error when I compile with tsc
Can you try to do npm install @types/xmlhttprequest --save
in your command line.
If it gives you error, then it means that xmlhttprequest library does not support TypeScript.
That means that the library does not contain type definitions and nobody from the DefinitelyTyped project wrote them. So you can't have the compiler do any typechecking. You can still use the library either
import * as xhr from 'xmlhttprequest'
Or, depending on version of your compiler
const xhr = require('xmlhttprequest')