From af4b21cd0ec2a6ea0af230c2d1260b241802f1ed Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 11 Aug 2022 13:06:55 -0700 Subject: [PATCH] Add missing constraints --- lib/utils/object.ts | 2 +- lib/utils/plugins.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils/object.ts b/lib/utils/object.ts index 50633d8b..ee83e0c4 100644 --- a/lib/utils/object.ts +++ b/lib/utils/object.ts @@ -17,6 +17,6 @@ export function keys(imm: Record) { return keysCache.get(imm); } -export const ObjectTypedKeys = (obj: T) => { +export const ObjectTypedKeys = (obj: T) => { return Object.keys(obj) as (keyof T)[]; }; diff --git a/lib/utils/plugins.ts b/lib/utils/plugins.ts index c0cb60b7..59bec887 100644 --- a/lib/utils/plugins.ts +++ b/lib/utils/plugins.ts @@ -91,7 +91,7 @@ function exposeDecorated

>( }; } -function getDecorated

(parent: React.ComponentType

, name: string): React.ComponentClass

{ +function getDecorated

>(parent: React.ComponentType

, name: string): React.ComponentClass

{ if (!decorated[name]) { let class_ = exposeDecorated(parent); (class_ as any).displayName = `_exposeDecorated(${name})`; @@ -136,7 +136,7 @@ function getDecorated

(parent: React.ComponentType

, name: string): React.Co // for each component, we return a higher-order component // that wraps with the higher-order components // exposed by plugins -export function decorate

( +export function decorate

>( Component_: React.ComponentType

, name: string ): React.ComponentClass { @@ -450,7 +450,7 @@ export function getTabProps>(tab: any, parentP // connects + decorates a class // plugins can override mapToState, dispatchToProps // and the class gets decorated (proxied) -export function connect( +export function connect( stateFn: (state: HyperState) => stateProps, dispatchFn: (dispatch: HyperDispatch) => dispatchProps, c: any,