Skip to content
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

Imported types from external libraries resolve to any #92

Closed
millsp opened this issue Oct 21, 2019 · 4 comments
Closed

Imported types from external libraries resolve to any #92

millsp opened this issue Oct 21, 2019 · 4 comments
Labels
Playground Issues that affect the Playground

Comments

@millsp
Copy link

millsp commented Oct 21, 2019

In this example, the type X resolved to any instead of:

// an opaque type of x
"x" & {
    __type: "x";
}

And this shouldn't work but does autocomplete on the import. It is incorrect because Concat can only be accessed from tb.T or tb.Tuple. So it seems like there is a confusion between namespaces and modules with the playground.

I think it is important to note that types which are exposed from top-level (not modules in modules) do work. But not when you have types -> in modules -> in modules. Something that is of the form:

ModuleA:					# A Module   that exports
 - SubModuleA1				# Submodules that export
   - Types					# Multiple types
 - SubModuleA2
   - Types
ModuleB:
 - SubModuleB1
   - Types
 - SubModuleB2
   - Types
export All:					# All parents exported
 - ModuleA
 - ModuleB
@orta orta added the Playground Issues that affect the Playground label Oct 21, 2019
@orta
Copy link
Contributor

orta commented Oct 21, 2019

Thanks - Yeah, I think this could only be fixed by moving to a completely virtual fs based ATA - which is something Monaco-typescript explicitly doesn't want to support.

Not sure how we're going to bridge that gap in the long run yet.

@millsp
Copy link
Author

millsp commented Oct 27, 2019

Maybe this could be resolved thanks to microsoft/TypeScript#4433

@orta
Copy link
Contributor

orta commented Mar 10, 2021

Improvements over time to ATA have fixed this:

Screen Shot 2021-03-10 at 9 14 19 AM

@orta orta closed this as completed Mar 10, 2021
@millsp
Copy link
Author

millsp commented Mar 10, 2021

Amazing! Thank you :) Now I can have doc examples with playground links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Playground Issues that affect the Playground
Projects
None yet
Development

No branches or pull requests

2 participants