Skip to content

[@typescript/api] Add a few more checker APIs#2972

Merged
andrewbranch merged 6 commits intomicrosoft:mainfrom
andrewbranch:api-features
Mar 4, 2026
Merged

[@typescript/api] Add a few more checker APIs#2972
andrewbranch merged 6 commits intomicrosoft:mainfrom
andrewbranch:api-features

Conversation

@andrewbranch
Copy link
Copy Markdown
Member

  • isContextSensitive
  • getReturnTypeOfSignature
  • getRestTypeOfSignature
  • getTypePredicateOfSignature
  • getBaseTypes
  • getPropertiesOfType
  • getIndexInfosOfType
  • getConstraintOfTypeParameter
  • getTypeArguments

Copilot AI review requested due to automatic review settings March 4, 2026 00:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds several additional TypeScript checker APIs to the @typescript/api surface by wiring new RPC methods through the Go API server and exposing them via the sync/async TypeScript client wrappers (with accompanying tests and enum generation).

Changes:

  • Add new checker RPC endpoints (e.g. isContextSensitive, signature/type queries) and snapshot signature-handle resolution on the Go server.
  • Expose new APIs and types in the TypeScript sync/async clients (including TypePredicate/IndexInfo) and generate TypePredicateKind.
  • Add sync + async API tests covering the new checker endpoints.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/checker/types.go Adds exported getters for TypePredicate and IndexInfo to support API serialization.
internal/checker/exports.go Exposes additional checker methods via exported wrappers used by the API server.
internal/api/session.go Adds signature-handle resolution and implements new checker request handlers + dispatch entries.
internal/api/proto.go Adds new method IDs, request param types, and response shapes for new checker RPCs.
_packages/api/src/sync/types.ts Adds TypePredicate and IndexInfo public type definitions for sync client.
_packages/api/src/async/types.ts Adds TypePredicate and IndexInfo public type definitions for async client.
_packages/api/src/sync/api.ts Adds new Checker methods and exports TypePredicateKind + related types (sync).
_packages/api/src/async/api.ts Adds new Checker methods and exports TypePredicateKind + related types (async).
_packages/api/src/proto.ts Adds TS-side protocol response typings for TypePredicateResponse and IndexInfoResponse.
_packages/api/src/enums/typePredicateKind.ts Adds generated runtime enum for TypePredicateKind.
_packages/api/src/enums/typePredicateKind.enum.ts Adds generated TypeScript enum TypePredicateKind.
_packages/api/test/sync/api.test.ts Adds sync tests covering newly added checker APIs.
_packages/api/test/async/api.test.ts Adds async tests covering newly added checker APIs.
Herebyfile.mjs Hooks TypePredicateKind into enum generation pipeline.

Comment thread internal/api/proto.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread _packages/api/src/proto.ts Outdated
@andrewbranch andrewbranch requested a review from jakebailey March 4, 2026 18:07
@andrewbranch andrewbranch enabled auto-merge March 4, 2026 18:25
@andrewbranch andrewbranch added this pull request to the merge queue Mar 4, 2026
Merged via the queue into microsoft:main with commit e369990 Mar 4, 2026
21 checks passed
@andrewbranch andrewbranch deleted the api-features branch March 4, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants