Skip to content

Handle TSIndexedAccessType #367

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

Closed
thchia opened this issue Jun 1, 2019 · 0 comments · Fixed by #369
Closed

Handle TSIndexedAccessType #367

thchia opened this issue Jun 1, 2019 · 0 comments · Fixed by #369

Comments

@thchia
Copy link
Contributor

thchia commented Jun 1, 2019

There currently isn't a handler for TSIndexedAccessType:

type ABC = {
  foo: string
}

type DEF = {
  bar: ABC["foo"] // <-- indexed type
}

The output for bar is { name: "unknown" }. Expected output would be either:

{ name: "string" } or;
{ name: "ABC[\"foo\"]" }

I believe there is an ongoing discussion in #366 over which of these 2 it should be (based on whether ABC is declared as a type or an interface), but either way currently it is neither.

I'm happy to attempt a PR but I have zero experience with AST so perhaps only if this doesn't get picked up by someone more capable 😃

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant