diff options
Diffstat (limited to 'library/src/main/scala/scala/scalajs/js/annotation')
9 files changed, 178 insertions, 0 deletions
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala new file mode 100644 index 0000000..596e327 --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala @@ -0,0 +1,17 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Marks the annotated method as representing bracket access in JavaScript. + * + * @see [[http://www.scala-js.org/doc/calling-javascript.html Calling JavaScript from Scala.js]] + */ +class JSBracketAccess extends scala.annotation.StaticAnnotation diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala new file mode 100644 index 0000000..0fa9a4e --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala @@ -0,0 +1,19 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Specifies that the given entity should be exported for use in raw JS. + * + * @see [[http://www.scala-js.org/doc/export-to-javascript.html Export Scala.js APIs to JavaScript]] + */ +class JSExport extends scala.annotation.StaticAnnotation { + def this(name: String) = this() +} diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala new file mode 100644 index 0000000..8174595 --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala @@ -0,0 +1,21 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Exports all public members directly defined in a class / object. + * + * Strictly equivalent to putting [[JSExport]] on every public member. + * Note: You are allowed to export protected members, but you'll have to do + * this explicitly on each member. + * + * @see [[http://www.scala-js.org/doc/export-to-javascript.html Export Scala.js APIs to JavaScript]] + */ +class JSExportAll extends scala.annotation.StaticAnnotation diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala new file mode 100644 index 0000000..9f2be96 --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala @@ -0,0 +1,20 @@ +/* __ *\ +** ________ ___ / / ___ __ ____ Scala.js API ** +** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | |__/ /____/ ** +** |/____/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Specifies that all the concrete classes extending the annotated class or + * should have all their public constructors exported for use in raw JS. + * The constructors exported this way are exported under their fully + * qualified name. + * + * @see [[http://www.scala-js.org/doc/export-to-javascript.html Export Scala.js APIs to JavaScript]] + */ +class JSExportDescendentClasses extends scala.annotation.StaticAnnotation diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala new file mode 100644 index 0000000..c196b53 --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala @@ -0,0 +1,20 @@ +/* __ *\ +** ________ ___ / / ___ __ ____ Scala.js API ** +** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | |__/ /____/ ** +** |/____/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Specifies that all the objects extending the annotated class or trait + * should be exported for use in raw JS. + * Note that objects exported this way are exported under their fully + * qualified name. + * + * @see [[http://www.scala-js.org/doc/export-to-javascript.html Export Scala.js APIs to JavaScript]] + */ +class JSExportDescendentObjects extends scala.annotation.StaticAnnotation diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala new file mode 100644 index 0000000..718404a --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala @@ -0,0 +1,38 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Exports the given method to JavaScript with named parameters. + * + * It can then be called like this: + * {{{ + * obj.foo({ + * param1: value1 + * param2: value2 + * param7: value3 + * }); + * }}} + * + * Note that named exports don't support overloading. Therefore the + * following will fail: + * {{{ + * class A { + * @JSExportNamed + * def a(foo: Int) = foo + 1 + * @JSExportNamed + * def a(bar: String) = "Hello " + bar + * } + * }}} + * @see [[http://www.scala-js.org/doc/export-to-javascript.html Export Scala.js APIs to JavaScript]] + */ +class JSExportNamed extends scala.annotation.StaticAnnotation { + def this(name: String) = this() +} diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala b/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala new file mode 100644 index 0000000..5401749 --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala @@ -0,0 +1,17 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Specifies the JavaScript name of an entity. + * + * @see [[http://www.scala-js.org/doc/calling-javascript.html Calling JavaScript from Scala.js]] + */ +class JSName(name: String) extends scala.annotation.StaticAnnotation diff --git a/library/src/main/scala/scala/scalajs/js/annotation/README.md b/library/src/main/scala/scala/scalajs/js/annotation/README.md new file mode 100644 index 0000000..9ce7ebf --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/README.md @@ -0,0 +1,3 @@ +**Attention**: Some files in here are also published in the Scala.js stubs JVM library (see the stubs project in the Scala.js build). + +If you add (or rename) a file, make sure the files in the stubs project are up to date. diff --git a/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala b/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala new file mode 100644 index 0000000..a5bb771 --- /dev/null +++ b/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala @@ -0,0 +1,23 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala.scalajs.js.annotation + +/** Marks the annotated class, trait or object as a raw JavaScript type. + * + * This annotation is added automatically by the compiler to all classes, + * traits and objects inheriting directly or indirectly from + * [[scala.scalajs.js.Any]]. It marks the annotated entity as being a raw + * JavaScript type, i.e., one that represents type information for an entity + * defined in JavaScript code. + * + * Do not use this annotation yourself. + */ +class RawJSType extends scala.annotation.StaticAnnotation |