JsSymbol

expect annotation class JsSymbol(val name: String)(source)

Declare access to a declaration by a well-known Symbol in JavaScript.

See additional information about well-known Symbols

Since Kotlin

2.3
actual annotation class JsSymbol(val name: String)(source)

Declare access to a declaration (right now, only functions are supported) by a well-known Symbol in JavaScript.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#well-known_symbols

This is especially useful for interop to implement different JS conventions to override JS iterability, auto-closing behavior, casting to primitives, etc

Since Kotlin

2.3

Properties

Link copied to clipboard
expect val name: String
Since Kotlin 2.3
actual val name: String

the name of a well-known symbol by which the declaration would be accessible. It's required the symbol to be presented under the name inside the Symbol static scope.

Since Kotlin 2.3