Expose Checker.getIndexInfoOfType on the unstable API - #64002
Open
Baptiste Jamin (baptistejamin) wants to merge 1 commit into
Open
Expose Checker.getIndexInfoOfType on the unstable API#64002Baptiste Jamin (baptistejamin) wants to merge 1 commit into
Baptiste Jamin (baptistejamin) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Baptiste Jamin (baptistejamin)
August 25, 2026 12:53
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Exposes Checker.getIndexInfoOfType through the synchronous and asynchronous unstable JavaScript APIs.
Changes:
- Adds protocol routing and serialization for index-info lookups.
- Implements sync and async checker methods.
- Adds coverage for matching, missing, and readonly index signatures.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tsc/internal/api/session.go |
Handles index-info requests. |
tsc/internal/api/proto.go |
Defines the protocol method and parameters. |
packages/typescript/src/api/proto.generated.ts |
Adds generated protocol typings. |
packages/typescript/src/api/sync/api.ts |
Exposes the synchronous API. |
packages/typescript/src/api/async/api.ts |
Exposes the asynchronous API. |
packages/typescript/test/sync/api.test.ts |
Tests synchronous behavior. |
packages/typescript/test/async/api.test.ts |
Tests asynchronous behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
getIndexInfoOfTypealready exists on the TypeScript 6 checker and internally in the Go checker (Checker.GetIndexInfoOfType), but it is not wired throughtypescript/unstable. This PR exports it on the JS API.Unlike the TS 6 surface (
IndexKind), this matches the Go checker: it takes the index key type (checker.getStringType(),checker.getNumberType(), or another key type) and returns that index info, orundefinedif none exists.Needed by typescript-eslint (
isTypeReadonly).