com.github.xpenatan.gdx.backends.teavm.filesystem.indexeddb.IDBIndexEmu Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of backend-teavm Show documentation
Show all versions of backend-teavm Show documentation
Tool to generate libgdx to javascript using teaVM
package com.github.xpenatan.gdx.backends.teavm.filesystem.indexeddb;
import com.github.xpenatan.gdx.backends.teavm.gen.Emulate;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSByRef;
import org.teavm.jso.JSObject;
import org.teavm.jso.JSProperty;
import org.teavm.jso.core.JSString;
import org.teavm.jso.indexeddb.IDBCountRequest;
import org.teavm.jso.indexeddb.IDBCursorRequest;
import org.teavm.jso.indexeddb.IDBCursorSource;
import org.teavm.jso.indexeddb.IDBGetRequest;
import org.teavm.jso.indexeddb.IDBIndex;
import org.teavm.jso.indexeddb.IDBKeyRange;
@Emulate(IDBIndex.class)
public abstract class IDBIndexEmu implements JSObject, IDBCursorSource {
@JSProperty
public abstract String getName();
@JSProperty("keyPath")
abstract JSObject getKeyPathImpl();
public final String[] getKeyPath() {
JSObject result = getKeyPathImpl();
if (JSString.isInstance(result)) {
return new String[] { result.cast().stringValue() };
} else {
return unwrapStringArray(result);
}
}
@JSBody(params = "obj", script = "return obj;")
private static native String[] unwrapStringArray(JSObject obj);
@JSProperty
public abstract boolean isMultiEntry();
@JSProperty
public abstract boolean isUnique();
public abstract IDBCursorRequest openCursor();
public abstract IDBCursorRequest openCursor(IDBKeyRange range);
public abstract IDBCursorRequest openKeyCursor();
public abstract IDBGetRequest get(JSObject key);
public abstract IDBGetRequest getKey(JSObject key);
public abstract IDBCountRequest count(JSObject key);
public abstract IDBCountRequest count();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy