Clean up syntax for importing and using nested type declarations #39935
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Search Terms
Suggestion
The current syntax for importing nested modules is confusing. For example, to specifically use a single property from an interface I would need to do something like this:
From what I understand, import is not importing anything here. It's confusing and looks like it's doing something totally different at first glance. In this case, I could also use
type Bind = interfaces.Bind
, but I don't want to create a new resource.A much nicer syntax would be adding a
use
ortake
keyword, or adding support for importing nested modulesUse Cases
This suggestion is just for readability and developer experience.
Examples
Importing nested modules with
use
ortake
importing nested interface/namespace values:
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: