@alipay/ams-checkout 0.0.1757298389-dev.5 → 0.0.1757298389-dev.6
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.
@@ -127,6 +127,10 @@ export interface LinkAuthMountOptions extends BaseMountOptions {
|
|
127
127
|
theme?: ThemeType;
|
128
128
|
};
|
129
129
|
}
|
130
|
+
type ToCamelCase<S extends string> = S extends `${infer First}-${infer Rest}` ? `${First}${Capitalize<ToCamelCase<Rest>>}` : S;
|
131
|
+
type CompatibleVariables<T extends Record<string, string>> = {
|
132
|
+
[K in keyof T as K | ToCamelCase<K & string>]: string;
|
133
|
+
};
|
130
134
|
export interface PaymentMountOptions extends BaseMountOptions {
|
131
135
|
type: ElementType.payment;
|
132
136
|
appearance?: {
|
@@ -134,7 +138,7 @@ export interface PaymentMountOptions extends BaseMountOptions {
|
|
134
138
|
layout?: {
|
135
139
|
type: PaymentElementLayout;
|
136
140
|
};
|
137
|
-
variables?: {
|
141
|
+
variables?: Partial<CompatibleVariables<{
|
138
142
|
'content-primary': string;
|
139
143
|
'content-secondary': string;
|
140
144
|
'content-tertiary': string;
|
@@ -159,7 +163,8 @@ export interface PaymentMountOptions extends BaseMountOptions {
|
|
159
163
|
'radius-module': string;
|
160
164
|
'radius-component': string;
|
161
165
|
'radius-button': string;
|
162
|
-
|
166
|
+
'warpper-padding': string;
|
167
|
+
}>>;
|
163
168
|
};
|
164
169
|
notRedirectAfterComplete?: boolean;
|
165
170
|
merchantAppointParam?: IMerchantAppointParam;
|
@@ -360,7 +365,7 @@ export interface IElementOptions {
|
|
360
365
|
appearance?: {
|
361
366
|
theme: ThemeType.Default | ThemeType.Night;
|
362
367
|
};
|
363
|
-
onEventCallback?: ({ code, message, result }: {
|
368
|
+
onEventCallback?: ({ code, message, result, }: {
|
364
369
|
code: EventCallbackCode;
|
365
370
|
message: string;
|
366
371
|
result?: any;
|
@@ -71,6 +71,11 @@ export var ELEMENT_ENVIRONMENT = /*#__PURE__*/function (ELEMENT_ENVIRONMENT) {
|
|
71
71
|
ELEMENT_ENVIRONMENT["SANDBOX"] = "SANDBOX";
|
72
72
|
return ELEMENT_ENVIRONMENT;
|
73
73
|
}({});
|
74
|
+
|
75
|
+
// 将短横线命名转为小驼峰
|
76
|
+
|
77
|
+
// 同时兼容短横线和小驼峰两种键名
|
78
|
+
|
74
79
|
// export type IMountOptions = AddressMountOptions | LinkAuthMountOptions | PaymentMountOptions;
|
75
80
|
|
76
81
|
export var AddressEventCallbackName = /*#__PURE__*/function (AddressEventCallbackName) {
|
@@ -10,7 +10,7 @@ export declare const formatElementOption: (options: IElementOptions) => {
|
|
10
10
|
appearance?: {
|
11
11
|
theme: import("./type").ThemeType.Default | import("./type").ThemeType.Night;
|
12
12
|
};
|
13
|
-
onEventCallback?: ({ code, message, result }: {
|
13
|
+
onEventCallback?: ({ code, message, result, }: {
|
14
14
|
code: EventCallbackCode;
|
15
15
|
message: string;
|
16
16
|
result?: any;
|