inversify 6.1.4 → 6.1.5-beta.1

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 (529) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/README.md +6 -15
  3. package/{amd → lib/cjs}/annotation/decorator_utils.d.ts +1 -0
  4. package/lib/cjs/annotation/decorator_utils.d.ts.map +1 -0
  5. package/{es6 → lib/cjs}/annotation/decorator_utils.js +25 -7
  6. package/lib/cjs/annotation/decorator_utils.js.map +1 -0
  7. package/{es6 → lib/cjs}/annotation/inject.d.ts +1 -0
  8. package/lib/cjs/annotation/inject.d.ts.map +1 -0
  9. package/{es6 → lib/cjs}/annotation/inject.js +18 -7
  10. package/lib/cjs/annotation/inject.js.map +1 -0
  11. package/{amd → lib/cjs}/annotation/inject_base.d.ts +1 -0
  12. package/lib/cjs/annotation/inject_base.d.ts.map +1 -0
  13. package/{es6 → lib/cjs}/annotation/inject_base.js +2 -0
  14. package/lib/cjs/annotation/inject_base.js.map +1 -0
  15. package/{amd → lib/cjs}/annotation/injectable.d.ts +1 -0
  16. package/lib/cjs/annotation/injectable.d.ts.map +1 -0
  17. package/{es6 → lib/cjs}/annotation/injectable.js +19 -7
  18. package/lib/cjs/annotation/injectable.js.map +1 -0
  19. package/{es → lib/cjs}/annotation/multi_inject.d.ts +1 -0
  20. package/lib/cjs/annotation/multi_inject.d.ts.map +1 -0
  21. package/{es6 → lib/cjs}/annotation/multi_inject.js +18 -7
  22. package/lib/cjs/annotation/multi_inject.js.map +1 -0
  23. package/{amd → lib/cjs}/annotation/named.d.ts +1 -0
  24. package/lib/cjs/annotation/named.d.ts.map +1 -0
  25. package/{es6 → lib/cjs}/annotation/named.js +19 -7
  26. package/lib/cjs/annotation/named.js.map +1 -0
  27. package/{amd → lib/cjs}/annotation/optional.d.ts +1 -0
  28. package/lib/cjs/annotation/optional.d.ts.map +1 -0
  29. package/{es6 → lib/cjs}/annotation/optional.js +18 -7
  30. package/lib/cjs/annotation/optional.js.map +1 -0
  31. package/{amd → lib/cjs}/annotation/post_construct.d.ts +1 -0
  32. package/lib/cjs/annotation/post_construct.d.ts.map +1 -0
  33. package/{es6 → lib/cjs}/annotation/post_construct.js +18 -7
  34. package/lib/cjs/annotation/post_construct.js.map +1 -0
  35. package/{es6 → lib/cjs}/annotation/pre_destroy.d.ts +1 -0
  36. package/lib/cjs/annotation/pre_destroy.d.ts.map +1 -0
  37. package/{es6 → lib/cjs}/annotation/pre_destroy.js +18 -7
  38. package/lib/cjs/annotation/pre_destroy.js.map +1 -0
  39. package/{es → lib/cjs}/annotation/property_event_decorator.d.ts +1 -0
  40. package/lib/cjs/annotation/property_event_decorator.d.ts.map +1 -0
  41. package/{es6 → lib/cjs}/annotation/property_event_decorator.js +1 -0
  42. package/lib/cjs/annotation/property_event_decorator.js.map +1 -0
  43. package/{amd → lib/cjs}/annotation/tagged.d.ts +1 -0
  44. package/lib/cjs/annotation/tagged.d.ts.map +1 -0
  45. package/{es6 → lib/cjs}/annotation/tagged.js +2 -0
  46. package/lib/cjs/annotation/tagged.js.map +1 -0
  47. package/{es6 → lib/cjs}/annotation/target_name.d.ts +1 -0
  48. package/lib/cjs/annotation/target_name.d.ts.map +1 -0
  49. package/{es6 → lib/cjs}/annotation/target_name.js +18 -7
  50. package/lib/cjs/annotation/target_name.js.map +1 -0
  51. package/{es6 → lib/cjs}/annotation/unmanaged.d.ts +1 -0
  52. package/lib/cjs/annotation/unmanaged.d.ts.map +1 -0
  53. package/{es6 → lib/cjs}/annotation/unmanaged.js +18 -7
  54. package/lib/cjs/annotation/unmanaged.js.map +1 -0
  55. package/{es6 → lib/cjs}/bindings/binding.d.ts +1 -0
  56. package/lib/cjs/bindings/binding.d.ts.map +1 -0
  57. package/{es6 → lib/cjs}/bindings/binding.js +29 -0
  58. package/lib/cjs/bindings/binding.js.map +1 -0
  59. package/{amd → lib/cjs}/bindings/binding_count.d.ts +1 -0
  60. package/lib/cjs/bindings/binding_count.d.ts.map +1 -0
  61. package/lib/{bindings → cjs/bindings}/binding_count.js +1 -0
  62. package/lib/cjs/bindings/binding_count.js.map +1 -0
  63. package/{amd → lib/cjs}/constants/error_msgs.d.ts +1 -0
  64. package/lib/cjs/constants/error_msgs.d.ts.map +1 -0
  65. package/{es6 → lib/cjs}/constants/error_msgs.js +2 -0
  66. package/lib/cjs/constants/error_msgs.js.map +1 -0
  67. package/{es → lib/cjs}/constants/literal_types.d.ts +1 -0
  68. package/lib/cjs/constants/literal_types.d.ts.map +1 -0
  69. package/{es6 → lib/cjs}/constants/literal_types.js +4 -0
  70. package/lib/cjs/constants/literal_types.js.map +1 -0
  71. package/{amd → lib/cjs}/constants/metadata_keys.d.ts +1 -0
  72. package/lib/cjs/constants/metadata_keys.d.ts.map +1 -0
  73. package/{es6 → lib/cjs}/constants/metadata_keys.js +13 -0
  74. package/lib/cjs/constants/metadata_keys.js.map +1 -0
  75. package/{es6 → lib/cjs}/container/container.d.ts +3 -0
  76. package/lib/cjs/container/container.d.ts.map +1 -0
  77. package/{es6 → lib/cjs}/container/container.js +157 -147
  78. package/lib/cjs/container/container.js.map +1 -0
  79. package/{amd → lib/cjs}/container/container_module.d.ts +1 -0
  80. package/lib/cjs/container/container_module.d.ts.map +1 -0
  81. package/{es6 → lib/cjs}/container/container_module.js +5 -0
  82. package/lib/cjs/container/container_module.js.map +1 -0
  83. package/{es → lib/cjs}/container/container_snapshot.d.ts +1 -0
  84. package/lib/cjs/container/container_snapshot.d.ts.map +1 -0
  85. package/{es6 → lib/cjs}/container/container_snapshot.js +6 -0
  86. package/lib/cjs/container/container_snapshot.js.map +1 -0
  87. package/{es → lib/cjs}/container/lookup.d.ts +1 -0
  88. package/lib/cjs/container/lookup.d.ts.map +1 -0
  89. package/{es6 → lib/cjs}/container/lookup.js +26 -7
  90. package/lib/cjs/container/lookup.js.map +1 -0
  91. package/{es6 → lib/cjs}/container/module_activation_store.d.ts +3 -2
  92. package/lib/cjs/container/module_activation_store.d.ts.map +1 -0
  93. package/{es6 → lib/cjs}/container/module_activation_store.js +2 -3
  94. package/lib/cjs/container/module_activation_store.js.map +1 -0
  95. package/{amd/inversify.d.ts → lib/cjs/index.d.ts} +2 -0
  96. package/lib/cjs/index.d.ts.map +1 -0
  97. package/{es6/inversify.js → lib/cjs/index.js} +20 -7
  98. package/lib/cjs/index.js.map +1 -0
  99. package/{amd → lib/cjs}/interfaces/interfaces.d.ts +3 -2
  100. package/lib/cjs/interfaces/interfaces.d.ts.map +1 -0
  101. package/lib/{interfaces → cjs/interfaces}/interfaces.js +1 -0
  102. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  103. package/lib/cjs/package.json +3 -0
  104. package/{es6 → lib/cjs}/planning/context.d.ts +1 -0
  105. package/lib/cjs/planning/context.d.ts.map +1 -0
  106. package/{es6 → lib/cjs}/planning/context.js +5 -0
  107. package/lib/cjs/planning/context.js.map +1 -0
  108. package/{es6 → lib/cjs}/planning/metadata.d.ts +1 -0
  109. package/lib/cjs/planning/metadata.d.ts.map +1 -0
  110. package/{es6 → lib/cjs}/planning/metadata.js +20 -7
  111. package/lib/cjs/planning/metadata.js.map +1 -0
  112. package/{es → lib/cjs}/planning/metadata_reader.d.ts +1 -0
  113. package/lib/cjs/planning/metadata_reader.d.ts.map +1 -0
  114. package/{es6 → lib/cjs}/planning/metadata_reader.js +24 -12
  115. package/lib/cjs/planning/metadata_reader.js.map +1 -0
  116. package/{amd → lib/cjs}/planning/plan.d.ts +1 -0
  117. package/lib/cjs/planning/plan.d.ts.map +1 -0
  118. package/{es6 → lib/cjs}/planning/plan.js +3 -0
  119. package/lib/cjs/planning/plan.js.map +1 -0
  120. package/{amd → lib/cjs}/planning/planner.d.ts +1 -0
  121. package/lib/cjs/planning/planner.d.ts.map +1 -0
  122. package/{es6 → lib/cjs}/planning/planner.js +27 -7
  123. package/lib/cjs/planning/planner.js.map +1 -0
  124. package/{amd → lib/cjs}/planning/queryable_string.d.ts +1 -0
  125. package/lib/cjs/planning/queryable_string.d.ts.map +1 -0
  126. package/{es6 → lib/cjs}/planning/queryable_string.js +3 -0
  127. package/lib/cjs/planning/queryable_string.js.map +1 -0
  128. package/{amd → lib/cjs}/planning/reflection_utils.d.ts +1 -0
  129. package/lib/cjs/planning/reflection_utils.d.ts.map +1 -0
  130. package/{es6 → lib/cjs}/planning/reflection_utils.js +25 -8
  131. package/lib/cjs/planning/reflection_utils.js.map +1 -0
  132. package/{amd → lib/cjs}/planning/request.d.ts +1 -0
  133. package/lib/cjs/planning/request.d.ts.map +1 -0
  134. package/{es6 → lib/cjs}/planning/request.js +13 -1
  135. package/lib/cjs/planning/request.js.map +1 -0
  136. package/{es → lib/cjs}/resolution/instantiation.d.ts +1 -0
  137. package/lib/cjs/resolution/instantiation.d.ts.map +1 -0
  138. package/{es6 → lib/cjs}/resolution/instantiation.js +40 -37
  139. package/lib/cjs/resolution/instantiation.js.map +1 -0
  140. package/{amd → lib/cjs}/resolution/resolver.d.ts +1 -0
  141. package/lib/cjs/resolution/resolver.d.ts.map +1 -0
  142. package/{es6 → lib/cjs}/resolution/resolver.js +39 -20
  143. package/lib/cjs/resolution/resolver.js.map +1 -0
  144. package/{amd → lib/cjs}/scope/scope.d.ts +1 -0
  145. package/lib/cjs/scope/scope.d.ts.map +1 -0
  146. package/{es6 → lib/cjs}/scope/scope.js +10 -12
  147. package/lib/cjs/scope/scope.js.map +1 -0
  148. package/{amd → lib/cjs}/syntax/binding_in_syntax.d.ts +1 -0
  149. package/lib/cjs/syntax/binding_in_syntax.d.ts.map +1 -0
  150. package/{es6 → lib/cjs}/syntax/binding_in_syntax.js +2 -0
  151. package/lib/cjs/syntax/binding_in_syntax.js.map +1 -0
  152. package/{es6 → lib/cjs}/syntax/binding_in_when_on_syntax.d.ts +1 -0
  153. package/lib/cjs/syntax/binding_in_when_on_syntax.d.ts.map +1 -0
  154. package/{es6 → lib/cjs}/syntax/binding_in_when_on_syntax.js +5 -0
  155. package/lib/cjs/syntax/binding_in_when_on_syntax.js.map +1 -0
  156. package/{es6 → lib/cjs}/syntax/binding_on_syntax.d.ts +1 -0
  157. package/lib/cjs/syntax/binding_on_syntax.d.ts.map +1 -0
  158. package/{es6 → lib/cjs}/syntax/binding_on_syntax.js +2 -0
  159. package/lib/cjs/syntax/binding_on_syntax.js.map +1 -0
  160. package/{es → lib/cjs}/syntax/binding_to_syntax.d.ts +1 -0
  161. package/lib/cjs/syntax/binding_to_syntax.d.ts.map +1 -0
  162. package/{es6 → lib/cjs}/syntax/binding_to_syntax.js +43 -8
  163. package/lib/cjs/syntax/binding_to_syntax.js.map +1 -0
  164. package/{amd → lib/cjs}/syntax/binding_when_on_syntax.d.ts +1 -0
  165. package/lib/cjs/syntax/binding_when_on_syntax.d.ts.map +1 -0
  166. package/{es6 → lib/cjs}/syntax/binding_when_on_syntax.js +4 -0
  167. package/lib/cjs/syntax/binding_when_on_syntax.js.map +1 -0
  168. package/{es6 → lib/cjs}/syntax/binding_when_syntax.d.ts +1 -0
  169. package/lib/cjs/syntax/binding_when_syntax.d.ts.map +1 -0
  170. package/{es6 → lib/cjs}/syntax/binding_when_syntax.js +5 -1
  171. package/lib/cjs/syntax/binding_when_syntax.js.map +1 -0
  172. package/{amd → lib/cjs}/syntax/constraint_helpers.d.ts +1 -0
  173. package/lib/cjs/syntax/constraint_helpers.d.ts.map +1 -0
  174. package/{es6 → lib/cjs}/syntax/constraint_helpers.js +22 -7
  175. package/lib/cjs/syntax/constraint_helpers.js.map +1 -0
  176. package/{amd → lib/cjs}/utils/async.d.ts +1 -0
  177. package/lib/cjs/utils/async.d.ts.map +1 -0
  178. package/{es6 → lib/cjs}/utils/async.js +1 -0
  179. package/lib/cjs/utils/async.js.map +1 -0
  180. package/{es6 → lib/cjs}/utils/binding_utils.d.ts +1 -0
  181. package/lib/cjs/utils/binding_utils.d.ts.map +1 -0
  182. package/{es6 → lib/cjs}/utils/binding_utils.js +21 -7
  183. package/lib/cjs/utils/binding_utils.js.map +1 -0
  184. package/{es6 → lib/cjs}/utils/clonable.d.ts +1 -0
  185. package/lib/cjs/utils/clonable.d.ts.map +1 -0
  186. package/{es6 → lib/cjs}/utils/clonable.js +1 -0
  187. package/lib/cjs/utils/clonable.js.map +1 -0
  188. package/{amd → lib/cjs}/utils/exceptions.d.ts +1 -0
  189. package/lib/cjs/utils/exceptions.d.ts.map +1 -0
  190. package/{es6 → lib/cjs}/utils/exceptions.js +18 -7
  191. package/lib/cjs/utils/exceptions.js.map +1 -0
  192. package/{es6 → lib/cjs}/utils/factory_type.d.ts +1 -0
  193. package/lib/cjs/utils/factory_type.d.ts.map +1 -0
  194. package/{es6 → lib/cjs}/utils/factory_type.js +1 -0
  195. package/lib/cjs/utils/factory_type.js.map +1 -0
  196. package/{amd → lib/cjs}/utils/id.d.ts +1 -0
  197. package/lib/cjs/utils/id.d.ts.map +1 -0
  198. package/{es6 → lib/cjs}/utils/id.js +1 -0
  199. package/lib/cjs/utils/id.js.map +1 -0
  200. package/{amd → lib/cjs}/utils/js.d.ts +1 -0
  201. package/lib/cjs/utils/js.d.ts.map +1 -0
  202. package/{es6 → lib/cjs}/utils/js.js +1 -0
  203. package/lib/cjs/utils/js.js.map +1 -0
  204. package/{amd → lib/cjs}/utils/serialization.d.ts +1 -0
  205. package/lib/cjs/utils/serialization.d.ts.map +1 -0
  206. package/{es6 → lib/cjs}/utils/serialization.js +23 -7
  207. package/lib/cjs/utils/serialization.js.map +1 -0
  208. package/{es6/interfaces/interfaces.d.ts → lib/esm/index.d.ts} +207 -8
  209. package/lib/esm/index.d.ts.map +1 -0
  210. package/lib/esm/index.js +2 -0
  211. package/lib/esm/index.js.map +1 -0
  212. package/package.json +30 -34
  213. package/amd/annotation/decorator_utils.js +0 -119
  214. package/amd/annotation/inject.d.ts +0 -5
  215. package/amd/annotation/inject.js +0 -31
  216. package/amd/annotation/inject_base.js +0 -16
  217. package/amd/annotation/injectable.js +0 -40
  218. package/amd/annotation/lazy_service_identifier.js +0 -4
  219. package/amd/annotation/multi_inject.d.ts +0 -5
  220. package/amd/annotation/multi_inject.js +0 -31
  221. package/amd/annotation/named.js +0 -32
  222. package/amd/annotation/optional.js +0 -32
  223. package/amd/annotation/post_construct.js +0 -32
  224. package/amd/annotation/pre_destroy.d.ts +0 -4
  225. package/amd/annotation/pre_destroy.js +0 -32
  226. package/amd/annotation/property_event_decorator.d.ts +0 -4
  227. package/amd/annotation/property_event_decorator.js +0 -16
  228. package/amd/annotation/tagged.js +0 -8
  229. package/amd/annotation/target_name.d.ts +0 -3
  230. package/amd/annotation/target_name.js +0 -35
  231. package/amd/annotation/unmanaged.d.ts +0 -3
  232. package/amd/annotation/unmanaged.js +0 -35
  233. package/amd/bindings/binding.d.ts +0 -20
  234. package/amd/bindings/binding.js +0 -40
  235. package/amd/bindings/binding_count.js +0 -11
  236. package/amd/constants/error_msgs.js +0 -75
  237. package/amd/constants/literal_types.d.ts +0 -5
  238. package/amd/constants/literal_types.js +0 -28
  239. package/amd/constants/metadata_keys.js +0 -28
  240. package/amd/container/container.d.ts +0 -73
  241. package/amd/container/container.js +0 -766
  242. package/amd/container/container_module.js +0 -21
  243. package/amd/container/container_snapshot.d.ts +0 -10
  244. package/amd/container/container_snapshot.js +0 -20
  245. package/amd/container/lookup.d.ts +0 -17
  246. package/amd/container/lookup.js +0 -132
  247. package/amd/container/module_activation_store.d.ts +0 -10
  248. package/amd/container/module_activation_store.js +0 -51
  249. package/amd/interfaces/interfaces.js +0 -4
  250. package/amd/inversify.js +0 -57
  251. package/amd/planning/context.d.ts +0 -11
  252. package/amd/planning/context.js +0 -19
  253. package/amd/planning/metadata.d.ts +0 -8
  254. package/amd/planning/metadata.js +0 -45
  255. package/amd/planning/metadata_reader.d.ts +0 -6
  256. package/amd/planning/metadata_reader.js +0 -49
  257. package/amd/planning/plan.js +0 -13
  258. package/amd/planning/planner.js +0 -187
  259. package/amd/planning/queryable_string.js +0 -33
  260. package/amd/planning/reflection_utils.js +0 -55
  261. package/amd/planning/request.js +0 -24
  262. package/amd/planning/target.js +0 -111
  263. package/amd/resolution/instantiation.d.ts +0 -3
  264. package/amd/resolution/instantiation.js +0 -219
  265. package/amd/resolution/resolver.js +0 -234
  266. package/amd/scope/scope.js +0 -93
  267. package/amd/syntax/binding_in_syntax.js +0 -24
  268. package/amd/syntax/binding_in_when_on_syntax.d.ts +0 -29
  269. package/amd/syntax/binding_in_when_on_syntax.js +0 -75
  270. package/amd/syntax/binding_on_syntax.d.ts +0 -8
  271. package/amd/syntax/binding_on_syntax.js +0 -20
  272. package/amd/syntax/binding_to_syntax.d.ts +0 -18
  273. package/amd/syntax/binding_to_syntax.js +0 -116
  274. package/amd/syntax/binding_when_on_syntax.js +0 -65
  275. package/amd/syntax/binding_when_syntax.d.ts +0 -21
  276. package/amd/syntax/binding_when_syntax.js +0 -107
  277. package/amd/syntax/constraint_helpers.js +0 -66
  278. package/amd/utils/async.js +0 -17
  279. package/amd/utils/binding_utils.d.ts +0 -4
  280. package/amd/utils/binding_utils.js +0 -86
  281. package/amd/utils/clonable.d.ts +0 -3
  282. package/amd/utils/clonable.js +0 -11
  283. package/amd/utils/exceptions.js +0 -46
  284. package/amd/utils/factory_type.d.ts +0 -5
  285. package/amd/utils/factory_type.js +0 -11
  286. package/amd/utils/id.js +0 -9
  287. package/amd/utils/js.js +0 -18
  288. package/amd/utils/serialization.js +0 -135
  289. package/es/annotation/decorator_utils.d.ts +0 -16
  290. package/es/annotation/decorator_utils.js +0 -90
  291. package/es/annotation/inject.d.ts +0 -5
  292. package/es/annotation/inject.js +0 -4
  293. package/es/annotation/inject_base.d.ts +0 -4
  294. package/es/annotation/inject_base.js +0 -14
  295. package/es/annotation/injectable.d.ts +0 -2
  296. package/es/annotation/injectable.js +0 -13
  297. package/es/annotation/lazy_service_identifier.js +0 -1
  298. package/es/annotation/multi_inject.js +0 -4
  299. package/es/annotation/named.d.ts +0 -2
  300. package/es/annotation/named.js +0 -7
  301. package/es/annotation/optional.d.ts +0 -2
  302. package/es/annotation/optional.js +0 -7
  303. package/es/annotation/post_construct.d.ts +0 -4
  304. package/es/annotation/post_construct.js +0 -5
  305. package/es/annotation/pre_destroy.d.ts +0 -4
  306. package/es/annotation/pre_destroy.js +0 -5
  307. package/es/annotation/property_event_decorator.js +0 -13
  308. package/es/annotation/tagged.d.ts +0 -2
  309. package/es/annotation/tagged.js +0 -6
  310. package/es/annotation/target_name.d.ts +0 -3
  311. package/es/annotation/target_name.js +0 -10
  312. package/es/annotation/unmanaged.d.ts +0 -3
  313. package/es/annotation/unmanaged.js +0 -10
  314. package/es/bindings/binding.d.ts +0 -20
  315. package/es/bindings/binding.js +0 -37
  316. package/es/bindings/binding_count.d.ts +0 -5
  317. package/es/bindings/binding_count.js +0 -6
  318. package/es/constants/error_msgs.d.ts +0 -30
  319. package/es/constants/error_msgs.js +0 -62
  320. package/es/constants/literal_types.js +0 -21
  321. package/es/constants/metadata_keys.d.ts +0 -13
  322. package/es/constants/metadata_keys.js +0 -23
  323. package/es/container/container.d.ts +0 -73
  324. package/es/container/container.js +0 -750
  325. package/es/container/container_module.d.ts +0 -11
  326. package/es/container/container_module.js +0 -17
  327. package/es/container/container_snapshot.js +0 -15
  328. package/es/container/lookup.js +0 -105
  329. package/es/container/module_activation_store.d.ts +0 -10
  330. package/es/container/module_activation_store.js +0 -47
  331. package/es/interfaces/interfaces.d.ts +0 -269
  332. package/es/interfaces/interfaces.js +0 -1
  333. package/es/inversify.d.ts +0 -24
  334. package/es/inversify.js +0 -2
  335. package/es/planning/context.d.ts +0 -11
  336. package/es/planning/context.js +0 -15
  337. package/es/planning/metadata.d.ts +0 -8
  338. package/es/planning/metadata.js +0 -17
  339. package/es/planning/metadata_reader.js +0 -21
  340. package/es/planning/plan.d.ts +0 -7
  341. package/es/planning/plan.js +0 -8
  342. package/es/planning/planner.d.ts +0 -5
  343. package/es/planning/planner.js +0 -168
  344. package/es/planning/queryable_string.d.ts +0 -10
  345. package/es/planning/queryable_string.js +0 -28
  346. package/es/planning/reflection_utils.d.ts +0 -5
  347. package/es/planning/reflection_utils.js +0 -27
  348. package/es/planning/request.d.ts +0 -14
  349. package/es/planning/request.js +0 -20
  350. package/es/planning/target.js +0 -87
  351. package/es/resolution/instantiation.js +0 -195
  352. package/es/resolution/resolver.d.ts +0 -3
  353. package/es/resolution/resolver.js +0 -214
  354. package/es/scope/scope.d.ts +0 -3
  355. package/es/scope/scope.js +0 -88
  356. package/es/syntax/binding_in_syntax.d.ts +0 -9
  357. package/es/syntax/binding_in_syntax.js +0 -21
  358. package/es/syntax/binding_in_when_on_syntax.d.ts +0 -29
  359. package/es/syntax/binding_in_when_on_syntax.js +0 -73
  360. package/es/syntax/binding_on_syntax.d.ts +0 -8
  361. package/es/syntax/binding_on_syntax.js +0 -16
  362. package/es/syntax/binding_to_syntax.js +0 -91
  363. package/es/syntax/binding_when_on_syntax.d.ts +0 -25
  364. package/es/syntax/binding_when_on_syntax.js +0 -62
  365. package/es/syntax/binding_when_syntax.d.ts +0 -21
  366. package/es/syntax/binding_when_syntax.js +0 -104
  367. package/es/syntax/constraint_helpers.d.ts +0 -6
  368. package/es/syntax/constraint_helpers.js +0 -36
  369. package/es/utils/async.d.ts +0 -3
  370. package/es/utils/async.js +0 -12
  371. package/es/utils/binding_utils.d.ts +0 -4
  372. package/es/utils/binding_utils.js +0 -58
  373. package/es/utils/clonable.d.ts +0 -3
  374. package/es/utils/clonable.js +0 -7
  375. package/es/utils/exceptions.d.ts +0 -2
  376. package/es/utils/exceptions.js +0 -16
  377. package/es/utils/factory_type.d.ts +0 -5
  378. package/es/utils/factory_type.js +0 -6
  379. package/es/utils/id.d.ts +0 -2
  380. package/es/utils/id.js +0 -5
  381. package/es/utils/js.d.ts +0 -1
  382. package/es/utils/js.js +0 -13
  383. package/es/utils/serialization.d.ts +0 -10
  384. package/es/utils/serialization.js +0 -103
  385. package/es6/annotation/decorator_utils.d.ts +0 -16
  386. package/es6/annotation/inject_base.d.ts +0 -4
  387. package/es6/annotation/injectable.d.ts +0 -2
  388. package/es6/annotation/lazy_service_identifier.js +0 -2
  389. package/es6/annotation/multi_inject.d.ts +0 -5
  390. package/es6/annotation/named.d.ts +0 -2
  391. package/es6/annotation/optional.d.ts +0 -2
  392. package/es6/annotation/post_construct.d.ts +0 -4
  393. package/es6/annotation/property_event_decorator.d.ts +0 -4
  394. package/es6/annotation/tagged.d.ts +0 -2
  395. package/es6/bindings/binding_count.d.ts +0 -5
  396. package/es6/bindings/binding_count.js +0 -9
  397. package/es6/constants/error_msgs.d.ts +0 -30
  398. package/es6/constants/literal_types.d.ts +0 -5
  399. package/es6/constants/metadata_keys.d.ts +0 -13
  400. package/es6/container/container_module.d.ts +0 -11
  401. package/es6/container/container_snapshot.d.ts +0 -10
  402. package/es6/container/lookup.d.ts +0 -17
  403. package/es6/interfaces/interfaces.js +0 -2
  404. package/es6/inversify.d.ts +0 -24
  405. package/es6/planning/metadata_reader.d.ts +0 -6
  406. package/es6/planning/plan.d.ts +0 -7
  407. package/es6/planning/planner.d.ts +0 -5
  408. package/es6/planning/queryable_string.d.ts +0 -10
  409. package/es6/planning/reflection_utils.d.ts +0 -5
  410. package/es6/planning/request.d.ts +0 -14
  411. package/es6/planning/target.js +0 -105
  412. package/es6/resolution/instantiation.d.ts +0 -3
  413. package/es6/resolution/resolver.d.ts +0 -3
  414. package/es6/scope/scope.d.ts +0 -3
  415. package/es6/syntax/binding_in_syntax.d.ts +0 -9
  416. package/es6/syntax/binding_to_syntax.d.ts +0 -18
  417. package/es6/syntax/binding_when_on_syntax.d.ts +0 -25
  418. package/es6/syntax/constraint_helpers.d.ts +0 -6
  419. package/es6/utils/async.d.ts +0 -3
  420. package/es6/utils/exceptions.d.ts +0 -2
  421. package/es6/utils/id.d.ts +0 -2
  422. package/es6/utils/js.d.ts +0 -1
  423. package/es6/utils/serialization.d.ts +0 -10
  424. package/lib/annotation/decorator_utils.d.ts +0 -16
  425. package/lib/annotation/decorator_utils.js +0 -118
  426. package/lib/annotation/inject.d.ts +0 -5
  427. package/lib/annotation/inject.js +0 -30
  428. package/lib/annotation/inject_base.d.ts +0 -4
  429. package/lib/annotation/inject_base.js +0 -17
  430. package/lib/annotation/injectable.d.ts +0 -2
  431. package/lib/annotation/injectable.js +0 -38
  432. package/lib/annotation/lazy_service_identifier.d.ts +0 -3
  433. package/lib/annotation/lazy_service_identifier.js +0 -2
  434. package/lib/annotation/multi_inject.d.ts +0 -5
  435. package/lib/annotation/multi_inject.js +0 -30
  436. package/lib/annotation/named.d.ts +0 -2
  437. package/lib/annotation/named.js +0 -32
  438. package/lib/annotation/optional.d.ts +0 -2
  439. package/lib/annotation/optional.js +0 -32
  440. package/lib/annotation/post_construct.d.ts +0 -4
  441. package/lib/annotation/post_construct.js +0 -31
  442. package/lib/annotation/pre_destroy.d.ts +0 -4
  443. package/lib/annotation/pre_destroy.js +0 -31
  444. package/lib/annotation/property_event_decorator.d.ts +0 -4
  445. package/lib/annotation/property_event_decorator.js +0 -15
  446. package/lib/annotation/tagged.d.ts +0 -2
  447. package/lib/annotation/tagged.js +0 -8
  448. package/lib/annotation/target_name.d.ts +0 -3
  449. package/lib/annotation/target_name.js +0 -35
  450. package/lib/annotation/unmanaged.d.ts +0 -3
  451. package/lib/annotation/unmanaged.js +0 -35
  452. package/lib/bindings/binding.d.ts +0 -20
  453. package/lib/bindings/binding.js +0 -40
  454. package/lib/bindings/binding_count.d.ts +0 -5
  455. package/lib/constants/error_msgs.d.ts +0 -30
  456. package/lib/constants/error_msgs.js +0 -73
  457. package/lib/constants/literal_types.d.ts +0 -5
  458. package/lib/constants/literal_types.js +0 -26
  459. package/lib/constants/metadata_keys.d.ts +0 -13
  460. package/lib/constants/metadata_keys.js +0 -26
  461. package/lib/container/container.d.ts +0 -73
  462. package/lib/container/container.js +0 -776
  463. package/lib/container/container_module.d.ts +0 -11
  464. package/lib/container/container_module.js +0 -20
  465. package/lib/container/container_snapshot.d.ts +0 -10
  466. package/lib/container/container_snapshot.js +0 -18
  467. package/lib/container/lookup.d.ts +0 -17
  468. package/lib/container/lookup.js +0 -131
  469. package/lib/container/module_activation_store.d.ts +0 -10
  470. package/lib/container/module_activation_store.js +0 -50
  471. package/lib/interfaces/interfaces.d.ts +0 -269
  472. package/lib/inversify.d.ts +0 -24
  473. package/lib/inversify.js +0 -76
  474. package/lib/planning/context.d.ts +0 -11
  475. package/lib/planning/context.js +0 -18
  476. package/lib/planning/metadata.d.ts +0 -8
  477. package/lib/planning/metadata.js +0 -43
  478. package/lib/planning/metadata_reader.d.ts +0 -6
  479. package/lib/planning/metadata_reader.js +0 -47
  480. package/lib/planning/plan.d.ts +0 -7
  481. package/lib/planning/plan.js +0 -11
  482. package/lib/planning/planner.d.ts +0 -5
  483. package/lib/planning/planner.js +0 -195
  484. package/lib/planning/queryable_string.d.ts +0 -10
  485. package/lib/planning/queryable_string.js +0 -31
  486. package/lib/planning/reflection_utils.d.ts +0 -5
  487. package/lib/planning/reflection_utils.js +0 -55
  488. package/lib/planning/request.d.ts +0 -14
  489. package/lib/planning/request.js +0 -23
  490. package/lib/planning/target.d.ts +0 -23
  491. package/lib/planning/target.js +0 -113
  492. package/lib/resolution/instantiation.d.ts +0 -3
  493. package/lib/resolution/instantiation.js +0 -220
  494. package/lib/resolution/resolver.d.ts +0 -3
  495. package/lib/resolution/resolver.js +0 -239
  496. package/lib/scope/scope.d.ts +0 -3
  497. package/lib/scope/scope.js +0 -93
  498. package/lib/syntax/binding_in_syntax.d.ts +0 -9
  499. package/lib/syntax/binding_in_syntax.js +0 -24
  500. package/lib/syntax/binding_in_when_on_syntax.d.ts +0 -29
  501. package/lib/syntax/binding_in_when_on_syntax.js +0 -76
  502. package/lib/syntax/binding_on_syntax.d.ts +0 -8
  503. package/lib/syntax/binding_on_syntax.js +0 -19
  504. package/lib/syntax/binding_to_syntax.d.ts +0 -18
  505. package/lib/syntax/binding_to_syntax.js +0 -117
  506. package/lib/syntax/binding_when_on_syntax.d.ts +0 -25
  507. package/lib/syntax/binding_when_on_syntax.js +0 -65
  508. package/lib/syntax/binding_when_syntax.d.ts +0 -21
  509. package/lib/syntax/binding_when_syntax.js +0 -107
  510. package/lib/syntax/constraint_helpers.d.ts +0 -6
  511. package/lib/syntax/constraint_helpers.js +0 -65
  512. package/lib/tsconfig.tsbuildinfo +0 -1
  513. package/lib/utils/async.d.ts +0 -3
  514. package/lib/utils/async.js +0 -15
  515. package/lib/utils/binding_utils.d.ts +0 -4
  516. package/lib/utils/binding_utils.js +0 -87
  517. package/lib/utils/clonable.d.ts +0 -3
  518. package/lib/utils/clonable.js +0 -9
  519. package/lib/utils/exceptions.d.ts +0 -2
  520. package/lib/utils/exceptions.js +0 -44
  521. package/lib/utils/factory_type.d.ts +0 -5
  522. package/lib/utils/factory_type.js +0 -9
  523. package/lib/utils/id.d.ts +0 -2
  524. package/lib/utils/id.js +0 -7
  525. package/lib/utils/js.d.ts +0 -1
  526. package/lib/utils/js.js +0 -16
  527. package/lib/utils/serialization.d.ts +0 -10
  528. package/lib/utils/serialization.js +0 -133
  529. /package/{es → lib/esm}/package.json +0 -0
