@pixui-dev/pxw 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/bin/pxw.js +199 -199
  2. package/bin/wpbuild.js +10 -10
  3. package/config/default.conf +20 -20
  4. package/config/devops.js +372 -361
  5. package/config/h5es.js +10 -10
  6. package/config/index.html +183 -181
  7. package/config/pfbs.js +245 -245
  8. package/config/util.js +140 -140
  9. package/config/webpack.js +325 -309
  10. package/lib/assets/check.html +62 -62
  11. package/lib/assets/preact.js +4354 -4354
  12. package/lib/check/main.less +62 -62
  13. package/lib/check/main.tsx +41 -41
  14. package/lib/check/tool.js +3 -3
  15. package/lib/check/util.tsx +110 -110
  16. package/lib/grpc-web/dist/ChunkParser.js +117 -117
  17. package/lib/grpc-web/dist/Code.js +58 -58
  18. package/lib/grpc-web/dist/client.js +299 -299
  19. package/lib/grpc-web/dist/debug.js +16 -16
  20. package/lib/grpc-web/dist/detach.js +7 -7
  21. package/lib/grpc-web/dist/index.js +29 -29
  22. package/lib/grpc-web/dist/invoke.js +32 -32
  23. package/lib/grpc-web/dist/message.js +3 -3
  24. package/lib/grpc-web/dist/metadata.js +5 -5
  25. package/lib/grpc-web/dist/service.js +3 -3
  26. package/lib/grpc-web/dist/transports/Transport.js +15 -15
  27. package/lib/grpc-web/dist/transports/http/fetch.js +117 -117
  28. package/lib/grpc-web/dist/transports/http/http.js +15 -15
  29. package/lib/grpc-web/dist/transports/http/xhr.js +136 -136
  30. package/lib/grpc-web/dist/transports/http/xhrUtil.js +36 -36
  31. package/lib/grpc-web/dist/transports/websocket/websocket.js +95 -95
  32. package/lib/grpc-web/dist/typings/ChunkParser.d.ts +17 -17
  33. package/lib/grpc-web/dist/typings/Code.d.ts +20 -20
  34. package/lib/grpc-web/dist/typings/client.d.ts +25 -25
  35. package/lib/grpc-web/dist/typings/debug.d.ts +1 -1
  36. package/lib/grpc-web/dist/typings/detach.d.ts +1 -1
  37. package/lib/grpc-web/dist/typings/index.d.ts +45 -45
  38. package/lib/grpc-web/dist/typings/invoke.d.ts +20 -20
  39. package/lib/grpc-web/dist/typings/message.d.ts +8 -8
  40. package/lib/grpc-web/dist/typings/metadata.d.ts +2 -2
  41. package/lib/grpc-web/dist/typings/service.d.ts +16 -16
  42. package/lib/grpc-web/dist/typings/transports/Transport.d.ts +22 -22
  43. package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +6 -6
  44. package/lib/grpc-web/dist/typings/transports/http/http.d.ts +5 -5
  45. package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +27 -27
  46. package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +3 -3
  47. package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +2 -2
  48. package/lib/grpc-web/dist/typings/unary.d.ts +23 -23
  49. package/lib/grpc-web/dist/typings/util.d.ts +2 -2
  50. package/lib/grpc-web/dist/unary.js +44 -44
  51. package/lib/grpc-web/dist/util.js +11 -11
  52. package/lib/grpcTransport/PixHttp2Transport.ts +107 -107
  53. package/lib/grpcTransport/PixLuaTransport.ts +82 -82
  54. package/lib/h5es-types/v1.9.2/h5es.d.ts +1698 -1698
  55. package/lib/h5es-types/v3.5.0/h5es.d.ts +1788 -1788
  56. package/lib/pi_component/tinyList/tinyList.js +483 -483
  57. package/lib/pi_component/tinyList/tinyList.tsx +517 -517
  58. package/lib/preact-router.js +395 -395
  59. package/lib/preact.js +4355 -4355
  60. package/lib/preact.tq.js +4385 -4385
  61. package/lib/react-window/src/FixedSizeGrid.js +172 -172
  62. package/lib/react-window/src/FixedSizeList.js +91 -91
  63. package/lib/react-window/src/VariableSizeGrid.js +329 -329
  64. package/lib/react-window/src/VariableSizeList.js +231 -231
  65. package/lib/react-window/src/__tests__/FixedSizeGrid.js +942 -942
  66. package/lib/react-window/src/__tests__/FixedSizeList.js +749 -749
  67. package/lib/react-window/src/__tests__/VariableSizeGrid.js +598 -598
  68. package/lib/react-window/src/__tests__/VariableSizeList.js +345 -345
  69. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +912 -912
  70. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +568 -568
  71. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +542 -542
  72. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +331 -331
  73. package/lib/react-window/src/__tests__/areEqual.js +28 -28
  74. package/lib/react-window/src/__tests__/shouldComponentUpdate.js +32 -32
  75. package/lib/react-window/src/areEqual.js +13 -13
  76. package/lib/react-window/src/createGridComponent.js +657 -657
  77. package/lib/react-window/src/createListComponent.js +574 -574
  78. package/lib/react-window/src/domHelpers.js +69 -69
  79. package/lib/react-window/src/index.js +9 -9
  80. package/lib/react-window/src/shallowDiffers.js +17 -17
  81. package/lib/react-window/src/shouldComponentUpdate.js +11 -11
  82. package/lib/react-window/src/test.js.flow +382 -382
  83. package/lib/react-window/src/timer.js +36 -36
  84. package/lib/types/dom.ts +17 -17
  85. package/lib/types/ext.d.ts +81 -81
  86. package/lib/types/{css.d.ts → preact/css.d.ts} +7476 -7476
  87. package/lib/types/{preact.d.ts → preact/index.d.ts} +340 -340
  88. package/lib/types/{internal.d.ts → preact/internal.d.ts} +94 -94
  89. package/lib/types/{jsx.d.ts → preact/jsx.d.ts} +309 -309
  90. package/lib/types/preact-router/index.d.ts +85 -0
  91. package/package.json +113 -113
  92. package/scripts/pack.js +40 -40
  93. package/scripts/postinstall.js +11 -11
  94. package/scripts/run-pxw.js +12 -12
  95. package/tsconfig.json +30 -30
