Skip to content

sdks/ts: replace any with proper types in SDK core#2857

Open
Myestery wants to merge 1 commit intomainfrom
fix/sdks-ts-type-improvements
Open

sdks/ts: replace any with proper types in SDK core#2857
Myestery wants to merge 1 commit intomainfrom
fix/sdks-ts-type-improvements

Conversation

@Myestery
Copy link
Contributor

@Myestery Myestery commented Mar 2, 2026

Summary

  • Replace any types with unknown, generics, and proper type constraints across ~15 SDK files
  • Use Reflect.construct for safe class instantiation in the decorator
  • Use Object.assign pattern for typed function objects in client generation
  • Add generic wrappers for deserialize/deserializeDataValue to maintain public API types while using unknown internally
  • Extract MethodKeys<T> helper type for cleaner Client<T> definition
  • Add MutableAgentStatics type to avoid (ctor as any).get = ... pattern

Context

Split from #2845 based on reviewer feedback. This PR focuses only on SDK type improvements, excluding:

Test plan

  • tsc --noEmit passes
  • All 163 tests pass across 11 test files
  • Rollup build succeeds

Replace `any` types with `unknown`, generics, and proper type
constraints across the SDK. Uses Reflect.construct for safe
instantiation, Object.assign for typed function objects, and
generic wrappers for deserialize functions.
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement. Please read the CLA and post the comment below to sign.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

1 participant