Monday, August 24, 2015

Re: JsInterop question ...

I haven't found a solution either. 
The final JSInterop version will probably have quite different annotations: (https://groups.google.com/forum/#!searchin/google-web-toolkit-contributors/annotations/google-web-toolkit-contributors/Dwdk-aEHs8Y/OvSNe6egUekJ)
There is also a paragraph about overloading methods (espeically regarding Elemental): https://docs.google.com/document/d/1tir74SB-ZWrs-gQ8w-lOEV3oMY6u6lF2MmNivDEihZ4/edit#heading=h.kcij4viab6dx



On Tuesday, June 30, 2015 at 9:30:17 PM UTC+2, Benjamin Tillman wrote:
Hey everyone, just a quick question regarding JsInterop: how is it proposed to manage javascript functions that can potentially take more than one type of parameter? For example, take the websocket interface:

@JsType(prototype = "WebSocket")
public interface WebSocket extends EventTarget {

 
... blah blah.

 
void send(String data);
  // void send(Blob data); <-- JsInterop forbids this

}

I suppose that the following is possible

@JsType(prototype = "WebSocket")
public interface WebSocket extends EventTarget {

 
void send(Object data);

}

but ... this doesn't seem ideal from a Java perspective :)

Regards,
Ben.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment