-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make TS type defs conform to redux 4
- Loading branch information
1 parent
d6eefa8
commit ed1126d
Showing
13 changed files
with
155 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ module.exports = { | |
env: { | ||
es6: true, | ||
}, | ||
rules: { | ||
'@typescript-eslint/ban-types': 0, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
import type { Reducer, Middleware } from 'redux' | ||
export declare const defaultCreateReducer: (<S>( | ||
initialState: S, | ||
reducers: { | ||
[actionType: string]: Reducer<S> | ||
} | ||
) => Reducer<S>) & | ||
(<S>(reducers: { [actionType: string]: Reducer<S> }) => Reducer<S>) | ||
export declare function defaultComposeReducers<S>( | ||
...reducers: Array<Reducer<S>> | ||
): Reducer<S> | ||
export declare function defaultCreateMiddleware(middlewares: { | ||
[actionType: string]: Middleware | ||
}): Middleware | ||
export declare function defaultComposeMiddleware( | ||
...middlewares: Array<Middleware> | ||
): Middleware | ||
import type { Reducer, Middleware, AnyAction, Dispatch } from 'redux' | ||
export declare const defaultCreateReducer: { | ||
<S = any, A extends AnyAction = AnyAction>( | ||
initialState: S, | ||
reducers: Record<string, Reducer<S, A>> | ||
): Reducer<S, A> | ||
<S = any, A extends AnyAction = AnyAction>( | ||
reducers: Record<string, Reducer<S, A>> | ||
): Reducer<S, A> | ||
} | ||
export declare function defaultComposeReducers< | ||
S = any, | ||
A extends AnyAction = AnyAction | ||
>(...reducers: Array<Reducer<S, A>>): Reducer<S, A> | ||
export declare function defaultCreateMiddleware< | ||
DispatchExt = {}, | ||
S = any, | ||
D extends Dispatch = Dispatch | ||
>( | ||
middlewares: Record<string, Middleware<DispatchExt, S, D>> | ||
): Middleware<DispatchExt, S, D> | ||
export declare function defaultComposeMiddleware< | ||
DispatchExt = {}, | ||
S = any, | ||
D extends Dispatch = Dispatch | ||
>( | ||
...middlewares: Array<Middleware<DispatchExt, S, D>> | ||
): Middleware<DispatchExt, S, D> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import type { Middleware } from 'redux' | ||
import type { Dispatch, Middleware } from 'redux' | ||
import type { Features, ComposeMiddleware } from './index' | ||
export default function featureMiddlewaresMiddleware<S>(config?: { | ||
getFeatures?: (state: S) => Features<S> | null | undefined | ||
composeMiddleware?: ComposeMiddleware | ||
}): Middleware | ||
export default function featureMiddlewaresMiddleware< | ||
DispatchExt = {}, | ||
S = any, | ||
D extends Dispatch = Dispatch | ||
>(config?: { | ||
getFeatures?: (state: S) => Features<S, Parameters<D>[0]> | null | undefined | ||
composeMiddleware?: ComposeMiddleware<DispatchExt, S, D> | ||
}): Middleware<DispatchExt, S, D> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import type { Reducer } from 'redux' | ||
import type { AnyAction, Reducer } from 'redux' | ||
import type { Features, ComposeReducers } from './index' | ||
export default function featureReducersReducer<S>(config?: { | ||
getFeatures?: (state: S) => Features<S> | null | undefined | ||
composeReducers?: ComposeReducers<S> | ||
}): Reducer<S> | ||
export default function featureReducersReducer< | ||
S = any, | ||
A extends AnyAction = AnyAction | ||
>(config?: { | ||
getFeatures?: (state: S) => Features<S, A> | null | undefined | ||
composeReducers?: ComposeReducers<S, A> | ||
}): Reducer<S, A> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import type { Reducer } from 'redux' | ||
import type { FeatureStates, CreateReducer } from './index' | ||
export default function featureStatesReducer(config?: { | ||
createReducer?: CreateReducer<FeatureStates> | ||
}): Reducer<FeatureStates> | ||
import type { FeatureStates, CreateReducer, FeatureAction } from './index' | ||
export default function featureStatesReducer< | ||
S extends FeatureStates = FeatureStates, | ||
A extends FeatureAction = FeatureAction | ||
>(config?: { createReducer?: CreateReducer<S, A> }): Reducer<S, A> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import type { Reducer } from 'redux' | ||
import type { AnyAction, Dispatch, Reducer } from 'redux' | ||
import type { Features, CreateReducer } from './index' | ||
export default function featuresReducer<S>(config?: { | ||
createReducer?: CreateReducer<Features<S>> | ||
}): Reducer<Features<S>> | ||
export default function featuresReducer< | ||
S = any, | ||
A extends AnyAction = AnyAction, | ||
D extends Dispatch = Dispatch<A> | ||
>(config?: { | ||
createReducer?: CreateReducer<Features<S, A>> | ||
}): Reducer<Features<S, A, D>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import type { Features, FeatureStates } from './index' | ||
import type { Middleware } from 'redux' | ||
export default function loadFeatureMiddleware<S>(config?: { | ||
getFeatures?: (state: S) => Features<S> | null | undefined | ||
import type { Dispatch, Middleware } from 'redux' | ||
export default function loadFeatureMiddleware< | ||
DispatchExt = {}, | ||
S = any, | ||
D extends Dispatch = Dispatch | ||
>(config?: { | ||
getFeatures?: ( | ||
state: S | ||
) => Features<S, Parameters<D>[0], D> | null | undefined | ||
getFeatureStates?: (state: S) => FeatureStates | null | undefined | ||
createMiddleware?: (middlewares: { | ||
[actionType: string]: Middleware | ||
}) => Middleware | ||
}): Middleware | ||
createMiddleware?: ( | ||
middlewares: Record<string, Middleware<DispatchExt, S, D>> | ||
) => Middleware<DispatchExt, S, D> | ||
}): Middleware<DispatchExt, S, D> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"extends": "./node_modules/@jcoreio/toolchain-typescript/tsconfig.json", | ||
"include": ["./src"], | ||
"exclude": ["node_modules"] | ||
"exclude": ["node_modules"], | ||
"compilerOptions": { | ||
"skipLibCheck": false | ||
} | ||
} |