I know that I can expose a "jsBridge" object to javascript in webview by
Control.AddJavascriptInterface(new JsBridge(), 'jsBridge');
It seems inside the "JsBridge" class, we can only expose methods like
[JavascriptInterface]
[Export("myMethodName")]
public void MyMethod(string message)
{
//some logic
}
But I need some way to expose some objects or properties like bellow:
public ApiModule1 Module1 => _module1;
public ApiModule2 Module2 => _module2;
seems the "ExportAttribute" can only be applied to methods.
I am doing this because I need a way to expose only one single namespace at the JavaScript side, and still keep things organized by not stuffing everything into one object, that is;
jsBridge.Module1.someMethod();
jsBridge.Module2.someMethod();
Did I misunderstood some concepts here or is there are any other way to achieve this kind of feature?
Thank you very much.