forked from saleel/react-native-super-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
89 lines (77 loc) · 2.2 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import * as React from "react";
import {
ViewStyle,
ListRenderItemInfo,
SectionListRenderItemInfo,
SectionListData,
StyleProp
} from "react-native";
/**
* React Native Super Grid Properties
*/
export interface FlatGridProps<ItemType = any> {
/**
* Function to render each object. Should return a react native component.
*/
renderItem: (info: ListRenderItemInfo<ItemType>) => JSX.Element;
/**
* Items to be rendered. renderItem will be called with each item in this array.
*/
items: ItemType[];
/**
* Minimum width or height for each item in pixels (virtual).
*/
itemDimension?: number;
/**
* If true, the exact itemDimension will be used and won't be adjusted to fit the screen.
*/
fixed?: boolean;
/**
* Spacing between each item.
*/
spacing?: number;
/**
* Style
*/
style?: StyleProp<ViewStyle>;
/**
* Specifies the style about content row view
*/
itemContainerStyle?: StyleProp<ViewStyle>;
/**
* Specifies a static width or height for the GridView container.
* If your container dimension is known or can be calculated at runtime
* (via Dimensions.get('window'), for example), passing this prop will force the grid container
* to that dimension size and avoid the reflow associated with dynamically calculating it
*/
staticDimension?: number;
/**
* If true, the grid will be scrolling horizontally
*/
horizontal?: boolean;
/**
* Optional callback ran by the internal `FlatList` or `SectionList`'s `onLayout` function,
* thus invoked on mount and layout changes.
*/
onLayout?: Function;
}
/**
* Responsive Grid View for React Native.
*/
export class FlatGrid<ItemType = any> extends React.Component<
FlatGridProps<ItemType>
> {}
export interface SectionGridProps<ItemType = any> {
renderItem: (info: SectionListRenderItemInfo<ItemType>) => JSX.Element;
sections: ItemType;
itemDimension?: number;
fixed?: boolean;
spacing?: number;
style?: StyleProp<ViewStyle>;
staticDimension?: number;
renderSectionHeader?: (info: { section: SectionListData<ItemType> }) => JSX.Element;
onLayout?: Function;
}
export class SectionGrid<ItemType = any> extends React.Component<
SectionGridProps<ItemType>
> {}