Package kotlin.js
Functions and other APIs specific to the JavaScript platform.
Types
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
Represents the constructor of a class. Instances of JsClass
can be passed to JavaScript APIs that expect a constructor reference.
interface JsClass<T : Any>
Platform and version requirements: JS (1.1)
An interface for indexing access to a collection of key-value pairs, where type of key is String and type of value is Any?.
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
Exposes the JavaScript Promise object to Kotlin.
open class Promise<out T>
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
Annotations
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
Marks experimental JS export annotations.
annotation class ExperimentalJsExport
Platform and version requirements: JS (1.3)
Exports top-level declaration on JS platform.
annotation class JsExport
Platform and version requirements: JS (1.1)
Denotes an external
declaration that must be imported from native JavaScript library.
annotation class JsModule
Platform and version requirements: JS (1.0)
Gives a declaration (a function, a property or a class) specific name in JavaScript.
Platform and version requirements: JS (1.1)
Denotes an external
declaration that can be used without module system.
annotation class JsNonModule
Platform and version requirements: JS (1.1)
Adds prefix to external
declarations in a source file.
annotation class JsQualifier
Platform and version requirements: JS (1.1)
annotation class nativeGetter
Platform and version requirements: JS (1.1)
annotation class nativeInvoke
Platform and version requirements: JS (1.1)
annotation class nativeSetter
Properties
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
The property that can be used as a placeholder for statements and values that are defined in JavaScript.
val definedExternally: Nothing
Platform and version requirements: JS (1.1)
Obtains a constructor reference for the given KClass
.
val <T : Any> KClass<T>.js: JsClass<T>
Platform and version requirements: JS (1.1)
Obtains a KClass
instance for the given constructor reference.
val <T : Any> JsClass<T>.kotlin: KClass<T>
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
Functions
Platform and version requirements: JS (1.1)
Adds key-value pairs from other to this. Returns the original receiver.
fun Json.add(other: Json): Json
Platform and version requirements: JS (1.1)
Converts the result of RegExp.exec to an array where the first element contains the entire matched text and each subsequent element is the text matched by each capturing parenthesis.
fun RegExpMatch.asArray(): Array<out String?>
Platform and version requirements: JS (1.1)
Reinterprets this value as a value of the dynamic type.
fun Any?.asDynamic(): dynamic
Platform and version requirements: JS (1.1)
fun dateLocaleOptions(
init: LocaleOptions.() -> Unit
): LocaleOptions
Platform and version requirements: JS (1.1)
Exposes the JavaScript eval function to Kotlin.
fun eval(expr: String): dynamic
Platform and version requirements: JS (1.1)
Returns the entire text matched by RegExp.exec if the index parameter is 0, or the text matched by the capturing parenthesis at the given index.
operator fun RegExpMatch.get(index: Int): String?
Platform and version requirements: JS (1.1)
Allows to iterate this dynamic
object in the following cases:
operator fun dynamic.iterator(): Iterator<dynamic>
Platform and version requirements: JS (1.1)
fun js(code: String): dynamic
Platform and version requirements: JS (1.1)
Returns a simple JavaScript object (as Json) using provided key-value pairs as names and values of its properties.
fun json(vararg pairs: Pair<String, Any?>): Json
Platform and version requirements: JS (1.1)
Function corresponding to JavaScript's typeof
operator
fun jsTypeOf(a: Any?): String
Platform and version requirements: JS (1.1)
Returns the greater of two values.
fun Math.max(a: Long, b: Long): Long
Platform and version requirements: JS (1.1)
Returns the smaller of two values.
fun Math.min(a: Long, b: Long): Long
Platform and version requirements: JS (1.1)
fun parseFloat(
s: String,
radix: Int = definedExternally
): Double
Platform and version requirements: JS (1.1)
fun parseInt(s: String): Int
fun parseInt(s: String, radix: Int = definedExternally): Int
Platform and version requirements: JS (1.1)
Resets the regular expression so that subsequent RegExp.test and RegExp.exec calls will match starting with the beginning of the input string.
Platform and version requirements: JS (1.1)
fun <T, S> Promise<Promise<T>>.then(
onFulfilled: ((T) -> S)?
): Promise<S>
fun <T, S> Promise<Promise<T>>.then(
onFulfilled: ((T) -> S)?,
onRejected: ((Throwable) -> S)?
): Promise<S>
Platform and version requirements: JS (1.1)
Reinterprets this value as a value of the specified type T without any actual type checking.
fun <T> Any?.unsafeCast(): T
Reinterprets this dynamic
value as a value of the specified type T without any actual type checking.
fun <T> dynamic.unsafeCast(): T