1 | import Taro from './index'
|
2 |
|
3 | type TaroGetDerivedStateFromProps<P, S> =
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | (nextProps: Readonly<P>, prevState: S) => Partial<S> | null;
|
10 |
|
11 | interface TaroStaticLifecycle<P, S> {
|
12 | getDerivedStateFromProps?: TaroGetDerivedStateFromProps<P, S>;
|
13 | }
|
14 |
|
15 | interface TaroNewLifecycle<P, S, SS> {
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>): SS | null;
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot?: SS): void;
|
31 | }
|
32 |
|
33 | declare module './index' {
|
34 | interface PageNotFoundObject {
|
35 | |
36 |
|
37 |
|
38 | path: string
|
39 |
|
40 | |
41 |
|
42 |
|
43 | query: Record<string, unknown>
|
44 |
|
45 | |
46 |
|
47 |
|
48 | isEntryPage: boolean
|
49 | }
|
50 |
|
51 | interface PageScrollObject {
|
52 | |
53 |
|
54 |
|
55 | scrollTop: number
|
56 | }
|
57 |
|
58 | interface PageResizeObject {
|
59 | size: {
|
60 | windowWidth: number
|
61 | windowHeight: number
|
62 | }
|
63 | }
|
64 |
|
65 | interface ShareAppMessageObject {
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | from?: 'button' | 'menu' | string
|
74 | |
75 |
|
76 |
|
77 |
|
78 |
|
79 | target?: object
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 | webViewUrl?: string
|
86 | }
|
87 |
|
88 | interface ShareAppMessageReturn {
|
89 | |
90 |
|
91 |
|
92 | title?: string
|
93 |
|
94 | |
95 |
|
96 |
|
97 | path?: string
|
98 |
|
99 | |
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | imageUrl?: string
|
108 | }
|
109 |
|
110 | interface TabItemTapObject {
|
111 | |
112 |
|
113 |
|
114 | index: string
|
115 |
|
116 | |
117 |
|
118 |
|
119 | pagePath: string
|
120 |
|
121 | |
122 |
|
123 |
|
124 | text: string
|
125 | }
|
126 |
|
127 | interface AddToFavoritesObject {
|
128 | |
129 |
|
130 |
|
131 | webviewUrl: string
|
132 | }
|
133 |
|
134 | interface AddToFavoritesReturnObject {
|
135 | |
136 |
|
137 |
|
138 | title?: string
|
139 |
|
140 | |
141 |
|
142 |
|
143 | imageUrl?: string
|
144 |
|
145 | |
146 |
|
147 |
|
148 | query?: string
|
149 | }
|
150 |
|
151 | interface ShareTimelineReturnObject {
|
152 | |
153 |
|
154 |
|
155 | title?: string
|
156 |
|
157 | |
158 |
|
159 |
|
160 | query?: string
|
161 |
|
162 | |
163 |
|
164 |
|
165 | imageUrl?: string
|
166 | }
|
167 |
|
168 | type GetDerivedStateFromProps<P, S> = TaroGetDerivedStateFromProps<P, S>
|
169 |
|
170 | type StaticLifecycle<P, S> = TaroStaticLifecycle<P, S>
|
171 |
|
172 | type NewLifecycle<P, S, SS> = TaroNewLifecycle<P, S, SS>
|
173 |
|
174 | interface TaroStatic {
|
175 | PageNotFoundObject: PageNotFoundObject
|
176 | PageScrollObject: PageScrollObject
|
177 | ShareAppMessageObject: ShareAppMessageObject
|
178 | ShareAppMessageReturn: ShareAppMessageReturn
|
179 | TabItemTapObject: TabItemTapObject
|
180 | AddToFavoritesObject: AddToFavoritesObject
|
181 | AddToFavoritesReturnObject: AddToFavoritesReturnObject
|
182 | ShareTimelineReturnObject: ShareTimelineReturnObject
|
183 | }
|
184 | }
|