Couldn't find it in the documentation. My question is, does TypeScript have a similar feature to this?
file1.js
module.exports = (service) =>
{
service.doSomeCoolStuff();
}
file2.js
const file2 = require('./file2')(service)
I need to pass the service object to another file and work with it. So, is there a TypeScript equivalent of this? I specifically need to use this exact syntax. I am aware it can be done using classes, but the requirement is to use this method.