-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathinterfaces.ts
More file actions
47 lines (41 loc) · 1.2 KB
/
Copy pathinterfaces.ts
File metadata and controls
47 lines (41 loc) · 1.2 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
import { Props as ProductButtonsProps } from "../components/ProductButtons";
import { Props as ProductCardProps } from "../components/ProductCard";
import { Props as ProductImageProps } from "../components/ProductImage";
import { Props as ProductTitleProps } from "../components/ProductTitle";
export interface Product {
id: string;
img?: string;
title: string;
}
export interface ProductContextProps {
counter: number;
product: Product;
increaseBy: (value: number) => void;
maxCount?: number;
isMaxCountedReached: () => boolean;
}
export interface ProductCardHOCProps {
({ children, product }: ProductCardProps): JSX.Element;
Buttons: (Props: ProductButtonsProps) => JSX.Element;
Image: (Props: ProductImageProps) => JSX.Element;
Title: (Props: ProductTitleProps) => JSX.Element;
}
export interface onChangeArgs {
product: Product;
count: number;
}
export interface ProductInCart extends Product {
count: number;
}
export interface InitialValuesProps {
count?: number;
maxCount?: number;
}
export interface ProductCardHandler {
count?: number;
isMaxCountedReached: () => boolean;
maxCount?: number;
product: Product;
increaseBy: (value: number) => void;
reset: () => void;
}