@@ -1,382 +1,382 @@
1
- // @flow
2
-
3
- import * as React from 'react';
4
- import {
5
- FixedSizeList,
6
- VariableSizeList,
7
- FixedSizeGrid,
8
- VariableSizeGrid,
9
- } from './';
10
-
11
- type ItemData = {|
12
- num: number,
13
- str: string,
14
- |};
15
-
16
- const assertVoid = (value: void) => {};
17
- const assertEmpty = (value: empty) => {};
18
- const assertNumber = (value: number) => {};
19
- const assertString = (value: string) => {};
20
- const assertCustomType = (value: ItemData) => {};
21
-
22
- /* FixedSizeList */
23
-
24
- {
25
- const Item = ({ index, style }) => {
26
- (index: number);
27
- (style: Object);
28
- return null;
29
- };
30
- <FixedSizeList width={0} height={0} itemSize={0} itemCount={0}>
31
- {Item}
32
- </FixedSizeList>;
33
- }
34
-
35
- {
36
- const Item = ({ data }) => {
37
- assertNumber(data);
38
- // $FlowFixMe number is passed to FixedSizeList
39
- assertString(data);
40
- return null;
41
- };
42
- const itemKey = (index, data) => {
43
- assertNumber(data);
44
- // $FlowFixMe expected
45
- assertString(data);
46
- return index;
47
- };
48
- <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemData={1} itemKey={itemKey}>
49
- {Item}
50
- </FixedSizeList>;
51
- }
52
-
53
- {
54
- const Item = ({ data }) => {
55
- assertCustomType(data);
56
- // $FlowFixMe ItemData is passed to FixedSizeList
57
- assertString(data);
58
- return null;
59
- };
60
- const itemKey = (index, data) => {
61
- assertCustomType(data);
62
- // $FlowFixMe expected
63
- assertString(data);
64
- return index;
65
- };
66
- <FixedSizeList
67
- width={0}
68
- height={0}
69
- itemSize={0}
70
- itemCount={0}
71
- itemData={{
72
- num: 123,
73
- str: 'abc',
74
- }}
75
- itemKey={itemKey}
76
- >
77
- {Item}
78
- </FixedSizeList>;
79
- }
80
-
81
- {
82
- const Item = ({ data }) => {
83
- assertVoid(data);
84
- // $FlowFixMe itemData is undefined by default
85
- assertEmpty(data);
86
-
87
- return null;
88
- };
89
- const itemKey = (index, data) => {
90
- assertVoid(data);
91
- // $FlowFixMe expected
92
- assertString(data);
93
- return index;
94
- };
95
- <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
96
- {Item}
97
- </FixedSizeList>;
98
- }
99
-
100
- /* VariableSizeList */
101
-
102
- {
103
- const Item = ({ data }) => {
104
- assertNumber(data);
105
- // $FlowFixMe number is passed to VariableSizeList
106
- assertString(data);
107
- return null;
108
- };
109
- const itemKey = (index, data) => {
110
- assertNumber(data);
111
- // $FlowFixMe expected
112
- assertString(data);
113
- return index;
114
- };
115
- <VariableSizeList
116
- width={0}
117
- height={0}
118
- itemSize={0}
119
- itemCount={0}
120
- itemData={1}
121
- itemKey={itemKey}
122
- >
123
- {Item}
124
- </VariableSizeList>;
125
- }
126
-
127
- {
128
- const Item = ({ data }) => {
129
- assertCustomType(data);
130
- // $FlowFixMe ItemData is passed to VariableSizeList
131
- assertString(data);
132
- return null;
133
- };
134
- const itemKey = (index, data) => {
135
- assertCustomType(data);
136
- // $FlowFixMe expected
137
- assertString(data);
138
- return index;
139
- };
140
- <VariableSizeList
141
- width={0}
142
- height={0}
143
- itemSize={0}
144
- itemCount={0}
145
- itemData={{
146
- num: 123,
147
- str: 'abc',
148
- }}
149
- itemKey={itemKey}
150
- >
151
- {Item}
152
- </VariableSizeList>;
153
- }
154
-
155
- {
156
- const Item = ({ data }) => {
157
- assertVoid(data);
158
- // $FlowFixMe itemData is undefined by default
159
- assertEmpty(data);
160
- return null;
161
- };
162
- const itemKey = (index, data) => {
163
- assertVoid(data);
164
- // $FlowFixMe expected
165
- assertString(data);
166
- return index;
167
- };
168
- <VariableSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
169
- {Item}
170
- </VariableSizeList>;
171
- }
172
-
173
- {
174
- class Item extends React.PureComponent<{ data: void }> {
175
- render() {
176
- const { data } = this.props;
177
- assertVoid(data);
178
- // $FlowFixMe itemData is undefined by default
179
- assertEmpty(data);
180
- return null;
181
- }
182
- }
183
- const itemKey = (index, data) => {
184
- assertVoid(data);
185
- // $FlowFixMe expected
186
- assertString(data);
187
- return index;
188
- };
189
- <VariableSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
190
- {Item}
191
- </VariableSizeList>;
192
- }
193
-
194
- /* FixedSizeGrid */
195
-
196
- {
197
- const Item = ({ columnIndex, rowIndex, style }) => {
198
- (columnIndex: number);
199
- (rowIndex: number);
200
- (style: Object);
201
- return null;
202
- };
203
- <FixedSizeGrid
204
- width={0}
205
- height={0}
206
- rowHeight={0}
207
- rowCount={0}
208
- columnWidth={0}
209
- columnCount={0}
210
- >
211
- {Item}
212
- </FixedSizeGrid>;
213
- }
214
-
215
- {
216
- const Item = ({ data }) => {
217
- assertNumber(data);
218
- // $FlowFixMe number is passed to FixedSizeGrid
219
- assertString(data);
220
- return null;
221
- };
222
- const itemKey = ({ columnIndex, data, rowIndex }) => {
223
- assertNumber(data);
224
- // $FlowFixMe expected
225
- assertString(data);
226
- return `${columnIndex}:${rowIndex}`;
227
- };
228
- <FixedSizeGrid
229
- width={0}
230
- height={0}
231
- rowHeight={0}
232
- rowCount={0}
233
- columnWidth={0}
234
- columnCount={0}
235
- itemData={1}
236
- itemKey={itemKey}
237
- >
238
- {Item}
239
- </FixedSizeGrid>;
240
- }
241
-
242
- {
243
- const Item = ({ data }) => {
244
- assertCustomType(data);
245
- // $FlowFixMe ItemData is passed to FixedSizeGrid
246
- assertString(data);
247
- return null;
248
- };
249
- const itemKey = ({ columnIndex, data, rowIndex }) => {
250
- assertCustomType(data);
251
- // $FlowFixMe expected
252
- assertString(data);
253
- return `${columnIndex}:${rowIndex}`;
254
- };
255
- <FixedSizeGrid
256
- width={0}
257
- height={0}
258
- rowHeight={0}
259
- rowCount={0}
260
- columnWidth={0}
261
- columnCount={0}
262
- itemData={{
263
- num: 123,
264
- str: 'abc',
265
- }}
266
- itemKey={itemKey}
267
- >
268
- {Item}
269
- </FixedSizeGrid>;
270
- }
271
-
272
- {
273
- const Item = ({ data }) => {
274
- assertVoid(data);
275
- // $FlowFixMe itemData is undefined by default
276
- assertEmpty(data);
277
- return null;
278
- };
279
- const itemKey = ({ columnIndex, data, rowIndex }) => {
280
- assertVoid(data);
281
- // $FlowFixMe expected
282
- assertString(data);
283
- return `${columnIndex}:${rowIndex}`;
284
- };
285
- <FixedSizeGrid
286
- width={0}
287
- height={0}
288
- rowHeight={0}
289
- rowCount={0}
290
- columnWidth={0}
291
- columnCount={0}
292
- itemKey={itemKey}
293
- >
294
- {Item}
295
- </FixedSizeGrid>;
296
- }
297
-
298
- /* VariableSizeGrid */
299
-
300
- {
301
- const Item = ({ data }) => {
302
- assertNumber(data);
303
- // $FlowFixMe number is passed to VariableSizeGrid
304
- assertString(data);
305
- return null;
306
- };
307
- <VariableSizeGrid
308
- width={0}
309
- height={0}
310
- rowHeight={0}
311
- rowCount={0}
312
- columnWidth={0}
313
- columnCount={0}
314
- itemData={1}
315
- >
316
- {Item}
317
- </VariableSizeGrid>;
318
- }
319
-
320
- {
321
- const Item = ({ data }) => {
322
- assertCustomType(data);
323
- // $FlowFixMe ItemData is passed to VariableSizeGrid
324
- assertString(data);
325
- return null;
326
- };
327
- <VariableSizeGrid
328
- width={0}
329
- height={0}
330
- rowHeight={0}
331
- rowCount={0}
332
- columnWidth={0}
333
- columnCount={0}
334
- itemData={{
335
- num: 123,
336
- str: 'abc',
337
- }}
338
- >
339
- {Item}
340
- </VariableSizeGrid>;
341
- }
342
-
343
- {
344
- const Item = ({ data }) => {
345
- assertVoid(data);
346
- // $FlowFixMe itemData is undefined by default
347
- assertEmpty(data);
348
- return null;
349
- };
350
- <VariableSizeGrid
351
- width={0}
352
- height={0}
353
- rowHeight={0}
354
- rowCount={0}
355
- columnWidth={0}
356
- columnCount={0}
357
- >
358
- {Item}
359
- </VariableSizeGrid>;
360
- }
361
-
362
- {
363
- class Item extends React.PureComponent<{ data: void }> {
364
- render() {
365
- const { data } = this.props;
366
- assertVoid(data);
367
- // $FlowFixMe itemData is undefined by default
368
- assertEmpty(data);
369
- return null;
370
- }
371
- }
372
- <VariableSizeGrid
373
- width={0}
374
- height={0}
375
- rowHeight={0}
376
- rowCount={0}
377
- columnWidth={0}
378
- columnCount={0}
379
- >
380
- {Item}
381
- </VariableSizeGrid>;
382
- }
1
+ // @flow
2
+
3
+ import * as React from 'react';
4
+ import {
5
+ FixedSizeList,
6
+ VariableSizeList,
7
+ FixedSizeGrid,
8
+ VariableSizeGrid,
9
+ } from './';
10
+
11
+ type ItemData = {|
12
+ num: number,
13
+ str: string,
14
+ |};
15
+
16
+ const assertVoid = (value: void) => {};
17
+ const assertEmpty = (value: empty) => {};
18
+ const assertNumber = (value: number) => {};
19
+ const assertString = (value: string) => {};
20
+ const assertCustomType = (value: ItemData) => {};
21
+
22
+ /* FixedSizeList */
23
+
24
+ {
25
+ const Item = ({ index, style }) => {
26
+ (index: number);
27
+ (style: Object);
28
+ return null;
29
+ };
30
+ <FixedSizeList width={0} height={0} itemSize={0} itemCount={0}>
31
+ {Item}
32
+ </FixedSizeList>;
33
+ }
34
+
35
+ {
36
+ const Item = ({ data }) => {
37
+ assertNumber(data);
38
+ // $FlowFixMe number is passed to FixedSizeList
39
+ assertString(data);
40
+ return null;
41
+ };
42
+ const itemKey = (index, data) => {
43
+ assertNumber(data);
44
+ // $FlowFixMe expected
45
+ assertString(data);
46
+ return index;
47
+ };
48
+ <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemData={1} itemKey={itemKey}>
49
+ {Item}
50
+ </FixedSizeList>;
51
+ }
52
+
53
+ {
54
+ const Item = ({ data }) => {
55
+ assertCustomType(data);
56
+ // $FlowFixMe ItemData is passed to FixedSizeList
57
+ assertString(data);
58
+ return null;
59
+ };
60
+ const itemKey = (index, data) => {
61
+ assertCustomType(data);
62
+ // $FlowFixMe expected
63
+ assertString(data);
64
+ return index;
65
+ };
66
+ <FixedSizeList
67
+ width={0}
68
+ height={0}
69
+ itemSize={0}
70
+ itemCount={0}
71
+ itemData={{
72
+ num: 123,
73
+ str: 'abc',
74
+ }}
75
+ itemKey={itemKey}
76
+ >
77
+ {Item}
78
+ </FixedSizeList>;
79
+ }
80
+
81
+ {
82
+ const Item = ({ data }) => {
83
+ assertVoid(data);
84
+ // $FlowFixMe itemData is undefined by default
85
+ assertEmpty(data);
86
+
87
+ return null;
88
+ };
89
+ const itemKey = (index, data) => {
90
+ assertVoid(data);
91
+ // $FlowFixMe expected
92
+ assertString(data);
93
+ return index;
94
+ };
95
+ <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
96
+ {Item}
97
+ </FixedSizeList>;
98
+ }
99
+
100
+ /* VariableSizeList */
101
+
102
+ {
103
+ const Item = ({ data }) => {
104
+ assertNumber(data);
105
+ // $FlowFixMe number is passed to VariableSizeList
106
+ assertString(data);
107
+ return null;
108
+ };
109
+ const itemKey = (index, data) => {
110
+ assertNumber(data);
111
+ // $FlowFixMe expected
112
+ assertString(data);
113
+ return index;
114
+ };
115
+ <VariableSizeList
116
+ width={0}
117
+ height={0}
118
+ itemSize={0}
119
+ itemCount={0}
120
+ itemData={1}
121
+ itemKey={itemKey}
122
+ >
123
+ {Item}
124
+ </VariableSizeList>;
125
+ }
126
+
127
+ {
128
+ const Item = ({ data }) => {
129
+ assertCustomType(data);
130
+ // $FlowFixMe ItemData is passed to VariableSizeList
131
+ assertString(data);
132
+ return null;
133
+ };
134
+ const itemKey = (index, data) => {
135
+ assertCustomType(data);
136
+ // $FlowFixMe expected
137
+ assertString(data);
138
+ return index;
139
+ };
140
+ <VariableSizeList
141
+ width={0}
142
+ height={0}
143
+ itemSize={0}
144
+ itemCount={0}
145
+ itemData={{
146
+ num: 123,
147
+ str: 'abc',
148
+ }}
149
+ itemKey={itemKey}
150
+ >
151
+ {Item}
152
+ </VariableSizeList>;
153
+ }
154
+
155
+ {
156
+ const Item = ({ data }) => {
157
+ assertVoid(data);
158
+ // $FlowFixMe itemData is undefined by default
159
+ assertEmpty(data);
160
+ return null;
161
+ };
162
+ const itemKey = (index, data) => {
163
+ assertVoid(data);
164
+ // $FlowFixMe expected
165
+ assertString(data);
166
+ return index;
167
+ };
168
+ <VariableSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
169
+ {Item}
170
+ </VariableSizeList>;
171
+ }
172
+
173
+ {
174
+ class Item extends React.PureComponent<{ data: void }> {
175
+ render() {
176
+ const { data } = this.props;
177
+ assertVoid(data);
178
+ // $FlowFixMe itemData is undefined by default
179
+ assertEmpty(data);
180
+ return null;
181
+ }
182
+ }
183
+ const itemKey = (index, data) => {
184
+ assertVoid(data);
185
+ // $FlowFixMe expected
186
+ assertString(data);
187
+ return index;
188
+ };
189
+ <VariableSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
190
+ {Item}
191
+ </VariableSizeList>;
192
+ }
193
+
194
+ /* FixedSizeGrid */
195
+
196
+ {
197
+ const Item = ({ columnIndex, rowIndex, style }) => {
198
+ (columnIndex: number);
199
+ (rowIndex: number);
200
+ (style: Object);
201
+ return null;
202
+ };
203
+ <FixedSizeGrid
204
+ width={0}
205
+ height={0}
206
+ rowHeight={0}
207
+ rowCount={0}
208
+ columnWidth={0}
209
+ columnCount={0}
210
+ >
211
+ {Item}
212
+ </FixedSizeGrid>;
213
+ }
214
+
215
+ {
216
+ const Item = ({ data }) => {
217
+ assertNumber(data);
218
+ // $FlowFixMe number is passed to FixedSizeGrid
219
+ assertString(data);
220
+ return null;
221
+ };
222
+ const itemKey = ({ columnIndex, data, rowIndex }) => {
223
+ assertNumber(data);
224
+ // $FlowFixMe expected
225
+ assertString(data);
226
+ return `${columnIndex}:${rowIndex}`;
227
+ };
228
+ <FixedSizeGrid
229
+ width={0}
230
+ height={0}
231
+ rowHeight={0}
232
+ rowCount={0}
233
+ columnWidth={0}
234
+ columnCount={0}
235
+ itemData={1}
236
+ itemKey={itemKey}
237
+ >
238
+ {Item}
239
+ </FixedSizeGrid>;
240
+ }
241
+
242
+ {
243
+ const Item = ({ data }) => {
244
+ assertCustomType(data);
245
+ // $FlowFixMe ItemData is passed to FixedSizeGrid
246
+ assertString(data);
247
+ return null;
248
+ };
249
+ const itemKey = ({ columnIndex, data, rowIndex }) => {
250
+ assertCustomType(data);
251
+ // $FlowFixMe expected
252
+ assertString(data);
253
+ return `${columnIndex}:${rowIndex}`;
254
+ };
255
+ <FixedSizeGrid
256
+ width={0}
257
+ height={0}
258
+ rowHeight={0}
259
+ rowCount={0}
260
+ columnWidth={0}
261
+ columnCount={0}
262
+ itemData={{
263
+ num: 123,
264
+ str: 'abc',
265
+ }}
266
+ itemKey={itemKey}
267
+ >
268
+ {Item}
269
+ </FixedSizeGrid>;
270
+ }
271
+
272
+ {
273
+ const Item = ({ data }) => {
274
+ assertVoid(data);
275
+ // $FlowFixMe itemData is undefined by default
276
+ assertEmpty(data);
277
+ return null;
278
+ };
279
+ const itemKey = ({ columnIndex, data, rowIndex }) => {
280
+ assertVoid(data);
281
+ // $FlowFixMe expected
282
+ assertString(data);
283
+ return `${columnIndex}:${rowIndex}`;
284
+ };
285
+ <FixedSizeGrid
286
+ width={0}
287
+ height={0}
288
+ rowHeight={0}
289
+ rowCount={0}
290
+ columnWidth={0}
291
+ columnCount={0}
292
+ itemKey={itemKey}
293
+ >
294
+ {Item}
295
+ </FixedSizeGrid>;
296
+ }
297
+
298
+ /* VariableSizeGrid */
299
+
300
+ {
301
+ const Item = ({ data }) => {
302
+ assertNumber(data);
303
+ // $FlowFixMe number is passed to VariableSizeGrid
304
+ assertString(data);
305
+ return null;
306
+ };
307
+ <VariableSizeGrid
308
+ width={0}
309
+ height={0}
310
+ rowHeight={0}
311
+ rowCount={0}
312
+ columnWidth={0}
313
+ columnCount={0}
314
+ itemData={1}
315
+ >
316
+ {Item}
317
+ </VariableSizeGrid>;
318
+ }
319
+
320
+ {
321
+ const Item = ({ data }) => {
322
+ assertCustomType(data);
323
+ // $FlowFixMe ItemData is passed to VariableSizeGrid
324
+ assertString(data);
325
+ return null;
326
+ };
327
+ <VariableSizeGrid
328
+ width={0}
329
+ height={0}
330
+ rowHeight={0}
331
+ rowCount={0}
332
+ columnWidth={0}
333
+ columnCount={0}
334
+ itemData={{
335
+ num: 123,
336
+ str: 'abc',
337
+ }}
338
+ >
339
+ {Item}
340
+ </VariableSizeGrid>;
341
+ }
342
+
343
+ {
344
+ const Item = ({ data }) => {
345
+ assertVoid(data);
346
+ // $FlowFixMe itemData is undefined by default
347
+ assertEmpty(data);
348
+ return null;
349
+ };
350
+ <VariableSizeGrid
351
+ width={0}
352
+ height={0}
353
+ rowHeight={0}
354
+ rowCount={0}
355
+ columnWidth={0}
356
+ columnCount={0}
357
+ >
358
+ {Item}
359
+ </VariableSizeGrid>;
360
+ }
361
+
362
+ {
363
+ class Item extends React.PureComponent<{ data: void }> {
364
+ render() {
365
+ const { data } = this.props;
366
+ assertVoid(data);
367
+ // $FlowFixMe itemData is undefined by default
368
+ assertEmpty(data);
369
+ return null;
370
+ }
371
+ }
372
+ <VariableSizeGrid
373
+ width={0}
374
+ height={0}
375
+ rowHeight={0}
376
+ rowCount={0}
377
+ columnWidth={0}
378
+ columnCount={0}
379
+ >
380
+ {Item}
381
+ </VariableSizeGrid>;
382
+ }