[@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\'.'
This commit is contained in:
Li Zhen
2019-05-28 12:52:56 -07:00
committed by Sheetal Nandi
parent 614b83fe75
commit 9e26db59d7
+5 -4
View File
@@ -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 <https://github.com/ali-Kos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.4
import * as React from 'react';
type ReactComponent<P = any, S = any> = React.ComponentClass<P, S>;
interface Util {
getActionType: (action: string) => { namespace: string | null; type: string };
getParam: () => any;
}
interface WrapperConfig {
@@ -25,7 +26,7 @@ interface Action<T = any> {
export interface KosProps<T = any> {
dispatch?: (action: Action<T>) => void;
getParam?: () => string;
getParam?: () => any;
getNamespace?: () => string;
}
@@ -42,7 +43,7 @@ export interface KosModel<T = any> {
asyncs: {
[key: string]: (dispatch?: KosDispatch, getState?: GetKosState<T>, action?: { payload: T }) => void;
};
setup?: (dispatch: KosDispatch, getState: GetKosState<T>) => void;
setup?: (dispatch: KosDispatch, getState: GetKosState<T>, action: { payload: { param: any } }) => void;
getAsync?: (
key: string
) => (dispatch: KosDispatch, getState?: GetKosState) => void;