inversify 6.1.5-beta.0 → 6.1.5-beta.2

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 (324) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/{es → lib/cjs}/annotation/decorator_utils.d.ts +1 -0
  3. package/lib/cjs/annotation/decorator_utils.d.ts.map +1 -0
  4. package/lib/{annotation → cjs/annotation}/decorator_utils.js +8 -0
  5. package/lib/cjs/annotation/decorator_utils.js.map +1 -0
  6. package/{es → lib/cjs}/annotation/inject.d.ts +1 -0
  7. package/lib/cjs/annotation/inject.d.ts.map +1 -0
  8. package/lib/{annotation → cjs/annotation}/inject.js +1 -0
  9. package/lib/cjs/annotation/inject.js.map +1 -0
  10. package/{es → lib/cjs}/annotation/inject_base.d.ts +1 -0
  11. package/lib/cjs/annotation/inject_base.d.ts.map +1 -0
  12. package/lib/{annotation → cjs/annotation}/inject_base.js +2 -0
  13. package/lib/cjs/annotation/inject_base.js.map +1 -0
  14. package/{es → lib/cjs}/annotation/injectable.d.ts +1 -0
  15. package/lib/cjs/annotation/injectable.d.ts.map +1 -0
  16. package/lib/{annotation → cjs/annotation}/injectable.js +2 -0
  17. package/lib/cjs/annotation/injectable.js.map +1 -0
  18. package/lib/{annotation → cjs/annotation}/multi_inject.d.ts +1 -0
  19. package/lib/cjs/annotation/multi_inject.d.ts.map +1 -0
  20. package/lib/{annotation → cjs/annotation}/multi_inject.js +1 -0
  21. package/lib/cjs/annotation/multi_inject.js.map +1 -0
  22. package/{es → lib/cjs}/annotation/named.d.ts +1 -0
  23. package/lib/cjs/annotation/named.d.ts.map +1 -0
  24. package/lib/{annotation → cjs/annotation}/named.js +2 -0
  25. package/lib/cjs/annotation/named.js.map +1 -0
  26. package/{es → lib/cjs}/annotation/optional.d.ts +1 -0
  27. package/lib/cjs/annotation/optional.d.ts.map +1 -0
  28. package/lib/{annotation → cjs/annotation}/optional.js +1 -0
  29. package/lib/cjs/annotation/optional.js.map +1 -0
  30. package/{es → lib/cjs}/annotation/post_construct.d.ts +1 -0
  31. package/lib/cjs/annotation/post_construct.d.ts.map +1 -0
  32. package/lib/{annotation → cjs/annotation}/post_construct.js +1 -0
  33. package/lib/cjs/annotation/post_construct.js.map +1 -0
  34. package/{es → lib/cjs}/annotation/pre_destroy.d.ts +1 -0
  35. package/lib/cjs/annotation/pre_destroy.d.ts.map +1 -0
  36. package/lib/{annotation → cjs/annotation}/pre_destroy.js +1 -0
  37. package/lib/cjs/annotation/pre_destroy.js.map +1 -0
  38. package/lib/{annotation → cjs/annotation}/property_event_decorator.d.ts +1 -0
  39. package/lib/cjs/annotation/property_event_decorator.d.ts.map +1 -0
  40. package/lib/{annotation → cjs/annotation}/property_event_decorator.js +1 -0
  41. package/lib/cjs/annotation/property_event_decorator.js.map +1 -0
  42. package/{es → lib/cjs}/annotation/tagged.d.ts +1 -0
  43. package/lib/cjs/annotation/tagged.d.ts.map +1 -0
  44. package/lib/{annotation → cjs/annotation}/tagged.js +2 -0
  45. package/lib/cjs/annotation/tagged.js.map +1 -0
  46. package/lib/{annotation → cjs/annotation}/target_name.d.ts +1 -0
  47. package/lib/cjs/annotation/target_name.d.ts.map +1 -0
  48. package/lib/{annotation → cjs/annotation}/target_name.js +1 -0
  49. package/lib/cjs/annotation/target_name.js.map +1 -0
  50. package/lib/{annotation → cjs/annotation}/unmanaged.d.ts +1 -0
  51. package/lib/cjs/annotation/unmanaged.d.ts.map +1 -0
  52. package/lib/{annotation → cjs/annotation}/unmanaged.js +1 -0
  53. package/lib/cjs/annotation/unmanaged.js.map +1 -0
  54. package/lib/{bindings → cjs/bindings}/binding.d.ts +1 -0
  55. package/lib/cjs/bindings/binding.d.ts.map +1 -0
  56. package/lib/{bindings → cjs/bindings}/binding.js +15 -0
  57. package/lib/cjs/bindings/binding.js.map +1 -0
  58. package/lib/{bindings → cjs/bindings}/binding_count.d.ts +1 -0
  59. package/lib/cjs/bindings/binding_count.d.ts.map +1 -0
  60. package/lib/{bindings → cjs/bindings}/binding_count.js +1 -0
  61. package/lib/cjs/bindings/binding_count.js.map +1 -0
  62. package/{es → lib/cjs}/constants/error_msgs.d.ts +1 -0
  63. package/lib/cjs/constants/error_msgs.d.ts.map +1 -0
  64. package/lib/{constants → cjs/constants}/error_msgs.js +2 -0
  65. package/lib/cjs/constants/error_msgs.js.map +1 -0
  66. package/lib/{constants → cjs/constants}/literal_types.d.ts +1 -0
  67. package/lib/cjs/constants/literal_types.d.ts.map +1 -0
  68. package/lib/{constants → cjs/constants}/literal_types.js +4 -0
  69. package/lib/cjs/constants/literal_types.js.map +1 -0
  70. package/{es → lib/cjs}/constants/metadata_keys.d.ts +1 -0
  71. package/lib/cjs/constants/metadata_keys.d.ts.map +1 -0
  72. package/lib/{constants → cjs/constants}/metadata_keys.js +13 -0
  73. package/lib/cjs/constants/metadata_keys.js.map +1 -0
  74. package/lib/{container → cjs/container}/container.d.ts +1 -0
  75. package/lib/cjs/container/container.d.ts.map +1 -0
  76. package/lib/{container → cjs/container}/container.js +29 -1
  77. package/lib/cjs/container/container.js.map +1 -0
  78. package/{es → lib/cjs}/container/container_module.d.ts +1 -0
  79. package/lib/cjs/container/container_module.d.ts.map +1 -0
  80. package/lib/{container → cjs/container}/container_module.js +1 -0
  81. package/lib/cjs/container/container_module.js.map +1 -0
  82. package/lib/{container → cjs/container}/container_snapshot.d.ts +1 -0
  83. package/lib/cjs/container/container_snapshot.d.ts.map +1 -0
  84. package/lib/{container → cjs/container}/container_snapshot.js +1 -0
  85. package/lib/cjs/container/container_snapshot.js.map +1 -0
  86. package/lib/{container → cjs/container}/lookup.d.ts +1 -0
  87. package/lib/cjs/container/lookup.d.ts.map +1 -0
  88. package/lib/{container → cjs/container}/lookup.js +8 -0
  89. package/lib/cjs/container/lookup.js.map +1 -0
  90. package/{es → lib/cjs}/container/module_activation_store.d.ts +1 -0
  91. package/lib/cjs/container/module_activation_store.d.ts.map +1 -0
  92. package/lib/{container → cjs/container}/module_activation_store.js +1 -0
  93. package/lib/cjs/container/module_activation_store.js.map +1 -0
  94. package/{es/inversify.d.ts → lib/cjs/index.d.ts} +1 -0
  95. package/lib/cjs/index.d.ts.map +1 -0
  96. package/lib/{inversify.js → cjs/index.js} +2 -0
  97. package/lib/cjs/index.js.map +1 -0
  98. package/{es → lib/cjs}/interfaces/interfaces.d.ts +2 -1
  99. package/lib/cjs/interfaces/interfaces.d.ts.map +1 -0
  100. package/lib/{interfaces → cjs/interfaces}/interfaces.js +1 -0
  101. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  102. package/lib/cjs/interfaces/interfaces_common_exports.d.ts +4 -0
  103. package/lib/cjs/interfaces/interfaces_common_exports.d.ts.map +1 -0
  104. package/lib/{annotation/lazy_service_identifier.js → cjs/interfaces/interfaces_common_exports.js} +1 -0
  105. package/lib/cjs/interfaces/interfaces_common_exports.js.map +1 -0
  106. package/lib/cjs/package.json +3 -0
  107. package/{es → lib/cjs}/planning/context.d.ts +1 -0
  108. package/lib/cjs/planning/context.d.ts.map +1 -0
  109. package/lib/{planning → cjs/planning}/context.js +1 -0
  110. package/lib/cjs/planning/context.js.map +1 -0
  111. package/lib/{planning → cjs/planning}/metadata.d.ts +1 -0
  112. package/lib/cjs/planning/metadata.d.ts.map +1 -0
  113. package/lib/{planning → cjs/planning}/metadata.js +1 -0
  114. package/lib/cjs/planning/metadata.js.map +1 -0
  115. package/lib/{planning → cjs/planning}/metadata_reader.d.ts +1 -0
  116. package/lib/cjs/planning/metadata_reader.d.ts.map +1 -0
  117. package/lib/{planning → cjs/planning}/metadata_reader.js +4 -0
  118. package/lib/cjs/planning/metadata_reader.js.map +1 -0
  119. package/{es → lib/cjs}/planning/plan.d.ts +1 -0
  120. package/lib/cjs/planning/plan.d.ts.map +1 -0
  121. package/lib/{planning → cjs/planning}/plan.js +1 -0
  122. package/lib/cjs/planning/plan.js.map +1 -0
  123. package/{es → lib/cjs}/planning/planner.d.ts +1 -0
  124. package/lib/cjs/planning/planner.d.ts.map +1 -0
  125. package/lib/{planning → cjs/planning}/planner.js +10 -0
  126. package/lib/cjs/planning/planner.js.map +1 -0
  127. package/{es → lib/cjs}/planning/queryable_string.d.ts +1 -0
  128. package/lib/cjs/planning/queryable_string.d.ts.map +1 -0
  129. package/lib/{planning → cjs/planning}/queryable_string.js +2 -0
  130. package/lib/cjs/planning/queryable_string.js.map +1 -0
  131. package/{es → lib/cjs}/planning/reflection_utils.d.ts +1 -0
  132. package/lib/cjs/planning/reflection_utils.d.ts.map +1 -0
  133. package/lib/{planning → cjs/planning}/reflection_utils.js +8 -1
  134. package/lib/cjs/planning/reflection_utils.js.map +1 -0
  135. package/{es → lib/cjs}/planning/request.d.ts +1 -0
  136. package/lib/cjs/planning/request.d.ts.map +1 -0
  137. package/lib/{planning → cjs/planning}/request.js +5 -1
  138. package/lib/cjs/planning/request.js.map +1 -0
  139. package/lib/{resolution → cjs/resolution}/instantiation.d.ts +1 -0
  140. package/lib/cjs/resolution/instantiation.d.ts.map +1 -0
  141. package/lib/{resolution → cjs/resolution}/instantiation.js +1 -0
  142. package/lib/cjs/resolution/instantiation.js.map +1 -0
  143. package/{es → lib/cjs}/resolution/resolver.d.ts +1 -0
  144. package/lib/cjs/resolution/resolver.d.ts.map +1 -0
  145. package/lib/{resolution → cjs/resolution}/resolver.js +18 -0
  146. package/lib/cjs/resolution/resolver.js.map +1 -0
  147. package/{es → lib/cjs}/scope/scope.d.ts +1 -0
  148. package/lib/cjs/scope/scope.d.ts.map +1 -0
  149. package/lib/{scope → cjs/scope}/scope.js +7 -0
  150. package/lib/cjs/scope/scope.js.map +1 -0
  151. package/{es → lib/cjs}/syntax/binding_in_syntax.d.ts +1 -0
  152. package/lib/cjs/syntax/binding_in_syntax.d.ts.map +1 -0
  153. package/lib/{syntax → cjs/syntax}/binding_in_syntax.js +1 -0
  154. package/lib/cjs/syntax/binding_in_syntax.js.map +1 -0
  155. package/{es → lib/cjs}/syntax/binding_in_when_on_syntax.d.ts +1 -0
  156. package/lib/cjs/syntax/binding_in_when_on_syntax.d.ts.map +1 -0
  157. package/lib/{syntax → cjs/syntax}/binding_in_when_on_syntax.js +1 -0
  158. package/lib/cjs/syntax/binding_in_when_on_syntax.js.map +1 -0
  159. package/{es → lib/cjs}/syntax/binding_on_syntax.d.ts +1 -0
  160. package/lib/cjs/syntax/binding_on_syntax.d.ts.map +1 -0
  161. package/lib/{syntax → cjs/syntax}/binding_on_syntax.js +1 -0
  162. package/lib/cjs/syntax/binding_on_syntax.js.map +1 -0
  163. package/lib/{syntax → cjs/syntax}/binding_to_syntax.d.ts +1 -0
  164. package/lib/cjs/syntax/binding_to_syntax.d.ts.map +1 -0
  165. package/lib/{syntax → cjs/syntax}/binding_to_syntax.js +7 -0
  166. package/lib/cjs/syntax/binding_to_syntax.js.map +1 -0
  167. package/{es → lib/cjs}/syntax/binding_when_on_syntax.d.ts +1 -0
  168. package/lib/cjs/syntax/binding_when_on_syntax.d.ts.map +1 -0
  169. package/lib/{syntax → cjs/syntax}/binding_when_on_syntax.js +1 -0
  170. package/lib/cjs/syntax/binding_when_on_syntax.js.map +1 -0
  171. package/lib/{syntax → cjs/syntax}/binding_when_syntax.d.ts +1 -0
  172. package/lib/cjs/syntax/binding_when_syntax.d.ts.map +1 -0
  173. package/lib/{syntax → cjs/syntax}/binding_when_syntax.js +4 -1
  174. package/lib/cjs/syntax/binding_when_syntax.js.map +1 -0
  175. package/{es → lib/cjs}/syntax/constraint_helpers.d.ts +1 -0
  176. package/lib/cjs/syntax/constraint_helpers.d.ts.map +1 -0
  177. package/lib/{syntax → cjs/syntax}/constraint_helpers.js +5 -0
  178. package/lib/cjs/syntax/constraint_helpers.js.map +1 -0
  179. package/{es → lib/cjs}/utils/async.d.ts +1 -0
  180. package/lib/cjs/utils/async.d.ts.map +1 -0
  181. package/lib/{utils → cjs/utils}/async.js +1 -0
  182. package/lib/cjs/utils/async.js.map +1 -0
  183. package/{es → lib/cjs}/utils/binding_utils.d.ts +1 -0
  184. package/lib/cjs/utils/binding_utils.d.ts.map +1 -0
  185. package/lib/{utils → cjs/utils}/binding_utils.js +4 -0
  186. package/lib/cjs/utils/binding_utils.js.map +1 -0
  187. package/{es → lib/cjs}/utils/clonable.d.ts +1 -0
  188. package/lib/cjs/utils/clonable.d.ts.map +1 -0
  189. package/lib/{utils → cjs/utils}/clonable.js +1 -0
  190. package/lib/cjs/utils/clonable.js.map +1 -0
  191. package/{es → lib/cjs}/utils/exceptions.d.ts +1 -0
  192. package/lib/cjs/utils/exceptions.d.ts.map +1 -0
  193. package/lib/{utils → cjs/utils}/exceptions.js +1 -0
  194. package/lib/cjs/utils/exceptions.js.map +1 -0
  195. package/lib/{utils → cjs/utils}/factory_type.d.ts +1 -0
  196. package/lib/cjs/utils/factory_type.d.ts.map +1 -0
  197. package/lib/{utils → cjs/utils}/factory_type.js +1 -0
  198. package/lib/cjs/utils/factory_type.js.map +1 -0
  199. package/{es → lib/cjs}/utils/id.d.ts +1 -0
  200. package/lib/cjs/utils/id.d.ts.map +1 -0
  201. package/lib/{utils → cjs/utils}/id.js +1 -0
  202. package/lib/cjs/utils/id.js.map +1 -0
  203. package/{es → lib/cjs}/utils/js.d.ts +1 -0
  204. package/lib/cjs/utils/js.d.ts.map +1 -0
  205. package/lib/{utils → cjs/utils}/js.js +1 -0
  206. package/lib/cjs/utils/js.js.map +1 -0
  207. package/{es → lib/cjs}/utils/serialization.d.ts +1 -0
  208. package/lib/cjs/utils/serialization.d.ts.map +1 -0
  209. package/lib/{utils → cjs/utils}/serialization.js +6 -0
  210. package/lib/cjs/utils/serialization.js.map +1 -0
  211. package/lib/{interfaces/interfaces.d.ts → esm/index.d.ts} +206 -4
  212. package/lib/esm/index.d.ts.map +1 -0
  213. package/lib/esm/index.js +2 -0
  214. package/lib/esm/index.js.map +1 -0
  215. package/package.json +21 -24
  216. package/es/annotation/decorator_utils.js +0 -90
  217. package/es/annotation/inject.js +0 -4
  218. package/es/annotation/inject_base.js +0 -14
  219. package/es/annotation/injectable.js +0 -13
  220. package/es/annotation/lazy_service_identifier.js +0 -1
  221. package/es/annotation/multi_inject.d.ts +0 -5
  222. package/es/annotation/multi_inject.js +0 -4
  223. package/es/annotation/named.js +0 -7
  224. package/es/annotation/optional.js +0 -7
  225. package/es/annotation/post_construct.js +0 -5
  226. package/es/annotation/pre_destroy.js +0 -5
  227. package/es/annotation/property_event_decorator.d.ts +0 -4
  228. package/es/annotation/property_event_decorator.js +0 -13
  229. package/es/annotation/tagged.js +0 -6
  230. package/es/annotation/target_name.d.ts +0 -3
  231. package/es/annotation/target_name.js +0 -10
  232. package/es/annotation/unmanaged.d.ts +0 -3
  233. package/es/annotation/unmanaged.js +0 -10
  234. package/es/bindings/binding.d.ts +0 -20
  235. package/es/bindings/binding.js +0 -37
  236. package/es/bindings/binding_count.d.ts +0 -5
  237. package/es/bindings/binding_count.js +0 -6
  238. package/es/constants/error_msgs.js +0 -62
  239. package/es/constants/literal_types.d.ts +0 -5
  240. package/es/constants/literal_types.js +0 -21
  241. package/es/constants/metadata_keys.js +0 -23
  242. package/es/container/container.d.ts +0 -75
  243. package/es/container/container.js +0 -750
  244. package/es/container/container_module.js +0 -17
  245. package/es/container/container_snapshot.d.ts +0 -10
  246. package/es/container/container_snapshot.js +0 -15
  247. package/es/container/lookup.d.ts +0 -17
  248. package/es/container/lookup.js +0 -105
  249. package/es/container/module_activation_store.js +0 -47
  250. package/es/interfaces/interfaces.js +0 -1
  251. package/es/inversify.js +0 -3
  252. package/es/inversify.js.LICENSE.txt +0 -14
  253. package/es/planning/context.js +0 -15
  254. package/es/planning/metadata.d.ts +0 -8
  255. package/es/planning/metadata.js +0 -17
  256. package/es/planning/metadata_reader.d.ts +0 -6
  257. package/es/planning/metadata_reader.js +0 -21
  258. package/es/planning/plan.js +0 -8
  259. package/es/planning/planner.js +0 -168
  260. package/es/planning/queryable_string.js +0 -28
  261. package/es/planning/reflection_utils.js +0 -27
  262. package/es/planning/request.js +0 -20
  263. package/es/planning/target.js +0 -87
  264. package/es/resolution/instantiation.d.ts +0 -3
  265. package/es/resolution/instantiation.js +0 -195
  266. package/es/resolution/resolver.js +0 -214
  267. package/es/scope/scope.js +0 -88
  268. package/es/syntax/binding_in_syntax.js +0 -21
  269. package/es/syntax/binding_in_when_on_syntax.js +0 -73
  270. package/es/syntax/binding_on_syntax.js +0 -16
  271. package/es/syntax/binding_to_syntax.d.ts +0 -18
  272. package/es/syntax/binding_to_syntax.js +0 -91
  273. package/es/syntax/binding_when_on_syntax.js +0 -62
  274. package/es/syntax/binding_when_syntax.d.ts +0 -21
  275. package/es/syntax/binding_when_syntax.js +0 -104
  276. package/es/syntax/constraint_helpers.js +0 -36
  277. package/es/utils/async.js +0 -12
  278. package/es/utils/binding_utils.js +0 -58
  279. package/es/utils/clonable.js +0 -7
  280. package/es/utils/exceptions.js +0 -16
  281. package/es/utils/factory_type.d.ts +0 -5
  282. package/es/utils/factory_type.js +0 -6
  283. package/es/utils/id.js +0 -5
  284. package/es/utils/js.js +0 -13
  285. package/es/utils/serialization.js +0 -103
  286. package/lib/annotation/decorator_utils.d.ts +0 -16
  287. package/lib/annotation/inject.d.ts +0 -5
  288. package/lib/annotation/inject_base.d.ts +0 -4
  289. package/lib/annotation/injectable.d.ts +0 -2
  290. package/lib/annotation/lazy_service_identifier.d.ts +0 -3
  291. package/lib/annotation/named.d.ts +0 -2
  292. package/lib/annotation/optional.d.ts +0 -2
  293. package/lib/annotation/post_construct.d.ts +0 -4
  294. package/lib/annotation/pre_destroy.d.ts +0 -4
  295. package/lib/annotation/tagged.d.ts +0 -2
  296. package/lib/constants/error_msgs.d.ts +0 -30
  297. package/lib/constants/metadata_keys.d.ts +0 -13
  298. package/lib/container/container_module.d.ts +0 -11
  299. package/lib/container/module_activation_store.d.ts +0 -10
  300. package/lib/inversify.d.ts +0 -25
  301. package/lib/planning/context.d.ts +0 -11
  302. package/lib/planning/plan.d.ts +0 -7
  303. package/lib/planning/planner.d.ts +0 -5
  304. package/lib/planning/queryable_string.d.ts +0 -10
  305. package/lib/planning/reflection_utils.d.ts +0 -5
  306. package/lib/planning/request.d.ts +0 -14
  307. package/lib/planning/target.d.ts +0 -23
  308. package/lib/planning/target.js +0 -113
  309. package/lib/resolution/resolver.d.ts +0 -3
  310. package/lib/scope/scope.d.ts +0 -3
  311. package/lib/syntax/binding_in_syntax.d.ts +0 -9
  312. package/lib/syntax/binding_in_when_on_syntax.d.ts +0 -29
  313. package/lib/syntax/binding_on_syntax.d.ts +0 -8
  314. package/lib/syntax/binding_when_on_syntax.d.ts +0 -25
  315. package/lib/syntax/constraint_helpers.d.ts +0 -6
  316. package/lib/tsconfig.tsbuildinfo +0 -1
  317. package/lib/utils/async.d.ts +0 -3
  318. package/lib/utils/binding_utils.d.ts +0 -4
  319. package/lib/utils/clonable.d.ts +0 -3
  320. package/lib/utils/exceptions.d.ts +0 -2
  321. package/lib/utils/id.d.ts +0 -2
  322. package/lib/utils/js.d.ts +0 -1
  323. package/lib/utils/serialization.d.ts +0 -10
  324. /package/{es → lib/esm}/package.json +0 -0
