ts: add missing types for conditional exports - #1137
Conversation
|
@fanatid Would you have some time to review this? This PR will unblock a slew of projects for us. Thanks in advance. |
|
I do not know TS good enough for approval that everything ok but LGTM. |
|
FYI: I patched this onto my local source and it did not fix the TS autocompletion issue. |
|
I think the problem is more likely in |
Yeah, I also think that problem in |
Odd, I did the same and it should work. How did you patch this? All this should do is build the definitions into the compiled index.d.ts file in the dist folder. It shouldn't have any effect on the outputted js files. Do you mean getting the
If we wanted to include strict typing with hints for the actual workspace program names, we'd need to somehow alter/add those definitions at build time. The |
|
I just tried adding these two exports and it seems to work for me (I simply added them to the source in the anchor repo, built, and then applied the corresponding transpiled bit in a hello-world test project). I don't think |
|
Yep- I was wrong. I was building into the wrong workspace. It was 3am here :) sorry! |

This adds type declarations for the conditional
workspaceandWalletexports, as detailed in response to the temporary solution in another issue.I don't think there's a way to conditionally declare them since all this is statically analyzed at build time.