Closed ssatguru closed 8 years ago
Just use the native
keyword (when you think of it, it makes sense to use it).
@Ambient
class ColorPicker extends jsweet.lang.Object {
public ColorPicker(HTMLElement e, TriConsumer<Object, Object, RGB> f) {};
public native void setRGB(RGB rgb);
}
class RGB {
double r;
double g;
double b;
}
Maybe you also want to define RGB as an ambient an/or and @Interface
.
I will add some indication for using the native
modifier in the error message.
That worked. Nice! Yes , some more documentation on this would be helpful. Thanks
I have updated the error message to give an hint for using modifiers such as 'abstract' and 'native'. Thanks for the feedback.
I have a javascript class - Colorpicker It has a constructor and a single method called setRGB How would I define this using @Ambient Tried the following
I get the following compilation error
If i remove the method and just leave the constructor it works