Package

de.surfice

smacrotools

Permalink

package smacrotools

Visibility
  1. Public
  2. All

Type Members

  1. abstract class BlackboxMacroTools extends CommonMacroTools

    Permalink
  2. abstract class CommonMacroTools extends AnyRef

    Permalink
  3. macro class JSOptionsObject extends Annotation with StaticAnnotation

    Permalink

    This macro annotation transforms a case class into a trait extending js.Object and a companion object with an apply() method.

    This macro annotation transforms a case class into a trait extending js.Object and a companion object with an apply() method. This allows easy definition of JavaScript "confguration" objects, where some options are required, but ohters are optional.

    Annotations
    @compileTimeOnly( ... ) @compileTimeOnly( ... )
    Example:
    1. @JSOptionsObject
      case class FooOptions(var foo: Int, @JSName("notify") update: Boolean = false, bar: js.UndefOr[String] = js.undefined)

      is transformed into

      @js.native
      trait FooOptions extends js.Object {
        var x: Int = js.native
        @JSName("notify")
        val update: Boolean = js.native
        val y: js.UndefOr[String] = js.native
      }
      object FooOptions {
        def apply(foo: Int, update: Boolean = false, bar: js.UndefOr[String] = js.undefined): FooOptions =
          val __o = js.Dynamic.literal(x = x, notify = update).asInstanceOf[js.Dictionary[js.Any]]
          if(bar.isDefined) __o.update("bar",bar)
          __o.asInstanceOf[FooOptions]
      }
    Note

    Arguments of type scalajs.js.UndefOr will only be defined on the returned object, iff their value is != js.undefined

  4. macro class JSRef extends Annotation with StaticAnnotation

    Permalink

    This annotation will expand into either @JSName or @JSImport at compile time.

    This annotation will expand into either @JSName or @JSImport at compile time.

    Annotations
    @compileTimeOnly( ... ) @compileTimeOnly( ... )
  5. trait JsBlackboxMacroTools extends BlackboxMacroTools with JsCommonMacroTools

    Permalink
  6. trait JsCommonMacroTools extends CommonMacroTools

    Permalink
  7. trait JsWhiteboxMacroTools extends WhiteboxMacroTools with JsCommonMacroTools

    Permalink
  8. abstract class MacroAnnotationHandlerNew extends WhiteboxMacroTools

    Permalink
  9. abstract class WhiteboxMacroTools extends CommonMacroTools

    Permalink
  10. macro class createJS extends Annotation with StaticAnnotation

    Permalink

    Creates a @ScalaJSDefined version of the annotated class or trait on the companion object.

    Creates a @ScalaJSDefined version of the annotated class or trait on the companion object.

    Annotations
    @compileTimeOnly( ... ) @compileTimeOnly( ... )
    Example:
    1. @createJS
      trait Foo {
        def bar: String
      }

      will expand to

      trait Foo {
        def bar: String
      }
      object Foo {
        @js.native
        @ScalaJSDefined
        trait JS extends js.Object {
          def bar: String
        }
      }
  11. class debug extends Annotation with StaticAnnotation

    Permalink

    Enables debugging of an annotated angulate2 class during macro expansion and/or at runtime.

  12. abstract class MacroAnnotationHandler extends WhiteboxMacroTools

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.0.4) Use MacroAnnotationHandlerNew instead

Value Members

  1. object JSOptionsObject

    Permalink
  2. object JSRef

    Permalink
  3. object createJS

    Permalink
  4. object debug

    Permalink

Ungrouped