-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
63 lines (48 loc) · 1.28 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import type { Image, Product } from "@shopify/hydrogen-react/storefront-api-types"
import type { PropsWithChildren, ReactNode } from "react"
export default interface Children {
children?: ReactNode
}
export { Children }
export type ClassName = {
className?: string
}
export type GalleryImageData = {
src: StaticImageData
alt: string
}
export type ImageProps = {
images: Image[]
currentImage: Image
}
export type ImageState = ImageProps & {
setCurrentImage: (i: number) => void
}
export type ModalProps = {
isModalOpen: boolean
}
export type ModalState = ModalProps & {
toggleModal: () => void
}
export type SwatchProps = {
colorOptions?: string[]
selectedColor?: string
hexCodes?: string[]
}
export type SwatchState = SwatchProps & {
setSelectedColor: (color: string) => void
}
export type SizeProps = {
sizeOptions?: string[]
selectedSize?: string
}
export type SizeState = SizeProps & {
setSelectedSize: (size: string) => void
}
export type ProductProps = PropsWithChildren<
ImageProps & ModalProps & SwatchProps & SizeProps
> & {
product: Partial<Product>
}
export type ProductState = ProductProps & ImageState & ModalState & SwatchState & SizeState
export type ProductProviderProps = PropsWithChildren<ProductProps>