Fix errors reported after upgrading to typescript 4.2

Removed ResizeObserver polyfill and added explicit type declaration for HyperState
This commit is contained in:
Labhansh Agrawal 2021-03-05 00:58:40 +05:30 committed by Benjamin Staneck
parent 4a91e03a78
commit e554e1db4f
5 changed files with 12 additions and 23 deletions

View file

@ -11,7 +11,6 @@ import Color from 'color';
import terms from '../terms';
import processClipboard from '../utils/paste';
import SearchBox from './searchBox';
import ResizeObserver from 'resize-observer-polyfill';
import {TermProps} from '../hyper';
import {ObjectTypedKeys} from '../utils/object';

7
lib/hyper.d.ts vendored
View file

@ -162,8 +162,11 @@ export type hyperPlugin = {
reduceUI: IUiReducer;
};
import rootReducer from './reducers/index';
export type HyperState = ReturnType<typeof rootReducer>;
export type HyperState = {
ui: Immutable<uiState>;
sessions: Immutable<sessionState>;
termGroups: Immutable<ITermState>;
};
import {UIActions} from './constants/ui';
import {ConfigActions} from './constants/config';

View file

@ -1,18 +1,11 @@
import {combineReducers} from 'redux';
import ui, {IUiReducer} from './ui';
import sessions, {ISessionReducer} from './sessions';
import termGroups, {ITermGroupReducer} from './term-groups';
import {HyperActions} from '../hyper';
import {combineReducers, Reducer} from 'redux';
import ui from './ui';
import sessions from './sessions';
import termGroups from './term-groups';
import {HyperActions, HyperState} from '../hyper';
export default combineReducers<
{
ui: ReturnType<IUiReducer>;
sessions: ReturnType<ISessionReducer>;
termGroups: ReturnType<ITermGroupReducer>;
},
HyperActions
>({
export default combineReducers({
ui,
sessions,
termGroups
});
}) as Reducer<HyperState, HyperActions>;

View file

@ -116,7 +116,6 @@
"prettier": "2.2.1",
"proxyquire": "2.1.3",
"redux-devtools-extension": "2.13.8",
"resize-observer-polyfill": "1.5.1",
"spectron": "13.0.0",
"style-loader": "2.0.0",
"terser": "5.6.0",

View file

@ -6480,11 +6480,6 @@ reselect@4.0.0:
resolved "https://registry.npmjs.org/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7"
integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA==
resize-observer-polyfill@1.5.1:
version "1.5.1"
resolved "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
resolve-alpn@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c"