-
Notifications
You must be signed in to change notification settings - Fork 39
/
declarations.d.ts
109 lines (101 loc) · 2.55 KB
/
declarations.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* eslint-disable @typescript-eslint/indent */
/**
* Adds a type to SVG imports on mobile.
*/
declare module '*.svg' {
import { SvgProps } from 'react-native-svg';
const content: React.FC<SvgProps>;
export default content;
}
/**
* Adds a type to the '@react-native/metro-config' file
*/
declare module '@react-native/metro-config';
// This ensures Typescript is happy when using the navigate function
export type RootStackParamList = {
ClaimDetailsScreen: { donation?: IDonation; claim?: IClaim; id: number };
ClientClaimsScreen: undefined;
ClientHistoryScreen: undefined;
ContactScreen: { backDestination: string };
DashboardScreen: undefined;
DeleteAccountScreen: undefined;
DeletedAccountScreen: undefined;
DonationScreen: undefined;
DonationsDetailScreen: { donation: IDonation };
DonorDashboardScreen: undefined;
DonorDonationScreen: { donation: IDonation };
DonorHistoryScreen: undefined;
Drawer: undefined;
Login: { email: string; password: string } | undefined;
LoginSuccessScreen: undefined;
Logout: undefined;
LogoutScreen: undefined;
MakeClaim: { donation: IDonation; id: number };
MakeClaimScreen: { donation: IDonation; id: number };
MapScreen: undefined;
QRCodeScannerScreen: undefined;
Register: undefined;
TermsScreen: undefined;
};
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
export interface IDonor {
id: number;
name: string;
email: string;
phone: string;
address_street: string;
address_city: string;
address_state: string;
address_zip: string;
latitude?: number;
longitude?: number;
donor_name: string;
created_at: Date;
updated_at: Date;
}
export interface IDonation {
category: string;
claim?: IClaim;
created_at: Date;
distance: number;
donor_id: number;
donor: IDonor;
food_name: string;
id: number;
image_url: string;
isHistory?: boolean;
measurement: string;
per_person: number;
pickup_instructions: string;
pickup_location: string;
status: string;
total_amount: string;
updated_at: Date;
}
export type NewDonation = Pick<
IDonation,
'food_name' | 'category' | 'total_amount' | 'pickup_location' | 'pickup_instructions'
>;
export interface IClaim extends IDonation {
// id: number;
// created_at: Date;
// updated_at: Date;
canceled: boolean;
claimed: boolean;
client_id: number;
client_name?: string;
completed: boolean;
donation_id: number;
// donation?: IDonation; // If needed, reference to the donation
qr_code: string;
// status: string;
time_claimed: Date;
}
export interface IClaimHistory {
claim: IClaim;
donation: IDonation;
}