JetBrains: Increase type-safety of JS -> Java bridge
Created by: philipp-spiess
I saw some unsafe typings and wanted to fix it. Going forward we should probably also encode the expected return type to avoid casting it.
This PR:
- Changes the Action type to be an enum instead of a loosely typed object.
- Changes the mock to use an exhaustive switch so that we get a type error when we add a new action that is not implemented (as opposed to a runtime error)
Test plan
App preview:
Check out the client app preview documentation to learn more.