4
0
forked from crowetic/commerce
commerce/framework/types.d.ts

58 lines
908 B
TypeScript
Raw Normal View History

2021-01-06 17:01:32 -03:00
interface Product {
id: string | number
name: string
description: string
slug: string
path?: string
2021-01-07 11:58:00 -03:00
images: ProductImage[]
2021-01-07 16:28:50 -03:00
variants: ProductVariant[]
2021-01-07 11:58:00 -03:00
prices: ProductPrice[]
2021-01-06 17:01:32 -03:00
}
2021-01-07 16:28:50 -03:00
interface ProductImage {
url: string
alt?: string
}
interface ProductVariant {
id: string | number
}
2021-01-06 17:01:32 -03:00
2021-01-07 11:58:00 -03:00
interface ProductPrice {
value: number | string
currencyCode: 'USD' | 'ARS'
type?: 'price' | 'retail' | 'sale' | string
2021-01-06 17:01:32 -03:00
}
2021-01-09 12:05:40 -03:00
2021-01-09 12:17:31 -03:00
interface Cart {
2021-01-09 12:05:40 -03:00
id: string
2021-01-09 12:07:17 -03:00
products: Pick<Product, 'id' | 'name' | 'prices'>[]
}
interface Wishlist {
id: string
products: Pick<Product, 'id' | 'name' | 'prices'>[]
2021-01-09 12:05:40 -03:00
}
2021-01-09 12:17:31 -03:00
interface Order {}
2021-01-09 12:05:40 -03:00
interface Customer {
2021-01-10 14:11:00 -03:00
id: string | number | undefined
[prop: string]: any
2021-01-09 12:05:40 -03:00
}
2021-01-10 14:11:00 -03:00
type UseCustomerResponse = {
customer: Customer
} | null
2021-01-09 12:17:31 -03:00
interface Category {
id: string
name: string
}
interface Brand {
id: string
name: string
}
2021-01-09 12:05:40 -03:00
2021-01-09 12:17:31 -03:00
type Features = 'wishlist' | 'customer'