5
5
StoreEnhancer ,
6
6
Dispatch ,
7
7
Observer ,
8
- ListenerCallback
8
+ ListenerCallback ,
9
+ UnknownIfNonSpecific
9
10
} from './types/store'
10
11
import { Action } from './types/actions'
11
12
import { Reducer } from './types/reducers'
@@ -46,7 +47,7 @@ export function createStore<
46
47
> (
47
48
reducer : Reducer < S , A > ,
48
49
enhancer ?: StoreEnhancer < Ext , StateExt >
49
- ) : Store < S , A , StateExt > & Ext
50
+ ) : Store < S , A , UnknownIfNonSpecific < StateExt > > & Ext
50
51
/**
51
52
* @deprecated
52
53
*
@@ -82,7 +83,7 @@ export function createStore<
82
83
reducer : Reducer < S , A , PreloadedState > ,
83
84
preloadedState ?: PreloadedState | undefined ,
84
85
enhancer ?: StoreEnhancer < Ext , StateExt >
85
- ) : Store < S , A , StateExt > & Ext
86
+ ) : Store < S , A , UnknownIfNonSpecific < StateExt > > & Ext
86
87
export function createStore <
87
88
S ,
88
89
A extends Action ,
@@ -93,7 +94,7 @@ export function createStore<
93
94
reducer : Reducer < S , A , PreloadedState > ,
94
95
preloadedState ?: PreloadedState | StoreEnhancer < Ext , StateExt > | undefined ,
95
96
enhancer ?: StoreEnhancer < Ext , StateExt >
96
- ) : Store < S , A , StateExt > & Ext {
97
+ ) : Store < S , A , UnknownIfNonSpecific < StateExt > > & Ext {
97
98
if ( typeof reducer !== 'function' ) {
98
99
throw new Error (
99
100
`Expected the root reducer to be a function. Instead, received: '${ kindOf (
@@ -432,7 +433,7 @@ export function legacy_createStore<
432
433
> (
433
434
reducer : Reducer < S , A > ,
434
435
enhancer ?: StoreEnhancer < Ext , StateExt >
435
- ) : Store < S , A , StateExt > & Ext
436
+ ) : Store < S , A , UnknownIfNonSpecific < StateExt > > & Ext
436
437
/**
437
438
* Creates a Redux store that holds the state tree.
438
439
*
@@ -473,7 +474,7 @@ export function legacy_createStore<
473
474
reducer : Reducer < S , A , PreloadedState > ,
474
475
preloadedState ?: PreloadedState | undefined ,
475
476
enhancer ?: StoreEnhancer < Ext , StateExt >
476
- ) : Store < S , A , StateExt > & Ext
477
+ ) : Store < S , A , UnknownIfNonSpecific < StateExt > > & Ext
477
478
export function legacy_createStore <
478
479
S ,
479
480
A extends Action ,
@@ -484,6 +485,6 @@ export function legacy_createStore<
484
485
reducer : Reducer < S , A > ,
485
486
preloadedState ?: PreloadedState | StoreEnhancer < Ext , StateExt > | undefined ,
486
487
enhancer ?: StoreEnhancer < Ext , StateExt >
487
- ) : Store < S , A , StateExt > & Ext {
488
+ ) : Store < S , A , UnknownIfNonSpecific < StateExt > > & Ext {
488
489
return createStore ( reducer , preloadedState as any , enhancer )
489
490
}
0 commit comments