You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/ui-extensions/src/surfaces/admin/api/discount-function-settings/launch-options.ts
+53-7Lines changed: 53 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,69 @@ interface Metafield {
7
7
type: string;
8
8
}
9
9
10
-
exportenumDiscountClass{
10
+
enumDiscountClass{
11
11
Product='PRODUCT',
12
12
Order='ORDER',
13
13
Shipping='SHIPPING',
14
14
}
15
15
16
-
interfaceDiscount{
17
-
/**
18
-
* the discount's gid
19
-
*/
20
-
id: string;
16
+
enumDiscountMethod{
17
+
Automatic='Automatic',
18
+
Code='Code',
19
+
}
20
+
21
+
enumPurchaseType{
22
+
OneTimePurchase='ONE_TIME_PURCHASE',
23
+
Subscription='SUBSCRIPTION',
24
+
Both='BOTH',
25
+
}
26
+
27
+
typeResult<T>=
28
+
|{success: true;value: T}
29
+
|{success: false;error: ValidationError};
30
+
31
+
interfaceValidationError{
32
+
type: 'error';
33
+
message: string;
34
+
code: string;
35
+
issues?: {
36
+
message: string;
37
+
path: string[];
38
+
}[];
21
39
}
22
40
23
41
/**
24
42
* The object that exposes the validation with its settings.
25
43
*/
26
44
exportinterfaceDiscountFunctionSettingsData{
27
-
id: Discount;
45
+
id: string;
46
+
discountClasses: DiscountClass[];
28
47
metafields: Metafield[];
29
48
}
49
+
50
+
/**
51
+
* Represents a reactive signal interface that provides both immediate value access and subscription-based updates. Enables real-time synchronization with changing data through the observer pattern.
52
+
*/
53
+
exportinterfaceReadonlySignalLike<T>{
54
+
/**
55
+
* The current value of the field.
56
+
*/
57
+
readonlyvalue: T;
58
+
/**
59
+
* Subscribes to field changes and calls the provided function whenever the field updates. Returns an unsubscribe function to clean up the subscription.
0 commit comments