-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
51 lines (44 loc) · 1.02 KB
/
types.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
import {ReactNode} from 'react';
import {FlatListProps} from 'react-native';
import {ItemLayout} from '../../models/Item';
import {LayoutRoot} from '../../models/Layout';
export interface ItemType {
layout: string;
items: {
[itemKey: string]: ItemLayout;
};
}
export interface Layouts {
[name: string]: LayoutRoot;
}
interface ChildrenProps {
[propName: string]: any;
}
interface OnItemPressParams {
layout: string;
itemId?: string;
photo?: string;
video?: string;
childrenProps?: ChildrenProps;
}
interface renderItemChildrenParams {
layout: string;
itemId?: string;
photo?: string;
video?: string;
childrenProps?: ChildrenProps;
}
export type Props = Omit<
FlatListProps<ItemType>,
'data' | 'renderItem' | 'keyExtractor'
> & {
rowSeparator?: number;
paddingHorizontal?: number;
layouts: Layouts;
onItemPress?: (params: OnItemPressParams) => void;
renderItemChildren?: (params: renderItemChildrenParams) => ReactNode;
data: ItemType[];
};
export interface SeparatorProps {
size: number;
}