@alipay/ams-checkout 0.0.1788166152-dev.7 → 0.0.1788166152-dev.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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/dist/ams-checkout.min.js.map +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/modernElementController/index.js +2 -2
- package/esm/modern/component/channel.d.ts +21 -0
- package/esm/modern/component/component.inline.style.d.ts +10 -0
- package/esm/modern/component/component.popup.style.d.ts +26 -0
- package/esm/modern/component/popupWindow.style.d.ts +27 -0
- package/esm/modern/config/index.d.ts +23 -0
- package/esm/modern/config/request.d.ts +21 -0
- package/esm/modern/constant/auto-debit.d.ts +12 -0
- package/esm/modern/constant/easysafepay.d.ts +16 -0
- package/esm/modern/constant/element.d.ts +27 -0
- package/esm/modern/constant/index.d.ts +331 -0
- package/esm/modern/core/bus/ability/callback.d.ts +9 -0
- package/esm/modern/core/bus/ability/security.d.ts +10 -0
- package/esm/modern/core/bus/ability/tracker.d.ts +9 -0
- package/esm/modern/core/bus/index.d.ts +125 -0
- package/esm/modern/core/bus/interface.d.ts +36 -0
- package/esm/modern/core/component/address.d.ts +8 -0
- package/esm/modern/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/modern/core/component/ckp/index.d.ts +29 -0
- package/esm/modern/core/component/element/EventCenter/index.d.ts +41 -0
- package/esm/modern/core/component/element/config.d.ts +10 -0
- package/esm/modern/core/component/element/elementContainerService/containerService.d.ts +34 -0
- package/esm/modern/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/modern/core/component/element/elementController/index.d.ts +54 -0
- package/esm/modern/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/baseElementProcessor.d.ts +42 -0
- package/esm/modern/core/component/element/elementProcessor/convertPaymentMethods.d.ts +22 -0
- package/esm/modern/core/component/element/elementProcessor/paymentProcessor.d.ts +37 -0
- package/esm/modern/core/component/element/index.d.ts +17 -0
- package/esm/modern/core/component/element/mock.d.ts +10 -0
- package/esm/modern/core/component/element/modernElementController/adapter.d.ts +19 -0
- package/esm/modern/core/component/element/modernElementController/index.d.ts +172 -0
- package/esm/modern/core/component/element/type.d.ts +586 -0
- package/esm/modern/core/component/element/util.d.ts +93 -0
- package/esm/modern/core/component/index.d.ts +58 -0
- package/esm/modern/core/instance/index.d.ts +97 -0
- package/esm/modern/core/utils/connectConfig.d.ts +11 -0
- package/esm/modern/foundation/core/index.d.ts +36 -0
- package/esm/modern/foundation/index.d.ts +93 -0
- package/esm/modern/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/modern/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/modern/foundation/product-processor/easysafepay/deps.d.ts +20 -0
- package/esm/modern/foundation/product-processor/easysafepay/index.d.ts +29 -0
- package/esm/modern/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/modern/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/modern/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/modern/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/modern/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/modern/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/modern/foundation/service/container/index.d.ts +42 -0
- package/esm/modern/foundation/service/container/popup.d.ts +31 -0
- package/esm/modern/foundation/service/container/utils.d.ts +7 -0
- package/esm/modern/foundation/service/event-center.d.ts +82 -0
- package/esm/modern/foundation/service/global-data/index.d.ts +11 -0
- package/esm/modern/foundation/service/index.d.ts +19 -0
- package/esm/modern/foundation/service/log/index.d.ts +44 -0
- package/esm/modern/foundation/service/log/keys.d.ts +13 -0
- package/esm/modern/foundation/service/log/processor.d.ts +9 -0
- package/esm/modern/foundation/service/log/types.d.ts +33 -0
- package/esm/modern/foundation/service/requester/deps.d.ts +17 -0
- package/esm/modern/foundation/service/requester/requester.d.ts +22 -0
- package/esm/modern/foundation/service/security/index.d.ts +33 -0
- package/esm/modern/foundation/service/security/security.d.ts +54 -0
- package/esm/modern/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/modern/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/preload_helper.d.ts +24 -0
- package/esm/modern/foundation/utils/redirect_utils.d.ts +11 -0
- package/esm/modern/foundation/utils/system_events.d.ts +4 -0
- package/esm/modern/foundation/utils/web_app_url_utils.d.ts +114 -0
- package/esm/modern/index.js +1 -1
- package/esm/modern/loader/constant.d.ts +36 -0
- package/esm/modern/loader/utils/proxyPerformance.d.ts +20 -0
- package/esm/modern/main.d.ts +54 -0
- package/esm/modern/{index.d.ts → modern/index.d.ts} +1 -1
- package/esm/modern/modern/loadAntomTracker.d.ts +7 -0
- package/esm/modern/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/modern/preload/config.d.ts +10 -0
- package/esm/modern/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/modern/preload/preloadAntomElements.d.ts +9 -0
- package/esm/modern/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/modern/sdk/applepay-core/ApplePayHostService.d.ts +102 -0
- package/esm/modern/modern/sdk/elements/CVVElement.d.ts +144 -0
- package/esm/modern/modern/sdk/elements/PaymentElement.d.ts +204 -0
- package/esm/modern/modern/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/modern/sdk/elements/appearanceRulesDefaults.d.ts +2 -0
- package/esm/modern/modern/sdk/eventsMap.d.ts +135 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/PaymentSessionService.d.ts +69 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/definitions.d.ts +5311 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/preConnection.d.ts +6 -0
- package/esm/modern/modern/sdk/stageName.d.ts +3 -0
- package/esm/modern/modern/sdk/tools/awaitWrap.d.ts +14 -0
- package/esm/modern/modern/sdk/tools/buildPageUrl.d.ts +4 -0
- package/esm/modern/modern/sdk/tools/checkSessionData.d.ts +1 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePay.d.ts +9 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePayHostToken.d.ts +32 -0
- package/esm/modern/modern/sdk/tools/expressElement/types.d.ts +277 -0
- package/esm/modern/modern/sdk/tools/getDevReqConfig.d.ts +2 -0
- package/esm/modern/modern/sdk/tools/getLocaleFromRenderData.d.ts +6 -0
- package/esm/modern/modern/sdk/tools/getMetaData.d.ts +126 -0
- package/esm/modern/modern/sdk/tools/modalMessageMonitor.d.ts +41 -0
- package/esm/modern/modern/sdk/tools/openModal.d.ts +20 -0
- package/esm/modern/modern/sdk/tools/paymentElement/applePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/googlePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/tracker.d.ts +16 -0
- package/esm/modern/modern/sdk/tools/paymentElement/walletHostListeners.d.ts +19 -0
- package/esm/modern/modern/sdk/tools/preloadTracking.d.ts +5 -0
- package/esm/modern/modern/sdk/tools/showToast.d.ts +33 -0
- package/esm/modern/modern/sdk/tools/validatePaymentAmount.d.ts +19 -0
- package/esm/modern/modern/sdk/tracking/elementTracker.d.ts +65 -0
- package/esm/modern/modern/sdk/types.d.ts +310 -0
- package/esm/modern/modern/tools.d.ts +26 -0
- package/esm/modern/plugin/applepay/component.d.ts +50 -0
- package/esm/modern/plugin/applepay/index.d.ts +17 -0
- package/esm/modern/plugin/applepay/interface.d.ts +161 -0
- package/esm/modern/plugin/applepay/service.d.ts +54 -0
- package/esm/modern/plugin/component/cashierApp.d.ts +38 -0
- package/esm/modern/plugin/component/channel.d.ts +73 -0
- package/esm/modern/plugin/component/component.inline.style.d.ts +10 -0
- package/esm/modern/plugin/component/component.popup.style.d.ts +25 -0
- package/esm/modern/plugin/component/index.d.ts +133 -0
- package/esm/modern/plugin/component/popupWindow.style.d.ts +11 -0
- package/esm/modern/plugin/const.d.ts +2 -0
- package/esm/modern/plugin/payment-element/utils.d.ts +2 -0
- package/esm/modern/plugin/paypal/index.d.ts +20 -0
- package/esm/modern/plugin/type.d.ts +34 -0
- package/esm/modern/plugin/utils.d.ts +6 -0
- package/esm/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/preload/antomManifestAdapter.js +117 -0
- package/esm/modern/preload/config.d.ts +10 -0
- package/esm/modern/preload/config.js +37 -0
- package/esm/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/preload/gatewayPreconnection.js +213 -0
- package/esm/modern/preload/preloadAntomElements.d.ts +9 -0
- package/esm/modern/preload/preloadAntomElements.js +95 -0
- package/esm/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/preload/startAntomPreload.js +9 -0
- package/esm/modern/request/index.d.ts +9 -0
- package/esm/modern/request/utils.d.ts +28 -0
- package/esm/modern/service/index.d.ts +13 -0
- package/esm/modern/tools.js +1 -1
- package/esm/modern/types/index.d.ts +856 -0
- package/esm/modern/util/beforeConfirm.d.ts +14 -0
- package/esm/modern/util/createIframeNode.d.ts +6 -0
- package/esm/modern/util/debug.d.ts +1 -0
- package/esm/modern/util/get.d.ts +25 -0
- package/esm/modern/util/getBackScheme.d.ts +5 -0
- package/esm/modern/util/index.d.ts +61 -0
- package/esm/modern/util/jshield-apdid/apdid-loader.d.ts +89 -0
- package/esm/modern/util/jshield-apdid/index.d.ts +21 -0
- package/esm/modern/util/logger.d.ts +67 -0
- package/esm/modern/util/mock.d.ts +1 -0
- package/esm/modern/util/redirect.d.ts +6 -0
- package/esm/modern/util/security-registry.d.ts +72 -0
- package/esm/modern/util/security.d.ts +55 -0
- package/esm/modern/util/spm-map.d.ts +217 -0
- package/esm/modern/util/storage.d.ts +2 -0
- package/esm/modern/util/timezone.d.ts +1 -0
- package/esm/modern/util/upgrade.d.ts +39 -0
- package/esm/modern/util/versionCompare.d.ts +15 -0
- package/esm/util/logger.js +1 -1
- package/package.json +2 -1
- package/types.d.ts +17 -2
- package/types.untrimmed.d.ts +35 -2
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import type { ShippingInfo } from "../../../modern/index";
|
|
2
|
+
import { ActionForm, ConnectErrorCode, IAmount, IAmountView, IMerchantAppointParam, IPaymentMethod } from '../../../types';
|
|
3
|
+
import AddressProcessor from './elementProcessor/addressProcessor';
|
|
4
|
+
import AuthProcessor from './elementProcessor/authProcessor';
|
|
5
|
+
import PaymentProcessor from './elementProcessor/paymentProcessor';
|
|
6
|
+
/**
|
|
7
|
+
* element 消息事件名
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ElementPaymentEvent {
|
|
10
|
+
RENDER_COMPONENT = "renderComponent",
|
|
11
|
+
CAPTURE_ASSET = "onCaptureAsset",
|
|
12
|
+
SIGN_OUT = "onSignout",
|
|
13
|
+
BLUR = "onBlur",
|
|
14
|
+
SUBMIT_PAY = "submitPay",
|
|
15
|
+
VALIDATE = "onValidate",
|
|
16
|
+
SUBMIT_RISK = "onSubmitRisk",
|
|
17
|
+
AFTER_SUBMIT = "onAfterSubmit",
|
|
18
|
+
SIZE_CHANGE = "onSizeChange",
|
|
19
|
+
LAUNCH = "onLaunch",
|
|
20
|
+
CALLBACK = "callback",
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated 已废弃 请使用eventCallback
|
|
23
|
+
*/
|
|
24
|
+
SEND_MUITI_APP_EVENT_TO_SDK = "sendMuitiAppEventToSdk",
|
|
25
|
+
LOG = "log",
|
|
26
|
+
HANDLE_PAYMENT = "handlePayment",
|
|
27
|
+
ON_EVENT_CALLBACK = "onEventCallback"
|
|
28
|
+
}
|
|
29
|
+
export declare enum ElementPaymentMethod {
|
|
30
|
+
CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
|
|
31
|
+
AUTH_ELEMENT = "AUTH_ELEMENT",
|
|
32
|
+
ADDRESS_ELEMENT = "ADDRESS_ELEMENT",
|
|
33
|
+
PAYMENT_ELEMENT = "PAYMENT_ELEMENT"
|
|
34
|
+
}
|
|
35
|
+
export declare enum ElementType {
|
|
36
|
+
auth = "auth",
|
|
37
|
+
address = "address",
|
|
38
|
+
payment = "payment"
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* TODO 替换外外网链接
|
|
42
|
+
* 支付状态参考: https://yuque.antfin.com/antom_ka_team/yg9y7x/fe8xxqgbivnx5fd2#rGgE
|
|
43
|
+
*/
|
|
44
|
+
export declare enum PaymentStatus {
|
|
45
|
+
SUCCESS = "SUCCESS",
|
|
46
|
+
PROCESSING = "PROCESSING",
|
|
47
|
+
CANCELLED = "CANCELLED",
|
|
48
|
+
PENDING = "PENDING",
|
|
49
|
+
S = "SUCCESS",
|
|
50
|
+
F = "FAIL",
|
|
51
|
+
U = "PROCESSING",
|
|
52
|
+
FAIL = "FAIL"
|
|
53
|
+
}
|
|
54
|
+
export declare const MountElementType: {
|
|
55
|
+
auth: ElementPaymentMethod;
|
|
56
|
+
address: ElementPaymentMethod;
|
|
57
|
+
payment: ElementPaymentMethod;
|
|
58
|
+
AUTH_ELEMENT: ElementType;
|
|
59
|
+
ADDRESS_ELEMENT: ElementType;
|
|
60
|
+
PAYMENT_ELEMENT: ElementType;
|
|
61
|
+
};
|
|
62
|
+
export declare enum ThemeType {
|
|
63
|
+
NostalgicGray = "nostalgicGray",
|
|
64
|
+
Default = "default",
|
|
65
|
+
Night = "night",
|
|
66
|
+
CherryBlossomPink = "cherryBlossomPink",
|
|
67
|
+
GamingPurple = "gamingPurple",
|
|
68
|
+
AgateGreen = "agateGreen"
|
|
69
|
+
}
|
|
70
|
+
export declare enum PaymentElementLayout {
|
|
71
|
+
Tabs = "tabs",
|
|
72
|
+
Accordion = "Accordion"
|
|
73
|
+
}
|
|
74
|
+
export declare const addressTheme: {
|
|
75
|
+
default: string;
|
|
76
|
+
night: string;
|
|
77
|
+
};
|
|
78
|
+
export declare enum EventCallbackCode {
|
|
79
|
+
SDK_CREATE_COMPONENT_ERROR = "SDK_CREATE_COMPONENT_ERROR",
|
|
80
|
+
SDK_CREATEPAYMENT_PARAMETER_ERROR = "SDK_CREATEPAYMENT_PARAMETER_ERROR",
|
|
81
|
+
SDK_PAYMENT_ERROR = "SDK_PAYMENT_ERROR",
|
|
82
|
+
SDK_PAYMENT_FAIL = "SDK_PAYMENT_FAIL",
|
|
83
|
+
SDK_PAYMENT_CANCEL = "SDK_PAYMENT_CANCEL",
|
|
84
|
+
SDK_PAYMENT_SUCCESSFUL = "SDK_PAYMENT_SUCCESSFUL",
|
|
85
|
+
SDK_PAYMENT_PROCESSING = "SDK_PAYMENT_PROCESSING"
|
|
86
|
+
}
|
|
87
|
+
export declare enum ELEMENT_ENVIRONMENT {
|
|
88
|
+
DEV = "DEV",
|
|
89
|
+
TEST = "TEST",
|
|
90
|
+
SIT = "SIT",
|
|
91
|
+
PRE = "PRE",
|
|
92
|
+
PROD = "PROD",
|
|
93
|
+
SANDBOX = "SANDBOX"
|
|
94
|
+
}
|
|
95
|
+
type ELEMENT_ENVIRONMENT_VALUE = 'dev' | 'test' | 'sit' | 'pre' | 'prod' | 'sandbox';
|
|
96
|
+
export type ELEMENT_ENVIRONMENT_TYPE = keyof typeof ELEMENT_ENVIRONMENT | (typeof ELEMENT_ENVIRONMENT)[keyof typeof ELEMENT_ENVIRONMENT] | ELEMENT_ENVIRONMENT_VALUE;
|
|
97
|
+
export interface AddressMountComponentsParams {
|
|
98
|
+
configParams?: AddressMountConfig;
|
|
99
|
+
prefillValue: Array<AddressSubmitData>;
|
|
100
|
+
sessionData: string;
|
|
101
|
+
appearance: {
|
|
102
|
+
themeType: string;
|
|
103
|
+
};
|
|
104
|
+
debugProps?: {
|
|
105
|
+
localLink: string;
|
|
106
|
+
};
|
|
107
|
+
elementProps?: {
|
|
108
|
+
elementLink: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
interface BaseMountOptions<T = void> {
|
|
112
|
+
configParams?: T;
|
|
113
|
+
debugProps?: {
|
|
114
|
+
localLink: string;
|
|
115
|
+
};
|
|
116
|
+
elementProps?: {
|
|
117
|
+
elementLink: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
type HideField = 'shippingCountry' | 'shippingName' | 'shippingPhoneNo' | 'shippingRegion' | 'shippingAddress1' | 'shippingZipCode' | 'shippingAddress2';
|
|
121
|
+
interface AddressMountConfig {
|
|
122
|
+
/**
|
|
123
|
+
* 是否开启地址联想功能
|
|
124
|
+
* 0 开启
|
|
125
|
+
* 1 关闭
|
|
126
|
+
*/
|
|
127
|
+
autoSaveAsDefaultAddress?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* 隐藏部分地址要素
|
|
130
|
+
*/
|
|
131
|
+
hideFields?: Array<HideField>;
|
|
132
|
+
}
|
|
133
|
+
export interface AddressMountOptions extends BaseMountOptions<AddressMountConfig> {
|
|
134
|
+
type: ElementType.address;
|
|
135
|
+
prefillValue: Array<AddressSubmitData>;
|
|
136
|
+
appearance?: {
|
|
137
|
+
theme?: ThemeType.Default | ThemeType.Night;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export interface LinkAuthMountOptions extends BaseMountOptions {
|
|
141
|
+
type: ElementType.auth;
|
|
142
|
+
appearance?: {
|
|
143
|
+
theme?: ThemeType;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
type ToCamelCase<S extends string> = S extends `${infer First}-${infer Rest}` ? `${First}${Capitalize<ToCamelCase<Rest>>}` : S;
|
|
147
|
+
type CompatibleVariables<T extends Record<string, string>> = {
|
|
148
|
+
[K in keyof T as K | ToCamelCase<K & string>]: string;
|
|
149
|
+
};
|
|
150
|
+
export interface PaymentMountOptions extends BaseMountOptions {
|
|
151
|
+
type: ElementType.payment;
|
|
152
|
+
appearance?: {
|
|
153
|
+
theme?: ThemeType | `APR_${string}`;
|
|
154
|
+
layout?: {
|
|
155
|
+
type: PaymentElementLayout;
|
|
156
|
+
};
|
|
157
|
+
variables?: Partial<CompatibleVariables<{
|
|
158
|
+
'content-primary': string;
|
|
159
|
+
'content-secondary': string;
|
|
160
|
+
'content-tertiary': string;
|
|
161
|
+
'content-quaternary': string;
|
|
162
|
+
'background-primary': string;
|
|
163
|
+
'background-secondary': string;
|
|
164
|
+
'background-disable': string;
|
|
165
|
+
'background-transparency': string;
|
|
166
|
+
'border-primary': string;
|
|
167
|
+
'border-secondary': string;
|
|
168
|
+
'border-disable': string;
|
|
169
|
+
'action-normal': string;
|
|
170
|
+
'action-hover': string;
|
|
171
|
+
'action-disable': string;
|
|
172
|
+
'action-secondary': string;
|
|
173
|
+
'state-failure': string;
|
|
174
|
+
'state-warning': string;
|
|
175
|
+
'state-success': string;
|
|
176
|
+
'state-info': string;
|
|
177
|
+
'state-marketing': string;
|
|
178
|
+
'state-conventional': string;
|
|
179
|
+
'radius-backup': string;
|
|
180
|
+
'radius-module': string;
|
|
181
|
+
'radius-component': string;
|
|
182
|
+
'radius-button': string;
|
|
183
|
+
'wrapper-padding': string;
|
|
184
|
+
'stroke-default': string;
|
|
185
|
+
'stroke-active': string;
|
|
186
|
+
}>>;
|
|
187
|
+
card?: {
|
|
188
|
+
showBrandIcon?: boolean;
|
|
189
|
+
};
|
|
190
|
+
accordion?: {
|
|
191
|
+
showRadio?: boolean;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
notRedirectAfterComplete?: boolean;
|
|
195
|
+
merchantAppointParam?: IMerchantAppointParam;
|
|
196
|
+
/**
|
|
197
|
+
* 支付方式配置
|
|
198
|
+
*
|
|
199
|
+
* 使用说明:
|
|
200
|
+
* - preview: true 时生效,用于配置预览展示的支付方式和外观
|
|
201
|
+
* - preview: false/undefined 时,此配置被忽略,支付方式来自后端 sdkAction.query 接口
|
|
202
|
+
*/
|
|
203
|
+
previewPaymentMethods?: {
|
|
204
|
+
/**
|
|
205
|
+
* 极速支付配置
|
|
206
|
+
*/
|
|
207
|
+
expressCheckout?: {
|
|
208
|
+
enabled: boolean;
|
|
209
|
+
methods?: {
|
|
210
|
+
/**
|
|
211
|
+
* 支付方式显示名称,如 "Apple Pay"
|
|
212
|
+
*/
|
|
213
|
+
paymentMethodName: string;
|
|
214
|
+
/**
|
|
215
|
+
* 支付方式类型,如 "APPLEPAY"
|
|
216
|
+
*/
|
|
217
|
+
paymentMethodType: string;
|
|
218
|
+
}[];
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* 支持的支付方式列表
|
|
222
|
+
* 数组顺序即为前端展示顺序
|
|
223
|
+
*/
|
|
224
|
+
supportedMethods?: {
|
|
225
|
+
/**
|
|
226
|
+
* 支付方式显示名称,如 "CARD", "AlipayHK"
|
|
227
|
+
*/
|
|
228
|
+
paymentMethodName: string;
|
|
229
|
+
/**
|
|
230
|
+
* 支付方式类型,如 "VISA", "ALIPAY_HK"
|
|
231
|
+
*/
|
|
232
|
+
paymentMethodType: string;
|
|
233
|
+
/**
|
|
234
|
+
* 支付方式图标 URL
|
|
235
|
+
*/
|
|
236
|
+
logoUrl?: string;
|
|
237
|
+
}[];
|
|
238
|
+
/**
|
|
239
|
+
* 推荐支付方式
|
|
240
|
+
* 值为 paymentMethodType,匹配的支付方式会被标记为 recommend
|
|
241
|
+
*/
|
|
242
|
+
topping?: string;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export declare enum AddressEventCallbackName {
|
|
246
|
+
SHIPPING_CHANGE = "SHIPPING_CHANGE"
|
|
247
|
+
}
|
|
248
|
+
interface BaseMountResult {
|
|
249
|
+
}
|
|
250
|
+
export interface AddressMountResult extends BaseMountResult {
|
|
251
|
+
on: (event: AddressEventCallbackName, callback: (data: any) => void) => void;
|
|
252
|
+
}
|
|
253
|
+
export interface LinkAuthMountResult extends BaseMountResult {
|
|
254
|
+
}
|
|
255
|
+
export interface PaymentMountResult extends BaseMountResult {
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* connect element之间通信的类型格式
|
|
259
|
+
*/
|
|
260
|
+
export interface ConnectElementMessageDataType<T = {}> {
|
|
261
|
+
source?: ElementPaymentMethod;
|
|
262
|
+
target?: ElementPaymentMethod;
|
|
263
|
+
data?: T;
|
|
264
|
+
event?: ElementPaymentEvent;
|
|
265
|
+
}
|
|
266
|
+
export interface ValidateResult<T = {}> {
|
|
267
|
+
success: boolean;
|
|
268
|
+
data: {
|
|
269
|
+
success: boolean;
|
|
270
|
+
status: PaymentStatus;
|
|
271
|
+
message?: string;
|
|
272
|
+
data: T;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
export interface AuthSubmitData {
|
|
276
|
+
accountInfo: {
|
|
277
|
+
email: string;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
export interface PaymentSubmitData {
|
|
281
|
+
paymentMethod: {
|
|
282
|
+
paymentMethodType: string;
|
|
283
|
+
paymentMethodDetail?: {
|
|
284
|
+
cardNo?: string;
|
|
285
|
+
};
|
|
286
|
+
cardHolderName?: {
|
|
287
|
+
firstName: string;
|
|
288
|
+
};
|
|
289
|
+
lastName: string;
|
|
290
|
+
};
|
|
291
|
+
paymentFactors: {
|
|
292
|
+
paymentRedirectUrl: string;
|
|
293
|
+
paymentMethodId?: string;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
export interface AddressSubmitData {
|
|
297
|
+
shippingName: {
|
|
298
|
+
firstName: string;
|
|
299
|
+
lastName: string;
|
|
300
|
+
};
|
|
301
|
+
shippingPhoneNo: string;
|
|
302
|
+
shippingAddress: {
|
|
303
|
+
region: string;
|
|
304
|
+
address1: string;
|
|
305
|
+
address2: string;
|
|
306
|
+
city?: string;
|
|
307
|
+
province?: string;
|
|
308
|
+
zipCode: string;
|
|
309
|
+
districts?: string[];
|
|
310
|
+
districtValues?: {
|
|
311
|
+
[key: string]: string;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
notes: string;
|
|
315
|
+
prefer: '1' | '0';
|
|
316
|
+
shippingId: string;
|
|
317
|
+
actionFlag?: 'I' | 'U' | 'D';
|
|
318
|
+
}
|
|
319
|
+
export interface SubmitFuncParams {
|
|
320
|
+
handleActions?: boolean;
|
|
321
|
+
shippingInfo?: ShippingInfo;
|
|
322
|
+
/**
|
|
323
|
+
* Amount displayed on the Apple Pay payment sheet, e.g. '10.99'.
|
|
324
|
+
* Display only; actual charge amount is controlled by server.
|
|
325
|
+
* Must be provided together with `currency`. Only effective for Apple Pay.
|
|
326
|
+
*/
|
|
327
|
+
amount?: string;
|
|
328
|
+
/**
|
|
329
|
+
* Currency code displayed on the Apple Pay payment sheet, e.g. 'USD'.
|
|
330
|
+
* Follows ISO 4217 standard. Must be provided together with `amount`. Only effective for Apple Pay.
|
|
331
|
+
*/
|
|
332
|
+
currency?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Pre-confirmation callback. Executed after user authorization but before actual charge,
|
|
335
|
+
* allowing merchant to create order at this point.
|
|
336
|
+
* - Apple Pay: invoked via event bridge after user FaceID/TouchID authorization
|
|
337
|
+
* - Other payment methods: invoked before the submit message is sent
|
|
338
|
+
* - Return true: proceed with charge
|
|
339
|
+
* - Return false / throw error: abort payment, returns MERCHANT_CONFIRM_ABORT error code
|
|
340
|
+
* - Timeout: abort payment, returns MERCHANT_CONFIRM_TIMEOUT error code
|
|
341
|
+
*/
|
|
342
|
+
onBeforeConfirm?: () => Promise<boolean>;
|
|
343
|
+
}
|
|
344
|
+
export interface SubmitServiceParams extends PaymentSubmitData {
|
|
345
|
+
accountInfo: AuthSubmitData['accountInfo'];
|
|
346
|
+
shipping?: AddressSubmitData;
|
|
347
|
+
}
|
|
348
|
+
interface SubmitResultActionForm extends ActionForm {
|
|
349
|
+
paymentCodeExpireTime: string;
|
|
350
|
+
}
|
|
351
|
+
export interface SubmitServiceResult {
|
|
352
|
+
success: boolean;
|
|
353
|
+
errorCode: ConnectErrorCode;
|
|
354
|
+
errorMessage: string;
|
|
355
|
+
errorStatus: string;
|
|
356
|
+
traceId: string;
|
|
357
|
+
actionForm?: SubmitResultActionForm;
|
|
358
|
+
codeFormViews?: Array<{
|
|
359
|
+
codeExpireTime?: string;
|
|
360
|
+
}>;
|
|
361
|
+
}
|
|
362
|
+
export interface SubmitFuncResult {
|
|
363
|
+
success: boolean;
|
|
364
|
+
msg: string;
|
|
365
|
+
}
|
|
366
|
+
declare enum AccountStatusEnum {
|
|
367
|
+
EFFECTIVE = "EFFECTIVE",
|
|
368
|
+
UNREGISTERED = "UNREGISTERED"
|
|
369
|
+
}
|
|
370
|
+
type IAccountInfo = {
|
|
371
|
+
email?: string;
|
|
372
|
+
verifyId?: string;
|
|
373
|
+
accountStatus?: AccountStatusEnum;
|
|
374
|
+
oneAccountId?: string;
|
|
375
|
+
needOtp?: boolean;
|
|
376
|
+
errorMsg?: string;
|
|
377
|
+
inputStatus?: 'success' | 'loading' | 'error' | 'focused' | '';
|
|
378
|
+
resendLeftTimes?: number;
|
|
379
|
+
};
|
|
380
|
+
interface ShippingsItem {
|
|
381
|
+
shippingName: {
|
|
382
|
+
firstName: string;
|
|
383
|
+
lastName: string;
|
|
384
|
+
};
|
|
385
|
+
prefer: '1' | '0';
|
|
386
|
+
shippingId: string;
|
|
387
|
+
shippingPhoneNo: string;
|
|
388
|
+
shippingAddress: {
|
|
389
|
+
region: string;
|
|
390
|
+
state: string;
|
|
391
|
+
city: string;
|
|
392
|
+
address1: string;
|
|
393
|
+
address2: string;
|
|
394
|
+
zipCode: string;
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
interface Estimate {
|
|
398
|
+
unit: string;
|
|
399
|
+
value: number;
|
|
400
|
+
}
|
|
401
|
+
interface DeliveryEstimate {
|
|
402
|
+
maximum: Estimate;
|
|
403
|
+
minimum: Estimate;
|
|
404
|
+
}
|
|
405
|
+
interface FixedAmount {
|
|
406
|
+
amount: number;
|
|
407
|
+
currency: string;
|
|
408
|
+
}
|
|
409
|
+
interface ShippingRateData {
|
|
410
|
+
displayName: string;
|
|
411
|
+
deliveryEstimate: DeliveryEstimate;
|
|
412
|
+
fixedAmount: FixedAmount;
|
|
413
|
+
}
|
|
414
|
+
interface ShippingAddress {
|
|
415
|
+
address1: string;
|
|
416
|
+
address2: string;
|
|
417
|
+
city: string;
|
|
418
|
+
region: string;
|
|
419
|
+
state: string;
|
|
420
|
+
zipCode: string;
|
|
421
|
+
}
|
|
422
|
+
interface IUserName {
|
|
423
|
+
firstName: string;
|
|
424
|
+
middleName?: string;
|
|
425
|
+
lastName: string;
|
|
426
|
+
fullName?: string;
|
|
427
|
+
}
|
|
428
|
+
type Shippings = ShippingsItem[];
|
|
429
|
+
type IPaymentMethods = IPaymentMethod[];
|
|
430
|
+
export interface CKPShipping {
|
|
431
|
+
shippingRateId?: string;
|
|
432
|
+
shippingRateData?: ShippingRateData;
|
|
433
|
+
shippingAddress: ShippingAddress;
|
|
434
|
+
shippingFee?: IAmount;
|
|
435
|
+
shippingFeeView?: IAmountView;
|
|
436
|
+
shippingDescription?: string;
|
|
437
|
+
deliveryEstimate?: DeliveryEstimate;
|
|
438
|
+
shippingFeeId?: string;
|
|
439
|
+
shippingName?: IUserName;
|
|
440
|
+
shippingPhoneNo?: string;
|
|
441
|
+
shipToEmail?: string;
|
|
442
|
+
notes?: string;
|
|
443
|
+
}
|
|
444
|
+
export interface AccountQueryRequest {
|
|
445
|
+
paymentSessionData: string;
|
|
446
|
+
paymentSessionConfig: any;
|
|
447
|
+
accountInfo: IAccountInfo;
|
|
448
|
+
}
|
|
449
|
+
export interface AccountQueryResult {
|
|
450
|
+
accountInfo: IAccountInfo;
|
|
451
|
+
actionForm?: ActionForm;
|
|
452
|
+
paymentMethods: IPaymentMethods;
|
|
453
|
+
shippings: Shippings;
|
|
454
|
+
success: boolean;
|
|
455
|
+
errorCode?: string;
|
|
456
|
+
errorMessage?: string;
|
|
457
|
+
errorStatus?: string;
|
|
458
|
+
shippingInfo?: CKPShipping;
|
|
459
|
+
}
|
|
460
|
+
export interface IElementOptions {
|
|
461
|
+
sessionData: string;
|
|
462
|
+
environment?: ELEMENT_ENVIRONMENT_TYPE;
|
|
463
|
+
locale?: string;
|
|
464
|
+
version?: string;
|
|
465
|
+
appearance?: {
|
|
466
|
+
theme: ThemeType.Default | ThemeType.Night;
|
|
467
|
+
};
|
|
468
|
+
onEventCallback?: ({ code, message, result }: {
|
|
469
|
+
code: EventCallbackCode;
|
|
470
|
+
message: string;
|
|
471
|
+
result?: any;
|
|
472
|
+
}) => void;
|
|
473
|
+
loading?: {
|
|
474
|
+
onStartLoading: () => void;
|
|
475
|
+
onEndLoading: () => void;
|
|
476
|
+
};
|
|
477
|
+
/**
|
|
478
|
+
* 预览模式开关
|
|
479
|
+
* - true / 'web': 跳过真实 API 请求,使用 mock 数据,按 WebElement(inline)方式渲染(向后兼容,等同于 'web')
|
|
480
|
+
* - 'mobile': 跳过真实 API 请求,使用 mock 数据,按 MobileElement(popup)方式渲染,用于 mobileElement 降级预览
|
|
481
|
+
* - false / undefined: 发起真实请求(默认行为)
|
|
482
|
+
*
|
|
483
|
+
* 使用场景:B 端配置后台预览,C 端生产环境不应使用
|
|
484
|
+
*/
|
|
485
|
+
preview?: boolean | 'web' | 'mobile';
|
|
486
|
+
}
|
|
487
|
+
export interface IElementProcessors {
|
|
488
|
+
[ElementType.auth]: AuthProcessor;
|
|
489
|
+
[ElementType.address]: AddressProcessor;
|
|
490
|
+
[ElementType.payment]: PaymentProcessor;
|
|
491
|
+
}
|
|
492
|
+
export interface IToastOptions {
|
|
493
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
494
|
+
backgroundColor?: string;
|
|
495
|
+
color?: string;
|
|
496
|
+
padding?: string;
|
|
497
|
+
borderRadius?: string;
|
|
498
|
+
fontSize?: string;
|
|
499
|
+
zIndex?: number;
|
|
500
|
+
width?: string;
|
|
501
|
+
duration?: number;
|
|
502
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
503
|
+
spin?: boolean;
|
|
504
|
+
}
|
|
505
|
+
interface IPaymentSession {
|
|
506
|
+
nextAction: INextAction;
|
|
507
|
+
}
|
|
508
|
+
interface INextAction {
|
|
509
|
+
normalUrl: string;
|
|
510
|
+
applinkUrl?: string;
|
|
511
|
+
schemeUrl?: string;
|
|
512
|
+
}
|
|
513
|
+
export interface ICommonApiResponse {
|
|
514
|
+
error?: {
|
|
515
|
+
code: string;
|
|
516
|
+
message: string;
|
|
517
|
+
traceId?: string;
|
|
518
|
+
context?: any;
|
|
519
|
+
needChangeSessionForRetry?: boolean;
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
export interface IPaymentApiResponse extends ICommonApiResponse {
|
|
523
|
+
status: keyof typeof PaymentStatus | '';
|
|
524
|
+
userCanceled3D?: boolean;
|
|
525
|
+
session?: IPaymentSession;
|
|
526
|
+
}
|
|
527
|
+
export declare class InvalidElementConfigError extends Error {
|
|
528
|
+
errors: Array<{
|
|
529
|
+
field: keyof IElementOptions;
|
|
530
|
+
message: string;
|
|
531
|
+
}>;
|
|
532
|
+
constructor(errors: Array<{
|
|
533
|
+
field: keyof IElementOptions;
|
|
534
|
+
message: string;
|
|
535
|
+
}>);
|
|
536
|
+
}
|
|
537
|
+
export declare enum EXPOSURE_API_EVENT {
|
|
538
|
+
DESTORY = "destroy",
|
|
539
|
+
MOUNT = "mount",
|
|
540
|
+
SUBMITPAYMENT = "submitPayment",
|
|
541
|
+
VALIDATAFIELDS = "validateFields",
|
|
542
|
+
UPDATEPAYMENT = "updatePayment"
|
|
543
|
+
}
|
|
544
|
+
export declare enum EVENTNAME {
|
|
545
|
+
PAYMENTMETHODCHANGED = "paymentMethodChanged",
|
|
546
|
+
BILLINGADDRESSCHANGED = "billingAddressChanged"
|
|
547
|
+
}
|
|
548
|
+
interface PaymentMethodChangedData {
|
|
549
|
+
type: string;
|
|
550
|
+
name: string;
|
|
551
|
+
}
|
|
552
|
+
interface BillingAddressChangedData {
|
|
553
|
+
sameAsShipping: boolean;
|
|
554
|
+
billingAddress: {
|
|
555
|
+
region: string;
|
|
556
|
+
state: string;
|
|
557
|
+
city: string;
|
|
558
|
+
address1: string;
|
|
559
|
+
address2: string;
|
|
560
|
+
zipCode: string;
|
|
561
|
+
phoneNo: string;
|
|
562
|
+
name: {
|
|
563
|
+
firstName: string;
|
|
564
|
+
lastName: string;
|
|
565
|
+
middleName: string;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
export interface EventDataMap {
|
|
570
|
+
[EVENTNAME.PAYMENTMETHODCHANGED]: PaymentMethodChangedData;
|
|
571
|
+
[EVENTNAME.BILLINGADDRESSCHANGED]: BillingAddressChangedData;
|
|
572
|
+
}
|
|
573
|
+
export interface IElementController {
|
|
574
|
+
mount(renderOptions: PaymentMountOptions, sdkSelector: string): Promise<ICommonApiResponse>;
|
|
575
|
+
submitPayment(params: SubmitFuncParams): Promise<IPaymentApiResponse>;
|
|
576
|
+
validateFields(): Promise<{
|
|
577
|
+
isValid: boolean;
|
|
578
|
+
}>;
|
|
579
|
+
/**
|
|
580
|
+
* @deprecated 不要使用,internal experiment方法
|
|
581
|
+
*/
|
|
582
|
+
updatePayment(paymentSessionData: string): Promise<boolean>;
|
|
583
|
+
destroy(): void;
|
|
584
|
+
on<T extends EVENTNAME>(event: T, callback: (data: EventDataMap[T]) => void): void;
|
|
585
|
+
}
|
|
586
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { IElementStatus } from '../../../foundation';
|
|
2
|
+
import { CashierSdkActionQueryResult, DisplayTypeEnum, Ianalytics, IPaymentSessionMetaData } from '../../../types';
|
|
3
|
+
import { ContainerController } from './elementContainerService/containerService';
|
|
4
|
+
import { ELEMENT_ENVIRONMENT_TYPE, EventCallbackCode, IElementOptions, IToastOptions } from './type';
|
|
5
|
+
export declare const formatElementOption: (options: IElementOptions) => {
|
|
6
|
+
environment: ELEMENT_ENVIRONMENT_TYPE;
|
|
7
|
+
sessionData: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
appearance?: {
|
|
11
|
+
theme: import("./type").ThemeType.Default | import("./type").ThemeType.Night;
|
|
12
|
+
};
|
|
13
|
+
onEventCallback?: ({ code, message, result }: {
|
|
14
|
+
code: EventCallbackCode;
|
|
15
|
+
message: string;
|
|
16
|
+
result?: any;
|
|
17
|
+
}) => void;
|
|
18
|
+
loading?: {
|
|
19
|
+
onStartLoading: () => void;
|
|
20
|
+
onEndLoading: () => void;
|
|
21
|
+
};
|
|
22
|
+
preview?: boolean | "web" | "mobile";
|
|
23
|
+
};
|
|
24
|
+
export declare const validateElementOption: (options: IElementOptions) => {
|
|
25
|
+
isValid: boolean;
|
|
26
|
+
errors: any[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 校验渲染条件
|
|
30
|
+
* 1.校验当前 sdkSelector 结点是否存在
|
|
31
|
+
* 2.校验当前 Element 的状态是否能够渲染
|
|
32
|
+
* 3.校验当前 type 类型 Elment 是否已经执行过 mount
|
|
33
|
+
*/
|
|
34
|
+
export declare function checkCanMount({ sdkSelector, containerService, status, }: {
|
|
35
|
+
sdkSelector: string;
|
|
36
|
+
containerService: ContainerController;
|
|
37
|
+
status: IElementStatus;
|
|
38
|
+
}): {
|
|
39
|
+
success: boolean;
|
|
40
|
+
errorMsg?: string;
|
|
41
|
+
error?: {
|
|
42
|
+
code: string;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare function checkCanUpdate({ status, paymentContainerService, newPaymentSessionData, oldPaymentSessionData, }: {
|
|
47
|
+
status: IElementStatus;
|
|
48
|
+
paymentContainerService: ContainerController;
|
|
49
|
+
newPaymentSessionData: string;
|
|
50
|
+
oldPaymentSessionData: string;
|
|
51
|
+
}): boolean;
|
|
52
|
+
export declare function generateIframeSrc({ paymentSessionObj, paymentSession, instanceId, environment, appVersion, analytics, locale, pageUrl, link, renderDisplayType, }: {
|
|
53
|
+
paymentSessionObj: IPaymentSessionMetaData;
|
|
54
|
+
paymentSession: string;
|
|
55
|
+
environment: string;
|
|
56
|
+
analytics: Ianalytics;
|
|
57
|
+
locale: string;
|
|
58
|
+
instanceId: string;
|
|
59
|
+
pageUrl: string;
|
|
60
|
+
appVersion: string;
|
|
61
|
+
link?: string;
|
|
62
|
+
/**
|
|
63
|
+
* iframe 中 checkout-v2 的渲染形态。
|
|
64
|
+
* - inline(默认): WebElement 渲染
|
|
65
|
+
* - popup: MobileElement 渲染(用于 mobileElement 降级预览)
|
|
66
|
+
*/
|
|
67
|
+
renderDisplayType?: DisplayTypeEnum;
|
|
68
|
+
}): string;
|
|
69
|
+
export declare function handleRedirect(data: any, fromFastSdk: boolean, eventCallback: ({ code, message }: {
|
|
70
|
+
code: any;
|
|
71
|
+
message: any;
|
|
72
|
+
}) => void): void;
|
|
73
|
+
export declare function redirect(data: {
|
|
74
|
+
normalUrl?: string;
|
|
75
|
+
schemeUrl?: string;
|
|
76
|
+
applinkUrl?: string;
|
|
77
|
+
callAppJudgeTime?: number;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
export declare function showToast(options?: IToastOptions, callback?: Function): void;
|
|
80
|
+
export declare const isElementMobile: () => boolean;
|
|
81
|
+
/**
|
|
82
|
+
* @description judge whether the device is a pad, by userAgent and screen aspect ratio, but not accurate
|
|
83
|
+
*/
|
|
84
|
+
export declare const isElementPad: () => boolean;
|
|
85
|
+
export declare const isElementPC: () => boolean;
|
|
86
|
+
/**
|
|
87
|
+
* 判断是否需要加载错误页
|
|
88
|
+
* @param {CashierSdkActionQueryResult} params
|
|
89
|
+
* @returns {boolean} - 是否需要加载错误页
|
|
90
|
+
*/
|
|
91
|
+
export declare const isLoadErrorPage: (params: CashierSdkActionQueryResult) => boolean;
|
|
92
|
+
export declare const safeStringify: (payload: any, defaultValue?: string) => string;
|
|
93
|
+
export declare const safeParse: (payload: any, defaultValue?: Record<string, any>) => Record<string, any>;
|