-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Exporting imported types as a namespace #20273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found a related issue - #4529 Not sure if that's the most recent on this. |
You can often get around this with notion like this:
or
|
thanks yeah your solution works in general, but for interfaces, I get that error though "using as value, but only refers to a type", so I have to use the solution/answer that's in the StackOverflow link at the top. |
The notation that I used works for me with interfaces/types too. Example TestInterfaces.ts
TestLibrary.ts
The problem exists if you try to do an aliased/selective import. The following will generate the error that you cite: TestLibrary.ts
An there is no pretty way to bundle these aliased interfaces/types unless you do something cumbersome like this: TestLibrary.ts
I agree that just having a convenient re-export notation like you have stated would be optimum. |
I also meant to say, if you want to keep the convenience of
But it's still not pretty. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
I solved this problem with the accepted answer to this question: |
This question is a bit tricky and I fear I won't get an answer on StackOverflow:
the question is here:
https://stackoverflow.com/questions/47500855/exporting-imports-as-a-namespace-with-typescript
Essentially I want to group together various types from other files into one namespace X. So the types are not declared in namespace X, but they are later grouped into namespace X after the fact. Hopefully that makes sense.
A simple scenario would look like:
we can sort of do this with a const:
but the problem is, for interfaces, I get the error:
The text was updated successfully, but these errors were encountered: