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

Viewed 3002

In node.js I'm using jsreport-core and they do their import like var jsreport = require('jsreport-core')(); with the trailing (). I'm curious what is the best way to replicate this import technique is in TypeScript?

2 Answers

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
});
Related