-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
71 lines (62 loc) · 1.46 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Type definitions for ./src/index.js
// Project: [LIBRARY_URL_HERE]
// Definitions by: [YOUR_NAME_HERE] <[YOUR_URL_HERE]>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// reducer.!1
/**
* 声明一个接口
*/
declare interface reactStore {
/**
*
*/
key: string;
/**
*
*/
type: string;
}
// useStoreHook.!ret
/**
* 声明一个接口
*/
declare interface Ret {}
// connect.!ret
type Ret = (Comp: any) => connect.RetRet;
declare namespace connect {
// connect.!ret.!ret
type RetRet = (props: any) => boolean;
}
/**
* 全局用的 provider,应用于app.js 或者单个模块的根文件
*/
declare function StoreProvider(props: any);
/**
* 进行事件派发的 hook,应用于 function 组件
* @param key 不同的model名称
*/
declare function useDispatchHook(key: String): void;
/**
* 获取 state 用的 hook,应用于 function 组件
* @param key 不同的model名称
*/
declare function useStateHook(key: String): void;
/**
* 返回state和方法
* {
* user: {id:1,getUser(state,payload){xxxx}}
* }
* @return
*/
declare function useStoreHook(): any;
/**
* 添加属性和方法到组件中,可应用于 function 组件和 class 组件
* @param mapStateToProps state
* @param mapDispatchToProps dispatch派发的方法,包括 reducers 和 effects 里面的方法
* @return
*/
declare function connect(mapStateToProps: any, mapDispatchToProps: any): any;
/**
*
*/
export declare var value: boolean;