elemental2.core.JsSet Maven / Gradle / Ivy
package elemental2.core;
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
import jsinterop.base.Js;
@JsType(isNative = true, name = "Set", namespace = JsPackage.GLOBAL)
public class JsSet implements JsIterable {
@JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL)
public interface ConstructorIterableUnionType {
@JsOverlay
static JsSet.ConstructorIterableUnionType of(Object o) {
return Js.cast(o);
}
@JsOverlay
default JsIterable asJsIterable() {
return Js.cast(this);
}
@JsOverlay
default VALUE[] asVALUEArray() {
return Js.cast(this);
}
@JsOverlay
default boolean isVALUEArray() {
return (Object) this instanceof Object[];
}
}
@JsFunction
public interface ForEachCallbackFn {
Object onInvoke(VALUE p0, VALUE p1, JsSet extends VALUE> p2);
}
public int size;
public JsSet() {}
public JsSet(JsSet.ConstructorIterableUnionType iterable) {}
public JsSet(JsIterable iterable) {}
public JsSet(VALUE[] iterable) {}
public native JsSet add(VALUE value);
public native void clear();
public native boolean delete(VALUE value);
public native JsIteratorIterable entries();
public native Object forEach(JsSet.ForEachCallbackFn super VALUE> callback, Object thisArg);
public native Object forEach(JsSet.ForEachCallbackFn super VALUE> callback);
public native boolean has(VALUE value);
public native JsIteratorIterable keys();
public native JsIteratorIterable values();
}