In my node.js app, I have a TypeScript file (util.ts) that defines methods:
export function myFunc() { console.log(42); }
And I use it in another typescript file:
const util = require('./util');
util.myFunc();
This works fine, but the type of util const is any. How can I make it typed, in a way that when I type util., my editor will know how to auto-complete, and when I write:
util.myOtherFunc();
TypeScript compiler will fail and say that util doesn't have a myOtherFunc method?