From 9e26db59d7ff09216f14d71dab4864ccb18af3fb Mon Sep 17 00:00:00 2001 From: Li Zhen Date: Wed, 29 May 2019 03:52:57 +0800 Subject: [PATCH] [@types/kos-core] Update definitions to fit the latest version (#35648) * Update definition 'KosModel.asyncs' * Fix a type bug * Fit the new features * Update action type * Update definitions to fit new version. * Format as lint * Fix 'Bash exited with code \'1\'.' --- types/kos-core/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/kos-core/index.d.ts b/types/kos-core/index.d.ts index b73f9d3980..97771b779a 100644 --- a/types/kos-core/index.d.ts +++ b/types/kos-core/index.d.ts @@ -1,14 +1,15 @@ -// Type definitions for kos-core 0.4 +// Type definitions for kos-core 0.6 // Project: https://github.com/ali-Kos/Kos // Definitions by: alibaba ali-Kos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.4 import * as React from 'react'; type ReactComponent

= React.ComponentClass; interface Util { getActionType: (action: string) => { namespace: string | null; type: string }; + getParam: () => any; } interface WrapperConfig { @@ -25,7 +26,7 @@ interface Action { export interface KosProps { dispatch?: (action: Action) => void; - getParam?: () => string; + getParam?: () => any; getNamespace?: () => string; } @@ -42,7 +43,7 @@ export interface KosModel { asyncs: { [key: string]: (dispatch?: KosDispatch, getState?: GetKosState, action?: { payload: T }) => void; }; - setup?: (dispatch: KosDispatch, getState: GetKosState) => void; + setup?: (dispatch: KosDispatch, getState: GetKosState, action: { payload: { param: any } }) => void; getAsync?: ( key: string ) => (dispatch: KosDispatch, getState?: GetKosState) => void;