Skip to content

Handle TSIndexedAccessType #367

Closed
@thchia

Description

@thchia

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 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions