package scalajs
- Alphabetic
- Public
- All
Types, methods and values for interoperability with JavaScript libraries.
Types, methods and values for interoperability with JavaScript libraries.
This package is only relevant to the Scala.js compiler, and should not be referenced by any project compiled to the JVM.
General documentation on Scala.js is available at http://www.scala-js.org/doc/.
The trait js.Any is the root of the hierarchy of JavaScript types. This package defines important subtypes of js.Any that are defined in the standard library of ECMAScript 5.1 (or ES 6, with a label in the documentation), such as js.Object, js.Array and js.RegExp.
Implicit conversions to and from standard Scala types to their equivalent in JavaScript are provided. For example, from Scala functions to JavaScript functions and back.
The most important subtypes of js.Any declared in this package are:
this
as an explicit parameterThe trait js.Dynamic is a special subtrait of js.Any. It can represent any JavaScript value in a dynamically-typed way. It is possible to call any method and read and write any field of a value of type js.Dynamic.
There are no explicit definitions for JavaScript primitive types, as one could expect, because the corresponding Scala types stand in their stead:
null
)Null
is the type of the JavaScript null value js.UndefOr gives a scala.Option-like interface where the
JavaScript value undefined
takes the role of None
.
A | B is an unboxed pseudo-union type, suitable to type values that admit several unrelated types in facade types.