Packages

  • package root
    Definition Classes
    root
  • package scala
    Definition Classes
    root
  • package scalajs
    Definition Classes
    scala
  • 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.

    Guide

    General documentation on Scala.js is available at http://www.scala-js.org/doc/.

    Overview

    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
    scalajs
  • package annotation
    Definition Classes
    js
  • package internal
    Definition Classes
    annotation
  • HasJSNativeLoadSpec
  • JSOptional

package internal

Type Members

  1. class HasJSNativeLoadSpec extends Annotation with StaticAnnotation

    IMPLEMENTATION DETAIL: Marks this JS native module class as having stored a loading spec in its IR.

    IMPLEMENTATION DETAIL: Marks this JS native module class as having stored a loading spec in its IR.

    This is true iff the module class was compiled with Scala.js 0.6.13 or later.

    Do not use this annotation yourself.

  2. class JSOptional extends Annotation with StaticAnnotation

    IMPLEMENTATION DETAIL: Marks concrete members of Scala.js-defined JS traits, so that they can be identified by the back-end not to emit them.

    IMPLEMENTATION DETAIL: Marks concrete members of Scala.js-defined JS traits, so that they can be identified by the back-end not to emit them.

    Internally, such members are known as "optional", in reference to their primary intended use case: optional fields in configuration objects.

    Do not use this annotation yourself.

    Annotations
    @field() @getter() @setter()

Ungrouped