What is the TypeScript equivalent to `var x = require("somemod")();` What is the TypeScript equivalent to `var x = require("somemod")();` typescript typescript

What is the TypeScript equivalent to `var x = require("somemod")();`


I'm curious what the best way to replicate this import technique is in TypeScript

You need to split the import and the function call:

import jsreportCreator = require('jsreport-core');const jsreport = jsreportCreator();


I am pulling in the "@types/jsreport-core": "^1.5.1" in package.json's devDependencies and am using an import, for example:

import JsReport from 'jsreport-core';const jsReport = JsReport({    loadConfig: true});