addRules method
Registers rules to handle events.
eventName
Name of the event this function affects.
webViewInstanceId
If provided, this is an integer that uniquely
identfies the
Implementation
Future<List<Rule>> addRules(
String eventName,
int webViewInstanceId,
List<Rule> rules,
) {
var $completer = Completer<List<Rule>>();
_wrapped.addRules(
eventName,
webViewInstanceId,
rules.toJSArray((e) => e.toJS),
(JSArray rules) {
if (checkRuntimeLastError($completer)) {
$completer.complete(rules.toDart
.cast<$js.Rule>()
.map((e) => Rule.fromJS(e))
.toList());
}
}.toJS,
);
return $completer.future;
}