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

Added handleTSIndexedAccessType. #369

Merged
merged 1 commit into from Jul 14, 2019
Merged

Conversation

thchia
Copy link
Contributor

@thchia thchia commented Jun 1, 2019

Fixes #367

I'm new to working with ASTs, and welcome any feedback. I also had some issues with type narrowing in Flow, resulting in the use of $Shape<>.

typeParams,
);

// We only get the signature if the objectType is a type (vs interface)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not for interfaces?

Copy link
Contributor Author

@thchia thchia Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devongovett actually I'm not 100% sure why, but I believe in my trial and error when defining the objectType as an interface, there is no signature property on it. I'm not sure if it is related to the discussion here?

Edit:

// getTSType.js Line 185

function handleTSInterfaceDeclaration(path: NodePath): FlowSimpleType {
  // Interfaces are handled like references which would be documented separately,
  // rather than inlined like type aliases.
  return {
    name: path.node.id.name,
  };
}

@sylvesteraswin
Copy link

@thchia, thanks a lot for working on this. Whats the process on this PR?

@thchia
Copy link
Contributor Author

thchia commented Jun 29, 2019

@sylvesteraswin at this stage I’m still waiting on any additional comments from @devongovett :)

@danez
Copy link
Collaborator

danez commented Jul 14, 2019

I think we need to look at interfaces in a separate change. I think the change (for object types) makes sense.

@danez danez merged commit c1dce84 into reactjs:master Jul 14, 2019
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle TSIndexedAccessType
4 participants