With the old js interop one could define function arguments with strong typing:
@JS()
class FooOld{
external void bar(void Function(String e) callback);
}
With the new js_interop this doens't seem to be possible
@JS()
extension type Foo._(JSObject _) implements JSObject {
// compile error:
// Type 'void Function(String)' is not a valid type in the signature of
// 'dart:js_interop' external APIs or APIs converted via 'toJS'.
external void bar(void Function(String e) callback);
// fine but not type safe
external void baz(JSFunction callback);
}
How can i still specify function signatures for function arguments? Or do i just have to live without?