js.util.iterable.JsIterator Maven / Gradle / Ivy
package js.util.iterable;
import js.lang.Any;
import org.teavm.jso.JSBody;
import java.util.Iterator;
public interface JsIterator extends Any {
@JSBody(script = "return this.next()")
IteratorResult doNext();
@JSBody(params = "value", script = "return this.return(value)")
IteratorResult doReturn(T value);
@JSBody(script = "return this.return()")
IteratorResult doReturn();
@JSBody(params = "e", script = "return this.throw(e)")
IteratorResult doThrow(Any e);
@JSBody(script = "return this.throw()")
IteratorResult doThrow();
default Iterator getJavaIterator() {
return new IteratorWrapper<>(this);
}
}