• package root
    Definition Classes
  • package scala
    Definition Classes
  • package scalajs
    Definition Classes
  • package concurrent
    Definition Classes
  • package js

    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


    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:

    The 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:

    • Boolean is the type of primitive JavaScript booleans
    • Double is the type of primitive JavaScript numbers
    • String is the type of primitive JavaScript strings (or null)
    • Unit is the type of the JavaScript undefined value
    • 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.

    Definition Classes
  • package reflect
    Definition Classes
  • package annotation
  • InstantiatableClass
  • InvokableConstructor
  • LoadableModuleClass
  • Reflect



package reflect

  1. Alphabetic
  1. Public
  2. All

Type Members

  1. final class InstantiatableClass extends AnyRef
  2. final class InvokableConstructor extends AnyRef
  3. final class LoadableModuleClass extends AnyRef

Value Members

  1. object Reflect