-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathdebug.d.ts
166 lines (148 loc) · 4.88 KB
/
debug.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import { IProjectData } from "./project";
import { IDebugInformation } from "../declarations";
import { IProjectDir, IPlatform } from "../common/declarations";
interface IDebugData
extends IProjectDir,
Mobile.IDeviceIdentifier,
IOptionalDebuggingOptions {
applicationIdentifier: string;
projectName?: string;
}
/**
* Describes all options that define the behavior of debug.
*/
interface IDebugOptions {
/**
* Defines if Chrome DevTools should be used for debugging.
*/
chrome?: boolean;
/**
* Defines if thе application is already started on device.
*/
start?: boolean;
/**
* Defines if we should stop the currently running debug process.
*/
stop?: boolean;
/**
* Defines if the debug process should break on the first line.
*/
debugBrk?: boolean;
/**
* Defines if the debug process will not have a client attached (i.e. the process will be started, but NativeScript Inspector will not be started and it will not attach to the running debug process).
*/
client?: boolean;
/**
* Defines if the process will watch for further changes in the project and transferrs them to device immediately, resulting in restar of the debug process.
*/
justlaunch?: boolean;
/**
* Defines if bundled Chrome DevTools should be used or specific commit.
* Default value is true for Android and false for iOS.
*/
useBundledDevTools?: boolean;
/**
* Defines if https://chrome-devtools-frontend.appspot.com should be used instead of chrome-devtools://devtools
* In case it is passed, the value of `useBundledDevTools` is disregarded.
* Default value is false.
*/
useHttpUrl?: boolean;
/**
* Defines the commit that will be used in cases where remote protocol is required.
* For Android this is the case when useHttpUrl is set to true or useBundledDevTools is set to false.
* For iOS the value is used by default and when useHttpUrl is set to true.
* Default value is 02e6bde1bbe34e43b309d4ef774b1168d25fd024 which corresponds to 55.0.2883 Chrome version
*/
devToolsCommit?: string;
/**
* Defines if the iOS App Inspector should be used instead of providing URL to debug the application with Chrome DevTools
*/
inspector?: boolean;
/**
* Defines if should print all availableDevices
*/
availableDevices?: boolean;
/**
* Defines the timeout in seconds {N} CLI will wait to find the inspector socket port from device's logs.
* If not provided, defaults to 10 seconds.
*/
timeout?: string;
/**
* The sdk version of the emulator.
*/
sdk?: string;
/**
* Forces the debugger attach event to be emitted.
*/
forceDebuggerAttachedEvent?: boolean;
}
/**
* Describes methods to create debug data object used by other methods.
*/
interface IDebugDataService {
/**
* Creates the debug data based on specified options.
* @param {string} deviceIdentifier The identifier of the device
* @param {IProjectData} projectData The data describing project that will be debugged.
* @param {IDebugOptions} debugOptions The debug options
* @returns {IDebugData} Data describing the required information for starting debug process.
*/
getDebugData(
deviceIdentifier: string,
projectData: IProjectData,
debugOptions: IDebugOptions
): IDebugData;
}
/**
* Describes actions required for debugging on specific platform (Android or iOS).
*/
interface IDeviceDebugService extends IPlatform, NodeJS.EventEmitter {
/**
* Stops debug operation.
* @returns {Promise<void>}
*/
debugStop(): Promise<void>;
/**
* Starts debug operation based on the specified debug data.
* @param {IAppDebugData} debugData Describes information for application that will be debugged.
* @param {IDebugOptions} debugOptions Describe possible options to modify the behaivor of the debug operation, for example stop on the first line.
* @returns {Promise<string>} Full url where the frontend client may be connected.
*/
debug(
debugData: IAppDebugData,
debugOptions: IDebugOptions
): Promise<IDebugResultInfo>;
}
interface IDebugResultInfo {
debugUrl: string;
}
interface IAppDebugData extends IProjectDir {
/**
* Application identifier of the app that it will be debugged.
*/
applicationIdentifier: string;
/**
* The name of the application, for example `MyProject`.
*/
projectName?: string;
}
interface IDebugController {
startDebug(debugData: IDebugData): Promise<IDebugInformation>;
stopDebug(deviceIdentifier: string): Promise<void>;
printDebugInformation(
debugInformation: IDebugInformation,
fireDebuggerAttachedEvent?: boolean
): IDebugInformation;
enableDebuggingCoreWithoutWaitingCurrentAction(
projectDir: string,
deviceIdentifier: string,
debugOptions: IDebugOptions
): Promise<IDebugInformation>;
enableDebugging(
enableDebuggingData: IEnableDebuggingData
): Promise<IDebugInformation>[];
disableDebugging(disableDebuggingData: IDisableDebuggingData): Promise<void>;
attachDebugger(
attachDebuggerData: IAttachDebuggerData
): Promise<IDebugInformation>;
}