@alipay/ams-checkout 0.0.1783663570-dev.6 → 0.0.1783663570-dev.7

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.
@@ -1,3 +1,5 @@
1
+ import type { CompatibleTrackerFull } from '@antintl/intl-tracker/common';
2
+
1
3
  declare interface ActionForm {
2
4
  /**
3
5
  * @description action form type
@@ -5,8 +7,6 @@ declare interface ActionForm {
5
7
  actionFormType?: string;
6
8
  }
7
9
 
8
- declare type AddBehavior = (behavior: BehaviorData) => void;
9
-
10
10
  declare interface Address {
11
11
  /**
12
12
  * @description 2-letter courtry/region code, refer to ISO 3166
@@ -405,6 +405,9 @@ export declare const AntomSDKErrorCodes: {
405
405
  readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
406
406
  readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
407
407
  readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
408
+ /**
409
+ * @description 是否需要更换 session 重试
410
+ */
408
411
  readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
409
412
  readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
410
413
  readonly API_MISS_PARAMS: "API_MISS_PARAMS";
@@ -424,20 +427,6 @@ export declare type AntomTheme = 'default' | 'agateGreen' | 'night' | 'nostalgic
424
427
 
425
428
  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';
426
429
 
427
- declare interface APICallbackOptions {
428
- requestType: 'fetch' | 'xhr';
429
- time: number;
430
- url: string;
431
- isSuccess?: boolean;
432
- error?: unknown;
433
- status?: number;
434
- type?: string;
435
- method?: string;
436
- traceId?: string;
437
- errorCode?: string | number;
438
- errorMsg?: string;
439
- }
440
-
441
430
  /**
442
431
  * @description SDK UI组件的外观配置。
443
432
  * 控制主题、CSS变量、布局规则及显示设置。
@@ -1022,7 +1011,7 @@ declare abstract class BaseElement<Config extends BaseElementConfig = BaseElemen
1022
1011
  * @internal 内部使用
1023
1012
  */
1024
1013
  iframe: HTMLIFrameElement | null;
1025
- status: 'initialized' | 'mounting' | 'mounted' | 'ready' | 'destroyed' | 'unmounted';
1014
+ status: ElementStatus;
1026
1015
  /**
1027
1016
  * @description 等待发送的时间
1028
1017
  * @internal 外部不要访问
@@ -1040,6 +1029,12 @@ declare abstract class BaseElement<Config extends BaseElementConfig = BaseElemen
1040
1029
  * @internal 外部不能直接调用
1041
1030
  */
1042
1031
  setup(): Promise<Partial<BaseElementAppConfig> | undefined>;
1032
+ /** Races merchant setup against destruction to stop the mount flow immediately. */
1033
+ private _setup;
1034
+ /**
1035
+ * @internal Checks whether this element is an instance of the given element class.
1036
+ */
1037
+ is<T extends iBaseElementClass>(eleCls: T): this is InstanceType<T>;
1043
1038
  /**
1044
1039
  * @param {HTMLElement} container
1045
1040
  */
@@ -1113,7 +1108,7 @@ declare abstract class BaseElement<Config extends BaseElementConfig = BaseElemen
1113
1108
  * @param fn 构建回调
1114
1109
  * @internal
1115
1110
  */
1116
- _addHook(hookName: 'ondestroy', fn: () => void): () => void;
1111
+ _addHook(hookName: 'ondestroy', fn: (preStatus: ElementStatus) => void): () => void;
1117
1112
  }
1118
1113
 
