-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
268 lines (243 loc) · 5.16 KB
/
types.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
import { TermNode } from './generated/graphql'
export interface GalleryItem {
id: string | null
src: string | null
alt: string | null
caption: string | null
description: string | null
href: string | null
}
export interface Gallery {
id: string
items?: GalleryItem[]
}
export interface PriceRange {
min_price: string
max_price: string
currency_code: string
currency_symbol: string
currency_minor_unit: number
currency_decimal_separator: string
currency_thousand_separator: string
currency_prefix: string
currency_suffix: string
}
export interface AttributeCount {
term: TermNode
count: number
}
export interface ProductAggregateItem {
attribute_counts: AttributeCount[]
price_range?: PriceRange
rating_counts?: any
}
export interface ProductAggregate {
key: string
data: ProductAggregateItem
}
export interface ProductFilter {
category?: number[]
gender?: number[]
size?: number[]
color?: number[]
}
export interface WooProductFilter {
category?: string
gender?: string
attributes?: {
attribute: string
operator: 'in' | 'and'
term_id: number[]
}[]
}
export interface CartData {
coupons: Coupon[]
shipping_rates: ShippingRate[]
shipping_address: ShippingAddress
billing_address: BillingAddress
items: OrderItem[]
items_count: number
items_weight: number
needs_payment: boolean
needs_shipping: boolean
has_calculated_shipping: boolean
fees: any[]
totals: Totals3
errors: any[]
payment_requirements: string[]
generated_timestamp: number
extensions: Extensions2
}
export interface Coupon {
code: string
discount_type: string
totals: Totals
}
export interface Totals {
total_discount: string
total_discount_tax: string
currency_code: string
currency_symbol: string
currency_minor_unit: number
currency_decimal_separator: string
currency_thousand_separator: string
currency_prefix: string
currency_suffix: string
}
export interface ShippingRate {
package_id: number
name: string
destination: Destination
items: Item[]
shipping_rates: ShippingRate2[]
}
export interface Destination {
address_1: string
address_2: string
city: string
state: string
postcode: string
country: string
}
export interface Item {
key: string
name: string
quantity: number
}
export interface ShippingRate2 {
rate_id: string
name: string
description: string
delivery_time: string
price: string
taxes: string
instance_id: number
method_id: string
meta_data: MetaDaum[]
selected: boolean
currency_code: string
currency_symbol: string
currency_minor_unit: number
currency_decimal_separator: string
currency_thousand_separator: string
currency_prefix: string
currency_suffix: string
}
export interface MetaDaum {
key: string
value: string
}
export interface ShippingAddress {
first_name: string
last_name: string
company: string
address_1: string
address_2: string
city: string
state: string
postcode: string
country: string
}
export interface BillingAddress {
first_name: string
last_name: string
company: string
address_1: string
address_2: string
city: string
state: string
postcode: string
country: string
email: string
phone: string
}
export interface OrderItem {
key: string
id: number
quantity: number
quantity_limit: number
name: string
short_description: string
description: string
sku: string
low_stock_remaining: any
backorders_allowed: boolean
show_backorder_badge: boolean
sold_individually: boolean
permalink: string
images: Image[]
variation: Variation[]
item_data: any[]
prices: Prices
totals: Totals2
catalog_visibility: string
extensions: Extensions
}
export interface Image {
id: number
src: string
thumbnail: string
srcset: string
sizes: string
name: string
alt: string
}
export interface Variation {
attribute: string
value: string
}
export interface Prices {
price: string
regular_price: string
sale_price: string
price_range: any
currency_code: string
currency_symbol: string
currency_minor_unit: number
currency_decimal_separator: string
currency_thousand_separator: string
currency_prefix: string
currency_suffix: string
raw_prices: RawPrices
}
export interface RawPrices {
precision: number
price: string
regular_price: string
sale_price: string
}
export interface Totals2 {
line_subtotal: string
line_subtotal_tax: string
line_total: string
line_total_tax: string
currency_code: string
currency_symbol: string
currency_minor_unit: number
currency_decimal_separator: string
currency_thousand_separator: string
currency_prefix: string
currency_suffix: string
}
export interface Extensions {}
export interface Totals3 {
total_items: string
total_items_tax: string
total_fees: string
total_fees_tax: string
total_discount: string
total_discount_tax: string
total_shipping: string
total_shipping_tax: string
total_price: string
total_tax: string
tax_lines: any[]
currency_code: string
currency_symbol: string
currency_minor_unit: number
currency_decimal_separator: string
currency_thousand_separator: string
currency_prefix: string
currency_suffix: string
}
export interface Extensions2 {}