@mpcore/simulator 0.6.3 → 1.0.0
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/README.md +43 -1
- package/dist/index.d.mts +304 -195
- package/dist/index.mjs +2121 -774
- package/package.json +7 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WEVU_PAGE_SCROLL_EVENT_CONTRACT_KEY, WEVU_ROUTE_EVENT_CONTRACT_KEY } from "@weapp-core/constants";
|
|
1
2
|
//#region src/host/globals.d.ts
|
|
2
3
|
export interface HeadlessAppDefinition extends Record<string, any> {}
|
|
3
4
|
export interface HeadlessPageDefinition extends Record<string, any> {}
|
|
@@ -23,6 +24,94 @@ export declare function registerPageDefinition(registries: HeadlessHostRegistrie
|
|
|
23
24
|
export declare function registerComponentDefinition(registries: HeadlessHostRegistries, definition: HeadlessComponentDefinition): HeadlessPageDefinition;
|
|
24
25
|
export declare function registerExportedComponentDefinition(registries: HeadlessHostRegistries, id: string, moduleExports: Record<string, any>, registeredDefinition?: HeadlessComponentDefinition): HeadlessComponentDefinition | null;
|
|
25
26
|
//#endregion
|
|
27
|
+
//#region src/project/pageConfig.d.ts
|
|
28
|
+
interface HeadlessNavigationBarSnapshot {
|
|
29
|
+
animation: {
|
|
30
|
+
duration?: number;
|
|
31
|
+
timingFunction?: string;
|
|
32
|
+
} | null;
|
|
33
|
+
backgroundColor: string;
|
|
34
|
+
frontColor: string;
|
|
35
|
+
loading: boolean;
|
|
36
|
+
title: string;
|
|
37
|
+
}
|
|
38
|
+
type HeadlessBackgroundTextStyle = 'dark' | 'light';
|
|
39
|
+
interface HeadlessBackgroundSnapshot {
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
backgroundColorBottom: string;
|
|
42
|
+
backgroundColorTop: string;
|
|
43
|
+
textStyle: HeadlessBackgroundTextStyle;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/runtime/componentInstance/types.d.ts
|
|
47
|
+
interface HeadlessComponentInstance extends Record<string, any> {
|
|
48
|
+
__definition__?: HeadlessComponentDefinition;
|
|
49
|
+
__lastInteractionEvent__?: Record<string, any>;
|
|
50
|
+
__propertySnapshots__?: Record<string, any>;
|
|
51
|
+
__ready__?: boolean;
|
|
52
|
+
createIntersectionObserver?: (options?: Record<string, any>) => any;
|
|
53
|
+
createMediaQueryObserver?: () => HeadlessWxMediaQueryObserver;
|
|
54
|
+
createSelectorQuery?: () => HeadlessWxSelectorQuery;
|
|
55
|
+
getRelationNodes: (relationKey: string) => HeadlessComponentInstance[];
|
|
56
|
+
data: Record<string, any>;
|
|
57
|
+
properties: Record<string, any>;
|
|
58
|
+
selectAllComponents?: (selector: string) => any[];
|
|
59
|
+
selectComponent?: (selector: string) => any;
|
|
60
|
+
selectOwnerComponent?: () => any;
|
|
61
|
+
setData: (patch: Record<string, any>, callback?: () => void) => void;
|
|
62
|
+
triggerEvent: (eventName: string, detail?: unknown, options?: Record<string, any>) => void;
|
|
63
|
+
}
|
|
64
|
+
interface CreateComponentInstanceOptions {
|
|
65
|
+
definition: HeadlessComponentDefinition;
|
|
66
|
+
properties?: Record<string, any>;
|
|
67
|
+
requestRender?: (callback?: () => void) => void;
|
|
68
|
+
triggerEvent?: (instance: HeadlessComponentInstance, eventName: string, detail?: unknown, options?: Record<string, any>) => void;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/runtime/componentInstance/observers.d.ts
|
|
72
|
+
export declare function runComponentObservers(definition: HeadlessComponentDefinition, instance: HeadlessComponentInstance, changedKeys: string[], previousProperties?: Record<string, any>): void;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/runtime/componentInstance/properties.d.ts
|
|
75
|
+
export declare function coerceComponentPropertyValue(rawValue: unknown, option: unknown): unknown;
|
|
76
|
+
export declare function normalizeComponentPropertyValue(definition: HeadlessComponentDefinition, key: string, rawValue: unknown): any;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/runtime/componentInstance/shared.d.ts
|
|
79
|
+
export declare function cloneValue<T>(value: T): T;
|
|
80
|
+
export declare function hasComponentPropertyValueChanged(currentValue: unknown, previousSnapshot: unknown, nextValue: unknown, bindingAffected: boolean): boolean;
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/runtime/componentInstance/index.d.ts
|
|
83
|
+
export declare function createComponentInstance(options: CreateComponentInstanceOptions): HeadlessComponentInstance;
|
|
84
|
+
export declare function runComponentLifecycle(instance: HeadlessComponentInstance, lifecycleName: 'attached' | 'created' | 'detached' | 'ready'): void;
|
|
85
|
+
export declare function runComponentPageLifetime(instance: HeadlessComponentInstance, lifetimeName: 'hide' | 'resize' | 'show', payload?: unknown): void;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/runtime/pageInstance.d.ts
|
|
88
|
+
export interface HeadlessPageInstance extends Record<string, any> {
|
|
89
|
+
__background__?: HeadlessBackgroundSnapshot;
|
|
90
|
+
__backgroundTextStyle__?: HeadlessBackgroundTextStyle;
|
|
91
|
+
__lastChangedKeys__?: string[];
|
|
92
|
+
__navigationBar__?: HeadlessNavigationBarSnapshot;
|
|
93
|
+
__navigationBarTitle__?: string;
|
|
94
|
+
__route__: string;
|
|
95
|
+
__scrollTop__?: number;
|
|
96
|
+
data: Record<string, any>;
|
|
97
|
+
properties: Record<string, any>;
|
|
98
|
+
options: Record<string, string>;
|
|
99
|
+
route: string;
|
|
100
|
+
createIntersectionObserver?: (options?: Record<string, any>) => any;
|
|
101
|
+
createMediaQueryObserver?: () => HeadlessWxMediaQueryObserver;
|
|
102
|
+
getTabBar?: () => HeadlessComponentInstance | null;
|
|
103
|
+
selectAllComponents?: (selector: string) => any[];
|
|
104
|
+
selectComponent?: (selector: string) => any;
|
|
105
|
+
setData: (patch: Record<string, any>, callback?: () => void) => void;
|
|
106
|
+
}
|
|
107
|
+
export declare function getPageInstanceId(page: HeadlessPageInstance): number;
|
|
108
|
+
export declare function createPageInstance(route: string, definition: HeadlessPageDefinition, options?: Record<string, string>, pageState?: {
|
|
109
|
+
background?: HeadlessBackgroundSnapshot;
|
|
110
|
+
backgroundTextStyle?: HeadlessBackgroundTextStyle;
|
|
111
|
+
navigationBar?: HeadlessNavigationBarSnapshot;
|
|
112
|
+
requestRender?: (callback?: () => void) => void;
|
|
113
|
+
}): HeadlessPageInstance;
|
|
114
|
+
//#endregion
|
|
26
115
|
//#region src/host/wx/core.d.ts
|
|
27
116
|
export interface HeadlessWxCallbackOption<TResult = void> {
|
|
28
117
|
complete?: (result?: TResult) => void;
|
|
@@ -932,8 +1021,54 @@ export interface HeadlessWxDriverCapabilities {
|
|
|
932
1021
|
};
|
|
933
1022
|
}
|
|
934
1023
|
//#endregion
|
|
1024
|
+
//#region src/host/wx/workers.d.ts
|
|
1025
|
+
export interface HeadlessWorker {
|
|
1026
|
+
onMessage: (listener: (message: any) => void) => void;
|
|
1027
|
+
offMessage: (listener?: (message: any) => void) => void;
|
|
1028
|
+
postMessage: (message: unknown) => void;
|
|
1029
|
+
onError: (listener: (error: {
|
|
1030
|
+
message: string;
|
|
1031
|
+
}) => void) => void;
|
|
1032
|
+
offError: (listener?: (error: {
|
|
1033
|
+
message: string;
|
|
1034
|
+
}) => void) => void;
|
|
1035
|
+
terminate: () => void;
|
|
1036
|
+
}
|
|
1037
|
+
export interface HeadlessWorkerApis {
|
|
1038
|
+
createWorker: (scriptPath: string) => HeadlessWorker;
|
|
1039
|
+
preDownloadSubpackage: (options: HeadlessWxCallbackOption<{
|
|
1040
|
+
errMsg: string;
|
|
1041
|
+
}> & {
|
|
1042
|
+
packageType: 'workers';
|
|
1043
|
+
}) => void;
|
|
1044
|
+
}
|
|
1045
|
+
//#endregion
|
|
935
1046
|
//#region src/host/wx/api.d.ts
|
|
936
|
-
|
|
1047
|
+
/** 宿主已接受的一次路由操作;同一次操作的所有阶段共用事件标识。 */
|
|
1048
|
+
export interface HeadlessWxRouteEvent {
|
|
1049
|
+
path: string;
|
|
1050
|
+
query: Record<string, string>;
|
|
1051
|
+
openType: 'appLaunch' | 'navigateTo' | 'redirectTo' | 'navigateBack' | 'switchTab' | 'reLaunch';
|
|
1052
|
+
renderer: 'webview' | 'skyline' | 'xr-frame';
|
|
1053
|
+
webviewId: number;
|
|
1054
|
+
routeEventId: string;
|
|
1055
|
+
timeStamp: number;
|
|
1056
|
+
}
|
|
1057
|
+
/** 页面销毁前的原生实例,仍可同步读取页面数据。 */
|
|
1058
|
+
export interface HeadlessWxBeforePageUnloadEvent extends HeadlessWxRouteEvent {
|
|
1059
|
+
page: HeadlessPageInstance;
|
|
1060
|
+
}
|
|
1061
|
+
export interface HeadlessWxRouteListeners {
|
|
1062
|
+
onBeforeAppRoute: (listener: (event: HeadlessWxRouteEvent) => void) => void;
|
|
1063
|
+
offBeforeAppRoute: (listener?: (event: HeadlessWxRouteEvent) => void) => void;
|
|
1064
|
+
onBeforePageUnload: (listener: (event: HeadlessWxBeforePageUnloadEvent) => void) => void;
|
|
1065
|
+
offBeforePageUnload: (listener?: (event: HeadlessWxBeforePageUnloadEvent) => void) => void;
|
|
1066
|
+
onAppRoute: (listener: (event: HeadlessWxRouteEvent) => void) => void;
|
|
1067
|
+
offAppRoute: (listener?: (event: HeadlessWxRouteEvent) => void) => void;
|
|
1068
|
+
onAppRouteDone: (listener: (event: HeadlessWxRouteEvent) => void) => void;
|
|
1069
|
+
offAppRouteDone: (listener?: (event: HeadlessWxRouteEvent) => void) => void;
|
|
1070
|
+
}
|
|
1071
|
+
export interface HeadlessWxDriver extends HeadlessWxDriverCapabilities, HeadlessWxRouteListeners {
|
|
937
1072
|
chooseImage: (option: HeadlessWxChooseImageOption) => HeadlessWxChooseImageResult;
|
|
938
1073
|
chooseMessageFile: (option: HeadlessWxChooseMessageFileOption) => HeadlessWxChooseMessageFileResult;
|
|
939
1074
|
chooseMedia: (option: HeadlessWxChooseMediaOption) => HeadlessWxChooseMediaResult;
|
|
@@ -959,7 +1094,9 @@ export interface HeadlessWxDriver extends HeadlessWxDriverCapabilities {
|
|
|
959
1094
|
canvasToTempFilePath: (option: HeadlessWxCanvasToTempFilePathOption) => HeadlessWxCanvasToTempFilePathSuccessResult;
|
|
960
1095
|
uploadFile: (option: HeadlessWxUploadFileOption) => HeadlessWxRequestTask;
|
|
961
1096
|
}
|
|
962
|
-
export interface HeadlessWx extends HeadlessUniEventBus {
|
|
1097
|
+
export interface HeadlessWx extends HeadlessUniEventBus, HeadlessWxRouteListeners, HeadlessWorkerApis {
|
|
1098
|
+
[WEVU_ROUTE_EVENT_CONTRACT_KEY]: 1;
|
|
1099
|
+
[WEVU_PAGE_SCROLL_EVENT_CONTRACT_KEY]: 1;
|
|
963
1100
|
canIUse: (schema: string) => boolean;
|
|
964
1101
|
chooseImage: (option?: HeadlessWxChooseImageOption) => HeadlessWxChooseImageResult | undefined;
|
|
965
1102
|
chooseMessageFile: (option?: HeadlessWxChooseMessageFileOption) => HeadlessWxChooseMessageFileResult | undefined;
|
|
@@ -1099,7 +1236,7 @@ export interface HeadlessWx extends HeadlessUniEventBus {
|
|
|
1099
1236
|
}
|
|
1100
1237
|
//#endregion
|
|
1101
1238
|
//#region src/host/wx/index.d.ts
|
|
1102
|
-
export declare function createHeadlessWx(driver: HeadlessWxDriver, runtimeConsole?: Pick<Console, 'debug' | 'info' | 'log' | 'warn'
|
|
1239
|
+
export declare function createHeadlessWx(driver: HeadlessWxDriver, runtimeConsole?: Pick<Console, 'debug' | 'info' | 'log' | 'warn'>, workers?: HeadlessWorkerApis): HeadlessWx;
|
|
1103
1240
|
//#endregion
|
|
1104
1241
|
//#region src/kernel/artifactSource.d.ts
|
|
1105
1242
|
export interface ArtifactSource {
|
|
@@ -1146,6 +1283,7 @@ export declare class RuntimeScheduler {
|
|
|
1146
1283
|
private readonly intervals;
|
|
1147
1284
|
private readonly timeouts;
|
|
1148
1285
|
private closed;
|
|
1286
|
+
private canceledHandle?;
|
|
1149
1287
|
private readonly onError;
|
|
1150
1288
|
constructor(onError: (error: unknown) => void);
|
|
1151
1289
|
clearInterval(handle: IntervalHandle): void;
|
|
@@ -1154,6 +1292,8 @@ export declare class RuntimeScheduler {
|
|
|
1154
1292
|
queueMicrotask(handler: () => void): void;
|
|
1155
1293
|
setInterval(handler: (...args: any[]) => void, timeout?: number, ...args: any[]): NodeJS.Timeout;
|
|
1156
1294
|
setTimeout(handler: (...args: any[]) => void, timeout?: number, ...args: any[]): NodeJS.Timeout;
|
|
1295
|
+
/** 已销毁 realm 的 Promise 回调不能复活任务,也不能向外泄漏异步拒绝。 */
|
|
1296
|
+
private getCanceledHandle;
|
|
1157
1297
|
}
|
|
1158
1298
|
//#endregion
|
|
1159
1299
|
//#region src/kernel/runtimeKernel.d.ts
|
|
@@ -1278,93 +1418,121 @@ export interface CreateBrowserProjectOptions {
|
|
|
1278
1418
|
}
|
|
1279
1419
|
export declare function createBrowserProject(files: BrowserVirtualFiles, options?: CreateBrowserProjectOptions): HeadlessProjectDescriptor;
|
|
1280
1420
|
//#endregion
|
|
1281
|
-
//#region src/
|
|
1282
|
-
interface
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
title: string;
|
|
1421
|
+
//#region src/view/nodeHandle.d.ts
|
|
1422
|
+
interface DomNodeLike$5 {
|
|
1423
|
+
attribs?: Record<string, string>;
|
|
1424
|
+
children?: DomNodeLike$5[];
|
|
1425
|
+
data?: string;
|
|
1426
|
+
dataset?: Record<string, unknown>;
|
|
1427
|
+
name?: string;
|
|
1428
|
+
parent?: DomNodeLike$5 | null;
|
|
1429
|
+
type?: string;
|
|
1291
1430
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1431
|
+
export interface HeadlessTestingNodeEventInit {
|
|
1432
|
+
currentTarget?: {
|
|
1433
|
+
dataset?: Record<string, unknown>;
|
|
1434
|
+
id?: string;
|
|
1435
|
+
};
|
|
1436
|
+
dataset?: Record<string, unknown>;
|
|
1437
|
+
detail?: unknown;
|
|
1438
|
+
id?: string;
|
|
1439
|
+
mark?: Record<string, unknown>;
|
|
1440
|
+
target?: {
|
|
1441
|
+
dataset?: Record<string, unknown>;
|
|
1442
|
+
id?: string;
|
|
1443
|
+
};
|
|
1298
1444
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
__propertySnapshots__?: Record<string, any>;
|
|
1305
|
-
__ready__?: boolean;
|
|
1306
|
-
createIntersectionObserver?: (options?: Record<string, any>) => any;
|
|
1307
|
-
createMediaQueryObserver?: () => HeadlessWxMediaQueryObserver;
|
|
1308
|
-
createSelectorQuery?: () => HeadlessWxSelectorQuery;
|
|
1309
|
-
getRelationNodes: (relationKey: string) => HeadlessComponentInstance[];
|
|
1310
|
-
data: Record<string, any>;
|
|
1311
|
-
properties: Record<string, any>;
|
|
1312
|
-
selectAllComponents?: (selector: string) => any[];
|
|
1313
|
-
selectComponent?: (selector: string) => any;
|
|
1314
|
-
selectOwnerComponent?: () => any;
|
|
1315
|
-
setData: (patch: Record<string, any>, callback?: () => void) => void;
|
|
1316
|
-
triggerEvent: (eventName: string, detail?: unknown, options?: Record<string, any>) => void;
|
|
1445
|
+
export interface HeadlessTestingNodeValueEventInit extends HeadlessTestingNodeEventInit {
|
|
1446
|
+
detail?: {
|
|
1447
|
+
value?: string;
|
|
1448
|
+
[key: string]: unknown;
|
|
1449
|
+
};
|
|
1317
1450
|
}
|
|
1318
|
-
interface
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1451
|
+
interface HeadlessTestingNodeInteractionHandlers {
|
|
1452
|
+
assertActive?: () => void;
|
|
1453
|
+
callMethod: (scopeId: string | null, methodName: string, event: Record<string, any>) => unknown;
|
|
1454
|
+
dispatchNativeEvent?: (node: DomNodeLike$5, eventName: string, event: HeadlessTestingNodeEventInit, onHandlerResult?: (result: unknown) => void) => boolean;
|
|
1455
|
+
createScopeHandle: (scopeId: string | null) => {
|
|
1456
|
+
scopeId: string;
|
|
1457
|
+
snapshot: () => Promise<unknown>;
|
|
1458
|
+
} | null;
|
|
1459
|
+
createPageHandle: () => {
|
|
1460
|
+
data: (path?: string) => Promise<unknown>;
|
|
1461
|
+
};
|
|
1462
|
+
ownerScopeId: (scopeId: string | null) => string | null;
|
|
1463
|
+
projectionOnly?: boolean;
|
|
1464
|
+
}
|
|
1465
|
+
export declare class HeadlessTestingNodeHandle {
|
|
1466
|
+
private readonly node;
|
|
1467
|
+
private readonly interactions?;
|
|
1468
|
+
constructor(node: DomNodeLike$5, interactions?: HeadlessTestingNodeInteractionHandlers | undefined);
|
|
1469
|
+
private assertActive;
|
|
1470
|
+
private query;
|
|
1471
|
+
$(selector: string): Promise<HeadlessTestingNodeHandle | null>;
|
|
1472
|
+
$$(selector: string): Promise<HeadlessTestingNodeHandle[]>;
|
|
1473
|
+
getElementsByXpath(expression: string): Promise<HeadlessTestingNodeHandle[]>;
|
|
1474
|
+
attr(name: string): Promise<string | undefined>;
|
|
1475
|
+
dataset(): Promise<Record<string, unknown>>;
|
|
1476
|
+
scope(): Promise<{
|
|
1477
|
+
scopeId: string;
|
|
1478
|
+
snapshot: () => Promise<unknown>;
|
|
1479
|
+
} | null>;
|
|
1480
|
+
componentScope(): Promise<{
|
|
1481
|
+
scopeId: string;
|
|
1482
|
+
snapshot: () => Promise<unknown>;
|
|
1483
|
+
} | null>;
|
|
1484
|
+
pageScope(): Promise<{
|
|
1485
|
+
scopeId: string;
|
|
1486
|
+
snapshot: () => Promise<unknown>;
|
|
1487
|
+
} | null>;
|
|
1488
|
+
page(): Promise<{
|
|
1489
|
+
data: (path?: string) => Promise<unknown>;
|
|
1490
|
+
}>;
|
|
1491
|
+
ownerComponentScope(): Promise<{
|
|
1492
|
+
scopeId: string;
|
|
1493
|
+
snapshot: () => Promise<unknown>;
|
|
1494
|
+
} | null>;
|
|
1495
|
+
text(): Promise<string>;
|
|
1496
|
+
tagName(): Promise<string | undefined>;
|
|
1497
|
+
trigger(eventName: string, event?: HeadlessTestingNodeEventInit): Promise<unknown>;
|
|
1498
|
+
tap(event?: HeadlessTestingNodeEventInit): Promise<unknown>;
|
|
1499
|
+
input(value: string, event?: HeadlessTestingNodeValueEventInit): Promise<unknown>;
|
|
1500
|
+
change(value: string, event?: HeadlessTestingNodeValueEventInit): Promise<unknown>;
|
|
1501
|
+
blur(value?: string, event?: HeadlessTestingNodeValueEventInit): Promise<unknown>;
|
|
1502
|
+
wxml(): Promise<string>;
|
|
1323
1503
|
}
|
|
1324
1504
|
//#endregion
|
|
1325
|
-
//#region src/
|
|
1326
|
-
export
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
export declare function coerceComponentPropertyValue(rawValue: unknown, option: unknown): unknown;
|
|
1330
|
-
export declare function normalizeComponentPropertyValue(definition: HeadlessComponentDefinition, key: string, rawValue: unknown): any;
|
|
1331
|
-
//#endregion
|
|
1332
|
-
//#region src/runtime/componentInstance/shared.d.ts
|
|
1333
|
-
export declare function cloneValue<T>(value: T): T;
|
|
1334
|
-
export declare function hasComponentPropertyValueChanged(currentValue: unknown, previousSnapshot: unknown, nextValue: unknown, bindingAffected: boolean): boolean;
|
|
1335
|
-
//#endregion
|
|
1336
|
-
//#region src/runtime/componentInstance/index.d.ts
|
|
1337
|
-
export declare function createComponentInstance(options: CreateComponentInstanceOptions): HeadlessComponentInstance;
|
|
1338
|
-
export declare function runComponentLifecycle(instance: HeadlessComponentInstance, lifecycleName: 'attached' | 'created' | 'detached' | 'ready'): void;
|
|
1339
|
-
export declare function runComponentPageLifetime(instance: HeadlessComponentInstance, lifetimeName: 'hide' | 'resize' | 'show', payload?: unknown): void;
|
|
1340
|
-
//#endregion
|
|
1341
|
-
//#region src/runtime/pageInstance.d.ts
|
|
1342
|
-
export interface HeadlessPageInstance extends Record<string, any> {
|
|
1343
|
-
__background__?: HeadlessBackgroundSnapshot;
|
|
1344
|
-
__backgroundTextStyle__?: HeadlessBackgroundTextStyle;
|
|
1345
|
-
__lastChangedKeys__?: string[];
|
|
1346
|
-
__navigationBar__?: HeadlessNavigationBarSnapshot;
|
|
1347
|
-
__navigationBarTitle__?: string;
|
|
1348
|
-
__route__: string;
|
|
1349
|
-
__scrollTop__?: number;
|
|
1350
|
-
data: Record<string, any>;
|
|
1351
|
-
properties: Record<string, any>;
|
|
1352
|
-
options: Record<string, string>;
|
|
1353
|
-
route: string;
|
|
1354
|
-
createIntersectionObserver?: (options?: Record<string, any>) => any;
|
|
1355
|
-
createMediaQueryObserver?: () => HeadlessWxMediaQueryObserver;
|
|
1356
|
-
getTabBar?: () => HeadlessComponentInstance | null;
|
|
1357
|
-
selectAllComponents?: (selector: string) => any[];
|
|
1358
|
-
selectComponent?: (selector: string) => any;
|
|
1359
|
-
setData: (patch: Record<string, any>, callback?: () => void) => void;
|
|
1505
|
+
//#region src/view/eventBinding.d.ts
|
|
1506
|
+
export interface MiniProgramEventBinding {
|
|
1507
|
+
method: string;
|
|
1508
|
+
stopAfter: boolean;
|
|
1360
1509
|
}
|
|
1361
|
-
export declare function
|
|
1362
|
-
export declare function
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1510
|
+
export declare function collectMiniProgramEventBindings(attributes?: Record<string, string>): Map<string, MiniProgramEventBinding>;
|
|
1511
|
+
export declare function resolveMiniProgramEventBinding(attributes: Record<string, string> | undefined, eventName: string): MiniProgramEventBinding | null;
|
|
1512
|
+
/** 冒泡时保留原始 target,currentTarget 则属于当前执行绑定的节点。 */
|
|
1513
|
+
export declare function createMiniProgramEventPayload(node: {
|
|
1514
|
+
attribs?: Record<string, string>;
|
|
1515
|
+
dataset?: Record<string, unknown>;
|
|
1516
|
+
}, eventName: string, event: HeadlessTestingNodeEventInit, origin?: {
|
|
1517
|
+
attribs?: Record<string, string>;
|
|
1518
|
+
dataset?: Record<string, unknown>;
|
|
1519
|
+
}): {
|
|
1520
|
+
bubbles: boolean;
|
|
1521
|
+
capturePhase: boolean;
|
|
1522
|
+
composed: boolean;
|
|
1523
|
+
currentTarget: {
|
|
1524
|
+
dataset: Record<string, unknown>;
|
|
1525
|
+
id: string;
|
|
1526
|
+
};
|
|
1527
|
+
detail: unknown;
|
|
1528
|
+
mark: Record<string, unknown> | undefined;
|
|
1529
|
+
target: {
|
|
1530
|
+
dataset: Record<string, unknown>;
|
|
1531
|
+
id: string;
|
|
1532
|
+
};
|
|
1533
|
+
timeStamp: number;
|
|
1534
|
+
type: string;
|
|
1535
|
+
};
|
|
1368
1536
|
//#endregion
|
|
1369
1537
|
//#region src/view/wxs.d.ts
|
|
1370
1538
|
type WxsModuleBindings = Record<string, unknown>;
|
|
@@ -1401,13 +1569,13 @@ export declare function resolveBrowserPageStyles(files: BrowserVirtualFiles, rou
|
|
|
1401
1569
|
}): BrowserPageStyles;
|
|
1402
1570
|
//#endregion
|
|
1403
1571
|
//#region src/browser/render/types.d.ts
|
|
1404
|
-
interface DomNodeLike$
|
|
1572
|
+
interface DomNodeLike$4 {
|
|
1405
1573
|
attribs?: Record<string, string>;
|
|
1406
|
-
children?: DomNodeLike$
|
|
1574
|
+
children?: DomNodeLike$4[];
|
|
1407
1575
|
data?: string;
|
|
1408
1576
|
dataset?: Record<string, unknown>;
|
|
1409
1577
|
name?: string;
|
|
1410
|
-
parent?: DomNodeLike$
|
|
1578
|
+
parent?: DomNodeLike$4 | null;
|
|
1411
1579
|
type?: string;
|
|
1412
1580
|
}
|
|
1413
1581
|
interface BrowserRenderScope {
|
|
@@ -1416,14 +1584,13 @@ interface BrowserRenderScope {
|
|
|
1416
1584
|
classList?: string[];
|
|
1417
1585
|
data: Record<string, any>;
|
|
1418
1586
|
dataset?: Record<string, unknown>;
|
|
1419
|
-
eventBindings?: Map<string,
|
|
1420
|
-
|
|
1421
|
-
stopAfter: boolean;
|
|
1422
|
-
}>;
|
|
1587
|
+
eventBindings?: Map<string, MiniProgramEventBinding>;
|
|
1588
|
+
captureEventBindings?: Map<string, MiniProgramEventBinding>;
|
|
1423
1589
|
getMethod: (methodName: string) => ((...args: any[]) => any) | undefined;
|
|
1424
1590
|
getScopeId: () => string;
|
|
1425
1591
|
genericComponents?: Map<string, string>;
|
|
1426
1592
|
hostId?: string;
|
|
1593
|
+
hostNode?: DomNodeLike$4;
|
|
1427
1594
|
listenerScopeId?: string;
|
|
1428
1595
|
id?: string;
|
|
1429
1596
|
ownerScopeId?: string;
|
|
@@ -1431,14 +1598,14 @@ interface BrowserRenderScope {
|
|
|
1431
1598
|
}
|
|
1432
1599
|
interface BrowserSlotContent {
|
|
1433
1600
|
instancePath: string;
|
|
1434
|
-
node: DomNodeLike$
|
|
1601
|
+
node: DomNodeLike$4;
|
|
1435
1602
|
ownerFilePath: string;
|
|
1436
1603
|
ownerJsonPath: string;
|
|
1437
1604
|
scope: BrowserRenderScope;
|
|
1438
|
-
templateRenderState: TemplateRenderState<DomNodeLike$
|
|
1605
|
+
templateRenderState: TemplateRenderState<DomNodeLike$4>;
|
|
1439
1606
|
}
|
|
1440
1607
|
interface BrowserRenderedPageTree {
|
|
1441
|
-
root: DomNodeLike$
|
|
1608
|
+
root: DomNodeLike$4;
|
|
1442
1609
|
styles: BrowserPageStyles;
|
|
1443
1610
|
wxml: string;
|
|
1444
1611
|
}
|
|
@@ -1479,13 +1646,13 @@ interface HeadlessModuleLoader {
|
|
|
1479
1646
|
}
|
|
1480
1647
|
//#endregion
|
|
1481
1648
|
//#region src/runtime/render/types.d.ts
|
|
1482
|
-
interface DomNodeLike$
|
|
1649
|
+
interface DomNodeLike$3 {
|
|
1483
1650
|
attribs?: Record<string, string>;
|
|
1484
|
-
children?: DomNodeLike$
|
|
1651
|
+
children?: DomNodeLike$3[];
|
|
1485
1652
|
data?: string;
|
|
1486
1653
|
dataset?: Record<string, unknown>;
|
|
1487
1654
|
name?: string;
|
|
1488
|
-
parent?: DomNodeLike$
|
|
1655
|
+
parent?: DomNodeLike$3 | null;
|
|
1489
1656
|
type?: string;
|
|
1490
1657
|
}
|
|
1491
1658
|
interface RuntimeRenderScope {
|
|
@@ -1494,14 +1661,13 @@ interface RuntimeRenderScope {
|
|
|
1494
1661
|
classList?: string[];
|
|
1495
1662
|
data: Record<string, any>;
|
|
1496
1663
|
dataset?: Record<string, unknown>;
|
|
1497
|
-
eventBindings?: Map<string,
|
|
1498
|
-
|
|
1499
|
-
stopAfter: boolean;
|
|
1500
|
-
}>;
|
|
1664
|
+
eventBindings?: Map<string, MiniProgramEventBinding>;
|
|
1665
|
+
captureEventBindings?: Map<string, MiniProgramEventBinding>;
|
|
1501
1666
|
getMethod: (methodName: string) => ((...args: any[]) => any) | undefined;
|
|
1502
1667
|
getScopeId: () => string;
|
|
1503
1668
|
genericComponents?: Map<string, string>;
|
|
1504
1669
|
hostId?: string;
|
|
1670
|
+
hostNode?: DomNodeLike$3;
|
|
1505
1671
|
listenerScopeId?: string;
|
|
1506
1672
|
id?: string;
|
|
1507
1673
|
ownerScopeId?: string;
|
|
@@ -1509,14 +1675,14 @@ interface RuntimeRenderScope {
|
|
|
1509
1675
|
}
|
|
1510
1676
|
interface RuntimeSlotContent {
|
|
1511
1677
|
instancePath: string;
|
|
1512
|
-
node: DomNodeLike$
|
|
1678
|
+
node: DomNodeLike$3;
|
|
1513
1679
|
ownerFilePath: string;
|
|
1514
1680
|
ownerJsonPath: string;
|
|
1515
1681
|
scope: RuntimeRenderScope;
|
|
1516
|
-
templateRenderState: TemplateRenderState<DomNodeLike$
|
|
1682
|
+
templateRenderState: TemplateRenderState<DomNodeLike$3>;
|
|
1517
1683
|
}
|
|
1518
1684
|
interface RuntimeRenderedPageTree {
|
|
1519
|
-
root: DomNodeLike$
|
|
1685
|
+
root: DomNodeLike$3;
|
|
1520
1686
|
wxml: string;
|
|
1521
1687
|
}
|
|
1522
1688
|
interface RuntimeRendererContext {
|
|
@@ -1539,6 +1705,17 @@ interface RuntimeRendererContext {
|
|
|
1539
1705
|
//#region src/runtime/render/index.d.ts
|
|
1540
1706
|
export declare function renderRuntimePageTree(context: RuntimeRendererContext, page: HeadlessPageInstance): RuntimeRenderedPageTree;
|
|
1541
1707
|
//#endregion
|
|
1708
|
+
//#region src/view/nativeNode.d.ts
|
|
1709
|
+
interface HeadlessNativeNode {
|
|
1710
|
+
attribs?: Record<string, string>;
|
|
1711
|
+
children?: HeadlessNativeNode[];
|
|
1712
|
+
name?: string;
|
|
1713
|
+
dataset?: Record<string, unknown>;
|
|
1714
|
+
data?: string;
|
|
1715
|
+
type?: string;
|
|
1716
|
+
parent?: HeadlessNativeNode | null;
|
|
1717
|
+
}
|
|
1718
|
+
//#endregion
|
|
1542
1719
|
//#region src/runtime/wxState.d.ts
|
|
1543
1720
|
export interface HeadlessWxLoadingSnapshot {
|
|
1544
1721
|
mask: boolean;
|
|
@@ -1653,6 +1830,7 @@ export interface HeadlessWxUploadFileLogEntry {
|
|
|
1653
1830
|
}
|
|
1654
1831
|
export interface HeadlessWxStateOptions {
|
|
1655
1832
|
strictMocks?: boolean;
|
|
1833
|
+
readPackageFile?: (filePath: string) => string | undefined;
|
|
1656
1834
|
}
|
|
1657
1835
|
export declare function createHeadlessWxState(scheduler?: Pick<RuntimeScheduler, 'clearTimeout' | 'setTimeout'>, options?: HeadlessWxStateOptions): {
|
|
1658
1836
|
close(): void;
|
|
@@ -1941,6 +2119,7 @@ export declare class HeadlessSession {
|
|
|
1941
2119
|
private appInstance;
|
|
1942
2120
|
private readonly appLifecycle;
|
|
1943
2121
|
private readonly moduleLoader;
|
|
2122
|
+
private readonly routeEvents;
|
|
1944
2123
|
private readonly eventListeners;
|
|
1945
2124
|
private readonly registries;
|
|
1946
2125
|
private currentPageInstance;
|
|
@@ -2055,6 +2234,9 @@ export declare class HeadlessSession {
|
|
|
2055
2234
|
getFileText(filePath: string): string | null;
|
|
2056
2235
|
getSavedFileListSnapshot(): HeadlessWxSavedFileInfo[];
|
|
2057
2236
|
renderCurrentPage(): RuntimeRenderedPageTree;
|
|
2237
|
+
dispatchNativeNodeEvent(node: HeadlessNativeNode, eventName: string, event: {
|
|
2238
|
+
detail?: unknown;
|
|
2239
|
+
}, onHandlerResult?: (result: unknown) => void): boolean;
|
|
2058
2240
|
requestRender(callback?: () => void): void;
|
|
2059
2241
|
getScopeSnapshot(scopeId: string): {
|
|
2060
2242
|
data: Record<string, any>;
|
|
@@ -2077,6 +2259,8 @@ export declare class HeadlessSession {
|
|
|
2077
2259
|
} | null;
|
|
2078
2260
|
getScopeIdForComponent(component: HeadlessComponentInstance | null | undefined): string | null;
|
|
2079
2261
|
callScopeMethod(scopeId: string | null, methodName: string, event: Record<string, any>): any;
|
|
2262
|
+
/** 解析本次交互的实例,后续回调不随重渲染或导航切换所有者。 */
|
|
2263
|
+
private resolveScopeMethod;
|
|
2080
2264
|
callScopeMethodDirect(scopeId: string, methodName: string, ...args: any[]): any;
|
|
2081
2265
|
getStorageSnapshot(): {
|
|
2082
2266
|
[k: string]: unknown;
|
|
@@ -2256,6 +2440,7 @@ export declare class HeadlessSession {
|
|
|
2256
2440
|
triggerRouteDone(options?: Record<string, any>): HeadlessPageInstance;
|
|
2257
2441
|
stopPullDownRefresh(): void;
|
|
2258
2442
|
private executeSelectorQuery;
|
|
2443
|
+
private beginRoute;
|
|
2259
2444
|
private createFreshPage;
|
|
2260
2445
|
private runInitialPageLifecycles;
|
|
2261
2446
|
private isTabBarRoute;
|
|
@@ -2285,7 +2470,8 @@ export declare function createHeadlessSession(options: HeadlessSessionOptions):
|
|
|
2285
2470
|
export interface BrowserHeadlessSessionOptions {
|
|
2286
2471
|
files: BrowserVirtualFiles;
|
|
2287
2472
|
globals?: Record<string, unknown>;
|
|
2288
|
-
|
|
2473
|
+
/** 返回的 Promise 表示宿主 DOM 已提交;普通返回值按同步渲染处理。 */
|
|
2474
|
+
onRender?: () => unknown;
|
|
2289
2475
|
project?: HeadlessProjectDescriptor;
|
|
2290
2476
|
strictHostMocks?: boolean;
|
|
2291
2477
|
}
|
|
@@ -2304,6 +2490,7 @@ export declare class BrowserHeadlessSession {
|
|
|
2304
2490
|
private readonly componentScopes;
|
|
2305
2491
|
private readonly selectorQueryScopeSnapshots;
|
|
2306
2492
|
private renderRequestPending;
|
|
2493
|
+
private renderInProgress;
|
|
2307
2494
|
private readonly renderRequestCallbacks;
|
|
2308
2495
|
private readonly tabBarRoutes;
|
|
2309
2496
|
private readonly tabPages;
|
|
@@ -2317,6 +2504,7 @@ export declare class BrowserHeadlessSession {
|
|
|
2317
2504
|
private launchOptions;
|
|
2318
2505
|
private readonly kernel;
|
|
2319
2506
|
private readonly startupNavigation;
|
|
2507
|
+
private readonly routeEvents;
|
|
2320
2508
|
private readonly wxState;
|
|
2321
2509
|
private pullDownRefreshState;
|
|
2322
2510
|
constructor(options: BrowserHeadlessSessionOptions);
|
|
@@ -2575,8 +2763,13 @@ export declare class BrowserHeadlessSession {
|
|
|
2575
2763
|
selectOwnerComponent(scopeId: string): any;
|
|
2576
2764
|
private selectComponentsWithin;
|
|
2577
2765
|
renderCurrentPage(): BrowserRenderedPageTree;
|
|
2766
|
+
dispatchNativeNodeEvent(node: HeadlessNativeNode, eventName: string, event: {
|
|
2767
|
+
detail?: unknown;
|
|
2768
|
+
}, onHandlerResult?: (result: unknown) => void): boolean;
|
|
2578
2769
|
requestRender(callback?: () => void): void;
|
|
2579
2770
|
callScopeMethod(scopeId: string | null, methodName: string, event: Record<string, any>): any;
|
|
2771
|
+
/** 解析本次交互的实例,后续回调不随重渲染或导航切换所有者。 */
|
|
2772
|
+
private resolveScopeMethod;
|
|
2580
2773
|
callScopeMethodDirect(scopeId: string, methodName: string, ...args: any[]): any;
|
|
2581
2774
|
callTapBinding(scopeId: string, methodName: string): any;
|
|
2582
2775
|
callTapBindingWithEvent(scopeId: string, methodName: string, event?: {
|
|
@@ -2617,6 +2810,7 @@ export declare class BrowserHeadlessSession {
|
|
|
2617
2810
|
triggerRouteDone(options?: Record<string, any>): HeadlessPageInstance;
|
|
2618
2811
|
stopPullDownRefresh(): void;
|
|
2619
2812
|
private executeSelectorQuery;
|
|
2813
|
+
private beginRoute;
|
|
2620
2814
|
private createFreshPage;
|
|
2621
2815
|
private runInitialPageLifecycles;
|
|
2622
2816
|
private isTabBarRoute;
|
|
@@ -2665,96 +2859,6 @@ export declare function waitForPageText<NodeHandle, ScopeHandle>(access: Headles
|
|
|
2665
2859
|
export declare function waitForPageTextGone<NodeHandle, ScopeHandle>(access: HeadlessTestingPageWaitAccess<NodeHandle, ScopeHandle>, text: string, options?: HeadlessTestingWaitOptions): Promise<void>;
|
|
2666
2860
|
export declare function waitForPageData<NodeHandle, ScopeHandle>(access: HeadlessTestingPageWaitAccess<NodeHandle, ScopeHandle>, path: string, matcher: HeadlessTestingDataMatcher, hasMatcher: boolean, options?: HeadlessTestingWaitOptions): Promise<{}>;
|
|
2667
2861
|
//#endregion
|
|
2668
|
-
//#region src/view/eventBinding.d.ts
|
|
2669
|
-
export interface MiniProgramEventBinding {
|
|
2670
|
-
method: string;
|
|
2671
|
-
stopAfter: boolean;
|
|
2672
|
-
}
|
|
2673
|
-
export declare function collectMiniProgramEventBindings(attributes?: Record<string, string>): Map<string, MiniProgramEventBinding>;
|
|
2674
|
-
export declare function resolveMiniProgramEventBinding(attributes: Record<string, string> | undefined, eventName: string): MiniProgramEventBinding | null;
|
|
2675
|
-
//#endregion
|
|
2676
|
-
//#region src/view/nodeHandle.d.ts
|
|
2677
|
-
interface DomNodeLike$3 {
|
|
2678
|
-
attribs?: Record<string, string>;
|
|
2679
|
-
children?: DomNodeLike$3[];
|
|
2680
|
-
data?: string;
|
|
2681
|
-
dataset?: Record<string, unknown>;
|
|
2682
|
-
name?: string;
|
|
2683
|
-
parent?: DomNodeLike$3 | null;
|
|
2684
|
-
type?: string;
|
|
2685
|
-
}
|
|
2686
|
-
export interface HeadlessTestingNodeEventInit {
|
|
2687
|
-
currentTarget?: {
|
|
2688
|
-
dataset?: Record<string, unknown>;
|
|
2689
|
-
id?: string;
|
|
2690
|
-
};
|
|
2691
|
-
dataset?: Record<string, unknown>;
|
|
2692
|
-
detail?: unknown;
|
|
2693
|
-
id?: string;
|
|
2694
|
-
mark?: Record<string, unknown>;
|
|
2695
|
-
target?: {
|
|
2696
|
-
dataset?: Record<string, unknown>;
|
|
2697
|
-
id?: string;
|
|
2698
|
-
};
|
|
2699
|
-
}
|
|
2700
|
-
export interface HeadlessTestingNodeValueEventInit extends HeadlessTestingNodeEventInit {
|
|
2701
|
-
detail?: {
|
|
2702
|
-
value?: string;
|
|
2703
|
-
[key: string]: unknown;
|
|
2704
|
-
};
|
|
2705
|
-
}
|
|
2706
|
-
interface HeadlessTestingNodeInteractionHandlers {
|
|
2707
|
-
assertActive?: () => void;
|
|
2708
|
-
callMethod: (scopeId: string | null, methodName: string, event: Record<string, any>) => unknown;
|
|
2709
|
-
createScopeHandle: (scopeId: string | null) => {
|
|
2710
|
-
scopeId: string;
|
|
2711
|
-
snapshot: () => Promise<unknown>;
|
|
2712
|
-
} | null;
|
|
2713
|
-
createPageHandle: () => {
|
|
2714
|
-
data: (path?: string) => Promise<unknown>;
|
|
2715
|
-
};
|
|
2716
|
-
ownerScopeId: (scopeId: string | null) => string | null;
|
|
2717
|
-
}
|
|
2718
|
-
export declare class HeadlessTestingNodeHandle {
|
|
2719
|
-
private readonly node;
|
|
2720
|
-
private readonly interactions?;
|
|
2721
|
-
constructor(node: DomNodeLike$3, interactions?: HeadlessTestingNodeInteractionHandlers | undefined);
|
|
2722
|
-
private assertActive;
|
|
2723
|
-
private query;
|
|
2724
|
-
$(selector: string): Promise<HeadlessTestingNodeHandle | null>;
|
|
2725
|
-
$$(selector: string): Promise<HeadlessTestingNodeHandle[]>;
|
|
2726
|
-
getElementsByXpath(expression: string): Promise<HeadlessTestingNodeHandle[]>;
|
|
2727
|
-
attr(name: string): Promise<string | undefined>;
|
|
2728
|
-
dataset(): Promise<Record<string, unknown>>;
|
|
2729
|
-
scope(): Promise<{
|
|
2730
|
-
scopeId: string;
|
|
2731
|
-
snapshot: () => Promise<unknown>;
|
|
2732
|
-
} | null>;
|
|
2733
|
-
componentScope(): Promise<{
|
|
2734
|
-
scopeId: string;
|
|
2735
|
-
snapshot: () => Promise<unknown>;
|
|
2736
|
-
} | null>;
|
|
2737
|
-
pageScope(): Promise<{
|
|
2738
|
-
scopeId: string;
|
|
2739
|
-
snapshot: () => Promise<unknown>;
|
|
2740
|
-
} | null>;
|
|
2741
|
-
page(): Promise<{
|
|
2742
|
-
data: (path?: string) => Promise<unknown>;
|
|
2743
|
-
}>;
|
|
2744
|
-
ownerComponentScope(): Promise<{
|
|
2745
|
-
scopeId: string;
|
|
2746
|
-
snapshot: () => Promise<unknown>;
|
|
2747
|
-
} | null>;
|
|
2748
|
-
text(): Promise<string>;
|
|
2749
|
-
tagName(): Promise<string | undefined>;
|
|
2750
|
-
trigger(eventName: string, event?: HeadlessTestingNodeEventInit): Promise<unknown>;
|
|
2751
|
-
tap(event?: HeadlessTestingNodeEventInit): Promise<unknown>;
|
|
2752
|
-
input(value: string, event?: HeadlessTestingNodeValueEventInit): Promise<unknown>;
|
|
2753
|
-
change(value: string, event?: HeadlessTestingNodeValueEventInit): Promise<unknown>;
|
|
2754
|
-
blur(value?: string, event?: HeadlessTestingNodeValueEventInit): Promise<unknown>;
|
|
2755
|
-
wxml(): Promise<string>;
|
|
2756
|
-
}
|
|
2757
|
-
//#endregion
|
|
2758
2862
|
//#region src/view/render.d.ts
|
|
2759
2863
|
interface DomNodeLike$2 {
|
|
2760
2864
|
attribs?: Record<string, string>;
|
|
@@ -2956,8 +3060,11 @@ interface HeadlessTestingToolInfo {
|
|
|
2956
3060
|
export declare class HeadlessTestingSessionHandle {
|
|
2957
3061
|
private readonly project;
|
|
2958
3062
|
private readonly session;
|
|
3063
|
+
private readonly pendingNavigations;
|
|
2959
3064
|
constructor(project: HeadlessProjectDescriptor, session: HeadlessSession);
|
|
2960
3065
|
close(): Promise<void>;
|
|
3066
|
+
/** 无头会话独占本地 runtime;同步释放与 automator 的连接清理契约一致。 */
|
|
3067
|
+
disconnect(): void;
|
|
2961
3068
|
toolInfo(): Promise<HeadlessTestingToolInfo>;
|
|
2962
3069
|
on(eventName: string, handler: (...args: any[]) => void): this;
|
|
2963
3070
|
removeListener(eventName: string, handler: (...args: any[]) => void): this;
|
|
@@ -2968,6 +3075,8 @@ export declare class HeadlessTestingSessionHandle {
|
|
|
2968
3075
|
getCurrentPages(): Promise<HeadlessTestingPageHandle[]>;
|
|
2969
3076
|
callWxMethod<T = unknown>(methodName: string, ...args: any[]): Promise<T>;
|
|
2970
3077
|
callWxMethodWithOptions<T = unknown>(methodName: string, options?: HeadlessTestingProtocolOptions, ...args: any[]): Promise<T>;
|
|
3078
|
+
/** 返回与 DevTools automator 兼容的运行时系统信息。 */
|
|
3079
|
+
systemInfo<T = unknown>(): Promise<T>;
|
|
2971
3080
|
scopeSnapshot(scopeId: string): Promise<{
|
|
2972
3081
|
data: Record<string, any>;
|
|
2973
3082
|
methods: string[];
|