@coolon/angular-ui-powerups 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/jest.config.js +9 -0
  3. package/ng-package.json +13 -0
  4. package/package.json +12 -14
  5. package/schematics/ng-add/index.ts +10 -0
  6. package/schematics/place-routes/index.ts +152 -0
  7. package/schematics/place-routes/place-def.ts +93 -0
  8. package/schematics/place-routes/scanner.ts +145 -0
  9. package/schematics/place-routes/schema.ts +7 -0
  10. package/src/lib/angular-ui-powerups.module.spec.ts +14 -0
  11. package/src/lib/angular-ui-powerups.module.ts +49 -0
  12. package/{lib/animations/index.d.ts → src/lib/animations/index.ts} +1 -0
  13. package/src/lib/animations/slideDownAndUpAnimation.ts +39 -0
  14. package/src/lib/components/disposable-component.ts +9 -0
  15. package/src/lib/components/forms/abstract-input.component.ts +108 -0
  16. package/src/lib/components/forms/number-input/number-input.component.html +15 -0
  17. package/src/lib/components/forms/number-input/number-input.component.scss +3 -0
  18. package/src/lib/components/forms/number-input/number-input.component.spec.ts +25 -0
  19. package/src/lib/components/forms/number-input/number-input.component.ts +19 -0
  20. package/src/lib/components/forms/password-input/password-input.component.html +16 -0
  21. package/src/lib/components/forms/password-input/password-input.component.scss +3 -0
  22. package/src/lib/components/forms/password-input/password-input.component.spec.ts +25 -0
  23. package/src/lib/components/forms/password-input/password-input.component.ts +18 -0
  24. package/src/lib/components/forms/scss/mixins.scss +16 -0
  25. package/src/lib/components/forms/select-input/select-input.component.html +16 -0
  26. package/src/lib/components/forms/select-input/select-input.component.scss +7 -0
  27. package/src/lib/components/forms/select-input/select-input.component.spec.ts +25 -0
  28. package/src/lib/components/forms/select-input/select-input.component.ts +31 -0
  29. package/src/lib/components/forms/string-input/string-input.component.html +15 -0
  30. package/src/lib/components/forms/string-input/string-input.component.scss +3 -0
  31. package/src/lib/components/forms/string-input/string-input.component.spec.ts +25 -0
  32. package/src/lib/components/forms/string-input/string-input.component.ts +18 -0
  33. package/{lib/components/index.d.ts → src/lib/components/index.ts} +1 -0
  34. package/src/lib/components/resize-aware.component.ts +52 -0
  35. package/src/lib/components/types/bounds.class.ts +25 -0
  36. package/src/lib/components/types/dimension.class.ts +3 -0
  37. package/src/lib/components/types/point.class.ts +13 -0
  38. package/src/lib/directives/command.directive.spec.ts +73 -0
  39. package/src/lib/directives/command.directive.ts +81 -0
  40. package/src/lib/directives/focus-binding.directive.spec.ts +8 -0
  41. package/src/lib/directives/focus-binding.directive.ts +108 -0
  42. package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +1 -0
  43. package/src/lib/interaction/abstract-activity.ts +57 -0
  44. package/src/lib/interaction/activity.ts +17 -0
  45. package/src/lib/interaction/alert.ts +6 -0
  46. package/src/lib/interaction/components/activity-container/activity-container.component.html +8 -0
  47. package/src/lib/interaction/components/activity-container/activity-container.component.scss +3 -0
  48. package/src/lib/interaction/components/activity-container/activity-container.component.spec.ts +25 -0
  49. package/src/lib/interaction/components/activity-container/activity-container.component.ts +93 -0
  50. package/{lib/interaction/components/activity-outlet/activity-outlet-context.d.ts → src/lib/interaction/components/activity-outlet/activity-outlet-context.ts} +7 -5
  51. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.scss +3 -0
  52. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.spec.ts +25 -0
  53. package/src/lib/interaction/components/activity-outlet/activity-outlet.component.ts +96 -0
  54. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.html +7 -0
  55. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.scss +7 -0
  56. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.spec.ts +25 -0
  57. package/src/lib/interaction/components/alert-dialog/alert-dialog.component.ts +20 -0
  58. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.html +9 -0
  59. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.scss +8 -0
  60. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.spec.ts +25 -0
  61. package/src/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.ts +26 -0
  62. package/{lib/interaction/confirm.d.ts → src/lib/interaction/confirm.ts} +3 -2
  63. package/{lib/interaction/index.d.ts → src/lib/interaction/index.ts} +1 -0
  64. package/src/lib/interaction/interaction-context.ts +16 -0
  65. package/src/lib/interaction/interaction.module.ts +35 -0
  66. package/src/lib/interaction/result.ts +16 -0
  67. package/src/lib/interaction/services/dialog-interaction.service.scss +11 -0
  68. package/src/lib/interaction/services/dialog-interaction.service.spec.ts +12 -0
  69. package/src/lib/interaction/services/dialog-interaction.service.ts +63 -0
  70. package/src/lib/place/abstract-place-component.ts +33 -0
  71. package/src/lib/place/components/busy-overlay/busy-overlay.component.html +4 -0
  72. package/src/lib/place/components/busy-overlay/busy-overlay.component.scss +27 -0
  73. package/src/lib/place/components/busy-overlay/busy-overlay.component.spec.ts +25 -0
  74. package/src/lib/place/components/busy-overlay/busy-overlay.component.ts +23 -0
  75. package/src/lib/place/components/empty-state/empty-state.component.scss +15 -0
  76. package/src/lib/place/components/empty-state/empty-state.component.spec.ts +25 -0
  77. package/src/lib/place/components/empty-state/empty-state.component.ts +19 -0
  78. package/src/lib/place/components/place-outlet/place-outlet.component.html +7 -0
  79. package/src/lib/place/components/place-outlet/place-outlet.component.scss +12 -0
  80. package/src/lib/place/components/place-outlet/place-outlet.component.spec.ts +25 -0
  81. package/src/lib/place/components/place-outlet/place-outlet.component.ts +37 -0
  82. package/src/lib/place/components/place-outlet/route-animations.ts +30 -0
  83. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.html +7 -0
  84. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.scss +100 -0
  85. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.spec.ts +25 -0
  86. package/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts +30 -0
  87. package/src/lib/place/guards/leave-place.guard.spec.ts +15 -0
  88. package/src/lib/place/guards/leave-place.guard.ts +18 -0
  89. package/src/lib/place/guards/place-route.guard.ts +37 -0
  90. package/{lib/place/index.d.ts → src/lib/place/index.ts} +2 -1
  91. package/src/lib/place/place-component.ts +6 -0
  92. package/src/lib/place/place.decorator.ts +40 -0
  93. package/src/lib/place/place.module.ts +44 -0
  94. package/src/lib/place/place.service.spec.ts +12 -0
  95. package/src/lib/place/place.service.ts +29 -0
  96. package/src/lib/place/route/json-types.ts +5 -0
  97. package/src/lib/place/route/parameter-decorators.ts +99 -0
  98. package/src/lib/place/route/parameter-definition.class.ts +12 -0
  99. package/{lib/place/route/parameter-sanitiser.d.ts → src/lib/place/route/parameter-sanitiser.ts} +1 -1
  100. package/src/lib/place/route/parameter-type.ts +31 -0
  101. package/src/lib/place/route/route-parameter-bindings.ts +140 -0
  102. package/src/lib/place/route/route-parameter-sanitiser.ts +135 -0
  103. package/src/test-setup.ts +1 -0
  104. package/tsconfig.json +7 -0
  105. package/tsconfig.lib.json +20 -0
  106. package/tsconfig.schematics.json +35 -0
  107. package/tsconfig.spec.json +10 -0
  108. package/tslint.json +7 -0
  109. package/bundles/coolon-angular-ui-powerups.umd.js +0 -3908
  110. package/bundles/coolon-angular-ui-powerups.umd.js.map +0 -1
  111. package/bundles/coolon-angular-ui-powerups.umd.min.js +0 -2
  112. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +0 -1
  113. package/coolon-angular-ui-powerups.d.ts +0 -30
  114. package/coolon-angular-ui-powerups.metadata.json +0 -1
  115. package/esm2015/coolon-angular-ui-powerups.js +0 -33
  116. package/esm2015/index.js +0 -6
  117. package/esm2015/lib/angular-ui-powerups.module.js +0 -54
  118. package/esm2015/lib/animations/index.js +0 -9
  119. package/esm2015/lib/animations/slideDownAndUpAnimation.js +0 -30
  120. package/esm2015/lib/components/disposable-component.js +0 -14
  121. package/esm2015/lib/components/forms/abstract-input.component.js +0 -183
  122. package/esm2015/lib/components/forms/number-input/number-input.component.js +0 -26
  123. package/esm2015/lib/components/forms/password-input/password-input.component.js +0 -26
  124. package/esm2015/lib/components/forms/select-input/select-input.component.js +0 -60
  125. package/esm2015/lib/components/forms/string-input/string-input.component.js +0 -26
  126. package/esm2015/lib/components/index.js +0 -18
  127. package/esm2015/lib/components/resize-aware.component.js +0 -96
  128. package/esm2015/lib/components/types/bounds.class.js +0 -56
  129. package/esm2015/lib/components/types/dimension.class.js +0 -21
  130. package/esm2015/lib/components/types/point.class.js +0 -36
  131. package/esm2015/lib/directives/command.directive.js +0 -135
  132. package/esm2015/lib/directives/focus-binding.directive.js +0 -179
  133. package/esm2015/lib/directives/index.js +0 -10
  134. package/esm2015/lib/interaction/abstract-activity.js +0 -129
  135. package/esm2015/lib/interaction/activity.js +0 -27
  136. package/esm2015/lib/interaction/alert.js +0 -23
  137. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +0 -144
  138. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
  139. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -169
  140. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -37
  141. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -46
  142. package/esm2015/lib/interaction/confirm.js +0 -17
  143. package/esm2015/lib/interaction/index.js +0 -21
  144. package/esm2015/lib/interaction/interaction-context.js +0 -35
  145. package/esm2015/lib/interaction/interaction.module.js +0 -41
  146. package/esm2015/lib/interaction/result.js +0 -24
  147. package/esm2015/lib/interaction/services/dialog-interaction.service.js +0 -114
  148. package/esm2015/lib/place/abstract-place-component.js +0 -59
  149. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +0 -44
  150. package/esm2015/lib/place/components/empty-state/empty-state.component.js +0 -28
  151. package/esm2015/lib/place/components/nav/nav.component.js +0 -31
  152. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +0 -67
  153. package/esm2015/lib/place/components/place-outlet/route-animations.js +0 -35
  154. package/esm2015/lib/place/guards/leave-place.guard.js +0 -52
  155. package/esm2015/lib/place/guards/place-route.guard.js +0 -74
  156. package/esm2015/lib/place/index.js +0 -27
  157. package/esm2015/lib/place/place-component.js +0 -17
  158. package/esm2015/lib/place/place.decorator.js +0 -72
  159. package/esm2015/lib/place/place.module.js +0 -49
  160. package/esm2015/lib/place/place.service.js +0 -61
  161. package/esm2015/lib/place/route/json-types.js +0 -13
  162. package/esm2015/lib/place/route/parameter-decorators.js +0 -178
  163. package/esm2015/lib/place/route/parameter-definition.class.js +0 -24
  164. package/esm2015/lib/place/route/parameter-sanitiser.js +0 -17
  165. package/esm2015/lib/place/route/parameter-type.js +0 -43
  166. package/esm2015/lib/place/route/route-parameter-bindings.js +0 -294
  167. package/esm2015/lib/place/route/route-parameter-sanitiser.js +0 -280
  168. package/esm2015/public_api.js +0 -11
  169. package/esm5/coolon-angular-ui-powerups.js +0 -33
  170. package/esm5/index.js +0 -6
  171. package/esm5/lib/angular-ui-powerups.module.js +0 -58
  172. package/esm5/lib/animations/index.js +0 -9
  173. package/esm5/lib/animations/slideDownAndUpAnimation.js +0 -30
  174. package/esm5/lib/components/disposable-component.js +0 -24
  175. package/esm5/lib/components/forms/abstract-input.component.js +0 -232
  176. package/esm5/lib/components/forms/number-input/number-input.component.js +0 -33
  177. package/esm5/lib/components/forms/password-input/password-input.component.js +0 -33
  178. package/esm5/lib/components/forms/select-input/select-input.component.js +0 -67
  179. package/esm5/lib/components/forms/string-input/string-input.component.js +0 -33
  180. package/esm5/lib/components/index.js +0 -18
  181. package/esm5/lib/components/resize-aware.component.js +0 -124
  182. package/esm5/lib/components/types/bounds.class.js +0 -59
  183. package/esm5/lib/components/types/dimension.class.js +0 -19
  184. package/esm5/lib/components/types/point.class.js +0 -43
  185. package/esm5/lib/directives/command.directive.js +0 -155
  186. package/esm5/lib/directives/focus-binding.directive.js +0 -231
  187. package/esm5/lib/directives/index.js +0 -10
  188. package/esm5/lib/interaction/abstract-activity.js +0 -173
  189. package/esm5/lib/interaction/activity.js +0 -27
  190. package/esm5/lib/interaction/alert.js +0 -23
  191. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +0 -181
  192. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -22
  193. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +0 -206
  194. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +0 -42
  195. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +0 -54
  196. package/esm5/lib/interaction/confirm.js +0 -17
  197. package/esm5/lib/interaction/index.js +0 -21
  198. package/esm5/lib/interaction/interaction-context.js +0 -45
  199. package/esm5/lib/interaction/interaction.module.js +0 -45
  200. package/esm5/lib/interaction/result.js +0 -24
  201. package/esm5/lib/interaction/services/dialog-interaction.service.js +0 -140
  202. package/esm5/lib/place/abstract-place-component.js +0 -66
  203. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +0 -49
  204. package/esm5/lib/place/components/empty-state/empty-state.component.js +0 -29
  205. package/esm5/lib/place/components/nav/nav.component.js +0 -36
  206. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +0 -81
  207. package/esm5/lib/place/components/place-outlet/route-animations.js +0 -35
  208. package/esm5/lib/place/guards/leave-place.guard.js +0 -57
  209. package/esm5/lib/place/guards/place-route.guard.js +0 -78
  210. package/esm5/lib/place/index.js +0 -27
  211. package/esm5/lib/place/place-component.js +0 -17
  212. package/esm5/lib/place/place.decorator.js +0 -69
  213. package/esm5/lib/place/place.module.js +0 -53
  214. package/esm5/lib/place/place.service.js +0 -75
  215. package/esm5/lib/place/route/json-types.js +0 -13
  216. package/esm5/lib/place/route/parameter-decorators.js +0 -178
  217. package/esm5/lib/place/route/parameter-definition.class.js +0 -24
  218. package/esm5/lib/place/route/parameter-sanitiser.js +0 -17
  219. package/esm5/lib/place/route/parameter-type.js +0 -65
  220. package/esm5/lib/place/route/route-parameter-bindings.js +0 -339
  221. package/esm5/lib/place/route/route-parameter-sanitiser.js +0 -395
  222. package/esm5/public_api.js +0 -11
  223. package/fesm2015/coolon-angular-ui-powerups.js +0 -3129
  224. package/fesm2015/coolon-angular-ui-powerups.js.map +0 -1
  225. package/fesm5/coolon-angular-ui-powerups.js +0 -3681
  226. package/fesm5/coolon-angular-ui-powerups.js.map +0 -1
  227. package/lib/angular-ui-powerups.module.d.ts +0 -2
  228. package/lib/animations/slideDownAndUpAnimation.d.ts +0 -5
  229. package/lib/components/disposable-component.d.ts +0 -5
  230. package/lib/components/forms/abstract-input.component.d.ts +0 -35
  231. package/lib/components/forms/number-input/number-input.component.d.ts +0 -6
  232. package/lib/components/forms/password-input/password-input.component.d.ts +0 -6
  233. package/lib/components/forms/select-input/select-input.component.d.ts +0 -11
  234. package/lib/components/forms/string-input/string-input.component.d.ts +0 -6
  235. package/lib/components/resize-aware.component.d.ts +0 -22
  236. package/lib/components/types/bounds.class.d.ts +0 -16
  237. package/lib/components/types/dimension.class.d.ts +0 -5
  238. package/lib/components/types/point.class.d.ts +0 -10
  239. package/lib/directives/command.directive.d.ts +0 -14
  240. package/lib/directives/focus-binding.directive.d.ts +0 -22
  241. package/lib/interaction/abstract-activity.d.ts +0 -17
  242. package/lib/interaction/activity.d.ts +0 -11
  243. package/lib/interaction/alert.d.ts +0 -5
  244. package/lib/interaction/components/activity-container/activity-container.component.d.ts +0 -32
  245. package/lib/interaction/components/activity-outlet/activity-outlet.component.d.ts +0 -30
  246. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +0 -8
  247. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -9
  248. package/lib/interaction/interaction-context.d.ts +0 -11
  249. package/lib/interaction/interaction.module.d.ts +0 -2
  250. package/lib/interaction/result.d.ts +0 -8
  251. package/lib/interaction/services/dialog-interaction.service.d.ts +0 -14
  252. package/lib/place/abstract-place-component.d.ts +0 -13
  253. package/lib/place/components/busy-overlay/busy-overlay.component.d.ts +0 -8
  254. package/lib/place/components/empty-state/empty-state.component.d.ts +0 -5
  255. package/lib/place/components/nav/nav.component.d.ts +0 -7
  256. package/lib/place/components/place-outlet/place-outlet.component.d.ts +0 -13
  257. package/lib/place/components/place-outlet/route-animations.d.ts +0 -1
  258. package/lib/place/guards/leave-place.guard.d.ts +0 -10
  259. package/lib/place/guards/place-route.guard.d.ts +0 -9
  260. package/lib/place/place-component.d.ts +0 -5
  261. package/lib/place/place.decorator.d.ts +0 -20
  262. package/lib/place/place.module.d.ts +0 -2
  263. package/lib/place/place.service.d.ts +0 -8
  264. package/lib/place/route/json-types.d.ts +0 -7
  265. package/lib/place/route/parameter-decorators.d.ts +0 -26
  266. package/lib/place/route/parameter-definition.class.d.ts +0 -11
  267. package/lib/place/route/parameter-type.d.ts +0 -16
  268. package/lib/place/route/route-parameter-bindings.d.ts +0 -18
  269. package/lib/place/route/route-parameter-sanitiser.d.ts +0 -42
  270. package/schematics/ng-add/index.d.ts +0 -2
  271. package/schematics/ng-add/index.js +0 -12
  272. package/schematics/ng-add/index.js.map +0 -1
  273. package/schematics/place-routes/index.d.ts +0 -3
  274. package/schematics/place-routes/index.js +0 -114
  275. package/schematics/place-routes/index.js.map +0 -1
  276. package/schematics/place-routes/place-def.d.ts +0 -34
  277. package/schematics/place-routes/place-def.js +0 -84
  278. package/schematics/place-routes/place-def.js.map +0 -1
  279. package/schematics/place-routes/scanner.d.ts +0 -26
  280. package/schematics/place-routes/scanner.js +0 -125
  281. package/schematics/place-routes/scanner.js.map +0 -1
  282. package/schematics/place-routes/schema.d.ts +0 -7
  283. package/schematics/place-routes/schema.js +0 -3
  284. package/schematics/place-routes/schema.js.map +0 -1
  285. /package/{index.d.ts → src/index.ts} +0 -0
  286. /package/{public_api.d.ts → src/public_api.ts} +0 -0
