You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to find a request like this but have not found anything so feel free to close this one if it has already been requested elsewhere.
Feature Request
So with that out of the way is it possible that the TS team could look at adding the ability to output interfaces as symbols when compiling? currently interfaces are stripped out and empty files are left in their place, which is fine, but it would be good if we could tell the compiler to output a symbol into the files which would allow at runtime some referencing of the interface.
This is primarily useful for DI related scenarios but I am sure it would be useful for other use cases.
Current behavior:
exportinterfaceIFoo{// innards not really important}
outputs an empty file
Requested behavior:
exportinterfaceIFoo{// innards not really important}
outputs a file containing
/*module specific export stuffs*/IFoo=Symbol.for("IFoo");
As you can see the interface name has been used as the symbol name and exposed variable.
You can tie this to an optional compiler arg like -emitInterfaceSymbols or something similar.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
I have tried to find a request like this but have not found anything so feel free to close this one if it has already been requested elsewhere.
Feature Request
So with that out of the way is it possible that the TS team could look at adding the ability to output interfaces as symbols when compiling? currently interfaces are stripped out and empty files are left in their place, which is fine, but it would be good if we could tell the compiler to output a symbol into the files which would allow at runtime some referencing of the interface.
This is primarily useful for DI related scenarios but I am sure it would be useful for other use cases.
Current behavior:
outputs an empty file
Requested behavior:
outputs a file containing
As you can see the interface name has been used as the symbol name and exposed variable.
You can tie this to an optional compiler arg like
-emitInterfaceSymbols
or something similar.Example use cases
would output (syntax may not be 100% accurate, but hopefully shows the concept)
This would then allow at runtime for you to be able to reference the interface in a unique way without breaking any existing functionality.
The text was updated successfully, but these errors were encountered: