UNPKG

123 kBTypeScriptView Raw
1// tslint:disable-next-line:dt-header
2// Type definitions for inspector
3
4// These definitions are auto-generated.
5// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
6// for more information.
7
8/**
9 * The inspector module provides an API for interacting with the V8 inspector.
10 */
11declare module "inspector" {
12 import { EventEmitter } from 'events';
13
14 interface InspectorNotification<T> {
15 method: string;
16 params: T;
17 }
18
19 namespace Console {
20 /**
21 * Console message.
22 */
23 interface ConsoleMessage {
24 /**
25 * Message source.
26 */
27 source: string;
28 /**
29 * Message severity.
30 */
31 level: string;
32 /**
33 * Message text.
34 */
35 text: string;
36 /**
37 * URL of the message origin.
38 */
39 url?: string;
40 /**
41 * Line number in the resource that generated this message (1-based).
42 */
43 line?: number;
44 /**
45 * Column number in the resource that generated this message (1-based).
46 */
47 column?: number;
48 }
49
50 interface MessageAddedEventDataType {
51 /**
52 * Console message that has been added.
53 */
54 message: ConsoleMessage;
55 }
56 }
57
58 namespace Debugger {
59 /**
60 * Breakpoint identifier.
61 */
62 type BreakpointId = string;
63
64 /**
65 * Call frame identifier.
66 */
67 type CallFrameId = string;
68
69 /**
70 * Location in the source code.
71 */
72 interface Location {
73 /**
74 * Script identifier as reported in the `Debugger.scriptParsed`.
75 */
76 scriptId: Runtime.ScriptId;
77 /**
78 * Line number in the script (0-based).
79 */
80 lineNumber: number;
81 /**
82 * Column number in the script (0-based).
83 */
84 columnNumber?: number;
85 }
86
87 /**
88 * Location in the source code.
89 * @experimental
90 */
91 interface ScriptPosition {
92 lineNumber: number;
93 columnNumber: number;
94 }
95
96 /**
97 * JavaScript call frame. Array of call frames form the call stack.
98 */
99 interface CallFrame {
100 /**
101 * Call frame identifier. This identifier is only valid while the virtual machine is paused.
102 */
103 callFrameId: CallFrameId;
104 /**
105 * Name of the JavaScript function called on this call frame.
106 */
107 functionName: string;
108 /**
109 * Location in the source code.
110 */
111 functionLocation?: Location;
112 /**
113 * Location in the source code.
114 */
115 location: Location;
116 /**
117 * JavaScript script name or url.
118 */
119 url: string;
120 /**
121 * Scope chain for this call frame.
122 */
123 scopeChain: Scope[];
124 /**
125 * `this` object for this call frame.
126 */
127 this: Runtime.RemoteObject;
128 /**
129 * The value being returned, if the function is at return point.
130 */
131 returnValue?: Runtime.RemoteObject;
132 }
133
134 /**
135 * Scope description.
136 */
137 interface Scope {
138 /**
139 * Scope type.
140 */
141 type: string;
142 /**
143 * Object representing the scope. For `global` and `with` scopes it represents the actual
144 * object; for the rest of the scopes, it is artificial transient object enumerating scope
145 * variables as its properties.
146 */
147 object: Runtime.RemoteObject;
148 name?: string;
149 /**
150 * Location in the source code where scope starts
151 */
152 startLocation?: Location;
153 /**
154 * Location in the source code where scope ends
155 */
156 endLocation?: Location;
157 }
158
159 /**
160 * Search match for resource.
161 */
162 interface SearchMatch {
163 /**
164 * Line number in resource content.
165 */
166 lineNumber: number;
167 /**
168 * Line with match content.
169 */
170 lineContent: string;
171 }
172
173 interface BreakLocation {
174 /**
175 * Script identifier as reported in the `Debugger.scriptParsed`.
176 */
177 scriptId: Runtime.ScriptId;
178 /**
179 * Line number in the script (0-based).
180 */
181 lineNumber: number;
182 /**
183 * Column number in the script (0-based).
184 */
185 columnNumber?: number;
186 type?: string;
187 }
188
189 interface ContinueToLocationParameterType {
190 /**
191 * Location to continue to.
192 */
193 location: Location;
194 targetCallFrames?: string;
195 }
196
197 interface EvaluateOnCallFrameParameterType {
198 /**
199 * Call frame identifier to evaluate on.
200 */
201 callFrameId: CallFrameId;
202 /**
203 * Expression to evaluate.
204 */
205 expression: string;
206 /**
207 * String object group name to put result into (allows rapid releasing resulting object handles
208 * using `releaseObjectGroup`).
209 */
210 objectGroup?: string;
211 /**
212 * Specifies whether command line API should be available to the evaluated expression, defaults
213 * to false.
214 */
215 includeCommandLineAPI?: boolean;
216 /**
217 * In silent mode exceptions thrown during evaluation are not reported and do not pause
218 * execution. Overrides `setPauseOnException` state.
219 */
220 silent?: boolean;
221 /**
222 * Whether the result is expected to be a JSON object that should be sent by value.
223 */
224 returnByValue?: boolean;
225 /**
226 * Whether preview should be generated for the result.
227 * @experimental
228 */
229 generatePreview?: boolean;
230 /**
231 * Whether to throw an exception if side effect cannot be ruled out during evaluation.
232 */
233 throwOnSideEffect?: boolean;
234 /**
235 * Terminate execution after timing out (number of milliseconds).
236 * @experimental
237 */
238 timeout?: Runtime.TimeDelta;
239 }
240
241 interface GetPossibleBreakpointsParameterType {
242 /**
243 * Start of range to search possible breakpoint locations in.
244 */
245 start: Location;
246 /**
247 * End of range to search possible breakpoint locations in (excluding). When not specified, end
248 * of scripts is used as end of range.
249 */
250 end?: Location;
251 /**
252 * Only consider locations which are in the same (non-nested) function as start.
253 */
254 restrictToFunction?: boolean;
255 }
256
257 interface GetScriptSourceParameterType {
258 /**
259 * Id of the script to get source for.
260 */
261 scriptId: Runtime.ScriptId;
262 }
263
264 interface GetStackTraceParameterType {
265 stackTraceId: Runtime.StackTraceId;
266 }
267
268 interface PauseOnAsyncCallParameterType {
269 /**
270 * Debugger will pause when async call with given stack trace is started.
271 */
272 parentStackTraceId: Runtime.StackTraceId;
273 }
274
275 interface RemoveBreakpointParameterType {
276 breakpointId: BreakpointId;
277 }
278
279 interface RestartFrameParameterType {
280 /**
281 * Call frame identifier to evaluate on.
282 */
283 callFrameId: CallFrameId;
284 }
285
286 interface SearchInContentParameterType {
287 /**
288 * Id of the script to search in.
289 */
290 scriptId: Runtime.ScriptId;
291 /**
292 * String to search for.
293 */
294 query: string;
295 /**
296 * If true, search is case sensitive.
297 */
298 caseSensitive?: boolean;
299 /**
300 * If true, treats string parameter as regex.
301 */
302 isRegex?: boolean;
303 }
304
305 interface SetAsyncCallStackDepthParameterType {
306 /**
307 * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
308 * call stacks (default).
309 */
310 maxDepth: number;
311 }
312
313 interface SetBlackboxPatternsParameterType {
314 /**
315 * Array of regexps that will be used to check script url for blackbox state.
316 */
317 patterns: string[];
318 }
319
320 interface SetBlackboxedRangesParameterType {
321 /**
322 * Id of the script.
323 */
324 scriptId: Runtime.ScriptId;
325 positions: ScriptPosition[];
326 }
327
328 interface SetBreakpointParameterType {
329 /**
330 * Location to set breakpoint in.
331 */
332 location: Location;
333 /**
334 * Expression to use as a breakpoint condition. When specified, debugger will only stop on the
335 * breakpoint if this expression evaluates to true.
336 */
337 condition?: string;
338 }
339
340 interface SetBreakpointByUrlParameterType {
341 /**
342 * Line number to set breakpoint at.
343 */
344 lineNumber: number;
345 /**
346 * URL of the resources to set breakpoint on.
347 */
348 url?: string;
349 /**
350 * Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or
351 * `urlRegex` must be specified.
352 */
353 urlRegex?: string;
354 /**
355 * Script hash of the resources to set breakpoint on.
356 */
357 scriptHash?: string;
358 /**
359 * Offset in the line to set breakpoint at.
360 */
361 columnNumber?: number;
362 /**
363 * Expression to use as a breakpoint condition. When specified, debugger will only stop on the
364 * breakpoint if this expression evaluates to true.
365 */
366 condition?: string;
367 }
368
369 interface SetBreakpointOnFunctionCallParameterType {
370 /**
371 * Function object id.
372 */
373 objectId: Runtime.RemoteObjectId;
374 /**
375 * Expression to use as a breakpoint condition. When specified, debugger will
376 * stop on the breakpoint if this expression evaluates to true.
377 */
378 condition?: string;
379 }
380
381 interface SetBreakpointsActiveParameterType {
382 /**
383 * New value for breakpoints active state.
384 */
385 active: boolean;
386 }
387
388 interface SetPauseOnExceptionsParameterType {
389 /**
390 * Pause on exceptions mode.
391 */
392 state: string;
393 }
394
395 interface SetReturnValueParameterType {
396 /**
397 * New return value.
398 */
399 newValue: Runtime.CallArgument;
400 }
401
402 interface SetScriptSourceParameterType {
403 /**
404 * Id of the script to edit.
405 */
406 scriptId: Runtime.ScriptId;
407 /**
408 * New content of the script.
409 */
410 scriptSource: string;
411 /**
412 * If true the change will not actually be applied. Dry run may be used to get result
413 * description without actually modifying the code.
414 */
415 dryRun?: boolean;
416 }
417
418 interface SetSkipAllPausesParameterType {
419 /**
420 * New value for skip pauses state.
421 */
422 skip: boolean;
423 }
424
425 interface SetVariableValueParameterType {
426 /**
427 * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
428 * scope types are allowed. Other scopes could be manipulated manually.
429 */
430 scopeNumber: number;
431 /**
432 * Variable name.
433 */
434 variableName: string;
435 /**
436 * New variable value.
437 */
438 newValue: Runtime.CallArgument;
439 /**
440 * Id of callframe that holds variable.
441 */
442 callFrameId: CallFrameId;
443 }
444
445 interface StepIntoParameterType {
446 /**
447 * Debugger will issue additional Debugger.paused notification if any async task is scheduled
448 * before next pause.
449 * @experimental
450 */
451 breakOnAsyncCall?: boolean;
452 }
453
454 interface EnableReturnType {
455 /**
456 * Unique identifier of the debugger.
457 * @experimental
458 */
459 debuggerId: Runtime.UniqueDebuggerId;
460 }
461
462 interface EvaluateOnCallFrameReturnType {
463 /**
464 * Object wrapper for the evaluation result.
465 */
466 result: Runtime.RemoteObject;
467 /**
468 * Exception details.
469 */
470 exceptionDetails?: Runtime.ExceptionDetails;
471 }
472
473 interface GetPossibleBreakpointsReturnType {
474 /**
475 * List of the possible breakpoint locations.
476 */
477 locations: BreakLocation[];
478 }
479
480 interface GetScriptSourceReturnType {
481 /**
482 * Script source.
483 */
484 scriptSource: string;
485 }
486
487 interface GetStackTraceReturnType {
488 stackTrace: Runtime.StackTrace;
489 }
490
491 interface RestartFrameReturnType {
492 /**
493 * New stack trace.
494 */
495 callFrames: CallFrame[];
496 /**
497 * Async stack trace, if any.
498 */
499 asyncStackTrace?: Runtime.StackTrace;
500 /**
501 * Async stack trace, if any.
502 * @experimental
503 */
504 asyncStackTraceId?: Runtime.StackTraceId;
505 }
506
507 interface SearchInContentReturnType {
508 /**
509 * List of search matches.
510 */
511 result: SearchMatch[];
512 }
513
514 interface SetBreakpointReturnType {
515 /**
516 * Id of the created breakpoint for further reference.
517 */
518 breakpointId: BreakpointId;
519 /**
520 * Location this breakpoint resolved into.
521 */
522 actualLocation: Location;
523 }
524
525 interface SetBreakpointByUrlReturnType {
526 /**
527 * Id of the created breakpoint for further reference.
528 */
529 breakpointId: BreakpointId;
530 /**
531 * List of the locations this breakpoint resolved into upon addition.
532 */
533 locations: Location[];
534 }
535
536 interface SetBreakpointOnFunctionCallReturnType {
537 /**
538 * Id of the created breakpoint for further reference.
539 */
540 breakpointId: BreakpointId;
541 }
542
543 interface SetScriptSourceReturnType {
544 /**
545 * New stack trace in case editing has happened while VM was stopped.
546 */
547 callFrames?: CallFrame[];
548 /**
549 * Whether current call stack was modified after applying the changes.
550 */
551 stackChanged?: boolean;
552 /**
553 * Async stack trace, if any.
554 */
555 asyncStackTrace?: Runtime.StackTrace;
556 /**
557 * Async stack trace, if any.
558 * @experimental
559 */
560 asyncStackTraceId?: Runtime.StackTraceId;
561 /**
562 * Exception details if any.
563 */
564 exceptionDetails?: Runtime.ExceptionDetails;
565 }
566
567 interface BreakpointResolvedEventDataType {
568 /**
569 * Breakpoint unique identifier.
570 */
571 breakpointId: BreakpointId;
572 /**
573 * Actual breakpoint location.
574 */
575 location: Location;
576 }
577
578 interface PausedEventDataType {
579 /**
580 * Call stack the virtual machine stopped on.
581 */
582 callFrames: CallFrame[];
583 /**
584 * Pause reason.
585 */
586 reason: string;
587 /**
588 * Object containing break-specific auxiliary properties.
589 */
590 data?: {};
591 /**
592 * Hit breakpoints IDs
593 */
594 hitBreakpoints?: string[];
595 /**
596 * Async stack trace, if any.
597 */
598 asyncStackTrace?: Runtime.StackTrace;
599 /**
600 * Async stack trace, if any.
601 * @experimental
602 */
603 asyncStackTraceId?: Runtime.StackTraceId;
604 /**
605 * Just scheduled async call will have this stack trace as parent stack during async execution.
606 * This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag.
607 * @experimental
608 */
609 asyncCallStackTraceId?: Runtime.StackTraceId;
610 }
611
612 interface ScriptFailedToParseEventDataType {
613 /**
614 * Identifier of the script parsed.
615 */
616 scriptId: Runtime.ScriptId;
617 /**
618 * URL or name of the script parsed (if any).
619 */
620 url: string;
621 /**
622 * Line offset of the script within the resource with given URL (for script tags).
623 */
624 startLine: number;
625 /**
626 * Column offset of the script within the resource with given URL.
627 */
628 startColumn: number;
629 /**
630 * Last line of the script.
631 */
632 endLine: number;
633 /**
634 * Length of the last line of the script.
635 */
636 endColumn: number;
637 /**
638 * Specifies script creation context.
639 */
640 executionContextId: Runtime.ExecutionContextId;
641 /**
642 * Content hash of the script.
643 */
644 hash: string;
645 /**
646 * Embedder-specific auxiliary data.
647 */
648 executionContextAuxData?: {};
649 /**
650 * URL of source map associated with script (if any).
651 */
652 sourceMapURL?: string;
653 /**
654 * True, if this script has sourceURL.
655 */
656 hasSourceURL?: boolean;
657 /**
658 * True, if this script is ES6 module.
659 */
660 isModule?: boolean;
661 /**
662 * This script length.
663 */
664 length?: number;
665 /**
666 * JavaScript top stack frame of where the script parsed event was triggered if available.
667 * @experimental
668 */
669 stackTrace?: Runtime.StackTrace;
670 }
671
672 interface ScriptParsedEventDataType {
673 /**
674 * Identifier of the script parsed.
675 */
676 scriptId: Runtime.ScriptId;
677 /**
678 * URL or name of the script parsed (if any).
679 */
680 url: string;
681 /**
682 * Line offset of the script within the resource with given URL (for script tags).
683 */
684 startLine: number;
685 /**
686 * Column offset of the script within the resource with given URL.
687 */
688 startColumn: number;
689 /**
690 * Last line of the script.
691 */
692 endLine: number;
693 /**
694 * Length of the last line of the script.
695 */
696 endColumn: number;
697 /**
698 * Specifies script creation context.
699 */
700 executionContextId: Runtime.ExecutionContextId;
701 /**
702 * Content hash of the script.
703 */
704 hash: string;
705 /**
706 * Embedder-specific auxiliary data.
707 */
708 executionContextAuxData?: {};
709 /**
710 * True, if this script is generated as a result of the live edit operation.
711 * @experimental
712 */
713 isLiveEdit?: boolean;
714 /**
715 * URL of source map associated with script (if any).
716 */
717 sourceMapURL?: string;
718 /**
719 * True, if this script has sourceURL.
720 */
721 hasSourceURL?: boolean;
722 /**
723 * True, if this script is ES6 module.
724 */
725 isModule?: boolean;
726 /**
727 * This script length.
728 */
729 length?: number;
730 /**
731 * JavaScript top stack frame of where the script parsed event was triggered if available.
732 * @experimental
733 */
734 stackTrace?: Runtime.StackTrace;
735 }
736 }
737
738 namespace HeapProfiler {
739 /**
740 * Heap snapshot object id.
741 */
742 type HeapSnapshotObjectId = string;
743
744 /**
745 * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
746 */
747 interface SamplingHeapProfileNode {
748 /**
749 * Function location.
750 */
751 callFrame: Runtime.CallFrame;
752 /**
753 * Allocations size in bytes for the node excluding children.
754 */
755 selfSize: number;
756 /**
757 * Child nodes.
758 */
759 children: SamplingHeapProfileNode[];
760 }
761
762 /**
763 * Profile.
764 */
765 interface SamplingHeapProfile {
766 head: SamplingHeapProfileNode;
767 }
768
769 interface AddInspectedHeapObjectParameterType {
770 /**
771 * Heap snapshot object id to be accessible by means of $x command line API.
772 */
773 heapObjectId: HeapSnapshotObjectId;
774 }
775
776 interface GetHeapObjectIdParameterType {
777 /**
778 * Identifier of the object to get heap object id for.
779 */
780 objectId: Runtime.RemoteObjectId;
781 }
782
783 interface GetObjectByHeapObjectIdParameterType {
784 objectId: HeapSnapshotObjectId;
785 /**
786 * Symbolic group name that can be used to release multiple objects.
787 */
788 objectGroup?: string;
789 }
790
791 interface StartSamplingParameterType {
792 /**
793 * Average sample interval in bytes. Poisson distribution is used for the intervals. The
794 * default value is 32768 bytes.
795 */
796 samplingInterval?: number;
797 }
798
799 interface StartTrackingHeapObjectsParameterType {
800 trackAllocations?: boolean;
801 }
802
803 interface StopTrackingHeapObjectsParameterType {
804 /**
805 * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken
806 * when the tracking is stopped.
807 */
808 reportProgress?: boolean;
809 }
810
811 interface TakeHeapSnapshotParameterType {
812 /**
813 * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
814 */
815 reportProgress?: boolean;
816 }
817
818 interface GetHeapObjectIdReturnType {
819 /**
820 * Id of the heap snapshot object corresponding to the passed remote object id.
821 */
822 heapSnapshotObjectId: HeapSnapshotObjectId;
823 }
824
825 interface GetObjectByHeapObjectIdReturnType {
826 /**
827 * Evaluation result.
828 */
829 result: Runtime.RemoteObject;
830 }
831
832 interface GetSamplingProfileReturnType {
833 /**
834 * Return the sampling profile being collected.
835 */
836 profile: SamplingHeapProfile;
837 }
838
839 interface StopSamplingReturnType {
840 /**
841 * Recorded sampling heap profile.
842 */
843 profile: SamplingHeapProfile;
844 }
845
846 interface AddHeapSnapshotChunkEventDataType {
847 chunk: string;
848 }
849
850 interface HeapStatsUpdateEventDataType {
851 /**
852 * An array of triplets. Each triplet describes a fragment. The first integer is the fragment
853 * index, the second integer is a total count of objects for the fragment, the third integer is
854 * a total size of the objects for the fragment.
855 */
856 statsUpdate: number[];
857 }
858
859 interface LastSeenObjectIdEventDataType {
860 lastSeenObjectId: number;
861 timestamp: number;
862 }
863
864 interface ReportHeapSnapshotProgressEventDataType {
865 done: number;
866 total: number;
867 finished?: boolean;
868 }
869 }
870
871 namespace Profiler {
872 /**
873 * Profile node. Holds callsite information, execution statistics and child nodes.
874 */
875 interface ProfileNode {
876 /**
877 * Unique id of the node.
878 */
879 id: number;
880 /**
881 * Function location.
882 */
883 callFrame: Runtime.CallFrame;
884 /**
885 * Number of samples where this node was on top of the call stack.
886 */
887 hitCount?: number;
888 /**
889 * Child node ids.
890 */
891 children?: number[];
892 /**
893 * The reason of being not optimized. The function may be deoptimized or marked as don't
894 * optimize.
895 */
896 deoptReason?: string;
897 /**
898 * An array of source position ticks.
899 */
900 positionTicks?: PositionTickInfo[];
901 }
902
903 /**
904 * Profile.
905 */
906 interface Profile {
907 /**
908 * The list of profile nodes. First item is the root node.
909 */
910 nodes: ProfileNode[];
911 /**
912 * Profiling start timestamp in microseconds.
913 */
914 startTime: number;
915 /**
916 * Profiling end timestamp in microseconds.
917 */
918 endTime: number;
919 /**
920 * Ids of samples top nodes.
921 */
922 samples?: number[];
923 /**
924 * Time intervals between adjacent samples in microseconds. The first delta is relative to the
925 * profile startTime.
926 */
927 timeDeltas?: number[];
928 }
929
930 /**
931 * Specifies a number of samples attributed to a certain source position.
932 */
933 interface PositionTickInfo {
934 /**
935 * Source line number (1-based).
936 */
937 line: number;
938 /**
939 * Number of samples attributed to the source line.
940 */
941 ticks: number;
942 }
943
944 /**
945 * Coverage data for a source range.
946 */
947 interface CoverageRange {
948 /**
949 * JavaScript script source offset for the range start.
950 */
951 startOffset: number;
952 /**
953 * JavaScript script source offset for the range end.
954 */
955 endOffset: number;
956 /**
957 * Collected execution count of the source range.
958 */
959 count: number;
960 }
961
962 /**
963 * Coverage data for a JavaScript function.
964 */
965 interface FunctionCoverage {
966 /**
967 * JavaScript function name.
968 */
969 functionName: string;
970 /**
971 * Source ranges inside the function with coverage data.
972 */
973 ranges: CoverageRange[];
974 /**
975 * Whether coverage data for this function has block granularity.
976 */
977 isBlockCoverage: boolean;
978 }
979
980 /**
981 * Coverage data for a JavaScript script.
982 */
983 interface ScriptCoverage {
984 /**
985 * JavaScript script id.
986 */
987 scriptId: Runtime.ScriptId;
988 /**
989 * JavaScript script name or url.
990 */
991 url: string;
992 /**
993 * Functions contained in the script that has coverage data.
994 */
995 functions: FunctionCoverage[];
996 }
997
998 /**
999 * Describes a type collected during runtime.
1000 * @experimental
1001 */
1002 interface TypeObject {
1003 /**
1004 * Name of a type collected with type profiling.
1005 */
1006 name: string;
1007 }
1008
1009 /**
1010 * Source offset and types for a parameter or return value.
1011 * @experimental
1012 */
1013 interface TypeProfileEntry {
1014 /**
1015 * Source offset of the parameter or end of function for return values.
1016 */
1017 offset: number;
1018 /**
1019 * The types for this parameter or return value.
1020 */
1021 types: TypeObject[];
1022 }
1023
1024 /**
1025 * Type profile data collected during runtime for a JavaScript script.
1026 * @experimental
1027 */
1028 interface ScriptTypeProfile {
1029 /**
1030 * JavaScript script id.
1031 */
1032 scriptId: Runtime.ScriptId;
1033 /**
1034 * JavaScript script name or url.
1035 */
1036 url: string;
1037 /**
1038 * Type profile entries for parameters and return values of the functions in the script.
1039 */
1040 entries: TypeProfileEntry[];
1041 }
1042
1043 interface SetSamplingIntervalParameterType {
1044 /**
1045 * New sampling interval in microseconds.
1046 */
1047 interval: number;
1048 }
1049
1050 interface StartPreciseCoverageParameterType {
1051 /**
1052 * Collect accurate call counts beyond simple 'covered' or 'not covered'.
1053 */
1054 callCount?: boolean;
1055 /**
1056 * Collect block-based coverage.
1057 */
1058 detailed?: boolean;
1059 }
1060
1061 interface GetBestEffortCoverageReturnType {
1062 /**
1063 * Coverage data for the current isolate.
1064 */
1065 result: ScriptCoverage[];
1066 }
1067
1068 interface StopReturnType {
1069 /**
1070 * Recorded profile.
1071 */
1072 profile: Profile;
1073 }
1074
1075 interface TakePreciseCoverageReturnType {
1076 /**
1077 * Coverage data for the current isolate.
1078 */
1079 result: ScriptCoverage[];
1080 }
1081
1082 interface TakeTypeProfileReturnType {
1083 /**
1084 * Type profile for all scripts since startTypeProfile() was turned on.
1085 */
1086 result: ScriptTypeProfile[];
1087 }
1088
1089 interface ConsoleProfileFinishedEventDataType {
1090 id: string;
1091 /**
1092 * Location of console.profileEnd().
1093 */
1094 location: Debugger.Location;
1095 profile: Profile;
1096 /**
1097 * Profile title passed as an argument to console.profile().
1098 */
1099 title?: string;
1100 }
1101
1102 interface ConsoleProfileStartedEventDataType {
1103 id: string;
1104 /**
1105 * Location of console.profile().
1106 */
1107 location: Debugger.Location;
1108 /**
1109 * Profile title passed as an argument to console.profile().
1110 */
1111 title?: string;
1112 }
1113 }
1114
1115 namespace Runtime {
1116 /**
1117 * Unique script identifier.
1118 */
1119 type ScriptId = string;
1120
1121 /**
1122 * Unique object identifier.
1123 */
1124 type RemoteObjectId = string;
1125
1126 /**
1127 * Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`,
1128 * `-Infinity`, and bigint literals.
1129 */
1130 type UnserializableValue = string;
1131
1132 /**
1133 * Mirror object referencing original JavaScript object.
1134 */
1135 interface RemoteObject {
1136 /**
1137 * Object type.
1138 */
1139 type: string;
1140 /**
1141 * Object subtype hint. Specified for `object` type values only.
1142 */
1143 subtype?: string;
1144 /**
1145 * Object class (constructor) name. Specified for `object` type values only.
1146 */
1147 className?: string;
1148 /**
1149 * Remote object value in case of primitive values or JSON values (if it was requested).
1150 */
1151 value?: any;
1152 /**
1153 * Primitive value which can not be JSON-stringified does not have `value`, but gets this
1154 * property.
1155 */
1156 unserializableValue?: UnserializableValue;
1157 /**
1158 * String representation of the object.
1159 */
1160 description?: string;
1161 /**
1162 * Unique object identifier (for non-primitive values).
1163 */
1164 objectId?: RemoteObjectId;
1165 /**
1166 * Preview containing abbreviated property values. Specified for `object` type values only.
1167 * @experimental
1168 */
1169 preview?: ObjectPreview;
1170 /**
1171 * @experimental
1172 */
1173 customPreview?: CustomPreview;
1174 }
1175
1176 /**
1177 * @experimental
1178 */
1179 interface CustomPreview {
1180 header: string;
1181 hasBody: boolean;
1182 formatterObjectId: RemoteObjectId;
1183 bindRemoteObjectFunctionId: RemoteObjectId;
1184 configObjectId?: RemoteObjectId;
1185 }
1186
1187 /**
1188 * Object containing abbreviated remote object value.
1189 * @experimental
1190 */
1191 interface ObjectPreview {
1192 /**
1193 * Object type.
1194 */
1195 type: string;
1196 /**
1197 * Object subtype hint. Specified for `object` type values only.
1198 */
1199 subtype?: string;
1200 /**
1201 * String representation of the object.
1202 */
1203 description?: string;
1204 /**
1205 * True iff some of the properties or entries of the original object did not fit.
1206 */
1207 overflow: boolean;
1208 /**
1209 * List of the properties.
1210 */
1211 properties: PropertyPreview[];
1212 /**
1213 * List of the entries. Specified for `map` and `set` subtype values only.
1214 */
1215 entries?: EntryPreview[];
1216 }
1217
1218 /**
1219 * @experimental
1220 */
1221 interface PropertyPreview {
1222 /**
1223 * Property name.
1224 */
1225 name: string;
1226 /**
1227 * Object type. Accessor means that the property itself is an accessor property.
1228 */
1229 type: string;
1230 /**
1231 * User-friendly property value string.
1232 */
1233 value?: string;
1234 /**
1235 * Nested value preview.
1236 */
1237 valuePreview?: ObjectPreview;
1238 /**
1239 * Object subtype hint. Specified for `object` type values only.
1240 */
1241 subtype?: string;
1242 }
1243
1244 /**
1245 * @experimental
1246 */
1247 interface EntryPreview {
1248 /**
1249 * Preview of the key. Specified for map-like collection entries.
1250 */
1251 key?: ObjectPreview;
1252 /**
1253 * Preview of the value.
1254 */
1255 value: ObjectPreview;
1256 }
1257
1258 /**
1259 * Object property descriptor.
1260 */
1261 interface PropertyDescriptor {
1262 /**
1263 * Property name or symbol description.
1264 */
1265 name: string;
1266 /**
1267 * The value associated with the property.
1268 */
1269 value?: RemoteObject;
1270 /**
1271 * True if the value associated with the property may be changed (data descriptors only).
1272 */
1273 writable?: boolean;
1274 /**
1275 * A function which serves as a getter for the property, or `undefined` if there is no getter
1276 * (accessor descriptors only).
1277 */
1278 get?: RemoteObject;
1279 /**
1280 * A function which serves as a setter for the property, or `undefined` if there is no setter
1281 * (accessor descriptors only).
1282 */
1283 set?: RemoteObject;
1284 /**
1285 * True if the type of this property descriptor may be changed and if the property may be
1286 * deleted from the corresponding object.
1287 */
1288 configurable: boolean;
1289 /**
1290 * True if this property shows up during enumeration of the properties on the corresponding
1291 * object.
1292 */
1293 enumerable: boolean;
1294 /**
1295 * True if the result was thrown during the evaluation.
1296 */
1297 wasThrown?: boolean;
1298 /**
1299 * True if the property is owned for the object.
1300 */
1301 isOwn?: boolean;
1302 /**
1303 * Property symbol object, if the property is of the `symbol` type.
1304 */
1305 symbol?: RemoteObject;
1306 }
1307
1308 /**
1309 * Object internal property descriptor. This property isn't normally visible in JavaScript code.
1310 */
1311 interface InternalPropertyDescriptor {
1312 /**
1313 * Conventional property name.
1314 */
1315 name: string;
1316 /**
1317 * The value associated with the property.
1318 */
1319 value?: RemoteObject;
1320 }
1321
1322 /**
1323 * Represents function call argument. Either remote object id `objectId`, primitive `value`,
1324 * unserializable primitive value or neither of (for undefined) them should be specified.
1325 */
1326 interface CallArgument {
1327 /**
1328 * Primitive value or serializable javascript object.
1329 */
1330 value?: any;
1331 /**
1332 * Primitive value which can not be JSON-stringified.
1333 */
1334 unserializableValue?: UnserializableValue;
1335 /**
1336 * Remote object handle.
1337 */
1338 objectId?: RemoteObjectId;
1339 }
1340
1341 /**
1342 * Id of an execution context.
1343 */
1344 type ExecutionContextId = number;
1345
1346 /**
1347 * Description of an isolated world.
1348 */
1349 interface ExecutionContextDescription {
1350 /**
1351 * Unique id of the execution context. It can be used to specify in which execution context
1352 * script evaluation should be performed.
1353 */
1354 id: ExecutionContextId;
1355 /**
1356 * Execution context origin.
1357 */
1358 origin: string;
1359 /**
1360 * Human readable name describing given context.
1361 */
1362 name: string;
1363 /**
1364 * Embedder-specific auxiliary data.
1365 */
1366 auxData?: {};
1367 }
1368
1369 /**
1370 * Detailed information about exception (or error) that was thrown during script compilation or
1371 * execution.
1372 */
1373 interface ExceptionDetails {
1374 /**
1375 * Exception id.
1376 */
1377 exceptionId: number;
1378 /**
1379 * Exception text, which should be used together with exception object when available.
1380 */
1381 text: string;
1382 /**
1383 * Line number of the exception location (0-based).
1384 */
1385 lineNumber: number;
1386 /**
1387 * Column number of the exception location (0-based).
1388 */
1389 columnNumber: number;
1390 /**
1391 * Script ID of the exception location.
1392 */
1393 scriptId?: ScriptId;
1394 /**
1395 * URL of the exception location, to be used when the script was not reported.
1396 */
1397 url?: string;
1398 /**
1399 * JavaScript stack trace if available.
1400 */
1401 stackTrace?: StackTrace;
1402 /**
1403 * Exception object if available.
1404 */
1405 exception?: RemoteObject;
1406 /**
1407 * Identifier of the context where exception happened.
1408 */
1409 executionContextId?: ExecutionContextId;
1410 }
1411
1412 /**
1413 * Number of milliseconds since epoch.
1414 */
1415 type Timestamp = number;
1416
1417 /**
1418 * Number of milliseconds.
1419 */
1420 type TimeDelta = number;
1421
1422 /**
1423 * Stack entry for runtime errors and assertions.
1424 */
1425 interface CallFrame {
1426 /**
1427 * JavaScript function name.
1428 */
1429 functionName: string;
1430 /**
1431 * JavaScript script id.
1432 */
1433 scriptId: ScriptId;
1434 /**
1435 * JavaScript script name or url.
1436 */
1437 url: string;
1438 /**
1439 * JavaScript script line number (0-based).
1440 */
1441 lineNumber: number;
1442 /**
1443 * JavaScript script column number (0-based).
1444 */
1445 columnNumber: number;
1446 }
1447
1448 /**
1449 * Call frames for assertions or error messages.
1450 */
1451 interface StackTrace {
1452 /**
1453 * String label of this stack trace. For async traces this may be a name of the function that
1454 * initiated the async call.
1455 */
1456 description?: string;
1457 /**
1458 * JavaScript function name.
1459 */
1460 callFrames: CallFrame[];
1461 /**
1462 * Asynchronous JavaScript stack trace that preceded this stack, if available.
1463 */
1464 parent?: StackTrace;
1465 /**
1466 * Asynchronous JavaScript stack trace that preceded this stack, if available.
1467 * @experimental
1468 */
1469 parentId?: StackTraceId;
1470 }
1471
1472 /**
1473 * Unique identifier of current debugger.
1474 * @experimental
1475 */
1476 type UniqueDebuggerId = string;
1477
1478 /**
1479 * If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This
1480 * allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.
1481 * @experimental
1482 */
1483 interface StackTraceId {
1484 id: string;
1485 debuggerId?: UniqueDebuggerId;
1486 }
1487
1488 interface AwaitPromiseParameterType {
1489 /**
1490 * Identifier of the promise.
1491 */
1492 promiseObjectId: RemoteObjectId;
1493 /**
1494 * Whether the result is expected to be a JSON object that should be sent by value.
1495 */
1496 returnByValue?: boolean;
1497 /**
1498 * Whether preview should be generated for the result.
1499 */
1500 generatePreview?: boolean;
1501 }
1502
1503 interface CallFunctionOnParameterType {
1504 /**
1505 * Declaration of the function to call.
1506 */
1507 functionDeclaration: string;
1508 /**
1509 * Identifier of the object to call function on. Either objectId or executionContextId should
1510 * be specified.
1511 */
1512 objectId?: RemoteObjectId;
1513 /**
1514 * Call arguments. All call arguments must belong to the same JavaScript world as the target
1515 * object.
1516 */
1517 arguments?: CallArgument[];
1518 /**
1519 * In silent mode exceptions thrown during evaluation are not reported and do not pause
1520 * execution. Overrides `setPauseOnException` state.
1521 */
1522 silent?: boolean;
1523 /**
1524 * Whether the result is expected to be a JSON object which should be sent by value.
1525 */
1526 returnByValue?: boolean;
1527 /**
1528 * Whether preview should be generated for the result.
1529 * @experimental
1530 */
1531 generatePreview?: boolean;
1532 /**
1533 * Whether execution should be treated as initiated by user in the UI.
1534 */
1535 userGesture?: boolean;
1536 /**
1537 * Whether execution should `await` for resulting value and return once awaited promise is
1538 * resolved.
1539 */
1540 awaitPromise?: boolean;
1541 /**
1542 * Specifies execution context which global object will be used to call function on. Either
1543 * executionContextId or objectId should be specified.
1544 */
1545 executionContextId?: ExecutionContextId;
1546 /**
1547 * Symbolic group name that can be used to release multiple objects. If objectGroup is not
1548 * specified and objectId is, objectGroup will be inherited from object.
1549 */
1550 objectGroup?: string;
1551 }
1552
1553 interface CompileScriptParameterType {
1554 /**
1555 * Expression to compile.
1556 */
1557 expression: string;
1558 /**
1559 * Source url to be set for the script.
1560 */
1561 sourceURL: string;
1562 /**
1563 * Specifies whether the compiled script should be persisted.
1564 */
1565 persistScript: boolean;
1566 /**
1567 * Specifies in which execution context to perform script run. If the parameter is omitted the
1568 * evaluation will be performed in the context of the inspected page.
1569 */
1570 executionContextId?: ExecutionContextId;
1571 }
1572
1573 interface EvaluateParameterType {
1574 /**
1575 * Expression to evaluate.
1576 */
1577 expression: string;
1578 /**
1579 * Symbolic group name that can be used to release multiple objects.
1580 */
1581 objectGroup?: string;
1582 /**
1583 * Determines whether Command Line API should be available during the evaluation.
1584 */
1585 includeCommandLineAPI?: boolean;
1586 /**
1587 * In silent mode exceptions thrown during evaluation are not reported and do not pause
1588 * execution. Overrides `setPauseOnException` state.
1589 */
1590 silent?: boolean;
1591 /**
1592 * Specifies in which execution context to perform evaluation. If the parameter is omitted the
1593 * evaluation will be performed in the context of the inspected page.
1594 */
1595 contextId?: ExecutionContextId;
1596 /**
1597 * Whether the result is expected to be a JSON object that should be sent by value.
1598 */
1599 returnByValue?: boolean;
1600 /**
1601 * Whether preview should be generated for the result.
1602 * @experimental
1603 */
1604 generatePreview?: boolean;
1605 /**
1606 * Whether execution should be treated as initiated by user in the UI.
1607 */
1608 userGesture?: boolean;
1609 /**
1610 * Whether execution should `await` for resulting value and return once awaited promise is
1611 * resolved.
1612 */
1613 awaitPromise?: boolean;
1614 /**
1615 * Whether to throw an exception if side effect cannot be ruled out during evaluation.
1616 * @experimental
1617 */
1618 throwOnSideEffect?: boolean;
1619 /**
1620 * Terminate execution after timing out (number of milliseconds).
1621 * @experimental
1622 */
1623 timeout?: TimeDelta;
1624 }
1625
1626 interface GetPropertiesParameterType {
1627 /**
1628 * Identifier of the object to return properties for.
1629 */
1630 objectId: RemoteObjectId;
1631 /**
1632 * If true, returns properties belonging only to the element itself, not to its prototype
1633 * chain.
1634 */
1635 ownProperties?: boolean;
1636 /**
1637 * If true, returns accessor properties (with getter/setter) only; internal properties are not
1638 * returned either.
1639 * @experimental
1640 */
1641 accessorPropertiesOnly?: boolean;
1642 /**
1643 * Whether preview should be generated for the results.
1644 * @experimental
1645 */
1646 generatePreview?: boolean;
1647 }
1648
1649 interface GlobalLexicalScopeNamesParameterType {
1650 /**
1651 * Specifies in which execution context to lookup global scope variables.
1652 */
1653 executionContextId?: ExecutionContextId;
1654 }
1655
1656 interface QueryObjectsParameterType {
1657 /**
1658 * Identifier of the prototype to return objects for.
1659 */
1660 prototypeObjectId: RemoteObjectId;
1661 /**
1662 * Symbolic group name that can be used to release the results.
1663 */
1664 objectGroup?: string;
1665 }
1666
1667 interface ReleaseObjectParameterType {
1668 /**
1669 * Identifier of the object to release.
1670 */
1671 objectId: RemoteObjectId;
1672 }
1673
1674 interface ReleaseObjectGroupParameterType {
1675 /**
1676 * Symbolic object group name.
1677 */
1678 objectGroup: string;
1679 }
1680
1681 interface RunScriptParameterType {
1682 /**
1683 * Id of the script to run.
1684 */
1685 scriptId: ScriptId;
1686 /**
1687 * Specifies in which execution context to perform script run. If the parameter is omitted the
1688 * evaluation will be performed in the context of the inspected page.
1689 */
1690 executionContextId?: ExecutionContextId;
1691 /**
1692 * Symbolic group name that can be used to release multiple objects.
1693 */
1694 objectGroup?: string;
1695 /**
1696 * In silent mode exceptions thrown during evaluation are not reported and do not pause
1697 * execution. Overrides `setPauseOnException` state.
1698 */
1699 silent?: boolean;
1700 /**
1701 * Determines whether Command Line API should be available during the evaluation.
1702 */
1703 includeCommandLineAPI?: boolean;
1704 /**
1705 * Whether the result is expected to be a JSON object which should be sent by value.
1706 */
1707 returnByValue?: boolean;
1708 /**
1709 * Whether preview should be generated for the result.
1710 */
1711 generatePreview?: boolean;
1712 /**
1713 * Whether execution should `await` for resulting value and return once awaited promise is
1714 * resolved.
1715 */
1716 awaitPromise?: boolean;
1717 }
1718
1719 interface SetCustomObjectFormatterEnabledParameterType {
1720 enabled: boolean;
1721 }
1722
1723 interface AwaitPromiseReturnType {
1724 /**
1725 * Promise result. Will contain rejected value if promise was rejected.
1726 */
1727 result: RemoteObject;
1728 /**
1729 * Exception details if stack strace is available.
1730 */
1731 exceptionDetails?: ExceptionDetails;
1732 }
1733
1734 interface CallFunctionOnReturnType {
1735 /**
1736 * Call result.
1737 */
1738 result: RemoteObject;
1739 /**
1740 * Exception details.
1741 */
1742 exceptionDetails?: ExceptionDetails;
1743 }
1744
1745 interface CompileScriptReturnType {
1746 /**
1747 * Id of the script.
1748 */
1749 scriptId?: ScriptId;
1750 /**
1751 * Exception details.
1752 */
1753 exceptionDetails?: ExceptionDetails;
1754 }
1755
1756 interface EvaluateReturnType {
1757 /**
1758 * Evaluation result.
1759 */
1760 result: RemoteObject;
1761 /**
1762 * Exception details.
1763 */
1764 exceptionDetails?: ExceptionDetails;
1765 }
1766
1767 interface GetIsolateIdReturnType {
1768 /**
1769 * The isolate id.
1770 */
1771 id: string;
1772 }
1773
1774 interface GetHeapUsageReturnType {
1775 /**
1776 * Used heap size in bytes.
1777 */
1778 usedSize: number;
1779 /**
1780 * Allocated heap size in bytes.
1781 */
1782 totalSize: number;
1783 }
1784
1785 interface GetPropertiesReturnType {
1786 /**
1787 * Object properties.
1788 */
1789 result: PropertyDescriptor[];
1790 /**
1791 * Internal object properties (only of the element itself).
1792 */
1793 internalProperties?: InternalPropertyDescriptor[];
1794 /**
1795 * Exception details.
1796 */
1797 exceptionDetails?: ExceptionDetails;
1798 }
1799
1800 interface GlobalLexicalScopeNamesReturnType {
1801 names: string[];
1802 }
1803
1804 interface QueryObjectsReturnType {
1805 /**
1806 * Array with objects.
1807 */
1808 objects: RemoteObject;
1809 }
1810
1811 interface RunScriptReturnType {
1812 /**
1813 * Run result.
1814 */
1815 result: RemoteObject;
1816 /**
1817 * Exception details.
1818 */
1819 exceptionDetails?: ExceptionDetails;
1820 }
1821
1822 interface ConsoleAPICalledEventDataType {
1823 /**
1824 * Type of the call.
1825 */
1826 type: string;
1827 /**
1828 * Call arguments.
1829 */
1830 args: RemoteObject[];
1831 /**
1832 * Identifier of the context where the call was made.
1833 */
1834 executionContextId: ExecutionContextId;
1835 /**
1836 * Call timestamp.
1837 */
1838 timestamp: Timestamp;
1839 /**
1840 * Stack trace captured when the call was made.
1841 */
1842 stackTrace?: StackTrace;
1843 /**
1844 * Console context descriptor for calls on non-default console context (not console.*):
1845 * 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call
1846 * on named context.
1847 * @experimental
1848 */
1849 context?: string;
1850 }
1851
1852 interface ExceptionRevokedEventDataType {
1853 /**
1854 * Reason describing why exception was revoked.
1855 */
1856 reason: string;
1857 /**
1858 * The id of revoked exception, as reported in `exceptionThrown`.
1859 */
1860 exceptionId: number;
1861 }
1862
1863 interface ExceptionThrownEventDataType {
1864 /**
1865 * Timestamp of the exception.
1866 */
1867 timestamp: Timestamp;
1868 exceptionDetails: ExceptionDetails;
1869 }
1870
1871 interface ExecutionContextCreatedEventDataType {
1872 /**
1873 * A newly created execution context.
1874 */
1875 context: ExecutionContextDescription;
1876 }
1877
1878 interface ExecutionContextDestroyedEventDataType {
1879 /**
1880 * Id of the destroyed context
1881 */
1882 executionContextId: ExecutionContextId;
1883 }
1884
1885 interface InspectRequestedEventDataType {
1886 object: RemoteObject;
1887 hints: {};
1888 }
1889 }
1890
1891 namespace Schema {
1892 /**
1893 * Description of the protocol domain.
1894 */
1895 interface Domain {
1896 /**
1897 * Domain name.
1898 */
1899 name: string;
1900 /**
1901 * Domain version.
1902 */
1903 version: string;
1904 }
1905
1906 interface GetDomainsReturnType {
1907 /**
1908 * List of supported domains.
1909 */
1910 domains: Domain[];
1911 }
1912 }
1913
1914 namespace NodeTracing {
1915 interface TraceConfig {
1916 /**
1917 * Controls how the trace buffer stores data.
1918 */
1919 recordMode?: string;
1920 /**
1921 * Included category filters.
1922 */
1923 includedCategories: string[];
1924 }
1925
1926 interface StartParameterType {
1927 traceConfig: TraceConfig;
1928 }
1929
1930 interface GetCategoriesReturnType {
1931 /**
1932 * A list of supported tracing categories.
1933 */
1934 categories: string[];
1935 }
1936
1937 interface DataCollectedEventDataType {
1938 value: Array<{}>;
1939 }
1940 }
1941
1942 namespace NodeWorker {
1943 type WorkerID = string;
1944
1945 /**
1946 * Unique identifier of attached debugging session.
1947 */
1948 type SessionID = string;
1949
1950 interface WorkerInfo {
1951 workerId: WorkerID;
1952 type: string;
1953 title: string;
1954 url: string;
1955 }
1956
1957 interface SendMessageToWorkerParameterType {
1958 message: string;
1959 /**
1960 * Identifier of the session.
1961 */
1962 sessionId: SessionID;
1963 }
1964
1965 interface EnableParameterType {
1966 /**
1967 * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
1968 * message to run them.
1969 */
1970 waitForDebuggerOnStart: boolean;
1971 }
1972
1973 interface AttachedToWorkerEventDataType {
1974 /**
1975 * Identifier assigned to the session used to send/receive messages.
1976 */
1977 sessionId: SessionID;
1978 workerInfo: WorkerInfo;
1979 waitingForDebugger: boolean;
1980 }
1981
1982 interface DetachedFromWorkerEventDataType {
1983 /**
1984 * Detached session identifier.
1985 */
1986 sessionId: SessionID;
1987 }
1988
1989 interface ReceivedMessageFromWorkerEventDataType {
1990 /**
1991 * Identifier of a session which sends a message.
1992 */
1993 sessionId: SessionID;
1994 message: string;
1995 }
1996 }
1997
1998 /**
1999 * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.
2000 */
2001 class Session extends EventEmitter {
2002 /**
2003 * Create a new instance of the inspector.Session class.
2004 * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend.
2005 */
2006 constructor();
2007
2008 /**
2009 * Connects a session to the inspector back-end.
2010 * An exception will be thrown if there is already a connected session established either
2011 * through the API or by a front-end connected to the Inspector WebSocket port.
2012 */
2013 connect(): void;
2014
2015 /**
2016 * Immediately close the session. All pending message callbacks will be called with an error.
2017 * session.connect() will need to be called to be able to send messages again.
2018 * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
2019 */
2020 disconnect(): void;
2021
2022 /**
2023 * Posts a message to the inspector back-end. callback will be notified when a response is received.
2024 * callback is a function that accepts two optional arguments - error and message-specific result.
2025 */
2026 post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void;
2027 post(method: string, callback?: (err: Error | null, params?: {}) => void): void;
2028
2029 /**
2030 * Does nothing.
2031 */
2032 post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void;
2033
2034 /**
2035 * Disables console domain, prevents further console messages from being reported to the client.
2036 */
2037 post(method: "Console.disable", callback?: (err: Error | null) => void): void;
2038
2039 /**
2040 * Enables console domain, sends the messages collected so far to the client by means of the
2041 * `messageAdded` notification.
2042 */
2043 post(method: "Console.enable", callback?: (err: Error | null) => void): void;
2044
2045 /**
2046 * Continues execution until specific location is reached.
2047 */
2048 post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void;
2049 post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void;
2050
2051 /**
2052 * Disables debugger for given page.
2053 */
2054 post(method: "Debugger.disable", callback?: (err: Error | null) => void): void;
2055
2056 /**
2057 * Enables debugger for the given page. Clients should not assume that the debugging has been
2058 * enabled until the result for this command is received.
2059 */
2060 post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void;
2061
2062 /**
2063 * Evaluates expression on a given call frame.
2064 */
2065 post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
2066 post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
2067
2068 /**
2069 * Returns possible locations for breakpoint. scriptId in start and end range locations should be
2070 * the same.
2071 */
2072 post(
2073 method: "Debugger.getPossibleBreakpoints",
2074 params?: Debugger.GetPossibleBreakpointsParameterType,
2075 callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void
2076 ): void;
2077 post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void;
2078
2079 /**
2080 * Returns source for the script with given id.
2081 */
2082 post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
2083 post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
2084
2085 /**
2086 * Returns stack trace with given `stackTraceId`.
2087 * @experimental
2088 */
2089 post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
2090 post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
2091
2092 /**
2093 * Stops on the next JavaScript statement.
2094 */
2095 post(method: "Debugger.pause", callback?: (err: Error | null) => void): void;
2096
2097 /**
2098 * @experimental
2099 */
2100 post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void;
2101 post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void;
2102
2103 /**
2104 * Removes JavaScript breakpoint.
2105 */
2106 post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void;
2107 post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void;
2108
2109 /**
2110 * Restarts particular call frame from the beginning.
2111 */
2112 post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
2113 post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
2114
2115 /**
2116 * Resumes JavaScript execution.
2117 */
2118 post(method: "Debugger.resume", callback?: (err: Error | null) => void): void;
2119
2120 /**
2121 * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and
2122 * Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled
2123 * before next pause. Returns success when async task is actually scheduled, returns error if no
2124 * task were scheduled or another scheduleStepIntoAsync was called.
2125 * @experimental
2126 */
2127 post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void;
2128
2129 /**
2130 * Searches for given string in script content.
2131 */
2132 post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
2133 post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
2134
2135 /**
2136 * Enables or disables async call stacks tracking.
2137 */
2138 post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
2139 post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void;
2140
2141 /**
2142 * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
2143 * scripts with url matching one of the patterns. VM will try to leave blackboxed script by
2144 * performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
2145 * @experimental
2146 */
2147 post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void;
2148 post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void;
2149
2150 /**
2151 * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
2152 * scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
2153 * Positions array contains positions where blackbox state is changed. First interval isn't
2154 * blackboxed. Array should be sorted.
2155 * @experimental
2156 */
2157 post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void;
2158 post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void;
2159
2160 /**
2161 * Sets JavaScript breakpoint at a given location.
2162 */
2163 post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
2164 post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
2165
2166 /**
2167 * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
2168 * command is issued, all existing parsed scripts will have breakpoints resolved and returned in
2169 * `locations` property. Further matching script parsing will result in subsequent
2170 * `breakpointResolved` events issued. This logical breakpoint will survive page reloads.
2171 */
2172 post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
2173 post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
2174
2175 /**
2176 * Sets JavaScript breakpoint before each call to the given function.
2177 * If another function was created from the same source as a given one,
2178 * calling it will also trigger the breakpoint.
2179 * @experimental
2180 */
2181 post(
2182 method: "Debugger.setBreakpointOnFunctionCall",
2183 params?: Debugger.SetBreakpointOnFunctionCallParameterType,
2184 callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void
2185 ): void;
2186 post(method: "Debugger.setBreakpointOnFunctionCall", callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void): void;
2187
2188 /**
2189 * Activates / deactivates all breakpoints on the page.
2190 */
2191 post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void;
2192 post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void;
2193
2194 /**
2195 * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or
2196 * no exceptions. Initial pause on exceptions state is `none`.
2197 */
2198 post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void;
2199 post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void;
2200
2201 /**
2202 * Changes return value in top frame. Available only at return break position.
2203 * @experimental
2204 */
2205 post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void;
2206 post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void;
2207
2208 /**
2209 * Edits JavaScript source live.
2210 */
2211 post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
2212 post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
2213
2214 /**
2215 * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
2216 */
2217 post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void;
2218 post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void;
2219
2220 /**
2221 * Changes value of variable in a callframe. Object-based scopes are not supported and must be
2222 * mutated manually.
2223 */
2224 post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void;
2225 post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void;
2226
2227 /**
2228 * Steps into the function call.
2229 */
2230 post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void;
2231 post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void;
2232
2233 /**
2234 * Steps out of the function call.
2235 */
2236 post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void;
2237
2238 /**
2239 * Steps over the statement.
2240 */
2241 post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void;
2242
2243 /**
2244 * Enables console to refer to the node with given id via $x (see Command Line API for more details
2245 * $x functions).
2246 */
2247 post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void;
2248 post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void;
2249
2250 post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void;
2251
2252 post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void;
2253
2254 post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void;
2255
2256 post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
2257 post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
2258
2259 post(
2260 method: "HeapProfiler.getObjectByHeapObjectId",
2261 params?: HeapProfiler.GetObjectByHeapObjectIdParameterType,
2262 callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void
2263 ): void;
2264 post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void;
2265
2266 post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
2267
2268 post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void;
2269 post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void;
2270
2271 post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
2272 post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void;
2273
2274 post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void;
2275
2276 post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
2277 post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void;
2278
2279 post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void;
2280 post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void;
2281
2282 post(method: "Profiler.disable", callback?: (err: Error | null) => void): void;
2283
2284 post(method: "Profiler.enable", callback?: (err: Error | null) => void): void;
2285
2286 /**
2287 * Collect coverage data for the current isolate. The coverage data may be incomplete due to
2288 * garbage collection.
2289 */
2290 post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void;
2291
2292 /**
2293 * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
2294 */
2295 post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void;
2296 post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void;
2297
2298 post(method: "Profiler.start", callback?: (err: Error | null) => void): void;
2299
2300 /**
2301 * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
2302 * coverage may be incomplete. Enabling prevents running optimized code and resets execution
2303 * counters.
2304 */
2305 post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void;
2306 post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void;
2307
2308 /**
2309 * Enable type profile.
2310 * @experimental
2311 */
2312 post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void;
2313
2314 post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void;
2315
2316 /**
2317 * Disable precise code coverage. Disabling releases unnecessary execution count records and allows
2318 * executing optimized code.
2319 */
2320 post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void;
2321
2322 /**
2323 * Disable type profile. Disabling releases type profile data collected so far.
2324 * @experimental
2325 */
2326 post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void;
2327
2328 /**
2329 * Collect coverage data for the current isolate, and resets execution counters. Precise code
2330 * coverage needs to have started.
2331 */
2332 post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void;
2333
2334 /**
2335 * Collect type profile.
2336 * @experimental
2337 */
2338 post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void;
2339
2340 /**
2341 * Add handler to promise with given promise object id.
2342 */
2343 post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
2344 post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
2345
2346 /**
2347 * Calls function with given declaration on the given object. Object group of the result is
2348 * inherited from the target object.
2349 */
2350 post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
2351 post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
2352
2353 /**
2354 * Compiles expression.
2355 */
2356 post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
2357 post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
2358
2359 /**
2360 * Disables reporting of execution contexts creation.
2361 */
2362 post(method: "Runtime.disable", callback?: (err: Error | null) => void): void;
2363
2364 /**
2365 * Discards collected exceptions and console API calls.
2366 */
2367 post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void;
2368
2369 /**
2370 * Enables reporting of execution contexts creation by means of `executionContextCreated` event.
2371 * When the reporting gets enabled the event will be sent immediately for each existing execution
2372 * context.
2373 */
2374 post(method: "Runtime.enable", callback?: (err: Error | null) => void): void;
2375
2376 /**
2377 * Evaluates expression on global object.
2378 */
2379 post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
2380 post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
2381
2382 /**
2383 * Returns the isolate id.
2384 * @experimental
2385 */
2386 post(method: "Runtime.getIsolateId", callback?: (err: Error | null, params: Runtime.GetIsolateIdReturnType) => void): void;
2387
2388 /**
2389 * Returns the JavaScript heap usage.
2390 * It is the total usage of the corresponding isolate not scoped to a particular Runtime.
2391 * @experimental
2392 */
2393 post(method: "Runtime.getHeapUsage", callback?: (err: Error | null, params: Runtime.GetHeapUsageReturnType) => void): void;
2394
2395 /**
2396 * Returns properties of a given object. Object group of the result is inherited from the target
2397 * object.
2398 */
2399 post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
2400 post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
2401
2402 /**
2403 * Returns all let, const and class variables from global scope.
2404 */
2405 post(
2406 method: "Runtime.globalLexicalScopeNames",
2407 params?: Runtime.GlobalLexicalScopeNamesParameterType,
2408 callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void
2409 ): void;
2410 post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
2411
2412 post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
2413 post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
2414
2415 /**
2416 * Releases remote object with given id.
2417 */
2418 post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void;
2419 post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void;
2420
2421 /**
2422 * Releases all remote objects that belong to a given group.
2423 */
2424 post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void;
2425 post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void;
2426
2427 /**
2428 * Tells inspected instance to run if it was waiting for debugger to attach.
2429 */
2430 post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void;
2431
2432 /**
2433 * Runs script with given id in a given context.
2434 */
2435 post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
2436 post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
2437
2438 /**
2439 * @experimental
2440 */
2441 post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void;
2442 post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void;
2443
2444 /**
2445 * Terminate current or next JavaScript execution.
2446 * Will cancel the termination when the outer-most script execution ends.
2447 * @experimental
2448 */
2449 post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void;
2450
2451 /**
2452 * Returns supported domains.
2453 */
2454 post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void;
2455
2456 /**
2457 * Gets supported tracing categories.
2458 */
2459 post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
2460
2461 /**
2462 * Start trace events collection.
2463 */
2464 post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
2465 post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void;
2466
2467 /**
2468 * Stop trace events collection. Remaining collected events will be sent as a sequence of
2469 * dataCollected events followed by tracingComplete event.
2470 */
2471 post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void;
2472
2473 /**
2474 * Sends protocol message over session with given id.
2475 */
2476 post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
2477 post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void;
2478
2479 /**
2480 * Instructs the inspector to attach to running workers. Will also attach to new workers
2481 * as they start
2482 */
2483 post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
2484 post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void;
2485
2486 /**
2487 * Detaches from all running workers and disables attaching to new workers as they are started.
2488 */
2489 post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void;
2490
2491 // Events
2492
2493 addListener(event: string, listener: (...args: any[]) => void): this;
2494
2495 /**
2496 * Emitted when any notification from the V8 Inspector is received.
2497 */
2498 addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2499
2500 /**
2501 * Issued when new console message is added.
2502 */
2503 addListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2504
2505 /**
2506 * Fired when breakpoint is resolved to an actual script and location.
2507 */
2508 addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2509
2510 /**
2511 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2512 */
2513 addListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2514
2515 /**
2516 * Fired when the virtual machine resumed execution.
2517 */
2518 addListener(event: "Debugger.resumed", listener: () => void): this;
2519
2520 /**
2521 * Fired when virtual machine fails to parse the script.
2522 */
2523 addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2524
2525 /**
2526 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2527 * scripts upon enabling debugger.
2528 */
2529 addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2530
2531 addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2532
2533 /**
2534 * If heap objects tracking has been started then backend may send update for one or more fragments
2535 */
2536 addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2537
2538 /**
2539 * If heap objects tracking has been started then backend regularly sends a current value for last
2540 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2541 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2542 */
2543 addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2544
2545 addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2546 addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2547 addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2548
2549 /**
2550 * Sent when new profile recording is started using console.profile() call.
2551 */
2552 addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2553
2554 /**
2555 * Issued when console API was called.
2556 */
2557 addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2558
2559 /**
2560 * Issued when unhandled exception was revoked.
2561 */
2562 addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2563
2564 /**
2565 * Issued when exception was thrown and unhandled.
2566 */
2567 addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2568
2569 /**
2570 * Issued when new execution context is created.
2571 */
2572 addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2573
2574 /**
2575 * Issued when execution context is destroyed.
2576 */
2577 addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2578
2579 /**
2580 * Issued when all executionContexts were cleared in browser
2581 */
2582 addListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
2583
2584 /**
2585 * Issued when object should be inspected (for example, as a result of inspect() command line API
2586 * call).
2587 */
2588 addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2589
2590 /**
2591 * Contains an bucket of collected trace events.
2592 */
2593 addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2594
2595 /**
2596 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2597 * delivered via dataCollected events.
2598 */
2599 addListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
2600
2601 /**
2602 * Issued when attached to a worker.
2603 */
2604 addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2605
2606 /**
2607 * Issued when detached from the worker.
2608 */
2609 addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2610
2611 /**
2612 * Notifies about a new protocol message received from the session
2613 * (session ID is provided in attachedToWorker notification).
2614 */
2615 addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2616
2617 emit(event: string | symbol, ...args: any[]): boolean;
2618 emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean;
2619 emit(event: "Console.messageAdded", message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
2620 emit(event: "Debugger.breakpointResolved", message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
2621 emit(event: "Debugger.paused", message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
2622 emit(event: "Debugger.resumed"): boolean;
2623 emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
2624 emit(event: "Debugger.scriptParsed", message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
2625 emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
2626 emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
2627 emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
2628 emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
2629 emit(event: "HeapProfiler.resetProfiles"): boolean;
2630 emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
2631 emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
2632 emit(event: "Runtime.consoleAPICalled", message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
2633 emit(event: "Runtime.exceptionRevoked", message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
2634 emit(event: "Runtime.exceptionThrown", message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
2635 emit(event: "Runtime.executionContextCreated", message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
2636 emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
2637 emit(event: "Runtime.executionContextsCleared"): boolean;
2638 emit(event: "Runtime.inspectRequested", message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
2639 emit(event: "NodeTracing.dataCollected", message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
2640 emit(event: "NodeTracing.tracingComplete"): boolean;
2641 emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
2642 emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
2643 emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
2644
2645 on(event: string, listener: (...args: any[]) => void): this;
2646
2647 /**
2648 * Emitted when any notification from the V8 Inspector is received.
2649 */
2650 on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2651
2652 /**
2653 * Issued when new console message is added.
2654 */
2655 on(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2656
2657 /**
2658 * Fired when breakpoint is resolved to an actual script and location.
2659 */
2660 on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2661
2662 /**
2663 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2664 */
2665 on(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2666
2667 /**
2668 * Fired when the virtual machine resumed execution.
2669 */
2670 on(event: "Debugger.resumed", listener: () => void): this;
2671
2672 /**
2673 * Fired when virtual machine fails to parse the script.
2674 */
2675 on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2676
2677 /**
2678 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2679 * scripts upon enabling debugger.
2680 */
2681 on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2682
2683 on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2684
2685 /**
2686 * If heap objects tracking has been started then backend may send update for one or more fragments
2687 */
2688 on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2689
2690 /**
2691 * If heap objects tracking has been started then backend regularly sends a current value for last
2692 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2693 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2694 */
2695 on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2696
2697 on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2698 on(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2699 on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2700
2701 /**
2702 * Sent when new profile recording is started using console.profile() call.
2703 */
2704 on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2705
2706 /**
2707 * Issued when console API was called.
2708 */
2709 on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2710
2711 /**
2712 * Issued when unhandled exception was revoked.
2713 */
2714 on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2715
2716 /**
2717 * Issued when exception was thrown and unhandled.
2718 */
2719 on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2720
2721 /**
2722 * Issued when new execution context is created.
2723 */
2724 on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2725
2726 /**
2727 * Issued when execution context is destroyed.
2728 */
2729 on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2730
2731 /**
2732 * Issued when all executionContexts were cleared in browser
2733 */
2734 on(event: "Runtime.executionContextsCleared", listener: () => void): this;
2735
2736 /**
2737 * Issued when object should be inspected (for example, as a result of inspect() command line API
2738 * call).
2739 */
2740 on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2741
2742 /**
2743 * Contains an bucket of collected trace events.
2744 */
2745 on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2746
2747 /**
2748 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2749 * delivered via dataCollected events.
2750 */
2751 on(event: "NodeTracing.tracingComplete", listener: () => void): this;
2752
2753 /**
2754 * Issued when attached to a worker.
2755 */
2756 on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2757
2758 /**
2759 * Issued when detached from the worker.
2760 */
2761 on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2762
2763 /**
2764 * Notifies about a new protocol message received from the session
2765 * (session ID is provided in attachedToWorker notification).
2766 */
2767 on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2768
2769 once(event: string, listener: (...args: any[]) => void): this;
2770
2771 /**
2772 * Emitted when any notification from the V8 Inspector is received.
2773 */
2774 once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2775
2776 /**
2777 * Issued when new console message is added.
2778 */
2779 once(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2780
2781 /**
2782 * Fired when breakpoint is resolved to an actual script and location.
2783 */
2784 once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2785
2786 /**
2787 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2788 */
2789 once(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2790
2791 /**
2792 * Fired when the virtual machine resumed execution.
2793 */
2794 once(event: "Debugger.resumed", listener: () => void): this;
2795
2796 /**
2797 * Fired when virtual machine fails to parse the script.
2798 */
2799 once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2800
2801 /**
2802 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2803 * scripts upon enabling debugger.
2804 */
2805 once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2806
2807 once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2808
2809 /**
2810 * If heap objects tracking has been started then backend may send update for one or more fragments
2811 */
2812 once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2813
2814 /**
2815 * If heap objects tracking has been started then backend regularly sends a current value for last
2816 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2817 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2818 */
2819 once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2820
2821 once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2822 once(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2823 once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2824
2825 /**
2826 * Sent when new profile recording is started using console.profile() call.
2827 */
2828 once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2829
2830 /**
2831 * Issued when console API was called.
2832 */
2833 once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2834
2835 /**
2836 * Issued when unhandled exception was revoked.
2837 */
2838 once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2839
2840 /**
2841 * Issued when exception was thrown and unhandled.
2842 */
2843 once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2844
2845 /**
2846 * Issued when new execution context is created.
2847 */
2848 once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2849
2850 /**
2851 * Issued when execution context is destroyed.
2852 */
2853 once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2854
2855 /**
2856 * Issued when all executionContexts were cleared in browser
2857 */
2858 once(event: "Runtime.executionContextsCleared", listener: () => void): this;
2859
2860 /**
2861 * Issued when object should be inspected (for example, as a result of inspect() command line API
2862 * call).
2863 */
2864 once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2865
2866 /**
2867 * Contains an bucket of collected trace events.
2868 */
2869 once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2870
2871 /**
2872 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2873 * delivered via dataCollected events.
2874 */
2875 once(event: "NodeTracing.tracingComplete", listener: () => void): this;
2876
2877 /**
2878 * Issued when attached to a worker.
2879 */
2880 once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2881
2882 /**
2883 * Issued when detached from the worker.
2884 */
2885 once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2886
2887 /**
2888 * Notifies about a new protocol message received from the session
2889 * (session ID is provided in attachedToWorker notification).
2890 */
2891 once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2892
2893 prependListener(event: string, listener: (...args: any[]) => void): this;
2894
2895 /**
2896 * Emitted when any notification from the V8 Inspector is received.
2897 */
2898 prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2899
2900 /**
2901 * Issued when new console message is added.
2902 */
2903 prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2904
2905 /**
2906 * Fired when breakpoint is resolved to an actual script and location.
2907 */
2908 prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2909
2910 /**
2911 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2912 */
2913 prependListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2914
2915 /**
2916 * Fired when the virtual machine resumed execution.
2917 */
2918 prependListener(event: "Debugger.resumed", listener: () => void): this;
2919
2920 /**
2921 * Fired when virtual machine fails to parse the script.
2922 */
2923 prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2924
2925 /**
2926 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2927 * scripts upon enabling debugger.
2928 */
2929 prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2930
2931 prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2932
2933 /**
2934 * If heap objects tracking has been started then backend may send update for one or more fragments
2935 */
2936 prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2937
2938 /**
2939 * If heap objects tracking has been started then backend regularly sends a current value for last
2940 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2941 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2942 */
2943 prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2944
2945 prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2946 prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2947 prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2948
2949 /**
2950 * Sent when new profile recording is started using console.profile() call.
2951 */
2952 prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2953
2954 /**
2955 * Issued when console API was called.
2956 */
2957 prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2958
2959 /**
2960 * Issued when unhandled exception was revoked.
2961 */
2962 prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2963
2964 /**
2965 * Issued when exception was thrown and unhandled.
2966 */
2967 prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2968
2969 /**
2970 * Issued when new execution context is created.
2971 */
2972 prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2973
2974 /**
2975 * Issued when execution context is destroyed.
2976 */
2977 prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2978
2979 /**
2980 * Issued when all executionContexts were cleared in browser
2981 */
2982 prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
2983
2984 /**
2985 * Issued when object should be inspected (for example, as a result of inspect() command line API
2986 * call).
2987 */
2988 prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2989
2990 /**
2991 * Contains an bucket of collected trace events.
2992 */
2993 prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2994
2995 /**
2996 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2997 * delivered via dataCollected events.
2998 */
2999 prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
3000
3001 /**
3002 * Issued when attached to a worker.
3003 */
3004 prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3005
3006 /**
3007 * Issued when detached from the worker.
3008 */
3009 prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3010
3011 /**
3012 * Notifies about a new protocol message received from the session
3013 * (session ID is provided in attachedToWorker notification).
3014 */
3015 prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3016
3017 prependOnceListener(event: string, listener: (...args: any[]) => void): this;
3018
3019 /**
3020 * Emitted when any notification from the V8 Inspector is received.
3021 */
3022 prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
3023
3024 /**
3025 * Issued when new console message is added.
3026 */
3027 prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
3028
3029 /**
3030 * Fired when breakpoint is resolved to an actual script and location.
3031 */
3032 prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
3033
3034 /**
3035 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
3036 */
3037 prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
3038
3039 /**
3040 * Fired when the virtual machine resumed execution.
3041 */
3042 prependOnceListener(event: "Debugger.resumed", listener: () => void): this;
3043
3044 /**
3045 * Fired when virtual machine fails to parse the script.
3046 */
3047 prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3048
3049 /**
3050 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
3051 * scripts upon enabling debugger.
3052 */
3053 prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3054
3055 prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3056
3057 /**
3058 * If heap objects tracking has been started then backend may send update for one or more fragments
3059 */
3060 prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
3061
3062 /**
3063 * If heap objects tracking has been started then backend regularly sends a current value for last
3064 * seen object id and corresponding timestamp. If the were changes in the heap since last event
3065 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
3066 */
3067 prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
3068
3069 prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3070 prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
3071 prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3072
3073 /**
3074 * Sent when new profile recording is started using console.profile() call.
3075 */
3076 prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3077
3078 /**
3079 * Issued when console API was called.
3080 */
3081 prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3082
3083 /**
3084 * Issued when unhandled exception was revoked.
3085 */
3086 prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3087
3088 /**
3089 * Issued when exception was thrown and unhandled.
3090 */
3091 prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3092
3093 /**
3094 * Issued when new execution context is created.
3095 */
3096 prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3097
3098 /**
3099 * Issued when execution context is destroyed.
3100 */
3101 prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3102
3103 /**
3104 * Issued when all executionContexts were cleared in browser
3105 */
3106 prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
3107
3108 /**
3109 * Issued when object should be inspected (for example, as a result of inspect() command line API
3110 * call).
3111 */
3112 prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3113
3114 /**
3115 * Contains an bucket of collected trace events.
3116 */
3117 prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
3118
3119 /**
3120 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
3121 * delivered via dataCollected events.
3122 */
3123 prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
3124
3125 /**
3126 * Issued when attached to a worker.
3127 */
3128 prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3129
3130 /**
3131 * Issued when detached from the worker.
3132 */
3133 prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3134
3135 /**
3136 * Notifies about a new protocol message received from the session
3137 * (session ID is provided in attachedToWorker notification).
3138 */
3139 prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3140 }
3141
3142 // Top Level API
3143
3144 /**
3145 * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started.
3146 * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client.
3147 * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI.
3148 * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI.
3149 * @param wait Block until a client has connected. Optional, defaults to false.
3150 */
3151 function open(port?: number, host?: string, wait?: boolean): void;
3152
3153 /**
3154 * Deactivate the inspector. Blocks until there are no active connections.
3155 */
3156 function close(): void;
3157
3158 /**
3159 * Return the URL of the active inspector, or `undefined` if there is none.
3160 */
3161 function url(): string | undefined;
3162}