-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.tsx
149 lines (126 loc) · 2.69 KB
/
types.tsx
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import { Component } from "react";
/**
* Learn more about using TypeScript with React Navigation:
* https://reactnavigation.org/docs/typescript/
*/
export type SuccessProps = {
addAnother?: () => void,
mainText: string,
subText: string,
buttonText?: string,
}
export type BoughtProps = {
proname: string,
bought: string
}
export type FilterProps = {
filterby: string, //Property, e.g. location, category, confection
filterto: string //Property name, e.g. fridge, fruit, fresh
}
export type WarningProps = {
iconColor: string,
positive: boolean,
mainText?: string,
subText?: string,
mainColor?: string,
subColor?: string,
}
export type RootStackParamList = {
Root: undefined,
NotFound: undefined,
AddItem: undefined,
Home: undefined,
QueriesScreen: undefined,
};
export type ShapeProps = {
proname: string,
prodate1: string,
prodate2: string,
};
export type BottomTabParamList = {
Home: undefined,
List: undefined,
Queries: undefined,
};
export type NavProps = {
OpenOption1: () => void,
text1: string,
text2: string
}
export type HomeNavigatorParamList = {
HomeScreen: undefined,
};
export type NewItemParamList = {
NewItemScreen: undefined,
};
export type QueriesParamList = {
QueriesScreen: undefined,
};
export type myFormElementProps = {
handleUpdate: (title:string, index: number) => void,
arrIndex: number,
titleArr: Array<string>,
placeHold?: string,
groupArr?: Array<string>
}
export type ButtonProps = {
btnText: string,
btnColor: 'dark' | 'tint' | 'light',
}
export type ScannerProps = {
handleClosing: () => void,
handleScanning: ({data}: any) => Promise<void>,
}
export type StringCallback = (
name:string,
brand?:string,
category?:string,
location?:string,
confection?:string,
maturity?:string,
datepick?:Date) => void
export type FormProps = {
onDataReady: StringCallback,
product?: ProductType,
editor: boolean
}
export type ProductType = {
id: string,
brand?: string,
category?: string,
name: string,
expiry: string,
confection?: string,
location?: string,
addedOn: string,
maturity?: string,
maturitydate?: string,
isOpen: boolean,
recentlyBought?: boolean,
boughtOn?: string,
}
export type DefListProps = {
items: ProductType[],
}
export type ProductProps = {
item: ProductType,
}
export type ModalProps = {
item: ProductType,
handleClosing: () => void
}
export type ColoredProps = {
item: ProductType,
short?: boolean,
}
export type DisplayerProps = {
items: ProductType[],
text: string,
shape?: string,
colored?: boolean,
}
export type GroupProps = {
items: ProductType[],
filterby: "Category" | "Location" | "Confection",
groupIcon?: string,
}