Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert package interface to Typescript #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ws333
Copy link
Contributor

@ws333 ws333 commented Feb 19, 2025

It was challenging to split the rest into several PRs so here is the full conversion of package interface to typescript.

Some comments to the files added and important changes...

.prettierrc

  • To keep the same code formatting as before

esling.config.mjs

  • Copied from fresh vite react-ts project
  • A few relevant rules added and set to warn
  • There are two warnings for regexes in utils.ts and one warning in index.tsx about fast refresh that you can look at.

package.json

  • Moved development dependencies under devDependencies

packages/iframe-service/src/iframe-service.ts

  • Objects passed to messageChild did not match the type MessagePayload
  • After fixing this I narrowed down the type of payload passed to messageChild, and also messageParent in packages/interface/src/service.ts.

The delay input will now be set to 0 instead of blank when using backspace to delete the numbers.

I refactored some of the runtime code like generatePrefUpdate in settings-tab.tsx, since now passing a constructed event value instead of an empty string in clearClicked onChange in the ClearableInput component in common.tsx.

I also changed all event.target to event.currentTarget since some HTML element types don't have an event.target.

Tested with both browser and Thunderbird and seems to work as expected.

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