kotlin.js
Package kotlin.js
Platform and version requirements: JS
Functions and other APIs specific to the JavaScript platform-
Types
external interface Console Exposes the console API to Kotlin. | |
external class Date Exposes the Date API to Kotlin. | |
external object JSON Exposes the JavaScript JSON object to Kotlin. | |
external interface JsClass<T : Any> Represents the constructor of a class. Instances of | |
external interface Json An interface for indexing access to a collection of key-value pairs, where type of key is String and type of value is Any?. | |
external object Math Exposes the JavaScript Math object to Kotlin. | |
open external class Promise<out T> Exposes the JavaScript Promise object to Kotlin. | |
external class RegExp Exposes the JavaScript RegExp object to Kotlin. | |
external interface RegExpMatch Represents the return value of RegExp.exec. |
Annotations
annotation class JsModule Denotes an | |
annotation class JsName Gives a declaration (a function, a property or a class) specific name in JavaScript. | |
annotation class JsNonModule Denotes an | |
annotation class JsQualifier Adds prefix to |
Properties
external val console: Console Exposes the console API to Kotlin. | |
external val definedExternally: Nothing The property that can be used as a placeholder for statements and values that are defined in JavaScript. | |
val <T : Any> KClass<T>.js: JsClass<T> Obtains a constructor reference for the given | |
val <T : Any> JsClass<T>.kotlin: KClass<T> Obtains a | |
external val undefined: Nothing? Exposes the JavaScript undefined property to Kotlin. |
Functions
fun Json.add(other: Json): Json Adds key-value pairs from other to this. Returns the original receiver. | |
fun RegExpMatch.asArray(): Array<out String?> 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 Any?.asDynamic(): dynamic Reinterprets this value as a value of the dynamic type. | |
external fun eval(expr: String): dynamic Exposes the JavaScript eval function to Kotlin. | |
operator fun RegExpMatch.get(index: Int): String? 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 dynamic.iterator(): Iterator<dynamic> Allows to iterate this | |
external fun js(code: String): dynamic Puts the given piece of a JavaScript code right into the calling function. The compiler replaces call to | |
fun jsTypeOf(a: Any?): String Function corresponding to JavaScript's | |
fun json(vararg pairs: Pair<String, Any?>): Json Returns a simple JavaScript object (as Json) using provided key-value pairs as names and values of its properties. | |
fun Math.max(a: Long, b: Long): Long Returns the greater of two values. | |
fun Math.min(a: Long, b: Long): Long Returns the smaller of two values. | |
fun RegExp.reset() Resets the regular expression so that subsequent RegExp.test and RegExp.exec calls will match starting with the beginning of the input string. | |
fun <T> Any?.unsafeCast(): T Reinterprets this value as a value of the specified type T without any actual type checking. |
© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/