-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathdebug.d.ts
128 lines (110 loc) · 3.58 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
/**
* Describes information for starting debug process.
*/
interface IDebugData {
/**
* Id of the device on which the debug process will be started.
*/
deviceIdentifier: string;
/**
* Application identifier of the app that it will be debugged.
*/
applicationIdentifier: string;
/**
* Path to .app built for iOS Simulator.
*/
pathToAppPackage?: string;
/**
* The name of the application, for example `MyProject`.
*/
projectName?: string;
/**
* Path to project.
*/
projectDir?: 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 debug process is for emulator (not for real device).
*/
emulator?: 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. Valid for iOS only.
*/
useBundledDevTools?: boolean;
}
/**
* Describes methods to create debug data object used by other methods.
*/
interface IDebugDataService {
/**
* Creates the debug data based on specified options.
* @param {IProjectData} projectData The data describing project that will be debugged.
* @param {IOptions} options The options based on which debugData will be created
* @returns {IDebugData} Data describing the required information for starting debug process.
*/
createDebugData(projectData: IProjectData, options: IDeviceIdentifier): IDebugData;
}
/**
* Describes methods for debug operation.
*/
interface IDebugServiceBase extends NodeJS.EventEmitter {
/**
* Starts debug operation based on the specified debug data.
* @param {IDebugData} debugData Describes information for device and 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<T>} Array of URLs that can be used for debugging or a string representing a single url that can be used for debugging.
*/
debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string>;
}
interface IDebugService {
getDebugService(device: Mobile.IDevice): IPlatformDebugService;
}
/**
* Describes actions required for debugging on specific platform (Android or iOS).
*/
interface IPlatformDebugService extends IDebugServiceBase {
/**
* Starts debug operation.
* @param {IDebugData} debugData Describes information for device and 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<void>}
*/
debugStart(debugData: IDebugData, debugOptions: IDebugOptions): Promise<void>;
/**
* Stops debug operation.
* @returns {Promise<void>}
*/
debugStop(): Promise<void>
/**
* Mobile platform of the device - Android or iOS.
*/
platform: string;
}