Is there a way to change the appearance of a specific typescript module for those importing it?
I have webpack rules that modify the exports of this module during transpile time, which is why I want to override its appearance.
In my custom.d.ts
file, I have a custom module declaration:
declare module '*.worker' {
class WebpackWorker extends Worker {
constructor();
}
export default WebpackWorker;
}
When I try to import this module like so:
import MyWorker from './test.worker';
const worker = new MyWorker();
It seems that the custom module declaration does not recognize the type definitions in my custom.d.ts file. Is it possible to override the exported types of a local module?