[Wasm] Wasi stdlib implementation

KT-56608
This commit is contained in:
Igor Yakovlev
2023-07-31 14:27:09 +02:00
committed by Zalim Bashorov
parent 090f393f97
commit 8cc0660693
61 changed files with 817 additions and 103 deletions
@@ -1,61 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("UNUSED_PARAMETER") // TODO: Remove after bootstrap update
package kotlin.js
/**
* Represents universal type for JS interoperability.
*/
@Deprecated("Use JsAny instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("JsAny"))
public external interface Dynamic : JsAny
/**
* Reinterprets this value as a value of the Dynamic type.
*/
@Deprecated("If value is a subtype of JsAny, use JsAny instead. Otherwise, use toJsReference", level = DeprecationLevel.ERROR)
fun Any.asDynamic(): JsAny = this.toJsReference()
/**
* Reinterprets this value as a value of the Dynamic type.
*/
@Deprecated("Use toJsString instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("this.toJsString()"))
@kotlin.internal.InlineOnly
fun String.asDynamic(): JsString = this.toJsString()
private fun jsThrow(e: JsAny) {
js("throw e;")
}
private fun jsCatch(f: () -> Unit): JsAny? {
js("""
let result = null;
try {
f();
} catch (e) {
result = e;
}
return result;
""")
}
/**
* For a Dynamic value caught in JS, returns the corresponding [Throwable]
* if it was thrown from Kotlin, or null otherwise.
*/
public fun JsAny.toThrowableOrNull(): Throwable? {
val thisAny: Any = this
if (thisAny is Throwable) return thisAny
var result: Throwable? = null
jsCatch {
try {
jsThrow(this)
} catch (e: Throwable) {
result = e
}
}
return result
}
@@ -1,22 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin
/**
* Implements annotated function in JavaScript and automatically imports is to Wasm.
* [code] string must contain JS expression that evaluates to JS function with signature that matches annotated kotlin function
*
* For example, a function that adds two Doubles via JS:
*
* @JsFun("(x, y) => x + y")
* fun jsAdd(x: Double, y: Double): Double =
* error("...")
*
* This is a temporary annotation because K/Wasm <-> JS interop is not designed yet.
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
@Retention(AnnotationRetention.BINARY)
public annotation class JsFun(val code: String)
@@ -1,9 +1,8 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
package kotlin.io
@PublishedApi
internal val undefined: Nothing? = null
internal actual interface Serializable
-42
View File
@@ -1,42 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("UNUSED_PARAMETER") // TODO: Remove after bootstrap update
package kotlin.io
import kotlin.wasm.internal.*
internal fun printError(error: String?): Unit =
js("console.error(error)")
private fun printlnImpl(message: String?): Unit =
js("console.log(message)")
private fun printImpl(message: String?): Unit =
js("typeof write !== 'undefined' ? write(message) : console.log(message)")
/** Prints the line separator to the standard output stream. */
public actual fun println() {
printlnImpl("")
}
/** Prints the given [message] and the line separator to the standard output stream. */
public actual fun println(message: Any?) {
printlnImpl(message?.toString())
}
/** Prints the given [message] to the standard output stream. */
public actual fun print(message: Any?) {
printImpl(message?.toString())
}
@SinceKotlin("1.6")
public actual fun readln(): String = throw UnsupportedOperationException("readln is not supported in Kotlin/WASM")
@SinceKotlin("1.6")
public actual fun readlnOrNull(): String? = throw UnsupportedOperationException("readlnOrNull is not supported in Kotlin/WASM")
internal actual interface Serializable
@@ -1,23 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.wasm.internal.ExcludedFromCodegen
import kotlin.wasm.internal.WasmNoOpCast
import kotlin.wasm.internal.implementedAsIntrinsic
/**
* Any JavaScript value except null or undefined
*/
public external interface JsAny
/**
* Cast JsAny to other Js type without runtime check
*/
@WasmNoOpCast
@ExcludedFromCodegen
public fun <T : JsAny> JsAny.unsafeCast(): T =
implementedAsIntrinsic
@@ -1,28 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
/** JavaScript Array */
@JsName("Array")
public external class JsArray<T : JsAny?> : JsAny {
val length: Int
}
public operator fun <T : JsAny?> JsArray<T>.get(index: Int): T? =
jsArrayGet(this, index)
public operator fun <T : JsAny?> JsArray<T>.set(index: Int, value: T) {
jsArraySet(this, index, value)
}
@Suppress("RedundantNullableReturnType", "UNUSED_PARAMETER")
private fun <T : JsAny?> jsArrayGet(array: JsArray<T>, index: Int): T? =
js("array[index]")
@Suppress("UNUSED_PARAMETER")
private fun <T : JsAny?> jsArraySet(array: JsArray<T>, index: Int, value: T) {
js("array[index] = value")
}
@@ -1,20 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.wasm.internal.JsPrimitive
import kotlin.wasm.internal.externRefToKotlinBooleanAdapter
import kotlin.wasm.internal.kotlinBooleanToExternRefAdapter
/** JavaScript primitive boolean */
@JsPrimitive("boolean")
public external class JsBoolean internal constructor() : JsAny
public fun JsBoolean.toBoolean(): Boolean =
externRefToKotlinBooleanAdapter(this)
public fun Boolean.toJsBoolean(): JsBoolean =
kotlinBooleanToExternRefAdapter(this)
@@ -1,28 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.wasm.internal.JsPrimitive
import kotlin.wasm.internal.externRefToKotlinDoubleAdapter
import kotlin.wasm.internal.externRefToKotlinIntAdapter
import kotlin.wasm.internal.kotlinDoubleToExternRefAdapter
import kotlin.wasm.internal.kotlinIntToExternRefAdapter
/** JavaScript primitive number */
@JsPrimitive("number")
public external class JsNumber internal constructor() : JsAny
public fun JsNumber.toDouble(): Double =
externRefToKotlinDoubleAdapter(this)
public fun Double.toJsNumber(): JsNumber =
kotlinDoubleToExternRefAdapter(this)
public fun JsNumber.toInt(): Int =
externRefToKotlinIntAdapter(this)
public fun Int.toJsNumber(): JsNumber =
kotlinIntToExternRefAdapter(this)
@@ -1,29 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.wasm.internal.WasmOp
import kotlin.wasm.internal.implementedAsIntrinsic
import kotlin.wasm.internal.returnArgumentIfItIsKotlinAny
/**
* JavaScript value that can serve as a reference for any Kotlin value.
*
* In JavaScript, it behaves like an immutable empty object with a null prototype.
* When passed back to Kotlin/Wasm, the original value can be retrieved using the [get] method.
*/
@Suppress("WRONG_JS_INTEROP_TYPE") // Exception to the rule
public sealed external interface JsReference<out T : Any> : JsAny
@WasmOp(WasmOp.EXTERN_EXTERNALIZE)
public fun <T : Any> T.toJsReference(): JsReference<T> =
implementedAsIntrinsic
/** Retrieve original Kotlin value from JsReference */
public fun <T : Any> JsReference<T>.get(): T {
returnArgumentIfItIsKotlinAny()
throw ClassCastException("JsReference doesn't contain a Kotlin type")
}
@@ -1,16 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.wasm.internal.JsPrimitive
import kotlin.wasm.internal.kotlinToJsStringAdapter
/** JavaScript primitive string */
@JsPrimitive("string")
public external class JsString internal constructor() : JsAny
public fun String.toJsString(): JsString =
kotlinToJsStringAdapter(this)!!
@@ -1,30 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.internal.LowPriorityInOverloadResolution
/**
* Exposes the JavaScript [Promise object](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise) to Kotlin.
*/
public external class Promise<out T : JsAny?>(executor: (resolve: (T) -> Unit, reject: (JsAny) -> Unit) -> Unit) : JsAny {
@LowPriorityInOverloadResolution
public fun <S : JsAny?> then(onFulfilled: ((T) -> S)?): Promise<S>
@LowPriorityInOverloadResolution
public fun <S : JsAny?> then(onFulfilled: ((T) -> S)?, onRejected: ((JsAny) -> S)?): Promise<S>
public fun <S : JsAny?> catch(onRejected: (JsAny) -> S): Promise<S>
public fun finally(onFinally: () -> Unit): Promise<T>
companion object {
public fun <S : JsAny?> all(promise: JsArray<out Promise<S>>): Promise<JsArray<out S>>
public fun <S : JsAny?> race(promise: JsArray<out Promise<S>>): Promise<S>
public fun reject(e: JsAny): Promise<Nothing>
public fun <S : JsAny?> resolve(e: S): Promise<S>
public fun <S : JsAny?> resolve(e: Promise<S>): Promise<S>
}
}
@@ -1,103 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
/**
* Exports top-level declaration on JS platform.
*
* Can only be applied to top-level functions.
*/
@ExperimentalJsExport
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.FUNCTION)
// All targets from expect can't be set because for K/Wasm so far you can export only functions
@Suppress("ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT")
public actual annotation class JsExport {
@ExperimentalJsExport
@Retention(AnnotationRetention.BINARY)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY,
AnnotationTarget.CONSTRUCTOR,
)
public actual annotation class Ignore
}
/**
* Specifies JavaScript name for external and imported declarations
*/
@Retention(AnnotationRetention.BINARY)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER
)
public actual annotation class JsName(actual val name: String)
/**
* Denotes an `external` declaration that must be imported from JavaScript module.
*
* The annotation can be used on top-level external declarations (classes, properties, functions) and files.
* In case of file (which can't be `external`) the following rule applies: all the declarations in
* the file must be `external`. By applying `@JsModule(...)` on a file you tell the compiler to import a JavaScript object
* that contain all the declarations from the file.
*
* Example:
*
* ``` kotlin
* @JsModule("jquery")
* external abstract class JQuery() {
* // some declarations here
* }
*
* @JsModule("jquery")
* external fun JQuery(element: Element): JQuery
* ```
*
* @property import name of a module to import declaration from.
* It is not interpreted by the Kotlin compiler, it's passed as is directly to the target module system.
*/
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION, AnnotationTarget.FILE)
public annotation class JsModule(val import: String)
/**
* Adds prefix to `external` declarations in a source file.
*
* JavaScript does not have concept of packages (namespaces). They are usually emulated by nested objects.
* The compiler turns references to `external` declarations either to plain unprefixed names
* or to plain imports.
* However, if a JavaScript library provides its declarations in packages, you won't be satisfied with this.
* You can tell the compiler to generate additional prefix before references to `external` declarations using the `@JsQualifier(...)`
* annotation.
*
* Note that a file marked with the `@JsQualifier(...)` annotation can't contain non-`external` declarations.
*
* Example:
*
* ```
* @file:JsQualifier("my.jsPackageName")
* package some.kotlinPackage
*
* external fun foo(x: Int)
*
* external fun bar(): String
* ```
*
* @property value the qualifier to add to the declarations in the generated code.
* It must be a sequence of valid JavaScript identifiers separated by the `.` character.
* Examples of valid qualifiers are: `foo`, `bar.Baz`, `_.$0.f`.
*
* @see JsModule
*/
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.FILE)
public annotation class JsQualifier(val value: String)
@@ -1,72 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
import kotlin.wasm.internal.ExcludedFromCodegen
/**
* The property that can be used as a placeholder for statements and values that are defined in JavaScript.
*
* This property can be used in two cases:
*
* * To represent body of an external function. In most cases Kotlin does not require to provide bodies of external
* functions and properties, but if for some reason you want to (for example, due to limitation of your coding style guides),
* you should use `definedExternally`.
* * To represent value of default argument.
*
* There's two forms of using `definedExternally`:
*
* 1. `= definedExternally` (for functions, properties and parameters).
* 2. `{ definedExternally }` (for functions and property getters/setters).
*
* This property can't be used from normal code.
*
* Examples:
*
* ``` kotlin
* external fun foo(): String = definedExternally
* external fun bar(x: Int) { definedExternally }
* external fun baz(z: Any = definedExternally): Array<Any>
* external val prop: Float = definedExternally
* ```
*/
@ExcludedFromCodegen
@Suppress("WRONG_JS_INTEROP_TYPE")
public external val definedExternally: Nothing
/**
* This function allows you to incorporate JavaScript [code] into Kotlin/Wasm codebase.
* It is used to implement top-level functions and initialize top-level properties.
*
* It is important to note, that calls to [js] function should be the only expression
* in a function body or a property initializer.
*
* [code] parameter should be a compile-time constant.
*
* When used in an expression context, [code] should contain a single JavaScript expression. For example:
*
* ``` kotlin
* val version: String = js("process.version")
* fun newEmptyJsArray(): JsValue = js("[]")
* ```
*
* When used in a function body, [code] is expected to be a list of JavaScript statements. For example:
*
* ``` kotlin
* fun log(message1: String, message2: String) {
* js("""
* console.log(message1);
* console.log(message2);
* """)
* }
* ```
*
* You can use parameters of calling function in JavaScript [code].
* However, other Kotlin declarations are not visible inside the [code] block.
*/
@ExcludedFromCodegen
@SinceKotlin("1.9")
public external fun js(code: String): Nothing
@@ -5,11 +5,5 @@
package kotlin.random
private fun initialSeed(): Int =
js("((Math.random() * Math.pow(2, 32)) | 0)")
internal actual fun defaultPlatformRandom(): Random =
Random(initialSeed())
internal actual fun doubleFromParts(hi26: Int, low27: Int): Double =
(hi26.toLong().shl(27) + low27) / (1L shl 53).toDouble()
@@ -1,40 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("UNUSED_PARAMETER") // TODO: Remove after bootstrap update
package kotlin.time
import kotlin.math.*
internal actual inline val durationAssertionsEnabled: Boolean get() = true
private fun toFixed(value: Double, decimals: Int): String =
js("value.toFixed(decimals)")
private fun toPrecision(value: Double, decimals: Int): String =
js("value.toPrecision(decimals)")
internal actual fun formatToExactDecimals(value: Double, decimals: Int): String {
val rounded = if (decimals == 0) {
value
} else {
val pow = (10.0).pow(decimals)
round(abs(value) * pow) / pow * sign(value)
round(abs(value) * pow) / pow * sign(value)
}
return if (abs(rounded) < 1e21) {
// toFixed switches to scientific format after 1e21
toFixed(rounded, decimals)
} else {
// toPrecision outputs the specified number of digits, but only for positive numbers
val positive = abs(rounded)
val positiveString = toPrecision(positive, ceil(log10(positive)).toInt() + decimals)
if (rounded < 0) "-$positiveString" else positiveString
}
}
internal actual fun formatUpToDecimals(value: Double, decimals: Int): String =
js("(value, decimals) => value.toLocaleString(\"en-us\", ({\"maximumFractionDigits\": decimals}))")
@@ -1,48 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("UNUSED_PARAMETER") // TODO: Remove after bootstrap advance
package kotlin.time
import kotlin.wasm.internal.ExternalInterfaceType
import kotlin.time.TimeSource.Monotonic.ValueTimeMark
import kotlin.time.Duration.Companion.milliseconds
private fun tryGetPerformance(): ExternalInterfaceType? =
js("typeof globalThis !== 'undefined' && typeof globalThis.performance !== 'undefined' ? globalThis.performance : null")
private fun getPerformanceNow(performance: ExternalInterfaceType): Double =
js("performance.now()")
private fun dateNow(): Double =
js("Date.now()")
@SinceKotlin("1.3")
internal actual object MonotonicTimeSource : TimeSource.WithComparableMarks {
private val performance: ExternalInterfaceType? = tryGetPerformance()
private fun read(): Double =
if (performance != null) getPerformanceNow(performance) else dateNow()
actual override fun markNow(): ValueTimeMark = ValueTimeMark(read())
actual fun elapsedFrom(timeMark: ValueTimeMark): Duration = (read() - timeMark.reading).milliseconds
actual fun adjustReading(timeMark: ValueTimeMark, duration: Duration): ValueTimeMark =
ValueTimeMark(sumCheckNaN(timeMark.reading + duration.toDouble(DurationUnit.MILLISECONDS)))
actual fun differenceBetween(one: ValueTimeMark, another: ValueTimeMark): Duration {
val ms1 = one.reading
val ms2 = another.reading
return if (ms1 == ms2) Duration.ZERO else (ms1 - ms2).milliseconds
}
override fun toString(): String =
if (performance != null) "TimeSource(globalThis.performance.now())" else "TimeSource(Date.now())"
}
@Suppress("ACTUAL_WITHOUT_EXPECT") // visibility
internal actual typealias ValueTimeMarkReading = Double
private fun sumCheckNaN(value: Double): Double = value.also { if (it.isNaN()) throw IllegalArgumentException("Summing infinities of different signs") }
@@ -1,16 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlinx.browser
import org.w3c.dom.*
public external val window: Window
public external val document: Document
public external val localStorage: Storage
public external val sessionStorage: Storage
@@ -1,32 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlinx.dom
import org.w3c.dom.*
import kotlin.contracts.*
/**
* Creates a new element with the specified [name].
*
* The element is initialized with the specified [init] function.
*/
@SinceKotlin("1.4")
public fun Document.createElement(name: String, init: Element.() -> Unit): Element {
contract { callsInPlace(init, InvocationKind.EXACTLY_ONCE) }
return createElement(name).apply(init)
}
/**
* Appends a newly created element with the specified [name] to this element.
*
* The element is initialized with the specified [init] function.
*/
@SinceKotlin("1.4")
public fun Element.appendElement(name: String, init: Element.() -> Unit): Element {
contract { callsInPlace(init, InvocationKind.EXACTLY_ONCE) }
return ownerDocument!!.createElement(name, init).also { appendChild(it) }
}
@@ -1,51 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlinx.dom
import org.w3c.dom.*
/** Returns true if the element has the given CSS class style in its 'class' attribute */
@SinceKotlin("1.4")
fun Element.hasClass(cssClass: String): Boolean = className.matches("""(^|.*\s+)$cssClass($|\s+.*)""".toRegex())
/**
* Adds CSS class to element. Has no effect if all specified classes are already in class attribute of the element
*
* @return true if at least one class has been added
*/
@SinceKotlin("1.4")
fun Element.addClass(vararg cssClasses: String): Boolean {
val missingClasses = cssClasses.filterNot { hasClass(it) }
if (missingClasses.isNotEmpty()) {
val presentClasses = className.trim()
className = buildString {
append(presentClasses)
if (!presentClasses.isEmpty()) {
append(" ")
}
missingClasses.joinTo(this, " ")
}
return true
}
return false
}
/**
* Removes all [cssClasses] from element. Has no effect if all specified classes are missing in class attribute of the element
*
* @return true if at least one class has been removed
*/
@SinceKotlin("1.4")
fun Element.removeClass(vararg cssClasses: String): Boolean {
if (cssClasses.any { hasClass(it) }) {
val toBeRemoved = cssClasses.toSet()
className = className.trim().split("\\s+".toRegex()).filter { it !in toBeRemoved }.joinToString(" ")
return true
}
return false
}
@@ -1,22 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlinx.dom
import org.w3c.dom.*
/**
* Gets a value indicating whether this node is a TEXT_NODE or a CDATA_SECTION_NODE.
*/
@SinceKotlin("1.4")
public val Node.isText: Boolean
get() = nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE
/**
* Gets a value indicating whether this node is an [Element].
*/
@SinceKotlin("1.4")
public val Node.isElement: Boolean
get() = nodeType == Node.ELEMENT_NODE
@@ -1,21 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.w3c.dom
public external interface ItemArrayLike<out T : JsAny?> : JsAny {
val length: Int
fun item(index: Int): T?
}
public fun <T : JsAny?> ItemArrayLike<T>.asList(): List<T> = object : AbstractList<T>() {
override val size: Int get() = this@asList.length
@Suppress("UNCHECKED_CAST")
override fun get(index: Int): T = when (index) {
in 0..lastIndex -> this@asList.item(index) as T
else -> throw IndexOutOfBoundsException("index $index is not in range [0..$lastIndex]")
}
}
@@ -1,27 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlinx.dom
import org.w3c.dom.*
/** Removes all the children from this node. */
@SinceKotlin("1.4")
public fun Node.clear() {
while (hasChildNodes()) {
removeChild(firstChild!!)
}
}
/**
* Creates text node and append it to the element.
*
* @return this element
*/
@SinceKotlin("1.4")
fun Element.appendText(text: String): Element {
appendChild(ownerDocument!!.createTextNode(text))
return this
}
File diff suppressed because it is too large Load Diff
@@ -1,81 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.css.masking
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.svg.*
/**
* Exposes the JavaScript [SVGClipPathElement](https://developer.mozilla.org/en/docs/Web/API/SVGClipPathElement) to Kotlin
*/
public external abstract class SVGClipPathElement : SVGElement, SVGUnitTypes, JsAny {
open val clipPathUnits: SVGAnimatedEnumeration
open val transform: SVGAnimatedTransformList
companion object {
val SVG_UNIT_TYPE_UNKNOWN: Short
val SVG_UNIT_TYPE_USERSPACEONUSE: Short
val SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: Short
val ELEMENT_NODE: Short
val ATTRIBUTE_NODE: Short
val TEXT_NODE: Short
val CDATA_SECTION_NODE: Short
val ENTITY_REFERENCE_NODE: Short
val ENTITY_NODE: Short
val PROCESSING_INSTRUCTION_NODE: Short
val COMMENT_NODE: Short
val DOCUMENT_NODE: Short
val DOCUMENT_TYPE_NODE: Short
val DOCUMENT_FRAGMENT_NODE: Short
val NOTATION_NODE: Short
val DOCUMENT_POSITION_DISCONNECTED: Short
val DOCUMENT_POSITION_PRECEDING: Short
val DOCUMENT_POSITION_FOLLOWING: Short
val DOCUMENT_POSITION_CONTAINS: Short
val DOCUMENT_POSITION_CONTAINED_BY: Short
val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short
}
}
/**
* Exposes the JavaScript [SVGMaskElement](https://developer.mozilla.org/en/docs/Web/API/SVGMaskElement) to Kotlin
*/
public external abstract class SVGMaskElement : SVGElement, SVGUnitTypes, JsAny {
open val maskUnits: SVGAnimatedEnumeration
open val maskContentUnits: SVGAnimatedEnumeration
open val x: SVGAnimatedLength
open val y: SVGAnimatedLength
open val width: SVGAnimatedLength
open val height: SVGAnimatedLength
companion object {
val SVG_UNIT_TYPE_UNKNOWN: Short
val SVG_UNIT_TYPE_USERSPACEONUSE: Short
val SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: Short
val ELEMENT_NODE: Short
val ATTRIBUTE_NODE: Short
val TEXT_NODE: Short
val CDATA_SECTION_NODE: Short
val ENTITY_REFERENCE_NODE: Short
val ENTITY_NODE: Short
val PROCESSING_INSTRUCTION_NODE: Short
val COMMENT_NODE: Short
val DOCUMENT_NODE: Short
val DOCUMENT_TYPE_NODE: Short
val DOCUMENT_FRAGMENT_NODE: Short
val NOTATION_NODE: Short
val DOCUMENT_POSITION_DISCONNECTED: Short
val DOCUMENT_POSITION_PRECEDING: Short
val DOCUMENT_POSITION_FOLLOWING: Short
val DOCUMENT_POSITION_CONTAINS: Short
val DOCUMENT_POSITION_CONTAINED_BY: Short
val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short
}
}
@@ -1,56 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.clipboard
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
public external interface ClipboardEventInit : EventInit, JsAny {
var clipboardData: DataTransfer? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ClipboardEventInit(clipboardData: DataTransfer? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ClipboardEventInit { js("return { clipboardData, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [ClipboardEvent](https://developer.mozilla.org/en/docs/Web/API/ClipboardEvent) to Kotlin
*/
public external open class ClipboardEvent(type: String, eventInitDict: ClipboardEventInit = definedExternally) : Event, JsAny {
open val clipboardData: DataTransfer?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
/**
* Exposes the JavaScript [Clipboard](https://developer.mozilla.org/en/docs/Web/API/Clipboard) to Kotlin
*/
public external abstract class Clipboard : EventTarget, JsAny {
fun read(): Promise<DataTransfer>
fun readText(): Promise<JsString>
fun write(data: DataTransfer): Promise<Nothing?>
fun writeText(data: String): Promise<Nothing?>
}
public external interface ClipboardPermissionDescriptor : JsAny {
var allowWithoutGesture: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ClipboardPermissionDescriptor(allowWithoutGesture: Boolean? = false): ClipboardPermissionDescriptor { js("return { allowWithoutGesture };") }
@@ -1,491 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.css
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
public external abstract class MediaList : ItemArrayLike<JsString>, JsAny {
open var mediaText: String
fun appendMedium(medium: String)
fun deleteMedium(medium: String)
override fun item(index: Int): JsString?
}
@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForMediaList(obj: MediaList, index: Int): String? { js("return obj[index];") }
public operator fun MediaList.get(index: Int): String? = getMethodImplForMediaList(this, index)
/**
* Exposes the JavaScript [StyleSheet](https://developer.mozilla.org/en/docs/Web/API/StyleSheet) to Kotlin
*/
public external abstract class StyleSheet : JsAny {
open val type: String
open val href: String?
open val ownerNode: UnionElementOrProcessingInstruction?
open val parentStyleSheet: StyleSheet?
open val title: String?
open val media: MediaList
open var disabled: Boolean
}
/**
* Exposes the JavaScript [CSSStyleSheet](https://developer.mozilla.org/en/docs/Web/API/CSSStyleSheet) to Kotlin
*/
public external abstract class CSSStyleSheet : StyleSheet, JsAny {
open val ownerRule: CSSRule?
open val cssRules: CSSRuleList
fun insertRule(rule: String, index: Int): Int
fun deleteRule(index: Int)
}
/**
* Exposes the JavaScript [StyleSheetList](https://developer.mozilla.org/en/docs/Web/API/StyleSheetList) to Kotlin
*/
public external abstract class StyleSheetList : ItemArrayLike<StyleSheet>, JsAny {
override fun item(index: Int): StyleSheet?
}
@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForStyleSheetList(obj: StyleSheetList, index: Int): StyleSheet? { js("return obj[index];") }
public operator fun StyleSheetList.get(index: Int): StyleSheet? = getMethodImplForStyleSheetList(this, index)
/**
* Exposes the JavaScript [LinkStyle](https://developer.mozilla.org/en/docs/Web/API/LinkStyle) to Kotlin
*/
public external interface LinkStyle : JsAny {
val sheet: StyleSheet?
get() = definedExternally
}
/**
* Exposes the JavaScript [CSSRuleList](https://developer.mozilla.org/en/docs/Web/API/CSSRuleList) to Kotlin
*/
public external abstract class CSSRuleList : ItemArrayLike<CSSRule>, JsAny {
override fun item(index: Int): CSSRule?
}
@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForCSSRuleList(obj: CSSRuleList, index: Int): CSSRule? { js("return obj[index];") }
public operator fun CSSRuleList.get(index: Int): CSSRule? = getMethodImplForCSSRuleList(this, index)
/**
* Exposes the JavaScript [CSSRule](https://developer.mozilla.org/en/docs/Web/API/CSSRule) to Kotlin
*/
public external abstract class CSSRule : JsAny {
open val type: Short
open var cssText: String
open val parentRule: CSSRule?
open val parentStyleSheet: CSSStyleSheet?
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
/**
* Exposes the JavaScript [CSSStyleRule](https://developer.mozilla.org/en/docs/Web/API/CSSStyleRule) to Kotlin
*/
public external abstract class CSSStyleRule : CSSRule, JsAny {
open var selectorText: String
open val style: CSSStyleDeclaration
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
public external abstract class CSSImportRule : CSSRule, JsAny {
open val href: String
open val media: MediaList
open val styleSheet: CSSStyleSheet
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
/**
* Exposes the JavaScript [CSSGroupingRule](https://developer.mozilla.org/en/docs/Web/API/CSSGroupingRule) to Kotlin
*/
public external abstract class CSSGroupingRule : CSSRule, JsAny {
open val cssRules: CSSRuleList
fun insertRule(rule: String, index: Int): Int
fun deleteRule(index: Int)
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
/**
* Exposes the JavaScript [CSSMediaRule](https://developer.mozilla.org/en/docs/Web/API/CSSMediaRule) to Kotlin
*/
public external abstract class CSSMediaRule : CSSGroupingRule, JsAny {
open val media: MediaList
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
/**
* Exposes the JavaScript [CSSPageRule](https://developer.mozilla.org/en/docs/Web/API/CSSPageRule) to Kotlin
*/
public external abstract class CSSPageRule : CSSGroupingRule, JsAny {
open var selectorText: String
open val style: CSSStyleDeclaration
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
public external abstract class CSSMarginRule : CSSRule, JsAny {
open val name: String
open val style: CSSStyleDeclaration
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
/**
* Exposes the JavaScript [CSSNamespaceRule](https://developer.mozilla.org/en/docs/Web/API/CSSNamespaceRule) to Kotlin
*/
public external abstract class CSSNamespaceRule : CSSRule, JsAny {
open val namespaceURI: String
open val prefix: String
companion object {
val STYLE_RULE: Short
val CHARSET_RULE: Short
val IMPORT_RULE: Short
val MEDIA_RULE: Short
val FONT_FACE_RULE: Short
val PAGE_RULE: Short
val MARGIN_RULE: Short
val NAMESPACE_RULE: Short
}
}
/**
* Exposes the JavaScript [CSSStyleDeclaration](https://developer.mozilla.org/en/docs/Web/API/CSSStyleDeclaration) to Kotlin
*/
public external abstract class CSSStyleDeclaration : ItemArrayLike<JsString>, JsAny {
open var cssText: String
open val parentRule: CSSRule?
open var cssFloat: String
open var alignContent: String
open var alignItems: String
open var alignSelf: String
open var animation: String
open var animationDelay: String
open var animationDirection: String
open var animationDuration: String
open var animationFillMode: String
open var animationIterationCount: String
open var animationName: String
open var animationPlayState: String
open var animationTimingFunction: String
open var backfaceVisibility: String
open var background: String
open var backgroundAttachment: String
open var backgroundClip: String
open var backgroundColor: String
open var backgroundImage: String
open var backgroundOrigin: String
open var backgroundPosition: String
open var backgroundRepeat: String
open var backgroundSize: String
open var border: String
open var borderBottom: String
open var borderBottomColor: String
open var borderBottomLeftRadius: String
open var borderBottomRightRadius: String
open var borderBottomStyle: String
open var borderBottomWidth: String
open var borderCollapse: String
open var borderColor: String
open var borderImage: String
open var borderImageOutset: String
open var borderImageRepeat: String
open var borderImageSlice: String
open var borderImageSource: String
open var borderImageWidth: String
open var borderLeft: String
open var borderLeftColor: String
open var borderLeftStyle: String
open var borderLeftWidth: String
open var borderRadius: String
open var borderRight: String
open var borderRightColor: String
open var borderRightStyle: String
open var borderRightWidth: String
open var borderSpacing: String
open var borderStyle: String
open var borderTop: String
open var borderTopColor: String
open var borderTopLeftRadius: String
open var borderTopRightRadius: String
open var borderTopStyle: String
open var borderTopWidth: String
open var borderWidth: String
open var bottom: String
open var boxDecorationBreak: String
open var boxShadow: String
open var boxSizing: String
open var breakAfter: String
open var breakBefore: String
open var breakInside: String
open var captionSide: String
open var clear: String
open var clip: String
open var color: String
open var columnCount: String
open var columnFill: String
open var columnGap: String
open var columnRule: String
open var columnRuleColor: String
open var columnRuleStyle: String
open var columnRuleWidth: String
open var columnSpan: String
open var columnWidth: String
open var columns: String
open var content: String
open var counterIncrement: String
open var counterReset: String
open var cursor: String
open var direction: String
open var display: String
open var emptyCells: String
open var filter: String
open var flex: String
open var flexBasis: String
open var flexDirection: String
open var flexFlow: String
open var flexGrow: String
open var flexShrink: String
open var flexWrap: String
open var font: String
open var fontFamily: String
open var fontFeatureSettings: String
open var fontKerning: String
open var fontLanguageOverride: String
open var fontSize: String
open var fontSizeAdjust: String
open var fontStretch: String
open var fontStyle: String
open var fontSynthesis: String
open var fontVariant: String
open var fontVariantAlternates: String
open var fontVariantCaps: String
open var fontVariantEastAsian: String
open var fontVariantLigatures: String
open var fontVariantNumeric: String
open var fontVariantPosition: String
open var fontWeight: String
open var hangingPunctuation: String
open var height: String
open var hyphens: String
open var imageOrientation: String
open var imageRendering: String
open var imageResolution: String
open var imeMode: String
open var justifyContent: String
open var left: String
open var letterSpacing: String
open var lineBreak: String
open var lineHeight: String
open var listStyle: String
open var listStyleImage: String
open var listStylePosition: String
open var listStyleType: String
open var margin: String
open var marginBottom: String
open var marginLeft: String
open var marginRight: String
open var marginTop: String
open var mark: String
open var markAfter: String
open var markBefore: String
open var marks: String
open var marqueeDirection: String
open var marqueePlayCount: String
open var marqueeSpeed: String
open var marqueeStyle: String
open var mask: String
open var maskType: String
open var maxHeight: String
open var maxWidth: String
open var minHeight: String
open var minWidth: String
open var navDown: String
open var navIndex: String
open var navLeft: String
open var navRight: String
open var navUp: String
open var objectFit: String
open var objectPosition: String
open var opacity: String
open var order: String
open var orphans: String
open var outline: String
open var outlineColor: String
open var outlineOffset: String
open var outlineStyle: String
open var outlineWidth: String
open var overflowWrap: String
open var overflowX: String
open var overflowY: String
open var padding: String
open var paddingBottom: String
open var paddingLeft: String
open var paddingRight: String
open var paddingTop: String
open var pageBreakAfter: String
open var pageBreakBefore: String
open var pageBreakInside: String
open var perspective: String
open var perspectiveOrigin: String
open var phonemes: String
open var position: String
open var quotes: String
open var resize: String
open var rest: String
open var restAfter: String
open var restBefore: String
open var right: String
open var tabSize: String
open var tableLayout: String
open var textAlign: String
open var textAlignLast: String
open var textCombineUpright: String
open var textDecoration: String
open var textDecorationColor: String
open var textDecorationLine: String
open var textDecorationStyle: String
open var textIndent: String
open var textJustify: String
open var textOrientation: String
open var textOverflow: String
open var textShadow: String
open var textTransform: String
open var textUnderlinePosition: String
open var top: String
open var transform: String
open var transformOrigin: String
open var transformStyle: String
open var transition: String
open var transitionDelay: String
open var transitionDuration: String
open var transitionProperty: String
open var transitionTimingFunction: String
open var unicodeBidi: String
open var verticalAlign: String
open var visibility: String
open var voiceBalance: String
open var voiceDuration: String
open var voicePitch: String
open var voicePitchRange: String
open var voiceRate: String
open var voiceStress: String
open var voiceVolume: String
open var whiteSpace: String
open var widows: String
open var width: String
open var wordBreak: String
open var wordSpacing: String
open var wordWrap: String
open var writingMode: String
open var zIndex: String
open var _dashed_attribute: String
open var _camel_cased_attribute: String
open var _webkit_cased_attribute: String
fun getPropertyValue(property: String): String
fun getPropertyPriority(property: String): String
fun setProperty(property: String, value: String, priority: String = definedExternally)
fun setPropertyValue(property: String, value: String)
fun setPropertyPriority(property: String, priority: String)
fun removeProperty(property: String): String
override fun item(index: Int): JsString
}
@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForCSSStyleDeclaration(obj: CSSStyleDeclaration, index: Int): String? { js("return obj[index];") }
public operator fun CSSStyleDeclaration.get(index: Int): String? = getMethodImplForCSSStyleDeclaration(this, index)
public external interface ElementCSSInlineStyle : JsAny {
val style: CSSStyleDeclaration
}
/**
* Exposes the JavaScript [CSS](https://developer.mozilla.org/en/docs/Web/API/CSS) to Kotlin
*/
public external abstract class CSS : JsAny {
companion object {
fun escape(ident: String): String
}
}
public external interface UnionElementOrProcessingInstruction
@@ -1,206 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.encryptedmedia
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
/**
* Exposes the JavaScript [MediaKeySystemConfiguration](https://developer.mozilla.org/en/docs/Web/API/MediaKeySystemConfiguration) to Kotlin
*/
public external interface MediaKeySystemConfiguration : JsAny {
var label: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var initDataTypes: JsArray<JsString>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
var audioCapabilities: JsArray<MediaKeySystemMediaCapability>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
var videoCapabilities: JsArray<MediaKeySystemMediaCapability>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
var distinctiveIdentifier: MediaKeysRequirement? /* = MediaKeysRequirement.OPTIONAL */
get() = definedExternally
set(value) = definedExternally
var persistentState: MediaKeysRequirement? /* = MediaKeysRequirement.OPTIONAL */
get() = definedExternally
set(value) = definedExternally
var sessionTypes: JsArray<JsString>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaKeySystemConfiguration(label: String? = "", initDataTypes: JsArray<JsString>? = JsArray(), audioCapabilities: JsArray<MediaKeySystemMediaCapability>? = JsArray(), videoCapabilities: JsArray<MediaKeySystemMediaCapability>? = JsArray(), distinctiveIdentifier: MediaKeysRequirement? = MediaKeysRequirement.OPTIONAL, persistentState: MediaKeysRequirement? = MediaKeysRequirement.OPTIONAL, sessionTypes: JsArray<JsString>? = undefined): MediaKeySystemConfiguration { js("return { label, initDataTypes, audioCapabilities, videoCapabilities, distinctiveIdentifier, persistentState, sessionTypes };") }
public external interface MediaKeySystemMediaCapability : JsAny {
var contentType: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var robustness: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaKeySystemMediaCapability(contentType: String? = "", robustness: String? = ""): MediaKeySystemMediaCapability { js("return { contentType, robustness };") }
/**
* Exposes the JavaScript [MediaKeySystemAccess](https://developer.mozilla.org/en/docs/Web/API/MediaKeySystemAccess) to Kotlin
*/
public external abstract class MediaKeySystemAccess : JsAny {
open val keySystem: String
fun getConfiguration(): MediaKeySystemConfiguration
fun createMediaKeys(): Promise<MediaKeys>
}
/**
* Exposes the JavaScript [MediaKeys](https://developer.mozilla.org/en/docs/Web/API/MediaKeys) to Kotlin
*/
public external abstract class MediaKeys : JsAny {
fun createSession(sessionType: MediaKeySessionType = definedExternally): MediaKeySession
fun setServerCertificate(serverCertificate: JsAny?): Promise<JsBoolean>
}
/**
* Exposes the JavaScript [MediaKeySession](https://developer.mozilla.org/en/docs/Web/API/MediaKeySession) to Kotlin
*/
public external abstract class MediaKeySession : EventTarget, JsAny {
open val sessionId: String
open val expiration: Double
open val closed: Promise<Nothing?>
open val keyStatuses: MediaKeyStatusMap
open var onkeystatuseschange: ((Event) -> Unit)?
open var onmessage: ((MessageEvent) -> Unit)?
fun generateRequest(initDataType: String, initData: JsAny?): Promise<Nothing?>
fun load(sessionId: String): Promise<JsBoolean>
fun update(response: JsAny?): Promise<Nothing?>
fun close(): Promise<Nothing?>
fun remove(): Promise<Nothing?>
}
/**
* Exposes the JavaScript [MediaKeyStatusMap](https://developer.mozilla.org/en/docs/Web/API/MediaKeyStatusMap) to Kotlin
*/
public external abstract class MediaKeyStatusMap : JsAny {
open val size: Int
fun has(keyId: JsAny?): Boolean
fun get(keyId: JsAny?): JsAny?
}
/**
* Exposes the JavaScript [MediaKeyMessageEvent](https://developer.mozilla.org/en/docs/Web/API/MediaKeyMessageEvent) to Kotlin
*/
public external open class MediaKeyMessageEvent(type: String, eventInitDict: MediaKeyMessageEventInit) : Event, JsAny {
open val messageType: MediaKeyMessageType
open val message: ArrayBuffer
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface MediaKeyMessageEventInit : EventInit, JsAny {
var messageType: MediaKeyMessageType?
var message: ArrayBuffer?
}
@Suppress("UNUSED_PARAMETER")
public fun MediaKeyMessageEventInit(messageType: MediaKeyMessageType?, message: ArrayBuffer?, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaKeyMessageEventInit { js("return { messageType, message, bubbles, cancelable, composed };") }
public external open class MediaEncryptedEvent(type: String, eventInitDict: MediaEncryptedEventInit = definedExternally) : Event, JsAny {
open val initDataType: String
open val initData: ArrayBuffer?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface MediaEncryptedEventInit : EventInit, JsAny {
var initDataType: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var initData: ArrayBuffer? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaEncryptedEventInit(initDataType: String? = "", initData: ArrayBuffer? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaEncryptedEventInit { js("return { initDataType, initData, bubbles, cancelable, composed };") }
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeysRequirement : JsAny {
companion object
}
public inline val MediaKeysRequirement.Companion.REQUIRED: MediaKeysRequirement get() = "required".toJsString().unsafeCast<MediaKeysRequirement>()
public inline val MediaKeysRequirement.Companion.OPTIONAL: MediaKeysRequirement get() = "optional".toJsString().unsafeCast<MediaKeysRequirement>()
public inline val MediaKeysRequirement.Companion.NOT_ALLOWED: MediaKeysRequirement get() = "not-allowed".toJsString().unsafeCast<MediaKeysRequirement>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeySessionType : JsAny {
companion object
}
public inline val MediaKeySessionType.Companion.TEMPORARY: MediaKeySessionType get() = "temporary".toJsString().unsafeCast<MediaKeySessionType>()
public inline val MediaKeySessionType.Companion.PERSISTENT_LICENSE: MediaKeySessionType get() = "persistent-license".toJsString().unsafeCast<MediaKeySessionType>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeyStatus : JsAny {
companion object
}
public inline val MediaKeyStatus.Companion.USABLE: MediaKeyStatus get() = "usable".toJsString().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.EXPIRED: MediaKeyStatus get() = "expired".toJsString().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.RELEASED: MediaKeyStatus get() = "released".toJsString().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.OUTPUT_RESTRICTED: MediaKeyStatus get() = "output-restricted".toJsString().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.OUTPUT_DOWNSCALED: MediaKeyStatus get() = "output-downscaled".toJsString().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.STATUS_PENDING: MediaKeyStatus get() = "status-pending".toJsString().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.INTERNAL_ERROR: MediaKeyStatus get() = "internal-error".toJsString().unsafeCast<MediaKeyStatus>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeyMessageType : JsAny {
companion object
}
public inline val MediaKeyMessageType.Companion.LICENSE_REQUEST: MediaKeyMessageType get() = "license-request".toJsString().unsafeCast<MediaKeyMessageType>()
public inline val MediaKeyMessageType.Companion.LICENSE_RENEWAL: MediaKeyMessageType get() = "license-renewal".toJsString().unsafeCast<MediaKeyMessageType>()
public inline val MediaKeyMessageType.Companion.LICENSE_RELEASE: MediaKeyMessageType get() = "license-release".toJsString().unsafeCast<MediaKeyMessageType>()
public inline val MediaKeyMessageType.Companion.INDIVIDUALIZATION_REQUEST: MediaKeyMessageType get() = "individualization-request".toJsString().unsafeCast<MediaKeyMessageType>()
@@ -1,366 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.events
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
/**
* Exposes the JavaScript [UIEvent](https://developer.mozilla.org/en/docs/Web/API/UIEvent) to Kotlin
*/
public external open class UIEvent(type: String, eventInitDict: UIEventInit = definedExternally) : Event, JsAny {
open val view: Window?
open val detail: Int
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface UIEventInit : EventInit, JsAny {
var view: Window? /* = null */
get() = definedExternally
set(value) = definedExternally
var detail: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun UIEventInit(view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): UIEventInit { js("return { view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [FocusEvent](https://developer.mozilla.org/en/docs/Web/API/FocusEvent) to Kotlin
*/
public external open class FocusEvent(type: String, eventInitDict: FocusEventInit = definedExternally) : UIEvent, JsAny {
open val relatedTarget: EventTarget?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface FocusEventInit : UIEventInit, JsAny {
var relatedTarget: EventTarget? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun FocusEventInit(relatedTarget: EventTarget? = null, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): FocusEventInit { js("return { relatedTarget, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [MouseEvent](https://developer.mozilla.org/en/docs/Web/API/MouseEvent) to Kotlin
*/
public external open class MouseEvent(type: String, eventInitDict: MouseEventInit = definedExternally) : UIEvent, UnionElementOrMouseEvent, JsAny {
open val screenX: Int
open val screenY: Int
open val clientX: Int
open val clientY: Int
open val ctrlKey: Boolean
open val shiftKey: Boolean
open val altKey: Boolean
open val metaKey: Boolean
open val button: Short
open val buttons: Short
open val relatedTarget: EventTarget?
open val region: String?
open val pageX: Double
open val pageY: Double
open val x: Double
open val y: Double
open val offsetX: Double
open val offsetY: Double
fun getModifierState(keyArg: String): Boolean
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface MouseEventInit : EventModifierInit, JsAny {
var screenX: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var screenY: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var clientX: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var clientY: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var button: Short? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var buttons: Short? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var relatedTarget: EventTarget? /* = null */
get() = definedExternally
set(value) = definedExternally
var region: String? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MouseEventInit(screenX: Int? = 0, screenY: Int? = 0, clientX: Int? = 0, clientY: Int? = 0, button: Short? = 0, buttons: Short? = 0, relatedTarget: EventTarget? = null, region: String? = null, ctrlKey: Boolean? = false, shiftKey: Boolean? = false, altKey: Boolean? = false, metaKey: Boolean? = false, modifierAltGraph: Boolean? = false, modifierCapsLock: Boolean? = false, modifierFn: Boolean? = false, modifierFnLock: Boolean? = false, modifierHyper: Boolean? = false, modifierNumLock: Boolean? = false, modifierScrollLock: Boolean? = false, modifierSuper: Boolean? = false, modifierSymbol: Boolean? = false, modifierSymbolLock: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MouseEventInit { js("return { screenX, screenY, clientX, clientY, button, buttons, relatedTarget, region, ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed };") }
public external interface EventModifierInit : UIEventInit, JsAny {
var ctrlKey: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var shiftKey: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var altKey: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var metaKey: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierAltGraph: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierCapsLock: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierFn: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierFnLock: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierHyper: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierNumLock: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierScrollLock: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierSuper: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierSymbol: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var modifierSymbolLock: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun EventModifierInit(ctrlKey: Boolean? = false, shiftKey: Boolean? = false, altKey: Boolean? = false, metaKey: Boolean? = false, modifierAltGraph: Boolean? = false, modifierCapsLock: Boolean? = false, modifierFn: Boolean? = false, modifierFnLock: Boolean? = false, modifierHyper: Boolean? = false, modifierNumLock: Boolean? = false, modifierScrollLock: Boolean? = false, modifierSuper: Boolean? = false, modifierSymbol: Boolean? = false, modifierSymbolLock: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): EventModifierInit { js("return { ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [WheelEvent](https://developer.mozilla.org/en/docs/Web/API/WheelEvent) to Kotlin
*/
public external open class WheelEvent(type: String, eventInitDict: WheelEventInit = definedExternally) : MouseEvent, JsAny {
open val deltaX: Double
open val deltaY: Double
open val deltaZ: Double
open val deltaMode: Int
companion object {
val DOM_DELTA_PIXEL: Int
val DOM_DELTA_LINE: Int
val DOM_DELTA_PAGE: Int
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface WheelEventInit : MouseEventInit, JsAny {
var deltaX: Double? /* = 0.0 */
get() = definedExternally
set(value) = definedExternally
var deltaY: Double? /* = 0.0 */
get() = definedExternally
set(value) = definedExternally
var deltaZ: Double? /* = 0.0 */
get() = definedExternally
set(value) = definedExternally
var deltaMode: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun WheelEventInit(deltaX: Double? = 0.0, deltaY: Double? = 0.0, deltaZ: Double? = 0.0, deltaMode: Int? = 0, screenX: Int? = 0, screenY: Int? = 0, clientX: Int? = 0, clientY: Int? = 0, button: Short? = 0, buttons: Short? = 0, relatedTarget: EventTarget? = null, region: String? = null, ctrlKey: Boolean? = false, shiftKey: Boolean? = false, altKey: Boolean? = false, metaKey: Boolean? = false, modifierAltGraph: Boolean? = false, modifierCapsLock: Boolean? = false, modifierFn: Boolean? = false, modifierFnLock: Boolean? = false, modifierHyper: Boolean? = false, modifierNumLock: Boolean? = false, modifierScrollLock: Boolean? = false, modifierSuper: Boolean? = false, modifierSymbol: Boolean? = false, modifierSymbolLock: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): WheelEventInit { js("return { deltaX, deltaY, deltaZ, deltaMode, screenX, screenY, clientX, clientY, button, buttons, relatedTarget, region, ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [InputEvent](https://developer.mozilla.org/en/docs/Web/API/InputEvent) to Kotlin
*/
public external open class InputEvent(type: String, eventInitDict: InputEventInit = definedExternally) : UIEvent, JsAny {
open val data: String
open val isComposing: Boolean
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface InputEventInit : UIEventInit, JsAny {
var data: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var isComposing: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun InputEventInit(data: String? = "", isComposing: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): InputEventInit { js("return { data, isComposing, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [KeyboardEvent](https://developer.mozilla.org/en/docs/Web/API/KeyboardEvent) to Kotlin
*/
public external open class KeyboardEvent(type: String, eventInitDict: KeyboardEventInit = definedExternally) : UIEvent, JsAny {
open val key: String
open val code: String
open val location: Int
open val ctrlKey: Boolean
open val shiftKey: Boolean
open val altKey: Boolean
open val metaKey: Boolean
open val repeat: Boolean
open val isComposing: Boolean
open val charCode: Int
open val keyCode: Int
open val which: Int
fun getModifierState(keyArg: String): Boolean
companion object {
val DOM_KEY_LOCATION_STANDARD: Int
val DOM_KEY_LOCATION_LEFT: Int
val DOM_KEY_LOCATION_RIGHT: Int
val DOM_KEY_LOCATION_NUMPAD: Int
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface KeyboardEventInit : EventModifierInit, JsAny {
var key: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var code: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var location: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var repeat: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var isComposing: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun KeyboardEventInit(key: String? = "", code: String? = "", location: Int? = 0, repeat: Boolean? = false, isComposing: Boolean? = false, ctrlKey: Boolean? = false, shiftKey: Boolean? = false, altKey: Boolean? = false, metaKey: Boolean? = false, modifierAltGraph: Boolean? = false, modifierCapsLock: Boolean? = false, modifierFn: Boolean? = false, modifierFnLock: Boolean? = false, modifierHyper: Boolean? = false, modifierNumLock: Boolean? = false, modifierScrollLock: Boolean? = false, modifierSuper: Boolean? = false, modifierSymbol: Boolean? = false, modifierSymbolLock: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): KeyboardEventInit { js("return { key, code, location, repeat, isComposing, ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [CompositionEvent](https://developer.mozilla.org/en/docs/Web/API/CompositionEvent) to Kotlin
*/
public external open class CompositionEvent(type: String, eventInitDict: CompositionEventInit = definedExternally) : UIEvent, JsAny {
open val data: String
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface CompositionEventInit : UIEventInit, JsAny {
var data: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun CompositionEventInit(data: String? = "", view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): CompositionEventInit { js("return { data, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [Event](https://developer.mozilla.org/en/docs/Web/API/Event) to Kotlin
*/
public external open class Event(type: String, eventInitDict: EventInit = definedExternally) : JsAny {
open val type: String
open val target: EventTarget?
open val currentTarget: EventTarget?
open val eventPhase: Short
open val bubbles: Boolean
open val cancelable: Boolean
open val defaultPrevented: Boolean
open val composed: Boolean
open val isTrusted: Boolean
open val timeStamp: JsNumber
fun composedPath(): JsArray<EventTarget>
fun stopPropagation()
fun stopImmediatePropagation()
fun preventDefault()
fun initEvent(type: String, bubbles: Boolean, cancelable: Boolean)
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
/**
* Exposes the JavaScript [EventTarget](https://developer.mozilla.org/en/docs/Web/API/EventTarget) to Kotlin
*/
public external abstract class EventTarget : JsAny {
fun addEventListener(type: String, callback: EventListener?, options: AddEventListenerOptions)
fun addEventListener(type: String, callback: ((Event) -> Unit)?, options: AddEventListenerOptions)
fun addEventListener(type: String, callback: EventListener?, options: Boolean)
fun addEventListener(type: String, callback: ((Event) -> Unit)?, options: Boolean)
fun addEventListener(type: String, callback: EventListener?)
fun addEventListener(type: String, callback: ((Event) -> Unit)?)
fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions)
fun removeEventListener(type: String, callback: ((Event) -> Unit)?, options: EventListenerOptions)
fun removeEventListener(type: String, callback: EventListener?, options: Boolean)
fun removeEventListener(type: String, callback: ((Event) -> Unit)?, options: Boolean)
fun removeEventListener(type: String, callback: EventListener?)
fun removeEventListener(type: String, callback: ((Event) -> Unit)?)
fun dispatchEvent(event: Event): Boolean
}
/**
* Exposes the JavaScript [EventListener](https://developer.mozilla.org/en/docs/Web/API/EventListener) to Kotlin
*/
public external interface EventListener : JsAny {
fun handleEvent(event: Event)
}
File diff suppressed because it is too large Load Diff
@@ -1,535 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.mediacapture
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
/**
* Exposes the JavaScript [MediaStream](https://developer.mozilla.org/en/docs/Web/API/MediaStream) to Kotlin
*/
public external open class MediaStream() : EventTarget, MediaProvider, JsAny {
constructor(stream: MediaStream)
constructor(tracks: JsArray<MediaStreamTrack>)
open val id: String
open val active: Boolean
var onaddtrack: ((MediaStreamTrackEvent) -> Unit)?
var onremovetrack: ((MediaStreamTrackEvent) -> Unit)?
fun getAudioTracks(): JsArray<MediaStreamTrack>
fun getVideoTracks(): JsArray<MediaStreamTrack>
fun getTracks(): JsArray<MediaStreamTrack>
fun getTrackById(trackId: String): MediaStreamTrack?
fun addTrack(track: MediaStreamTrack)
fun removeTrack(track: MediaStreamTrack)
fun clone(): MediaStream
}
/**
* Exposes the JavaScript [MediaStreamTrack](https://developer.mozilla.org/en/docs/Web/API/MediaStreamTrack) to Kotlin
*/
public external abstract class MediaStreamTrack : EventTarget, JsAny {
open val kind: String
open val id: String
open val label: String
open var enabled: Boolean
open val muted: Boolean
open var onmute: ((Event) -> Unit)?
open var onunmute: ((Event) -> Unit)?
open val readyState: MediaStreamTrackState
open var onended: ((Event) -> Unit)?
open var onoverconstrained: ((Event) -> Unit)?
fun clone(): MediaStreamTrack
fun stop()
fun getCapabilities(): MediaTrackCapabilities
fun getConstraints(): MediaTrackConstraints
fun getSettings(): MediaTrackSettings
fun applyConstraints(constraints: MediaTrackConstraints = definedExternally): Promise<Nothing?>
}
/**
* Exposes the JavaScript [MediaTrackSupportedConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaTrackSupportedConstraints) to Kotlin
*/
public external interface MediaTrackSupportedConstraints : JsAny {
var width: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var height: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var aspectRatio: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var frameRate: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var facingMode: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var resizeMode: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var volume: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var sampleRate: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var sampleSize: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var echoCancellation: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var autoGainControl: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var noiseSuppression: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var latency: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var channelCount: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var deviceId: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
var groupId: Boolean? /* = true */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaTrackSupportedConstraints(width: Boolean? = true, height: Boolean? = true, aspectRatio: Boolean? = true, frameRate: Boolean? = true, facingMode: Boolean? = true, resizeMode: Boolean? = true, volume: Boolean? = true, sampleRate: Boolean? = true, sampleSize: Boolean? = true, echoCancellation: Boolean? = true, autoGainControl: Boolean? = true, noiseSuppression: Boolean? = true, latency: Boolean? = true, channelCount: Boolean? = true, deviceId: Boolean? = true, groupId: Boolean? = true): MediaTrackSupportedConstraints { js("return { width, height, aspectRatio, frameRate, facingMode, resizeMode, volume, sampleRate, sampleSize, echoCancellation, autoGainControl, noiseSuppression, latency, channelCount, deviceId, groupId };") }
public external interface MediaTrackCapabilities : JsAny {
var width: ULongRange?
get() = definedExternally
set(value) = definedExternally
var height: ULongRange?
get() = definedExternally
set(value) = definedExternally
var aspectRatio: DoubleRange?
get() = definedExternally
set(value) = definedExternally
var frameRate: DoubleRange?
get() = definedExternally
set(value) = definedExternally
var facingMode: JsArray<JsString>?
get() = definedExternally
set(value) = definedExternally
var resizeMode: JsArray<JsString>?
get() = definedExternally
set(value) = definedExternally
var volume: DoubleRange?
get() = definedExternally
set(value) = definedExternally
var sampleRate: ULongRange?
get() = definedExternally
set(value) = definedExternally
var sampleSize: ULongRange?
get() = definedExternally
set(value) = definedExternally
var echoCancellation: JsArray<JsBoolean>?
get() = definedExternally
set(value) = definedExternally
var autoGainControl: JsArray<JsBoolean>?
get() = definedExternally
set(value) = definedExternally
var noiseSuppression: JsArray<JsBoolean>?
get() = definedExternally
set(value) = definedExternally
var latency: DoubleRange?
get() = definedExternally
set(value) = definedExternally
var channelCount: ULongRange?
get() = definedExternally
set(value) = definedExternally
var deviceId: String?
get() = definedExternally
set(value) = definedExternally
var groupId: String?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaTrackCapabilities(width: ULongRange? = undefined, height: ULongRange? = undefined, aspectRatio: DoubleRange? = undefined, frameRate: DoubleRange? = undefined, facingMode: JsArray<JsString>? = undefined, resizeMode: JsArray<JsString>? = undefined, volume: DoubleRange? = undefined, sampleRate: ULongRange? = undefined, sampleSize: ULongRange? = undefined, echoCancellation: JsArray<JsBoolean>? = undefined, autoGainControl: JsArray<JsBoolean>? = undefined, noiseSuppression: JsArray<JsBoolean>? = undefined, latency: DoubleRange? = undefined, channelCount: ULongRange? = undefined, deviceId: String? = undefined, groupId: String? = undefined): MediaTrackCapabilities { js("return { width, height, aspectRatio, frameRate, facingMode, resizeMode, volume, sampleRate, sampleSize, echoCancellation, autoGainControl, noiseSuppression, latency, channelCount, deviceId, groupId };") }
/**
* Exposes the JavaScript [MediaTrackConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaTrackConstraints) to Kotlin
*/
public external interface MediaTrackConstraints : MediaTrackConstraintSet, JsAny {
var advanced: JsArray<MediaTrackConstraintSet>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaTrackConstraints(advanced: JsArray<MediaTrackConstraintSet>? = undefined, width: JsAny? /* Int|ConstrainULongRange */ = undefined, height: JsAny? /* Int|ConstrainULongRange */ = undefined, aspectRatio: JsAny? /* Double|ConstrainDoubleRange */ = undefined, frameRate: JsAny? /* Double|ConstrainDoubleRange */ = undefined, facingMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, resizeMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, volume: JsAny? /* Double|ConstrainDoubleRange */ = undefined, sampleRate: JsAny? /* Int|ConstrainULongRange */ = undefined, sampleSize: JsAny? /* Int|ConstrainULongRange */ = undefined, echoCancellation: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, autoGainControl: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, noiseSuppression: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, latency: JsAny? /* Double|ConstrainDoubleRange */ = undefined, channelCount: JsAny? /* Int|ConstrainULongRange */ = undefined, deviceId: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, groupId: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined): MediaTrackConstraints { js("return { advanced, width, height, aspectRatio, frameRate, facingMode, resizeMode, volume, sampleRate, sampleSize, echoCancellation, autoGainControl, noiseSuppression, latency, channelCount, deviceId, groupId };") }
public external interface MediaTrackConstraintSet : JsAny {
var width: JsAny? /* Int|ConstrainULongRange */
get() = definedExternally
set(value) = definedExternally
var height: JsAny? /* Int|ConstrainULongRange */
get() = definedExternally
set(value) = definedExternally
var aspectRatio: JsAny? /* Double|ConstrainDoubleRange */
get() = definedExternally
set(value) = definedExternally
var frameRate: JsAny? /* Double|ConstrainDoubleRange */
get() = definedExternally
set(value) = definedExternally
var facingMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */
get() = definedExternally
set(value) = definedExternally
var resizeMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */
get() = definedExternally
set(value) = definedExternally
var volume: JsAny? /* Double|ConstrainDoubleRange */
get() = definedExternally
set(value) = definedExternally
var sampleRate: JsAny? /* Int|ConstrainULongRange */
get() = definedExternally
set(value) = definedExternally
var sampleSize: JsAny? /* Int|ConstrainULongRange */
get() = definedExternally
set(value) = definedExternally
var echoCancellation: JsAny? /* Boolean|ConstrainBooleanParameters */
get() = definedExternally
set(value) = definedExternally
var autoGainControl: JsAny? /* Boolean|ConstrainBooleanParameters */
get() = definedExternally
set(value) = definedExternally
var noiseSuppression: JsAny? /* Boolean|ConstrainBooleanParameters */
get() = definedExternally
set(value) = definedExternally
var latency: JsAny? /* Double|ConstrainDoubleRange */
get() = definedExternally
set(value) = definedExternally
var channelCount: JsAny? /* Int|ConstrainULongRange */
get() = definedExternally
set(value) = definedExternally
var deviceId: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */
get() = definedExternally
set(value) = definedExternally
var groupId: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaTrackConstraintSet(width: JsAny? /* Int|ConstrainULongRange */ = undefined, height: JsAny? /* Int|ConstrainULongRange */ = undefined, aspectRatio: JsAny? /* Double|ConstrainDoubleRange */ = undefined, frameRate: JsAny? /* Double|ConstrainDoubleRange */ = undefined, facingMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, resizeMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, volume: JsAny? /* Double|ConstrainDoubleRange */ = undefined, sampleRate: JsAny? /* Int|ConstrainULongRange */ = undefined, sampleSize: JsAny? /* Int|ConstrainULongRange */ = undefined, echoCancellation: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, autoGainControl: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, noiseSuppression: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, latency: JsAny? /* Double|ConstrainDoubleRange */ = undefined, channelCount: JsAny? /* Int|ConstrainULongRange */ = undefined, deviceId: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, groupId: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined): MediaTrackConstraintSet { js("return { width, height, aspectRatio, frameRate, facingMode, resizeMode, volume, sampleRate, sampleSize, echoCancellation, autoGainControl, noiseSuppression, latency, channelCount, deviceId, groupId };") }
/**
* Exposes the JavaScript [MediaTrackSettings](https://developer.mozilla.org/en/docs/Web/API/MediaTrackSettings) to Kotlin
*/
public external interface MediaTrackSettings : JsAny {
var width: Int?
get() = definedExternally
set(value) = definedExternally
var height: Int?
get() = definedExternally
set(value) = definedExternally
var aspectRatio: Double?
get() = definedExternally
set(value) = definedExternally
var frameRate: Double?
get() = definedExternally
set(value) = definedExternally
var facingMode: String?
get() = definedExternally
set(value) = definedExternally
var resizeMode: String?
get() = definedExternally
set(value) = definedExternally
var volume: Double?
get() = definedExternally
set(value) = definedExternally
var sampleRate: Int?
get() = definedExternally
set(value) = definedExternally
var sampleSize: Int?
get() = definedExternally
set(value) = definedExternally
var echoCancellation: Boolean?
get() = definedExternally
set(value) = definedExternally
var autoGainControl: Boolean?
get() = definedExternally
set(value) = definedExternally
var noiseSuppression: Boolean?
get() = definedExternally
set(value) = definedExternally
var latency: Double?
get() = definedExternally
set(value) = definedExternally
var channelCount: Int?
get() = definedExternally
set(value) = definedExternally
var deviceId: String?
get() = definedExternally
set(value) = definedExternally
var groupId: String?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaTrackSettings(width: Int? = undefined, height: Int? = undefined, aspectRatio: Double? = undefined, frameRate: Double? = undefined, facingMode: String? = undefined, resizeMode: String? = undefined, volume: Double? = undefined, sampleRate: Int? = undefined, sampleSize: Int? = undefined, echoCancellation: Boolean? = undefined, autoGainControl: Boolean? = undefined, noiseSuppression: Boolean? = undefined, latency: Double? = undefined, channelCount: Int? = undefined, deviceId: String? = undefined, groupId: String? = undefined): MediaTrackSettings { js("return { width, height, aspectRatio, frameRate, facingMode, resizeMode, volume, sampleRate, sampleSize, echoCancellation, autoGainControl, noiseSuppression, latency, channelCount, deviceId, groupId };") }
/**
* Exposes the JavaScript [MediaStreamTrackEvent](https://developer.mozilla.org/en/docs/Web/API/MediaStreamTrackEvent) to Kotlin
*/
public external open class MediaStreamTrackEvent(type: String, eventInitDict: MediaStreamTrackEventInit) : Event, JsAny {
open val track: MediaStreamTrack
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface MediaStreamTrackEventInit : EventInit, JsAny {
var track: MediaStreamTrack?
}
@Suppress("UNUSED_PARAMETER")
public fun MediaStreamTrackEventInit(track: MediaStreamTrack?, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaStreamTrackEventInit { js("return { track, bubbles, cancelable, composed };") }
public external open class OverconstrainedErrorEvent(type: String, eventInitDict: OverconstrainedErrorEventInit) : Event, JsAny {
open val error: JsAny?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface OverconstrainedErrorEventInit : EventInit, JsAny {
var error: JsAny? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun OverconstrainedErrorEventInit(error: JsAny? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): OverconstrainedErrorEventInit { js("return { error, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [MediaDevices](https://developer.mozilla.org/en/docs/Web/API/MediaDevices) to Kotlin
*/
public external abstract class MediaDevices : EventTarget, JsAny {
open var ondevicechange: ((Event) -> Unit)?
fun enumerateDevices(): Promise<JsArray<MediaDeviceInfo>>
fun getSupportedConstraints(): MediaTrackSupportedConstraints
fun getUserMedia(constraints: MediaStreamConstraints = definedExternally): Promise<MediaStream>
}
/**
* Exposes the JavaScript [MediaDeviceInfo](https://developer.mozilla.org/en/docs/Web/API/MediaDeviceInfo) to Kotlin
*/
public external abstract class MediaDeviceInfo : JsAny {
open val deviceId: String
open val kind: MediaDeviceKind
open val label: String
open val groupId: String
fun toJSON(): JsAny
}
public external abstract class InputDeviceInfo : MediaDeviceInfo, JsAny {
fun getCapabilities(): MediaTrackCapabilities
}
/**
* Exposes the JavaScript [MediaStreamConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaStreamConstraints) to Kotlin
*/
public external interface MediaStreamConstraints : JsAny {
var video: JsAny? /* Boolean|MediaTrackConstraints */
get() = definedExternally
set(value) = definedExternally
var audio: JsAny? /* Boolean|MediaTrackConstraints */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun MediaStreamConstraints(video: JsAny? /* Boolean|MediaTrackConstraints */ = false.toJsBoolean(), audio: JsAny? /* Boolean|MediaTrackConstraints */ = false.toJsBoolean()): MediaStreamConstraints { js("return { video, audio };") }
public external interface ConstrainablePattern : JsAny {
var onoverconstrained: ((Event) -> Unit)?
get() = definedExternally
set(value) = definedExternally
fun getCapabilities(): Capabilities
fun getConstraints(): Constraints
fun getSettings(): Settings
fun applyConstraints(constraints: Constraints = definedExternally): Promise<Nothing?>
}
/**
* Exposes the JavaScript [DoubleRange](https://developer.mozilla.org/en/docs/Web/API/DoubleRange) to Kotlin
*/
public external interface DoubleRange : JsAny {
var max: Double?
get() = definedExternally
set(value) = definedExternally
var min: Double?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun DoubleRange(max: Double? = undefined, min: Double? = undefined): DoubleRange { js("return { max, min };") }
public external interface ConstrainDoubleRange : DoubleRange, JsAny {
var exact: Double?
get() = definedExternally
set(value) = definedExternally
var ideal: Double?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ConstrainDoubleRange(exact: Double? = undefined, ideal: Double? = undefined, max: Double? = undefined, min: Double? = undefined): ConstrainDoubleRange { js("return { exact, ideal, max, min };") }
public external interface ULongRange : JsAny {
var max: Int?
get() = definedExternally
set(value) = definedExternally
var min: Int?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ULongRange(max: Int? = undefined, min: Int? = undefined): ULongRange { js("return { max, min };") }
public external interface ConstrainULongRange : ULongRange, JsAny {
var exact: Int?
get() = definedExternally
set(value) = definedExternally
var ideal: Int?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ConstrainULongRange(exact: Int? = undefined, ideal: Int? = undefined, max: Int? = undefined, min: Int? = undefined): ConstrainULongRange { js("return { exact, ideal, max, min };") }
/**
* Exposes the JavaScript [ConstrainBooleanParameters](https://developer.mozilla.org/en/docs/Web/API/ConstrainBooleanParameters) to Kotlin
*/
public external interface ConstrainBooleanParameters : JsAny {
var exact: Boolean?
get() = definedExternally
set(value) = definedExternally
var ideal: Boolean?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ConstrainBooleanParameters(exact: Boolean? = undefined, ideal: Boolean? = undefined): ConstrainBooleanParameters { js("return { exact, ideal };") }
/**
* Exposes the JavaScript [ConstrainDOMStringParameters](https://developer.mozilla.org/en/docs/Web/API/ConstrainDOMStringParameters) to Kotlin
*/
public external interface ConstrainDOMStringParameters : JsAny {
var exact: JsAny? /* String|JsArray<JsString> */
get() = definedExternally
set(value) = definedExternally
var ideal: JsAny? /* String|JsArray<JsString> */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ConstrainDOMStringParameters(exact: JsAny? /* String|JsArray<JsString> */ = undefined, ideal: JsAny? /* String|JsArray<JsString> */ = undefined): ConstrainDOMStringParameters { js("return { exact, ideal };") }
public external interface Capabilities : JsAny
@Suppress("UNUSED_PARAMETER")
public fun Capabilities(): Capabilities { js("return { };") }
public external interface Settings : JsAny
@Suppress("UNUSED_PARAMETER")
public fun Settings(): Settings { js("return { };") }
public external interface ConstraintSet : JsAny
@Suppress("UNUSED_PARAMETER")
public fun ConstraintSet(): ConstraintSet { js("return { };") }
public external interface Constraints : ConstraintSet, JsAny {
var advanced: JsArray<ConstraintSet>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun Constraints(advanced: JsArray<ConstraintSet>? = undefined): Constraints { js("return { advanced };") }
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaStreamTrackState : JsAny {
companion object
}
public inline val MediaStreamTrackState.Companion.LIVE: MediaStreamTrackState get() = "live".toJsString().unsafeCast<MediaStreamTrackState>()
public inline val MediaStreamTrackState.Companion.ENDED: MediaStreamTrackState get() = "ended".toJsString().unsafeCast<MediaStreamTrackState>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface VideoFacingModeEnum : JsAny {
companion object
}
public inline val VideoFacingModeEnum.Companion.USER: VideoFacingModeEnum get() = "user".toJsString().unsafeCast<VideoFacingModeEnum>()
public inline val VideoFacingModeEnum.Companion.ENVIRONMENT: VideoFacingModeEnum get() = "environment".toJsString().unsafeCast<VideoFacingModeEnum>()
public inline val VideoFacingModeEnum.Companion.LEFT: VideoFacingModeEnum get() = "left".toJsString().unsafeCast<VideoFacingModeEnum>()
public inline val VideoFacingModeEnum.Companion.RIGHT: VideoFacingModeEnum get() = "right".toJsString().unsafeCast<VideoFacingModeEnum>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface VideoResizeModeEnum : JsAny {
companion object
}
public inline val VideoResizeModeEnum.Companion.NONE: VideoResizeModeEnum get() = "none".toJsString().unsafeCast<VideoResizeModeEnum>()
public inline val VideoResizeModeEnum.Companion.CROP_AND_SCALE: VideoResizeModeEnum get() = "crop-and-scale".toJsString().unsafeCast<VideoResizeModeEnum>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaDeviceKind : JsAny {
companion object
}
public inline val MediaDeviceKind.Companion.AUDIOINPUT: MediaDeviceKind get() = "audioinput".toJsString().unsafeCast<MediaDeviceKind>()
public inline val MediaDeviceKind.Companion.AUDIOOUTPUT: MediaDeviceKind get() = "audiooutput".toJsString().unsafeCast<MediaDeviceKind>()
public inline val MediaDeviceKind.Companion.VIDEOINPUT: MediaDeviceKind get() = "videoinput".toJsString().unsafeCast<MediaDeviceKind>()
@@ -1,108 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.mediasource
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
/**
* Exposes the JavaScript [MediaSource](https://developer.mozilla.org/en/docs/Web/API/MediaSource) to Kotlin
*/
public external open class MediaSource : EventTarget, MediaProvider, JsAny {
open val sourceBuffers: SourceBufferList
open val activeSourceBuffers: SourceBufferList
open val readyState: ReadyState
var duration: Double
var onsourceopen: ((Event) -> Unit)?
var onsourceended: ((Event) -> Unit)?
var onsourceclose: ((Event) -> Unit)?
fun addSourceBuffer(type: String): SourceBuffer
fun removeSourceBuffer(sourceBuffer: SourceBuffer)
fun endOfStream(error: EndOfStreamError = definedExternally)
fun setLiveSeekableRange(start: Double, end: Double)
fun clearLiveSeekableRange()
companion object {
fun isTypeSupported(type: String): Boolean
}
}
/**
* Exposes the JavaScript [SourceBuffer](https://developer.mozilla.org/en/docs/Web/API/SourceBuffer) to Kotlin
*/
public external abstract class SourceBuffer : EventTarget, JsAny {
open var mode: AppendMode
open val updating: Boolean
open val buffered: TimeRanges
open var timestampOffset: Double
open val audioTracks: AudioTrackList
open val videoTracks: VideoTrackList
open val textTracks: TextTrackList
open var appendWindowStart: Double
open var appendWindowEnd: Double
open var onupdatestart: ((Event) -> Unit)?
open var onupdate: ((Event) -> Unit)?
open var onupdateend: ((Event) -> Unit)?
open var onerror: ((Event) -> Unit)?
open var onabort: ((Event) -> Unit)?
fun appendBuffer(data: JsAny?)
fun abort()
fun remove(start: Double, end: Double)
}
/**
* Exposes the JavaScript [SourceBufferList](https://developer.mozilla.org/en/docs/Web/API/SourceBufferList) to Kotlin
*/
public external abstract class SourceBufferList : EventTarget, JsAny {
open val length: Int
open var onaddsourcebuffer: ((Event) -> Unit)?
open var onremovesourcebuffer: ((Event) -> Unit)?
}
@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForSourceBufferList(obj: SourceBufferList, index: Int): SourceBuffer? { js("return obj[index];") }
public operator fun SourceBufferList.get(index: Int): SourceBuffer? = getMethodImplForSourceBufferList(this, index)
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ReadyState : JsAny {
companion object
}
public inline val ReadyState.Companion.CLOSED: ReadyState get() = "closed".toJsString().unsafeCast<ReadyState>()
public inline val ReadyState.Companion.OPEN: ReadyState get() = "open".toJsString().unsafeCast<ReadyState>()
public inline val ReadyState.Companion.ENDED: ReadyState get() = "ended".toJsString().unsafeCast<ReadyState>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface EndOfStreamError : JsAny {
companion object
}
public inline val EndOfStreamError.Companion.NETWORK: EndOfStreamError get() = "network".toJsString().unsafeCast<EndOfStreamError>()
public inline val EndOfStreamError.Companion.DECODE: EndOfStreamError get() = "decode".toJsString().unsafeCast<EndOfStreamError>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface AppendMode : JsAny {
companion object
}
public inline val AppendMode.Companion.SEGMENTS: AppendMode get() = "segments".toJsString().unsafeCast<AppendMode>()
public inline val AppendMode.Companion.SEQUENCE: AppendMode get() = "sequence".toJsString().unsafeCast<AppendMode>()
@@ -1,27 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.parsing
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
/**
* Exposes the JavaScript [DOMParser](https://developer.mozilla.org/en/docs/Web/API/DOMParser) to Kotlin
*/
public external open class DOMParser : JsAny {
fun parseFromString(str: String, type: JsAny?): Document
}
/**
* Exposes the JavaScript [XMLSerializer](https://developer.mozilla.org/en/docs/Web/API/XMLSerializer) to Kotlin
*/
public external open class XMLSerializer : JsAny {
fun serializeToString(root: Node): String
}
@@ -1,73 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.pointerevents
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
public external interface PointerEventInit : MouseEventInit, JsAny {
var pointerId: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var width: Double? /* = 1.0 */
get() = definedExternally
set(value) = definedExternally
var height: Double? /* = 1.0 */
get() = definedExternally
set(value) = definedExternally
var pressure: Float? /* = 0f */
get() = definedExternally
set(value) = definedExternally
var tangentialPressure: Float? /* = 0f */
get() = definedExternally
set(value) = definedExternally
var tiltX: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var tiltY: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var twist: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var pointerType: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var isPrimary: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun PointerEventInit(pointerId: Int? = 0, width: Double? = 1.0, height: Double? = 1.0, pressure: Float? = 0f, tangentialPressure: Float? = 0f, tiltX: Int? = 0, tiltY: Int? = 0, twist: Int? = 0, pointerType: String? = "", isPrimary: Boolean? = false, screenX: Int? = 0, screenY: Int? = 0, clientX: Int? = 0, clientY: Int? = 0, button: Short? = 0, buttons: Short? = 0, relatedTarget: EventTarget? = null, region: String? = null, ctrlKey: Boolean? = false, shiftKey: Boolean? = false, altKey: Boolean? = false, metaKey: Boolean? = false, modifierAltGraph: Boolean? = false, modifierCapsLock: Boolean? = false, modifierFn: Boolean? = false, modifierFnLock: Boolean? = false, modifierHyper: Boolean? = false, modifierNumLock: Boolean? = false, modifierScrollLock: Boolean? = false, modifierSuper: Boolean? = false, modifierSymbol: Boolean? = false, modifierSymbolLock: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): PointerEventInit { js("return { pointerId, width, height, pressure, tangentialPressure, tiltX, tiltY, twist, pointerType, isPrimary, screenX, screenY, clientX, clientY, button, buttons, relatedTarget, region, ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [PointerEvent](https://developer.mozilla.org/en/docs/Web/API/PointerEvent) to Kotlin
*/
public external open class PointerEvent(type: String, eventInitDict: PointerEventInit = definedExternally) : MouseEvent, JsAny {
open val pointerId: Int
open val width: Double
open val height: Double
open val pressure: Float
open val tangentialPressure: Float
open val tiltX: Int
open val tiltY: Int
open val twist: Int
open val pointerType: String
open val isPrimary: Boolean
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
File diff suppressed because it is too large Load Diff
@@ -1,53 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.dom.url
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.mediasource.*
import org.w3c.files.*
/**
* Exposes the JavaScript [URL](https://developer.mozilla.org/en/docs/Web/API/URL) to Kotlin
*/
public external open class URL(url: String, base: String = definedExternally) : JsAny {
var href: String
open val origin: String
var protocol: String
var username: String
var password: String
var host: String
var hostname: String
var port: String
var pathname: String
var search: String
open val searchParams: URLSearchParams
var hash: String
companion object {
fun domainToASCII(domain: String): String
fun domainToUnicode(domain: String): String
fun createObjectURL(mediaSource: MediaSource): String
fun createObjectURL(blob: Blob): String
fun createFor(blob: Blob): String
fun revokeObjectURL(url: String)
}
}
/**
* Exposes the JavaScript [URLSearchParams](https://developer.mozilla.org/en/docs/Web/API/URLSearchParams) to Kotlin
*/
public external open class URLSearchParams(init: JsAny? /* String|URLSearchParams */ = definedExternally) : JsAny {
fun append(name: String, value: String)
fun delete(name: String)
fun get(name: String): String?
fun getAll(name: String): JsArray<JsString>
fun has(name: String): Boolean
fun set(name: String, value: String)
}
@@ -1,286 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.fetch
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.files.*
import org.w3c.xhr.*
/**
* Exposes the JavaScript [Headers](https://developer.mozilla.org/en/docs/Web/API/Headers) to Kotlin
*/
public external open class Headers(init: JsAny? /* Headers|JsArray<JsArray<JsString>>|OpenEndedDictionary<JsString> */ = definedExternally) : JsAny {
fun append(name: String, value: String)
fun delete(name: String)
fun get(name: String): String?
fun has(name: String): Boolean
fun set(name: String, value: String)
}
/**
* Exposes the JavaScript [Body](https://developer.mozilla.org/en/docs/Web/API/Body) to Kotlin
*/
public external interface Body : JsAny {
val bodyUsed: Boolean
fun arrayBuffer(): Promise<ArrayBuffer>
fun blob(): Promise<Blob>
fun formData(): Promise<FormData>
fun json(): Promise<JsAny?>
fun text(): Promise<JsString>
}
/**
* Exposes the JavaScript [Request](https://developer.mozilla.org/en/docs/Web/API/Request) to Kotlin
*/
public external open class Request(input: JsAny? /* Request|String */, init: RequestInit = definedExternally) : Body, JsAny {
open val method: String
open val url: String
open val headers: Headers
open val type: RequestType
open val destination: RequestDestination
open val referrer: String
open val referrerPolicy: JsAny?
open val mode: RequestMode
open val credentials: RequestCredentials
open val cache: RequestCache
open val redirect: RequestRedirect
open val integrity: String
open val keepalive: Boolean
override val bodyUsed: Boolean
fun clone(): Request
override fun arrayBuffer(): Promise<ArrayBuffer>
override fun blob(): Promise<Blob>
override fun formData(): Promise<FormData>
override fun json(): Promise<JsAny?>
override fun text(): Promise<JsString>
}
public external interface RequestInit : JsAny {
var method: String?
get() = definedExternally
set(value) = definedExternally
var headers: JsAny? /* Headers|JsArray<JsArray<JsString>>|OpenEndedDictionary<JsString> */
get() = definedExternally
set(value) = definedExternally
var body: JsAny? /* Blob|BufferSource|FormData|URLSearchParams|String */
get() = definedExternally
set(value) = definedExternally
var referrer: String?
get() = definedExternally
set(value) = definedExternally
var referrerPolicy: JsAny?
get() = definedExternally
set(value) = definedExternally
var mode: RequestMode?
get() = definedExternally
set(value) = definedExternally
var credentials: RequestCredentials?
get() = definedExternally
set(value) = definedExternally
var cache: RequestCache?
get() = definedExternally
set(value) = definedExternally
var redirect: RequestRedirect?
get() = definedExternally
set(value) = definedExternally
var integrity: String?
get() = definedExternally
set(value) = definedExternally
var keepalive: Boolean?
get() = definedExternally
set(value) = definedExternally
var window: JsAny?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun RequestInit(method: String? = undefined, headers: JsAny? /* Headers|JsArray<JsArray<JsString>>|OpenEndedDictionary<JsString> */ = undefined, body: JsAny? /* Blob|BufferSource|FormData|URLSearchParams|String */ = undefined, referrer: String? = undefined, referrerPolicy: JsAny? = undefined, mode: RequestMode? = undefined, credentials: RequestCredentials? = undefined, cache: RequestCache? = undefined, redirect: RequestRedirect? = undefined, integrity: String? = undefined, keepalive: Boolean? = undefined, window: JsAny? = undefined): RequestInit { js("return { method, headers, body, referrer, referrerPolicy, mode, credentials, cache, redirect, integrity, keepalive, window };") }
/**
* Exposes the JavaScript [Response](https://developer.mozilla.org/en/docs/Web/API/Response) to Kotlin
*/
public external open class Response(body: JsAny? /* JsAny?|ReadableStream */ = definedExternally, init: ResponseInit = definedExternally) : Body, JsAny {
open val type: ResponseType
open val url: String
open val redirected: Boolean
open val status: Short
open val ok: Boolean
open val statusText: String
open val headers: Headers
open val body: JsAny?
open val trailer: Promise<Headers>
override val bodyUsed: Boolean
fun clone(): Response
override fun arrayBuffer(): Promise<ArrayBuffer>
override fun blob(): Promise<Blob>
override fun formData(): Promise<FormData>
override fun json(): Promise<JsAny?>
override fun text(): Promise<JsString>
companion object {
fun error(): Response
fun redirect(url: String, status: Short = definedExternally): Response
}
}
public external interface ResponseInit : JsAny {
var status: Short? /* = 200 */
get() = definedExternally
set(value) = definedExternally
var statusText: String? /* = "OK" */
get() = definedExternally
set(value) = definedExternally
var headers: JsAny? /* Headers|JsArray<JsArray<JsString>>|OpenEndedDictionary<JsString> */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ResponseInit(status: Short? = 200, statusText: String? = "OK", headers: JsAny? /* Headers|JsArray<JsArray<JsString>>|OpenEndedDictionary<JsString> */ = undefined): ResponseInit { js("return { status, statusText, headers };") }
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestType : JsAny {
companion object
}
public inline val RequestType.Companion.EMPTY: RequestType get() = "".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.AUDIO: RequestType get() = "audio".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.FONT: RequestType get() = "font".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.IMAGE: RequestType get() = "image".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.SCRIPT: RequestType get() = "script".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.STYLE: RequestType get() = "style".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.TRACK: RequestType get() = "track".toJsString().unsafeCast<RequestType>()
public inline val RequestType.Companion.VIDEO: RequestType get() = "video".toJsString().unsafeCast<RequestType>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestDestination : JsAny {
companion object
}
public inline val RequestDestination.Companion.EMPTY: RequestDestination get() = "".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.DOCUMENT: RequestDestination get() = "document".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.EMBED: RequestDestination get() = "embed".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.FONT: RequestDestination get() = "font".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.IMAGE: RequestDestination get() = "image".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.MANIFEST: RequestDestination get() = "manifest".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.MEDIA: RequestDestination get() = "media".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.OBJECT: RequestDestination get() = "object".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.REPORT: RequestDestination get() = "report".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.SCRIPT: RequestDestination get() = "script".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.SERVICEWORKER: RequestDestination get() = "serviceworker".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.SHAREDWORKER: RequestDestination get() = "sharedworker".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.STYLE: RequestDestination get() = "style".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.WORKER: RequestDestination get() = "worker".toJsString().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.XSLT: RequestDestination get() = "xslt".toJsString().unsafeCast<RequestDestination>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestMode : JsAny {
companion object
}
public inline val RequestMode.Companion.NAVIGATE: RequestMode get() = "navigate".toJsString().unsafeCast<RequestMode>()
public inline val RequestMode.Companion.SAME_ORIGIN: RequestMode get() = "same-origin".toJsString().unsafeCast<RequestMode>()
public inline val RequestMode.Companion.NO_CORS: RequestMode get() = "no-cors".toJsString().unsafeCast<RequestMode>()
public inline val RequestMode.Companion.CORS: RequestMode get() = "cors".toJsString().unsafeCast<RequestMode>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestCredentials : JsAny {
companion object
}
public inline val RequestCredentials.Companion.OMIT: RequestCredentials get() = "omit".toJsString().unsafeCast<RequestCredentials>()
public inline val RequestCredentials.Companion.SAME_ORIGIN: RequestCredentials get() = "same-origin".toJsString().unsafeCast<RequestCredentials>()
public inline val RequestCredentials.Companion.INCLUDE: RequestCredentials get() = "include".toJsString().unsafeCast<RequestCredentials>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestCache : JsAny {
companion object
}
public inline val RequestCache.Companion.DEFAULT: RequestCache get() = "default".toJsString().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.NO_STORE: RequestCache get() = "no-store".toJsString().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.RELOAD: RequestCache get() = "reload".toJsString().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.NO_CACHE: RequestCache get() = "no-cache".toJsString().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.FORCE_CACHE: RequestCache get() = "force-cache".toJsString().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.ONLY_IF_CACHED: RequestCache get() = "only-if-cached".toJsString().unsafeCast<RequestCache>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestRedirect : JsAny {
companion object
}
public inline val RequestRedirect.Companion.FOLLOW: RequestRedirect get() = "follow".toJsString().unsafeCast<RequestRedirect>()
public inline val RequestRedirect.Companion.ERROR: RequestRedirect get() = "error".toJsString().unsafeCast<RequestRedirect>()
public inline val RequestRedirect.Companion.MANUAL: RequestRedirect get() = "manual".toJsString().unsafeCast<RequestRedirect>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ResponseType : JsAny {
companion object
}
public inline val ResponseType.Companion.BASIC: ResponseType get() = "basic".toJsString().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.CORS: ResponseType get() = "cors".toJsString().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.DEFAULT: ResponseType get() = "default".toJsString().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.ERROR: ResponseType get() = "error".toJsString().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.OPAQUE: ResponseType get() = "opaque".toJsString().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.OPAQUEREDIRECT: ResponseType get() = "opaqueredirect".toJsString().unsafeCast<ResponseType>()
@@ -1,100 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.files
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.xhr.*
/**
* Exposes the JavaScript [Blob](https://developer.mozilla.org/en/docs/Web/API/Blob) to Kotlin
*/
public external open class Blob(blobParts: JsArray<JsAny? /* BufferSource|Blob|String */> = definedExternally, options: BlobPropertyBag = definedExternally) : MediaProvider, ImageBitmapSource, JsAny {
open val size: JsNumber
open val type: String
open val isClosed: Boolean
fun slice(start: Int = definedExternally, end: Int = definedExternally, contentType: String = definedExternally): Blob
fun close()
}
public external interface BlobPropertyBag : JsAny {
var type: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun BlobPropertyBag(type: String? = ""): BlobPropertyBag { js("return { type };") }
/**
* Exposes the JavaScript [File](https://developer.mozilla.org/en/docs/Web/API/File) to Kotlin
*/
public external open class File(fileBits: JsArray<JsAny? /* BufferSource|Blob|String */>, fileName: String, options: FilePropertyBag = definedExternally) : Blob, JsAny {
open val name: String
open val lastModified: Int
}
public external interface FilePropertyBag : BlobPropertyBag, JsAny {
var lastModified: Int?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun FilePropertyBag(lastModified: Int? = undefined, type: String? = ""): FilePropertyBag { js("return { lastModified, type };") }
/**
* Exposes the JavaScript [FileList](https://developer.mozilla.org/en/docs/Web/API/FileList) to Kotlin
*/
public external abstract class FileList : ItemArrayLike<File>, JsAny {
override fun item(index: Int): File?
}
@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForFileList(obj: FileList, index: Int): File? { js("return obj[index];") }
public operator fun FileList.get(index: Int): File? = getMethodImplForFileList(this, index)
/**
* Exposes the JavaScript [FileReader](https://developer.mozilla.org/en/docs/Web/API/FileReader) to Kotlin
*/
public external open class FileReader : EventTarget, JsAny {
open val readyState: Short
open val result: JsAny? /* String|ArrayBuffer */
open val error: JsAny?
var onloadstart: ((ProgressEvent) -> Unit)?
var onprogress: ((ProgressEvent) -> Unit)?
var onload: ((Event) -> Unit)?
var onabort: ((Event) -> Unit)?
var onerror: ((Event) -> Unit)?
var onloadend: ((Event) -> Unit)?
fun readAsArrayBuffer(blob: Blob)
fun readAsBinaryString(blob: Blob)
fun readAsText(blob: Blob, label: String = definedExternally)
fun readAsDataURL(blob: Blob)
fun abort()
companion object {
val EMPTY: Short
val LOADING: Short
val DONE: Short
}
}
/**
* Exposes the JavaScript [FileReaderSync](https://developer.mozilla.org/en/docs/Web/API/FileReaderSync) to Kotlin
*/
public external open class FileReaderSync : JsAny {
fun readAsArrayBuffer(blob: Blob): ArrayBuffer
fun readAsBinaryString(blob: Blob): String
fun readAsText(blob: Blob, label: String = definedExternally): String
fun readAsDataURL(blob: Blob): String
}
@@ -1,175 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.notifications
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.events.*
import org.w3c.workers.*
/**
* Exposes the JavaScript [Notification](https://developer.mozilla.org/en/docs/Web/API/Notification) to Kotlin
*/
public external open class Notification(title: String, options: NotificationOptions = definedExternally) : EventTarget, JsAny {
var onclick: ((MouseEvent) -> Unit)?
var onerror: ((Event) -> Unit)?
open val title: String
open val dir: NotificationDirection
open val lang: String
open val body: String
open val tag: String
open val image: String
open val icon: String
open val badge: String
open val sound: String
open val vibrate: JsArray<out JsNumber>
open val timestamp: JsNumber
open val renotify: Boolean
open val silent: Boolean
open val noscreen: Boolean
open val requireInteraction: Boolean
open val sticky: Boolean
open val data: JsAny?
open val actions: JsArray<out NotificationAction>
fun close()
companion object {
val permission: NotificationPermission
val maxActions: Int
fun requestPermission(deprecatedCallback: (NotificationPermission) -> Unit = definedExternally): Promise<NotificationPermission>
}
}
public external interface NotificationOptions : JsAny {
var dir: NotificationDirection? /* = NotificationDirection.AUTO */
get() = definedExternally
set(value) = definedExternally
var lang: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var body: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var tag: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var image: String?
get() = definedExternally
set(value) = definedExternally
var icon: String?
get() = definedExternally
set(value) = definedExternally
var badge: String?
get() = definedExternally
set(value) = definedExternally
var sound: String?
get() = definedExternally
set(value) = definedExternally
var vibrate: JsAny? /* Int|JsArray<JsNumber> */
get() = definedExternally
set(value) = definedExternally
var timestamp: JsNumber?
get() = definedExternally
set(value) = definedExternally
var renotify: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var silent: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var noscreen: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var requireInteraction: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var sticky: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var data: JsAny? /* = null */
get() = definedExternally
set(value) = definedExternally
var actions: JsArray<NotificationAction>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun NotificationOptions(dir: NotificationDirection? = NotificationDirection.AUTO, lang: String? = "", body: String? = "", tag: String? = "", image: String? = undefined, icon: String? = undefined, badge: String? = undefined, sound: String? = undefined, vibrate: JsAny? /* Int|JsArray<JsNumber> */ = undefined, timestamp: JsNumber? = undefined, renotify: Boolean? = false, silent: Boolean? = false, noscreen: Boolean? = false, requireInteraction: Boolean? = false, sticky: Boolean? = false, data: JsAny? = null, actions: JsArray<NotificationAction>? = JsArray()): NotificationOptions { js("return { dir, lang, body, tag, image, icon, badge, sound, vibrate, timestamp, renotify, silent, noscreen, requireInteraction, sticky, data, actions };") }
public external interface NotificationAction : JsAny {
var action: String?
var title: String?
var icon: String?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun NotificationAction(action: String?, title: String?, icon: String? = undefined): NotificationAction { js("return { action, title, icon };") }
public external interface GetNotificationOptions : JsAny {
var tag: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun GetNotificationOptions(tag: String? = ""): GetNotificationOptions { js("return { tag };") }
/**
* Exposes the JavaScript [NotificationEvent](https://developer.mozilla.org/en/docs/Web/API/NotificationEvent) to Kotlin
*/
public external open class NotificationEvent(type: String, eventInitDict: NotificationEventInit) : ExtendableEvent, JsAny {
open val notification: Notification
open val action: String
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface NotificationEventInit : ExtendableEventInit, JsAny {
var notification: Notification?
var action: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun NotificationEventInit(notification: Notification?, action: String? = "", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): NotificationEventInit { js("return { notification, action, bubbles, cancelable, composed };") }
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface NotificationPermission : JsAny {
companion object
}
public inline val NotificationPermission.Companion.DEFAULT: NotificationPermission get() = "default".toJsString().unsafeCast<NotificationPermission>()
public inline val NotificationPermission.Companion.DENIED: NotificationPermission get() = "denied".toJsString().unsafeCast<NotificationPermission>()
public inline val NotificationPermission.Companion.GRANTED: NotificationPermission get() = "granted".toJsString().unsafeCast<NotificationPermission>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface NotificationDirection : JsAny {
companion object
}
public inline val NotificationDirection.Companion.AUTO: NotificationDirection get() = "auto".toJsString().unsafeCast<NotificationDirection>()
public inline val NotificationDirection.Companion.LTR: NotificationDirection get() = "ltr".toJsString().unsafeCast<NotificationDirection>()
public inline val NotificationDirection.Companion.RTL: NotificationDirection get() = "rtl".toJsString().unsafeCast<NotificationDirection>()
@@ -1,68 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.performance
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.events.*
/**
* Exposes the JavaScript [Performance](https://developer.mozilla.org/en/docs/Web/API/Performance) to Kotlin
*/
public external abstract class Performance : EventTarget, JsAny {
open val timing: PerformanceTiming
open val navigation: PerformanceNavigation
fun now(): Double
}
public external interface GlobalPerformance : JsAny {
val performance: Performance
}
/**
* Exposes the JavaScript [PerformanceTiming](https://developer.mozilla.org/en/docs/Web/API/PerformanceTiming) to Kotlin
*/
public external abstract class PerformanceTiming : JsAny {
open val navigationStart: JsNumber
open val unloadEventStart: JsNumber
open val unloadEventEnd: JsNumber
open val redirectStart: JsNumber
open val redirectEnd: JsNumber
open val fetchStart: JsNumber
open val domainLookupStart: JsNumber
open val domainLookupEnd: JsNumber
open val connectStart: JsNumber
open val connectEnd: JsNumber
open val secureConnectionStart: JsNumber
open val requestStart: JsNumber
open val responseStart: JsNumber
open val responseEnd: JsNumber
open val domLoading: JsNumber
open val domInteractive: JsNumber
open val domContentLoadedEventStart: JsNumber
open val domContentLoadedEventEnd: JsNumber
open val domComplete: JsNumber
open val loadEventStart: JsNumber
open val loadEventEnd: JsNumber
}
/**
* Exposes the JavaScript [PerformanceNavigation](https://developer.mozilla.org/en/docs/Web/API/PerformanceNavigation) to Kotlin
*/
public external abstract class PerformanceNavigation : JsAny {
open val type: Short
open val redirectCount: Short
companion object {
val TYPE_NAVIGATE: Short
val TYPE_RELOAD: Short
val TYPE_BACK_FORWARD: Short
val TYPE_RESERVED: Short
}
}
@@ -1,442 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.workers
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.fetch.*
import org.w3c.notifications.*
/**
* Exposes the JavaScript [ServiceWorker](https://developer.mozilla.org/en/docs/Web/API/ServiceWorker) to Kotlin
*/
public external abstract class ServiceWorker : EventTarget, AbstractWorker, UnionMessagePortOrServiceWorker, UnionClientOrMessagePortOrServiceWorker, JsAny {
open val scriptURL: String
open val state: ServiceWorkerState
open var onstatechange: ((Event) -> Unit)?
fun postMessage(message: JsAny?, transfer: JsArray<JsAny> = definedExternally)
}
/**
* Exposes the JavaScript [ServiceWorkerRegistration](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerRegistration) to Kotlin
*/
public external abstract class ServiceWorkerRegistration : EventTarget, JsAny {
open val installing: ServiceWorker?
open val waiting: ServiceWorker?
open val active: ServiceWorker?
open val scope: String
open var onupdatefound: ((Event) -> Unit)?
open val APISpace: JsAny?
fun update(): Promise<Nothing?>
fun unregister(): Promise<JsBoolean>
fun showNotification(title: String, options: NotificationOptions = definedExternally): Promise<Nothing?>
fun getNotifications(filter: GetNotificationOptions = definedExternally): Promise<JsArray<Notification>>
fun methodName(): Promise<JsAny?>
}
/**
* Exposes the JavaScript [ServiceWorkerContainer](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerContainer) to Kotlin
*/
public external abstract class ServiceWorkerContainer : EventTarget, JsAny {
open val controller: ServiceWorker?
open val ready: Promise<ServiceWorkerRegistration>
open var oncontrollerchange: ((Event) -> Unit)?
open var onmessage: ((MessageEvent) -> Unit)?
fun register(scriptURL: String, options: RegistrationOptions = definedExternally): Promise<ServiceWorkerRegistration>
fun getRegistration(clientURL: String = definedExternally): Promise<JsAny?>
fun getRegistrations(): Promise<JsArray<ServiceWorkerRegistration>>
fun startMessages()
}
public external interface RegistrationOptions : JsAny {
var scope: String?
get() = definedExternally
set(value) = definedExternally
var type: WorkerType? /* = WorkerType.CLASSIC */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun RegistrationOptions(scope: String? = undefined, type: WorkerType? = WorkerType.CLASSIC): RegistrationOptions { js("return { scope, type };") }
/**
* Exposes the JavaScript [ServiceWorkerMessageEvent](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerMessageEvent) to Kotlin
*/
public external open class ServiceWorkerMessageEvent(type: String, eventInitDict: ServiceWorkerMessageEventInit = definedExternally) : Event, JsAny {
open val data: JsAny?
open val origin: String
open val lastEventId: String
open val source: UnionMessagePortOrServiceWorker?
open val ports: JsArray<out MessagePort>?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ServiceWorkerMessageEventInit : EventInit, JsAny {
var data: JsAny?
get() = definedExternally
set(value) = definedExternally
var origin: String?
get() = definedExternally
set(value) = definedExternally
var lastEventId: String?
get() = definedExternally
set(value) = definedExternally
var source: UnionMessagePortOrServiceWorker?
get() = definedExternally
set(value) = definedExternally
var ports: JsArray<MessagePort>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ServiceWorkerMessageEventInit(data: JsAny? = undefined, origin: String? = undefined, lastEventId: String? = undefined, source: UnionMessagePortOrServiceWorker? = undefined, ports: JsArray<MessagePort>? = undefined, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ServiceWorkerMessageEventInit { js("return { data, origin, lastEventId, source, ports, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [ServiceWorkerGlobalScope](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerGlobalScope) to Kotlin
*/
public external abstract class ServiceWorkerGlobalScope : WorkerGlobalScope, JsAny {
open val clients: Clients
open val registration: ServiceWorkerRegistration
open var oninstall: ((Event) -> Unit)?
open var onactivate: ((Event) -> Unit)?
open var onfetch: ((FetchEvent) -> Unit)?
open var onforeignfetch: ((Event) -> Unit)?
open var onmessage: ((MessageEvent) -> Unit)?
open var onnotificationclick: ((NotificationEvent) -> Unit)?
open var onnotificationclose: ((NotificationEvent) -> Unit)?
open var onfunctionalevent: ((Event) -> Unit)?
fun skipWaiting(): Promise<Nothing?>
}
/**
* Exposes the JavaScript [Client](https://developer.mozilla.org/en/docs/Web/API/Client) to Kotlin
*/
public external abstract class Client : UnionClientOrMessagePortOrServiceWorker, JsAny {
open val url: String
open val frameType: FrameType
open val id: String
fun postMessage(message: JsAny?, transfer: JsArray<JsAny> = definedExternally)
}
/**
* Exposes the JavaScript [WindowClient](https://developer.mozilla.org/en/docs/Web/API/WindowClient) to Kotlin
*/
public external abstract class WindowClient : Client, JsAny {
open val visibilityState: JsAny?
open val focused: Boolean
fun focus(): Promise<WindowClient>
fun navigate(url: String): Promise<WindowClient>
}
/**
* Exposes the JavaScript [Clients](https://developer.mozilla.org/en/docs/Web/API/Clients) to Kotlin
*/
public external abstract class Clients : JsAny {
fun get(id: String): Promise<JsAny?>
fun matchAll(options: ClientQueryOptions = definedExternally): Promise<JsArray<Client>>
fun openWindow(url: String): Promise<WindowClient?>
fun claim(): Promise<Nothing?>
}
public external interface ClientQueryOptions : JsAny {
var includeUncontrolled: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var type: ClientType? /* = ClientType.WINDOW */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ClientQueryOptions(includeUncontrolled: Boolean? = false, type: ClientType? = ClientType.WINDOW): ClientQueryOptions { js("return { includeUncontrolled, type };") }
/**
* Exposes the JavaScript [ExtendableEvent](https://developer.mozilla.org/en/docs/Web/API/ExtendableEvent) to Kotlin
*/
public external open class ExtendableEvent(type: String, eventInitDict: ExtendableEventInit = definedExternally) : Event, JsAny {
fun waitUntil(f: Promise<JsAny?>)
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ExtendableEventInit : EventInit, JsAny
@Suppress("UNUSED_PARAMETER")
public fun ExtendableEventInit(bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ExtendableEventInit { js("return { bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [InstallEvent](https://developer.mozilla.org/en/docs/Web/API/InstallEvent) to Kotlin
*/
public external open class InstallEvent(type: String, eventInitDict: ExtendableEventInit = definedExternally) : ExtendableEvent, JsAny {
fun registerForeignFetch(options: ForeignFetchOptions)
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ForeignFetchOptions : JsAny {
var scopes: JsArray<JsString>?
var origins: JsArray<JsString>?
}
@Suppress("UNUSED_PARAMETER")
public fun ForeignFetchOptions(scopes: JsArray<JsString>?, origins: JsArray<JsString>?): ForeignFetchOptions { js("return { scopes, origins };") }
/**
* Exposes the JavaScript [FetchEvent](https://developer.mozilla.org/en/docs/Web/API/FetchEvent) to Kotlin
*/
public external open class FetchEvent(type: String, eventInitDict: FetchEventInit) : ExtendableEvent, JsAny {
open val request: Request
open val clientId: String?
open val isReload: Boolean
fun respondWith(r: Promise<Response>)
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface FetchEventInit : ExtendableEventInit, JsAny {
var request: Request?
var clientId: String? /* = null */
get() = definedExternally
set(value) = definedExternally
var isReload: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun FetchEventInit(request: Request?, clientId: String? = null, isReload: Boolean? = false, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): FetchEventInit { js("return { request, clientId, isReload, bubbles, cancelable, composed };") }
public external open class ForeignFetchEvent(type: String, eventInitDict: ForeignFetchEventInit) : ExtendableEvent, JsAny {
open val request: Request
open val origin: String
fun respondWith(r: Promise<ForeignFetchResponse>)
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ForeignFetchEventInit : ExtendableEventInit, JsAny {
var request: Request?
var origin: String? /* = "null" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ForeignFetchEventInit(request: Request?, origin: String? = "null", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ForeignFetchEventInit { js("return { request, origin, bubbles, cancelable, composed };") }
public external interface ForeignFetchResponse : JsAny {
var response: Response?
var origin: String?
get() = definedExternally
set(value) = definedExternally
var headers: JsArray<JsString>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ForeignFetchResponse(response: Response?, origin: String? = undefined, headers: JsArray<JsString>? = undefined): ForeignFetchResponse { js("return { response, origin, headers };") }
/**
* Exposes the JavaScript [ExtendableMessageEvent](https://developer.mozilla.org/en/docs/Web/API/ExtendableMessageEvent) to Kotlin
*/
public external open class ExtendableMessageEvent(type: String, eventInitDict: ExtendableMessageEventInit = definedExternally) : ExtendableEvent, JsAny {
open val data: JsAny?
open val origin: String
open val lastEventId: String
open val source: UnionClientOrMessagePortOrServiceWorker?
open val ports: JsArray<out MessagePort>?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ExtendableMessageEventInit : ExtendableEventInit, JsAny {
var data: JsAny?
get() = definedExternally
set(value) = definedExternally
var origin: String?
get() = definedExternally
set(value) = definedExternally
var lastEventId: String?
get() = definedExternally
set(value) = definedExternally
var source: UnionClientOrMessagePortOrServiceWorker?
get() = definedExternally
set(value) = definedExternally
var ports: JsArray<MessagePort>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ExtendableMessageEventInit(data: JsAny? = undefined, origin: String? = undefined, lastEventId: String? = undefined, source: UnionClientOrMessagePortOrServiceWorker? = undefined, ports: JsArray<MessagePort>? = undefined, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ExtendableMessageEventInit { js("return { data, origin, lastEventId, source, ports, bubbles, cancelable, composed };") }
/**
* Exposes the JavaScript [Cache](https://developer.mozilla.org/en/docs/Web/API/Cache) to Kotlin
*/
public external abstract class Cache : JsAny {
fun match(request: Request, options: CacheQueryOptions = definedExternally): Promise<JsAny?>
fun match(request: String, options: CacheQueryOptions = definedExternally): Promise<JsAny?>
fun matchAll(request: Request, options: CacheQueryOptions = definedExternally): Promise<JsArray<Response>>
fun matchAll(request: String, options: CacheQueryOptions = definedExternally): Promise<JsArray<Response>>
fun matchAll(): Promise<JsArray<Response>>
fun add(request: Request): Promise<Nothing?>
fun add(request: String): Promise<Nothing?>
fun addAll(requests: JsArray<JsAny? /* Request|String */>): Promise<Nothing?>
fun put(request: Request, response: Response): Promise<Nothing?>
fun put(request: String, response: Response): Promise<Nothing?>
fun delete(request: Request, options: CacheQueryOptions = definedExternally): Promise<JsBoolean>
fun delete(request: String, options: CacheQueryOptions = definedExternally): Promise<JsBoolean>
fun keys(request: Request, options: CacheQueryOptions = definedExternally): Promise<JsArray<Request>>
fun keys(request: String, options: CacheQueryOptions = definedExternally): Promise<JsArray<Request>>
fun keys(): Promise<JsArray<Request>>
}
public external interface CacheQueryOptions : JsAny {
var ignoreSearch: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var ignoreMethod: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var ignoreVary: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var cacheName: String?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun CacheQueryOptions(ignoreSearch: Boolean? = false, ignoreMethod: Boolean? = false, ignoreVary: Boolean? = false, cacheName: String? = undefined): CacheQueryOptions { js("return { ignoreSearch, ignoreMethod, ignoreVary, cacheName };") }
public external interface CacheBatchOperation : JsAny {
var type: String?
get() = definedExternally
set(value) = definedExternally
var request: Request?
get() = definedExternally
set(value) = definedExternally
var response: Response?
get() = definedExternally
set(value) = definedExternally
var options: CacheQueryOptions?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun CacheBatchOperation(type: String? = undefined, request: Request? = undefined, response: Response? = undefined, options: CacheQueryOptions? = undefined): CacheBatchOperation { js("return { type, request, response, options };") }
/**
* Exposes the JavaScript [CacheStorage](https://developer.mozilla.org/en/docs/Web/API/CacheStorage) to Kotlin
*/
public external abstract class CacheStorage : JsAny {
fun match(request: Request, options: CacheQueryOptions = definedExternally): Promise<JsAny?>
fun match(request: String, options: CacheQueryOptions = definedExternally): Promise<JsAny?>
fun has(cacheName: String): Promise<JsBoolean>
fun open(cacheName: String): Promise<Cache>
fun delete(cacheName: String): Promise<JsBoolean>
fun keys(): Promise<JsArray<JsString>>
}
public external open class FunctionalEvent : ExtendableEvent, JsAny {
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface UnionMessagePortOrServiceWorker
public external interface UnionClientOrMessagePortOrServiceWorker
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ServiceWorkerState : JsAny {
companion object
}
public inline val ServiceWorkerState.Companion.INSTALLING: ServiceWorkerState get() = "installing".toJsString().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.INSTALLED: ServiceWorkerState get() = "installed".toJsString().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.ACTIVATING: ServiceWorkerState get() = "activating".toJsString().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.ACTIVATED: ServiceWorkerState get() = "activated".toJsString().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.REDUNDANT: ServiceWorkerState get() = "redundant".toJsString().unsafeCast<ServiceWorkerState>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface FrameType : JsAny {
companion object
}
public inline val FrameType.Companion.AUXILIARY: FrameType get() = "auxiliary".toJsString().unsafeCast<FrameType>()
public inline val FrameType.Companion.TOP_LEVEL: FrameType get() = "top-level".toJsString().unsafeCast<FrameType>()
public inline val FrameType.Companion.NESTED: FrameType get() = "nested".toJsString().unsafeCast<FrameType>()
public inline val FrameType.Companion.NONE: FrameType get() = "none".toJsString().unsafeCast<FrameType>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ClientType : JsAny {
companion object
}
public inline val ClientType.Companion.WINDOW: ClientType get() = "window".toJsString().unsafeCast<ClientType>()
public inline val ClientType.Companion.WORKER: ClientType get() = "worker".toJsString().unsafeCast<ClientType>()
public inline val ClientType.Companion.SHAREDWORKER: ClientType get() = "sharedworker".toJsString().unsafeCast<ClientType>()
public inline val ClientType.Companion.ALL: ClientType get() = "all".toJsString().unsafeCast<ClientType>()
@@ -1,134 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
// See github.com/kotlin/dukat for details
package org.w3c.xhr
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.dom.url.*
import org.w3c.files.*
/**
* Exposes the JavaScript [XMLHttpRequestEventTarget](https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequestEventTarget) to Kotlin
*/
public external abstract class XMLHttpRequestEventTarget : EventTarget, JsAny {
open var onloadstart: ((ProgressEvent) -> Unit)?
open var onprogress: ((ProgressEvent) -> Unit)?
open var onabort: ((Event) -> Unit)?
open var onerror: ((Event) -> Unit)?
open var onload: ((Event) -> Unit)?
open var ontimeout: ((Event) -> Unit)?
open var onloadend: ((Event) -> Unit)?
}
public external abstract class XMLHttpRequestUpload : XMLHttpRequestEventTarget, JsAny
/**
* Exposes the JavaScript [XMLHttpRequest](https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest) to Kotlin
*/
public external open class XMLHttpRequest : XMLHttpRequestEventTarget, JsAny {
var onreadystatechange: ((Event) -> Unit)?
open val readyState: Short
var timeout: Int
var withCredentials: Boolean
open val upload: XMLHttpRequestUpload
open val responseURL: String
open val status: Short
open val statusText: String
var responseType: XMLHttpRequestResponseType
open val response: JsAny?
open val responseText: String
open val responseXML: Document?
fun open(method: String, url: String)
fun open(method: String, url: String, async: Boolean, username: String? = definedExternally, password: String? = definedExternally)
fun setRequestHeader(name: String, value: String)
fun send(body: Document)
fun send(body: Blob)
fun send(body: FormData)
fun send(body: URLSearchParams)
fun send(body: String)
fun send()
fun abort()
fun getResponseHeader(name: String): String?
fun getAllResponseHeaders(): String
fun overrideMimeType(mime: String)
companion object {
val UNSENT: Short
val OPENED: Short
val HEADERS_RECEIVED: Short
val LOADING: Short
val DONE: Short
}
}
/**
* Exposes the JavaScript [FormData](https://developer.mozilla.org/en/docs/Web/API/FormData) to Kotlin
*/
public external open class FormData(form: HTMLFormElement = definedExternally) : JsAny {
fun append(name: String, value: String)
fun append(name: String, value: Blob, filename: String = definedExternally)
fun delete(name: String)
fun get(name: String): JsAny? /* File|String */
fun getAll(name: String): JsArray<JsAny? /* File|String */>
fun has(name: String): Boolean
fun set(name: String, value: String)
fun set(name: String, value: Blob, filename: String = definedExternally)
}
/**
* Exposes the JavaScript [ProgressEvent](https://developer.mozilla.org/en/docs/Web/API/ProgressEvent) to Kotlin
*/
public external open class ProgressEvent(type: String, eventInitDict: ProgressEventInit = definedExternally) : Event, JsAny {
open val lengthComputable: Boolean
open val loaded: JsNumber
open val total: JsNumber
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ProgressEventInit : EventInit, JsAny {
var lengthComputable: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var loaded: JsNumber? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var total: JsNumber? /* = 0 */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("UNUSED_PARAMETER")
public fun ProgressEventInit(lengthComputable: Boolean? = false, loaded: JsNumber? = 0.toJsNumber(), total: JsNumber? = 0.toJsNumber(), bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ProgressEventInit { js("return { lengthComputable, loaded, total, bubbles, cancelable, composed };") }
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface XMLHttpRequestResponseType : JsAny {
companion object
}
public inline val XMLHttpRequestResponseType.Companion.EMPTY: XMLHttpRequestResponseType get() = "".toJsString().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.ARRAYBUFFER: XMLHttpRequestResponseType get() = "arraybuffer".toJsString().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.BLOB: XMLHttpRequestResponseType get() = "blob".toJsString().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.DOCUMENT: XMLHttpRequestResponseType get() = "document".toJsString().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.JSON: XMLHttpRequestResponseType get() = "json".toJsString().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.TEXT: XMLHttpRequestResponseType get() = "text".toJsString().unsafeCast<XMLHttpRequestResponseType>()