@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.
@@ -289,12 +289,14 @@ export declare interface AntomOpenModalConfig extends OpenModalParams {
289
289
  */
290
290
  export declare class AntomSDK extends BaseElementsFactory {
291
291
  static version: string;
292
+ private stopModalMessageMonitor;
292
293
  constructor(config?: AntomSDKConfig);
293
294
  protected canUseElements(): Array<ElementListItemType>;
294
295
  /**
295
296
  * @description 更新配置
296
297
  */
297
298
  updateConfig(config: Partial<BaseFactoryConfig>): void;
299
+ destroy(): void;
298
300
  /**
299
301
  * @internal
300
302
  * @param payload
@@ -311,7 +313,7 @@ export declare class AntomSDK extends BaseElementsFactory {
311
313
  elements(): Elements;
312
314
  createElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
313
315
  createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
314
- createElement(elementType: 'CVV', options?: CVVAppConfig): CVVElement;
316
+ createElement(elementType: 'CVV', options: CVVAppConfig): CVVElement;
315
317
  createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
316
318
  getElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
317
319
  getElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
@@ -383,9 +385,29 @@ export declare const AntomSDKErrorCodes: {
383
385
  */
384
386
  readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
385
387
  /**
386
- * @description 金额格式非法(仅允许整数和小数)
388
+ * @description 金额格式非法(仅允许 ASCII 数字字符串)
387
389
  */
388
390
  readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
391
+ /**
392
+ * @description Amount currency does not match the payment session currency
393
+ */
394
+ readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
395
+ /**
396
+ * @description Amount currency is not supported
397
+ */
398
+ readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
399
+ /**
400
+ * @description Amount currency precision is not supported
401
+ */
402
+ readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
403
+ /**
404
+ * @description Amount conversion timed out
405
+ */
406
+ readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
407
+ /**
408
+ * @description Amount conversion failed
409
+ */
410
+ readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
389
411
  readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
390
412
  readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
391
413
  readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
@@ -398,15 +420,12 @@ export declare const AntomSDKErrorCodes: {
398
420
  readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
399
421
  readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
400
422
  readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
401
- readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
402
- readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
423
+ readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT"; /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
424
+ readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT"; /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
403
425
  readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
404
426
  readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
405
427
  readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
406
428
  readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
407
- /**
408
- * 查询到的结果消息
409
- */
410
429
  readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
411
430
  readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
412
431
  readonly API_MISS_PARAMS: "API_MISS_PARAMS";
@@ -424,28 +443,100 @@ export declare type AntomSDKErrorCodes = (typeof AntomSDKErrorCodes)[keyof typeo
424
443
 
425
444
  export declare type AntomTheme = 'default' | 'agateGreen' | 'night' | 'nostalgicGray' | 'gamingPurple' | 'cherryBlossomPink' | 'light';
426
445
 
427
- 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';
446
+ /**
447
+ * @deprecated Use {@link AppearanceVariables} (Token 2.0) instead.
448
+ * 保留仅为向后兼容,将在下一个 major 版本中删除。
449
+ */
450
+ export declare type AntomVariables = LegacyAppearanceVariables;
428
451
 
429
452
  /**
430
453
  * @description SDK UI组件的外观配置。
431
454
  * 控制主题、CSS变量、布局规则及显示设置。
432
455
  * @template Props - 自定义外观属性类型,默认为 DefaultAppearanceProps。
433
456
  */
434
- declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = DefaultAppearanceProps> {
457
+ declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = DefaultAppearanceProps, Rules extends CSS_2.Properties<string, number> = CSS_2.Properties<string, number>> {
435
458
  theme?: Props['theme'];
436
459
  variables?: PartialSpeKey<Props['variables'], string>;
437
- rules?: PartialSpeKey<Props['rules'], CSS_2.Properties<string, number>>;
460
+ rules?: PartialSpeKey<Props['rules'], Rules>;
438
461
  displaySetting?: PartialSpeKey<Props['displaySetting'], boolean>;
439
462
  layout?: Props['layout'];
440
463
  fonts?: FontSource[];
441
464
  }
442
465
 
443
- export declare type AppearanceSetting = {
444
- displaySetting: Record<'showCardBrandIcon', boolean>;
445
- theme: 'light' | 'dark';
446
- layout: 'accordion' | 'tabs';
466
+ /** Target-level layout declarations admitted before runtime capability intersection. */
467
+ export declare type AppearanceLayoutDeclarations = {
468
+ [Property in Exclude<AppearanceLayoutProperty, 'height'>]?: AppearanceSpacingValue;
469
+ } & {
470
+ /** Exact integer-pixel enum allocated by the target contract. */
471
+ readonly height?: `${number}px`;
447
472
  };
448
473
 
474
+ /** Controlled layout longhands intersected with the concrete Part at runtime. */
475
+ export declare type AppearanceLayoutProperty = 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'height';
476
+
477
+ /** Paint declarations accepted before WebApp and Components runtime validation. */
478
+ declare type AppearancePaintDeclarations = Partial<Record<Exclude<AppearancePaintProperty, 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'textDecorationStyle' | 'outlineStyle'>, string> & Record<'fillOpacity' | 'strokeOpacity' | 'strokeWidth', string | number> & {
479
+ textDecorationStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'dashed' | 'dotted' | 'double' | 'solid' | 'wavy';
480
+ outlineStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'auto' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
481
+ }>;
482
+
483
+ /** Paint-only property names exposed by the SDK contract. */
484
+ 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';
485
+
486
+ /** Paint declarations plus controlled typography and target-level layout fields. */
487
+ declare type AppearanceRuleDeclarations = AppearancePaintDeclarations & AppearanceLayoutDeclarations & {
488
+ /** Single font family identifier admitted only for authorized targets at runtime. */
489
+ readonly fontFamily?: string;
490
+ /** Integer pixel size admitted only for authorized text targets at runtime. */
491
+ readonly fontSize?: `${number}px`;
492
+ /** Controlled font weight admitted only for authorized text targets at runtime. */
493
+ readonly fontWeight?: 400 | 500 | 600 | 700;
494
+ /** Controlled font style admitted only for authorized text targets at runtime. */
495
+ readonly fontStyle?: 'normal' | 'italic';
496
+ };
497
+
498
+ /** Controlled pseudo-class accepted by the merchant selector grammar. */
499
+ declare type AppearanceRulePseudoClass = 'autofill';
500
+
501
+ /** Controlled pseudo-element accepted by the merchant selector grammar. */
502
+ declare type AppearanceRulePseudoElement = 'placeholder' | 'selection';
503
+
504
+ /**
505
+ * Optional state or controlled pseudo suffix on one alias.
506
+ */
507
+ export declare type AppearanceRuleScopeSuffix = '' | `:${AppearanceRuleState | AppearanceRulePseudoClass}` | `::${AppearanceRulePseudoElement}`;
508
+
509
+ /** One merchant alias with an optional semantic suffix. */
510
+ export declare type AppearanceRuleSelector<RuleAlias extends string> = `${RuleAlias}${AppearanceRuleScopeSuffix}`;
511
+
512
+ /** Semantic states accepted by the merchant selector grammar. */
513
+ declare type AppearanceRuleState = 'hover' | 'focus' | 'focus-visible' | 'active' | 'disabled' | 'loading' | 'selected' | 'checked' | 'expanded' | 'invalid' | 'success' | 'error';
514
+
515
+ /** Backward-compatible name for the Express appearance configuration. */
516
+ export declare type AppearanceSetting = ExpressAppearance;
517
+
518
+ /** Exact official spacing Token accepted by controlled margin and padding. */
519
+ export declare type AppearanceSpacingToken = `var(--spacing-${'base' | 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'})`;
520
+
521
+ /** Runtime-constrained non-negative integer pixel value for spacing longhands. */
522
+ export declare type AppearanceSpacingValue = '0' | `${number}px` | AppearanceSpacingToken;
523
+
524
+ /**
525
+ * 对客公开 appearance variables 类型(Token 2.x,figma-v4「3 层 + 状态」命名)。
526
+ * 字段名为新 CSS 变量名去掉 '--' 前缀(如 color-text-primary)。
527
+ *
528
+ * 权威源:`antom-web-checkout-v2/packages/elements2/src/utils/themeConfig.ts` 的 `PUBLIC_TOKENS`
529
+ * (54 color + 4 radius + 10 spacing = 68 项)。本 union 是该清单的手工镜像,
530
+ * 增删 token 时必须两侧同步,否则商户会遇到「类型报错但运行时可用」的错位。
531
+ *
532
+ * 命名规则:`--color-<scene>-<level>[-<state>]`;brand 场景并入 scene 段的 camelCase
533
+ * (如 `color-backgroundBrand-primary-hover`),CSS 变量大小写敏感,不可改写为 kebab。
534
+ *
535
+ * @example
536
+ * variables: { 'color-text-primary': '#2a3a52', 'radius-sm': '4px' }
537
+ */
538
+ 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';
539
+
449
540
  declare interface AppleMerchantInfo {
450
541
  /**
451
542
  * @description Apple商户ID
@@ -834,10 +925,6 @@ declare interface BankInfo {
834
925
  hasSchemaUrl?: boolean;
835
926
  }
836
927
 
837
- declare interface BaseAppearance<A extends Partial<Appearance>> {
838
- appearance?: A;
839
- }
840
-
841
928
  /**
842
929
  * @description 内置基础的桥接事件映射类型
843
930
  */
@@ -2457,18 +2544,22 @@ export declare interface ConfirmCardSetupOptions {
2457
2544
  redirect?: 'always' | 'if_required';
2458
2545
  }
2459
2546
 
2460
- export declare interface ConfirmPaymentOptions extends Omit<ConfirmCardSetupOptions, 'elements'>, PaymentSubmitParams {
2461
- sessionData: string;
2462
- /**
2463
- * @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
2464
- */
2465
- elements?: BaseMainElement | BaseElements;
2547
+ export declare type ConfirmPaymentOptions = PaymentSubmitParams & {
2466
2548
  appearance?: CVVAppearance;
2467
2549
  /**
2468
2550
  * @description 集成用户自定义信息(如 cardHolderName)
2469
2551
  */
2470
2552
  params?: Record<string, unknown>;
2471
- }
2553
+ } & ({
2554
+ /** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
2555
+ elements: BaseMainElement | BaseElements;
2556
+ /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
2557
+ sessionData?: string;
2558
+ } | {
2559
+ elements?: undefined;
2560
+ /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
2561
+ sessionData: string;
2562
+ });
2472
2563
 
2473
2564
  /**
2474
2565
  * @description Connect流程参数
@@ -2605,11 +2696,13 @@ declare interface CustomFontSource {
2605
2696
  * @public
2606
2697
  * @description CVV element app config type
2607
2698
  */
2608
- export declare interface CVVAppConfig extends BaseAppearance<CVVAppearance>, BaseElementAppConfig {
2699
+ export declare interface CVVAppConfig extends BaseElementAppConfig {
2700
+ /** CVV appearance configuration including optional alias-only Rules. */
2701
+ appearance?: CVVAppearance;
2609
2702
  /**
2610
- * @description sessionData
2703
+ * @description 创建时必填的支付会话;不可通过 updateConfig 或 submit 替换
2611
2704
  */
2612
- sessionData?: string;
2705
+ sessionData: string;
2613
2706
  /**
2614
2707
  * @internal sessionConfig 渲染数据,内部使用,无需用户传递
2615
2708
  */
@@ -2639,12 +2732,13 @@ export declare interface CVVAppConfig extends BaseAppearance<CVVAppearance>, Bas
2639
2732
  paymentFlow?: 'automatic' | 'cvv';
2640
2733
  }
2641
2734
 
2642
- export declare type CVVAppearance = PickAppearance<CVVAppearanceProps>;
2735
+ export declare type CVVAppearance = PickAntomAppearance<CVVAppearanceProps>;
2643
2736
 
2644
2737
  export declare type CVVAppearanceProps = {
2645
2738
  theme: AntomTheme;
2646
- variables: AntomVariables;
2739
+ variables: AppearanceVariables | AntomVariables;
2647
2740
  fonts?: FontSource[];
2741
+ rules: AppearanceRuleSelector<string>;
2648
2742
  };
2649
2743
 
2650
2744
  /**
@@ -2652,11 +2746,19 @@ export declare type CVVAppearanceProps = {
2652
2746
  */
2653
2747
  export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVElementEvents> {
2654
2748
  static elementType: string;
2749
+ private readonly sessionData;
2655
2750
  constructor(name: string, config: CVVElementConfig);
2656
2751
  /**
2657
2752
  * @internal
2658
2753
  */
2659
2754
  setup(): Promise<Partial<CVVAppConfig> | undefined>;
2755
+ /**
2756
+ * @internal Not supported by the public CVV integration API.
2757
+ * Updates appearance only, preserving the Rules clear semantics.
2758
+ * @param newConfig Appearance configuration patch.
2759
+ * @returns The WebApp update acknowledgement.
2760
+ */
2761
+ updateConfig(newConfig: Pick<CVVAppConfig, 'appearance'>): Promise<CVVElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
2660
2762
  /**
2661
2763
  * @internal
2662
2764
  */
@@ -2671,20 +2773,10 @@ export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVEle
2671
2773
  * @description CVV element config type
2672
2774
  */
2673
2775
  export declare interface CVVElementConfig extends BaseElementConfig<CVVAppConfig> {
2776
+ appConfig: CVVAppConfig;
2674
2777
  }
2675
2778
 
2676
- export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams> {
2677
- /**
2678
- * @description Emitted event about form
2679
- */
2680
- form: {
2681
- errors?: Array<{
2682
- field: string | number;
2683
- message: string;
2684
- currentValue: any;
2685
- }>;
2686
- message: string;
2687
- };
2779
+ export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams & Pick<CVVAppConfig, 'sessionData'>> {
2688
2780
  /**
2689
2781
  * @description Emitted when the element is destroy
2690
2782
  */
@@ -2728,10 +2820,6 @@ export declare type CVVSubmitErrorCodes = 'NOT_FIND_MAINELEMENT' | 'SESSION_DATA
2728
2820
  * @description CVV 支付提交参数
2729
2821
  */
2730
2822
  export declare interface CVVSubmitParams {
2731
- /**
2732
- * 支付会话数据
2733
- */
2734
- sessionData?: string;
2735
2823
  /**
2736
2824
  * 重定向策略
2737
2825
  */
@@ -3544,20 +3632,21 @@ declare interface ExpPaymentOptionDetail {
3544
3632
  * @public
3545
3633
  * @description Express element app config type
3546
3634
  */
3547
- export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetting>, BaseElementAppConfig {
3635
+ export declare interface ExpressAppConfig extends BaseElementAppConfig {
3636
+ /** Express appearance configuration. */
3637
+ appearance?: ExpressAppearance;
3548
3638
  /** payment SessionData */
3549
3639
  sessionData?: string;
3550
- /** Business division (country/region) */
3551
- businessDivision?: string;
3552
3640
  /**
3553
3641
  * Amount & Currency
3554
3642
  *
3555
- * Only effective via `updateConfig({ amount })` at runtime.
3556
- * Passing amount at creation time is ignored; the initial amount
3557
- * comes from the server-side sdkQuery result (renderData.paymentAmount).
3643
+ * For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
3644
+ * the payment session currency's minor unit; `currency` may be omitted.
3645
+ * For example, USD 10.99 is passed as `{ value: '1099' }`.
3646
+ * PayPal keeps its existing major-unit amount semantics and requires `currency`.
3558
3647
  */
3559
3648
  amount?: {
3560
- currency: string;
3649
+ currency?: string;
3561
3650
  value: string;
3562
3651
  };
3563
3652
  /** PayPal 配置 */
@@ -3611,6 +3700,17 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
3611
3700
  doMain?: string;
3612
3701
  }
3613
3702
 
3703
+ /** Express element appearance configuration. */
3704
+ declare type ExpressAppearance = PickAntomAppearance<ExpressAppearanceProps>;
3705
+
3706
+ /** Express element appearance properties. */
3707
+ export declare type ExpressAppearanceProps = {
3708
+ displaySetting: 'showCardBrandIcon';
3709
+ theme: 'light' | 'dark';
3710
+ layout: 'accordion' | 'tabs';
3711
+ rules: AppearanceRuleSelector<string>;
3712
+ };
3713
+
3614
3714
  /** cancel 事件负载 */
3615
3715
  export declare interface ExpressCancelEvent {
3616
3716
  expressPaymentType: string;
@@ -3686,7 +3786,17 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3686
3786
  private _localHandlers;
3687
3787
  /** 支付流程进行中标志(click → confirm/error/cancel 之间) */
3688
3788
  private _paymentInProgress;
3789
+ /**
3790
+ * 是否已收到 iframe 业务层 ready 事件(app.tsx sendReady)。
3791
+ * 注意:与 host `status='ready'`(由 HANDSHAKE_ACK 触发,bridge.js:450 同步回发,与 amount 解析无关)不同。
3792
+ * 首屏 amount setupError 时 iframe 不发业务 ready → _readyReceived 保持 false,
3793
+ * 据此判别"首屏失败"以阻断后续 updateConfig。
3794
+ */
3795
+ private _readyReceived;
3796
+ /** 首屏 setupError 致命标志:置位后 updateConfig 被 CHECKOUT_NOT_READY 阻断,只能 destroy 重开。 */
3797
+ private _setupFailed;
3689
3798
  private _paypalOverlay;
3799
+ private _updateQueue;
3690
3800
  constructor(name: string, config: ExpressElementConfig);
3691
3801
  /**
3692
3802
  * 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
@@ -3697,7 +3807,17 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3697
3807
  * 用于 Native WebView 场景下 SDK 需要向商户透传跳转信息等。
3698
3808
  */
3699
3809
  private _emit;
3700
- updateConfig(newConfig: Pick<ExpressAppConfig, 'amount'>): Promise<ExpressElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
3810
+ updateConfig(newConfig: ExpressAppConfig): Promise<ExpressElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
3811
+ private updateConfigTransaction;
3812
+ private updateAmountConfigWithSanitizedDebug;
3813
+ private getAmountValidationReason;
3814
+ /** iframe 业务 ready 事件到达:置 _readyReceived,后续运行时 error 不再视为首屏失败。
3815
+ * ready 是"本次首屏成功"的确实信号(首屏 setupError 时 iframe 不发 ready),
3816
+ * 故同时清掉 _setupFailed——unmount+remount 同实例二次首屏成功后可恢复 updateConfig。
3817
+ */
3818
+ private _handleReady;
3819
+ /** iframe error 事件:若 business ready 未到达,视为首屏 setupError → 置 _setupFailed 阻断后续 updateConfig。 */
3820
+ private _handleError;
3701
3821
  /**
3702
3822
  * 商户在 confirm 回调内调用,触发实际支付提交。
3703
3823
  * iframe 收到 OPENSDK@COMPLETE_PAYMENT 后执行 submitPay / polling 等,
@@ -3712,6 +3832,7 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3712
3832
  };
3713
3833
  /** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
3714
3834
  userCanceled3D?: boolean;
3835
+ status?: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
3715
3836
  }>;
3716
3837
  setup(): Promise<Partial<ExpressAppConfig> | undefined>;
3717
3838
  private registerInternalListeners;
@@ -3786,6 +3907,11 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
3786
3907
  'OPENSDK@GET_APPLE_PAY_TOKEN': {
3787
3908
  requestId: string;
3788
3909
  expressPaymentType: string;
3910
+ /** iframe 已转好的 major unit 金额(来自 resolvedAmount);host 委托 Apple Pay 消费,不再做 minor→major 转换。 */
3911
+ walletAmount?: {
3912
+ value: string;
3913
+ currency: string;
3914
+ };
3789
3915
  };
3790
3916
  /** host 完成 Apple Pay token 获取后回包给 iframe,submit/3DS/polling 均由 webapp 完成 */
3791
3917
  'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': {
@@ -3896,6 +4022,57 @@ declare interface FrontSupportIppBank {
3896
4022
  logo?: Logo;
3897
4023
  }
3898
4024
 
4025
+ /** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
4026
+ declare interface GetApplePayTokenReply {
4027
+ success: boolean;
4028
+ result?: {
4029
+ token?: unknown;
4030
+ billingContact?: unknown;
4031
+ shippingContact?: unknown;
4032
+ } | {
4033
+ errorCode: string;
4034
+ };
4035
+ }
4036
+
4037
+ /** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
4038
+ declare interface GetApplePayTokenRequest {
4039
+ paymentMethod?: {
4040
+ paymentMethodDetail?: {
4041
+ applePayProps?: {
4042
+ paymentRequest?: unknown;
4043
+ };
4044
+ };
4045
+ };
4046
+ shipping?: unknown;
4047
+ }
4048
+
4049
+ /** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
4050
+ declare interface GetGooglePayTokenReply {
4051
+ success: boolean;
4052
+ result?: unknown;
4053
+ err?: {
4054
+ statusCode?: string;
4055
+ [key: string]: unknown;
4056
+ };
4057
+ }
4058
+
4059
+ /** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
4060
+ declare interface GetGooglePayTokenRequest {
4061
+ actionName?: string;
4062
+ data?: {
4063
+ environment?: string;
4064
+ paymentRequest?: unknown;
4065
+ paymentMethod?: unknown;
4066
+ paymentMethodDetail?: {
4067
+ googlePayProps?: {
4068
+ environment?: string;
4069
+ paymentRequest?: unknown;
4070
+ };
4071
+ };
4072
+ [key: string]: unknown;
4073
+ };
4074
+ }
4075
+
3899
4076
  declare type GetI18nQueryParam = string | {
3900
4077
  /**
3901
4078
  * 多语言文案的 key
@@ -4746,6 +4923,58 @@ declare interface Language {
4746
4923
  country?: string;
4747
4924
  }
4748
4925
 
4926
+ /**
4927
+ * @deprecated Token 1.0 老字段类型 — 请迁移到 {@link AppearanceVariables}。
4928
+ * 所有字段均已废弃,运行时由 WebApp 侧 LEGACY_TO_NEW_TOKEN_MAP 翻译为新 token。
4929
+ *
4930
+ * @deprecated 'content-primary' → color-text-primary
4931
+ * @deprecated 'content-secondary' → color-text-secondary
4932
+ * @deprecated 'content-tertiary' → color-text-tertiary
4933
+ * @deprecated 'content-quaternary' → color-text-inverse
4934
+ * @deprecated 'background-primary' → color-background-primary
4935
+ * @deprecated 'background-secondary' → color-background-secondary
4936
+ * @deprecated 'background-disable' → color-background-disabled
4937
+ * @deprecated 'background-transparency' → color-background-transparency
4938
+ * @deprecated 'border-primary' → color-border-primary
4939
+ * @deprecated 'border-secondary' → color-border-secondary
4940
+ * @deprecated 'border-disable' → color-border-disabled
4941
+ * @deprecated 'border-active' → color-border-active
4942
+ * @deprecated 'action-normal' → 一对多 fan-out(无单值映射;运行时展开为 3 个新 token,老 key 不再注入):
4943
+ * - background/background-color → color-backgroundBrand-primary
4944
+ * - border/border-color/box-shadow → color-border-active
4945
+ * - color/文本/图标/勾选态 → color-text-active
4946
+ * @deprecated 'action-hover' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
4947
+ * - background → color-backgroundBrand-primary-hover
4948
+ * - border → color-borderBrand-primary-hover
4949
+ * 文字色 color-textBrand-secondary-hover 不参与派生
4950
+ * (设计稿中与 bg/border 不同色阶),需要时请显式传入该新 token 键
4951
+ * @deprecated 'action-secondary' → color-backgroundBrand-secondary
4952
+ * @deprecated 'action-disable' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
4953
+ * - background/background-color → color-backgroundBrand-disabled
4954
+ * - border/border-color → color-borderBrand-disabled
4955
+ * 文字色 color-textBrand-disabled 不参与派生
4956
+ * (设计稿中全部主题均与 bg/border 不同色阶),需要时请显式传入该新 token 键
4957
+ * @deprecated 'state-success' → color-text-success
4958
+ * @deprecated 'state-failure' → color-text-danger
4959
+ * @deprecated 'state-warning' → color-text-warning
4960
+ * @deprecated 'state-info' → color-text-info
4961
+ * @deprecated 'state-conventional' → color-text-neutral
4962
+ * @deprecated 'state-marketing' → color-text-promotional(color 上下文;background 上下文由 CSS 层直接迁移)
4963
+ * @deprecated 'radius-backup' → radius-sm
4964
+ * @deprecated 'radius-component' → radius-md
4965
+ * @deprecated 'radius-module' → radius-lg
4966
+ * @deprecated 'radius-button' → radius-lg(与 radius-module 同档合并)
4967
+ * @deprecated 'wrapper-padding' → spacing-lg
4968
+ * @deprecated 'stroke-default' → 由 Rules 机制接管
4969
+ * @deprecated 'stroke-active' → 由 Rules 机制接管
4970
+ *
4971
+ * 注:fan-out 展开基数以 figma-v4 设计稿的色阶一致性为准,故 action-hover / action-disable
4972
+ * 为 1→2 而非 1→3;三者合计派生 7 项。
4973
+ */
4974
+ 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'
4975
+ /** 非 Token 体系字段,由 WebApp 侧展开为 design-font-family-* 系列 */
4976
+ | 'fontFamily';
4977
+
4749
4978
  declare interface Link {
4750
4979
  /**
4751
4980
  * @description 发起关联的父元素,如国家
@@ -7312,7 +7541,7 @@ declare interface OtpChallengeActionForm {
7312
7541
  resendLeftTimes?: number;
7313
7542
  }
7314
7543
 
7315
- declare type PartialSpeKey<T, V> = Partial<T extends infer K extends string ? Record<K, V> : Record<string, V>>;
7544
+ declare type PartialSpeKey<T extends string | undefined, V> = Partial<Record<T extends string ? T : string, V>>;
7316
7545
 
7317
7546
  declare interface PayByLinkInfo {
7318
7547
  /**
@@ -7336,7 +7565,9 @@ declare interface PayByLinkInfo {
7336
7565
  /**
7337
7566
  * @description Payment element app config type
7338
7567
  */
7339
- export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearance>, BaseElementAppConfig {
7568
+ export declare interface PaymentAppConfig extends BaseElementAppConfig {
7569
+ /** Payment appearance configuration including optional alias-only Rules. */
7570
+ appearance?: PaymentAppearance;
7340
7571
  /**
7341
7572
  * @description sessionData,无法通过updateConfig更新
7342
7573
  */
@@ -7398,12 +7629,18 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
7398
7629
  /**
7399
7630
  * @description Payment element appearance type
7400
7631
  */
7401
- export declare type PaymentAppearance = PickAppearance<{
7632
+ export declare type PaymentAppearance = PickAntomAppearance<PaymentAppearanceProps>;
7633
+
7634
+ /**
7635
+ * @description Payment element appearance properties
7636
+ */
7637
+ export declare type PaymentAppearanceProps = {
7402
7638
  displaySetting: 'showPaymentMethodListWhenSingleOption' | 'showCardBrandIcon' | 'showRadioWhenAccordionLayout' | 'showCardCVV';
7403
7639
  theme: AntomTheme;
7404
- variables: AntomVariables;
7640
+ variables: AppearanceVariables | AntomVariables;
7405
7641
  layout: AntomLayouts;
7406
- }>;
7642
+ rules: AppearanceRuleSelector<string>;
7643
+ };
7407
7644
 
7408
7645
  /**
7409
7646
  * @description Payment element
@@ -7411,15 +7648,16 @@ export declare type PaymentAppearance = PickAppearance<{
7411
7648
  export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
7412
7649
  static elementType: string;
7413
7650
  private _paymentInProgress;
7651
+ private readonly walletLogger;
7414
7652
  constructor(name: string, config: PaymentElementConfig);
7415
7653
  /**
7416
7654
  * @internal
7417
7655
  */
7418
7656
  setup(): Promise<Partial<PaymentAppConfig> | undefined>;
7419
7657
  /**
7420
- * @description Update payment element configuration with amount validation
7658
+ * @description Update payment element configuration with amount validation and appearance Rules support
7421
7659
  */
7422
- updateConfig(newConfig: Pick<PaymentAppConfig, 'amount'>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
7660
+ updateConfig(newConfig: Partial<PaymentAppConfig>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
7423
7661
  /**
7424
7662
  * @internal
7425
7663
  */
@@ -7439,6 +7677,20 @@ declare interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfi
7439
7677
  * @description Payment element events
7440
7678
  */
7441
7679
  export declare interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
7680
+ /**
7681
+ * webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
7682
+ * payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
7683
+ */
7684
+ 'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
7685
+ /** host 完成 Apple Pay token 获取后回包给 webapp */
7686
+ 'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
7687
+ /**
7688
+ * webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
7689
+ * payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
7690
+ */
7691
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
7692
+ /** host 完成 Google Pay token 获取后回包给 webapp */
7693
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
7442
7694
  }
7443
7695
 
7444
7696
  declare interface PaymentElementView {
@@ -8130,6 +8382,7 @@ export declare interface PayPalConfig {
8130
8382
  channelMerchantAccountId?: string;
8131
8383
  /** Button style (fine-grained override) */
8132
8384
  style?: PayPalButtonStyle;
8385
+ businessDivision?: string;
8133
8386
  /** Callback to create PayPal order, no params, returns sessionData */
8134
8387
  createOrder?: () => Promise<string>;
8135
8388
  /** Callback when user changes shipping address, data is raw data returned by PayPal */
@@ -8149,12 +8402,15 @@ declare interface PeriodRule {
8149
8402
  periodCount?: number;
8150
8403
  }
8151
8404
 
8405
+ /** Builds an Antom appearance type with the restricted Rules declaration contract. */
8406
+ declare type PickAntomAppearance<T extends Record<string, any>> = PickAppearance<T, AppearanceRuleDeclarations>;
8407
+
8152
8408
  /**
8153
8409
  * @description 工具类型,仅从 Appearance 中拾取与 Props 类型匹配的属性。
8154
8410
  * 返回受 Props 中存在的键约束的部分外观对象。
8155
8411
  * @template Props - 要从 Appearance 中拾取的自定义外观属性类型。
8156
8412
  */
8157
- declare type PickAppearance<Props extends Partial<DefaultAppearanceProps>> = Partial<Pick<Appearance<Props>, keyof Props extends infer k extends keyof Partial<Appearance> ? k : keyof Partial<Appearance>>>;
8413
+ 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>>>;
8158
8414
 
8159
8415
  /**
8160
8416
  * @description 政策信息,例如隐私链接,免责声明等
@@ -24862,7 +25118,9 @@ declare interface UserName {
24862
25118
  * @public
24863
25119
  * @description Vaulting element app config type
24864
25120
  */
24865
- export declare interface VaultingAppConfig extends BaseAppearance<VaultingAppearance>, BaseElementAppConfig {
25121
+ export declare interface VaultingAppConfig extends BaseElementAppConfig {
25122
+ /** Vaulting appearance configuration including optional alias-only Rules. */
25123
+ appearance?: VaultingAppearance;
24866
25124
  /**
24867
25125
  * @description sessionData,无法通过updateConfig更新
24868
25126
  */
@@ -24889,13 +25147,14 @@ export declare interface VaultingAppConfig extends BaseAppearance<VaultingAppear
24889
25147
  _requestConfig?: Partial<Omit<RequestOptions, 'scope' | 'tracker'>>;
24890
25148
  }
24891
25149
 
24892
- export declare type VaultingAppearance = PickAppearance<VaultingAppearanceProps>;
25150
+ export declare type VaultingAppearance = PickAntomAppearance<VaultingAppearanceProps>;
24893
25151
 
24894
25152
  export declare type VaultingAppearanceProps = {
24895
25153
  displaySetting: 'showCardBrandIcon';
24896
25154
  theme: AntomTheme;
24897
- variables: AntomVariables;
25155
+ variables: AppearanceVariables | AntomVariables;
24898
25156
  fonts?: FontSource[];
25157
+ rules: AppearanceRuleSelector<string>;
24899
25158
  };
24900
25159
 
24901
25160
  /**
@@ -24908,6 +25167,12 @@ export declare class VaultingElement extends BaseMainElement<VaultingElementConf
24908
25167
  * @internal
24909
25168
  */
24910
25169
  setup(): Promise<Partial<VaultingAppConfig> | undefined>;
25170
+ /**
25171
+ * Updates Vaulting configuration while preserving the public Rules clear semantics.
25172
+ * @param newConfig Partial Vaulting configuration patch.
25173
+ * @returns The WebApp update acknowledgement.
25174
+ */
25175
+ updateConfig(newConfig: Partial<VaultingAppConfig>): Promise<VaultingElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
24911
25176
  /**
24912
25177
  * @internal
24913
25178
  */