2019-07-30 10:35:09 +00:00
|
|
|
/**
|
|
|
|
* @type P: Type of payload
|
|
|
|
* @type C: Type of callback
|
|
|
|
*/
|
|
|
|
export type Dispatch = <P = any, C = (payload: P) => void>(action: {
|
|
|
|
type: string;
|
|
|
|
payload?: P;
|
|
|
|
callback?: C;
|
|
|
|
[key: string]: any;
|
|
|
|
}) => any;
|
|
|
|
|
|
|
|
export interface DefaultProps {
|
|
|
|
dispatch: Dispatch
|
|
|
|
}
|
|
|
|
|
2019-07-27 09:52:23 +00:00
|
|
|
export interface DefaultModel<T> {
|
|
|
|
namespace: string,
|
|
|
|
state: T,
|
|
|
|
effects?: { [key: string]: Function },
|
|
|
|
reducers?: { [key: string]: Function },
|
|
|
|
subscriptions?: { [key: string]: Function },
|
|
|
|
}
|