microsoft / microsoft/TypeScript

make `checker.getAllPossiblePropertiesOfTypes` a public method

Open
#38,184 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: API
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

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 https://github.com/styleguidist/react-docgen-typescript/pull/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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating checker.getAllPossiblePropertiesOfTypes and the completions API, then inspect the external usage in react-docgen-typescript's src/parser.ts around line 513. Confirm the public API surface and verify that callers can access the method without changing existing runtime behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.