mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
[@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:
Vendored
+5
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user