@shopify/app-bridge-types 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/shopify.ts +15 -3
package/package.json
CHANGED
package/shopify.ts
CHANGED
|
@@ -50,11 +50,14 @@ interface Cart {
|
|
|
50
50
|
grandTotal: string;
|
|
51
51
|
note?: string;
|
|
52
52
|
cartDiscount?: Discount;
|
|
53
|
+
cartDiscounts: Discount[];
|
|
53
54
|
customer?: Customer;
|
|
54
55
|
lineItems: LineItem[];
|
|
55
56
|
properties: Record<string, string>;
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
type CartDiscountType = 'Percentage' | 'FixedAmount';
|
|
60
|
+
|
|
58
61
|
type CartSubscriber = (cart: Cart) => void;
|
|
59
62
|
|
|
60
63
|
interface Collection extends Resource {
|
|
@@ -114,7 +117,7 @@ interface Device {
|
|
|
114
117
|
interface Discount {
|
|
115
118
|
amount: number;
|
|
116
119
|
title?: string;
|
|
117
|
-
type?:
|
|
120
|
+
type?: CartDiscountType;
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
interface Environment {
|
|
@@ -154,7 +157,7 @@ interface LineItem {
|
|
|
154
157
|
|
|
155
158
|
interface LineItemDiscount {
|
|
156
159
|
title: string;
|
|
157
|
-
type:
|
|
160
|
+
type: CartDiscountType;
|
|
158
161
|
amount: string;
|
|
159
162
|
}
|
|
160
163
|
|
|
@@ -175,6 +178,9 @@ interface Location_2 {
|
|
|
175
178
|
|
|
176
179
|
export interface MenuItemProperties {
|
|
177
180
|
variant?: 'primary' | 'breadcrumb' | null | undefined;
|
|
181
|
+
tone?: 'critical' | 'default';
|
|
182
|
+
disabled?: boolean;
|
|
183
|
+
loading?: boolean | string;
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
type Money = string;
|
|
@@ -188,7 +194,9 @@ interface Pos {
|
|
|
188
194
|
addAddress(address: Address): Promise<void>;
|
|
189
195
|
updateAddress(index: number, address: Address): Promise<void>;
|
|
190
196
|
applyCartDiscount(discount: Discount): Promise<void>;
|
|
197
|
+
applyCartCodeDiscount(code: string): Promise<void>;
|
|
191
198
|
removeCartDiscount(): Promise<void>;
|
|
199
|
+
removeAllDiscounts(disableAutomaticDiscounts: boolean): Promise<void>;
|
|
192
200
|
addCartProperties(properties: Record<string, string>): Promise<void>;
|
|
193
201
|
removeCartProperties(properties: string[]): Promise<void>;
|
|
194
202
|
clear(): Promise<void>;
|
|
@@ -224,6 +232,7 @@ interface Product extends Resource {
|
|
|
224
232
|
templateSuffix?: string | null;
|
|
225
233
|
title: string;
|
|
226
234
|
totalInventory: number;
|
|
235
|
+
totalVariants: number;
|
|
227
236
|
tracksInventory: boolean;
|
|
228
237
|
variants: Partial<ProductVariant>[];
|
|
229
238
|
vendor: string;
|
|
@@ -357,12 +366,15 @@ interface ToastOptions {
|
|
|
357
366
|
export interface UIModalAttributes {
|
|
358
367
|
id?: string;
|
|
359
368
|
variant?: Variant;
|
|
369
|
+
src?: string;
|
|
360
370
|
children?: any;
|
|
361
371
|
}
|
|
362
372
|
|
|
363
373
|
interface UIModalElement_2 extends Omit<HTMLElement, 'addEventListener' | 'removeEventListener'> {
|
|
364
374
|
variant: Variant;
|
|
365
|
-
content
|
|
375
|
+
content?: HTMLElement;
|
|
376
|
+
src?: string;
|
|
377
|
+
readonly contentWindow?: Window | null;
|
|
366
378
|
show(): Promise<void>;
|
|
367
379
|
hide(): Promise<void>;
|
|
368
380
|
toggle(): Promise<void>;
|