@@ -1,214 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import * as ERROR_MSGS from '../constants/error_msgs';
38
- import { BindingTypeEnum } from '../constants/literal_types';
39
- import { getBindingDictionary } from '../planning/planner';
40
- import { saveToScope, tryGetFromScope } from '../scope/scope';
41
- import { isPromise } from '../utils/async';
42
- import { ensureFullyBound, getFactoryDetails } from '../utils/binding_utils';
43
- import { tryAndThrowErrorIfStackOverflow } from '../utils/exceptions';
44
- import { resolveInstance } from './instantiation';
45
- var _resolveRequest = function (requestScope) {
46
- return function (request) {
47
- request.parentContext.setCurrentRequest(request);
48
- var bindings = request.bindings;
49
- var childRequests = request.childRequests;
50
- var targetIsAnArray = request.target && request.target.isArray();
51
- var targetParentIsNotAnArray = !request.parentRequest ||
52
- !request.parentRequest.target ||
53
- !request.target ||
54
- !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);
55
- if (targetIsAnArray && targetParentIsNotAnArray) {
56
- return childRequests.map(function (childRequest) {
57
- var resolveRequest = _resolveRequest(requestScope);
58
- return resolveRequest(childRequest);
59
- });
60
- }
61
- else {
62
- if (request.target.isOptional() && bindings.length === 0) {
63
- return undefined;
64
- }
65
- var binding = bindings[0];
66
- return _resolveBinding(requestScope, request, binding);
67
- }
68
- };
69
- };
70
- var _resolveFactoryFromBinding = function (binding, context) {
71
- var factoryDetails = getFactoryDetails(binding);
72
- return tryAndThrowErrorIfStackOverflow(function () {
73
- return factoryDetails.factory.bind(binding)(context);
74
- }, function () {
75
- return new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryDetails.factoryType, context.currentRequest.serviceIdentifier.toString()));
76
- });
77
- };
78
- var _getResolvedFromBinding = function (requestScope, request, binding) {
79
- var result;
80
- var childRequests = request.childRequests;
81
- ensureFullyBound(binding);
82
- switch (binding.type) {
83
- case BindingTypeEnum.ConstantValue:
84
- case BindingTypeEnum.Function:
85
- result = binding.cache;
86
- break;
87
- case BindingTypeEnum.Constructor:
88
- result = binding.implementationType;
89
- break;
90
- case BindingTypeEnum.Instance:
91
- result = resolveInstance(binding, binding.implementationType, childRequests, _resolveRequest(requestScope));
92
- break;
93
- default:
94
- result = _resolveFactoryFromBinding(binding, request.parentContext);
95
- }
96
- return result;
97
- };
98
- var _resolveInScope = function (requestScope, binding, resolveFromBinding) {
99
- var result = tryGetFromScope(requestScope, binding);
100
- if (result !== null) {
101
- return result;
102
- }
103
- result = resolveFromBinding();
104
- saveToScope(requestScope, binding, result);
105
- return result;
106
- };
107
- var _resolveBinding = function (requestScope, request, binding) {
108
- return _resolveInScope(requestScope, binding, function () {
109
- var result = _getResolvedFromBinding(requestScope, request, binding);
110
- if (isPromise(result)) {
111
- result = result.then(function (resolved) {
112
- return _onActivation(request, binding, resolved);
113
- });
114
- }
115
- else {
116
- result = _onActivation(request, binding, result);
117
- }
118
- return result;
119
- });
120
- };
121
- function _onActivation(request, binding, resolved) {
122
- var result = _bindingActivation(request.parentContext, binding, resolved);
123
- var containersIterator = _getContainersIterator(request.parentContext.container);
124
- var container;
125
- var containersIteratorResult = containersIterator.next();
126
- do {
127
- container = containersIteratorResult.value;
128
- var context_1 = request.parentContext;
129
- var serviceIdentifier = request.serviceIdentifier;
130
- var activationsIterator = _getContainerActivationsForService(container, serviceIdentifier);
131
- if (isPromise(result)) {
132
- result = _activateContainerAsync(activationsIterator, context_1, result);
133
- }
134
- else {
135
- result = _activateContainer(activationsIterator, context_1, result);
136
- }
137
- containersIteratorResult = containersIterator.next();
138
- } while (containersIteratorResult.done !== true &&
139
- !getBindingDictionary(container).hasKey(request.serviceIdentifier));
140
- return result;
141
- }
142
- var _bindingActivation = function (context, binding, previousResult) {
143
- var result;
144
- if (typeof binding.onActivation === 'function') {
145
- result = binding.onActivation(context, previousResult);
146
- }
147
- else {
148
- result = previousResult;
149
- }
150
- return result;
151
- };
152
- var _activateContainer = function (activationsIterator, context, result) {
153
- var activation = activationsIterator.next();
154
- while (activation.done !== true) {
155
- result = activation.value(context, result);
156
- if (isPromise(result)) {
157
- return _activateContainerAsync(activationsIterator, context, result);
158
- }
159
- activation = activationsIterator.next();
160
- }
161
- return result;
162
- };
163
- var _activateContainerAsync = function (activationsIterator, context, resultPromise) { return __awaiter(void 0, void 0, void 0, function () {
164
- var result, activation;
165
- return __generator(this, function (_a) {
166
- switch (_a.label) {
167
- case 0: return [4, resultPromise];
168
- case 1:
169
- result = _a.sent();
170
- activation = activationsIterator.next();
171
- _a.label = 2;
172
- case 2:
173
- if (!(activation.done !== true)) return [3, 4];
174
- return [4, activation.value(context, result)];
175
- case 3:
176
- result = _a.sent();
177
- activation = activationsIterator.next();
178
- return [3, 2];
179
- case 4: return [2, result];
180
- }
181
- });
182
- }); };
183
- var _getContainerActivationsForService = function (container, serviceIdentifier) {
184
- var activations = container._activations;
185
- return activations.hasKey(serviceIdentifier)
186
- ? activations.get(serviceIdentifier).values()
187
- : [].values();
188
- };
189
- var _getContainersIterator = function (container) {
190
- var containersStack = [container];
191
- var parent = container.parent;
192
- while (parent !== null) {
193
- containersStack.push(parent);
194
- parent = parent.parent;
195
- }
196
- var getNextContainer = function () {
197
- var nextContainer = containersStack.pop();
198
- if (nextContainer !== undefined) {
199
- return { done: false, value: nextContainer };
200
- }
201
- else {
202
- return { done: true, value: undefined };
203
- }
204
- };
205
- var containersIterator = {
206
- next: getNextContainer,
207
- };
208
- return containersIterator;
209
- };
210
- function resolve(context) {
211
- var resolveRequestFunction = _resolveRequest(context.plan.rootRequest.requestScope);
212
- return resolveRequestFunction(context.plan.rootRequest);
213
- }
214
- export { resolve };
package/es/scope/scope.js DELETED
@@ -1,88 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import { BindingScopeEnum } from '../constants/literal_types';
38
- import { isPromise } from '../utils/async';
39
- export var tryGetFromScope = function (requestScope, binding) {
40
- if (binding.scope === BindingScopeEnum.Singleton && binding.activated) {
41
- return binding.cache;
42
- }
43
- if (binding.scope === BindingScopeEnum.Request &&
44
- requestScope.has(binding.id)) {
45
- return requestScope.get(binding.id);
46
- }
47
- return null;
48
- };
49
- export var saveToScope = function (requestScope, binding, result) {
50
- if (binding.scope === BindingScopeEnum.Singleton) {
51
- _saveToSingletonScope(binding, result);
52
- }
53
- if (binding.scope === BindingScopeEnum.Request) {
54
- _saveToRequestScope(requestScope, binding, result);
55
- }
56
- };
57
- var _saveToRequestScope = function (requestScope, binding, result) {
58
- if (!requestScope.has(binding.id)) {
59
- requestScope.set(binding.id, result);
60
- }
61
- };
62
- var _saveToSingletonScope = function (binding, result) {
63
- binding.cache = result;
64
- binding.activated = true;
65
- if (isPromise(result)) {
66
- void _saveAsyncResultToSingletonScope(binding, result);
67
- }
68
- };
69
- var _saveAsyncResultToSingletonScope = function (binding, asyncResult) { return __awaiter(void 0, void 0, void 0, function () {
70
- var result, ex_1;
71
- return __generator(this, function (_a) {
72
- switch (_a.label) {
73
- case 0:
74
- _a.trys.push([0, 2, , 3]);
75
- return [4, asyncResult];
76
- case 1:
77
- result = _a.sent();
78
- binding.cache = result;
79
- return [3, 3];
80
- case 2:
81
- ex_1 = _a.sent();
82
- binding.cache = null;
83
- binding.activated = false;
84
- throw ex_1;
85
- case 3: return [2];
86
- }
87
- });
88
- }); };
@@ -1,21 +0,0 @@
1
- import { BindingScopeEnum } from '../constants/literal_types';
2
- import { BindingWhenOnSyntax } from './binding_when_on_syntax';
3
- var BindingInSyntax = (function () {
4
- function BindingInSyntax(binding) {
5
- this._binding = binding;
6
- }
7
- BindingInSyntax.prototype.inRequestScope = function () {
8
- this._binding.scope = BindingScopeEnum.Request;
9
- return new BindingWhenOnSyntax(this._binding);
10
- };
11
- BindingInSyntax.prototype.inSingletonScope = function () {
12
- this._binding.scope = BindingScopeEnum.Singleton;
13
- return new BindingWhenOnSyntax(this._binding);
14
- };
15
- BindingInSyntax.prototype.inTransientScope = function () {
16
- this._binding.scope = BindingScopeEnum.Transient;
17
- return new BindingWhenOnSyntax(this._binding);
18
- };
19
- return BindingInSyntax;
20
- }());
21
- export { BindingInSyntax };
@@ -1,73 +0,0 @@
1
- import { BindingInSyntax } from './binding_in_syntax';
2
- import { BindingOnSyntax } from './binding_on_syntax';
3
- import { BindingWhenSyntax } from './binding_when_syntax';
4
- var BindingInWhenOnSyntax = (function () {
5
- function BindingInWhenOnSyntax(binding) {
6
- this._binding = binding;
7
- this._bindingWhenSyntax = new BindingWhenSyntax(this._binding);
8
- this._bindingOnSyntax = new BindingOnSyntax(this._binding);
9
- this._bindingInSyntax = new BindingInSyntax(binding);
10
- }
11
- BindingInWhenOnSyntax.prototype.inRequestScope = function () {
12
- return this._bindingInSyntax.inRequestScope();
13
- };
14
- BindingInWhenOnSyntax.prototype.inSingletonScope = function () {
15
- return this._bindingInSyntax.inSingletonScope();
16
- };
17
- BindingInWhenOnSyntax.prototype.inTransientScope = function () {
18
- return this._bindingInSyntax.inTransientScope();
19
- };
20
- BindingInWhenOnSyntax.prototype.when = function (constraint) {
21
- return this._bindingWhenSyntax.when(constraint);
22
- };
23
- BindingInWhenOnSyntax.prototype.whenTargetNamed = function (name) {
24
- return this._bindingWhenSyntax.whenTargetNamed(name);
25
- };
26
- BindingInWhenOnSyntax.prototype.whenTargetIsDefault = function () {
27
- return this._bindingWhenSyntax.whenTargetIsDefault();
28
- };
29
- BindingInWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
30
- return this._bindingWhenSyntax.whenTargetTagged(tag, value);
31
- };
32
- BindingInWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
33
- return this._bindingWhenSyntax.whenInjectedInto(parent);
34
- };
35
- BindingInWhenOnSyntax.prototype.whenParentNamed = function (name) {
36
- return this._bindingWhenSyntax.whenParentNamed(name);
37
- };
38
- BindingInWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
39
- return this._bindingWhenSyntax.whenParentTagged(tag, value);
40
- };
41
- BindingInWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
42
- return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
43
- };
44
- BindingInWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
45
- return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
46
- };
47
- BindingInWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
48
- return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
49
- };
50
- BindingInWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
51
- return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
52
- };
53
- BindingInWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
54
- return this._bindingWhenSyntax.whenNoAncestorNamed(name);
55
- };
56
- BindingInWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
57
- return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
58
- };
59
- BindingInWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
60
- return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
61
- };
62
- BindingInWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
63
- return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
64
- };
65
- BindingInWhenOnSyntax.prototype.onActivation = function (handler) {
66
- return this._bindingOnSyntax.onActivation(handler);
67
- };
68
- BindingInWhenOnSyntax.prototype.onDeactivation = function (handler) {
69
- return this._bindingOnSyntax.onDeactivation(handler);
70
- };
71
- return BindingInWhenOnSyntax;
72
- }());
73
- export { BindingInWhenOnSyntax };
@@ -1,16 +0,0 @@
1
- import { BindingWhenSyntax } from './binding_when_syntax';
2
- var BindingOnSyntax = (function () {
3
- function BindingOnSyntax(binding) {
4
- this._binding = binding;
5
- }
6
- BindingOnSyntax.prototype.onActivation = function (handler) {
7
- this._binding.onActivation = handler;
8
- return new BindingWhenSyntax(this._binding);
9
- };
10
- BindingOnSyntax.prototype.onDeactivation = function (handler) {
11
- this._binding.onDeactivation = handler;
12
- return new BindingWhenSyntax(this._binding);
13
- };
14
- return BindingOnSyntax;
15
- }());
16
- export { BindingOnSyntax };
@@ -1,18 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- import { BindingWhenOnSyntax } from './binding_when_on_syntax';
3
- declare class BindingToSyntax<T> implements interfaces.BindingToSyntax<T> {
4
- private readonly _binding;
5
- constructor(binding: interfaces.Binding<T>);
6
- to(constructor: interfaces.Newable<T>): interfaces.BindingInWhenOnSyntax<T>;
7
- toSelf(): interfaces.BindingInWhenOnSyntax<T>;
8
- toConstantValue(value: T): interfaces.BindingWhenOnSyntax<T>;
9
- toDynamicValue(func: interfaces.DynamicValue<T>): interfaces.BindingInWhenOnSyntax<T>;
10
- toConstructor<T2>(constructor: interfaces.Newable<T2>): interfaces.BindingWhenOnSyntax<T>;
11
- toFactory<T2>(factory: interfaces.FactoryCreator<T2>): interfaces.BindingWhenOnSyntax<T>;
12
- toFunction(func: T): interfaces.BindingWhenOnSyntax<T>;
13
- toAutoFactory<T2>(serviceIdentifier: interfaces.ServiceIdentifier<T2>): interfaces.BindingWhenOnSyntax<T>;
14
- toAutoNamedFactory<T2>(serviceIdentifier: interfaces.ServiceIdentifier<T2>): BindingWhenOnSyntax<T>;
15
- toProvider<T2>(provider: interfaces.ProviderCreator<T2>): interfaces.BindingWhenOnSyntax<T>;
16
- toService(service: interfaces.ServiceIdentifier<T>): void;
17
- }
18
- export { BindingToSyntax };
@@ -1,91 +0,0 @@
1
- import * as ERROR_MSGS from '../constants/error_msgs';
2
- import { BindingScopeEnum, BindingTypeEnum } from '../constants/literal_types';
3
- import { BindingInWhenOnSyntax } from './binding_in_when_on_syntax';
4
- import { BindingWhenOnSyntax } from './binding_when_on_syntax';
5
- var BindingToSyntax = (function () {
6
- function BindingToSyntax(binding) {
7
- this._binding = binding;
8
- }
9
- BindingToSyntax.prototype.to = function (constructor) {
10
- this._binding.type = BindingTypeEnum.Instance;
11
- this._binding.implementationType = constructor;
12
- return new BindingInWhenOnSyntax(this._binding);
13
- };
14
- BindingToSyntax.prototype.toSelf = function () {
15
- if (typeof this._binding.serviceIdentifier !== 'function') {
16
- throw new Error(ERROR_MSGS.INVALID_TO_SELF_VALUE);
17
- }
18
- var self = this._binding
19
- .serviceIdentifier;
20
- return this.to(self);
21
- };
22
- BindingToSyntax.prototype.toConstantValue = function (value) {
23
- this._binding.type = BindingTypeEnum.ConstantValue;
24
- this._binding.cache = value;
25
- this._binding.dynamicValue = null;
26
- this._binding.implementationType = null;
27
- this._binding.scope = BindingScopeEnum.Singleton;
28
- return new BindingWhenOnSyntax(this._binding);
29
- };
30
- BindingToSyntax.prototype.toDynamicValue = function (func) {
31
- this._binding.type = BindingTypeEnum.DynamicValue;
32
- this._binding.cache = null;
33
- this._binding.dynamicValue = func;
34
- this._binding.implementationType = null;
35
- return new BindingInWhenOnSyntax(this._binding);
36
- };
37
- BindingToSyntax.prototype.toConstructor = function (constructor) {
38
- this._binding.type = BindingTypeEnum.Constructor;
39
- this._binding.implementationType = constructor;
40
- this._binding.scope = BindingScopeEnum.Singleton;
41
- return new BindingWhenOnSyntax(this._binding);
42
- };
43
- BindingToSyntax.prototype.toFactory = function (factory) {
44
- this._binding.type = BindingTypeEnum.Factory;
45
- this._binding.factory = factory;
46
- this._binding.scope = BindingScopeEnum.Singleton;
47
- return new BindingWhenOnSyntax(this._binding);
48
- };
49
- BindingToSyntax.prototype.toFunction = function (func) {
50
- if (typeof func !== 'function') {
51
- throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING);
52
- }
53
- var bindingWhenOnSyntax = this.toConstantValue(func);
54
- this._binding.type = BindingTypeEnum.Function;
55
- this._binding.scope = BindingScopeEnum.Singleton;
56
- return bindingWhenOnSyntax;
57
- };
58
- BindingToSyntax.prototype.toAutoFactory = function (serviceIdentifier) {
59
- this._binding.type = BindingTypeEnum.Factory;
60
- this._binding.factory = function (context) {
61
- var autofactory = function () {
62
- return context.container.get(serviceIdentifier);
63
- };
64
- return autofactory;
65
- };
66
- this._binding.scope = BindingScopeEnum.Singleton;
67
- return new BindingWhenOnSyntax(this._binding);
68
- };
69
- BindingToSyntax.prototype.toAutoNamedFactory = function (serviceIdentifier) {
70
- this._binding.type = BindingTypeEnum.Factory;
71
- this._binding.factory = function (context) {
72
- return function (named) {
73
- return context.container.getNamed(serviceIdentifier, named);
74
- };
75
- };
76
- return new BindingWhenOnSyntax(this._binding);
77
- };
78
- BindingToSyntax.prototype.toProvider = function (provider) {
79
- this._binding.type = BindingTypeEnum.Provider;
80
- this._binding.provider = provider;
81
- this._binding.scope = BindingScopeEnum.Singleton;
82
- return new BindingWhenOnSyntax(this._binding);
83
- };
84
- BindingToSyntax.prototype.toService = function (service) {
85
- this.toDynamicValue(function (context) {
86
- return context.container.get(service);
87
- });
88
- };
89
- return BindingToSyntax;
90
- }());
91
- export { BindingToSyntax };
@@ -1,62 +0,0 @@
1
- import { BindingOnSyntax } from './binding_on_syntax';
2
- import { BindingWhenSyntax } from './binding_when_syntax';
3
- var BindingWhenOnSyntax = (function () {
4
- function BindingWhenOnSyntax(binding) {
5
- this._binding = binding;
6
- this._bindingWhenSyntax = new BindingWhenSyntax(this._binding);
7
- this._bindingOnSyntax = new BindingOnSyntax(this._binding);
8
- }
9
- BindingWhenOnSyntax.prototype.when = function (constraint) {
10
- return this._bindingWhenSyntax.when(constraint);
11
- };
12
- BindingWhenOnSyntax.prototype.whenTargetNamed = function (name) {
13
- return this._bindingWhenSyntax.whenTargetNamed(name);
14
- };
15
- BindingWhenOnSyntax.prototype.whenTargetIsDefault = function () {
16
- return this._bindingWhenSyntax.whenTargetIsDefault();
17
- };
18
- BindingWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
19
- return this._bindingWhenSyntax.whenTargetTagged(tag, value);
20
- };
21
- BindingWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
22
- return this._bindingWhenSyntax.whenInjectedInto(parent);
23
- };
24
- BindingWhenOnSyntax.prototype.whenParentNamed = function (name) {
25
- return this._bindingWhenSyntax.whenParentNamed(name);
26
- };
27
- BindingWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
28
- return this._bindingWhenSyntax.whenParentTagged(tag, value);
29
- };
30
- BindingWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
31
- return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
32
- };
33
- BindingWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
34
- return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
35
- };
36
- BindingWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
37
- return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
38
- };
39
- BindingWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
40
- return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
41
- };
42
- BindingWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
43
- return this._bindingWhenSyntax.whenNoAncestorNamed(name);
44
- };
45
- BindingWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
46
- return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
47
- };
48
- BindingWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
49
- return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
50
- };
51
- BindingWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
52
- return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
53
- };
54
- BindingWhenOnSyntax.prototype.onActivation = function (handler) {
55
- return this._bindingOnSyntax.onActivation(handler);
56
- };
57
- BindingWhenOnSyntax.prototype.onDeactivation = function (handler) {
58
- return this._bindingOnSyntax.onDeactivation(handler);
59
- };
60
- return BindingWhenOnSyntax;
61
- }());
62
- export { BindingWhenOnSyntax };
@@ -1,21 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class BindingWhenSyntax<T> implements interfaces.BindingWhenSyntax<T> {
3
- private readonly _binding;
4
- constructor(binding: interfaces.Binding<T>);
5
- when(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
6
- whenTargetNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
7
- whenTargetIsDefault(): interfaces.BindingOnSyntax<T>;
8
- whenTargetTagged(tag: string | number | symbol, value: unknown): interfaces.BindingOnSyntax<T>;
9
- whenInjectedInto(parent: NewableFunction | string): interfaces.BindingOnSyntax<T>;
10
- whenParentNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
11
- whenParentTagged(tag: string | number | symbol, value: unknown): interfaces.BindingOnSyntax<T>;
12
- whenAnyAncestorIs(ancestor: NewableFunction | string): interfaces.BindingOnSyntax<T>;
13
- whenNoAncestorIs(ancestor: NewableFunction | string): interfaces.BindingOnSyntax<T>;
14
- whenAnyAncestorNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
15
- whenNoAncestorNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
16
- whenAnyAncestorTagged(tag: string | number | symbol, value: unknown): interfaces.BindingOnSyntax<T>;
17
- whenNoAncestorTagged(tag: string | number | symbol, value: unknown): interfaces.BindingOnSyntax<T>;
18
- whenAnyAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
19
- whenNoAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
20
- }
21
- export { BindingWhenSyntax };