semantic error TS4023 Exported variable 'increment' has or is using name 'TypeGetter' from external module
import { createAction } from 'typesafe-actions'
export const increment = createAction('INCREMENT')
export const add = createAction('ADD', (amount: number) => ({
type: 'ADD',
payload: amount,
}))
import { getType } from 'typesafe-actions';
import { RootState, RootAction } from '@src/redux/store';
import { add } from './actions';
export type CounterState = {
readonly value: number,
};
export const initialState: CounterState = {
value: 0,
};
export const CounterReducer = (state: RootState, action: RootAction) => {
switch (action.type) {
case getType(add):
return state.counters.value + action.payload;
default:
return state.counters.value
}
}
import { createStore, Store, combineReducers } from 'redux';
import * as CounterActions from '@src/redux/actions';
import { CounterReducer, CounterState } from '@src/redux/reducer';
import { $call } from 'utility-types';
export const returnsOfActions = [
...Object.values(CounterActions)
].map($call);
export type AppAction = typeof returnsOfActions[number];
export type RootAction =
| AppAction
export interface StoreEnhancerState { }
export interface RootState extends StoreEnhancerState {
counters: CounterState;
}
const rootReducer = combineReducers<RootState>({
counters: CounterReducer
});
function configureStore(initialState?: RootState) {
return createStore(
rootReducer,
initialState!
);
}
const store: Store<RootState> = configureStore();
export { store };
import { TypeGetter } from 'typesafe-actions'
export { TypeGetter }
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": [
"dom",
"es2016",
"es2017.object"
],
"jsx": "react",
"declaration": false,
"outDir": "./lib",
"importHelpers": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmitHelpers": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"baseUrl": "./",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": ["node"],
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true
}