package smacrotools
- Alphabetic
- Public
- All
Type Members
- abstract class BlackboxMacroTools extends CommonMacroTools
- abstract class CommonMacroTools extends AnyRef
-
macro
class
JSOptionsObject
extends Annotation with StaticAnnotation
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( ... )
@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
Example: -
macro
class
JSRef
extends Annotation with StaticAnnotation
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( ... )
- trait JsBlackboxMacroTools extends BlackboxMacroTools with JsCommonMacroTools
- trait JsCommonMacroTools extends CommonMacroTools
- trait JsWhiteboxMacroTools extends WhiteboxMacroTools with JsCommonMacroTools
- abstract class MacroAnnotationHandlerNew extends WhiteboxMacroTools
- abstract class WhiteboxMacroTools extends CommonMacroTools
-
class
debug
extends Annotation with StaticAnnotation
Enables debugging of an annotated angulate2 class during macro expansion and/or at runtime.
-
abstract
class
MacroAnnotationHandler
extends WhiteboxMacroTools
- Annotations
- @deprecated
- Deprecated
(Since version 0.0.4) Use MacroAnnotationHandlerNew instead