All Downloads are FREE. Search and download functionalities are using the official Maven repository.

elemental2.core.JsSet Maven / Gradle / Ivy

There is a newer version: 1.0.139
Show newest version
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 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 callback, Object thisArg);

  public native Object forEach(JsSet.ForEachCallbackFn callback);

  public native boolean has(VALUE value);

  public native JsIteratorIterable keys();

  public native JsIteratorIterable values();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy