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. abstract class JsBlackboxMacroTools extends BlackboxMacroTools with JsCommonMacroTools

    Permalink
  5. trait JsCommonMacroTools extends CommonMacroTools

    Permalink
  6. abstract class JsWhiteboxMacroTools extends WhiteboxMacroTools with JsCommonMacroTools

    Permalink
  7. abstract class WhiteboxMacroTools extends CommonMacroTools

    Permalink
  8. class debug extends Annotation with StaticAnnotation

    Permalink

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

Value Members

  1. object JSOptionsObject

    Permalink
  2. object debug

    Permalink

Ungrouped