I want to modify the prototype of the nodejs module module.
@types/node has an interface defined for this (NodeModule) but don't has anything when I import the module, so I have to require it.
import * as Module from "module"; // Error
var Module = require("module"); // Ok
The problem is that Module don't has any definition. Is returned as any.
I have this
export interface CustomNodeModule extends NodeModule {
__thingy:()=>void;
}
Module.prototype.__thingy = function() {
// things!
}
I have to create my own CustomNodeModule interface, but, how can I modify the Module prototype and also those functions know that they are part of a CustomNodeModule instance?