@@ -1,220 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __generator = (this && this.__generator) || function (thisArg, body) {
46
- 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);
47
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
- function verb(n) { return function (v) { return step([n, v]); }; }
49
- function step(op) {
50
- if (f) throw new TypeError("Generator is already executing.");
51
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
- 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;
53
- if (y = 0, t) op = [op[0] & 2, t.value];
54
- switch (op[0]) {
55
- case 0: case 1: t = op; break;
56
- case 4: _.label++; return { value: op[1], done: false };
57
- case 5: _.label++; y = op[1]; op = [0]; continue;
58
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
- default:
60
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
- if (t[2]) _.ops.pop();
65
- _.trys.pop(); continue;
66
- }
67
- op = body.call(thisArg, _);
68
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
- }
71
- };
72
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
74
- if (ar || !(i in from)) {
75
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
76
- ar[i] = from[i];
77
- }
78
- }
79
- return to.concat(ar || Array.prototype.slice.call(from));
80
- };
81
- Object.defineProperty(exports, "__esModule", { value: true });
82
- exports.resolveInstance = resolveInstance;
83
- var error_msgs_1 = require("../constants/error_msgs");
84
- var literal_types_1 = require("../constants/literal_types");
85
- var METADATA_KEY = __importStar(require("../constants/metadata_keys"));
86
- var async_1 = require("../utils/async");
87
- function _resolveRequests(childRequests, resolveRequest) {
88
- return childRequests.reduce(function (resolvedRequests, childRequest) {
89
- var injection = resolveRequest(childRequest);
90
- var targetType = childRequest.target.type;
91
- if (targetType === literal_types_1.TargetTypeEnum.ConstructorArgument) {
92
- resolvedRequests.constructorInjections.push(injection);
93
- }
94
- else {
95
- resolvedRequests.propertyRequests.push(childRequest);
96
- resolvedRequests.propertyInjections.push(injection);
97
- }
98
- if (!resolvedRequests.isAsync) {
99
- resolvedRequests.isAsync = (0, async_1.isPromiseOrContainsPromise)(injection);
100
- }
101
- return resolvedRequests;
102
- }, {
103
- constructorInjections: [],
104
- isAsync: false,
105
- propertyInjections: [],
106
- propertyRequests: [],
107
- });
108
- }
109
- function _createInstance(constr, childRequests, resolveRequest) {
110
- var result;
111
- if (childRequests.length > 0) {
112
- var resolved = _resolveRequests(childRequests, resolveRequest);
113
- var createInstanceWithInjectionsArg = __assign(__assign({}, resolved), { constr: constr });
114
- if (resolved.isAsync) {
115
- result = createInstanceWithInjectionsAsync(createInstanceWithInjectionsArg);
116
- }
117
- else {
118
- result = createInstanceWithInjections(createInstanceWithInjectionsArg);
119
- }
120
- }
121
- else {
122
- result = new constr();
123
- }
124
- return result;
125
- }
126
- function createInstanceWithInjections(args) {
127
- var _a;
128
- var instance = new ((_a = args.constr).bind.apply(_a, __spreadArray([void 0], args.constructorInjections, false)))();
129
- args.propertyRequests.forEach(function (r, index) {
130
- var property = r.target.identifier;
131
- var injection = args.propertyInjections[index];
132
- if (!r.target.isOptional() || injection !== undefined) {
133
- instance[property] = injection;
134
- }
135
- });
136
- return instance;
137
- }
138
- function createInstanceWithInjectionsAsync(args) {
139
- return __awaiter(this, void 0, void 0, function () {
140
- var constructorInjections, propertyInjections;
141
- return __generator(this, function (_a) {
142
- switch (_a.label) {
143
- case 0: return [4, possiblyWaitInjections(args.constructorInjections)];
144
- case 1:
145
- constructorInjections = _a.sent();
146
- return [4, possiblyWaitInjections(args.propertyInjections)];
147
- case 2:
148
- propertyInjections = _a.sent();
149
- return [2, createInstanceWithInjections(__assign(__assign({}, args), { constructorInjections: constructorInjections, propertyInjections: propertyInjections }))];
150
- }
151
- });
152
- });
153
- }
154
- function possiblyWaitInjections(possiblePromiseinjections) {
155
- return __awaiter(this, void 0, void 0, function () {
156
- var injections, _i, possiblePromiseinjections_1, injection;
157
- return __generator(this, function (_a) {
158
- injections = [];
159
- for (_i = 0, possiblePromiseinjections_1 = possiblePromiseinjections; _i < possiblePromiseinjections_1.length; _i++) {
160
- injection = possiblePromiseinjections_1[_i];
161
- if (Array.isArray(injection)) {
162
- injections.push(Promise.all(injection));
163
- }
164
- else {
165
- injections.push(injection);
166
- }
167
- }
168
- return [2, Promise.all(injections)];
169
- });
170
- });
171
- }
172
- function _getInstanceAfterPostConstruct(constr, result) {
173
- var postConstructResult = _postConstruct(constr, result);
174
- if ((0, async_1.isPromise)(postConstructResult)) {
175
- return postConstructResult.then(function () { return result; });
176
- }
177
- else {
178
- return result;
179
- }
180
- }
181
- function _postConstruct(constr, instance) {
182
- var _a, _b;
183
- if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
184
- var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);
185
- try {
186
- return (_b = (_a = instance)[data.value]) === null || _b === void 0 ? void 0 : _b.call(_a);
187
- }
188
- catch (e) {
189
- if (e instanceof Error) {
190
- throw new Error((0, error_msgs_1.POST_CONSTRUCT_ERROR)(constr.name, e.message));
191
- }
192
- }
193
- }
194
- }
195
- function _validateInstanceResolution(binding, constr) {
196
- if (binding.scope !== literal_types_1.BindingScopeEnum.Singleton) {
197
- _throwIfHandlingDeactivation(binding, constr);
198
- }
199
- }
200
- function _throwIfHandlingDeactivation(binding, constr) {
201
- var scopeErrorMessage = "Class cannot be instantiated in ".concat(binding.scope === literal_types_1.BindingScopeEnum.Request ? 'request' : 'transient', " scope.");
202
- if (typeof binding.onDeactivation === 'function') {
203
- throw new Error((0, error_msgs_1.ON_DEACTIVATION_ERROR)(constr.name, scopeErrorMessage));
204
- }
205
- if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constr)) {
206
- throw new Error((0, error_msgs_1.PRE_DESTROY_ERROR)(constr.name, scopeErrorMessage));
207
- }
208
- }
209
- function resolveInstance(binding, constr, childRequests, resolveRequest) {
210
- _validateInstanceResolution(binding, constr);
211
- var result = _createInstance(constr, childRequests, resolveRequest);
212
- if ((0, async_1.isPromise)(result)) {
213
- return result.then(function (resolvedResult) {
214
- return _getInstanceAfterPostConstruct(constr, resolvedResult);
215
- });
216
- }
217
- else {
218
- return _getInstanceAfterPostConstruct(constr, result);
219
- }
220
- }
@@ -1,3 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare function resolve<T>(context: interfaces.Context): T | Promise<T> | (T | Promise<T>)[];
3
- export { resolve };
@@ -1,239 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- 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);
36
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- 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;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
- Object.defineProperty(exports, "__esModule", { value: true });
62
- exports.resolve = resolve;
63
- var ERROR_MSGS = __importStar(require("../constants/error_msgs"));
64
- var literal_types_1 = require("../constants/literal_types");
65
- var planner_1 = require("../planning/planner");
66
- var scope_1 = require("../scope/scope");
67
- var async_1 = require("../utils/async");
68
- var binding_utils_1 = require("../utils/binding_utils");
69
- var exceptions_1 = require("../utils/exceptions");
70
- var instantiation_1 = require("./instantiation");
71
- var _resolveRequest = function (requestScope) {
72
- return function (request) {
73
- request.parentContext.setCurrentRequest(request);
74
- var bindings = request.bindings;
75
- var childRequests = request.childRequests;
76
- var targetIsAnArray = request.target && request.target.isArray();
77
- var targetParentIsNotAnArray = !request.parentRequest ||
78
- !request.parentRequest.target ||
79
- !request.target ||
80
- !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);
81
- if (targetIsAnArray && targetParentIsNotAnArray) {
82
- return childRequests.map(function (childRequest) {
83
- var resolveRequest = _resolveRequest(requestScope);
84
- return resolveRequest(childRequest);
85
- });
86
- }
87
- else {
88
- if (request.target.isOptional() && bindings.length === 0) {
89
- return undefined;
90
- }
91
- var binding = bindings[0];
92
- return _resolveBinding(requestScope, request, binding);
93
- }
94
- };
95
- };
96
- var _resolveFactoryFromBinding = function (binding, context) {
97
- var factoryDetails = (0, binding_utils_1.getFactoryDetails)(binding);
98
- return (0, exceptions_1.tryAndThrowErrorIfStackOverflow)(function () {
99
- return factoryDetails.factory.bind(binding)(context);
100
- }, function () {
101
- return new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryDetails.factoryType, context.currentRequest.serviceIdentifier.toString()));
102
- });
103
- };
104
- var _getResolvedFromBinding = function (requestScope, request, binding) {
105
- var result;
106
- var childRequests = request.childRequests;
107
- (0, binding_utils_1.ensureFullyBound)(binding);
108
- switch (binding.type) {
109
- case literal_types_1.BindingTypeEnum.ConstantValue:
110
- case literal_types_1.BindingTypeEnum.Function:
111
- result = binding.cache;
112
- break;
113
- case literal_types_1.BindingTypeEnum.Constructor:
114
- result = binding.implementationType;
115
- break;
116
- case literal_types_1.BindingTypeEnum.Instance:
117
- result = (0, instantiation_1.resolveInstance)(binding, binding.implementationType, childRequests, _resolveRequest(requestScope));
118
- break;
119
- default:
120
- result = _resolveFactoryFromBinding(binding, request.parentContext);
121
- }
122
- return result;
123
- };
124
- var _resolveInScope = function (requestScope, binding, resolveFromBinding) {
125
- var result = (0, scope_1.tryGetFromScope)(requestScope, binding);
126
- if (result !== null) {
127
- return result;
128
- }
129
- result = resolveFromBinding();
130
- (0, scope_1.saveToScope)(requestScope, binding, result);
131
- return result;
132
- };
133
- var _resolveBinding = function (requestScope, request, binding) {
134
- return _resolveInScope(requestScope, binding, function () {
135
- var result = _getResolvedFromBinding(requestScope, request, binding);
136
- if ((0, async_1.isPromise)(result)) {
137
- result = result.then(function (resolved) {
138
- return _onActivation(request, binding, resolved);
139
- });
140
- }
141
- else {
142
- result = _onActivation(request, binding, result);
143
- }
144
- return result;
145
- });
146
- };
147
- function _onActivation(request, binding, resolved) {
148
- var result = _bindingActivation(request.parentContext, binding, resolved);
149
- var containersIterator = _getContainersIterator(request.parentContext.container);
150
- var container;
151
- var containersIteratorResult = containersIterator.next();
152
- do {
153
- container = containersIteratorResult.value;
154
- var context_1 = request.parentContext;
155
- var serviceIdentifier = request.serviceIdentifier;
156
- var activationsIterator = _getContainerActivationsForService(container, serviceIdentifier);
157
- if ((0, async_1.isPromise)(result)) {
158
- result = _activateContainerAsync(activationsIterator, context_1, result);
159
- }
160
- else {
161
- result = _activateContainer(activationsIterator, context_1, result);
162
- }
163
- containersIteratorResult = containersIterator.next();
164
- } while (containersIteratorResult.done !== true &&
165
- !(0, planner_1.getBindingDictionary)(container).hasKey(request.serviceIdentifier));
166
- return result;
167
- }
168
- var _bindingActivation = function (context, binding, previousResult) {
169
- var result;
170
- if (typeof binding.onActivation === 'function') {
171
- result = binding.onActivation(context, previousResult);
172
- }
173
- else {
174
- result = previousResult;
175
- }
176
- return result;
177
- };
178
- var _activateContainer = function (activationsIterator, context, result) {
179
- var activation = activationsIterator.next();
180
- while (activation.done !== true) {
181
- result = activation.value(context, result);
182
- if ((0, async_1.isPromise)(result)) {
183
- return _activateContainerAsync(activationsIterator, context, result);
184
- }
185
- activation = activationsIterator.next();
186
- }
187
- return result;
188
- };
189
- var _activateContainerAsync = function (activationsIterator, context, resultPromise) { return __awaiter(void 0, void 0, void 0, function () {
190
- var result, activation;
191
- return __generator(this, function (_a) {
192
- switch (_a.label) {
193
- case 0: return [4, resultPromise];
194
- case 1:
195
- result = _a.sent();
196
- activation = activationsIterator.next();
197
- _a.label = 2;
198
- case 2:
199
- if (!(activation.done !== true)) return [3, 4];
200
- return [4, activation.value(context, result)];
201
- case 3:
202
- result = _a.sent();
203
- activation = activationsIterator.next();
204
- return [3, 2];
205
- case 4: return [2, result];
206
- }
207
- });
208
- }); };
209
- var _getContainerActivationsForService = function (container, serviceIdentifier) {
210
- var activations = container._activations;
211
- return activations.hasKey(serviceIdentifier)
212
- ? activations.get(serviceIdentifier).values()
213
- : [].values();
214
- };
215
- var _getContainersIterator = function (container) {
216
- var containersStack = [container];
217
- var parent = container.parent;
218
- while (parent !== null) {
219
- containersStack.push(parent);
220
- parent = parent.parent;
221
- }
222
- var getNextContainer = function () {
223
- var nextContainer = containersStack.pop();
224
- if (nextContainer !== undefined) {
225
- return { done: false, value: nextContainer };
226
- }
227
- else {
228
- return { done: true, value: undefined };
229
- }
230
- };
231
- var containersIterator = {
232
- next: getNextContainer,
233
- };
234
- return containersIterator;
235
- };
236
- function resolve(context) {
237
- var resolveRequestFunction = _resolveRequest(context.plan.rootRequest.requestScope);
238
- return resolveRequestFunction(context.plan.rootRequest);
239
- }
@@ -1,3 +0,0 @@
1
- import type { interfaces } from '../interfaces/interfaces';
2
- export declare const tryGetFromScope: <T>(requestScope: interfaces.RequestScope, binding: interfaces.Binding<T>) => T | Promise<T> | null;
3
- export declare const saveToScope: <T>(requestScope: interfaces.RequestScope, binding: interfaces.Binding<T>, result: T | Promise<T>) => void;
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- 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);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.saveToScope = exports.tryGetFromScope = void 0;
40
- var literal_types_1 = require("../constants/literal_types");
41
- var async_1 = require("../utils/async");
42
- var tryGetFromScope = function (requestScope, binding) {
43
- if (binding.scope === literal_types_1.BindingScopeEnum.Singleton && binding.activated) {
44
- return binding.cache;
45
- }
46
- if (binding.scope === literal_types_1.BindingScopeEnum.Request &&
47
- requestScope.has(binding.id)) {
48
- return requestScope.get(binding.id);
49
- }
50
- return null;
51
- };
52
- exports.tryGetFromScope = tryGetFromScope;
53
- var saveToScope = function (requestScope, binding, result) {
54
- if (binding.scope === literal_types_1.BindingScopeEnum.Singleton) {
55
- _saveToSingletonScope(binding, result);
56
- }
57
- if (binding.scope === literal_types_1.BindingScopeEnum.Request) {
58
- _saveToRequestScope(requestScope, binding, result);
59
- }
60
- };
61
- exports.saveToScope = saveToScope;
62
- var _saveToRequestScope = function (requestScope, binding, result) {
63
- if (!requestScope.has(binding.id)) {
64
- requestScope.set(binding.id, result);
65
- }
66
- };
67
- var _saveToSingletonScope = function (binding, result) {
68
- binding.cache = result;
69
- binding.activated = true;
70
- if ((0, async_1.isPromise)(result)) {
71
- void _saveAsyncResultToSingletonScope(binding, result);
72
- }
73
- };
74
- var _saveAsyncResultToSingletonScope = function (binding, asyncResult) { return __awaiter(void 0, void 0, void 0, function () {
75
- var result, ex_1;
76
- return __generator(this, function (_a) {
77
- switch (_a.label) {
78
- case 0:
79
- _a.trys.push([0, 2, , 3]);
80
- return [4, asyncResult];
81
- case 1:
82
- result = _a.sent();
83
- binding.cache = result;
84
- return [3, 3];
85
- case 2:
86
- ex_1 = _a.sent();
87
- binding.cache = null;
88
- binding.activated = false;
89
- throw ex_1;
90
- case 3: return [2];
91
- }
92
- });
93
- }); };
@@ -1,9 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class BindingInSyntax<T> implements interfaces.BindingInSyntax<T> {
3
- private readonly _binding;
4
- constructor(binding: interfaces.Binding<T>);
5
- inRequestScope(): interfaces.BindingWhenOnSyntax<T>;
6
- inSingletonScope(): interfaces.BindingWhenOnSyntax<T>;
7
- inTransientScope(): interfaces.BindingWhenOnSyntax<T>;
8
- }
9
- export { BindingInSyntax };
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BindingInSyntax = void 0;
4
- var literal_types_1 = require("../constants/literal_types");
5
- var binding_when_on_syntax_1 = require("./binding_when_on_syntax");
6
- var BindingInSyntax = (function () {
7
- function BindingInSyntax(binding) {
8
- this._binding = binding;
9
- }
10
- BindingInSyntax.prototype.inRequestScope = function () {
11
- this._binding.scope = literal_types_1.BindingScopeEnum.Request;
12
- return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
13
- };
14
- BindingInSyntax.prototype.inSingletonScope = function () {
15
- this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;
16
- return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
17
- };
18
- BindingInSyntax.prototype.inTransientScope = function () {
19
- this._binding.scope = literal_types_1.BindingScopeEnum.Transient;
20
- return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
21
- };
22
- return BindingInSyntax;
23
- }());
24
- exports.BindingInSyntax = BindingInSyntax;
@@ -1,29 +0,0 @@
1
- import { interfaces } from '../interfaces/interfaces';
2
- declare class BindingInWhenOnSyntax<T> implements interfaces.BindingInSyntax<T>, interfaces.BindingWhenSyntax<T>, interfaces.BindingOnSyntax<T> {
3
- private readonly _bindingInSyntax;
4
- private readonly _bindingWhenSyntax;
5
- private readonly _bindingOnSyntax;
6
- private readonly _binding;
7
- constructor(binding: interfaces.Binding<T>);
8
- inRequestScope(): interfaces.BindingWhenOnSyntax<T>;
9
- inSingletonScope(): interfaces.BindingWhenOnSyntax<T>;
10
- inTransientScope(): interfaces.BindingWhenOnSyntax<T>;
11
- when(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
12
- whenTargetNamed(name: string): interfaces.BindingOnSyntax<T>;
13
- whenTargetIsDefault(): interfaces.BindingOnSyntax<T>;
14
- whenTargetTagged(tag: string, value: unknown): interfaces.BindingOnSyntax<T>;
15
- whenInjectedInto(parent: NewableFunction | string): interfaces.BindingOnSyntax<T>;
16
- whenParentNamed(name: string): interfaces.BindingOnSyntax<T>;
17
- whenParentTagged(tag: string, value: unknown): interfaces.BindingOnSyntax<T>;
18
- whenAnyAncestorIs(ancestor: NewableFunction | string): interfaces.BindingOnSyntax<T>;
19
- whenNoAncestorIs(ancestor: NewableFunction | string): interfaces.BindingOnSyntax<T>;
20
- whenAnyAncestorNamed(name: string): interfaces.BindingOnSyntax<T>;
21
- whenAnyAncestorTagged(tag: string, value: unknown): interfaces.BindingOnSyntax<T>;
22
- whenNoAncestorNamed(name: string): interfaces.BindingOnSyntax<T>;
23
- whenNoAncestorTagged(tag: string, value: unknown): interfaces.BindingOnSyntax<T>;
24
- whenAnyAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
25
- whenNoAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
26
- onActivation(handler: (context: interfaces.Context, injectable: T) => T | Promise<T>): interfaces.BindingWhenSyntax<T>;
27
- onDeactivation(handler: (injectable: T) => void | Promise<void>): interfaces.BindingWhenSyntax<T>;
28
- }
29
- export { BindingInWhenOnSyntax };