@@ -1,8 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { ValueModel } from '@coolon/pectin';
3
- export declare class BusyOverlayComponent implements OnInit {
4
- busyModel: ValueModel<boolean>;
5
- busy: boolean;
6
- constructor();
7
- ngOnInit(): void;
8
- }
@@ -1,5 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- export declare class EmptyStateComponent implements OnInit {
3
- constructor();
4
- ngOnInit(): void;
5
- }
@@ -1,7 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { Place } from '../../place.decorator';
3
- export declare class NavComponent implements OnInit {
4
- places: Place.Descriptor[];
5
- constructor();
6
- ngOnInit(): void;
7
- }
@@ -1,13 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { RouterOutlet } from '@angular/router';
3
- import { PlaceComponent } from '../../place-component';
4
- import { PlaceService } from '../../place.service';
5
- export declare class PlaceOutletComponent implements OnInit {
6
- private readonly placeService;
7
- animate: boolean;
8
- constructor(placeService: PlaceService);
9
- ngOnInit(): void;
10
- onActivate($event: PlaceComponent): void;
11
- onDeactivate($event: PlaceComponent): void;
12
- getPlaceOrder(outlet: RouterOutlet): any;
13
- }
@@ -1 +0,0 @@
1
- export declare const LEFT_RIGHT_PLACE_ANIMATION: import("@angular/animations").AnimationTriggerMetadata;
@@ -1,10 +0,0 @@
1
- import { Injector } from '@angular/core';
2
- import { ActivatedRouteSnapshot, CanDeactivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
3
- import { Observable } from 'rxjs';
4
- import { PlaceComponent } from '../place-component';
5
- export declare class LeavePlaceGuard implements CanDeactivate<PlaceComponent> {
6
- private router;
7
- private injector;
8
- constructor(router: Router, injector: Injector);
9
- canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
10
- }
@@ -1,9 +0,0 @@
1
- import { Injector } from '@angular/core';
2
- import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
3
- import { Observable } from 'rxjs';
4
- export declare class PlaceRouteGuard implements CanActivate {
5
- private router;
6
- private injector;
7
- constructor(router: Router, injector: Injector);
8
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
9
- }
@@ -1,5 +0,0 @@
1
- import { ValueModel } from '@coolon/pectin';
2
- export interface PlaceComponent {
3
- titleModel: ValueModel<string>;
4
- canDeactivate(): boolean | Promise<boolean>;
5
- }
@@ -1,20 +0,0 @@
1
- import { Constructable } from '@coolon/pectin';
2
- import 'reflect-metadata';
3
- import { PlaceComponent } from './place-component';
4
- export declare function Place(options: Place.Options): (target: Function) => void;
5
- export declare namespace Place {
6
- interface Options {
7
- path: string;
8
- title: string;
9
- order: number;
10
- authenticate?: boolean;
11
- }
12
- class Descriptor {
13
- readonly path: string;
14
- readonly authenticate: boolean;
15
- readonly title: string;
16
- readonly order: number;
17
- constructor(placeClass: Constructable<PlaceComponent>, options: Options);
18
- }
19
- function getDescriptor(klass: Constructable<PlaceComponent>): Descriptor;
20
- }
@@ -1,2 +0,0 @@
1
- export declare class PlaceModule {
2
- }
@@ -1,8 +0,0 @@
1
- import { PlaceComponent } from './place-component';
2
- export declare class PlaceService {
3
- private _activePlaces;
4
- constructor();
5
- readonly activePlaces: import("@coolon/pectin").ListModel<PlaceComponent>;
6
- onActivate(place: PlaceComponent): void;
7
- onDeactivate(place: PlaceComponent): void;
8
- }
@@ -1,7 +0,0 @@
1
- export declare type JsonPrimitive = boolean | number | string;
2
- export declare type AnyJson = JsonPrimitive | null | JsonArray | JsonMap;
3
- export interface JsonArray extends Array<AnyJson> {
4
- }
5
- export interface JsonMap {
6
- [key: string]: AnyJson;
7
- }
@@ -1,26 +0,0 @@
1
- import { Constructable } from '@coolon/pectin';
2
- import { ParameterSanitiser } from './parameter-sanitiser';
3
- import { ParameterType } from './parameter-type';
4
- export interface ParameterOptions<T> {
5
- as?: string;
6
- sanitiser?: Constructable<ParameterSanitiser<T>>;
7
- }
8
- export interface ListParameterOptions<T> {
9
- as?: string;
10
- listSanitiser?: Constructable<ParameterSanitiser<T[]>>;
11
- }
12
- export declare function RouteId<T extends string | number>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator;
13
- /**
14
- * @deprecated use RouteParameter instead.
15
- * @param type
16
- * @param options
17
- */
18
- export declare function QueryParameter<T>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator;
19
- export declare function RouteParameter<T>(type: ParameterType<T>, options?: ParameterOptions<T>): PropertyDecorator;
20
- /**
21
- * @deprecated use RouteParameterList instead
22
- * @param elementType
23
- * @param options
24
- */
25
- export declare function QueryParameterList<E>(elementType: ParameterType<E>, options?: ListParameterOptions<E>): PropertyDecorator;
26
- export declare function RouteParameterList<E>(elementType: ParameterType<E>, options?: ListParameterOptions<E>): PropertyDecorator;
@@ -1,11 +0,0 @@
1
- import { Constructable } from '@coolon/pectin';
2
- import { ParameterSanitiser } from './parameter-sanitiser';
3
- import { ParameterType } from './parameter-type';
4
- export interface ParameterDefinition<E, S = E> {
5
- readonly name: string;
6
- readonly propertyName: string;
7
- readonly type: ParameterType<E>;
8
- readonly sanitiser: Constructable<ParameterSanitiser<S>>;
9
- readonly isRouteId: boolean;
10
- readonly isArray: boolean;
11
- }
@@ -1,16 +0,0 @@
1
- export interface ParameterType<T> {
2
- format(value: T): string;
3
- parse(value: string): T;
4
- }
5
- export declare namespace ParameterType {
6
- class StringType implements ParameterType<string> {
7
- format(value: string): string;
8
- parse(value: string): string;
9
- }
10
- class NumberType implements ParameterType<number> {
11
- format(value: number): string;
12
- parse(value: string): number;
13
- }
14
- const STRING: StringType;
15
- const NUMBER: NumberType;
16
- }
@@ -1,18 +0,0 @@
1
- import { ActivatedRoute, Router } from '@angular/router';
2
- import { GarbageCollector, MutableValueModel } from '@coolon/pectin';
3
- import { ParameterDefinition } from './parameter-definition.class';
4
- export declare class RouteParameterBindings extends GarbageCollector {
5
- private readonly component;
6
- private readonly router;
7
- private readonly activatedRoute;
8
- readonly _incomingRouteChange: MutableValueModel<boolean>;
9
- private txo;
10
- private readonly resolvedParameters;
11
- constructor(component: any, router: Router, activatedRoute: ActivatedRoute);
12
- readonly incomingRouteChange: import("@coolon/pectin").ValueModel<boolean>;
13
- protected installBinding<T>(parameter: ParameterDefinition<T>): void;
14
- private getModelFor;
15
- }
16
- export declare namespace RouteParameterBindings {
17
- const ROUTE_PARAMETER_LIST_KEY: unique symbol;
18
- }
@@ -1,42 +0,0 @@
1
- import { Injector } from '@angular/core';
2
- import { ActivatedRouteSnapshot, Router } from '@angular/router';
3
- import { ParameterDefinition } from './parameter-definition.class';
4
- import { ParameterSanitiser } from './parameter-sanitiser';
5
- export declare abstract class Sanitiser<T, S> {
6
- readonly parameterDef: ParameterDefinition<T>;
7
- readonly snapshot: ActivatedRouteSnapshot;
8
- readonly sanitiser: ParameterSanitiser<S>;
9
- private initialValue;
10
- private _sanitisedValue;
11
- constructor(parameterDef: ParameterDefinition<T>, snapshot: ActivatedRouteSnapshot, sanitiser: ParameterSanitiser<S>);
12
- isRouteId(): boolean;
13
- readonly valueChanged: boolean;
14
- readonly sanitisedValue: S;
15
- protected abstract readFrom(snapshot: ActivatedRouteSnapshot): S;
16
- protected abstract hasChanged(initialValue: S, sanitisedValue: S): boolean;
17
- abstract injectRouteParam(dest: {}): any;
18
- sanitize(): Promise<boolean>;
19
- }
20
- export declare class RouteParameterSanitiser {
21
- readonly parameterDefs: ParameterDefinition<any>[];
22
- readonly snapshot: ActivatedRouteSnapshot;
23
- readonly injector: Injector;
24
- private readonly routeIdSanitiser;
25
- private readonly parameterSanitisers;
26
- constructor(parameterDefs: ParameterDefinition<any>[], snapshot: ActivatedRouteSnapshot, injector: Injector);
27
- sanitise(): Promise<boolean>;
28
- redirect(router: Router): Promise<boolean>;
29
- private getSanitiser;
30
- }
31
- export declare namespace Sanitiser {
32
- class Value<T> extends Sanitiser<T, T> {
33
- readFrom(snapshot: ActivatedRouteSnapshot): T;
34
- protected hasChanged(initialValue: T, sanitisedValue: T): boolean;
35
- injectRouteParam(dest: {}): void;
36
- }
37
- class Array<T> extends Sanitiser<T, T[]> {
38
- readFrom(snapshot: ActivatedRouteSnapshot): T[];
39
- protected hasChanged(initialValue: T[], sanitisedValue: T[]): boolean;
40
- injectRouteParam(dest: {}): void;
41
- }
42
- }
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare function ngAdd(_options: any): Rule;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tasks_1 = require("@angular-devkit/schematics/tasks");
4
- // Just return the tree
5
- function ngAdd(_options) {
6
- return (tree, _context) => {
7
- _context.addTask(new tasks_1.NodePackageInstallTask());
8
- return tree;
9
- };
10
- }
11
- exports.ngAdd = ngAdd;
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/ng-add/index.ts"],"names":[],"mappings":";;AACA,4DAA0E;AAE1E,uBAAuB;AACvB,SAAgB,KAAK,CAAC,QAAa;IACjC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,QAAQ,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AALD,sBAKC"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema } from './schema';
3
- export declare function generateRoutes(options: Schema): Rule;
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@angular-devkit/core");
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const JSON5 = require("json5");
6
- const ts_morph_1 = require("ts-morph");
7
- const place_def_1 = require("./place-def");
8
- const PLACE_ANNOTATION = /@Place\({([^})]*)}\)/m;
9
- function generateRoutes(options) {
10
- return (tree, context) => {
11
- const workspaceConfig = tree.read('/angular.json');
12
- if (!workspaceConfig) {
13
- throw new Error('Could not find Angular workspace configuration');
14
- }
15
- // convert workspace to string
16
- const workspaceContent = workspaceConfig.toString();
17
- // parse workspace string into JSON object
18
- const workspace = JSON.parse(workspaceContent);
19
- if (!options.project) {
20
- options.project = workspace.defaultProject;
21
- }
22
- const projectName = options.project;
23
- const project = workspace.projects[projectName];
24
- const config = loadConfig(project, tree, context);
25
- const placeDefs = extractPlaces(project, options, tree, context);
26
- const projectType = project.projectType === 'application' ? 'app' : 'lib';
27
- const files = schematics_1.apply(schematics_1.url('./templates'), [
28
- schematics_1.applyTemplates(Object.assign({}, options, { placeDefs,
29
- config }, core_1.strings)),
30
- schematics_1.move(`${project.sourceRoot}/${projectType}`),
31
- // @see https://github.com/angular/angular-cli/issues/11337#issuecomment-448259549
32
- schematics_1.forEach((fileEntry) => {
33
- if (tree.exists(fileEntry.path)) {
34
- tree.overwrite(fileEntry.path, fileEntry.content);
35
- }
36
- return fileEntry;
37
- })
38
- ]);
39
- return schematics_1.mergeWith(files);
40
- };
41
- }
42
- exports.generateRoutes = generateRoutes;
43
- // function applyWithOverwrite(source: Source, rules: Rule[]): Rule {
44
- // return (tree: Tree, _context: SchematicContext) => {
45
- // const rule = mergeWith(
46
- // apply(source, [
47
- // ...rules,
48
- // forEach((fileEntry) => {
49
- // if (tree.exists(fileEntry.path)) {
50
- // tree.overwrite(fileEntry.path, fileEntry.content);
51
- // return null;
52
- // }
53
- // return fileEntry;
54
- // })
55
- // ])
56
- // );
57
- //
58
- // return rule(tree, _context);
59
- // };
60
- // }
61
- function createProject(project, context) {
62
- const tsConfigPath = project.architect.build.options.tsConfig;
63
- context.logger.info(`loading tsConfig from -> ${tsConfigPath}`);
64
- try {
65
- return new ts_morph_1.Project({
66
- tsConfigFilePath: `./${tsConfigPath}`
67
- });
68
- }
69
- catch (error) {
70
- context.logger.fatal(`Failed to load typescript project form: ${project.root} You probably need to specify the --project option?`);
71
- }
72
- }
73
- function loadConfig(project, tree, context) {
74
- context.logger.info(`loading places config from -> ${project.root}/places.json (or places.json5)`);
75
- const fileEntry = tree.get(`${project.root}/places.json5`) || tree.get(`${project.root}/places.json5`);
76
- if (!fileEntry) {
77
- throw new Error(`Unable to find config file at '${project.root}/places.json' or '${project.root}/places.json5'`);
78
- }
79
- const config = JSON5.parse(fileEntry.content.toString('utf-8'));
80
- return config;
81
- }
82
- function extractPlaces(project, schema, tree, context) {
83
- const projectType = project.projectType === 'application' ? 'app' : 'lib';
84
- const projectRoot = `${project.root}`;
85
- const sourceRoot = `${project.sourceRoot}/${projectType}`;
86
- const importPrefix = `./${sourceRoot}`;
87
- const tsProject = createProject(project, context);
88
- const placeDefs = [];
89
- context.logger.info(`Scanning sources in -> ${sourceRoot}`);
90
- tree.getDir(sourceRoot).visit(filePath => {
91
- if (!filePath.endsWith('.ts')) {
92
- return;
93
- }
94
- const content = tree.read(filePath);
95
- if (!content) {
96
- return;
97
- }
98
- const sourceText = content.toString('utf-8');
99
- if (sourceText.match(PLACE_ANNOTATION)) {
100
- const sourceFile = tsProject.getSourceFileOrThrow(`./${filePath}`);
101
- sourceFile.getClasses().forEach((classDecl) => {
102
- place_def_1.PlaceDef.scan(classDecl, context).onMatch(result => {
103
- // context.logger.info(`filePath=${filePath}`);
104
- const moduleImportPath = `./${filePath.substr(importPrefix.length, filePath.length - importPrefix.length - '.ts'.length)}`;
105
- const definition = result.createDefinition(moduleImportPath);
106
- context.logger.info(`${moduleImportPath} -> ${classDecl.getName()}(route: /${definition.fullPath})`);
107
- placeDefs.push(definition);
108
- });
109
- });
110
- }
111
- });
112
- return placeDefs;
113
- }
114
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/index.ts"],"names":[],"mappings":";;AAAA,+CAA6D;AAC7D,2DAWoC;AAGpC,+BAA+B;AAC/B,uCAAqD;AACrD,2CAAuC;AAGvC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEjD,SAAgB,cAAc,CAAC,O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,EAAE,CAAC,CAAC;YAEnE,UAAU,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,SAA2B,EAAE,EAAE;gBAE9D,oBAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;oBACjD,+CAA+C;oBAC/C,MAAM,gBAAgB,GAAG,KAAK,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC3H,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;oBAC7D,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,OAAO,SAAS,CAAC,OAAO,EAAE,YAAY,UAAU,CAAC,QAAQ,GAAG,CAAC,CAAC;oBACrG,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC7B,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,34 +0,0 @@
1
- import { SchematicContext } from '@angular-devkit/schematics';
2
- import { ClassDeclaration } from 'ts-morph';
3
- import { Scanner } from './scanner';
4
- export declare class PlaceDef {
5
- readonly importPath: string;
6
- readonly componentClass: string;
7
- readonly properties: PlaceDef.Options;
8
- readonly routeDef: PlaceDef.Parameter;
9
- readonly queryParameters: PlaceDef.Parameter[];
10
- constructor(importPath: string, componentClass: string, properties: PlaceDef.Options, routeDef: PlaceDef.Parameter, queryParameters: PlaceDef.Parameter[]);
11
- readonly path: string;
12
- readonly routeIdentifier: string;
13
- readonly fullPath: string;
14
- readonly placeName: string;
15
- readonly order: number;
16
- readonly activateGuardNames: string[];
17
- private requiresRouteGuard;
18
- readonly routeModelName: string;
19
- readonly authenticate: boolean;
20
- stripEnclosingQuotes(value: string): string;
21
- }
22
- export declare namespace PlaceDef {
23
- interface Options {
24
- title: string;
25
- path: string;
26
- order: number;
27
- authenticate: string;
28
- }
29
- interface Parameter {
30
- parameterName: string;
31
- modelName: string;
32
- }
33
- function scan(classDecl: ClassDeclaration, context: SchematicContext): Scanner;
34
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const src_1 = require("@typescript-plus/fast-memoize-decorator/dist/src");
10
- const scanner_1 = require("./scanner");
11
- class PlaceDef {
12
- constructor(importPath, componentClass, properties, routeDef, queryParameters) {
13
- this.importPath = importPath;
14
- this.componentClass = componentClass;
15
- this.properties = properties;
16
- this.routeDef = routeDef;
17
- this.queryParameters = queryParameters;
18
- // console.log({ properties, routeDef });
19
- }
20
- get path() {
21
- return this.stripEnclosingQuotes(this.properties.path);
22
- }
23
- get routeIdentifier() {
24
- return this.routeDef ? this.stripEnclosingQuotes(this.routeDef.parameterName) : null;
25
- }
26
- get fullPath() {
27
- return !!this.routeIdentifier ?
28
- `${this.path}/:${this.routeIdentifier}` :
29
- this.path;
30
- }
31
- get placeName() {
32
- return this.componentClass.replace(/Component$/, "");
33
- }
34
- get order() {
35
- return this.properties.order;
36
- }
37
- get activateGuardNames() {
38
- const activateGuards = [];
39
- if (this.authenticate) {
40
- activateGuards.push('AuthGuard');
41
- }
42
- if (this.requiresRouteGuard()) {
43
- activateGuards.push('PlaceRouteGuard');
44
- }
45
- return activateGuards;
46
- }
47
- requiresRouteGuard() {
48
- return this.routeIdentifier || this.queryParameters.length > 0;
49
- }
50
- get routeModelName() {
51
- return this.routeDef ? this.stripEnclosingQuotes(this.routeDef.modelName) : null;
52
- }
53
- get authenticate() {
54
- return this.properties.authenticate === 'true';
55
- }
56
- stripEnclosingQuotes(value) {
57
- const cooked = value.replace(/(^["'])|(["']$)/g, '');
58
- // console.log({ raw: value, cooked: cooked });
59
- return cooked;
60
- }
61
- }
62
- __decorate([
63
- src_1.Memoize()
64
- ], PlaceDef.prototype, "path", null);
65
- __decorate([
66
- src_1.Memoize()
67
- ], PlaceDef.prototype, "routeIdentifier", null);
68
- __decorate([
69
- src_1.Memoize()
70
- ], PlaceDef.prototype, "placeName", null);
71
- __decorate([
72
- src_1.Memoize()
73
- ], PlaceDef.prototype, "activateGuardNames", null);
74
- __decorate([
75
- src_1.Memoize()
76
- ], PlaceDef.prototype, "routeModelName", null);
77
- exports.PlaceDef = PlaceDef;
78
- (function (PlaceDef) {
79
- function scan(classDecl, context) {
80
- return new scanner_1.Scanner(classDecl, context);
81
- }
82
- PlaceDef.scan = scan;
83
- })(PlaceDef = exports.PlaceDef || (exports.PlaceDef = {}));
84
- //# sourceMappingURL=place-def.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;AACA,0EAA2E;AAE3E,uCAAoC;AAEpC,MAAa,QAAQ;IAGnB,YACW,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC;QAJrC,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAkB;QAC5B,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,oBAAe,GAAf,eAAe,CAAsB;QAE9C,yCAAyC;IAC3C,CAAC;IAGD,IAAI,IAAI;QACN,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AAC,UAAU,CAAC,YAAY,KAAK,MAAM,CAAC;IACjD,CAAC;IAED,oBAAoB,CAAC,KAAa;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACrD,+CAA+C;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAtDC;IADC,aAAO,EAAE;oCAGT;AAGD;IADC,aAAO,EAAE;+CAGT;AASD;IADC,aAAO,EAAE;yCAGT;AAOD;IADC,aAAO,EAAE;kDAUT;AAOD;IADC,aAAO,EAAE;8CAGT;AAzDH,4BAoEC;AAED,WAAiB,QAAQ;IAcvB,SAAgB,IAAI,CAAC,SAA2B,EAAE,OAAyB;QACzE,OAAO,IAAI,iBAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAFe,aAAI,OAEnB,CAAA;AACH,CAAC,EAjBgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAiBxB"}
@@ -1,26 +0,0 @@
1
- import { SchematicContext } from '@angular-devkit/schematics';
2
- import { ClassDeclaration, Decorator, ObjectLiteralExpression, PropertyDeclaration } from 'ts-morph';
3
- import { PlaceDef } from './place-def';
4
- export declare class Scanner {
5
- private readonly classDecl;
6
- readonly context: SchematicContext;
7
- private placeAnnotation;
8
- constructor(classDecl: ClassDeclaration, context: SchematicContext);
9
- isPlace(): boolean;
10
- onMatch(callback: (scan: Scanner) => void): void;
11
- createDefinition(moduleImportPath: string): PlaceDef;
12
- protected getPlaceOptions(): PlaceDef.Options;
13
- protected getRouteIdParameter(): PlaceDef.Parameter;
14
- protected getQueryParameters(): PlaceDef.Parameter[];
15
- protected getDecoratedProperties(annotation: string): {
16
- decorator: Decorator;
17
- property: PropertyDeclaration;
18
- }[];
19
- }
20
- export declare namespace Scanner {
21
- function getObjectLiteralArgument(annotation: Decorator, position: number): ObjectLiteralExpression;
22
- function getOptionsArg<T extends {}>(annotation: Decorator, defaults: T, options?: {
23
- position: number;
24
- required: boolean;
25
- }): T;
26
- }