I'm using typescript to write extension scripts for a program that has some objects, like File and Text, that duplicate definitions in lib.d.ts.
As a result, a definition like
declare File(x: string): object;
will cause a duplicate identifier error. Is there a way to selectively override or shadow the library definitions or otherwise replace them with my own?
Is there a way to selectively override or shadow the library definitions or otherwise replace them with my own?
Two options:
nolib
tsconfig option and adding your lib to your src. E.g. don't call your variable File
or window
or document
or location
or other known globals e.g. in node process
or global
The second option is ofcourse preferred. Its the cost of working with JavaScript.