1119
1114
  declare interface BaseElementAppConfig {
@@ -1245,7 +1240,7 @@ declare abstract class BaseFactory {
1245
1240
  */
1246
1241
  init(): Promise<this>;
1247
1242
  /**
1248
- * @description 默认情况下,生成元素的key为elementType,如有特殊需求,可重写此方法
1243
+ * @description 默认情况下,生成元素的key为elementType,如有特殊需求,可重写此方法,key请以${elementType}开头,如elementType是payment则key可以是paymentXXX或者payment
1249
1244
  * @internal
1250
1245
  */
1251
1246
  protected generateElementKey(elementType: string, _options?: Partial<BaseElementAppConfig>): string;
@@ -1321,26 +1316,6 @@ declare interface BaseFactoryConfig extends BaseConfig {
1321
1316
  trackerCode?: string;
1322
1317
  }
1323
1318
 
1324
- declare type BaseInfo = BrowserInfo & DeviceInfo & NetworkInfo & LocationInfo & EnvInfo & OSInfo & {
1325
- sdk?: string;
1326
- marmotId?: string;
1327
- compatibleAppId?: string;
1328
- deviceId?: string;
1329
- userId?: string;
1330
- programVer?: string;
1331
- language?: string;
1332
- timezone?: string;
1333
- bizType?: string;
1334
- productId?: string;
1335
- clientId?: string;
1336
- visibleState?: 'visible' | 'hidden' | 'app-visible' | 'page-visible' | 'app-hidden' | 'page-hidden';
1337
- };
1338
-
1339
- declare interface BaseInfoPlugin {
1340
- getAppName?(): Promise<string | undefined>;
1341
- getDefaultExtraInfo?(): Promise<BaseInfo>;
1342
- }
1343
-
1344
1319
  /**
1345
1320
  * @description 主元素,可以独立提交
1346
1321
  */
@@ -1404,68 +1379,6 @@ declare interface BaseOpenModalConfig {
1404
1379
  modalId?: string;
1405
1380
  }
1406
1381
 
1407
- declare type BehaviorConfig = {
1408
- enableConsole?: boolean;
1409
- };
1410
-
1411
- declare interface BehaviorData {
1412
- type: string;
1413
- data: {
1414
- msg?: string | null;
1415
- from?: string;
1416
- to?: string;
1417
- };
1418
- timestamp: number;
1419
- times?: number;
1420
- }
1421
-
1422
- declare type BlankMonitorConfig = {
1423
- selector?: string | string[];
1424
- delay?: number | (() => number);
1425
- persistent?: boolean;
1426
- };
1427
-
1428
- declare interface BrowserInfo {
1429
- title?: string;
1430
- fullUrl?: string;
1431
- url?: string;
1432
- referrer?: string;
1433
- domCnt?: number;
1434
- delay?: number;
1435
- scrollTop?: number;
1436
- lastAction?: string;
1437
- sessionId?: string;
1438
- containerPageSessionId?: string;
1439
- containerSessionId?: string;
1440
- ua?: string;
1441
- browser?: string;
1442
- cCoreVer?: string;
1443
- assetsVer?: string;
1444
- }
1445
-
1446
- declare type C = {
1447
- c1?: string;
1448
- c2?: string;
1449
- c3?: string;
1450
- c4?: string;
1451
- c5?: string;
1452
- c6?: string;
1453
- c7?: string;
1454
- c8?: string;
1455
- c9?: string;
1456
- c10?: string;
1457
- c11?: string;
1458
- c12?: string;
1459
- c13?: string;
1460
- c14?: string;
1461
- c15?: string;
1462
- c16?: string;
1463
- c17?: string;
1464
- c18?: string;
1465
- c19?: string;
1466
- c20?: string;
1467
- };
1468
-
1469
1382
  /**
1470
1383
  * @description C2P标识
1471
1384
  */
@@ -2502,68 +2415,7 @@ declare interface ComIpayIexpprodServiceFacadeCommonPromotionInfo {
2502
2415
  extendInfo?: Record<string, string>;
2503
2416
  }
2504
2417
 
2505
- declare class CompatibleTracker extends Tracker {
2506
- private mdata;
2507
- initi(options: OriginTrackerInitOptions & {
2508
- performance?: boolean;
2509
- error?: boolean;
2510
- }): Promise<boolean>;
2511
- set(options: Record<string, any>): void;
2512
- protected getDefaultExtraInfo(): Promise<{
2513
- title?: string | undefined;
2514
- fullUrl?: string | undefined;
2515
- url?: string | undefined;
2516
- referrer?: string | undefined;
2517
- domCnt?: number | undefined;
2518
- delay?: number | undefined;
2519
- scrollTop?: number | undefined;
2520
- lastAction?: string | undefined;
2521
- sessionId?: string | undefined;
2522
- containerPageSessionId?: string | undefined;
2523
- containerSessionId?: string | undefined;
2524
- ua?: string | undefined;
2525
- browser?: string | undefined;
2526
- cCoreVer?: string | undefined;
2527
- assetsVer?: string | undefined;
2528
- device?: string | undefined;
2529
- deviceType?: string | undefined;
2530
- deviceBrand?: string | undefined;
2531
- deviceModel?: string | undefined;
2532
- screenWidth?: number | undefined;
2533
- screenHeight?: number | undefined;
2534
- contentHeight?: number | undefined;
2535
- pixelRatio?: number | undefined;
2536
- cClient?: string | undefined;
2537
- networkType?: string | undefined;
2538
- isp?: string | undefined;
2539
- ip?: string | undefined;
2540
- countryName?: string | undefined;
2541
- cityName?: string | undefined;
2542
- provinceName?: string | undefined;
2543
- area?: string | undefined;
2544
- env?: Env_2 | undefined;
2545
- sprintId?: string | undefined;
2546
- container?: string | undefined;
2547
- cOfflineVer?: string | undefined;
2548
- serverIp?: string | undefined;
2549
- serverEnv?: string | undefined;
2550
- canaryFlag?: string | undefined;
2551
- os?: string | undefined;
2552
- osVer?: string | undefined;
2553
- sdk?: string | undefined;
2554
- marmotId?: string | undefined;
2555
- compatibleAppId?: string | undefined;
2556
- deviceId?: string | undefined;
2557
- userId?: string | undefined;
2558
- programVer?: string | undefined;
2559
- language?: string | undefined;
2560
- timezone?: string | undefined;
2561
- bizType?: string | undefined;
2562
- productId?: string | undefined;
2563
- clientId?: string | undefined;
2564
- visibleState?: "hidden" | "visible" | "app-visible" | "page-visible" | "app-hidden" | "page-hidden" | undefined;
2565
- }>;
2566
- }
2418
+ declare type CompatibleTrackerFullOptions = ConstructorParameters<typeof CompatibleTrackerFull>[0];
2567
2419
 
2568
2420
  /**
2569
2421
  * @description googlePay createPaymentSession 入参
@@ -2588,7 +2440,7 @@ export declare interface ConfirmCardSetupOptions {
2588
2440
  redirect?: 'always' | 'if_required';
2589
2441
  }
2590
2442
 
2591
- export declare interface ConfirmPaymentOptions extends Omit<ConfirmCardSetupOptions, 'elements'> {
2443
+ export declare interface ConfirmPaymentOptions extends Omit<ConfirmCardSetupOptions, 'elements'>, PaymentSubmitParams {
2592
2444
  sessionData: string;
2593
2445
  /**
2594
2446
  * @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
@@ -2732,11 +2584,6 @@ declare interface CustomFontSource {
2732
2584
  unicodeRange?: string;
2733
2585
  }
2734
2586
 
2735
- /**
2736
- * CustomizedPerformanceKey 是给业务使用的自定义指标,共 20 个,页面之间互相独立
2737
- */
2738
- declare type CustomizedPerformanceKey = 'm1' | 'm2' | 'm3' | 'm4' | 'm5' | 'm6' | 'm7' | 'm8' | 'm9' | 'm10' | 'm11' | 'm12' | 'm13' | 'm14' | 'm15' | 'm16' | 'm17' | 'm18' | 'm19' | 'm20';
2739
-
2740
2587
  /**
2741
2588
  * @public
2742
2589
  * @description CVV element app config type
@@ -3453,18 +3300,6 @@ declare interface DeliveryEstimateInfo {
3453
3300
  value?: number;
3454
3301
  }
3455
3302
 
3456
- declare interface DeviceInfo {
3457
- device?: string;
3458
- deviceType?: string;
3459
- deviceBrand?: string;
3460
- deviceModel?: string;
3461
- screenWidth?: number;
3462
- screenHeight?: number;
3463
- contentHeight?: number;
3464
- pixelRatio?: number;
3465
- cClient?: string;
3466
- }
3467
-
3468
3303
  /**
3469
3304
  * @description 立减型营销信息
3470
3305
  */
@@ -3510,29 +3345,6 @@ declare interface DisplayItem {
3510
3345
  status?: string;
3511
3346
  }
3512
3347
 
3513
- declare type DMC = {
3514
- d1?: number | string;
3515
- d2?: number | string;
3516
- d3?: number | string;
3517
- d4?: number | string;
3518
- d5?: number | string;
3519
- d6?: number | string;
3520
- d7?: number | string;
3521
- d8?: number | string;
3522
- d9?: number | string;
3523
- d10?: number | string;
3524
- d11?: number | string;
3525
- d12?: number | string;
3526
- d13?: number | string;
3527
- d14?: number | string;
3528
- d15?: number | string;
3529
- d16?: number | string;
3530
- d17?: number | string;
3531
- d18?: number | string;
3532
- d19?: number | string;
3533
- d20?: number | string;
3534
- } & C & M;
3535
-
3536
3348
  /**
3537
3349
  * @description 元素列表项类型
3538
3350
  */
@@ -3594,21 +3406,9 @@ declare class Elements extends BaseElements {
3594
3406
  getElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
3595
3407
  }
3596
3408
 
3597
- declare type ElementTypeEnum = 'TEXT' | 'DIGIT_6' | 'DIGIT_18' | 'DIGIT_32' | 'DIGIT_11' | 'DIGIT_4' | 'DIGIT_10' | 'CHECKBOX' | 'SELECT' | 'SWITCH' | 'PASSWORD_2' | 'DATE_PICKER' | 'CHECKLIST' | 'ADDRESS' | 'DROPBOX' | 'DIGIT_13' | 'GRIDLIST' | 'TENOR_SELECT_KR' | 'STORELIST' | 'GRIDBANKLIST' | 'SUB_QR_CODE' | 'GRIDBANKTOP' | 'PHONE_TEXT_AREA_CODE' | 'SUPPORTIPPBANKLIST';
3598
-
3599
- declare type Env = 'local' | 'dev' | 'sit' | 'pre' | 'prod';
3600
-
3601
- declare type Env_2 = 'DEV' | 'SIT' | 'PRE' | 'PROD' | 'LOCAL';
3409
+ declare type ElementStatus = 'initialized' | 'mounting' | 'mounted' | 'ready' | 'destroyed' | 'unmounted';
3602
3410
 
3603
- declare interface EnvInfo {
3604
- env?: Env_2;
3605
- sprintId?: string;
3606
- container?: string;
3607
- cOfflineVer?: string;
3608
- serverIp?: string;
3609
- serverEnv?: string;
3610
- canaryFlag?: string;
3611
- }
3411
+ declare type ElementTypeEnum = 'TEXT' | 'DIGIT_6' | 'DIGIT_18' | 'DIGIT_32' | 'DIGIT_11' | 'DIGIT_4' | 'DIGIT_10' | 'CHECKBOX' | 'SELECT' | 'SWITCH' | 'PASSWORD_2' | 'DATE_PICKER' | 'CHECKLIST' | 'ADDRESS' | 'DROPBOX' | 'DIGIT_13' | 'GRIDLIST' | 'TENOR_SELECT_KR' | 'STORELIST' | 'GRIDBANKLIST' | 'SUB_QR_CODE' | 'GRIDBANKTOP' | 'PHONE_TEXT_AREA_CODE' | 'SUPPORTIPPBANKLIST';
3612
3412
 
3613
3413
  /**
3614
3414
  * @description 错误上下文对象。参考主站<code>ErrorContext</code>实现。
@@ -3639,9 +3439,11 @@ declare type ErrorSource = ErrorSource_2;
3639
3439
 
3640
3440
  declare type ErrorSource_2 = 'SDK_INTERNAL' | 'SDK_USAGE' | 'APP_RUNTIME' | 'SERVER_API' | 'SYSTEM';
3641
3441
 
3642
- declare type ErrorType = 'js-error-addeventlistener' | 'source-error' | 'promise-error' | 'video-error' | 'video-source-error';
3643
-
3644
- declare type EventFunction = (opt: Record<string, any>) => boolean;
3442
+ /**
3443
+ * @description 工具类型,从类型中排除 undefined。
3444
+ * 如果 T 继承 undefined 则返回 never,否则返回 T。
3445
+ */
3446
+ declare type ExcludeUndefined<T> = T extends undefined ? never : T;
3645
3447
 
3646
3448
  /**
3647
3449
  * @description 卡分期计划
@@ -4080,40 +3882,6 @@ declare type GetI18nQueryParam = string | {
4080
3882
  defaultMessage?: string;
4081
3883
  };
4082
3884
 
4083
- declare function getMiniPerformance(): Promise<{
4084
- performance: {
4085
- appLaunch: number;
4086
- jumpAppStartUnix: number;
4087
- preparePhase: number;
4088
- appPhase: number;
4089
- pagePhase: number;
4090
- appxPhase: number;
4091
- launchId: string;
4092
- launchType: 0 | 1;
4093
- };
4094
- onLoadTime: number;
4095
- loadId: string;
4096
- srcCount: number;
4097
- webviewComponentSrc?: string | undefined;
4098
- } | undefined>;
4099
-
4100
- declare type GetRequesterResult = (data: string, rawData: (ReportData & BaseInfo) | IOptions | IEventOPtions) => Promise<void>;
4101
-
4102
- declare interface GetWebVitalsInfoResult {
4103
- fcp: Promise<number | null | undefined>;
4104
- ttfb: Promise<number | null | undefined>;
4105
- lcp: Promise<number | null | undefined>;
4106
- inp: Promise<number | null | undefined>;
4107
- cls: Promise<number | null | undefined>;
4108
- }
4109
-
4110
- declare interface GetWhiteScreenInfoOptions {
4111
- selector?: string | string[];
4112
- delay?: number | (() => number);
4113
- persistent?: boolean;
4114
- ignoreNotInViewport?: boolean;
4115
- }
4116
-
4117
3885
  declare type GlobalOptions = {
4118
3886
  i18n?: SimpleI18n;
4119
3887
  i18nPrefix: string;
@@ -4681,19 +4449,6 @@ declare type HtmlAttributes =
4681
4449
  | "[writingsuggestions]"
4682
4450
  | "[xmlns]";
4683
4451
 
4684
- declare interface HTTPErrorCallbackOptions {
4685
- requestType: 'fetch' | 'xhr';
4686
- error?: unknown;
4687
- status?: number;
4688
- url: string;
4689
- type?: string;
4690
- redirected?: 0 | 1;
4691
- responseUrl?: string;
4692
- time: number;
4693
- method?: string;
4694
- aborted?: 0 | 1;
4695
- }
4696
-
4697
4452
  declare interface IApplePayContactField {
4698
4453
  email: string;
4699
4454
  name: string;
@@ -4707,16 +4462,6 @@ declare interface iBaseElementClass {
4707
4462
  elementType: string;
4708
4463
  }
4709
4464
 
4710
- declare interface IEventOPtions {
4711
- eventId: string;
4712
- param4: Record<string, any>;
4713
- immediat?: boolean;
4714
- }
4715
-
4716
- declare type IMDAP_SERVER = (typeof imdapServers)[number];
4717
-
4718
- declare const imdapServers: readonly ["https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do", "https://imdap.alipay.com/loggw/dwcookieLogGet.do", "https://imdap-de.alipay.com/loggw/dwcookieLogGet.do"];
4719
-
4720
4465
  declare interface InstallmentPlan {
4721
4466
  /**
4722
4467
  * @description 分期支持的银行
@@ -4835,38 +4580,23 @@ declare interface InterestFree {
4835
4580
  bankShortName?: string;
4836
4581
  }
4837
4582
 
4838
- declare class IntlOpenSDKTracker extends CompatibleTracker {
4839
- constructor(initOption?: IntlOpenSDKTrackerInitOptions_2);
4840
- initi(options: IntlOpenSDKTrackerInitOptions_2): Promise<boolean>;
4841
- set(data: Partial<IntlOpenSDKTrackerInitOptions_2>): void;
4842
- }
4843
-
4844
- declare interface IntlOpenSDKTrackerInitOptions extends Omit<IntlOpenSDKTrackerInitOptions_2, 'appId'> {
4583
+ declare interface IntlOpenSDKTrackerInitOptions extends Omit<ExcludeUndefined<CompatibleTrackerFullOptions>, 'appId'> {
4584
+ trackId?: string;
4585
+ /**
4586
+ * @description appId,默认值为180020050100012557
4587
+ */
4845
4588
  appId?: string;
4846
- }
4847
-
4848
- declare interface IntlOpenSDKTrackerInitOptions_2 extends Omit<OriginTrackerInitOptions, 'bizType' | 'productId'> {
4849
- whiteScreen?: BlankMonitorConfig | boolean;
4850
- bizType?: string;
4851
- productId?: string;
4852
4589
  /**
4853
- * @description 追踪id
4590
+ * origin → 完全按入参 key 输出
4591
+ * snake → 强制 snake_case
4592
+ * camel → 强制 camelCase
4593
+ * both → snake + origin 双写
4854
4594
  */
4855
- trackId?: string;
4856
- mdata?: Record<string, any>;
4857
- performance?: boolean;
4858
- error?: boolean;
4859
- }
4860
-
4861
- declare interface IOptions {
4862
- actionId: string;
4863
- spmId: string;
4864
- param1?: string;
4865
- param2?: string;
4866
- param3?: string;
4867
- param4?: Record<string, any>;
4868
- param5?: Record<string, any>;
4869
- stayTime?: number;
4595
+ keyFormat?: 'origin' | 'snake' | 'camel' | 'both';
4596
+ /**
4597
+ * 是否上报idengine_user_path
4598
+ */
4599
+ userPathAuto?: boolean;
4870
4600
  }
4871
4601
 
4872
4602
  declare interface IPaymentSessionMetaData {
@@ -4963,70 +4693,6 @@ declare interface IPaymentSessionMetaData {
4963
4693
  needAccountConfirmPage?: boolean;
4964
4694
  }
4965
4695
 
4966
- declare interface ISystemInfo {
4967
- readonly pixelRatio: number;
4968
- readonly windowWidth: number;
4969
- readonly windowHeight: number;
4970
- readonly model: string;
4971
- readonly language: string;
4972
- readonly version: string;
4973
- readonly platform: string;
4974
- readonly system: string;
4975
- readonly screenWidth: number;
4976
- readonly screenHeight: number;
4977
- readonly brand: string;
4978
- readonly app: string;
4979
- readonly [propName: string]: any;
4980
- }
4981
-
4982
- declare interface ITracert extends IUserTracertProperties {
4983
- get: (arg0: string) => any;
4984
- set: (arg0: IUserTracertProperties) => void;
4985
- loadPlugins: (_plugins: PluginFunction[]) => void;
4986
- readonly logLevel?: string;
4987
- readonly logVersion?: string;
4988
- readonly debug?: boolean;
4989
- readonly contact?: boolean;
4990
- readonly pluginReady?: boolean;
4991
- readonly _plugins?: readonly PluginFunction[];
4992
- readonly _beforeEvObj?: Record<string, EventFunction[]>;
4993
- readonly _afterEvObj?: Record<string, EventFunction[]>;
4994
- readonly _pluginLoadCnt?: number;
4995
- readonly apiCashList?: any[];
4996
- }
4997
-
4998
- declare interface IUserTracertProperties {
4999
- readonly ready?: boolean;
5000
- readonly bizType?: string;
5001
- readonly deviceId?: string;
5002
- readonly userId?: string;
5003
- readonly spmAPos?: string;
5004
- readonly spmBPos?: string;
5005
- readonly pageId?: string;
5006
- readonly server?: string;
5007
- readonly servers?: string[];
5008
- readonly chInfo?: string;
5009
- readonly scm?: string;
5010
- readonly env?: Env;
5011
- readonly switch?: boolean;
5012
- readonly sendFrequency?: number;
5013
- readonly batchCount?: number;
5014
- readonly referSPM?: string;
5015
- readonly sessionId?: string;
5016
- readonly appId?: string;
5017
- readonly productId?: string;
5018
- readonly mdata?: Record<string, number | string>;
5019
- readonly systemInfo?: ISystemInfo;
5020
- readonly networkType?: string;
5021
- readonly path?: string;
5022
- readonly packageVersion?: string;
5023
- readonly autoExpo?: boolean;
5024
- }
5025
-
5026
- declare interface LagPlugin {
5027
- onFpsLag?: (callback: (durationList: number[]) => void, maxDuration?: number, maxTimeoutCount?: number) => void;
5028
- }
5029
-
5030
4696
  /**
5031
4697
  * @description 前端语言模型
5032
4698
  */
@@ -5079,86 +4745,6 @@ export declare interface LoadAntomConfig extends Omit<BaseFactoryConfig, 'tracke
5079
4745
  env?: 'sandbox' | 'prod';
5080
4746
  }
5081
4747
 
5082
- declare interface LocationInfo {
5083
- countryName?: string;
5084
- cityName?: string;
5085
- provinceName?: string;
5086
- area?: string;
5087
- }
5088
-
5089
- declare interface LogInfo {
5090
- title: string;
5091
- msg?: string | Error | Record<string, number | string>;
5092
- }
5093
-
5094
- declare type LogItem = {
5095
- code: string;
5096
- msg: string;
5097
- marmotId?: string;
5098
- s1?: string | number;
5099
- s2?: string | number;
5100
- s3?: string | number;
5101
- s4?: string | number;
5102
- s5?: string | number;
5103
- s6?: string | number;
5104
- s7?: string | number;
5105
- s8?: string | number;
5106
- s9?: string | number;
5107
- s10?: string | number;
5108
- s11?: string | number;
5109
- s12?: string | number;
5110
- s13?: string | number;
5111
- s14?: string | number;
5112
- s15?: string | number;
5113
- s16?: string | number;
5114
- s17?: string | number;
5115
- s18?: string | number;
5116
- s19?: string | number;
5117
- s20?: string | number;
5118
- env?: Env_2;
5119
- sdk?: string;
5120
- container?: string;
5121
- title?: string;
5122
- fullUrl?: string;
5123
- sprintId?: string;
5124
- ip?: string;
5125
- countryName?: string;
5126
- cityName?: string;
5127
- provinceName?: string;
5128
- cOfflineVer?: string;
5129
- url?: string;
5130
- referrer?: string;
5131
- domCnt?: number;
5132
- delay?: number;
5133
- scrollTop?: number;
5134
- lastAction?: string;
5135
- sessionId?: string;
5136
- isp?: string;
5137
- area?: string;
5138
- ua?: string;
5139
- browser?: string;
5140
- os?: string;
5141
- device?: string;
5142
- deviceType?: string;
5143
- deviceBrand?: string;
5144
- deviceModel?: string;
5145
- screenWidth?: number;
5146
- screenHeight?: number;
5147
- contentHeight?: number;
5148
- pixelRatio?: number;
5149
- cClient?: string;
5150
- cClientId?: string;
5151
- cCoreVer?: string;
5152
- assetsVer?: string;
5153
- traceId?: string;
5154
- serverIp?: string;
5155
- serverEnv?: string;
5156
- clientId?: string;
5157
- spm?: string;
5158
- spma?: string;
5159
- spmb?: string;
5160
- } & DMC;
5161
-
5162
4748
  /**
5163
4749
  * @description Logo信息
5164
4750
  */
@@ -5189,29 +4775,6 @@ declare interface Logo {
5189
4775
  logoHeight?: string;
5190
4776
  }
5191
4777
 
5192
- declare type M = {
5193
- m1?: number;
5194
- m2?: number;
5195
- m3?: number;
5196
- m4?: number;
5197
- m5?: number;
5198
- m6?: number;
5199
- m7?: number;
5200
- m8?: number;
5201
- m9?: number;
5202
- m10?: number;
5203
- m11?: number;
5204
- m12?: number;
5205
- m13?: number;
5206
- m14?: number;
5207
- m15?: number;
5208
- m16?: number;
5209
- m17?: number;
5210
- m18?: number;
5211
- m19?: number;
5212
- m20?: number;
5213
- };
5214
-
5215
4778
  /**
5216
4779
  * @description 端上的行为设定 @Author yanhong
5217
4780
  */
@@ -5355,12 +4918,6 @@ declare interface MultiCurrencyMoney {
5355
4918
  currencyValue?: string;
5356
4919
  }
5357
4920
 
5358
- declare interface NetworkInfo {
5359
- networkType?: string;
5360
- isp?: string;
5361
- ip?: string;
5362
- }
5363
-
5364
4921
  declare interface ObsoleteProperties<TLength = (string & {}) | 0, TTime = string & {}> {
5365
4922
  /**
5366
4923
  * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box.
@@ -7605,7 +7162,7 @@ declare class OpenSDKTracker {
7605
7162
  * @param options
7606
7163
  * @returns
7607
7164
  */
7608
- initTracker(options?: IntlOpenSDKTrackerInitOptions): Promise<IntlOpenSDKTracker | undefined>;
7165
+ initTracker(options?: IntlOpenSDKTrackerInitOptions): Promise<CompatibleTrackerFull | undefined>;
7609
7166
  private safeCall;
7610
7167
  /**
7611
7168
  *
@@ -7615,7 +7172,7 @@ declare class OpenSDKTracker {
7615
7172
  /**
7616
7173
  * @description 设置属性
7617
7174
  */
7618
- set(data: Partial<IntlOpenSDKTrackerInitOptions>): void;
7175
+ set(data: Partial<ExcludeUndefined<IntlOpenSDKTrackerInitOptions>>): void;
7619
7176
  /**
7620
7177
  * 会以 10141 code 上报一条常规日志,日志头为 D-AE
7621
7178
  * @see https://yuque.antfin.com/marmot/handbook/beginning#cq9Zw
@@ -7625,38 +7182,38 @@ declare class OpenSDKTracker {
7625
7182
  * 请在marmot申请code后使用,必须关联code
7626
7183
  * @see https://yuque.antfin.com/marmot/handbook/beginning#W3dtb
7627
7184
  */
7628
- log(...args: Parameters<IntlOpenSDKTracker['log']>): void;
7185
+ log(...args: Parameters<CompatibleTrackerFull['log']>): void;
7629
7186
  /**
7630
7187
  * 用于埋点相关上报,点击
7631
7188
  * @see https://yuque.antfin.com/marmot/handbook/beginning#XQel9
7632
7189
  */
7633
- click(...args: Parameters<IntlOpenSDKTracker['click']>): void;
7190
+ click(...args: Parameters<CompatibleTrackerFull['click']>): void;
7634
7191
  /**
7635
7192
  * 用于埋点相关上报,曝光
7636
7193
  * @see https://yuque.antfin.com/marmot/handbook/beginning#LiVxE
7637
7194
  */
7638
- expo(...args: Parameters<IntlOpenSDKTracker['expo']>): void;
7195
+ expo(...args: Parameters<CompatibleTrackerFull['expo']>): void;
7639
7196
  /**
7640
7197
  * 用于日志管控
7641
7198
  * @see https://yuque.antfin.com/marmot/handbook/beginning#rK7Ru
7642
7199
  */
7643
- onSendData(...args: Parameters<IntlOpenSDKTracker['onSendData']>): void;
7200
+ onSendData(...args: Parameters<CompatibleTrackerFull['onSendData']>): void;
7644
7201
  /**
7645
7202
  * 用于日志管控
7646
7203
  * @see https://yuque.antfin.com/marmot/handbook/beginning#rK7Ru
7647
7204
  */
7648
- offSendData(...args: Parameters<IntlOpenSDKTracker['offSendData']>): void;
7205
+ offSendData(...args: Parameters<CompatibleTrackerFull['offSendData']>): void;
7649
7206
  /**
7650
7207
  * 用于埋点相关上报,上报的日志头为 D-VM
7651
7208
  * @see https://yuque.antfin.com/marmot/handbook/beginning#RSCKn
7652
7209
  */
7653
- pageMonitor(...args: Parameters<IntlOpenSDKTracker['pageMonitor']>): void;
7210
+ pageMonitor(...args: Parameters<CompatibleTrackerFull['pageMonitor']>): void;
7654
7211
  /**
7655
7212
  * 用于上报自定义性能指标,单次仅上报一个指标
7656
7213
  * @param {string} key — m1 - m20
7657
7214
  * @param {number} num — 耗时,数字,一定要 >= 0,否则无统计意义
7658
7215
  */
7659
- reportCustomizedPerformance(...args: Parameters<IntlOpenSDKTracker['reportCustomizedPerformance']>): void;
7216
+ reportCustomizedPerformance(...args: Parameters<CompatibleTrackerFull['reportCustomizedPerformance']>): void;
7660
7217
  }
7661
7218
 
7662
7219
  /**
@@ -7669,67 +7226,6 @@ declare interface OrderInfo {
7669
7226
  orderDescription?: string;
7670
7227
  }
7671
7228
 
7672
- declare interface OriginTrackerInitOptions {
7673
- isMarmot?: boolean;
7674
- spmConfig?: SpmConfig;
7675
- bizType: string;
7676
- appId: string;
7677
- /**
7678
- * 适用于从雨燕监控迁移到 marmot 的场景
7679
- * 该字段的值可使用雨燕监控的 appId 值
7680
- * 最终该值会放在 D-AE 日志类型的 appId 字段位置,并覆盖扩展参数 4 中的 idengine_groupId 值
7681
- * 正常情况下不需要用到,有疑问咨询 @之其 205637
7682
- **/
7683
- compatibleAppId?: string;
7684
- productId: string;
7685
- userId?: string;
7686
- deviceId?: string;
7687
- chInfo?: string;
7688
- batchCount?: number;
7689
- plugins?: PluginFunction[];
7690
- server?: string;
7691
- /**
7692
- * servers 传入空数组或不传的情况下,不会禁用所有日志的上报,这个字段不是用来做上报开关的
7693
- * 就像 server 不传或传空字符串的情况下,也不会禁用日志的上报,会使用默认的服务器地址
7694
- * servers 只在有至少一个有效值的情况下才有意义
7695
- */
7696
- servers?: string[];
7697
- mdata?: Record<string, number | string>;
7698
- env?: Env_2;
7699
- ready?: boolean;
7700
- isReport?: boolean;
7701
- version?: string;
7702
- funnelAuto?: boolean;
7703
- userPathAuto?: boolean;
7704
- autoExpo?: boolean;
7705
- autoClick?: boolean;
7706
- expoOnce?: boolean;
7707
- platform?: string;
7708
- sprintId?: string;
7709
- autoReportConfig?: {
7710
- isReport?: boolean;
7711
- programVersion?: string;
7712
- productId?: string;
7713
- appId?: string;
7714
- bizType?: string;
7715
- imdapServerIndex?: number;
7716
- server?: string;
7717
- servers?: string[];
7718
- platform?: string;
7719
- deviceId?: string;
7720
- };
7721
- whiteScreenConfig?: BlankMonitorConfig | boolean;
7722
- fmpIgnoreElements?: string[];
7723
- enableBehavior?: BehaviorConfig | boolean;
7724
- enableRequestHook?: RequestHookConfig | boolean;
7725
- enableJSAPIReport?: boolean;
7726
- }
7727
-
7728
- declare interface OSInfo {
7729
- os?: string;
7730
- osVer?: string;
7731
- }
7732
-
7733
7229
  declare interface OtpChallengeActionForm {
7734
7230
  /**
7735
7231
  * @description action form type
@@ -8591,56 +8087,6 @@ export declare interface PayPalConfig {
8591
8087
  onShippingOptionsChange?: (data: any, actions: any) => Promise<void>;
8592
8088
  }
8593
8089
 
8594
- declare interface PerformancePlugin extends BaseInfoPlugin {
8595
- getAnalyzePerformanceInfo?(): Record<string, any> | null;
8596
- getPagePerformanceInfo?(): {
8597
- onload: string | number;
8598
- domContentLoad: string | number;
8599
- redirect: string | number;
8600
- appCache: string | number;
8601
- dns: string | number;
8602
- tcp: string | number;
8603
- ssl: string | number;
8604
- reqt: string | number;
8605
- rest: string | number;
8606
- dpt: string | number;
8607
- ft: string | number;
8608
- domInteractive: string | number;
8609
- domReady: string | number;
8610
- domComplete: string | number;
8611
- random: string | number;
8612
- miniPerformance?: ReturnType<typeof getMiniPerformance>;
8613
- timeOrigin?: number;
8614
- };
8615
- getWebVitalsInfo?(): GetWebVitalsInfoResult;
8616
- getWhiteScreenInfo?(options?: Pick<GetWhiteScreenInfoOptions, 'selector' | 'ignoreNotInViewport'>): Promise<{
8617
- status: 'error' | 'ok';
8618
- }>;
8619
- getFMP?(options?: {
8620
- ignoreElements?: string[];
8621
- }): Promise<{
8622
- time: number;
8623
- selector: string;
8624
- } | undefined>;
8625
- getTTI?(): Promise<number | undefined>;
8626
- getFP?(): Promise<number | undefined>;
8627
- getT2Time?(): Promise<number | undefined>;
8628
- /**
8629
- * 将性能数据发送到容器,目前只需 H5 应用实现
8630
- */
8631
- sendPerformanceDataToContainer?(data: LogItem): Promise<void>;
8632
- getSnapshot?: () => {
8633
- fmp: string;
8634
- lcp: string;
8635
- };
8636
- /**
8637
- * 用于采集详细的性能数据,越晚调用,搜集的数据越多
8638
- */
8639
- getDetailPerformance?(): Promise<DMC | null>;
8640
- startCheckingPageWhiteScreen?(config: GetWhiteScreenInfoOptions | boolean | undefined): Promise<(() => void) | undefined>;
8641
- startCheckingDOMWhiteScreen?(selector: string, options: Omit<GetWhiteScreenInfoOptions, 'selector'>): (() => void) | undefined;
8642
- }
8643
-
8644
8090
  declare interface PeriodRule {
8645
8091
  /**
8646
8092
  * @description period type
@@ -8659,85 +8105,6 @@ declare interface PeriodRule {
8659
8105
  */
8660
8106
  declare type PickAppearance<Props extends Partial<DefaultAppearanceProps>> = Partial<Pick<Appearance<Props>, keyof Props extends infer k extends keyof Partial<Appearance> ? k : keyof Partial<Appearance>>>;
8661
8107
 
8662
- declare interface PluginContext {
8663
- userPath: {
8664
- reStoreUserPath: (appId: string) => void;
8665
- parseUserPathExtra: (key: string) => {
8666
- idengine_user_path: string;
8667
- } | null;
8668
- getUserPathExtra: () => {
8669
- cachePath: string[];
8670
- extra: {
8671
- idengine_user_path: string;
8672
- };
8673
- };
8674
- };
8675
- waitInit: () => Promise<void>;
8676
- }
8677
-
8678
- declare type PluginFunction = (iTracert: ITracert, callback: () => void) => boolean;
8679
-
8680
- declare type PluginInitOptions = Pick<OriginTrackerInitOptions, 'spmConfig' | 'autoExpo' | 'autoClick' | 'bizType' | 'appId' | 'compatibleAppId' | 'productId' | 'batchCount' | 'mdata' | 'env' | 'plugins' | 'userId' | 'ready' | 'isReport' | 'version' | 'chInfo' | 'expoOnce' | 'platform' | 'sprintId' | 'autoReportConfig' | 'enableJSAPIReport'> & {
8681
- server?: string;
8682
- servers?: string[];
8683
- isMarmot?: boolean;
8684
- deviceId?: Promise<string>;
8685
- whiteScreenConfig?: (BlankMonitorConfig & {
8686
- callback?: (options: ReportData) => Promise<void>;
8687
- }) | boolean;
8688
- spmCheckCover?: string;
8689
- whiteListConfigSource?: WHITE_LIST_CONFIG_SOURCE;
8690
- remoteConfigValidDuration?: number;
8691
- };
8692
-
8693
- declare interface PluginOnErrorCallbackErrorInfo {
8694
- message: string;
8695
- extra: Record<string, any>;
8696
- type: ErrorType;
8697
- }
8698
-
8699
- declare interface PluginPageMonitorOptions {
8700
- spmInfo: {
8701
- spmAPos: string;
8702
- spmBPos: string;
8703
- currentPage: string;
8704
- };
8705
- logData?: Record<string, any>;
8706
- }
8707
-
8708
- declare interface PluginShape extends PerformancePlugin, LagPlugin {
8709
- getRequester(): GetRequesterResult;
8710
- getDataFilter?(): (data: string[]) => Promise<string[]>;
8711
- getExtraDataFilter?(): (data: Record<string, any>) => Promise<Record<string, any>>;
8712
- onSendData?(callback: (rawData: ReportData & BaseInfo, data: string) => boolean): void;
8713
- offSendData?(callback: (rawData: ReportData & BaseInfo, data: string) => boolean): void;
8714
- init?(options: PluginInitOptions): Promise<void>;
8715
- onError?(callback: (error: PluginOnErrorCallbackErrorInfo) => void): () => void;
8716
- onPageLoad?(callback: () => void): () => void;
8717
- set?(options: Record<string, any>): void;
8718
- /**
8719
- * @deprecated Compatible with old APIs. Use `Tracker#report` instead.
8720
- * @param info
8721
- * @param extra
8722
- */
8723
- log?(type: string, params?: Record<string, any>): void;
8724
- pageMonitor?(options: PluginPageMonitorOptions): void;
8725
- expo?(code: string, extra?: Record<string, number | string | boolean>): void;
8726
- click?(code: string, extra: Record<string, number | string | boolean>): void;
8727
- getSessionItem?(key: string): string | null;
8728
- removeSessionItem?(key: string): void;
8729
- setSessionItem?(key: string, value: string): void;
8730
- getSessionId?(): string | null;
8731
- getStorageItem?(key: string): Promise<string | null>;
8732
- removeStorageItem?(key: string): void;
8733
- setStorageItem?(key: string, value: string): void;
8734
- onHTTPError?(callback: (options: HTTPErrorCallbackOptions) => void): void;
8735
- triggerPreCaptureReport?(callback: (error: PluginOnErrorCallbackErrorInfo) => void): void;
8736
- PluginShape?: void;
8737
- initBehaviorListener?(addBehavior: AddBehavior, config: BehaviorConfig): void;
8738
- reportAPI?(config: RequestHookConfig, callback: (options: APICallbackOptions) => void): void;
8739
- }
8740
-
8741
8108
  /**
8742
8109
  * @description 政策信息,例如隐私链接,免责声明等
8743
8110
  */
@@ -10743,57 +10110,8 @@ declare interface RedirectOption {
10743
10110
  destroy?: boolean;
10744
10111
  }
10745
10112
 
10746
- declare type ReportData = {
10747
- title?: string;
10748
- msg?: string | Error | Record<string, number | string> | Event;
10749
- logType: 'error' | 'info';
10750
- extra?: Record<string, number | boolean | string | undefined | Error | null>;
10751
- } | ({
10752
- logType: 'custom';
10753
- } & LogItem);
10754
-
10755
10113
  declare type RequestEnv = 'local' | 'dev' | 'sit' | 'pre' | 'prod' | 'sandbox' | 'light_sandbox';
10756
10114
 
10757
- declare class RequesterCacheWrapper {
10758
- private autoReportConfig;
10759
- private dataCache;
10760
- private lastSendTime;
10761
- private batchCount;
10762
- private sendFrequency;
10763
- constructor(autoReportConfig: {
10764
- immediate?: boolean;
10765
- deviceId?: Promise<string>;
10766
- isReport?: boolean;
10767
- programVersion?: string;
10768
- productId?: string;
10769
- appId?: string;
10770
- compatibleAppId?: string;
10771
- bizType?: string;
10772
- });
10773
- report(options: ReportData & {
10774
- request: GetRequesterResult;
10775
- extraDataFilter?: (data: Record<string, any>) => Promise<Record<string, any>>;
10776
- dataFilter?: (data: string[]) => Promise<string[]>;
10777
- } & BaseInfo & {
10778
- immediate?: boolean;
10779
- }): Promise<void>;
10780
- private send;
10781
- /**
10782
- * 分批发送请求
10783
- */
10784
- private httpRequest;
10785
- private sendBatch;
10786
- }
10787
-
10788
- declare type RequestHookConfig = {
10789
- /**
10790
- * @description 不上报的域名
10791
- */
10792
- excludes?: Array<string | RegExp>;
10793
- getFetchResponseInfo?: (headers: Headers, responseData: Record<string, any>, requestParam: Array<any>) => ResponseInfo;
10794
- getXHRResponseInfo?: (response: XHRResponse) => ResponseInfo;
10795
- };
10796
-
10797
10115
  declare interface RequestOptions {
10798
10116
  env?: RequestEnv;
10799
10117
  baseURL?: string;
@@ -10818,15 +10136,6 @@ declare interface RequestOptions {
10818
10136
  scope?: string;
10819
10137
  }
10820
10138
 
10821
- declare type ResponseInfo = {
10822
- responseUrl?: string;
10823
- traceId?: string;
10824
- isSuccess?: boolean;
10825
- errorCode?: string | number;
10826
- errorMsg?: string;
10827
- url?: string;
10828
- };
10829
-
10830
10139
  /**
10831
10140
  * @description 国际支付标准结果码,参考主站<code>ErrorCode</code>实现。
10832
10141
  *
@@ -11201,14 +10510,6 @@ declare type SimplePseudos =
11201
10510
  | ":volume-locked"
11202
10511
  | ":xr-overlay";
11203
10512
 
11204
- declare interface SpmConfig {
11205
- spmAPos: string;
11206
- bizType: string;
11207
- pages?: Record<string, Record<string, string>>;
11208
- mdata?: Record<string, number | string | boolean>;
11209
- immediate?: boolean;
11210
- }
11211
-
11212
10513
  declare interface StandardLonghandProperties<TLength = (string & {}) | 0, TTime = string & {}> {
11213
10514
  /**
11214
10515
  * This feature is not Baseline because it does not work in some of the most widely-used browsers.
@@ -25415,257 +24716,6 @@ export declare const themeColorMap: Record<AntomTheme, {
25415
24716
  backgroundColor: string;
25416
24717
  }>;
25417
24718
 
25418
- declare class Tracker {
25419
- protected requesterCacheWrapper?: RequesterCacheWrapper;
25420
- private initPromise;
25421
- private spmInfo;
25422
- private spmConfig?;
25423
- private spmAPos?;
25424
- private spmBPos?;
25425
- private funnelAuto?;
25426
- private userPathAuto?;
25427
- private cachePath;
25428
- private userPathLength;
25429
- private pathUserMeta;
25430
- private isMarmot;
25431
- protected appId?: string;
25432
- protected compatibleAppId?: string;
25433
- private plugin;
25434
- private sprintId?;
25435
- private userId;
25436
- protected deviceId?: Promise<string>;
25437
- protected programVersion?: string;
25438
- private language?;
25439
- protected bizType?: string;
25440
- protected productId?: string;
25441
- private whiteScreenConfig?;
25442
- private performance?;
25443
- protected isReport?: boolean;
25444
- protected server?: string;
25445
- protected servers?: string[];
25446
- protected platform?: string;
25447
- private env?;
25448
- private immediate?;
25449
- enableScreenshot: boolean | undefined | {
25450
- rate: number;
25451
- };
25452
- private enableResourceAnalysis?;
25453
- private _lag?;
25454
- private spmCheckCover?;
25455
- private enableBehavior?;
25456
- private behavior?;
25457
- private enableRequestHook?;
25458
- private enableJSAPIReport?;
25459
- private customizedPerformanceMark?;
25460
- constructor(Plugin: new (context: PluginContext) => PluginShape);
25461
- init(options: TrackerInitOptions): Promise<boolean>;
25462
- /**
25463
- * 业务侧可以拦截发送日志的请求,用于手动过滤
25464
- * 当前仅对浏览器环境生效
25465
- * rawData 是 intl-tracker 内部格式的数据,为对象
25466
- * data 是最终发送到服务端的数据,为字符串形式
25467
- */
25468
- onSendData(callback: (rawData: ReportData & BaseInfo, data: string) => boolean): void;
25469
- /**
25470
- * 业务侧可以取消拦截发送日志的请求
25471
- * 当前仅对浏览器环境生效
25472
- */
25473
- offSendData(callback: (rawData: ReportData & BaseInfo, data: string) => boolean): void;
25474
- private startReportSnapshot;
25475
- /**
25476
- * 用于上报自定义性能指标,单次仅上报一个指标
25477
- * @param key m1 - m20
25478
- * @param num 耗时,数字,一定要 >= 0,否则无统计意义
25479
- */
25480
- reportCustomizedPerformance(key: CustomizedPerformanceKey, num: number): void | undefined;
25481
- /**
25482
- * 上报自定义性能指标
25483
- * @param data 适合单次合并上报多个指标的场景
25484
- * 请注意,使用 reportCustomizedPerformance 上报时,每次上报会发送一次日志请求
25485
- * 不同阶段的数据量会有差异,这些差异可以作为页面流失漏斗的数据源
25486
- * 但合并上报时,同时上报的多个指标数量是相同的
25487
- */
25488
- reportCustomizedPerformanceData(data: Partial<Record<CustomizedPerformanceKey, number>>): void | undefined;
25489
- /**
25490
- * 用于显式上报小程序性能指标
25491
- * 由于小程序的性能指标仅在“使用 schema 打开页面”时有效,原来的自动上报未区分场景,会导致脏数据较多
25492
- * 改为数据自动采集、仅在必要时由业务方手动调用接口上报
25493
- */
25494
- reportMiniProgramPerformance(): Promise<void> | undefined;
25495
- getMiniProgramPerformanceData(): Promise<{
25496
- s1: number;
25497
- s2: number;
25498
- s3: number;
25499
- s4: number;
25500
- s5: number;
25501
- s6: number;
25502
- s7: number;
25503
- s8: number;
25504
- } | undefined> | undefined;
25505
- /**
25506
- * 用于显式上报网页性能指标,一般用不上
25507
- * 1. tracker.onPageLoad() 会自动上报
25508
- * 2. tracker.reportCustomizedPerformanceData() 会自动上报
25509
- * 3. tracker.reportCustomizedPerformance() 会自动上报
25510
- * 4. tracker.reportMiniProgramPerformance() 会自动上报
25511
- * 5. 以上方法仅会上报一次网页性能指标,多次调用不受影响
25512
- * 6. 仅当以上所有方法均未调用时,才需要手动调用此方法
25513
- */
25514
- reportPagePerformance(): Promise<void> | undefined;
25515
- private handleReportSnapShot;
25516
- get lag(): {
25517
- log: (msg: string) => Promise<void>;
25518
- fps: () => Promise<void>;
25519
- };
25520
- onPageLoad(options?: string | {
25521
- title?: string;
25522
- fmpIgnoreElements?: string[];
25523
- }): Promise<void>;
25524
- reportPerformance(title?: string): void;
25525
- reportDetailPerformance(): void;
25526
- onError(): Promise<(() => void) | undefined>;
25527
- fmp(time: number): void;
25528
- flushBehavior(): void;
25529
- /**
25530
- * 内部使用
25531
- *
25532
- * @param error
25533
- */
25534
- private reportError;
25535
- private triggerPreCaptureReport;
25536
- onHTTPError(): Promise<void>;
25537
- private reportAPI;
25538
- /**
25539
- * 内部使用,业务项目不要调用
25540
- *
25541
- * @param options
25542
- */
25543
- reportHTTPError(options: HTTPErrorCallbackOptions): void;
25544
- set(options: Record<string, any>): void;
25545
- log(item: LogItem): void;
25546
- /**
25547
- * @deprecated Compatible with old APIs. Use `Tracker#log` instead.
25548
- * @param info
25549
- * @param extra
25550
- */
25551
- logInfo(info: LogInfo, extra?: Record<string, number | boolean | string>): Promise<void>;
25552
- /**
25553
- * @deprecated Compatible with old APIs. Use `Tracker#log` instead.
25554
- * @param info
25555
- * @param extra
25556
- */
25557
- logError(info: LogInfo, extra?: Record<string, number | boolean | string>): Promise<void>;
25558
- reportFunnel(title: string, config?: {
25559
- [prop: string]: string | number;
25560
- name: string;
25561
- level: number;
25562
- label: string;
25563
- } | undefined): Promise<void>;
25564
- reportRPC(rpcInfo: {
25565
- name: string;
25566
- label: string;
25567
- code?: string | undefined;
25568
- msg?: string | Error | Record<string, string | number> | undefined;
25569
- success?: boolean | undefined;
25570
- result?: number | undefined;
25571
- traceId?: string | undefined;
25572
- httpStatus?: string | undefined;
25573
- time?: number | undefined;
25574
- }): void;
25575
- logJSBridgeError(info: LogInfo): void;
25576
- pageMonitor(page: string, extraParams?: Record<string, any>, autoPv?: boolean): void;
25577
- expo(code: string, extra?: Record<string, string | number | boolean> | undefined): void;
25578
- click(code: string, extra?: Record<string, string | number | boolean>): void;
25579
- pv(): void;
25580
- /**
25581
- * 指定点位白屏的监控 - 用于监控目标点位的白屏
25582
- * 页面白屏和目标点位白屏的通用监控逻辑
25583
- *
25584
- * @param selector 目标点位选择器
25585
- * @param options 配置项
25586
- * {
25587
- * 检测延时,单位 second,即启动白屏检测后多久开始执行白屏识别
25588
- * NOTE: 设置时间时要考虑业务平均加载时间,太短可能会误报
25589
- * delay
25590
- *
25591
- * 是否持续监测, 即初始化白屏检测结束之后是否继续监控业务运行中白屏, default: true
25592
- * persistent
25593
- * }
25594
- */
25595
- startCheckingDOMWhiteScreen(selector: string, options: Omit<BlankMonitorConfig, 'selector'>): void;
25596
- private getRequester;
25597
- protected getDefaultExtraInfo(): Promise<BaseInfo>;
25598
- private request;
25599
- private formatExtra;
25600
- private reportLog;
25601
- /**
25602
- * 解析成功率上报参数
25603
- * @param key p_ page c_ click expo r l -info或者-error结尾是前端日志
25604
- * @param funnelConfig 标准漏斗上报参数
25605
- * @returns 扩展参数数据
25606
- */
25607
- private parseUserPathExtra;
25608
- /**
25609
- * 获取成功率上报参数
25610
- * 用于去冲
25611
- */
25612
- private getUserPathExtra;
25613
- /**
25614
- * 恢复存储的用户路径
25615
- */
25616
- private reStoreUserPath;
25617
- private reStoreUserPathMeta;
25618
- private reStoreSessionId;
25619
- /**
25620
- * 重置session id
25621
- */
25622
- resetSessionId(): void;
25623
- /**
25624
- * 重置用户路径
25625
- */
25626
- resetUserPath(): void;
25627
- private normalizeServer;
25628
- private normalizeServers;
25629
- }
25630
-
25631
- declare interface TrackerInitOptions {
25632
- spmConfig?: SpmConfig;
25633
- marmotId: string;
25634
- compatibleAppId?: string;
25635
- userId?: string;
25636
- server?: IMDAP_SERVER | string;
25637
- servers?: (IMDAP_SERVER | string)[];
25638
- env?: Env_2;
25639
- sprintId?: string;
25640
- whiteScreen?: BlankMonitorConfig | boolean;
25641
- immediate?: boolean;
25642
- autoExpo?: boolean;
25643
- autoClick?: boolean;
25644
- expoOnce?: boolean;
25645
- enableScreenshot?: boolean | {
25646
- rate: number;
25647
- };
25648
- enableResourceAnalysis?: boolean;
25649
- spmCheckCover?: string;
25650
- enableBehavior?: BehaviorConfig | boolean;
25651
- enableRequestHook?: RequestHookConfig | boolean;
25652
- enableJSAPIReport?: boolean;
25653
- /**
25654
- * 白名单配置源,仅浏览器环境支持
25655
- * 不传值时,与旧版功能相同,所有日志都会发送
25656
- * 1. 值为 REMOTE 时,表示从远程服务器获取白名单配置
25657
- * 2. 值为 NONE 时,表示不使用白名单配置,所有日志都会发送
25658
- */
25659
- whiteListConfigSource?: WHITE_LIST_CONFIG_SOURCE;
25660
- /**
25661
- * 当且仅当 whiteListConfigSource 为 REMOTE 时有效
25662
- * 在有效期内,不重复加载 json 请求
25663
- */
25664
- remoteConfigValidDuration?: number;
25665
- productId?: string;
25666
- bizType?: string;
25667
- }
25668
-
25669
24719
  /**
25670
24720
  * @description 交易信息
25671
24721
  */
@@ -29429,16 +28479,9 @@ declare interface VendorShorthandPropertiesHyphen<TLength = (string & {}) | 0, T
29429
28479
 
29430
28480
  declare type VendorShorthandPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<VendorShorthandPropertiesHyphen<TLength, TTime>>;
29431
28481
 
29432
- declare type WHITE_LIST_CONFIG_SOURCE = 'REMOTE' | 'NONE';
29433
-
29434
28482
  declare type WithAppURL<T> = T & {
29435
28483
  appUrl: string;
29436
28484
  isMainElement: boolean;
29437
28485
  };
29438
28486
 
29439
- declare type XHRResponse = {
29440
- headers: ReturnType<XMLHttpRequest['getAllResponseHeaders']>;
29441
- body: XMLHttpRequest['response'];
29442
- };
29443
-
29444
28487
  export { }