I'm writing a REPL application using typescript with nodejs's built-in readline module. To build a customized shell, there is a need to change a small piece of implementation of readline's completer. I have found the source code of readline and would like to do a small fix from output += '\r\n\r\n'; to output += '\r\n'; at line 665.
I guess an approach is to have a patched version of readline.js and write a type declaration for it. But since readline is a built-in module, too many variables (e.g. primordials at line 65) are declared elsewhere and simply rewriting the source file leads to compile error. Redeclaring the module seems to be impractical.
Any workaround for this problem?