Skip to content

refactor: update type annotations for better type safety in normal components#1989

Open
nailoo wants to merge 1 commit intotscircuit:mainfrom
nailoo:type
Open

refactor: update type annotations for better type safety in normal components#1989
nailoo wants to merge 1 commit intotscircuit:mainfrom
nailoo:type

Conversation

@nailoo
Copy link
Contributor

@nailoo nailoo commented Mar 2, 2026

Summary

This PR improves type safety across several "normal components" by replacing generic as any type assertions with specific types from circuit-json. It also removes unnecessary @ts-ignore comments that were previously silencing type errors.

Changes

  • Type Safety Enhancements: Replaced as any with explicit circuit-json types in the following components:
    • Diode (using SourceSimpleDiode)
    • Mosfet (using SourceSimpleMosfet)
    • PowerSource (using SourceSimplePowerSource)
    • Transistor (using SourceSimpleTransistor)
    • VoltageSource (using SourceSimpleVoltageSource)
  • Cleanup: Removed // @ts-ignore comments where type safety is now correctly handled.
  • Imports: Added explicit type imports for the corresponding circuit-json definitions.

@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Mar 2, 2026 4:26am

Request Review

@nailoo
Copy link
Contributor Author

nailoo commented Mar 2, 2026

@MustafaMulla29 can you review it.

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