Fit more scenarios for @types/kos-core package (#34546)

* Update definition 'KosModel.asyncs'

* Fix a type bug

* Fit the new features

* Update action type
This commit is contained in:
Li Zhen
2019-04-17 16:58:37 -07:00
committed by Armando Aguirre
parent 7c72ecac37
commit 10aca63078
+2 -2
View File
@@ -20,7 +20,7 @@ interface WrapperConfig {
interface Action<T = any> {
type: string;
payload?: Partial<T>;
payload?: Partial<T> & { [x: string]: any };
}
export interface KosProps<T = any> {
@@ -40,7 +40,7 @@ export interface KosModel<T = any> {
[key: string]: (state: T, { payload }: { payload: T }) => void;
};
asyncs: {
[key: string]: (dispatch: KosDispatch, getState: GetKosState<T>, action: Action) => void;
[key: string]: (dispatch?: KosDispatch, getState?: GetKosState<T>, action?: { payload: T }) => void;
};
setup?: (dispatch: KosDispatch, getState: GetKosState<T>) => void;
getAsync?: (