diff --git a/lib/containers/hyper.tsx b/lib/containers/hyper.tsx index 5fd406187ea3..4ee96c4d9ad7 100644 --- a/lib/containers/hyper.tsx +++ b/lib/containers/hyper.tsx @@ -73,7 +73,7 @@ const Hyper = forwardRef((props, ref) => { window.rpc.on('term selectAll', handleSelectAll); }, []); - const onTermsRef = (_terms: Terms) => { + const onTermsRef = (_terms: Terms | null) => { terms.current = _terms; window.focusActiveTerm = (uid?: string) => { if (uid) { diff --git a/lib/utils/plugins.ts b/lib/utils/plugins.ts index d2e145406462..460cee2f2b0b 100644 --- a/lib/utils/plugins.ts +++ b/lib/utils/plugins.ts @@ -222,7 +222,7 @@ const clearModulesCache = () => { const getPluginName = (path: string) => pathModule.basename(path); const getPluginVersion = (path: string): string | null => { - let version = null; + let version: string | null = null; try { version = window.require(pathModule.resolve(path, 'package.json')).version as string; } catch (err) { @@ -460,9 +460,12 @@ export function connect( c: null | undefined, d: ConnectOptions = {} ) { - return (Class: ComponentType, name: keyof typeof connectors) => { - return reduxConnect( - (state) => { + return

>( + Class: ComponentType

, + name: keyof typeof connectors + ) => { + return reduxConnect( + (state: HyperState) => { let ret = stateFn(state); connectors[name].state.forEach((fn) => { let ret_; @@ -488,7 +491,7 @@ export function connect( }); return ret; }, - (dispatch) => { + (dispatch: HyperDispatch) => { let ret = dispatchFn(dispatch); connectors[name].dispatch.forEach((fn) => { let ret_; @@ -519,7 +522,7 @@ export function connect( }, c, d - )(decorate(Class, name)); + )(decorate(Class, name) as any) as ComponentType

; }; }