You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

281 lines
13 KiB

2 years ago
  1. //
  2. // Copyright © 2019 Swinject Contributors. All rights reserved.
  3. //
  4. //
  5. // NOTICE:
  6. //
  7. // Resolver.swift is generated from Resolver.erb by ERB.
  8. // Do NOT modify Resolver.swift directly.
  9. // Instead, modify Resolver.erb and run `script/gencode` at the project root directory to generate the code.
  10. //
  11. public protocol Resolver {
  12. /// Retrieves the instance with the specified service type.
  13. ///
  14. /// - Parameter serviceType: The service type to resolve.
  15. ///
  16. /// - Returns: The resolved service type instance, or nil if no service is found.
  17. func resolve<Service>(_ serviceType: Service.Type) -> Service?
  18. /// Retrieves the instance with the specified service type and registration name.
  19. ///
  20. /// - Parameters:
  21. /// - serviceType: The service type to resolve.
  22. /// - name: The registration name.
  23. ///
  24. /// - Returns: The resolved service type instance, or nil if no service with the name is found.
  25. func resolve<Service>(_ serviceType: Service.Type, name: String?) -> Service?
  26. /// Retrieves the instance with the specified service type and 1 argument to the factory closure.
  27. ///
  28. /// - Parameters:
  29. /// - serviceType: The service type to resolve.
  30. /// - argument: 1 argument to pass to the factory closure.
  31. ///
  32. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  33. /// and 1 argument is found.
  34. func resolve<Service, Arg1>(
  35. _ serviceType: Service.Type,
  36. argument: Arg1
  37. ) -> Service?
  38. /// Retrieves the instance with the specified service type, 1 argument to the factory closure and registration name.
  39. ///
  40. /// - Parameters:
  41. /// - serviceType: The service type to resolve.
  42. /// - name: The registration name.
  43. /// - argument: 1 argument to pass to the factory closure.
  44. ///
  45. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  46. /// 1 argument and name is found.
  47. func resolve<Service, Arg1>(
  48. _ serviceType: Service.Type,
  49. name: String?,
  50. argument: Arg1
  51. ) -> Service?
  52. /// Retrieves the instance with the specified service type and list of 2 arguments to the factory closure.
  53. ///
  54. /// - Parameters:
  55. /// - serviceType: The service type to resolve.
  56. /// - arguments: List of 2 arguments to pass to the factory closure.
  57. ///
  58. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  59. /// and list of 2 arguments is found.
  60. func resolve<Service, Arg1, Arg2>(
  61. _ serviceType: Service.Type,
  62. arguments arg1: Arg1, _ arg2: Arg2
  63. ) -> Service?
  64. /// Retrieves the instance with the specified service type, list of 2 arguments to the factory closure and registration name.
  65. ///
  66. /// - Parameters:
  67. /// - serviceType: The service type to resolve.
  68. /// - name: The registration name.
  69. /// - arguments: List of 2 arguments to pass to the factory closure.
  70. ///
  71. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  72. /// list of 2 arguments and name is found.
  73. func resolve<Service, Arg1, Arg2>(
  74. _ serviceType: Service.Type,
  75. name: String?,
  76. arguments arg1: Arg1, _ arg2: Arg2
  77. ) -> Service?
  78. /// Retrieves the instance with the specified service type and list of 3 arguments to the factory closure.
  79. ///
  80. /// - Parameters:
  81. /// - serviceType: The service type to resolve.
  82. /// - arguments: List of 3 arguments to pass to the factory closure.
  83. ///
  84. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  85. /// and list of 3 arguments is found.
  86. func resolve<Service, Arg1, Arg2, Arg3>(
  87. _ serviceType: Service.Type,
  88. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3
  89. ) -> Service?
  90. /// Retrieves the instance with the specified service type, list of 3 arguments to the factory closure and registration name.
  91. ///
  92. /// - Parameters:
  93. /// - serviceType: The service type to resolve.
  94. /// - name: The registration name.
  95. /// - arguments: List of 3 arguments to pass to the factory closure.
  96. ///
  97. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  98. /// list of 3 arguments and name is found.
  99. func resolve<Service, Arg1, Arg2, Arg3>(
  100. _ serviceType: Service.Type,
  101. name: String?,
  102. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3
  103. ) -> Service?
  104. /// Retrieves the instance with the specified service type and list of 4 arguments to the factory closure.
  105. ///
  106. /// - Parameters:
  107. /// - serviceType: The service type to resolve.
  108. /// - arguments: List of 4 arguments to pass to the factory closure.
  109. ///
  110. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  111. /// and list of 4 arguments is found.
  112. func resolve<Service, Arg1, Arg2, Arg3, Arg4>(
  113. _ serviceType: Service.Type,
  114. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4
  115. ) -> Service?
  116. /// Retrieves the instance with the specified service type, list of 4 arguments to the factory closure and registration name.
  117. ///
  118. /// - Parameters:
  119. /// - serviceType: The service type to resolve.
  120. /// - name: The registration name.
  121. /// - arguments: List of 4 arguments to pass to the factory closure.
  122. ///
  123. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  124. /// list of 4 arguments and name is found.
  125. func resolve<Service, Arg1, Arg2, Arg3, Arg4>(
  126. _ serviceType: Service.Type,
  127. name: String?,
  128. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4
  129. ) -> Service?
  130. /// Retrieves the instance with the specified service type and list of 5 arguments to the factory closure.
  131. ///
  132. /// - Parameters:
  133. /// - serviceType: The service type to resolve.
  134. /// - arguments: List of 5 arguments to pass to the factory closure.
  135. ///
  136. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  137. /// and list of 5 arguments is found.
  138. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5>(
  139. _ serviceType: Service.Type,
  140. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5
  141. ) -> Service?
  142. /// Retrieves the instance with the specified service type, list of 5 arguments to the factory closure and registration name.
  143. ///
  144. /// - Parameters:
  145. /// - serviceType: The service type to resolve.
  146. /// - name: The registration name.
  147. /// - arguments: List of 5 arguments to pass to the factory closure.
  148. ///
  149. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  150. /// list of 5 arguments and name is found.
  151. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5>(
  152. _ serviceType: Service.Type,
  153. name: String?,
  154. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5
  155. ) -> Service?
  156. /// Retrieves the instance with the specified service type and list of 6 arguments to the factory closure.
  157. ///
  158. /// - Parameters:
  159. /// - serviceType: The service type to resolve.
  160. /// - arguments: List of 6 arguments to pass to the factory closure.
  161. ///
  162. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  163. /// and list of 6 arguments is found.
  164. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>(
  165. _ serviceType: Service.Type,
  166. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6
  167. ) -> Service?
  168. /// Retrieves the instance with the specified service type, list of 6 arguments to the factory closure and registration name.
  169. ///
  170. /// - Parameters:
  171. /// - serviceType: The service type to resolve.
  172. /// - name: The registration name.
  173. /// - arguments: List of 6 arguments to pass to the factory closure.
  174. ///
  175. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  176. /// list of 6 arguments and name is found.
  177. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>(
  178. _ serviceType: Service.Type,
  179. name: String?,
  180. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6
  181. ) -> Service?
  182. /// Retrieves the instance with the specified service type and list of 7 arguments to the factory closure.
  183. ///
  184. /// - Parameters:
  185. /// - serviceType: The service type to resolve.
  186. /// - arguments: List of 7 arguments to pass to the factory closure.
  187. ///
  188. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  189. /// and list of 7 arguments is found.
  190. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7>(
  191. _ serviceType: Service.Type,
  192. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7
  193. ) -> Service?
  194. /// Retrieves the instance with the specified service type, list of 7 arguments to the factory closure and registration name.
  195. ///
  196. /// - Parameters:
  197. /// - serviceType: The service type to resolve.
  198. /// - name: The registration name.
  199. /// - arguments: List of 7 arguments to pass to the factory closure.
  200. ///
  201. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  202. /// list of 7 arguments and name is found.
  203. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7>(
  204. _ serviceType: Service.Type,
  205. name: String?,
  206. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7
  207. ) -> Service?
  208. /// Retrieves the instance with the specified service type and list of 8 arguments to the factory closure.
  209. ///
  210. /// - Parameters:
  211. /// - serviceType: The service type to resolve.
  212. /// - arguments: List of 8 arguments to pass to the factory closure.
  213. ///
  214. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  215. /// and list of 8 arguments is found.
  216. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>(
  217. _ serviceType: Service.Type,
  218. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8
  219. ) -> Service?
  220. /// Retrieves the instance with the specified service type, list of 8 arguments to the factory closure and registration name.
  221. ///
  222. /// - Parameters:
  223. /// - serviceType: The service type to resolve.
  224. /// - name: The registration name.
  225. /// - arguments: List of 8 arguments to pass to the factory closure.
  226. ///
  227. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  228. /// list of 8 arguments and name is found.
  229. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>(
  230. _ serviceType: Service.Type,
  231. name: String?,
  232. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8
  233. ) -> Service?
  234. /// Retrieves the instance with the specified service type and list of 9 arguments to the factory closure.
  235. ///
  236. /// - Parameters:
  237. /// - serviceType: The service type to resolve.
  238. /// - arguments: List of 9 arguments to pass to the factory closure.
  239. ///
  240. /// - Returns: The resolved service type instance, or nil if no registration for the service type
  241. /// and list of 9 arguments is found.
  242. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9>(
  243. _ serviceType: Service.Type,
  244. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8, _ arg9: Arg9
  245. ) -> Service?
  246. /// Retrieves the instance with the specified service type, list of 9 arguments to the factory closure and registration name.
  247. ///
  248. /// - Parameters:
  249. /// - serviceType: The service type to resolve.
  250. /// - name: The registration name.
  251. /// - arguments: List of 9 arguments to pass to the factory closure.
  252. ///
  253. /// - Returns: The resolved service type instance, or nil if no registration for the service type,
  254. /// list of 9 arguments and name is found.
  255. func resolve<Service, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9>(
  256. _ serviceType: Service.Type,
  257. name: String?,
  258. arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8, _ arg9: Arg9
  259. ) -> Service?
  260. }