-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtypes.d.ts
More file actions
150 lines (132 loc) · 3.25 KB
/
types.d.ts
File metadata and controls
150 lines (132 loc) · 3.25 KB
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
150
import { MouseEventHandler, ReactNode } from 'react';
export interface FuelsProps {
fuel: string;
id: number;
}
export interface CarProps {
capacity: number;
carTitle: string;
carType: string;
cityMPG: number;
cylinders: number;
combinationMPG: number;
drive: string;
fuelCapacity: number;
fuelType: string;
highwayMPG: number;
imageFiles: string[];
location: string;
manufacturer: string;
model: string;
rentPrice: number
shortDescription: string;
transmission: string;
typeOfclass: string;
year: string;
creator: Creator;
_id: string;
}
export interface CarInfoProps extends CarProps {
creator?: Creator;
_id?: string;
}
export interface CreatorProps {
_id: string;
email: string;
username: string;
email: string;
}
export interface FetchCarProps {
manufacturer?: string;
year?: number;
model?: string;
limit?: number;
fuelType?: string;
}
export interface CardCardProps {
car: CarProps;
isFavorite?: boolean;
handleDelete?: (id: string) => void;
handleEdit?: (id: string) => void;
}
export interface CatalogueProps {
allCars: CarProps[];
limit: number;
isLoading: boolean;
}
export interface CustomButtonProps {
title: string;
type: 'button' | 'submit' | 'reset';
handleClick?: MouseEventHandler<HTMLButtonElement>;
icon?: JSX.Element | undefined;
containerStyle?: string;
isLoading?: boolean;
}
export interface CustomSelectProps {
options: { value: string; title: string }[];
label: string;
containerStyle?: string;
parentContainerStyle?: string;
onChange: (value: string, name: string) => void;
name: string;
}
export interface FilterProps {
brand: string[];
cylinders: string[];
type: string[];
drive: string[];
fuelType: string[];
rentPriceRange: string;
}
export interface ProviderProps {
children: ReactNode;
session: any;
}
export interface FileProps {
path: string;
lastModified: number;
lastModifiedDate: Date;
name: string
size: number
type: string;
webkitRelativePath: string;
base64: string;
}
export interface ImageUploaderProps {
handleOnDrop: (acceptedFiles: File[]) => void;
files: File[];
carInfo?: CarInfoProps;
}
export interface CustomInputProps {
label: string;
placeholder: string;
name: string;
type?: 'text' | 'number' | 'radio' | 'number';
value?: string | number;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
}
export interface FormProps {
carInfo: CarInfoProps;
setCarInfo: React.Dispatch<React.SetStateAction<CarInfoProps>>;
submitBtnTitle: string;
title: string;
handleSubmit: (event: FormEvent<HTMLFormElement>) => void;
isLoading?: boolean;
}
export interface ShowAllCarsProps {
allCars: CarProps[];
limit: number;
isLoading: boolean;
}
export interface FilterCardProps {
title: string,
category: keyof FilterProps,
options: { value: string, label: string }[]
}
export interface QueryProps {
model?: string | null | undefined;
limit?: string | null | undefined;
fuelType?: string | null | undefined;
year?: string | null | undefined;
manufacturer?: string | null | undefined;
}