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

main.kotlinext.js.Object.kt Maven / Gradle / Ivy

package kotlinext.js

external interface PropertyDescriptor {
    var configurable: Boolean
    var enumerable: Boolean
    var value: T
    var writable: Boolean
    var get: () -> T
    var set: (v: T) -> Unit
}

fun Any.asJsObject(): Object = unsafeCast()

external class Object internal constructor() {
    fun toLocaleString(): String
    fun valueOf(): dynamic
    fun hasOwnProperty(v: String): Boolean
    fun isPrototypeOf(v: Any): Boolean
    fun propertyIsEnumerable(v: String): Boolean

    companion object {
        fun 

getPrototypeOf(o: T): P fun getOwnPropertyDescriptor(o: Any, p: String): PropertyDescriptor fun getOwnPropertyNames(o: Any): Array fun create(o: T?, properties: dynamic = definedExternally): T fun defineProperty(o: T, p: String, attributes: PropertyDescriptor

): T fun defineProperties(o: T, properties: dynamic): T fun seal(o: T): T fun freeze(o: T): R fun preventExtensions(o: T): T fun isSealed(o: Any): Boolean fun isFrozen(o: Any): Boolean fun isExtensible(o: Any): Boolean fun keys(o: Any): Array fun assign(dest: R, vararg src: T?): R } } fun Any.getOwnPropertyNames(): Array = Object.getOwnPropertyNames(this)