@@ -25,15 +25,38 @@ import {
25
25
* @template Ext Dispatch signature added by a middleware.
26
26
* @template S The type of the state supported by a middleware.
27
27
*/
28
- export default function applyMiddleware <
29
- S = any ,
30
- M extends Middleware = Middleware
31
- > (
32
- ...middlewares : M [ ]
33
- ) : StoreEnhancer <
34
- M extends Middleware < any , any , infer D > ? { dispatch : D } : never ,
35
- S
36
- > {
28
+ export default function applyMiddleware ( ) : StoreEnhancer < { dispatch : { } } , { } >
29
+ export default function applyMiddleware < Ext1 , S > (
30
+ middleware1 : Middleware < Ext1 , S , any >
31
+ ) : StoreEnhancer < { dispatch : Ext1 } , S >
32
+ export default function applyMiddleware < Ext1 , Ext2 , S > (
33
+ middleware1 : Middleware < Ext1 , S , any > ,
34
+ middleware2 : Middleware < Ext2 , S , any >
35
+ ) : StoreEnhancer < { dispatch : Ext1 & Ext2 } , S >
36
+ export default function applyMiddleware < Ext1 , Ext2 , Ext3 , S > (
37
+ middleware1 : Middleware < Ext1 , S , any > ,
38
+ middleware2 : Middleware < Ext2 , S , any > ,
39
+ middleware3 : Middleware < Ext3 , S , any >
40
+ ) : StoreEnhancer < { dispatch : Ext1 & Ext2 & Ext3 } , S >
41
+ export default function applyMiddleware < Ext1 , Ext2 , Ext3 , Ext4 , S > (
42
+ middleware1 : Middleware < Ext1 , S , any > ,
43
+ middleware2 : Middleware < Ext2 , S , any > ,
44
+ middleware3 : Middleware < Ext3 , S , any > ,
45
+ middleware4 : Middleware < Ext4 , S , any >
46
+ ) : StoreEnhancer < { dispatch : Ext1 & Ext2 & Ext3 & Ext4 } , S >
47
+ export default function applyMiddleware < Ext1 , Ext2 , Ext3 , Ext4 , Ext5 , S > (
48
+ middleware1 : Middleware < Ext1 , S , any > ,
49
+ middleware2 : Middleware < Ext2 , S , any > ,
50
+ middleware3 : Middleware < Ext3 , S , any > ,
51
+ middleware4 : Middleware < Ext4 , S , any > ,
52
+ middleware5 : Middleware < Ext5 , S , any >
53
+ ) : StoreEnhancer < { dispatch : Ext1 & Ext2 & Ext3 & Ext4 & Ext5 } , S >
54
+ export default function applyMiddleware < Ext , S = any > (
55
+ ...middlewares : Middleware < any , S , any > [ ]
56
+ ) : StoreEnhancer < { dispatch : Ext } , S >
57
+ export default function applyMiddleware < S > (
58
+ ...middlewares : Middleware [ ]
59
+ ) : StoreEnhancer < any , S > {
37
60
return ( createStore : StoreEnhancerStoreCreator < any > ) => (
38
61
reducer ,
39
62
...args : any [ ]
0 commit comments