Module interfaces #179
gustavopch
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sometimes you need a lot of files to have the same structure, the same exports. For example, route files in Remix. All those files follow the contract defined by Remix, but there's currently no way in TypeScript to represent that contract, you need to manually type each export:
So the same way we can type an object and then TS knows exactly the shape it must have, we could have the same for the whole module:
We must read this issue to get insights: microsoft/TypeScript#38511
Beta Was this translation helpful? Give feedback.
All reactions