[WASM] Add w3c bindings

This commit is contained in:
Igor Yakovlev
2022-09-19 20:11:31 +02:00
committed by teamcity
parent 4bafa2c9db
commit b6eb2b3620
30 changed files with 14005 additions and 7 deletions
+204
View File
@@ -0,0 +1,204 @@
/*
* 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
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetBoolean(obj: Dynamic, index: String, value: Boolean)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetByte(obj: Dynamic, index: String, value: Byte)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetShort(obj: Dynamic, index: String, value: Short)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetChar(obj: Dynamic, index: String, value: Char)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetInt(obj: Dynamic, index: String, value: Int)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetLong(obj: Dynamic, index: String, value: Long)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetFloat(obj: Dynamic, index: String, value: Float)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetDouble(obj: Dynamic, index: String, value: Double)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetString(obj: Dynamic, index: String, value: String?)
@PublishedApi
@JsFun("(obj, index, value) => obj[index] = value")
internal external fun dynamicSetAny(obj: Dynamic, index: String, value: Any?)
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetBoolean(obj: Dynamic, index: String): Boolean
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetByte(obj: Dynamic, index: String): Byte
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetShort(obj: Dynamic, index: String): Short
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetChar(obj: Dynamic, index: String): Char
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetInt(obj: Dynamic, index: String): Int
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetLong(obj: Dynamic, index: String): Long
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetFloat(obj: Dynamic, index: String): Float
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetDouble(obj: Dynamic, index: String): Double
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetString(obj: Dynamic, index: String): String?
@PublishedApi
@JsFun("(obj, index, value) => obj[index]")
internal external fun dynamicGetAny(obj: Dynamic, index: String): Any?
@PublishedApi
internal fun Dynamic.getBoolean(index: String): Boolean = dynamicGetBoolean(this, index)
@PublishedApi
internal fun Dynamic.getByte(index: String): Byte = dynamicGetByte(this, index)
@PublishedApi
internal fun Dynamic.getShort(index: String): Short = dynamicGetShort(this, index)
@PublishedApi
internal fun Dynamic.getChar(index: String): Char = dynamicGetChar(this, index)
@PublishedApi
internal fun Dynamic.getInt(index: String): Int = dynamicGetInt(this, index)
@PublishedApi
internal fun Dynamic.getLong(index: String): Long = dynamicGetLong(this, index)
@PublishedApi
internal fun Dynamic.getFloat(index: String): Float = dynamicGetFloat(this, index)
@PublishedApi
internal fun Dynamic.getDouble(index: String): Double = dynamicGetDouble(this, index)
@PublishedApi
internal fun Dynamic.getString(index: String): String? = dynamicGetString(this, index)
@PublishedApi
internal fun <T> Dynamic.getAny(index: String): T? = dynamicGetAny(this, index) as T?
@PublishedApi
internal fun Dynamic.getBoolean(index: Int): Boolean = dynamicGetBoolean(this, index.toString())
@PublishedApi
internal fun Dynamic.getByte(index: Int): Byte = dynamicGetByte(this, index.toString())
@PublishedApi
internal fun Dynamic.getShort(index: Int): Short = dynamicGetShort(this, index.toString())
@PublishedApi
internal fun Dynamic.getChar(index: Int): Char = dynamicGetChar(this, index.toString())
@PublishedApi
internal fun Dynamic.getInt(index: Int): Int = dynamicGetInt(this, index.toString())
@PublishedApi
internal fun Dynamic.getLong(index: Int): Long = dynamicGetLong(this, index.toString())
@PublishedApi
internal fun Dynamic.getFloat(index: Int): Float = dynamicGetFloat(this, index.toString())
@PublishedApi
internal fun Dynamic.getDouble(index: Int): Double = dynamicGetDouble(this, index.toString())
@PublishedApi
internal fun Dynamic.getString(index: Int): String? = dynamicGetString(this, index.toString())
@PublishedApi
internal fun <T> Dynamic.getAny(index: Int): T? = dynamicGetAny(this, index.toString()) as T?
/**
* Represents unversal type for JS interoperability.
*/
external interface Dynamic
/**
* Reinterprets this value as a value of the Dynamic type.
*/
@kotlin.internal.InlineOnly
fun Any.asDynamic(): Dynamic = this as Dynamic
/**
* Reinterprets this value as a value of the Dynamic type.
*/
@kotlin.internal.InlineOnly
fun String.asDynamic(): Dynamic = this.unsafeCast<Dynamic>()
operator fun Dynamic.set(index: String, value: Any?) {
when (value) {
is Boolean -> dynamicSetBoolean(this, index, value)
is Byte -> dynamicSetByte(this, index, value)
is Short -> dynamicSetShort(this, index, value)
is Char -> dynamicSetChar(this, index, value)
is Int -> dynamicSetInt(this, index, value)
is Long -> dynamicSetLong(this, index, value)
is Float -> dynamicSetFloat(this, index, value)
is Double -> dynamicSetDouble(this, index, value)
is String -> dynamicSetString(this, index, value)
else -> dynamicSetAny(this, index, value)
}
}
operator fun Dynamic.set(index: Int, value: Any?) {
this[index.toString()] = value
}
@JsFun("(x) => x")
private external fun <T> unsafeCastJs(x: String): Dynamic
fun <T> String.unsafeCast(): T = unsafeCastJs<T>(this) as T
@JsFun("(x) => x")
private external fun <T> unsafeCastJs(x: Boolean): Dynamic
/**
* Reinterprets boolean value as a value of the specified type [T] without any actual type checking.
*/
fun <T> Boolean.unsafeCast(): T = unsafeCastJs<T>(this) as T
/**
* Reinterprets Nothing? type value as Dynamic? null.
*/
fun <T> Nothing?.unsafeCast(): Dynamic? = null
/**
* Reinterprets Dynamic type value as a value of the specified type [T] without any actual type checking.
*/
fun <T> Dynamic.unsafeCast(): T = this as T
@@ -0,0 +1,31 @@
/*
* 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
external class Promise<T>
@PublishedApi
internal val undefined: Nothing? = null
/**
* Exposes the JavaScript [eval function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) to Kotlin.
*/
@JsFun("(s) => eval(s)")
external fun js(code: String): Dynamic
external interface ItemArrayLike<out T> {
val length: Int
fun item(index: Int): T?
}
fun <T> ItemArrayLike<T>.asList(): List<T> = object : AbstractList<T>() {
override val size: Int get() = this@asList.length
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]")
}
}
@@ -0,0 +1,16 @@
/*
* 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
@@ -0,0 +1,32 @@
/*
* 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) }
}
@@ -0,0 +1,51 @@
/*
* 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
}
@@ -0,0 +1,22 @@
/*
* 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
@@ -0,0 +1,27 @@
/*
* 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
@@ -0,0 +1,81 @@
/*
* 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.
*/
// 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 {
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 {
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
}
}
@@ -0,0 +1,69 @@
/*
* 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.
*/
// 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 {
var clipboardData: DataTransfer? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ClipboardEventInit(clipboardData: DataTransfer? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ClipboardEventInit {
val o = js("({})")
o["clipboardData"] = clipboardData
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as ClipboardEventInit
}
/**
* 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 {
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 {
fun read(): Promise<DataTransfer>
fun readText(): Promise<String>
fun write(data: DataTransfer): Promise<Unit>
fun writeText(data: String): Promise<Unit>
}
public external interface ClipboardPermissionDescriptor {
var allowWithoutGesture: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ClipboardPermissionDescriptor(allowWithoutGesture: Boolean? = false): ClipboardPermissionDescriptor {
val o = js("({})")
o["allowWithoutGesture"] = allowWithoutGesture
return o as ClipboardPermissionDescriptor
}
@@ -0,0 +1,487 @@
/*
* 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.
*/
// 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<String> {
open var mediaText: String
fun appendMedium(medium: String)
fun deleteMedium(medium: String)
override fun item(index: Int): String?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun MediaList.get(index: Int): String? = asDynamic().getString(index)
/**
* Exposes the JavaScript [StyleSheet](https://developer.mozilla.org/en/docs/Web/API/StyleSheet) to Kotlin
*/
public external abstract class StyleSheet {
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 {
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> {
override fun item(index: Int): StyleSheet?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun StyleSheetList.get(index: Int): StyleSheet? = asDynamic().getAny(index)
/**
* Exposes the JavaScript [LinkStyle](https://developer.mozilla.org/en/docs/Web/API/LinkStyle) to Kotlin
*/
public external interface LinkStyle {
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> {
override fun item(index: Int): CSSRule?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun CSSRuleList.get(index: Int): CSSRule? = asDynamic().getAny(index)
/**
* Exposes the JavaScript [CSSRule](https://developer.mozilla.org/en/docs/Web/API/CSSRule) to Kotlin
*/
public external abstract class CSSRule {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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<String> {
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): String
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun CSSStyleDeclaration.get(index: Int): String? = asDynamic().getString(index)
public external interface ElementCSSInlineStyle {
val style: CSSStyleDeclaration
}
/**
* Exposes the JavaScript [CSS](https://developer.mozilla.org/en/docs/Web/API/CSS) to Kotlin
*/
public external abstract class CSS {
companion object {
fun escape(ident: String): String
}
}
public external interface UnionElementOrProcessingInstruction
@@ -0,0 +1,241 @@
/*
* 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.
*/
// 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 {
var label: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var initDataTypes: Array<String>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
var audioCapabilities: Array<MediaKeySystemMediaCapability>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
var videoCapabilities: Array<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: Array<String>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaKeySystemConfiguration(label: String? = "", initDataTypes: Array<String>? = arrayOf(), audioCapabilities: Array<MediaKeySystemMediaCapability>? = arrayOf(), videoCapabilities: Array<MediaKeySystemMediaCapability>? = arrayOf(), distinctiveIdentifier: MediaKeysRequirement? = MediaKeysRequirement.OPTIONAL, persistentState: MediaKeysRequirement? = MediaKeysRequirement.OPTIONAL, sessionTypes: Array<String>? = undefined): MediaKeySystemConfiguration {
val o = js("({})")
o["label"] = label
o["initDataTypes"] = initDataTypes
o["audioCapabilities"] = audioCapabilities
o["videoCapabilities"] = videoCapabilities
o["distinctiveIdentifier"] = distinctiveIdentifier
o["persistentState"] = persistentState
o["sessionTypes"] = sessionTypes
return o as MediaKeySystemConfiguration
}
public external interface MediaKeySystemMediaCapability {
var contentType: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var robustness: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaKeySystemMediaCapability(contentType: String? = "", robustness: String? = ""): MediaKeySystemMediaCapability {
val o = js("({})")
o["contentType"] = contentType
o["robustness"] = robustness
return o as MediaKeySystemMediaCapability
}
/**
* Exposes the JavaScript [MediaKeySystemAccess](https://developer.mozilla.org/en/docs/Web/API/MediaKeySystemAccess) to Kotlin
*/
public external abstract class MediaKeySystemAccess {
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 {
fun createSession(sessionType: MediaKeySessionType = definedExternally): MediaKeySession
fun setServerCertificate(serverCertificate: Dynamic?): Promise<Boolean>
}
/**
* Exposes the JavaScript [MediaKeySession](https://developer.mozilla.org/en/docs/Web/API/MediaKeySession) to Kotlin
*/
public external abstract class MediaKeySession : EventTarget {
open val sessionId: String
open val expiration: Double
open val closed: Promise<Unit>
open val keyStatuses: MediaKeyStatusMap
open var onkeystatuseschange: ((Event) -> Dynamic?)?
open var onmessage: ((MessageEvent) -> Dynamic?)?
fun generateRequest(initDataType: String, initData: Dynamic?): Promise<Unit>
fun load(sessionId: String): Promise<Boolean>
fun update(response: Dynamic?): Promise<Unit>
fun close(): Promise<Unit>
fun remove(): Promise<Unit>
}
/**
* Exposes the JavaScript [MediaKeyStatusMap](https://developer.mozilla.org/en/docs/Web/API/MediaKeyStatusMap) to Kotlin
*/
public external abstract class MediaKeyStatusMap {
open val size: Int
fun has(keyId: Dynamic?): Boolean
fun get(keyId: Dynamic?): Any?
}
/**
* 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 {
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 {
var messageType: MediaKeyMessageType?
var message: ArrayBuffer?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaKeyMessageEventInit(messageType: MediaKeyMessageType?, message: ArrayBuffer?, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaKeyMessageEventInit {
val o = js("({})")
o["messageType"] = messageType
o["message"] = message
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as MediaKeyMessageEventInit
}
public external open class MediaEncryptedEvent(type: String, eventInitDict: MediaEncryptedEventInit = definedExternally) : Event {
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 {
var initDataType: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var initData: ArrayBuffer? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaEncryptedEventInit(initDataType: String? = "", initData: ArrayBuffer? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaEncryptedEventInit {
val o = js("({})")
o["initDataType"] = initDataType
o["initData"] = initData
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as MediaEncryptedEventInit
}
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeysRequirement {
companion object
}
public inline val MediaKeysRequirement.Companion.REQUIRED: MediaKeysRequirement get() = "required".asDynamic().unsafeCast<MediaKeysRequirement>()
public inline val MediaKeysRequirement.Companion.OPTIONAL: MediaKeysRequirement get() = "optional".asDynamic().unsafeCast<MediaKeysRequirement>()
public inline val MediaKeysRequirement.Companion.NOT_ALLOWED: MediaKeysRequirement get() = "not-allowed".asDynamic().unsafeCast<MediaKeysRequirement>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeySessionType {
companion object
}
public inline val MediaKeySessionType.Companion.TEMPORARY: MediaKeySessionType get() = "temporary".asDynamic().unsafeCast<MediaKeySessionType>()
public inline val MediaKeySessionType.Companion.PERSISTENT_LICENSE: MediaKeySessionType get() = "persistent-license".asDynamic().unsafeCast<MediaKeySessionType>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeyStatus {
companion object
}
public inline val MediaKeyStatus.Companion.USABLE: MediaKeyStatus get() = "usable".asDynamic().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.EXPIRED: MediaKeyStatus get() = "expired".asDynamic().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.RELEASED: MediaKeyStatus get() = "released".asDynamic().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.OUTPUT_RESTRICTED: MediaKeyStatus get() = "output-restricted".asDynamic().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.OUTPUT_DOWNSCALED: MediaKeyStatus get() = "output-downscaled".asDynamic().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.STATUS_PENDING: MediaKeyStatus get() = "status-pending".asDynamic().unsafeCast<MediaKeyStatus>()
public inline val MediaKeyStatus.Companion.INTERNAL_ERROR: MediaKeyStatus get() = "internal-error".asDynamic().unsafeCast<MediaKeyStatus>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaKeyMessageType {
companion object
}
public inline val MediaKeyMessageType.Companion.LICENSE_REQUEST: MediaKeyMessageType get() = "license-request".asDynamic().unsafeCast<MediaKeyMessageType>()
public inline val MediaKeyMessageType.Companion.LICENSE_RENEWAL: MediaKeyMessageType get() = "license-renewal".asDynamic().unsafeCast<MediaKeyMessageType>()
public inline val MediaKeyMessageType.Companion.LICENSE_RELEASE: MediaKeyMessageType get() = "license-release".asDynamic().unsafeCast<MediaKeyMessageType>()
public inline val MediaKeyMessageType.Companion.INDIVIDUALIZATION_REQUEST: MediaKeyMessageType get() = "individualization-request".asDynamic().unsafeCast<MediaKeyMessageType>()
@@ -0,0 +1,515 @@
/*
* 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.
*/
// 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 {
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 {
var view: Window? /* = null */
get() = definedExternally
set(value) = definedExternally
var detail: Int? /* = 0 */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun UIEventInit(view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): UIEventInit {
val o = js("({})")
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as UIEventInit
}
/**
* 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 {
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 {
var relatedTarget: EventTarget? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun FocusEventInit(relatedTarget: EventTarget? = null, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): FocusEventInit {
val o = js("({})")
o["relatedTarget"] = relatedTarget
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as FocusEventInit
}
/**
* 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 {
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 {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["screenX"] = screenX
o["screenY"] = screenY
o["clientX"] = clientX
o["clientY"] = clientY
o["button"] = button
o["buttons"] = buttons
o["relatedTarget"] = relatedTarget
o["region"] = region
o["ctrlKey"] = ctrlKey
o["shiftKey"] = shiftKey
o["altKey"] = altKey
o["metaKey"] = metaKey
o["modifierAltGraph"] = modifierAltGraph
o["modifierCapsLock"] = modifierCapsLock
o["modifierFn"] = modifierFn
o["modifierFnLock"] = modifierFnLock
o["modifierHyper"] = modifierHyper
o["modifierNumLock"] = modifierNumLock
o["modifierScrollLock"] = modifierScrollLock
o["modifierSuper"] = modifierSuper
o["modifierSymbol"] = modifierSymbol
o["modifierSymbolLock"] = modifierSymbolLock
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as MouseEventInit
}
public external interface EventModifierInit : UIEventInit {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["ctrlKey"] = ctrlKey
o["shiftKey"] = shiftKey
o["altKey"] = altKey
o["metaKey"] = metaKey
o["modifierAltGraph"] = modifierAltGraph
o["modifierCapsLock"] = modifierCapsLock
o["modifierFn"] = modifierFn
o["modifierFnLock"] = modifierFnLock
o["modifierHyper"] = modifierHyper
o["modifierNumLock"] = modifierNumLock
o["modifierScrollLock"] = modifierScrollLock
o["modifierSuper"] = modifierSuper
o["modifierSymbol"] = modifierSymbol
o["modifierSymbolLock"] = modifierSymbolLock
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as EventModifierInit
}
/**
* 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 {
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 {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["deltaX"] = deltaX
o["deltaY"] = deltaY
o["deltaZ"] = deltaZ
o["deltaMode"] = deltaMode
o["screenX"] = screenX
o["screenY"] = screenY
o["clientX"] = clientX
o["clientY"] = clientY
o["button"] = button
o["buttons"] = buttons
o["relatedTarget"] = relatedTarget
o["region"] = region
o["ctrlKey"] = ctrlKey
o["shiftKey"] = shiftKey
o["altKey"] = altKey
o["metaKey"] = metaKey
o["modifierAltGraph"] = modifierAltGraph
o["modifierCapsLock"] = modifierCapsLock
o["modifierFn"] = modifierFn
o["modifierFnLock"] = modifierFnLock
o["modifierHyper"] = modifierHyper
o["modifierNumLock"] = modifierNumLock
o["modifierScrollLock"] = modifierScrollLock
o["modifierSuper"] = modifierSuper
o["modifierSymbol"] = modifierSymbol
o["modifierSymbolLock"] = modifierSymbolLock
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as WheelEventInit
}
/**
* 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 {
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 {
var data: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
var isComposing: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun InputEventInit(data: String? = "", isComposing: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): InputEventInit {
val o = js("({})")
o["data"] = data
o["isComposing"] = isComposing
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as InputEventInit
}
/**
* 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 {
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 {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["key"] = key
o["code"] = code
o["location"] = location
o["repeat"] = repeat
o["isComposing"] = isComposing
o["ctrlKey"] = ctrlKey
o["shiftKey"] = shiftKey
o["altKey"] = altKey
o["metaKey"] = metaKey
o["modifierAltGraph"] = modifierAltGraph
o["modifierCapsLock"] = modifierCapsLock
o["modifierFn"] = modifierFn
o["modifierFnLock"] = modifierFnLock
o["modifierHyper"] = modifierHyper
o["modifierNumLock"] = modifierNumLock
o["modifierScrollLock"] = modifierScrollLock
o["modifierSuper"] = modifierSuper
o["modifierSymbol"] = modifierSymbol
o["modifierSymbolLock"] = modifierSymbolLock
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as KeyboardEventInit
}
/**
* 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 {
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 {
var data: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun CompositionEventInit(data: String? = "", view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): CompositionEventInit {
val o = js("({})")
o["data"] = data
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as CompositionEventInit
}
/**
* 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) {
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: Number
fun composedPath(): Array<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 {
fun addEventListener(type: String, callback: EventListener?, options: Dynamic? = definedExternally)
fun addEventListener(type: String, callback: ((Event) -> Unit)?, options: Dynamic? = definedExternally)
fun removeEventListener(type: String, callback: EventListener?, options: Dynamic? = definedExternally)
fun removeEventListener(type: String, callback: ((Event) -> Unit)?, options: Dynamic? = definedExternally)
fun dispatchEvent(event: Event): Boolean
}
/**
* Exposes the JavaScript [EventListener](https://developer.mozilla.org/en/docs/Web/API/EventListener) to Kotlin
*/
public external interface EventListener {
fun handleEvent(event: Event)
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,715 @@
/*
* 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.
*/
// 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 {
constructor(stream: MediaStream)
constructor(tracks: Array<MediaStreamTrack>)
open val id: String
open val active: Boolean
var onaddtrack: ((MediaStreamTrackEvent) -> Dynamic?)?
var onremovetrack: ((MediaStreamTrackEvent) -> Dynamic?)?
fun getAudioTracks(): Array<MediaStreamTrack>
fun getVideoTracks(): Array<MediaStreamTrack>
fun getTracks(): Array<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 {
open val kind: String
open val id: String
open val label: String
open var enabled: Boolean
open val muted: Boolean
open var onmute: ((Event) -> Dynamic?)?
open var onunmute: ((Event) -> Dynamic?)?
open val readyState: MediaStreamTrackState
open var onended: ((Event) -> Dynamic?)?
open var onoverconstrained: ((Event) -> Dynamic?)?
fun clone(): MediaStreamTrack
fun stop()
fun getCapabilities(): MediaTrackCapabilities
fun getConstraints(): MediaTrackConstraints
fun getSettings(): MediaTrackSettings
fun applyConstraints(constraints: MediaTrackConstraints = definedExternally): Promise<Unit>
}
/**
* Exposes the JavaScript [MediaTrackSupportedConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaTrackSupportedConstraints) to Kotlin
*/
public external interface MediaTrackSupportedConstraints {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["width"] = width
o["height"] = height
o["aspectRatio"] = aspectRatio
o["frameRate"] = frameRate
o["facingMode"] = facingMode
o["resizeMode"] = resizeMode
o["volume"] = volume
o["sampleRate"] = sampleRate
o["sampleSize"] = sampleSize
o["echoCancellation"] = echoCancellation
o["autoGainControl"] = autoGainControl
o["noiseSuppression"] = noiseSuppression
o["latency"] = latency
o["channelCount"] = channelCount
o["deviceId"] = deviceId
o["groupId"] = groupId
return o as MediaTrackSupportedConstraints
}
public external interface MediaTrackCapabilities {
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: Array<String>?
get() = definedExternally
set(value) = definedExternally
var resizeMode: Array<String>?
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: Array<Boolean>?
get() = definedExternally
set(value) = definedExternally
var autoGainControl: Array<Boolean>?
get() = definedExternally
set(value) = definedExternally
var noiseSuppression: Array<Boolean>?
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaTrackCapabilities(width: ULongRange? = undefined, height: ULongRange? = undefined, aspectRatio: DoubleRange? = undefined, frameRate: DoubleRange? = undefined, facingMode: Array<String>? = undefined, resizeMode: Array<String>? = undefined, volume: DoubleRange? = undefined, sampleRate: ULongRange? = undefined, sampleSize: ULongRange? = undefined, echoCancellation: Array<Boolean>? = undefined, autoGainControl: Array<Boolean>? = undefined, noiseSuppression: Array<Boolean>? = undefined, latency: DoubleRange? = undefined, channelCount: ULongRange? = undefined, deviceId: String? = undefined, groupId: String? = undefined): MediaTrackCapabilities {
val o = js("({})")
o["width"] = width
o["height"] = height
o["aspectRatio"] = aspectRatio
o["frameRate"] = frameRate
o["facingMode"] = facingMode
o["resizeMode"] = resizeMode
o["volume"] = volume
o["sampleRate"] = sampleRate
o["sampleSize"] = sampleSize
o["echoCancellation"] = echoCancellation
o["autoGainControl"] = autoGainControl
o["noiseSuppression"] = noiseSuppression
o["latency"] = latency
o["channelCount"] = channelCount
o["deviceId"] = deviceId
o["groupId"] = groupId
return o as MediaTrackCapabilities
}
/**
* Exposes the JavaScript [MediaTrackConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaTrackConstraints) to Kotlin
*/
public external interface MediaTrackConstraints : MediaTrackConstraintSet {
var advanced: Array<MediaTrackConstraintSet>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaTrackConstraints(advanced: Array<MediaTrackConstraintSet>? = undefined, width: Dynamic? = undefined, height: Dynamic? = undefined, aspectRatio: Dynamic? = undefined, frameRate: Dynamic? = undefined, facingMode: Dynamic? = undefined, resizeMode: Dynamic? = undefined, volume: Dynamic? = undefined, sampleRate: Dynamic? = undefined, sampleSize: Dynamic? = undefined, echoCancellation: Dynamic? = undefined, autoGainControl: Dynamic? = undefined, noiseSuppression: Dynamic? = undefined, latency: Dynamic? = undefined, channelCount: Dynamic? = undefined, deviceId: Dynamic? = undefined, groupId: Dynamic? = undefined): MediaTrackConstraints {
val o = js("({})")
o["advanced"] = advanced
o["width"] = width
o["height"] = height
o["aspectRatio"] = aspectRatio
o["frameRate"] = frameRate
o["facingMode"] = facingMode
o["resizeMode"] = resizeMode
o["volume"] = volume
o["sampleRate"] = sampleRate
o["sampleSize"] = sampleSize
o["echoCancellation"] = echoCancellation
o["autoGainControl"] = autoGainControl
o["noiseSuppression"] = noiseSuppression
o["latency"] = latency
o["channelCount"] = channelCount
o["deviceId"] = deviceId
o["groupId"] = groupId
return o as MediaTrackConstraints
}
public external interface MediaTrackConstraintSet {
var width: Dynamic?
get() = definedExternally
set(value) = definedExternally
var height: Dynamic?
get() = definedExternally
set(value) = definedExternally
var aspectRatio: Dynamic?
get() = definedExternally
set(value) = definedExternally
var frameRate: Dynamic?
get() = definedExternally
set(value) = definedExternally
var facingMode: Dynamic?
get() = definedExternally
set(value) = definedExternally
var resizeMode: Dynamic?
get() = definedExternally
set(value) = definedExternally
var volume: Dynamic?
get() = definedExternally
set(value) = definedExternally
var sampleRate: Dynamic?
get() = definedExternally
set(value) = definedExternally
var sampleSize: Dynamic?
get() = definedExternally
set(value) = definedExternally
var echoCancellation: Dynamic?
get() = definedExternally
set(value) = definedExternally
var autoGainControl: Dynamic?
get() = definedExternally
set(value) = definedExternally
var noiseSuppression: Dynamic?
get() = definedExternally
set(value) = definedExternally
var latency: Dynamic?
get() = definedExternally
set(value) = definedExternally
var channelCount: Dynamic?
get() = definedExternally
set(value) = definedExternally
var deviceId: Dynamic?
get() = definedExternally
set(value) = definedExternally
var groupId: Dynamic?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaTrackConstraintSet(width: Dynamic? = undefined, height: Dynamic? = undefined, aspectRatio: Dynamic? = undefined, frameRate: Dynamic? = undefined, facingMode: Dynamic? = undefined, resizeMode: Dynamic? = undefined, volume: Dynamic? = undefined, sampleRate: Dynamic? = undefined, sampleSize: Dynamic? = undefined, echoCancellation: Dynamic? = undefined, autoGainControl: Dynamic? = undefined, noiseSuppression: Dynamic? = undefined, latency: Dynamic? = undefined, channelCount: Dynamic? = undefined, deviceId: Dynamic? = undefined, groupId: Dynamic? = undefined): MediaTrackConstraintSet {
val o = js("({})")
o["width"] = width
o["height"] = height
o["aspectRatio"] = aspectRatio
o["frameRate"] = frameRate
o["facingMode"] = facingMode
o["resizeMode"] = resizeMode
o["volume"] = volume
o["sampleRate"] = sampleRate
o["sampleSize"] = sampleSize
o["echoCancellation"] = echoCancellation
o["autoGainControl"] = autoGainControl
o["noiseSuppression"] = noiseSuppression
o["latency"] = latency
o["channelCount"] = channelCount
o["deviceId"] = deviceId
o["groupId"] = groupId
return o as MediaTrackConstraintSet
}
/**
* Exposes the JavaScript [MediaTrackSettings](https://developer.mozilla.org/en/docs/Web/API/MediaTrackSettings) to Kotlin
*/
public external interface MediaTrackSettings {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["width"] = width
o["height"] = height
o["aspectRatio"] = aspectRatio
o["frameRate"] = frameRate
o["facingMode"] = facingMode
o["resizeMode"] = resizeMode
o["volume"] = volume
o["sampleRate"] = sampleRate
o["sampleSize"] = sampleSize
o["echoCancellation"] = echoCancellation
o["autoGainControl"] = autoGainControl
o["noiseSuppression"] = noiseSuppression
o["latency"] = latency
o["channelCount"] = channelCount
o["deviceId"] = deviceId
o["groupId"] = groupId
return o as MediaTrackSettings
}
/**
* 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 {
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 {
var track: MediaStreamTrack?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaStreamTrackEventInit(track: MediaStreamTrack?, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaStreamTrackEventInit {
val o = js("({})")
o["track"] = track
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as MediaStreamTrackEventInit
}
public external open class OverconstrainedErrorEvent(type: String, eventInitDict: OverconstrainedErrorEventInit) : Event {
open val error: Dynamic?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface OverconstrainedErrorEventInit : EventInit {
var error: Dynamic? /* = null */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun OverconstrainedErrorEventInit(error: Dynamic? = null.unsafeCast<Dynamic?>(), bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): OverconstrainedErrorEventInit {
val o = js("({})")
o["error"] = error
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as OverconstrainedErrorEventInit
}
/**
* Exposes the JavaScript [MediaDevices](https://developer.mozilla.org/en/docs/Web/API/MediaDevices) to Kotlin
*/
public external abstract class MediaDevices : EventTarget {
open var ondevicechange: ((Event) -> Dynamic?)?
fun enumerateDevices(): Promise<Array<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 {
open val deviceId: String
open val kind: MediaDeviceKind
open val label: String
open val groupId: String
fun toJSON(): Dynamic?
}
public external abstract class InputDeviceInfo : MediaDeviceInfo {
fun getCapabilities(): MediaTrackCapabilities
}
/**
* Exposes the JavaScript [MediaStreamConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaStreamConstraints) to Kotlin
*/
public external interface MediaStreamConstraints {
var video: Dynamic? /* = false */
get() = definedExternally
set(value) = definedExternally
var audio: Dynamic? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun MediaStreamConstraints(video: Dynamic? = false.unsafeCast<Dynamic?>(), audio: Dynamic? = false.unsafeCast<Dynamic?>()): MediaStreamConstraints {
val o = js("({})")
o["video"] = video
o["audio"] = audio
return o as MediaStreamConstraints
}
public external interface ConstrainablePattern {
var onoverconstrained: ((Event) -> Dynamic?)?
get() = definedExternally
set(value) = definedExternally
fun getCapabilities(): Capabilities
fun getConstraints(): Constraints
fun getSettings(): Settings
fun applyConstraints(constraints: Constraints = definedExternally): Promise<Unit>
}
/**
* Exposes the JavaScript [DoubleRange](https://developer.mozilla.org/en/docs/Web/API/DoubleRange) to Kotlin
*/
public external interface DoubleRange {
var max: Double?
get() = definedExternally
set(value) = definedExternally
var min: Double?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun DoubleRange(max: Double? = undefined, min: Double? = undefined): DoubleRange {
val o = js("({})")
o["max"] = max
o["min"] = min
return o as DoubleRange
}
public external interface ConstrainDoubleRange : DoubleRange {
var exact: Double?
get() = definedExternally
set(value) = definedExternally
var ideal: Double?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ConstrainDoubleRange(exact: Double? = undefined, ideal: Double? = undefined, max: Double? = undefined, min: Double? = undefined): ConstrainDoubleRange {
val o = js("({})")
o["exact"] = exact
o["ideal"] = ideal
o["max"] = max
o["min"] = min
return o as ConstrainDoubleRange
}
public external interface ULongRange {
var max: Int?
get() = definedExternally
set(value) = definedExternally
var min: Int?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ULongRange(max: Int? = undefined, min: Int? = undefined): ULongRange {
val o = js("({})")
o["max"] = max
o["min"] = min
return o as ULongRange
}
public external interface ConstrainULongRange : ULongRange {
var exact: Int?
get() = definedExternally
set(value) = definedExternally
var ideal: Int?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ConstrainULongRange(exact: Int? = undefined, ideal: Int? = undefined, max: Int? = undefined, min: Int? = undefined): ConstrainULongRange {
val o = js("({})")
o["exact"] = exact
o["ideal"] = ideal
o["max"] = max
o["min"] = min
return o as ConstrainULongRange
}
/**
* Exposes the JavaScript [ConstrainBooleanParameters](https://developer.mozilla.org/en/docs/Web/API/ConstrainBooleanParameters) to Kotlin
*/
public external interface ConstrainBooleanParameters {
var exact: Boolean?
get() = definedExternally
set(value) = definedExternally
var ideal: Boolean?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ConstrainBooleanParameters(exact: Boolean? = undefined, ideal: Boolean? = undefined): ConstrainBooleanParameters {
val o = js("({})")
o["exact"] = exact
o["ideal"] = ideal
return o as ConstrainBooleanParameters
}
/**
* Exposes the JavaScript [ConstrainDOMStringParameters](https://developer.mozilla.org/en/docs/Web/API/ConstrainDOMStringParameters) to Kotlin
*/
public external interface ConstrainDOMStringParameters {
var exact: Dynamic?
get() = definedExternally
set(value) = definedExternally
var ideal: Dynamic?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ConstrainDOMStringParameters(exact: Dynamic? = undefined, ideal: Dynamic? = undefined): ConstrainDOMStringParameters {
val o = js("({})")
o["exact"] = exact
o["ideal"] = ideal
return o as ConstrainDOMStringParameters
}
public external interface Capabilities
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun Capabilities(): Capabilities {
val o = js("({})")
return o as Capabilities
}
public external interface Settings
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun Settings(): Settings {
val o = js("({})")
return o as Settings
}
public external interface ConstraintSet
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ConstraintSet(): ConstraintSet {
val o = js("({})")
return o as ConstraintSet
}
public external interface Constraints : ConstraintSet {
var advanced: Array<ConstraintSet>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun Constraints(advanced: Array<ConstraintSet>? = undefined): Constraints {
val o = js("({})")
o["advanced"] = advanced
return o as Constraints
}
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaStreamTrackState {
companion object
}
public inline val MediaStreamTrackState.Companion.LIVE: MediaStreamTrackState get() = "live".asDynamic().unsafeCast<MediaStreamTrackState>()
public inline val MediaStreamTrackState.Companion.ENDED: MediaStreamTrackState get() = "ended".asDynamic().unsafeCast<MediaStreamTrackState>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface VideoFacingModeEnum {
companion object
}
public inline val VideoFacingModeEnum.Companion.USER: VideoFacingModeEnum get() = "user".asDynamic().unsafeCast<VideoFacingModeEnum>()
public inline val VideoFacingModeEnum.Companion.ENVIRONMENT: VideoFacingModeEnum get() = "environment".asDynamic().unsafeCast<VideoFacingModeEnum>()
public inline val VideoFacingModeEnum.Companion.LEFT: VideoFacingModeEnum get() = "left".asDynamic().unsafeCast<VideoFacingModeEnum>()
public inline val VideoFacingModeEnum.Companion.RIGHT: VideoFacingModeEnum get() = "right".asDynamic().unsafeCast<VideoFacingModeEnum>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface VideoResizeModeEnum {
companion object
}
public inline val VideoResizeModeEnum.Companion.NONE: VideoResizeModeEnum get() = "none".asDynamic().unsafeCast<VideoResizeModeEnum>()
public inline val VideoResizeModeEnum.Companion.CROP_AND_SCALE: VideoResizeModeEnum get() = "crop-and-scale".asDynamic().unsafeCast<VideoResizeModeEnum>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface MediaDeviceKind {
companion object
}
public inline val MediaDeviceKind.Companion.AUDIOINPUT: MediaDeviceKind get() = "audioinput".asDynamic().unsafeCast<MediaDeviceKind>()
public inline val MediaDeviceKind.Companion.AUDIOOUTPUT: MediaDeviceKind get() = "audiooutput".asDynamic().unsafeCast<MediaDeviceKind>()
public inline val MediaDeviceKind.Companion.VIDEOINPUT: MediaDeviceKind get() = "videoinput".asDynamic().unsafeCast<MediaDeviceKind>()
@@ -0,0 +1,107 @@
/*
* 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.
*/
// 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 {
open val sourceBuffers: SourceBufferList
open val activeSourceBuffers: SourceBufferList
open val readyState: ReadyState
var duration: Double
var onsourceopen: ((Event) -> Dynamic?)?
var onsourceended: ((Event) -> Dynamic?)?
var onsourceclose: ((Event) -> Dynamic?)?
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 {
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) -> Dynamic?)?
open var onupdate: ((Event) -> Dynamic?)?
open var onupdateend: ((Event) -> Dynamic?)?
open var onerror: ((Event) -> Dynamic?)?
open var onabort: ((Event) -> Dynamic?)?
fun appendBuffer(data: Dynamic?)
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 {
open val length: Int
open var onaddsourcebuffer: ((Event) -> Dynamic?)?
open var onremovesourcebuffer: ((Event) -> Dynamic?)?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun SourceBufferList.get(index: Int): SourceBuffer? = asDynamic().getAny(index)
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ReadyState {
companion object
}
public inline val ReadyState.Companion.CLOSED: ReadyState get() = "closed".asDynamic().unsafeCast<ReadyState>()
public inline val ReadyState.Companion.OPEN: ReadyState get() = "open".asDynamic().unsafeCast<ReadyState>()
public inline val ReadyState.Companion.ENDED: ReadyState get() = "ended".asDynamic().unsafeCast<ReadyState>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface EndOfStreamError {
companion object
}
public inline val EndOfStreamError.Companion.NETWORK: EndOfStreamError get() = "network".asDynamic().unsafeCast<EndOfStreamError>()
public inline val EndOfStreamError.Companion.DECODE: EndOfStreamError get() = "decode".asDynamic().unsafeCast<EndOfStreamError>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface AppendMode {
companion object
}
public inline val AppendMode.Companion.SEGMENTS: AppendMode get() = "segments".asDynamic().unsafeCast<AppendMode>()
public inline val AppendMode.Companion.SEQUENCE: AppendMode get() = "sequence".asDynamic().unsafeCast<AppendMode>()
@@ -0,0 +1,27 @@
/*
* 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.
*/
// 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 {
fun parseFromString(str: String, type: Dynamic?): Document
}
/**
* Exposes the JavaScript [XMLSerializer](https://developer.mozilla.org/en/docs/Web/API/XMLSerializer) to Kotlin
*/
public external open class XMLSerializer {
fun serializeToString(root: Node): String
}
@@ -0,0 +1,114 @@
/*
* 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.
*/
// 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 {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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 {
val o = js("({})")
o["pointerId"] = pointerId
o["width"] = width
o["height"] = height
o["pressure"] = pressure
o["tangentialPressure"] = tangentialPressure
o["tiltX"] = tiltX
o["tiltY"] = tiltY
o["twist"] = twist
o["pointerType"] = pointerType
o["isPrimary"] = isPrimary
o["screenX"] = screenX
o["screenY"] = screenY
o["clientX"] = clientX
o["clientY"] = clientY
o["button"] = button
o["buttons"] = buttons
o["relatedTarget"] = relatedTarget
o["region"] = region
o["ctrlKey"] = ctrlKey
o["shiftKey"] = shiftKey
o["altKey"] = altKey
o["metaKey"] = metaKey
o["modifierAltGraph"] = modifierAltGraph
o["modifierCapsLock"] = modifierCapsLock
o["modifierFn"] = modifierFn
o["modifierFnLock"] = modifierFnLock
o["modifierHyper"] = modifierHyper
o["modifierNumLock"] = modifierNumLock
o["modifierScrollLock"] = modifierScrollLock
o["modifierSuper"] = modifierSuper
o["modifierSymbol"] = modifierSymbol
o["modifierSymbolLock"] = modifierSymbolLock
o["view"] = view
o["detail"] = detail
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as PointerEventInit
}
/**
* 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 {
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
@@ -0,0 +1,53 @@
/*
* 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.
*/
// 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) {
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: Dynamic? = definedExternally) {
fun append(name: String, value: String)
fun delete(name: String)
fun get(name: String): String?
fun getAll(name: String): Array<String>
fun has(name: String): Boolean
fun set(name: String, value: String)
}
@@ -0,0 +1,309 @@
/*
* 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.
*/
// 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: Dynamic? = definedExternally) {
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 {
val bodyUsed: Boolean
fun arrayBuffer(): Promise<ArrayBuffer>
fun blob(): Promise<Blob>
fun formData(): Promise<FormData>
fun json(): Promise<Any?>
fun text(): Promise<String>
}
/**
* Exposes the JavaScript [Request](https://developer.mozilla.org/en/docs/Web/API/Request) to Kotlin
*/
public external open class Request(input: Dynamic?, init: RequestInit = definedExternally) : Body {
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: Dynamic?
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<Any?>
override fun text(): Promise<String>
}
public external interface RequestInit {
var method: String?
get() = definedExternally
set(value) = definedExternally
var headers: Dynamic?
get() = definedExternally
set(value) = definedExternally
var body: Dynamic?
get() = definedExternally
set(value) = definedExternally
var referrer: String?
get() = definedExternally
set(value) = definedExternally
var referrerPolicy: Dynamic?
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: Any?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun RequestInit(method: String? = undefined, headers: Dynamic? = undefined, body: Dynamic? = undefined, referrer: String? = undefined, referrerPolicy: Dynamic? = undefined, mode: RequestMode? = undefined, credentials: RequestCredentials? = undefined, cache: RequestCache? = undefined, redirect: RequestRedirect? = undefined, integrity: String? = undefined, keepalive: Boolean? = undefined, window: Any? = undefined): RequestInit {
val o = js("({})")
o["method"] = method
o["headers"] = headers
o["body"] = body
o["referrer"] = referrer
o["referrerPolicy"] = referrerPolicy
o["mode"] = mode
o["credentials"] = credentials
o["cache"] = cache
o["redirect"] = redirect
o["integrity"] = integrity
o["keepalive"] = keepalive
o["window"] = window
return o as RequestInit
}
/**
* Exposes the JavaScript [Response](https://developer.mozilla.org/en/docs/Web/API/Response) to Kotlin
*/
public external open class Response(body: Dynamic? = definedExternally, init: ResponseInit = definedExternally) : Body {
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: Dynamic?
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<Any?>
override fun text(): Promise<String>
companion object {
fun error(): Response
fun redirect(url: String, status: Short = definedExternally): Response
}
}
public external interface ResponseInit {
var status: Short? /* = 200 */
get() = definedExternally
set(value) = definedExternally
var statusText: String? /* = "OK" */
get() = definedExternally
set(value) = definedExternally
var headers: Dynamic?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ResponseInit(status: Short? = 200, statusText: String? = "OK", headers: Dynamic? = undefined): ResponseInit {
val o = js("({})")
o["status"] = status
o["statusText"] = statusText
o["headers"] = headers
return o as ResponseInit
}
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestType {
companion object
}
public inline val RequestType.Companion.EMPTY: RequestType get() = "".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.AUDIO: RequestType get() = "audio".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.FONT: RequestType get() = "font".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.IMAGE: RequestType get() = "image".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.SCRIPT: RequestType get() = "script".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.STYLE: RequestType get() = "style".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.TRACK: RequestType get() = "track".asDynamic().unsafeCast<RequestType>()
public inline val RequestType.Companion.VIDEO: RequestType get() = "video".asDynamic().unsafeCast<RequestType>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestDestination {
companion object
}
public inline val RequestDestination.Companion.EMPTY: RequestDestination get() = "".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.DOCUMENT: RequestDestination get() = "document".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.EMBED: RequestDestination get() = "embed".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.FONT: RequestDestination get() = "font".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.IMAGE: RequestDestination get() = "image".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.MANIFEST: RequestDestination get() = "manifest".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.MEDIA: RequestDestination get() = "media".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.OBJECT: RequestDestination get() = "object".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.REPORT: RequestDestination get() = "report".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.SCRIPT: RequestDestination get() = "script".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.SERVICEWORKER: RequestDestination get() = "serviceworker".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.SHAREDWORKER: RequestDestination get() = "sharedworker".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.STYLE: RequestDestination get() = "style".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.WORKER: RequestDestination get() = "worker".asDynamic().unsafeCast<RequestDestination>()
public inline val RequestDestination.Companion.XSLT: RequestDestination get() = "xslt".asDynamic().unsafeCast<RequestDestination>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestMode {
companion object
}
public inline val RequestMode.Companion.NAVIGATE: RequestMode get() = "navigate".asDynamic().unsafeCast<RequestMode>()
public inline val RequestMode.Companion.SAME_ORIGIN: RequestMode get() = "same-origin".asDynamic().unsafeCast<RequestMode>()
public inline val RequestMode.Companion.NO_CORS: RequestMode get() = "no-cors".asDynamic().unsafeCast<RequestMode>()
public inline val RequestMode.Companion.CORS: RequestMode get() = "cors".asDynamic().unsafeCast<RequestMode>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestCredentials {
companion object
}
public inline val RequestCredentials.Companion.OMIT: RequestCredentials get() = "omit".asDynamic().unsafeCast<RequestCredentials>()
public inline val RequestCredentials.Companion.SAME_ORIGIN: RequestCredentials get() = "same-origin".asDynamic().unsafeCast<RequestCredentials>()
public inline val RequestCredentials.Companion.INCLUDE: RequestCredentials get() = "include".asDynamic().unsafeCast<RequestCredentials>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestCache {
companion object
}
public inline val RequestCache.Companion.DEFAULT: RequestCache get() = "default".asDynamic().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.NO_STORE: RequestCache get() = "no-store".asDynamic().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.RELOAD: RequestCache get() = "reload".asDynamic().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.NO_CACHE: RequestCache get() = "no-cache".asDynamic().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.FORCE_CACHE: RequestCache get() = "force-cache".asDynamic().unsafeCast<RequestCache>()
public inline val RequestCache.Companion.ONLY_IF_CACHED: RequestCache get() = "only-if-cached".asDynamic().unsafeCast<RequestCache>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface RequestRedirect {
companion object
}
public inline val RequestRedirect.Companion.FOLLOW: RequestRedirect get() = "follow".asDynamic().unsafeCast<RequestRedirect>()
public inline val RequestRedirect.Companion.ERROR: RequestRedirect get() = "error".asDynamic().unsafeCast<RequestRedirect>()
public inline val RequestRedirect.Companion.MANUAL: RequestRedirect get() = "manual".asDynamic().unsafeCast<RequestRedirect>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ResponseType {
companion object
}
public inline val ResponseType.Companion.BASIC: ResponseType get() = "basic".asDynamic().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.CORS: ResponseType get() = "cors".asDynamic().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.DEFAULT: ResponseType get() = "default".asDynamic().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.ERROR: ResponseType get() = "error".asDynamic().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.OPAQUE: ResponseType get() = "opaque".asDynamic().unsafeCast<ResponseType>()
public inline val ResponseType.Companion.OPAQUEREDIRECT: ResponseType get() = "opaqueredirect".asDynamic().unsafeCast<ResponseType>()
@@ -0,0 +1,110 @@
/*
* 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.
*/
// 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: Array<Dynamic?> = definedExternally, options: BlobPropertyBag = definedExternally) : MediaProvider, ImageBitmapSource {
open val size: Number
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 {
var type: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun BlobPropertyBag(type: String? = ""): BlobPropertyBag {
val o = js("({})")
o["type"] = type
return o as BlobPropertyBag
}
/**
* Exposes the JavaScript [File](https://developer.mozilla.org/en/docs/Web/API/File) to Kotlin
*/
public external open class File(fileBits: Array<Dynamic?>, fileName: String, options: FilePropertyBag = definedExternally) : Blob {
open val name: String
open val lastModified: Int
}
public external interface FilePropertyBag : BlobPropertyBag {
var lastModified: Int?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun FilePropertyBag(lastModified: Int? = undefined, type: String? = ""): FilePropertyBag {
val o = js("({})")
o["lastModified"] = lastModified
o["type"] = type
return o as FilePropertyBag
}
/**
* Exposes the JavaScript [FileList](https://developer.mozilla.org/en/docs/Web/API/FileList) to Kotlin
*/
public external abstract class FileList : ItemArrayLike<File> {
override fun item(index: Int): File?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun FileList.get(index: Int): File? = asDynamic().getAny(index)
/**
* Exposes the JavaScript [FileReader](https://developer.mozilla.org/en/docs/Web/API/FileReader) to Kotlin
*/
public external open class FileReader : EventTarget {
open val readyState: Short
open val result: Dynamic?
open val error: Dynamic?
var onloadstart: ((ProgressEvent) -> Dynamic?)?
var onprogress: ((ProgressEvent) -> Dynamic?)?
var onload: ((Event) -> Dynamic?)?
var onabort: ((Event) -> Dynamic?)?
var onerror: ((Event) -> Dynamic?)?
var onloadend: ((Event) -> Dynamic?)?
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 {
fun readAsArrayBuffer(blob: Blob): ArrayBuffer
fun readAsBinaryString(blob: Blob): String
fun readAsText(blob: Blob, label: String = definedExternally): String
fun readAsDataURL(blob: Blob): String
}
@@ -0,0 +1,217 @@
/*
* 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.
*/
// 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 {
var onclick: ((MouseEvent) -> Dynamic?)?
var onerror: ((Event) -> Dynamic?)?
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: Array<out Int>
open val timestamp: Number
open val renotify: Boolean
open val silent: Boolean
open val noscreen: Boolean
open val requireInteraction: Boolean
open val sticky: Boolean
open val data: Any?
open val actions: Array<out NotificationAction>
fun close()
companion object {
val permission: NotificationPermission
val maxActions: Int
fun requestPermission(deprecatedCallback: (NotificationPermission) -> Unit = definedExternally): Promise<NotificationPermission>
}
}
public external interface NotificationOptions {
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: Dynamic?
get() = definedExternally
set(value) = definedExternally
var timestamp: Number?
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: Any? /* = null */
get() = definedExternally
set(value) = definedExternally
var actions: Array<NotificationAction>? /* = arrayOf() */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline 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: Dynamic? = undefined, timestamp: Number? = undefined, renotify: Boolean? = false, silent: Boolean? = false, noscreen: Boolean? = false, requireInteraction: Boolean? = false, sticky: Boolean? = false, data: Any? = null, actions: Array<NotificationAction>? = arrayOf()): NotificationOptions {
val o = js("({})")
o["dir"] = dir
o["lang"] = lang
o["body"] = body
o["tag"] = tag
o["image"] = image
o["icon"] = icon
o["badge"] = badge
o["sound"] = sound
o["vibrate"] = vibrate
o["timestamp"] = timestamp
o["renotify"] = renotify
o["silent"] = silent
o["noscreen"] = noscreen
o["requireInteraction"] = requireInteraction
o["sticky"] = sticky
o["data"] = data
o["actions"] = actions
return o as NotificationOptions
}
public external interface NotificationAction {
var action: String?
var title: String?
var icon: String?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun NotificationAction(action: String?, title: String?, icon: String? = undefined): NotificationAction {
val o = js("({})")
o["action"] = action
o["title"] = title
o["icon"] = icon
return o as NotificationAction
}
public external interface GetNotificationOptions {
var tag: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun GetNotificationOptions(tag: String? = ""): GetNotificationOptions {
val o = js("({})")
o["tag"] = tag
return o as GetNotificationOptions
}
/**
* 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 {
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 {
var notification: Notification?
var action: String? /* = "" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun NotificationEventInit(notification: Notification?, action: String? = "", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): NotificationEventInit {
val o = js("({})")
o["notification"] = notification
o["action"] = action
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as NotificationEventInit
}
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface NotificationPermission {
companion object
}
public inline val NotificationPermission.Companion.DEFAULT: NotificationPermission get() = "default".asDynamic().unsafeCast<NotificationPermission>()
public inline val NotificationPermission.Companion.DENIED: NotificationPermission get() = "denied".asDynamic().unsafeCast<NotificationPermission>()
public inline val NotificationPermission.Companion.GRANTED: NotificationPermission get() = "granted".asDynamic().unsafeCast<NotificationPermission>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface NotificationDirection {
companion object
}
public inline val NotificationDirection.Companion.AUTO: NotificationDirection get() = "auto".asDynamic().unsafeCast<NotificationDirection>()
public inline val NotificationDirection.Companion.LTR: NotificationDirection get() = "ltr".asDynamic().unsafeCast<NotificationDirection>()
public inline val NotificationDirection.Companion.RTL: NotificationDirection get() = "rtl".asDynamic().unsafeCast<NotificationDirection>()
@@ -0,0 +1,68 @@
/*
* 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.
*/
// 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 {
open val timing: PerformanceTiming
open val navigation: PerformanceNavigation
fun now(): Double
}
public external interface GlobalPerformance {
val performance: Performance
}
/**
* Exposes the JavaScript [PerformanceTiming](https://developer.mozilla.org/en/docs/Web/API/PerformanceTiming) to Kotlin
*/
public external abstract class PerformanceTiming {
open val navigationStart: Number
open val unloadEventStart: Number
open val unloadEventEnd: Number
open val redirectStart: Number
open val redirectEnd: Number
open val fetchStart: Number
open val domainLookupStart: Number
open val domainLookupEnd: Number
open val connectStart: Number
open val connectEnd: Number
open val secureConnectionStart: Number
open val requestStart: Number
open val responseStart: Number
open val responseEnd: Number
open val domLoading: Number
open val domInteractive: Number
open val domContentLoadedEventStart: Number
open val domContentLoadedEventEnd: Number
open val domComplete: Number
open val loadEventStart: Number
open val loadEventEnd: Number
}
/**
* Exposes the JavaScript [PerformanceNavigation](https://developer.mozilla.org/en/docs/Web/API/PerformanceNavigation) to Kotlin
*/
public external abstract class PerformanceNavigation {
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
}
}
@@ -0,0 +1,524 @@
/*
* 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.
*/
// 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 {
open val scriptURL: String
open val state: ServiceWorkerState
open var onstatechange: ((Event) -> Dynamic?)?
fun postMessage(message: Any?, transfer: Array<Dynamic?> = definedExternally)
}
/**
* Exposes the JavaScript [ServiceWorkerRegistration](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerRegistration) to Kotlin
*/
public external abstract class ServiceWorkerRegistration : EventTarget {
open val installing: ServiceWorker?
open val waiting: ServiceWorker?
open val active: ServiceWorker?
open val scope: String
open var onupdatefound: ((Event) -> Dynamic?)?
open val APISpace: Dynamic?
fun update(): Promise<Unit>
fun unregister(): Promise<Boolean>
fun showNotification(title: String, options: NotificationOptions = definedExternally): Promise<Unit>
fun getNotifications(filter: GetNotificationOptions = definedExternally): Promise<Array<Notification>>
fun methodName(): Promise<Dynamic?>
}
/**
* Exposes the JavaScript [ServiceWorkerContainer](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerContainer) to Kotlin
*/
public external abstract class ServiceWorkerContainer : EventTarget {
open val controller: ServiceWorker?
open val ready: Promise<ServiceWorkerRegistration>
open var oncontrollerchange: ((Event) -> Dynamic?)?
open var onmessage: ((MessageEvent) -> Dynamic?)?
fun register(scriptURL: String, options: RegistrationOptions = definedExternally): Promise<ServiceWorkerRegistration>
fun getRegistration(clientURL: String = definedExternally): Promise<Any?>
fun getRegistrations(): Promise<Array<ServiceWorkerRegistration>>
fun startMessages()
}
public external interface RegistrationOptions {
var scope: String?
get() = definedExternally
set(value) = definedExternally
var type: WorkerType? /* = WorkerType.CLASSIC */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun RegistrationOptions(scope: String? = undefined, type: WorkerType? = WorkerType.CLASSIC): RegistrationOptions {
val o = js("({})")
o["scope"] = scope
o["type"] = type
return o as RegistrationOptions
}
/**
* 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 {
open val data: Any?
open val origin: String
open val lastEventId: String
open val source: UnionMessagePortOrServiceWorker?
open val ports: Array<out MessagePort>?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ServiceWorkerMessageEventInit : EventInit {
var data: Any?
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: Array<MessagePort>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ServiceWorkerMessageEventInit(data: Any? = undefined, origin: String? = undefined, lastEventId: String? = undefined, source: UnionMessagePortOrServiceWorker? = undefined, ports: Array<MessagePort>? = undefined, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ServiceWorkerMessageEventInit {
val o = js("({})")
o["data"] = data
o["origin"] = origin
o["lastEventId"] = lastEventId
o["source"] = source
o["ports"] = ports
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as ServiceWorkerMessageEventInit
}
/**
* Exposes the JavaScript [ServiceWorkerGlobalScope](https://developer.mozilla.org/en/docs/Web/API/ServiceWorkerGlobalScope) to Kotlin
*/
public external abstract class ServiceWorkerGlobalScope : WorkerGlobalScope {
open val clients: Clients
open val registration: ServiceWorkerRegistration
open var oninstall: ((Event) -> Dynamic?)?
open var onactivate: ((Event) -> Dynamic?)?
open var onfetch: ((FetchEvent) -> Dynamic?)?
open var onforeignfetch: ((Event) -> Dynamic?)?
open var onmessage: ((MessageEvent) -> Dynamic?)?
open var onnotificationclick: ((NotificationEvent) -> Dynamic?)?
open var onnotificationclose: ((NotificationEvent) -> Dynamic?)?
open var onfunctionalevent: ((Event) -> Dynamic?)?
fun skipWaiting(): Promise<Unit>
}
/**
* Exposes the JavaScript [Client](https://developer.mozilla.org/en/docs/Web/API/Client) to Kotlin
*/
public external abstract class Client : UnionClientOrMessagePortOrServiceWorker {
open val url: String
open val frameType: FrameType
open val id: String
fun postMessage(message: Any?, transfer: Array<Dynamic?> = definedExternally)
}
/**
* Exposes the JavaScript [WindowClient](https://developer.mozilla.org/en/docs/Web/API/WindowClient) to Kotlin
*/
public external abstract class WindowClient : Client {
open val visibilityState: Dynamic?
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 {
fun get(id: String): Promise<Any?>
fun matchAll(options: ClientQueryOptions = definedExternally): Promise<Array<Client>>
fun openWindow(url: String): Promise<WindowClient?>
fun claim(): Promise<Unit>
}
public external interface ClientQueryOptions {
var includeUncontrolled: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var type: ClientType? /* = ClientType.WINDOW */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ClientQueryOptions(includeUncontrolled: Boolean? = false, type: ClientType? = ClientType.WINDOW): ClientQueryOptions {
val o = js("({})")
o["includeUncontrolled"] = includeUncontrolled
o["type"] = type
return o as ClientQueryOptions
}
/**
* 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 {
fun waitUntil(f: Promise<Any?>)
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ExtendableEventInit : EventInit
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ExtendableEventInit(bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ExtendableEventInit {
val o = js("({})")
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as ExtendableEventInit
}
/**
* 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 {
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 {
var scopes: Array<String>?
var origins: Array<String>?
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ForeignFetchOptions(scopes: Array<String>?, origins: Array<String>?): ForeignFetchOptions {
val o = js("({})")
o["scopes"] = scopes
o["origins"] = origins
return o as ForeignFetchOptions
}
/**
* 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 {
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 {
var request: Request?
var clientId: String? /* = null */
get() = definedExternally
set(value) = definedExternally
var isReload: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun FetchEventInit(request: Request?, clientId: String? = null, isReload: Boolean? = false, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): FetchEventInit {
val o = js("({})")
o["request"] = request
o["clientId"] = clientId
o["isReload"] = isReload
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as FetchEventInit
}
public external open class ForeignFetchEvent(type: String, eventInitDict: ForeignFetchEventInit) : ExtendableEvent {
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 {
var request: Request?
var origin: String? /* = "null" */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ForeignFetchEventInit(request: Request?, origin: String? = "null", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ForeignFetchEventInit {
val o = js("({})")
o["request"] = request
o["origin"] = origin
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as ForeignFetchEventInit
}
public external interface ForeignFetchResponse {
var response: Response?
var origin: String?
get() = definedExternally
set(value) = definedExternally
var headers: Array<String>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ForeignFetchResponse(response: Response?, origin: String? = undefined, headers: Array<String>? = undefined): ForeignFetchResponse {
val o = js("({})")
o["response"] = response
o["origin"] = origin
o["headers"] = headers
return o as ForeignFetchResponse
}
/**
* 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 {
open val data: Any?
open val origin: String
open val lastEventId: String
open val source: UnionClientOrMessagePortOrServiceWorker?
open val ports: Array<out MessagePort>?
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ExtendableMessageEventInit : ExtendableEventInit {
var data: Any?
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: Array<MessagePort>?
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ExtendableMessageEventInit(data: Any? = undefined, origin: String? = undefined, lastEventId: String? = undefined, source: UnionClientOrMessagePortOrServiceWorker? = undefined, ports: Array<MessagePort>? = undefined, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ExtendableMessageEventInit {
val o = js("({})")
o["data"] = data
o["origin"] = origin
o["lastEventId"] = lastEventId
o["source"] = source
o["ports"] = ports
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as ExtendableMessageEventInit
}
/**
* Exposes the JavaScript [Cache](https://developer.mozilla.org/en/docs/Web/API/Cache) to Kotlin
*/
public external abstract class Cache {
fun match(request: Dynamic?, options: CacheQueryOptions = definedExternally): Promise<Any?>
fun matchAll(request: Dynamic? = definedExternally, options: CacheQueryOptions = definedExternally): Promise<Array<Response>>
fun add(request: Dynamic?): Promise<Unit>
fun addAll(requests: Array<Dynamic?>): Promise<Unit>
fun put(request: Dynamic?, response: Response): Promise<Unit>
fun delete(request: Dynamic?, options: CacheQueryOptions = definedExternally): Promise<Boolean>
fun keys(request: Dynamic? = definedExternally, options: CacheQueryOptions = definedExternally): Promise<Array<Request>>
}
public external interface CacheQueryOptions {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun CacheQueryOptions(ignoreSearch: Boolean? = false, ignoreMethod: Boolean? = false, ignoreVary: Boolean? = false, cacheName: String? = undefined): CacheQueryOptions {
val o = js("({})")
o["ignoreSearch"] = ignoreSearch
o["ignoreMethod"] = ignoreMethod
o["ignoreVary"] = ignoreVary
o["cacheName"] = cacheName
return o as CacheQueryOptions
}
public external interface CacheBatchOperation {
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("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun CacheBatchOperation(type: String? = undefined, request: Request? = undefined, response: Response? = undefined, options: CacheQueryOptions? = undefined): CacheBatchOperation {
val o = js("({})")
o["type"] = type
o["request"] = request
o["response"] = response
o["options"] = options
return o as CacheBatchOperation
}
/**
* Exposes the JavaScript [CacheStorage](https://developer.mozilla.org/en/docs/Web/API/CacheStorage) to Kotlin
*/
public external abstract class CacheStorage {
fun match(request: Dynamic?, options: CacheQueryOptions = definedExternally): Promise<Any?>
fun has(cacheName: String): Promise<Boolean>
fun open(cacheName: String): Promise<Cache>
fun delete(cacheName: String): Promise<Boolean>
fun keys(): Promise<Array<String>>
}
public external open class FunctionalEvent : ExtendableEvent {
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 {
companion object
}
public inline val ServiceWorkerState.Companion.INSTALLING: ServiceWorkerState get() = "installing".asDynamic().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.INSTALLED: ServiceWorkerState get() = "installed".asDynamic().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.ACTIVATING: ServiceWorkerState get() = "activating".asDynamic().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.ACTIVATED: ServiceWorkerState get() = "activated".asDynamic().unsafeCast<ServiceWorkerState>()
public inline val ServiceWorkerState.Companion.REDUNDANT: ServiceWorkerState get() = "redundant".asDynamic().unsafeCast<ServiceWorkerState>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface FrameType {
companion object
}
public inline val FrameType.Companion.AUXILIARY: FrameType get() = "auxiliary".asDynamic().unsafeCast<FrameType>()
public inline val FrameType.Companion.TOP_LEVEL: FrameType get() = "top-level".asDynamic().unsafeCast<FrameType>()
public inline val FrameType.Companion.NESTED: FrameType get() = "nested".asDynamic().unsafeCast<FrameType>()
public inline val FrameType.Companion.NONE: FrameType get() = "none".asDynamic().unsafeCast<FrameType>()
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface ClientType {
companion object
}
public inline val ClientType.Companion.WINDOW: ClientType get() = "window".asDynamic().unsafeCast<ClientType>()
public inline val ClientType.Companion.WORKER: ClientType get() = "worker".asDynamic().unsafeCast<ClientType>()
public inline val ClientType.Companion.SHAREDWORKER: ClientType get() = "sharedworker".asDynamic().unsafeCast<ClientType>()
public inline val ClientType.Companion.ALL: ClientType get() = "all".asDynamic().unsafeCast<ClientType>()
@@ -0,0 +1,138 @@
/*
* 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.
*/
// 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.files.*
/**
* Exposes the JavaScript [XMLHttpRequestEventTarget](https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequestEventTarget) to Kotlin
*/
public external abstract class XMLHttpRequestEventTarget : EventTarget {
open var onloadstart: ((ProgressEvent) -> Dynamic?)?
open var onprogress: ((ProgressEvent) -> Dynamic?)?
open var onabort: ((Event) -> Dynamic?)?
open var onerror: ((Event) -> Dynamic?)?
open var onload: ((Event) -> Dynamic?)?
open var ontimeout: ((Event) -> Dynamic?)?
open var onloadend: ((Event) -> Dynamic?)?
}
public external abstract class XMLHttpRequestUpload : XMLHttpRequestEventTarget
/**
* Exposes the JavaScript [XMLHttpRequest](https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest) to Kotlin
*/
public external open class XMLHttpRequest : XMLHttpRequestEventTarget {
var onreadystatechange: ((Event) -> Dynamic?)?
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: Any?
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: Dynamic? = definedExternally)
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) {
fun append(name: String, value: String)
fun append(name: String, value: Blob, filename: String = definedExternally)
fun delete(name: String)
fun get(name: String): Dynamic?
fun getAll(name: String): Array<Dynamic?>
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 {
open val lengthComputable: Boolean
open val loaded: Number
open val total: Number
companion object {
val NONE: Short
val CAPTURING_PHASE: Short
val AT_TARGET: Short
val BUBBLING_PHASE: Short
}
}
public external interface ProgressEventInit : EventInit {
var lengthComputable: Boolean? /* = false */
get() = definedExternally
set(value) = definedExternally
var loaded: Number? /* = 0 */
get() = definedExternally
set(value) = definedExternally
var total: Number? /* = 0 */
get() = definedExternally
set(value) = definedExternally
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline fun ProgressEventInit(lengthComputable: Boolean? = false, loaded: Number? = 0, total: Number? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ProgressEventInit {
val o = js("({})")
o["lengthComputable"] = lengthComputable
o["loaded"] = loaded
o["total"] = total
o["bubbles"] = bubbles
o["cancelable"] = cancelable
o["composed"] = composed
return o as ProgressEventInit
}
/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface XMLHttpRequestResponseType {
companion object
}
public inline val XMLHttpRequestResponseType.Companion.EMPTY: XMLHttpRequestResponseType get() = "".asDynamic().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.ARRAYBUFFER: XMLHttpRequestResponseType get() = "arraybuffer".asDynamic().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.BLOB: XMLHttpRequestResponseType get() = "blob".asDynamic().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.DOCUMENT: XMLHttpRequestResponseType get() = "document".asDynamic().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.JSON: XMLHttpRequestResponseType get() = "json".asDynamic().unsafeCast<XMLHttpRequestResponseType>()
public inline val XMLHttpRequestResponseType.Companion.TEXT: XMLHttpRequestResponseType get() = "text".asDynamic().unsafeCast<XMLHttpRequestResponseType>()