def test_component_event_trigger_arbitrary_args():
    """Test that we can define arbitrary types for the args of an event trigger."""

    def on_foo_spec(
        _e: ObjectVar[JavascriptInputEvent],
        alpha: Var[str],
        bravo: dict[str, Any],
        charlie: ObjectVar[_Obj],
    ):
        return [_e.target.value, bravo["nested"], charlie.custom.to(int) + 42]

    class C1(Component):
        library = "/local"
        tag = "C1"

        @classmethod
        def get_event_triggers(cls) -> dict[str, Any]:
            return {
                **super().get_event_triggers(),
                "on_foo": on_foo_spec,
            }

    C1.create(on_foo=C1State.mock_handler)
Test that we can define arbitrary types for the args of an event trigger.
tests/units/components/test_component.py