index.d.ts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. export as namespace Reselect;
  2. export type Selector<S, R> = (state: S) => R;
  3. export type OutputSelector<S, R, C> = Selector<S, R> & {
  4. resultFunc: C;
  5. recomputations: () => number;
  6. resetRecomputations: () => number;
  7. }
  8. export type ParametricSelector<S, P, R> = (state: S, props: P, ...args: any[]) => R;
  9. export type OutputParametricSelector<S, P, R, C> = ParametricSelector<S, P, R> & {
  10. resultFunc: C;
  11. recomputations: () => number;
  12. resetRecomputations: () => number;
  13. }
  14. /* one selector */
  15. export function createSelector<S, R1, T>(
  16. selector: Selector<S, R1>,
  17. combiner: (res: R1) => T,
  18. ): OutputSelector<S, T, (res: R1) => T>;
  19. export function createSelector<S, P, R1, T>(
  20. selector: ParametricSelector<S, P, R1>,
  21. combiner: (res: R1) => T,
  22. ): OutputParametricSelector<S, P, T, (res: R1) => T>;
  23. /* two selectors */
  24. export function createSelector<S, R1, R2, T>(
  25. selector1: Selector<S, R1>,
  26. selector2: Selector<S, R2>,
  27. combiner: (res1: R1, res2: R2) => T,
  28. ): OutputSelector<S, T, (res1: R1, res2: R2) => T>;
  29. export function createSelector<S, P, R1, R2, T>(
  30. selector1: ParametricSelector<S, P, R1>,
  31. selector2: ParametricSelector<S, P, R2>,
  32. combiner: (res1: R1, res2: R2) => T,
  33. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2) => T>;
  34. /* three selectors */
  35. export function createSelector<S, R1, R2, R3, T>(
  36. selector1: Selector<S, R1>,
  37. selector2: Selector<S, R2>,
  38. selector3: Selector<S, R3>,
  39. combiner: (res1: R1, res2: R2, res3: R3) => T,
  40. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3) => T>;
  41. export function createSelector<S, P, R1, R2, R3, T>(
  42. selector1: ParametricSelector<S, P, R1>,
  43. selector2: ParametricSelector<S, P, R2>,
  44. selector3: ParametricSelector<S, P, R3>,
  45. combiner: (res1: R1, res2: R2, res3: R3) => T,
  46. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3) => T>;
  47. /* four selectors */
  48. export function createSelector<S, R1, R2, R3, R4, T>(
  49. selector1: Selector<S, R1>,
  50. selector2: Selector<S, R2>,
  51. selector3: Selector<S, R3>,
  52. selector4: Selector<S, R4>,
  53. combiner: (res1: R1, res2: R2, res3: R3, res4: R4) => T,
  54. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4) => T>;
  55. export function createSelector<S, P, R1, R2, R3, R4, T>(
  56. selector1: ParametricSelector<S, P, R1>,
  57. selector2: ParametricSelector<S, P, R2>,
  58. selector3: ParametricSelector<S, P, R3>,
  59. selector4: ParametricSelector<S, P, R4>,
  60. combiner: (res1: R1, res2: R2, res3: R3, res4: R4) => T,
  61. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4) => T>;
  62. /* five selectors */
  63. export function createSelector<S, R1, R2, R3, R4, R5, T>(
  64. selector1: Selector<S, R1>,
  65. selector2: Selector<S, R2>,
  66. selector3: Selector<S, R3>,
  67. selector4: Selector<S, R4>,
  68. selector5: Selector<S, R5>,
  69. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T,
  70. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T>;
  71. export function createSelector<S, P, R1, R2, R3, R4, R5, T>(
  72. selector1: ParametricSelector<S, P, R1>,
  73. selector2: ParametricSelector<S, P, R2>,
  74. selector3: ParametricSelector<S, P, R3>,
  75. selector4: ParametricSelector<S, P, R4>,
  76. selector5: ParametricSelector<S, P, R5>,
  77. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T,
  78. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T>;
  79. /* six selectors */
  80. export function createSelector<S, R1, R2, R3, R4, R5, R6, T>(
  81. selector1: Selector<S, R1>,
  82. selector2: Selector<S, R2>,
  83. selector3: Selector<S, R3>,
  84. selector4: Selector<S, R4>,
  85. selector5: Selector<S, R5>,
  86. selector6: Selector<S, R6>,
  87. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T,
  88. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T>;
  89. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, T>(
  90. selector1: ParametricSelector<S, P, R1>,
  91. selector2: ParametricSelector<S, P, R2>,
  92. selector3: ParametricSelector<S, P, R3>,
  93. selector4: ParametricSelector<S, P, R4>,
  94. selector5: ParametricSelector<S, P, R5>,
  95. selector6: ParametricSelector<S, P, R6>,
  96. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T,
  97. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T>;
  98. /* seven selectors */
  99. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, T>(
  100. selector1: Selector<S, R1>,
  101. selector2: Selector<S, R2>,
  102. selector3: Selector<S, R3>,
  103. selector4: Selector<S, R4>,
  104. selector5: Selector<S, R5>,
  105. selector6: Selector<S, R6>,
  106. selector7: Selector<S, R7>,
  107. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  108. res7: R7) => T,
  109. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  110. res7: R7) => T>;
  111. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, T>(
  112. selector1: ParametricSelector<S, P, R1>,
  113. selector2: ParametricSelector<S, P, R2>,
  114. selector3: ParametricSelector<S, P, R3>,
  115. selector4: ParametricSelector<S, P, R4>,
  116. selector5: ParametricSelector<S, P, R5>,
  117. selector6: ParametricSelector<S, P, R6>,
  118. selector7: ParametricSelector<S, P, R7>,
  119. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  120. res7: R7) => T,
  121. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  122. res7: R7) => T>;
  123. /* eight selectors */
  124. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, T>(
  125. selector1: Selector<S, R1>,
  126. selector2: Selector<S, R2>,
  127. selector3: Selector<S, R3>,
  128. selector4: Selector<S, R4>,
  129. selector5: Selector<S, R5>,
  130. selector6: Selector<S, R6>,
  131. selector7: Selector<S, R7>,
  132. selector8: Selector<S, R8>,
  133. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  134. res7: R7, res8: R8) => T,
  135. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  136. res7: R7, res8: R8) => T>;
  137. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, T>(
  138. selector1: ParametricSelector<S, P, R1>,
  139. selector2: ParametricSelector<S, P, R2>,
  140. selector3: ParametricSelector<S, P, R3>,
  141. selector4: ParametricSelector<S, P, R4>,
  142. selector5: ParametricSelector<S, P, R5>,
  143. selector6: ParametricSelector<S, P, R6>,
  144. selector7: ParametricSelector<S, P, R7>,
  145. selector8: ParametricSelector<S, P, R8>,
  146. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  147. res7: R7, res8: R8) => T,
  148. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  149. res7: R7, res8: R8) => T>;
  150. /* nine selectors */
  151. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, T>(
  152. selector1: Selector<S, R1>,
  153. selector2: Selector<S, R2>,
  154. selector3: Selector<S, R3>,
  155. selector4: Selector<S, R4>,
  156. selector5: Selector<S, R5>,
  157. selector6: Selector<S, R6>,
  158. selector7: Selector<S, R7>,
  159. selector8: Selector<S, R8>,
  160. selector9: Selector<S, R9>,
  161. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  162. res7: R7, res8: R8, res9: R9) => T,
  163. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  164. res7: R7, res8: R8, res9: R9) => T>;
  165. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, T>(
  166. selector1: ParametricSelector<S, P, R1>,
  167. selector2: ParametricSelector<S, P, R2>,
  168. selector3: ParametricSelector<S, P, R3>,
  169. selector4: ParametricSelector<S, P, R4>,
  170. selector5: ParametricSelector<S, P, R5>,
  171. selector6: ParametricSelector<S, P, R6>,
  172. selector7: ParametricSelector<S, P, R7>,
  173. selector8: ParametricSelector<S, P, R8>,
  174. selector9: ParametricSelector<S, P, R9>,
  175. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  176. res7: R7, res8: R8, res9: R9) => T,
  177. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  178. res7: R7, res8: R8, res9: R9) => T>;
  179. /* ten selectors */
  180. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, T>(
  181. selector1: Selector<S, R1>,
  182. selector2: Selector<S, R2>,
  183. selector3: Selector<S, R3>,
  184. selector4: Selector<S, R4>,
  185. selector5: Selector<S, R5>,
  186. selector6: Selector<S, R6>,
  187. selector7: Selector<S, R7>,
  188. selector8: Selector<S, R8>,
  189. selector9: Selector<S, R9>,
  190. selector10: Selector<S, R10>,
  191. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  192. res7: R7, res8: R8, res9: R9, res10: R10) => T,
  193. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  194. res7: R7, res8: R8, res9: R9, res10: R10) => T>;
  195. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, T>(
  196. selector1: ParametricSelector<S, P, R1>,
  197. selector2: ParametricSelector<S, P, R2>,
  198. selector3: ParametricSelector<S, P, R3>,
  199. selector4: ParametricSelector<S, P, R4>,
  200. selector5: ParametricSelector<S, P, R5>,
  201. selector6: ParametricSelector<S, P, R6>,
  202. selector7: ParametricSelector<S, P, R7>,
  203. selector8: ParametricSelector<S, P, R8>,
  204. selector9: ParametricSelector<S, P, R9>,
  205. selector10: ParametricSelector<S, P, R10>,
  206. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  207. res7: R7, res8: R8, res9: R9, res10: R10) => T,
  208. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  209. res7: R7, res8: R8, res9: R9, res10: R10) => T>;
  210. /* eleven selectors */
  211. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, T>(
  212. selector1: Selector<S, R1>,
  213. selector2: Selector<S, R2>,
  214. selector3: Selector<S, R3>,
  215. selector4: Selector<S, R4>,
  216. selector5: Selector<S, R5>,
  217. selector6: Selector<S, R6>,
  218. selector7: Selector<S, R7>,
  219. selector8: Selector<S, R8>,
  220. selector9: Selector<S, R9>,
  221. selector10: Selector<S, R10>,
  222. selector11: Selector<S, R11>,
  223. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  224. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T,
  225. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  226. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T>;
  227. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, T>(
  228. selector1: ParametricSelector<S, P, R1>,
  229. selector2: ParametricSelector<S, P, R2>,
  230. selector3: ParametricSelector<S, P, R3>,
  231. selector4: ParametricSelector<S, P, R4>,
  232. selector5: ParametricSelector<S, P, R5>,
  233. selector6: ParametricSelector<S, P, R6>,
  234. selector7: ParametricSelector<S, P, R7>,
  235. selector8: ParametricSelector<S, P, R8>,
  236. selector9: ParametricSelector<S, P, R9>,
  237. selector10: ParametricSelector<S, P, R10>,
  238. selector11: ParametricSelector<S, P, R11>,
  239. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  240. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T,
  241. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  242. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T>;
  243. /* twelve selectors */
  244. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, T>(
  245. selector1: Selector<S, R1>,
  246. selector2: Selector<S, R2>,
  247. selector3: Selector<S, R3>,
  248. selector4: Selector<S, R4>,
  249. selector5: Selector<S, R5>,
  250. selector6: Selector<S, R6>,
  251. selector7: Selector<S, R7>,
  252. selector8: Selector<S, R8>,
  253. selector9: Selector<S, R9>,
  254. selector10: Selector<S, R10>,
  255. selector11: Selector<S, R11>,
  256. selector12: Selector<S, R12>,
  257. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  258. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T,
  259. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  260. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T>;
  261. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, T>(
  262. selector1: ParametricSelector<S, P, R1>,
  263. selector2: ParametricSelector<S, P, R2>,
  264. selector3: ParametricSelector<S, P, R3>,
  265. selector4: ParametricSelector<S, P, R4>,
  266. selector5: ParametricSelector<S, P, R5>,
  267. selector6: ParametricSelector<S, P, R6>,
  268. selector7: ParametricSelector<S, P, R7>,
  269. selector8: ParametricSelector<S, P, R8>,
  270. selector9: ParametricSelector<S, P, R9>,
  271. selector10: ParametricSelector<S, P, R10>,
  272. selector11: ParametricSelector<S, P, R11>,
  273. selector12: ParametricSelector<S, P, R12>,
  274. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  275. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T,
  276. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  277. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T>;
  278. /* array argument */
  279. /* one selector */
  280. export function createSelector<S, R1, T>(
  281. selectors: [Selector<S, R1>],
  282. combiner: (res: R1) => T,
  283. ): OutputSelector<S, T, (res: R1) => T>;
  284. export function createSelector<S, P, R1, T>(
  285. selectors: [ParametricSelector<S, P, R1>],
  286. combiner: (res: R1) => T,
  287. ): OutputParametricSelector<S, P, T, (res: R1) => T>;
  288. /* two selectors */
  289. export function createSelector<S, R1, R2, T>(
  290. selectors: [Selector<S, R1>,
  291. Selector<S, R2>],
  292. combiner: (res1: R1, res2: R2) => T,
  293. ): OutputSelector<S, T, (res1: R1, res2: R2) => T>;
  294. export function createSelector<S, P, R1, R2, T>(
  295. selectors: [ParametricSelector<S, P, R1>,
  296. ParametricSelector<S, P, R2>],
  297. combiner: (res1: R1, res2: R2) => T,
  298. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2) => T>;
  299. /* three selectors */
  300. export function createSelector<S, R1, R2, R3, T>(
  301. selectors: [Selector<S, R1>,
  302. Selector<S, R2>,
  303. Selector<S, R3>],
  304. combiner: (res1: R1, res2: R2, res3: R3) => T,
  305. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3) => T>;
  306. export function createSelector<S, P, R1, R2, R3, T>(
  307. selectors: [ParametricSelector<S, P, R1>,
  308. ParametricSelector<S, P, R2>,
  309. ParametricSelector<S, P, R3>],
  310. combiner: (res1: R1, res2: R2, res3: R3) => T,
  311. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3) => T>;
  312. /* four selectors */
  313. export function createSelector<S, R1, R2, R3, R4, T>(
  314. selectors: [Selector<S, R1>,
  315. Selector<S, R2>,
  316. Selector<S, R3>,
  317. Selector<S, R4>],
  318. combiner: (res1: R1, res2: R2, res3: R3, res4: R4) => T,
  319. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4) => T>;
  320. export function createSelector<S, P, R1, R2, R3, R4, T>(
  321. selectors: [ParametricSelector<S, P, R1>,
  322. ParametricSelector<S, P, R2>,
  323. ParametricSelector<S, P, R3>,
  324. ParametricSelector<S, P, R4>],
  325. combiner: (res1: R1, res2: R2, res3: R3, res4: R4) => T,
  326. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4) => T>;
  327. /* five selectors */
  328. export function createSelector<S, R1, R2, R3, R4, R5, T>(
  329. selectors: [Selector<S, R1>,
  330. Selector<S, R2>,
  331. Selector<S, R3>,
  332. Selector<S, R4>,
  333. Selector<S, R5>],
  334. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T,
  335. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T>;
  336. export function createSelector<S, P, R1, R2, R3, R4, R5, T>(
  337. selectors: [ParametricSelector<S, P, R1>,
  338. ParametricSelector<S, P, R2>,
  339. ParametricSelector<S, P, R3>,
  340. ParametricSelector<S, P, R4>,
  341. ParametricSelector<S, P, R5>],
  342. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T,
  343. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5) => T>;
  344. /* six selectors */
  345. export function createSelector<S, R1, R2, R3, R4, R5, R6, T>(
  346. selectors: [Selector<S, R1>,
  347. Selector<S, R2>,
  348. Selector<S, R3>,
  349. Selector<S, R4>,
  350. Selector<S, R5>,
  351. Selector<S, R6>],
  352. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T,
  353. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T>;
  354. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, T>(
  355. selectors: [ParametricSelector<S, P, R1>,
  356. ParametricSelector<S, P, R2>,
  357. ParametricSelector<S, P, R3>,
  358. ParametricSelector<S, P, R4>,
  359. ParametricSelector<S, P, R5>,
  360. ParametricSelector<S, P, R6>],
  361. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T,
  362. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6) => T>;
  363. /* seven selectors */
  364. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, T>(
  365. selectors: [Selector<S, R1>,
  366. Selector<S, R2>,
  367. Selector<S, R3>,
  368. Selector<S, R4>,
  369. Selector<S, R5>,
  370. Selector<S, R6>,
  371. Selector<S, R7>],
  372. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  373. res7: R7) => T,
  374. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  375. res7: R7) => T>;
  376. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, T>(
  377. selectors: [ParametricSelector<S, P, R1>,
  378. ParametricSelector<S, P, R2>,
  379. ParametricSelector<S, P, R3>,
  380. ParametricSelector<S, P, R4>,
  381. ParametricSelector<S, P, R5>,
  382. ParametricSelector<S, P, R6>,
  383. ParametricSelector<S, P, R7>],
  384. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  385. res7: R7) => T,
  386. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  387. res7: R7) => T>;
  388. /* eight selectors */
  389. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, T>(
  390. selectors: [Selector<S, R1>,
  391. Selector<S, R2>,
  392. Selector<S, R3>,
  393. Selector<S, R4>,
  394. Selector<S, R5>,
  395. Selector<S, R6>,
  396. Selector<S, R7>,
  397. Selector<S, R8>],
  398. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  399. res7: R7, res8: R8) => T,
  400. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  401. res7: R7, res8: R8) => T>;
  402. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, T>(
  403. selectors: [ParametricSelector<S, P, R1>,
  404. ParametricSelector<S, P, R2>,
  405. ParametricSelector<S, P, R3>,
  406. ParametricSelector<S, P, R4>,
  407. ParametricSelector<S, P, R5>,
  408. ParametricSelector<S, P, R6>,
  409. ParametricSelector<S, P, R7>,
  410. ParametricSelector<S, P, R8>],
  411. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  412. res7: R7, res8: R8) => T,
  413. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  414. res7: R7, res8: R8) => T>;
  415. /* nine selectors */
  416. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, T>(
  417. selectors: [Selector<S, R1>,
  418. Selector<S, R2>,
  419. Selector<S, R3>,
  420. Selector<S, R4>,
  421. Selector<S, R5>,
  422. Selector<S, R6>,
  423. Selector<S, R7>,
  424. Selector<S, R8>,
  425. Selector<S, R9>],
  426. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  427. res7: R7, res8: R8, res9: R9) => T,
  428. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  429. res7: R7, res8: R8, res9: R9) => T>;
  430. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, T>(
  431. selectors: [ParametricSelector<S, P, R1>,
  432. ParametricSelector<S, P, R2>,
  433. ParametricSelector<S, P, R3>,
  434. ParametricSelector<S, P, R4>,
  435. ParametricSelector<S, P, R5>,
  436. ParametricSelector<S, P, R6>,
  437. ParametricSelector<S, P, R7>,
  438. ParametricSelector<S, P, R8>,
  439. ParametricSelector<S, P, R9>],
  440. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  441. res7: R7, res8: R8, res9: R9) => T,
  442. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  443. res7: R7, res8: R8, res9: R9) => T>;
  444. /* ten selectors */
  445. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, T>(
  446. selectors: [Selector<S, R1>,
  447. Selector<S, R2>,
  448. Selector<S, R3>,
  449. Selector<S, R4>,
  450. Selector<S, R5>,
  451. Selector<S, R6>,
  452. Selector<S, R7>,
  453. Selector<S, R8>,
  454. Selector<S, R9>,
  455. Selector<S, R10>],
  456. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  457. res7: R7, res8: R8, res9: R9, res10: R10) => T,
  458. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  459. res7: R7, res8: R8, res9: R9, res10: R10) => T>;
  460. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, T>(
  461. selectors: [ParametricSelector<S, P, R1>,
  462. ParametricSelector<S, P, R2>,
  463. ParametricSelector<S, P, R3>,
  464. ParametricSelector<S, P, R4>,
  465. ParametricSelector<S, P, R5>,
  466. ParametricSelector<S, P, R6>,
  467. ParametricSelector<S, P, R7>,
  468. ParametricSelector<S, P, R8>,
  469. ParametricSelector<S, P, R9>,
  470. ParametricSelector<S, P, R10>],
  471. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  472. res7: R7, res8: R8, res9: R9, res10: R10) => T,
  473. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  474. res7: R7, res8: R8, res9: R9, res10: R10) => T>;
  475. /* eleven selectors */
  476. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, T>(
  477. selectors: [Selector<S, R1>,
  478. Selector<S, R2>,
  479. Selector<S, R3>,
  480. Selector<S, R4>,
  481. Selector<S, R5>,
  482. Selector<S, R6>,
  483. Selector<S, R7>,
  484. Selector<S, R8>,
  485. Selector<S, R9>,
  486. Selector<S, R10>,
  487. Selector<S, R11>],
  488. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  489. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T,
  490. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  491. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T>;
  492. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, T>(
  493. selectors: [ParametricSelector<S, P, R1>,
  494. ParametricSelector<S, P, R2>,
  495. ParametricSelector<S, P, R3>,
  496. ParametricSelector<S, P, R4>,
  497. ParametricSelector<S, P, R5>,
  498. ParametricSelector<S, P, R6>,
  499. ParametricSelector<S, P, R7>,
  500. ParametricSelector<S, P, R8>,
  501. ParametricSelector<S, P, R9>,
  502. ParametricSelector<S, P, R10>,
  503. ParametricSelector<S, P, R11>],
  504. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  505. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T,
  506. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  507. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11) => T>;
  508. /* twelve selectors */
  509. export function createSelector<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, T>(
  510. selectors: [Selector<S, R1>,
  511. Selector<S, R2>,
  512. Selector<S, R3>,
  513. Selector<S, R4>,
  514. Selector<S, R5>,
  515. Selector<S, R6>,
  516. Selector<S, R7>,
  517. Selector<S, R8>,
  518. Selector<S, R9>,
  519. Selector<S, R10>,
  520. Selector<S, R11>,
  521. Selector<S, R12>],
  522. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  523. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T,
  524. ): OutputSelector<S, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  525. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T>;
  526. export function createSelector<S, P, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, T>(
  527. selectors: [ParametricSelector<S, P, R1>,
  528. ParametricSelector<S, P, R2>,
  529. ParametricSelector<S, P, R3>,
  530. ParametricSelector<S, P, R4>,
  531. ParametricSelector<S, P, R5>,
  532. ParametricSelector<S, P, R6>,
  533. ParametricSelector<S, P, R7>,
  534. ParametricSelector<S, P, R8>,
  535. ParametricSelector<S, P, R9>,
  536. ParametricSelector<S, P, R10>,
  537. ParametricSelector<S, P, R11>,
  538. ParametricSelector<S, P, R12>],
  539. combiner: (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  540. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T,
  541. ): OutputParametricSelector<S, P, T, (res1: R1, res2: R2, res3: R3, res4: R4, res5: R5, res6: R6,
  542. res7: R7, res8: R8, res9: R9, res10: R10, res11: R11, res12: R12) => T>;
  543. export function defaultMemoize<F extends Function>(
  544. func: F, equalityCheck?: <T>(a: T, b: T, index: number) => boolean,
  545. ): F;
  546. export function createSelectorCreator(
  547. memoize: <F extends Function>(func: F) => F,
  548. ): typeof createSelector;
  549. export function createSelectorCreator<O1>(
  550. memoize: <F extends Function>(func: F,
  551. option1: O1) => F,
  552. option1: O1,
  553. ): typeof createSelector;
  554. export function createSelectorCreator<O1, O2>(
  555. memoize: <F extends Function>(func: F,
  556. option1: O1,
  557. option2: O2) => F,
  558. option1: O1,
  559. option2: O2,
  560. ): typeof createSelector;
  561. export function createSelectorCreator<O1, O2, O3>(
  562. memoize: <F extends Function>(func: F,
  563. option1: O1,
  564. option2: O2,
  565. option3: O3,
  566. ...rest: any[]) => F,
  567. option1: O1,
  568. option2: O2,
  569. option3: O3,
  570. ...rest: any[],
  571. ): typeof createSelector;
  572. export function createStructuredSelector<S, T>(
  573. selectors: {[K in keyof T]: Selector<S, T[K]>},
  574. selectorCreator?: typeof createSelector,
  575. ): Selector<S, T>;
  576. export function createStructuredSelector<S, P, T>(
  577. selectors: {[K in keyof T]: ParametricSelector<S, P, T[K]>},
  578. selectorCreator?: typeof createSelector,
  579. ): ParametricSelector<S, P, T>;