@alipay/ams-checkout 2.0.26 → 2.0.28

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/types.d.ts CHANGED
@@ -208,18 +208,20 @@ export declare type AntomLayouts = 'tabs' | 'accordion';
208
208
  */
209
209
  export declare class AntomSDK extends BaseElementsFactory {
210
210
  static version: string;
211
+ private stopModalMessageMonitor;
211
212
  constructor(config?: AntomSDKConfig);
212
213
  protected canUseElements(): Array<ElementListItemType>;
213
214
  /**
214
215
  * @description 更新配置
215
216
  */
216
217
  updateConfig(config: Partial<BaseFactoryConfig>): void;
218
+ destroy(): void;
217
219
  /* Excluded from this release type: redirect */
218
220
  /* Excluded from this release type: openModal */
219
221
  elements(): Elements;
220
222
  createElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
221
223
  createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
222
- createElement(elementType: 'CVV', options?: CVVAppConfig): CVVElement;
224
+ createElement(elementType: 'CVV', options: CVVAppConfig): CVVElement;
223
225
  createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
224
226
  getElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
225
227
  getElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
@@ -291,9 +293,29 @@ export declare const AntomSDKErrorCodes: {
291
293
  */
292
294
  readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
293
295
  /**
294
- * @description 金额格式非法(仅允许整数和小数)
296
+ * @description 金额格式非法(仅允许 ASCII 数字字符串)
295
297
  */
296
298
  readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
299
+ /**
300
+ * @description Amount currency does not match the payment session currency
301
+ */
302
+ readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
303
+ /**
304
+ * @description Amount currency is not supported
305
+ */
306
+ readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
307
+ /**
308
+ * @description Amount currency precision is not supported
309
+ */
310
+ readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
311
+ /**
312
+ * @description Amount conversion timed out
313
+ */
314
+ readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
315
+ /**
316
+ * @description Amount conversion failed
317
+ */
318
+ readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
297
319
  readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
298
320
  readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
299
321
  readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
@@ -306,15 +328,12 @@ export declare const AntomSDKErrorCodes: {
306
328
  readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
307
329
  readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
308
330
  readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
309
- readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
310
- readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
331
+ readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT"; /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
332
+ readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT"; /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
311
333
  readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
312
334
  readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
313
335
  readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
314
336
  readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
315
- /**
316
- * 查询到的结果消息
317
- */
318
337
  readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
319
338
  readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
320
339
  readonly API_MISS_PARAMS: "API_MISS_PARAMS";
@@ -332,28 +351,100 @@ export declare type AntomSDKErrorCodes = (typeof AntomSDKErrorCodes)[keyof typeo
332
351
 
333
352
  export declare type AntomTheme = 'default' | 'agateGreen' | 'night' | 'nostalgicGray' | 'gamingPurple' | 'cherryBlossomPink' | 'light';
334
353
 
335
- export declare type AntomVariables = 'content-primary' | 'content-secondary' | 'content-tertiary' | 'content-quaternary' | 'background-primary' | 'background-secondary' | 'background-disable' | 'background-transparency' | 'border-primary' | 'border-secondary' | 'border-disable' | 'action-normal' | 'action-hover' | 'action-disable' | 'action-secondary' | 'state-failure' | 'state-warning' | 'state-success' | 'state-info' | 'state-marketing' | 'state-conventional' | 'radius-backup' | 'radius-module' | 'radius-component' | 'radius-button' | 'wrapper-padding' | 'stroke-default' | 'stroke-active' | 'fontFamily';
354
+ /**
355
+ * @deprecated Use {@link AppearanceVariables} (Token 2.0) instead.
356
+ * 保留仅为向后兼容,将在下一个 major 版本中删除。
357
+ */
358
+ export declare type AntomVariables = LegacyAppearanceVariables;
336
359
 
337
360
  /**
338
361
  * @description SDK UI组件的外观配置。
339
362
  * 控制主题、CSS变量、布局规则及显示设置。
340
363
  * @template Props - 自定义外观属性类型,默认为 DefaultAppearanceProps。
341
364
  */
342
- declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = DefaultAppearanceProps> {
365
+ declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = DefaultAppearanceProps, Rules extends CSS_2.Properties<string, number> = CSS_2.Properties<string, number>> {
343
366
  theme?: Props['theme'];
344
367
  variables?: PartialSpeKey<Props['variables'], string>;
345
- rules?: PartialSpeKey<Props['rules'], CSS_2.Properties<string, number>>;
368
+ rules?: PartialSpeKey<Props['rules'], Rules>;
346
369
  displaySetting?: PartialSpeKey<Props['displaySetting'], boolean>;
347
370
  layout?: Props['layout'];
348
371
  fonts?: FontSource[];
349
372
  }
350
373
 
351
- export declare type AppearanceSetting = {
352
- displaySetting: Record<'showCardBrandIcon', boolean>;
353
- theme: 'light' | 'dark';
354
- layout: 'accordion' | 'tabs';
374
+ /** Target-level layout declarations admitted before runtime capability intersection. */
375
+ export declare type AppearanceLayoutDeclarations = {
376
+ [Property in Exclude<AppearanceLayoutProperty, 'height'>]?: AppearanceSpacingValue;
377
+ } & {
378
+ /** Exact integer-pixel enum allocated by the target contract. */
379
+ readonly height?: `${number}px`;
355
380
  };
356
381
 
382
+ /** Controlled layout longhands intersected with the concrete Part at runtime. */
383
+ export declare type AppearanceLayoutProperty = 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'height';
384
+
385
+ /** Paint declarations accepted before WebApp and Components runtime validation. */
386
+ declare type AppearancePaintDeclarations = Partial<Record<Exclude<AppearancePaintProperty, 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'textDecorationStyle' | 'outlineStyle'>, string> & Record<'fillOpacity' | 'strokeOpacity' | 'strokeWidth', string | number> & {
387
+ textDecorationStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'dashed' | 'dotted' | 'double' | 'solid' | 'wavy';
388
+ outlineStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'auto' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
389
+ }>;
390
+
391
+ /** Paint-only property names exposed by the SDK contract. */
392
+ export declare type AppearancePaintProperty = 'color' | 'WebkitTextFillColor' | 'textDecorationColor' | 'textDecorationLine' | 'textDecorationStyle' | 'textShadow' | 'backgroundColor' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'borderRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomRightRadius' | 'borderBottomLeftRadius' | 'borderStyle' | 'boxShadow' | 'fill' | 'stroke' | 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'outlineColor' | 'outlineStyle' | 'outlineWidth' | 'outlineOffset' | 'caretColor' | 'accentColor';
393
+
394
+ /** Paint declarations plus controlled typography and target-level layout fields. */
395
+ declare type AppearanceRuleDeclarations = AppearancePaintDeclarations & AppearanceLayoutDeclarations & {
396
+ /** Single font family identifier admitted only for authorized targets at runtime. */
397
+ readonly fontFamily?: string;
398
+ /** Integer pixel size admitted only for authorized text targets at runtime. */
399
+ readonly fontSize?: `${number}px`;
400
+ /** Controlled font weight admitted only for authorized text targets at runtime. */
401
+ readonly fontWeight?: 400 | 500 | 600 | 700;
402
+ /** Controlled font style admitted only for authorized text targets at runtime. */
403
+ readonly fontStyle?: 'normal' | 'italic';
404
+ };
405
+
406
+ /** Controlled pseudo-class accepted by the merchant selector grammar. */
407
+ declare type AppearanceRulePseudoClass = 'autofill';
408
+
409
+ /** Controlled pseudo-element accepted by the merchant selector grammar. */
410
+ declare type AppearanceRulePseudoElement = 'placeholder' | 'selection';
411
+
412
+ /**
413
+ * Optional state or controlled pseudo suffix on one alias.
414
+ */
415
+ export declare type AppearanceRuleScopeSuffix = '' | `:${AppearanceRuleState | AppearanceRulePseudoClass}` | `::${AppearanceRulePseudoElement}`;
416
+
417
+ /** One merchant alias with an optional semantic suffix. */
418
+ export declare type AppearanceRuleSelector<RuleAlias extends string> = `${RuleAlias}${AppearanceRuleScopeSuffix}`;
419
+
420
+ /** Semantic states accepted by the merchant selector grammar. */
421
+ declare type AppearanceRuleState = 'hover' | 'focus' | 'focus-visible' | 'active' | 'disabled' | 'loading' | 'selected' | 'checked' | 'expanded' | 'invalid' | 'success' | 'error';
422
+
423
+ /** Backward-compatible name for the Express appearance configuration. */
424
+ export declare type AppearanceSetting = ExpressAppearance;
425
+
426
+ /** Exact official spacing Token accepted by controlled margin and padding. */
427
+ export declare type AppearanceSpacingToken = `var(--spacing-${'base' | 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'})`;
428
+
429
+ /** Runtime-constrained non-negative integer pixel value for spacing longhands. */
430
+ export declare type AppearanceSpacingValue = '0' | `${number}px` | AppearanceSpacingToken;
431
+
432
+ /**
433
+ * 对客公开 appearance variables 类型(Token 2.x,figma-v4「3 层 + 状态」命名)。
434
+ * 字段名为新 CSS 变量名去掉 '--' 前缀(如 color-text-primary)。
435
+ *
436
+ * 权威源:`antom-web-checkout-v2/packages/elements2/src/utils/themeConfig.ts` 的 `PUBLIC_TOKENS`
437
+ * (54 color + 4 radius + 10 spacing = 68 项)。本 union 是该清单的手工镜像,
438
+ * 增删 token 时必须两侧同步,否则商户会遇到「类型报错但运行时可用」的错位。
439
+ *
440
+ * 命名规则:`--color-<scene>-<level>[-<state>]`;brand 场景并入 scene 段的 camelCase
441
+ * (如 `color-backgroundBrand-primary-hover`),CSS 变量大小写敏感,不可改写为 kebab。
442
+ *
443
+ * @example
444
+ * variables: { 'color-text-primary': '#2a3a52', 'radius-sm': '4px' }
445
+ */
446
+ export declare type AppearanceVariables = 'color-background-primary' | 'color-background-primary-hover' | 'color-background-primary-active' | 'color-background-secondary' | 'color-background-secondary-hover' | 'color-background-secondary-active' | 'color-background-layout' | 'color-background-inverse' | 'color-background-disabled' | 'color-background-transparency' | 'color-background-mask' | 'color-background-success' | 'color-background-warning' | 'color-background-danger' | 'color-background-info' | 'color-background-neutral' | 'color-background-promotional' | 'color-backgroundBrand-primary' | 'color-backgroundBrand-primary-hover' | 'color-backgroundBrand-secondary' | 'color-backgroundBrand-secondary-hover' | 'color-backgroundBrand-tertiary' | 'color-backgroundBrand-disabled' | 'color-text-primary' | 'color-text-secondary' | 'color-text-tertiary' | 'color-text-inverse' | 'color-text-active' | 'color-text-disabled' | 'color-text-success' | 'color-text-warning' | 'color-text-danger' | 'color-text-info' | 'color-text-neutral' | 'color-text-promotional' | 'color-textBrand-primary' | 'color-textBrand-secondary' | 'color-textBrand-secondary-hover' | 'color-textBrand-disabled' | 'color-border-primary' | 'color-border-secondary' | 'color-border-inverse' | 'color-border-active' | 'color-border-subtle' | 'color-border-disabled' | 'color-border-success' | 'color-border-warning' | 'color-border-danger' | 'color-border-info' | 'color-border-neutral' | 'color-border-promotional' | 'color-borderBrand-primary' | 'color-borderBrand-primary-hover' | 'color-borderBrand-disabled' | 'radius-sm' | 'radius-md' | 'radius-lg' | 'radius-xl' | 'spacing-base' | 'spacing-none' | 'spacing-2xs' | 'spacing-xs' | 'spacing-sm' | 'spacing-md' | 'spacing-lg' | 'spacing-xl' | 'spacing-2xl' | 'spacing-3xl';
447
+
357
448
  declare interface AppleMerchantInfo {
358
449
  /**
359
450
  * @description Apple商户ID
@@ -742,10 +833,6 @@ declare interface BankInfo {
742
833
  hasSchemaUrl?: boolean;
743
834
  }
744
835
 
745
- declare interface BaseAppearance<A extends Partial<Appearance>> {
746
- appearance?: A;
747
- }
748
-
749
836
  /**
750
837
  * @description 内置基础的桥接事件映射类型
751
838
  */
@@ -2062,18 +2149,22 @@ export declare interface ConfirmCardSetupOptions {
2062
2149
  redirect?: 'always' | 'if_required';
2063
2150
  }
2064
2151
 
2065
- export declare interface ConfirmPaymentOptions extends Omit<ConfirmCardSetupOptions, 'elements'>, PaymentSubmitParams {
2066
- sessionData: string;
2067
- /**
2068
- * @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
2069
- */
2070
- elements?: BaseMainElement | BaseElements;
2152
+ export declare type ConfirmPaymentOptions = PaymentSubmitParams & {
2071
2153
  appearance?: CVVAppearance;
2072
2154
  /**
2073
2155
  * @description 集成用户自定义信息(如 cardHolderName)
2074
2156
  */
2075
2157
  params?: Record<string, unknown>;
2076
- }
2158
+ } & ({
2159
+ /** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
2160
+ elements: BaseMainElement | BaseElements;
2161
+ /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
2162
+ sessionData?: string;
2163
+ } | {
2164
+ elements?: undefined;
2165
+ /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
2166
+ sessionData: string;
2167
+ });
2077
2168
 
2078
2169
  /**
2079
2170
  * @description Connect流程参数
@@ -2210,11 +2301,13 @@ declare interface CustomFontSource {
2210
2301
  * @public
2211
2302
  * @description CVV element app config type
2212
2303
  */
2213
- export declare interface CVVAppConfig extends BaseAppearance<CVVAppearance>, BaseElementAppConfig {
2304
+ export declare interface CVVAppConfig extends BaseElementAppConfig {
2305
+ /** CVV appearance configuration including optional alias-only Rules. */
2306
+ appearance?: CVVAppearance;
2214
2307
  /**
2215
- * @description sessionData
2308
+ * @description 创建时必填的支付会话;不可通过 updateConfig 或 submit 替换
2216
2309
  */
2217
- sessionData?: string;
2310
+ sessionData: string;
2218
2311
  /* Excluded from this release type: paymentSessionConfig */
2219
2312
  /* Excluded from this release type: renderData */
2220
2313
  /* Excluded from this release type: sdkVersion */
@@ -2226,12 +2319,13 @@ export declare interface CVVAppConfig extends BaseAppearance<CVVAppearance>, Bas
2226
2319
  /* Excluded from this release type: paymentFlow */
2227
2320
  }
2228
2321
 
2229
- export declare type CVVAppearance = PickAppearance<CVVAppearanceProps>;
2322
+ export declare type CVVAppearance = PickAntomAppearance<CVVAppearanceProps>;
2230
2323
 
2231
2324
  export declare type CVVAppearanceProps = {
2232
2325
  theme: AntomTheme;
2233
- variables: AntomVariables;
2326
+ variables: AppearanceVariables | AntomVariables;
2234
2327
  fonts?: FontSource[];
2328
+ rules: AppearanceRuleSelector<string>;
2235
2329
  };
2236
2330
 
2237
2331
  /**
@@ -2239,8 +2333,10 @@ export declare type CVVAppearanceProps = {
2239
2333
  */
2240
2334
  export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVElementEvents> {
2241
2335
  static elementType: string;
2336
+ private readonly sessionData;
2242
2337
  constructor(name: string, config: CVVElementConfig);
2243
2338
  /* Excluded from this release type: setup */
2339
+ /* Excluded from this release type: updateConfig */
2244
2340
  /* Excluded from this release type: submit */
2245
2341
  protected focus(): void;
2246
2342
  protected blur(): void;
@@ -2252,20 +2348,10 @@ export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVEle
2252
2348
  * @description CVV element config type
2253
2349
  */
2254
2350
  export declare interface CVVElementConfig extends BaseElementConfig<CVVAppConfig> {
2351
+ appConfig: CVVAppConfig;
2255
2352
  }
2256
2353
 
2257
- export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams> {
2258
- /**
2259
- * @description Emitted event about form
2260
- */
2261
- form: {
2262
- errors?: Array<{
2263
- field: string | number;
2264
- message: string;
2265
- currentValue: any;
2266
- }>;
2267
- message: string;
2268
- };
2354
+ export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams & Pick<CVVAppConfig, 'sessionData'>> {
2269
2355
  /**
2270
2356
  * @description Emitted when the element is destroy
2271
2357
  */
@@ -2309,10 +2395,6 @@ export declare type CVVSubmitErrorCodes = 'NOT_FIND_MAINELEMENT' | 'SESSION_DATA
2309
2395
  * @description CVV 支付提交参数
2310
2396
  */
2311
2397
  export declare interface CVVSubmitParams {
2312
- /**
2313
- * 支付会话数据
2314
- */
2315
- sessionData?: string;
2316
2398
  /**
2317
2399
  * 重定向策略
2318
2400
  */
@@ -3125,20 +3207,21 @@ declare interface ExpPaymentOptionDetail {
3125
3207
  * @public
3126
3208
  * @description Express element app config type
3127
3209
  */
3128
- export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetting>, BaseElementAppConfig {
3210
+ export declare interface ExpressAppConfig extends BaseElementAppConfig {
3211
+ /** Express appearance configuration. */
3212
+ appearance?: ExpressAppearance;
3129
3213
  /** payment SessionData */
3130
3214
  sessionData?: string;
3131
- /** Business division (country/region) */
3132
- businessDivision?: string;
3133
3215
  /**
3134
3216
  * Amount & Currency
3135
3217
  *
3136
- * Only effective via `updateConfig({ amount })` at runtime.
3137
- * Passing amount at creation time is ignored; the initial amount
3138
- * comes from the server-side sdkQuery result (renderData.paymentAmount).
3218
+ * For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
3219
+ * the payment session currency's minor unit; `currency` may be omitted.
3220
+ * For example, USD 10.99 is passed as `{ value: '1099' }`.
3221
+ * PayPal keeps its existing major-unit amount semantics and requires `currency`.
3139
3222
  */
3140
3223
  amount?: {
3141
- currency: string;
3224
+ currency?: string;
3142
3225
  value: string;
3143
3226
  };
3144
3227
  /** PayPal 配置 */
@@ -3183,6 +3266,17 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
3183
3266
  /* Excluded from this release type: doMain */
3184
3267
  }
3185
3268
 
3269
+ /** Express element appearance configuration. */
3270
+ declare type ExpressAppearance = PickAntomAppearance<ExpressAppearanceProps>;
3271
+
3272
+ /** Express element appearance properties. */
3273
+ export declare type ExpressAppearanceProps = {
3274
+ displaySetting: 'showCardBrandIcon';
3275
+ theme: 'light' | 'dark';
3276
+ layout: 'accordion' | 'tabs';
3277
+ rules: AppearanceRuleSelector<string>;
3278
+ };
3279
+
3186
3280
  /** cancel 事件负载 */
3187
3281
  export declare interface ExpressCancelEvent {
3188
3282
  expressPaymentType: string;
@@ -3258,7 +3352,17 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3258
3352
  private _localHandlers;
3259
3353
  /** 支付流程进行中标志(click → confirm/error/cancel 之间) */
3260
3354
  private _paymentInProgress;
3355
+ /**
3356
+ * 是否已收到 iframe 业务层 ready 事件(app.tsx sendReady)。
3357
+ * 注意:与 host `status='ready'`(由 HANDSHAKE_ACK 触发,bridge.js:450 同步回发,与 amount 解析无关)不同。
3358
+ * 首屏 amount setupError 时 iframe 不发业务 ready → _readyReceived 保持 false,
3359
+ * 据此判别"首屏失败"以阻断后续 updateConfig。
3360
+ */
3361
+ private _readyReceived;
3362
+ /** 首屏 setupError 致命标志:置位后 updateConfig 被 CHECKOUT_NOT_READY 阻断,只能 destroy 重开。 */
3363
+ private _setupFailed;
3261
3364
  private _paypalOverlay;
3365
+ private _updateQueue;
3262
3366
  constructor(name: string, config: ExpressElementConfig);
3263
3367
  /**
3264
3368
  * 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
@@ -3269,7 +3373,17 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3269
3373
  * 用于 Native WebView 场景下 SDK 需要向商户透传跳转信息等。
3270
3374
  */
3271
3375
  private _emit;
3272
- updateConfig(newConfig: Pick<ExpressAppConfig, 'amount'>): Promise<ExpressElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
3376
+ updateConfig(newConfig: ExpressAppConfig): Promise<ExpressElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
3377
+ private updateConfigTransaction;
3378
+ private updateAmountConfigWithSanitizedDebug;
3379
+ private getAmountValidationReason;
3380
+ /** iframe 业务 ready 事件到达:置 _readyReceived,后续运行时 error 不再视为首屏失败。
3381
+ * ready 是"本次首屏成功"的确实信号(首屏 setupError 时 iframe 不发 ready),
3382
+ * 故同时清掉 _setupFailed——unmount+remount 同实例二次首屏成功后可恢复 updateConfig。
3383
+ */
3384
+ private _handleReady;
3385
+ /** iframe error 事件:若 business ready 未到达,视为首屏 setupError → 置 _setupFailed 阻断后续 updateConfig。 */
3386
+ private _handleError;
3273
3387
  /**
3274
3388
  * 商户在 confirm 回调内调用,触发实际支付提交。
3275
3389
  * iframe 收到 OPENSDK@COMPLETE_PAYMENT 后执行 submitPay / polling 等,
@@ -3284,6 +3398,7 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3284
3398
  };
3285
3399
  /** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
3286
3400
  userCanceled3D?: boolean;
3401
+ status?: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
3287
3402
  }>;
3288
3403
  setup(): Promise<Partial<ExpressAppConfig> | undefined>;
3289
3404
  private registerInternalListeners;
@@ -3358,6 +3473,11 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
3358
3473
  'OPENSDK@GET_APPLE_PAY_TOKEN': {
3359
3474
  requestId: string;
3360
3475
  expressPaymentType: string;
3476
+ /** iframe 已转好的 major unit 金额(来自 resolvedAmount);host 委托 Apple Pay 消费,不再做 minor→major 转换。 */
3477
+ walletAmount?: {
3478
+ value: string;
3479
+ currency: string;
3480
+ };
3361
3481
  };
3362
3482
  /** host 完成 Apple Pay token 获取后回包给 iframe,submit/3DS/polling 均由 webapp 完成 */
3363
3483
  'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': {
@@ -3468,6 +3588,57 @@ declare interface FrontSupportIppBank {
3468
3588
  logo?: Logo;
3469
3589
  }
3470
3590
 
3591
+ /** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
3592
+ declare interface GetApplePayTokenReply {
3593
+ success: boolean;
3594
+ result?: {
3595
+ token?: unknown;
3596
+ billingContact?: unknown;
3597
+ shippingContact?: unknown;
3598
+ } | {
3599
+ errorCode: string;
3600
+ };
3601
+ }
3602
+
3603
+ /** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
3604
+ declare interface GetApplePayTokenRequest {
3605
+ paymentMethod?: {
3606
+ paymentMethodDetail?: {
3607
+ applePayProps?: {
3608
+ paymentRequest?: unknown;
3609
+ };
3610
+ };
3611
+ };
3612
+ shipping?: unknown;
3613
+ }
3614
+
3615
+ /** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
3616
+ declare interface GetGooglePayTokenReply {
3617
+ success: boolean;
3618
+ result?: unknown;
3619
+ err?: {
3620
+ statusCode?: string;
3621
+ [key: string]: unknown;
3622
+ };
3623
+ }
3624
+
3625
+ /** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
3626
+ declare interface GetGooglePayTokenRequest {
3627
+ actionName?: string;
3628
+ data?: {
3629
+ environment?: string;
3630
+ paymentRequest?: unknown;
3631
+ paymentMethod?: unknown;
3632
+ paymentMethodDetail?: {
3633
+ googlePayProps?: {
3634
+ environment?: string;
3635
+ paymentRequest?: unknown;
3636
+ };
3637
+ };
3638
+ [key: string]: unknown;
3639
+ };
3640
+ }
3641
+
3471
3642
  declare type GetI18nQueryParam = string | {
3472
3643
  /**
3473
3644
  * 多语言文案的 key
@@ -4318,6 +4489,58 @@ declare interface Language {
4318
4489
  country?: string;
4319
4490
  }
4320
4491
 
4492
+ /**
4493
+ * @deprecated Token 1.0 老字段类型 — 请迁移到 {@link AppearanceVariables}。
4494
+ * 所有字段均已废弃,运行时由 WebApp 侧 LEGACY_TO_NEW_TOKEN_MAP 翻译为新 token。
4495
+ *
4496
+ * @deprecated 'content-primary' → color-text-primary
4497
+ * @deprecated 'content-secondary' → color-text-secondary
4498
+ * @deprecated 'content-tertiary' → color-text-tertiary
4499
+ * @deprecated 'content-quaternary' → color-text-inverse
4500
+ * @deprecated 'background-primary' → color-background-primary
4501
+ * @deprecated 'background-secondary' → color-background-secondary
4502
+ * @deprecated 'background-disable' → color-background-disabled
4503
+ * @deprecated 'background-transparency' → color-background-transparency
4504
+ * @deprecated 'border-primary' → color-border-primary
4505
+ * @deprecated 'border-secondary' → color-border-secondary
4506
+ * @deprecated 'border-disable' → color-border-disabled
4507
+ * @deprecated 'border-active' → color-border-active
4508
+ * @deprecated 'action-normal' → 一对多 fan-out(无单值映射;运行时展开为 3 个新 token,老 key 不再注入):
4509
+ * - background/background-color → color-backgroundBrand-primary
4510
+ * - border/border-color/box-shadow → color-border-active
4511
+ * - color/文本/图标/勾选态 → color-text-active
4512
+ * @deprecated 'action-hover' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
4513
+ * - background → color-backgroundBrand-primary-hover
4514
+ * - border → color-borderBrand-primary-hover
4515
+ * 文字色 color-textBrand-secondary-hover 不参与派生
4516
+ * (设计稿中与 bg/border 不同色阶),需要时请显式传入该新 token 键
4517
+ * @deprecated 'action-secondary' → color-backgroundBrand-secondary
4518
+ * @deprecated 'action-disable' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
4519
+ * - background/background-color → color-backgroundBrand-disabled
4520
+ * - border/border-color → color-borderBrand-disabled
4521
+ * 文字色 color-textBrand-disabled 不参与派生
4522
+ * (设计稿中全部主题均与 bg/border 不同色阶),需要时请显式传入该新 token 键
4523
+ * @deprecated 'state-success' → color-text-success
4524
+ * @deprecated 'state-failure' → color-text-danger
4525
+ * @deprecated 'state-warning' → color-text-warning
4526
+ * @deprecated 'state-info' → color-text-info
4527
+ * @deprecated 'state-conventional' → color-text-neutral
4528
+ * @deprecated 'state-marketing' → color-text-promotional(color 上下文;background 上下文由 CSS 层直接迁移)
4529
+ * @deprecated 'radius-backup' → radius-sm
4530
+ * @deprecated 'radius-component' → radius-md
4531
+ * @deprecated 'radius-module' → radius-lg
4532
+ * @deprecated 'radius-button' → radius-lg(与 radius-module 同档合并)
4533
+ * @deprecated 'wrapper-padding' → spacing-lg
4534
+ * @deprecated 'stroke-default' → 由 Rules 机制接管
4535
+ * @deprecated 'stroke-active' → 由 Rules 机制接管
4536
+ *
4537
+ * 注:fan-out 展开基数以 figma-v4 设计稿的色阶一致性为准,故 action-hover / action-disable
4538
+ * 为 1→2 而非 1→3;三者合计派生 7 项。
4539
+ */
4540
+ export declare type LegacyAppearanceVariables = 'content-primary' | 'content-secondary' | 'content-tertiary' | 'content-quaternary' | 'background-primary' | 'background-secondary' | 'background-disable' | 'background-transparency' | 'border-primary' | 'border-secondary' | 'border-disable' | 'action-normal' | 'action-hover' | 'action-disable' | 'action-secondary' | 'state-failure' | 'state-warning' | 'state-success' | 'state-info' | 'state-marketing' | 'state-conventional' | 'radius-backup' | 'radius-module' | 'radius-component' | 'radius-button' | 'wrapper-padding' | 'stroke-default' | 'stroke-active'
4541
+ /** 非 Token 体系字段,由 WebApp 侧展开为 design-font-family-* 系列 */
4542
+ | 'fontFamily';
4543
+
4321
4544
  declare interface Link {
4322
4545
  /**
4323
4546
  * @description 发起关联的父元素,如国家
@@ -6881,7 +7104,7 @@ declare interface OtpChallengeActionForm {
6881
7104
  resendLeftTimes?: number;
6882
7105
  }
6883
7106
 
6884
- declare type PartialSpeKey<T, V> = Partial<T extends infer K extends string ? Record<K, V> : Record<string, V>>;
7107
+ declare type PartialSpeKey<T extends string | undefined, V> = Partial<Record<T extends string ? T : string, V>>;
6885
7108
 
6886
7109
  declare interface PayByLinkInfo {
6887
7110
  /**
@@ -6905,7 +7128,9 @@ declare interface PayByLinkInfo {
6905
7128
  /**
6906
7129
  * @description Payment element app config type
6907
7130
  */
6908
- export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearance>, BaseElementAppConfig {
7131
+ export declare interface PaymentAppConfig extends BaseElementAppConfig {
7132
+ /** Payment appearance configuration including optional alias-only Rules. */
7133
+ appearance?: PaymentAppearance;
6909
7134
  /**
6910
7135
  * @description sessionData,无法通过updateConfig更新
6911
7136
  */
@@ -6934,12 +7159,18 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
6934
7159
  /**
6935
7160
  * @description Payment element appearance type
6936
7161
  */
6937
- export declare type PaymentAppearance = PickAppearance<{
7162
+ export declare type PaymentAppearance = PickAntomAppearance<PaymentAppearanceProps>;
7163
+
7164
+ /**
7165
+ * @description Payment element appearance properties
7166
+ */
7167
+ export declare type PaymentAppearanceProps = {
6938
7168
  displaySetting: 'showPaymentMethodListWhenSingleOption' | 'showCardBrandIcon' | 'showRadioWhenAccordionLayout' | 'showCardCVV';
6939
7169
  theme: AntomTheme;
6940
- variables: AntomVariables;
7170
+ variables: AppearanceVariables | AntomVariables;
6941
7171
  layout: AntomLayouts;
6942
- }>;
7172
+ rules: AppearanceRuleSelector<string>;
7173
+ };
6943
7174
 
6944
7175
  /**
6945
7176
  * @description Payment element
@@ -6947,12 +7178,13 @@ export declare type PaymentAppearance = PickAppearance<{
6947
7178
  export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
6948
7179
  static elementType: string;
6949
7180
  private _paymentInProgress;
7181
+ private readonly walletLogger;
6950
7182
  constructor(name: string, config: PaymentElementConfig);
6951
7183
  /* Excluded from this release type: setup */
6952
7184
  /**
6953
- * @description Update payment element configuration with amount validation
7185
+ * @description Update payment element configuration with amount validation and appearance Rules support
6954
7186
  */
6955
- updateConfig(newConfig: Pick<PaymentAppConfig, 'amount'>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
7187
+ updateConfig(newConfig: Partial<PaymentAppConfig>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
6956
7188
  /* Excluded from this release type: submit */
6957
7189
  protected focus(): void;
6958
7190
  protected blur(): void;
@@ -6969,6 +7201,20 @@ declare interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfi
6969
7201
  * @description Payment element events
6970
7202
  */
6971
7203
  export declare interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
7204
+ /**
7205
+ * webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
7206
+ * payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
7207
+ */
7208
+ 'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
7209
+ /** host 完成 Apple Pay token 获取后回包给 webapp */
7210
+ 'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
7211
+ /**
7212
+ * webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
7213
+ * payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
7214
+ */
7215
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
7216
+ /** host 完成 Google Pay token 获取后回包给 webapp */
7217
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
6972
7218
  }
6973
7219
 
6974
7220
  declare interface PaymentElementView {
@@ -7660,6 +7906,7 @@ export declare interface PayPalConfig {
7660
7906
  channelMerchantAccountId?: string;
7661
7907
  /** Button style (fine-grained override) */
7662
7908
  style?: PayPalButtonStyle;
7909
+ businessDivision?: string;
7663
7910
  /** Callback to create PayPal order, no params, returns sessionData */
7664
7911
  createOrder?: () => Promise<string>;
7665
7912
  /** Callback when user changes shipping address, data is raw data returned by PayPal */
@@ -7679,12 +7926,15 @@ declare interface PeriodRule {
7679
7926
  periodCount?: number;
7680
7927
  }
7681
7928
 
7929
+ /** Builds an Antom appearance type with the restricted Rules declaration contract. */
7930
+ declare type PickAntomAppearance<T extends Record<string, any>> = PickAppearance<T, AppearanceRuleDeclarations>;
7931
+
7682
7932
  /**
7683
7933
  * @description 工具类型,仅从 Appearance 中拾取与 Props 类型匹配的属性。
7684
7934
  * 返回受 Props 中存在的键约束的部分外观对象。
7685
7935
  * @template Props - 要从 Appearance 中拾取的自定义外观属性类型。
7686
7936
  */
7687
- declare type PickAppearance<Props extends Partial<DefaultAppearanceProps>> = Partial<Pick<Appearance<Props>, keyof Props extends infer k extends keyof Partial<Appearance> ? k : keyof Partial<Appearance>>>;
7937
+ declare type PickAppearance<Props extends Partial<DefaultAppearanceProps>, Rules extends CSS_2.Properties<string, number> = CSS_2.Properties<string, number>> = Partial<Pick<Appearance<Props, Rules>, keyof Props extends infer k extends keyof Partial<Appearance> ? k : keyof Partial<Appearance>>>;
7688
7938
 
7689
7939
  /**
7690
7940
  * @description 政策信息,例如隐私链接,免责声明等
@@ -24382,7 +24632,9 @@ declare interface UserName {
24382
24632
  * @public
24383
24633
  * @description Vaulting element app config type
24384
24634
  */
24385
- export declare interface VaultingAppConfig extends BaseAppearance<VaultingAppearance>, BaseElementAppConfig {
24635
+ export declare interface VaultingAppConfig extends BaseElementAppConfig {
24636
+ /** Vaulting appearance configuration including optional alias-only Rules. */
24637
+ appearance?: VaultingAppearance;
24386
24638
  /**
24387
24639
  * @description sessionData,无法通过updateConfig更新
24388
24640
  */
@@ -24394,13 +24646,14 @@ export declare interface VaultingAppConfig extends BaseAppearance<VaultingAppear
24394
24646
  /* Excluded from this release type: _requestConfig */
24395
24647
  }
24396
24648
 
24397
- export declare type VaultingAppearance = PickAppearance<VaultingAppearanceProps>;
24649
+ export declare type VaultingAppearance = PickAntomAppearance<VaultingAppearanceProps>;
24398
24650
 
24399
24651
  export declare type VaultingAppearanceProps = {
24400
24652
  displaySetting: 'showCardBrandIcon';
24401
24653
  theme: AntomTheme;
24402
- variables: AntomVariables;
24654
+ variables: AppearanceVariables | AntomVariables;
24403
24655
  fonts?: FontSource[];
24656
+ rules: AppearanceRuleSelector<string>;
24404
24657
  };
24405
24658
 
24406
24659
  /**
@@ -24410,6 +24663,12 @@ export declare class VaultingElement extends BaseMainElement<VaultingElementConf
24410
24663
  static elementType: string;
24411
24664
  constructor(name: string, config: VaultingElementConfig);
24412
24665
  /* Excluded from this release type: setup */
24666
+ /**
24667
+ * Updates Vaulting configuration while preserving the public Rules clear semantics.
24668
+ * @param newConfig Partial Vaulting configuration patch.
24669
+ * @returns The WebApp update acknowledgement.
24670
+ */
24671
+ updateConfig(newConfig: Partial<VaultingAppConfig>): Promise<VaultingElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
24413
24672
  /* Excluded from this release type: submit */
24414
24673
  protected focus(): void;
24415
24674
  protected blur(): void;