I have a Node server created as:
function createHttpServer(app) {
var http = require('http');
var server = http.createServer(app);
return server;
}
I am in the process of migrating our .js code into .ts code and I notice that when the extension is .js, I get type information for createServer. However, when I switch to .ts it becomes any, so I struggle with the correct typings.
This is what my tsconfig.json file looks like:
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"outDir": "./out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"types": [
"node"
],
"lib": ["es6"],
"module": "commonjs",
"pretty": true,
"allowSyntheticDefaultImports": true
}
}
Why, despite the node types, do I get any instead of the correct type information?
.jsextension.