import {CONST} from "facade/lang";

/**
 * A parameter annotation that creates a synchronous eager dependency.
 *
 *    class AComponent {
 *      constructor(@Inject('aServiceToken') aService) {}
 *    }
 *
 */
export class Inject {
  token;
  @CONST()
  constructor(token) {
    this.token = token;
  }
}

/**
 * A parameter annotation that creates an asynchronous eager dependency.
 *
 *    class AComponent {
 *      constructor(@InjectPromise('aServiceToken') aServicePromise) {
 *        aServicePromise.then(aService => ...);
 *      }
 *    }
 *
 */
export class InjectPromise {
  token;
  @CONST()
  constructor(token) {
    this.token = token;
  }
}

/**
 * A parameter annotation that creates a synchronous lazy dependency.
 *
 *    class AComponent {
 *      constructor(@InjectLazy('aServiceToken') aServiceFn) {
 *        aService = aServiceFn();
 *      }
 *    }
 *
 */
export class InjectLazy {
  token;
  @CONST()
  constructor(token) {
    this.token = token;
  }
}

/**
 * `DependencyAnnotation` is used by the framework to extend DI.
 *
 * Only annotations implementing `DependencyAnnotation` will be added
 * to the list of dependency properties.
 *
 * For example:
 *
 *    class Parent extends DependencyAnnotation {}
 *    class NotDependencyProperty {}
 *
 *    class AComponent {
 *      constructor(@Parent @NotDependencyProperty aService:AService) {}
 *    }
 *
 * will create the following dependency:
 *
 *    new Dependency(Key.get(AService), [new Parent()])
 *
 * The framework can use `new Parent()` to handle the `aService` dependency
 * in a specific way.
 *
 */
export class DependencyAnnotation {
  @CONST()
  constructor() {
  }
}
@@ -102,34 +102,38 @@
 pendency.%0A *%0A * 
-  
+%60%60%60%0A *
  class AComponen
@@ -130,35 +130,32 @@
  AComponent %7B%0A *
-   
    constructor(@
@@ -190,28 +190,32 @@
 vice) %7B%7D%0A * 
-   %7D
+%7D%0A * %60%60%60
 %0A *%0A */%0Aexpo
@@ -381,34 +381,38 @@
 pendency.%0A *%0A * 
-  
+%60%60%60%0A *
  class AComponen
@@ -409,35 +409,32 @@
  AComponent %7B%0A *
-   
    constructor(@
@@ -481,27 +481,24 @@
 romise) %7B%0A *
-   
      aServic
@@ -530,36 +530,37 @@
  ...);%0A *   
-  
+%7D%0A *
  %7D%0A * 
-   %7D
+%60%60%60
 %0A *%0A */%0Aexpo
@@ -734,26 +734,30 @@
 ency.%0A *%0A * 
-  
+%60%60%60%0A *
  class AComp
@@ -758,35 +758,32 @@
  AComponent %7B%0A *
-   
    constructor(@
@@ -826,19 +826,16 @@
 Fn) %7B%0A *
-   
      aSe
@@ -865,20 +865,21 @@
 *   
-  
+%7D%0A *
  %7D%0A * 
-   %7D
+%60%60%60
 %0A *%0A
@@ -1186,26 +1186,30 @@
 mple:%0A *%0A * 
-  
+%60%60%60%0A *
  class Paren
@@ -1244,19 +1244,16 @@
 on %7B%7D%0A *
-   
  class N
@@ -1281,19 +1281,16 @@
 %7B%7D%0A *%0A *
-   
  class A
@@ -1303,19 +1303,16 @@
 ent %7B%0A *
-   
    const
@@ -1374,20 +1374,24 @@
 ) %7B%7D%0A * 
-   %7D
+%7D%0A * %60%60%60
 %0A *%0A * w
@@ -1433,18 +1433,22 @@
 :%0A *%0A * 
-  
+%60%60%60%0A *
  new Dep
@@ -1490,16 +1490,23 @@
 ent()%5D)%0A
+ * %60%60%60%0A
  *%0A * Th

use triple backticks to code-fence code blocks