Skip to content

Conversation

@wnqqnw19
Copy link

@wnqqnw19 wnqqnw19 commented Dec 8, 2025

Refactor: improve type safety and migrate entry scripts to TypeScript

  • Replace any types with proper types in store.ts and background-connection.ts
  • Replace TemporaryMessageDataType with MessageDataType for better type safety
  • Convert contentscript.js, offscreen.js, and ui.js to TypeScript
  • Add proper type annotations and interfaces for all converted files
  • Fix Chrome extension API type issues with proper type assertions
  • Replace console.warn with log.warn in background-connection.ts
  • Replace require() with dynamic import() in offscreen.ts for ES module compatibility

This improves type safety across the codebase and sets the foundation for further TypeScript migrations. The converted files maintain full backward compatibility while providing better IDE support and compile-time error checking.

Files changed:

  • ui/store/store.ts: Fixed preloadedState type, replaced TemporaryMessageDataType
  • ui/store/background-connection.ts: Improved API types, replaced console with log
  • app/scripts/contentscript.ts: Converted from JS to TS with proper types
  • app/scripts/offscreen.ts: Converted from JS to TS, fixed Chrome API types
  • app/scripts/ui.ts: Converted from JS to TS, added interfaces and type aliases

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

CLA Signature Action:

Thank you for your submission, we really appreciate it. We ask that you read and sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just by adding a comment to this pull request with this exact sentence:

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

By commenting with the above message you are agreeing to the terms of the CLA. Your account will be recorded as agreeing to our CLA so you don't need to sign it again for future contributions to this repository.

0 out of 1 committers have signed the CLA.
@wnqqnw19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants