elemental2.core.JsObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elemental2-core Show documentation
Show all versions of elemental2-core Show documentation
Thin Java abstractions for the standard built-in objects for Javascript.
package elemental2.core;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
import jsinterop.base.Js;
import jsinterop.base.JsPropertyMap;
@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
public class JsObject {
@JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL)
public interface DefinePropertyPropUnionType {
@JsOverlay
static JsObject.DefinePropertyPropUnionType of(Object o) {
return Js.cast(o);
}
@JsOverlay
default Object asObject() {
return Js.cast(this);
}
@JsOverlay
default String asString() {
return Js.asString(this);
}
@JsOverlay
default boolean isObject() {
return (Object) this instanceof Object;
}
@JsOverlay
default boolean isString() {
return (Object) this instanceof String;
}
}
@JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL)
public interface EntriesArrayArrayUnionType {
@JsOverlay
static JsObject.EntriesArrayArrayUnionType of(Object o) {
return Js.cast(o);
}
@JsOverlay
default String asString() {
return Js.asString(this);
}
@JsOverlay
default T asT() {
return Js.cast(this);
}
@JsOverlay
default boolean isString() {
return (Object) this instanceof String;
}
}
@JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL)
public interface GetOwnPropertyDescriptorPropUnionType {
@JsOverlay
static JsObject.GetOwnPropertyDescriptorPropUnionType of(Object o) {
return Js.cast(o);
}
@JsOverlay
default Object asObject() {
return Js.cast(this);
}
@JsOverlay
default String asString() {
return Js.asString(this);
}
@JsOverlay
default boolean isObject() {
return (Object) this instanceof Object;
}
@JsOverlay
default boolean isString() {
return (Object) this instanceof String;
}
}
public static native JsObject assign(JsObject target, JsObject... var_args);
@JsOverlay
public static final JsObject assign(Object target, Object... var_args) {
return assign(Js.uncheckedCast(target), Js.uncheckedCast(var_args));
}
public static native JsObject create(JsObject proto, JsObject properties);
public static native JsObject create(JsObject proto);
@JsOverlay
public static final JsObject create(Object proto, Object properties) {
return create(Js.uncheckedCast(proto), Js.uncheckedCast(properties));
}
@JsOverlay
public static final JsObject create(Object proto) {
return create(Js.uncheckedCast(proto));
}
public static native JsObject defineProperties(JsObject obj, JsObject props);
@JsOverlay
public static final JsObject defineProperties(Object obj, Object props) {
return defineProperties(Js.uncheckedCast(obj), Js.uncheckedCast(props));
}
public static native JsObject defineProperty(
JsObject obj, JsObject.DefinePropertyPropUnionType prop, JsObject descriptor);
@JsOverlay
public static final JsObject defineProperty(JsObject obj, Object prop, JsObject descriptor) {
return defineProperty(
obj, Js.uncheckedCast(prop), descriptor);
}
@JsOverlay
public static final JsObject defineProperty(JsObject obj, String prop, JsObject descriptor) {
return defineProperty(
obj, Js.uncheckedCast(prop), descriptor);
}
@JsOverlay
public static final JsObject defineProperty(
Object obj, JsObject.DefinePropertyPropUnionType prop, Object descriptor) {
return defineProperty(
Js.uncheckedCast(obj), prop, Js.uncheckedCast(descriptor));
}
@JsOverlay
public static final JsObject defineProperty(Object obj, Object prop, Object descriptor) {
return defineProperty(
Js.uncheckedCast(obj), prop, Js.uncheckedCast(descriptor));
}
@JsOverlay
public static final JsObject defineProperty(Object obj, String prop, Object descriptor) {
return defineProperty(
Js.uncheckedCast(obj), prop, Js.uncheckedCast(descriptor));
}
public static native JsObject.EntriesArrayArrayUnionType[][] entries(JsPropertyMap obj);
public static native T freeze(T obj);
public static native JsObject fromEntries(JsIterable
© 2015 - 2024 Weber Informatics LLC | Privacy Policy