Skip to content

make checker.getAllPossiblePropertiesOfTypes a public method #38184

Open
@hipstersmoothie

Description

Search Terms

compiler, getAllPossiblePropertiesOfTypes, union, intersection, checker, Public API

Suggestion

Change the checker.getAllPossiblePropertiesOfTypes from private to public

Use Cases

This is the only easy way to calculate all the possible properties of an object and is used by the completions API to provide suggestion.

I am currently using this API in styleguidist/react-docgen-typescript#247 to document react props.

Examples

https://github.com/styleguidist/react-docgen-typescript/blob/master/src/parser.ts#L513

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

BTW I would be happy to make these changes myself and submit a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions