Add "removeExportFromDeclarations" definition file option. - #38
Conversation
Bitburner's Script Editor (using Monaco) provides types from the definition file ambiently. To do so, Bitburner modifies the definition file in this same way before providing it to Monaco (https://github.com/bitburner-official/bitburner-src/blob/2e83ba9ce9b688540d9f60cf4b0245fd53bea9e0/src/ScriptEditor/ui/Editor.tsx#L48). Now that Bitburner can execute TS natively, I would like the same experience outside of Bitburner when developing scripts. I currently need to strip `import` lines that refer to the unmodified definition file, or else sync the definition file back into Bitburner so scripts can refer to the modified definition file. I think this should actually be the responsibility of Bitburner rather than RFA implementors, but the Bitburner team has already specified they won't fix this and consider it the responsibility of each RFA implementation (bitburner-official/bitburner-src#2471).
|
I've tested this by installing this modified package as a "file:" dependency in https://github.com/danielmirchandani/bitburner-typescript which is based on Bitburner's official typescript-template. Including the definition file in my "tsconfig.json" allows my scripts to use these types without an explicit |
This relies on bitburner-official/bitburner-filesync#38 to make the inside and outside TS experiences as similar as possible.
|
I ran |
catloversg
left a comment
There was a problem hiding this comment.
Optional: Add this new option to the config example in README.md.
Bitburner's side was updated in bitburner-official/bitburner-src#2473.
Done. |
|
Do you have any feedback on the name of the option, or the description? I admit it's a bit mysterious unless you already know why you need this option. |
|
"ambient" is not very descriptive, but I don't have any good suggestions. Maybe you should ask on Discord (the suggestion channel) for more feedback. |
|
I think the actions definitions are so old that they won't even run, so I won't hold that against you. |
Bitburner's Script Editor (using Monaco) provides types from the definition file ambiently. To do so, Bitburner modifies the definition file in this same way before providing it to Monaco (https://github.com/bitburner-official/bitburner-src/blob/2e83ba9ce9b688540d9f60cf4b0245fd53bea9e0/src/ScriptEditor/ui/Editor.tsx#L48). Now that Bitburner can execute TS natively, I would like the same experience outside of Bitburner when developing scripts. I currently need to strip
importlines that refer to the unmodified definition file, or else sync the definition file back into Bitburner so scripts can refer to the modified definition file.I think this should actually be the responsibility of Bitburner rather than RFA implementors, but the Bitburner team has already specified they won't fix this and consider it the responsibility of each RFA implementation (bitburner-official/bitburner-src#2471).