gliscano-product-card
Version:
Product card is a test package, it was created with React and Typescript using State Initializer Component Pattern
30 lines (26 loc) • 565 B
text/typescript
export interface Product {
id: string;
img?: string;
title: string;
}
export interface ProductContextProps {
counter: number;
product: Product;
increaseBy: ( value: number ) => void;
}
export interface OnChangeArgs {
product: Product;
count: number;
}
export interface InitialValues {
count?: number;
maxCount?: number;
}
export interface ProductCardHandlers {
count: number;
isMaxCountReached: boolean;
maxCount?: number;
product: Product,
increaseBy: ( value: number ) => void;
reset: () => void;
}