added new types

This commit is contained in:
Mamalizz
2025-03-13 01:39:37 +03:30
parent 7f8ce21842
commit eaefadb6e8
+42 -1
View File
@@ -88,7 +88,10 @@ declare global {
colors: string[];
};
type ProductListItem = Pick<Product, "id" | "variants" | "name" | "rating" | "slug" | "category" | "colors">
type ProductListItem = Pick<
Product,
"id" | "variants" | "name" | "rating" | "slug" | "category" | "colors"
>;
type Article = {
id: number;
@@ -176,6 +179,44 @@ declare global {
address: Address | null;
};
type DiscountCode = {
code: string;
percent: number;
amount: string;
};
type CartItem = {
id: number;
product: {
title: string;
product_attributes: {
id: number;
attribute_type: {
id: number;
name: string;
};
value: string;
}[];
category: string;
in_stock: number;
price: string;
discount: number;
color: string;
image: string;
discount_amount: string;
final_price: string;
};
quantity: number;
};
type Cart = {
discount_code: DiscountCode;
items: CartItem[];
cart_total: string;
tax: string;
final_price: string;
};
type ServerFile = {
id: number;
file_link: string;