-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
100 lines (89 loc) · 2.22 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
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
import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore';
import { NavigatorScreenParams } from '@react-navigation/native';
import type { CompositeScreenProps } from '@react-navigation/native';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import type { MaterialBottomTabScreenProps } from 'react-native-paper/react-navigation';
export type RootStackParamList = {
Login: undefined;
Register: undefined;
Item: {
sharedTransitionTag: string;
itemId: string;
};
BottomTabs: NavigatorScreenParams<BottomTabsParamList>;
Camera: undefined;
CreateItem: {
imageURI: string;
};
CreateStorage: undefined;
InvoiceViewer: {
sharedTransitionTag: string;
invoice: TInvoice;
item: TItem;
};
};
export type RootStackScreenProps<ScreenName extends keyof RootStackParamList> =
NativeStackScreenProps<RootStackParamList, ScreenName>;
export type BottomTabsParamList = {
Home: undefined;
Search: undefined;
AddItem: undefined;
Storages: undefined;
};
export type BottomTabsScreenProps<
ScreenName extends keyof BottomTabsParamList,
> = CompositeScreenProps<
MaterialBottomTabScreenProps<BottomTabsParamList, ScreenName>,
NativeStackScreenProps<RootStackParamList, 'BottomTabs'>
>;
export type TPlace = {
place_id: number;
licence: string;
osm_type: string;
osm_id: number;
lat: number;
lon: number;
category: string;
type: string;
place_rank: number;
importance: number;
addresstype: string;
name: string;
display_name: string;
boundingbox: [string, string, string, string];
};
export type TStorage = {
id: string;
name: string;
locationName?: string;
location?: FirebaseFirestoreTypes.GeoPoint;
userId: string;
};
export type TItem = {
id: string;
title: string;
description: string;
storage: string;
category: string;
image: string;
expiryDate: Date | null;
userId: string;
invoice?: TInvoice;
reminder?: TReminder;
};
export type TReminder = {
title: string;
date: string;
time: string;
};
export type TInvoice = TInvoiceImage | TInvoicePDF;
export type TInvoiceImage = {
url: string;
width: number;
height: number;
type: 'image';
};
export type TInvoicePDF = {
url: string;
type: 'pdf';
};