8000 Add new syntax to import namespaces · Issue #2956 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Add new syntax to import namespaces #2956
Closed
@mikehaas763

Description

@mikehaas763

Opening this separate issue as suggested by @mhegazy in the PR mentioned below. I'm not the most informed on this issue but I am opening it because I do not want it to get lost/forgot.

Quoting @mhegazy here:

@ahejlsberg proposed a import * from "mod" syntax to do that a while back. and in this case it would be import * from namespace. the problem here is it makes it harder to do a syntactic transformation on a single file, as the compiler needs to have the full program information to know how things should be qualified. it is something that we are looking into, i would recommend filing a new issue for this instead of having the discussion on this PR.

The PR is just renaming internal modules to namespaces to avoid any confusion with ES6 modules. this is something we got feedback for regularly from customers.

Now that TypeScript has renamed internal modules to namespaces and has the namespace keyword (PR #2923) it would be nice to be able to import a namespace and then have access to the types defined on that namespace. Would this essentially just be a new syntax to do what /// <reference path> does?

What are the obstacles and concerns for this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Out of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0