This commit is contained in:
Belen Curcio
2021-01-07 16:28:50 -03:00
parent e9dfda1e86
commit c780852fbb
6 changed files with 53 additions and 27 deletions

View File

@@ -15,8 +15,8 @@ import removeItem from './handlers/remove-item'
export type { Wishlist, WishlistItem }
export type ItemBody = {
productId: number
variantId: number
productId: Product['id']
variantId: ProductVariant['id']
}
export type AddItemBody = { item: ItemBody }

View File

@@ -0,0 +1,4 @@
export { default as useAddItem } from './use-add-item'
export { default as useWishlist } from './use-wishlist'
export { default as useRemoveItem } from './use-remove-item'
export { default as useWishlistActions } from './use-wishlist-actions'

14
framework/types.d.ts vendored
View File

@@ -1,17 +1,21 @@
interface ProductImage {
url: string
alt?: string
}
interface Product {
id: string | number
name: string
description: string
images: ProductImage[]
variants: ProductVariant[]
prices: ProductPrice[]
slug: string
path?: string
}
interface ProductImage {
url: string
alt?: string
}
interface ProductVariant {
id: string | number
}
interface ProductPrice {
value: number | string