From eaefadb6e81056de86a93e8d2754cb910f810c8a Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Thu, 13 Mar 2025 01:39:37 +0330 Subject: [PATCH] added new types --- frontend/types/global.d.ts | 43 +++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/frontend/types/global.d.ts b/frontend/types/global.d.ts index 5f53c79..7f8772a 100644 --- a/frontend/types/global.d.ts +++ b/frontend/types/global.d.ts @@ -88,7 +88,10 @@ declare global { colors: string[]; }; - type ProductListItem = Pick + 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;