Expose getStringLiteralType and getNumberLiteralType on the TypeChecker, plus remove /** @internal */ from several useful methods. #52473
+32
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Expose the following on the TypeChecker:
Fixes #50694
I opened a suggestion issue #50694 to suggest exposing
getStringLiteralTypeandgetNumberLiteralType. The rationale was that they would help avoid questionable and hacky code in an ES-Lint rule I was working on and that they would be useful to other developers using the TypeChecker. All of the other methods were technically available on the TypeChecker, but not "visibile" due to having been marked /** @internal */. This PR exposes the two recommended in #50694 and removes the Internal designation on several others that are useful for developers leveraging the TypeChecker.@andrewbranch suggested that I create the PR myself, so I did :-)
I read the Contributing.md, and I'm aware of the following:
And I'm also aware that I don't have such a label from a TS project maintainer, but at Andrew's suggestion, I have created the PR anyway. Please let me know if there is anything else I can do to make the PR better or the review process easier.