UNPKG

127 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 SetAsyncCallStackDepthParameterType {
1720 /**
1721 * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
1722 * call stacks (default).
1723 */
1724 maxDepth: number;
1725 }
1726
1727 interface SetCustomObjectFormatterEnabledParameterType {
1728 enabled: boolean;
1729 }
1730
1731 interface SetMaxCallStackSizeToCaptureParameterType {
1732 size: number;
1733 }
1734
1735 interface AddBindingParameterType {
1736 name: string;
1737 executionContextId?: ExecutionContextId;
1738 }
1739
1740 interface RemoveBindingParameterType {
1741 name: string;
1742 }
1743
1744 interface AwaitPromiseReturnType {
1745 /**
1746 * Promise result. Will contain rejected value if promise was rejected.
1747 */
1748 result: RemoteObject;
1749 /**
1750 * Exception details if stack strace is available.
1751 */
1752 exceptionDetails?: ExceptionDetails;
1753 }
1754
1755 interface CallFunctionOnReturnType {
1756 /**
1757 * Call result.
1758 */
1759 result: RemoteObject;
1760 /**
1761 * Exception details.
1762 */
1763 exceptionDetails?: ExceptionDetails;
1764 }
1765
1766 interface CompileScriptReturnType {
1767 /**
1768 * Id of the script.
1769 */
1770 scriptId?: ScriptId;
1771 /**
1772 * Exception details.
1773 */
1774 exceptionDetails?: ExceptionDetails;
1775 }
1776
1777 interface EvaluateReturnType {
1778 /**
1779 * Evaluation result.
1780 */
1781 result: RemoteObject;
1782 /**
1783 * Exception details.
1784 */
1785 exceptionDetails?: ExceptionDetails;
1786 }
1787
1788 interface GetIsolateIdReturnType {
1789 /**
1790 * The isolate id.
1791 */
1792 id: string;
1793 }
1794
1795 interface GetHeapUsageReturnType {
1796 /**
1797 * Used heap size in bytes.
1798 */
1799 usedSize: number;
1800 /**
1801 * Allocated heap size in bytes.
1802 */
1803 totalSize: number;
1804 }
1805
1806 interface GetPropertiesReturnType {
1807 /**
1808 * Object properties.
1809 */
1810 result: PropertyDescriptor[];
1811 /**
1812 * Internal object properties (only of the element itself).
1813 */
1814 internalProperties?: InternalPropertyDescriptor[];
1815 /**
1816 * Exception details.
1817 */
1818 exceptionDetails?: ExceptionDetails;
1819 }
1820
1821 interface GlobalLexicalScopeNamesReturnType {
1822 names: string[];
1823 }
1824
1825 interface QueryObjectsReturnType {
1826 /**
1827 * Array with objects.
1828 */
1829 objects: RemoteObject;
1830 }
1831
1832 interface RunScriptReturnType {
1833 /**
1834 * Run result.
1835 */
1836 result: RemoteObject;
1837 /**
1838 * Exception details.
1839 */
1840 exceptionDetails?: ExceptionDetails;
1841 }
1842
1843 interface BindingCalledEventDataType {
1844 name: string;
1845 payload: string;
1846 /**
1847 * Identifier of the context where the call was made.
1848 */
1849 executionContextId: ExecutionContextId;
1850 }
1851
1852 interface ConsoleAPICalledEventDataType {
1853 /**
1854 * Type of the call.
1855 */
1856 type: string;
1857 /**
1858 * Call arguments.
1859 */
1860 args: RemoteObject[];
1861 /**
1862 * Identifier of the context where the call was made.
1863 */
1864 executionContextId: ExecutionContextId;
1865 /**
1866 * Call timestamp.
1867 */
1868 timestamp: Timestamp;
1869 /**
1870 * Stack trace captured when the call was made.
1871 */
1872 stackTrace?: StackTrace;
1873 /**
1874 * Console context descriptor for calls on non-default console context (not console.*):
1875 * 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call
1876 * on named context.
1877 * @experimental
1878 */
1879 context?: string;
1880 }
1881
1882 interface ExceptionRevokedEventDataType {
1883 /**
1884 * Reason describing why exception was revoked.
1885 */
1886 reason: string;
1887 /**
1888 * The id of revoked exception, as reported in `exceptionThrown`.
1889 */
1890 exceptionId: number;
1891 }
1892
1893 interface ExceptionThrownEventDataType {
1894 /**
1895 * Timestamp of the exception.
1896 */
1897 timestamp: Timestamp;
1898 exceptionDetails: ExceptionDetails;
1899 }
1900
1901 interface ExecutionContextCreatedEventDataType {
1902 /**
1903 * A newly created execution context.
1904 */
1905 context: ExecutionContextDescription;
1906 }
1907
1908 interface ExecutionContextDestroyedEventDataType {
1909 /**
1910 * Id of the destroyed context
1911 */
1912 executionContextId: ExecutionContextId;
1913 }
1914
1915 interface InspectRequestedEventDataType {
1916 object: RemoteObject;
1917 hints: {};
1918 }
1919 }
1920
1921 namespace Schema {
1922 /**
1923 * Description of the protocol domain.
1924 */
1925 interface Domain {
1926 /**
1927 * Domain name.
1928 */
1929 name: string;
1930 /**
1931 * Domain version.
1932 */
1933 version: string;
1934 }
1935
1936 interface GetDomainsReturnType {
1937 /**
1938 * List of supported domains.
1939 */
1940 domains: Domain[];
1941 }
1942 }
1943
1944 namespace NodeTracing {
1945 interface TraceConfig {
1946 /**
1947 * Controls how the trace buffer stores data.
1948 */
1949 recordMode?: string;
1950 /**
1951 * Included category filters.
1952 */
1953 includedCategories: string[];
1954 }
1955
1956 interface StartParameterType {
1957 traceConfig: TraceConfig;
1958 }
1959
1960 interface GetCategoriesReturnType {
1961 /**
1962 * A list of supported tracing categories.
1963 */
1964 categories: string[];
1965 }
1966
1967 interface DataCollectedEventDataType {
1968 value: Array<{}>;
1969 }
1970 }
1971
1972 namespace NodeWorker {
1973 type WorkerID = string;
1974
1975 /**
1976 * Unique identifier of attached debugging session.
1977 */
1978 type SessionID = string;
1979
1980 interface WorkerInfo {
1981 workerId: WorkerID;
1982 type: string;
1983 title: string;
1984 url: string;
1985 }
1986
1987 interface SendMessageToWorkerParameterType {
1988 message: string;
1989 /**
1990 * Identifier of the session.
1991 */
1992 sessionId: SessionID;
1993 }
1994
1995 interface EnableParameterType {
1996 /**
1997 * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
1998 * message to run them.
1999 */
2000 waitForDebuggerOnStart: boolean;
2001 }
2002
2003 interface AttachedToWorkerEventDataType {
2004 /**
2005 * Identifier assigned to the session used to send/receive messages.
2006 */
2007 sessionId: SessionID;
2008 workerInfo: WorkerInfo;
2009 waitingForDebugger: boolean;
2010 }
2011
2012 interface DetachedFromWorkerEventDataType {
2013 /**
2014 * Detached session identifier.
2015 */
2016 sessionId: SessionID;
2017 }
2018
2019 interface ReceivedMessageFromWorkerEventDataType {
2020 /**
2021 * Identifier of a session which sends a message.
2022 */
2023 sessionId: SessionID;
2024 message: string;
2025 }
2026 }
2027
2028 /**
2029 * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.
2030 */
2031 class Session extends EventEmitter {
2032 /**
2033 * Create a new instance of the inspector.Session class.
2034 * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend.
2035 */
2036 constructor();
2037
2038 /**
2039 * Connects a session to the inspector back-end.
2040 * An exception will be thrown if there is already a connected session established either
2041 * through the API or by a front-end connected to the Inspector WebSocket port.
2042 */
2043 connect(): void;
2044
2045 /**
2046 * Immediately close the session. All pending message callbacks will be called with an error.
2047 * session.connect() will need to be called to be able to send messages again.
2048 * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
2049 */
2050 disconnect(): void;
2051
2052 /**
2053 * Posts a message to the inspector back-end. callback will be notified when a response is received.
2054 * callback is a function that accepts two optional arguments - error and message-specific result.
2055 */
2056 post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void;
2057 post(method: string, callback?: (err: Error | null, params?: {}) => void): void;
2058
2059 /**
2060 * Does nothing.
2061 */
2062 post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void;
2063
2064 /**
2065 * Disables console domain, prevents further console messages from being reported to the client.
2066 */
2067 post(method: "Console.disable", callback?: (err: Error | null) => void): void;
2068
2069 /**
2070 * Enables console domain, sends the messages collected so far to the client by means of the
2071 * `messageAdded` notification.
2072 */
2073 post(method: "Console.enable", callback?: (err: Error | null) => void): void;
2074
2075 /**
2076 * Continues execution until specific location is reached.
2077 */
2078 post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void;
2079 post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void;
2080
2081 /**
2082 * Disables debugger for given page.
2083 */
2084 post(method: "Debugger.disable", callback?: (err: Error | null) => void): void;
2085
2086 /**
2087 * Enables debugger for the given page. Clients should not assume that the debugging has been
2088 * enabled until the result for this command is received.
2089 */
2090 post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void;
2091
2092 /**
2093 * Evaluates expression on a given call frame.
2094 */
2095 post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
2096 post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
2097
2098 /**
2099 * Returns possible locations for breakpoint. scriptId in start and end range locations should be
2100 * the same.
2101 */
2102 post(
2103 method: "Debugger.getPossibleBreakpoints",
2104 params?: Debugger.GetPossibleBreakpointsParameterType,
2105 callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void
2106 ): void;
2107 post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void;
2108
2109 /**
2110 * Returns source for the script with given id.
2111 */
2112 post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
2113 post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
2114
2115 /**
2116 * Returns stack trace with given `stackTraceId`.
2117 * @experimental
2118 */
2119 post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
2120 post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
2121
2122 /**
2123 * Stops on the next JavaScript statement.
2124 */
2125 post(method: "Debugger.pause", callback?: (err: Error | null) => void): void;
2126
2127 /**
2128 * @experimental
2129 */
2130 post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void;
2131 post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void;
2132
2133 /**
2134 * Removes JavaScript breakpoint.
2135 */
2136 post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void;
2137 post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void;
2138
2139 /**
2140 * Restarts particular call frame from the beginning.
2141 */
2142 post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
2143 post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
2144
2145 /**
2146 * Resumes JavaScript execution.
2147 */
2148 post(method: "Debugger.resume", callback?: (err: Error | null) => void): void;
2149
2150 /**
2151 * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and
2152 * Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled
2153 * before next pause. Returns success when async task is actually scheduled, returns error if no
2154 * task were scheduled or another scheduleStepIntoAsync was called.
2155 * @experimental
2156 */
2157 post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void;
2158
2159 /**
2160 * Searches for given string in script content.
2161 */
2162 post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
2163 post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
2164
2165 /**
2166 * Enables or disables async call stacks tracking.
2167 */
2168 post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
2169 post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void;
2170
2171 /**
2172 * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
2173 * scripts with url matching one of the patterns. VM will try to leave blackboxed script by
2174 * performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
2175 * @experimental
2176 */
2177 post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void;
2178 post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void;
2179
2180 /**
2181 * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
2182 * scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
2183 * Positions array contains positions where blackbox state is changed. First interval isn't
2184 * blackboxed. Array should be sorted.
2185 * @experimental
2186 */
2187 post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void;
2188 post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void;
2189
2190 /**
2191 * Sets JavaScript breakpoint at a given location.
2192 */
2193 post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
2194 post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
2195
2196 /**
2197 * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
2198 * command is issued, all existing parsed scripts will have breakpoints resolved and returned in
2199 * `locations` property. Further matching script parsing will result in subsequent
2200 * `breakpointResolved` events issued. This logical breakpoint will survive page reloads.
2201 */
2202 post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
2203 post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
2204
2205 /**
2206 * Sets JavaScript breakpoint before each call to the given function.
2207 * If another function was created from the same source as a given one,
2208 * calling it will also trigger the breakpoint.
2209 * @experimental
2210 */
2211 post(
2212 method: "Debugger.setBreakpointOnFunctionCall",
2213 params?: Debugger.SetBreakpointOnFunctionCallParameterType,
2214 callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void
2215 ): void;
2216 post(method: "Debugger.setBreakpointOnFunctionCall", callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void): void;
2217
2218 /**
2219 * Activates / deactivates all breakpoints on the page.
2220 */
2221 post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void;
2222 post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void;
2223
2224 /**
2225 * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or
2226 * no exceptions. Initial pause on exceptions state is `none`.
2227 */
2228 post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void;
2229 post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void;
2230
2231 /**
2232 * Changes return value in top frame. Available only at return break position.
2233 * @experimental
2234 */
2235 post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void;
2236 post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void;
2237
2238 /**
2239 * Edits JavaScript source live.
2240 */
2241 post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
2242 post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
2243
2244 /**
2245 * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
2246 */
2247 post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void;
2248 post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void;
2249
2250 /**
2251 * Changes value of variable in a callframe. Object-based scopes are not supported and must be
2252 * mutated manually.
2253 */
2254 post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void;
2255 post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void;
2256
2257 /**
2258 * Steps into the function call.
2259 */
2260 post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void;
2261 post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void;
2262
2263 /**
2264 * Steps out of the function call.
2265 */
2266 post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void;
2267
2268 /**
2269 * Steps over the statement.
2270 */
2271 post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void;
2272
2273 /**
2274 * Enables console to refer to the node with given id via $x (see Command Line API for more details
2275 * $x functions).
2276 */
2277 post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void;
2278 post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void;
2279
2280 post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void;
2281
2282 post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void;
2283
2284 post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void;
2285
2286 post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
2287 post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
2288
2289 post(
2290 method: "HeapProfiler.getObjectByHeapObjectId",
2291 params?: HeapProfiler.GetObjectByHeapObjectIdParameterType,
2292 callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void
2293 ): void;
2294 post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void;
2295
2296 post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
2297
2298 post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void;
2299 post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void;
2300
2301 post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
2302 post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void;
2303
2304 post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void;
2305
2306 post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
2307 post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void;
2308
2309 post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void;
2310 post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void;
2311
2312 post(method: "Profiler.disable", callback?: (err: Error | null) => void): void;
2313
2314 post(method: "Profiler.enable", callback?: (err: Error | null) => void): void;
2315
2316 /**
2317 * Collect coverage data for the current isolate. The coverage data may be incomplete due to
2318 * garbage collection.
2319 */
2320 post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void;
2321
2322 /**
2323 * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
2324 */
2325 post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void;
2326 post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void;
2327
2328 post(method: "Profiler.start", callback?: (err: Error | null) => void): void;
2329
2330 /**
2331 * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
2332 * coverage may be incomplete. Enabling prevents running optimized code and resets execution
2333 * counters.
2334 */
2335 post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void;
2336 post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void;
2337
2338 /**
2339 * Enable type profile.
2340 * @experimental
2341 */
2342 post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void;
2343
2344 post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void;
2345
2346 /**
2347 * Disable precise code coverage. Disabling releases unnecessary execution count records and allows
2348 * executing optimized code.
2349 */
2350 post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void;
2351
2352 /**
2353 * Disable type profile. Disabling releases type profile data collected so far.
2354 * @experimental
2355 */
2356 post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void;
2357
2358 /**
2359 * Collect coverage data for the current isolate, and resets execution counters. Precise code
2360 * coverage needs to have started.
2361 */
2362 post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void;
2363
2364 /**
2365 * Collect type profile.
2366 * @experimental
2367 */
2368 post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void;
2369
2370 /**
2371 * Add handler to promise with given promise object id.
2372 */
2373 post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
2374 post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
2375
2376 /**
2377 * Calls function with given declaration on the given object. Object group of the result is
2378 * inherited from the target object.
2379 */
2380 post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
2381 post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
2382
2383 /**
2384 * Compiles expression.
2385 */
2386 post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
2387 post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
2388
2389 /**
2390 * Disables reporting of execution contexts creation.
2391 */
2392 post(method: "Runtime.disable", callback?: (err: Error | null) => void): void;
2393
2394 /**
2395 * Discards collected exceptions and console API calls.
2396 */
2397 post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void;
2398
2399 /**
2400 * Enables reporting of execution contexts creation by means of `executionContextCreated` event.
2401 * When the reporting gets enabled the event will be sent immediately for each existing execution
2402 * context.
2403 */
2404 post(method: "Runtime.enable", callback?: (err: Error | null) => void): void;
2405
2406 /**
2407 * Evaluates expression on global object.
2408 */
2409 post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
2410 post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
2411
2412 /**
2413 * Returns the isolate id.
2414 * @experimental
2415 */
2416 post(method: "Runtime.getIsolateId", callback?: (err: Error | null, params: Runtime.GetIsolateIdReturnType) => void): void;
2417
2418 /**
2419 * Returns the JavaScript heap usage.
2420 * It is the total usage of the corresponding isolate not scoped to a particular Runtime.
2421 * @experimental
2422 */
2423 post(method: "Runtime.getHeapUsage", callback?: (err: Error | null, params: Runtime.GetHeapUsageReturnType) => void): void;
2424
2425 /**
2426 * Returns properties of a given object. Object group of the result is inherited from the target
2427 * object.
2428 */
2429 post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
2430 post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
2431
2432 /**
2433 * Returns all let, const and class variables from global scope.
2434 */
2435 post(
2436 method: "Runtime.globalLexicalScopeNames",
2437 params?: Runtime.GlobalLexicalScopeNamesParameterType,
2438 callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void
2439 ): void;
2440 post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
2441
2442 post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
2443 post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
2444
2445 /**
2446 * Releases remote object with given id.
2447 */
2448 post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void;
2449 post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void;
2450
2451 /**
2452 * Releases all remote objects that belong to a given group.
2453 */
2454 post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void;
2455 post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void;
2456
2457 /**
2458 * Tells inspected instance to run if it was waiting for debugger to attach.
2459 */
2460 post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void;
2461
2462 /**
2463 * Runs script with given id in a given context.
2464 */
2465 post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
2466 post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
2467
2468 /**
2469 * Enables or disables async call stacks tracking.
2470 */
2471 post(method: "Runtime.setAsyncCallStackDepth", params?: Runtime.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
2472 post(method: "Runtime.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void;
2473
2474 /**
2475 * @experimental
2476 */
2477 post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void;
2478 post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void;
2479
2480 /**
2481 * @experimental
2482 */
2483 post(method: "Runtime.setMaxCallStackSizeToCapture", params?: Runtime.SetMaxCallStackSizeToCaptureParameterType, callback?: (err: Error | null) => void): void;
2484 post(method: "Runtime.setMaxCallStackSizeToCapture", callback?: (err: Error | null) => void): void;
2485
2486 /**
2487 * Terminate current or next JavaScript execution.
2488 * Will cancel the termination when the outer-most script execution ends.
2489 * @experimental
2490 */
2491 post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void;
2492
2493 /**
2494 * If executionContextId is empty, adds binding with the given name on the
2495 * global objects of all inspected contexts, including those created later,
2496 * bindings survive reloads.
2497 * If executionContextId is specified, adds binding only on global object of
2498 * given execution context.
2499 * Binding function takes exactly one argument, this argument should be string,
2500 * in case of any other input, function throws an exception.
2501 * Each binding function call produces Runtime.bindingCalled notification.
2502 * @experimental
2503 */
2504 post(method: "Runtime.addBinding", params?: Runtime.AddBindingParameterType, callback?: (err: Error | null) => void): void;
2505 post(method: "Runtime.addBinding", callback?: (err: Error | null) => void): void;
2506
2507 /**
2508 * This method does not remove binding function from global object but
2509 * unsubscribes current runtime agent from Runtime.bindingCalled notifications.
2510 * @experimental
2511 */
2512 post(method: "Runtime.removeBinding", params?: Runtime.RemoveBindingParameterType, callback?: (err: Error | null) => void): void;
2513 post(method: "Runtime.removeBinding", callback?: (err: Error | null) => void): void;
2514
2515 /**
2516 * Returns supported domains.
2517 */
2518 post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void;
2519
2520 /**
2521 * Gets supported tracing categories.
2522 */
2523 post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
2524
2525 /**
2526 * Start trace events collection.
2527 */
2528 post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
2529 post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void;
2530
2531 /**
2532 * Stop trace events collection. Remaining collected events will be sent as a sequence of
2533 * dataCollected events followed by tracingComplete event.
2534 */
2535 post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void;
2536
2537 /**
2538 * Sends protocol message over session with given id.
2539 */
2540 post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
2541 post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void;
2542
2543 /**
2544 * Instructs the inspector to attach to running workers. Will also attach to new workers
2545 * as they start
2546 */
2547 post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
2548 post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void;
2549
2550 /**
2551 * Detaches from all running workers and disables attaching to new workers as they are started.
2552 */
2553 post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void;
2554
2555 // Events
2556
2557 addListener(event: string, listener: (...args: any[]) => void): this;
2558
2559 /**
2560 * Emitted when any notification from the V8 Inspector is received.
2561 */
2562 addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2563
2564 /**
2565 * Issued when new console message is added.
2566 */
2567 addListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2568
2569 /**
2570 * Fired when breakpoint is resolved to an actual script and location.
2571 */
2572 addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2573
2574 /**
2575 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2576 */
2577 addListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2578
2579 /**
2580 * Fired when the virtual machine resumed execution.
2581 */
2582 addListener(event: "Debugger.resumed", listener: () => void): this;
2583
2584 /**
2585 * Fired when virtual machine fails to parse the script.
2586 */
2587 addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2588
2589 /**
2590 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2591 * scripts upon enabling debugger.
2592 */
2593 addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2594
2595 addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2596
2597 /**
2598 * If heap objects tracking has been started then backend may send update for one or more fragments
2599 */
2600 addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2601
2602 /**
2603 * If heap objects tracking has been started then backend regularly sends a current value for last
2604 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2605 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2606 */
2607 addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2608
2609 addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2610 addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2611 addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2612
2613 /**
2614 * Sent when new profile recording is started using console.profile() call.
2615 */
2616 addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2617
2618 /**
2619 * Notification is issued every time when binding is called.
2620 * @experimental
2621 */
2622 addListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification<Runtime.BindingCalledEventDataType>) => void): this;
2623
2624 /**
2625 * Issued when console API was called.
2626 */
2627 addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2628
2629 /**
2630 * Issued when unhandled exception was revoked.
2631 */
2632 addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2633
2634 /**
2635 * Issued when exception was thrown and unhandled.
2636 */
2637 addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2638
2639 /**
2640 * Issued when new execution context is created.
2641 */
2642 addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2643
2644 /**
2645 * Issued when execution context is destroyed.
2646 */
2647 addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2648
2649 /**
2650 * Issued when all executionContexts were cleared in browser
2651 */
2652 addListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
2653
2654 /**
2655 * Issued when object should be inspected (for example, as a result of inspect() command line API
2656 * call).
2657 */
2658 addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2659
2660 /**
2661 * Contains an bucket of collected trace events.
2662 */
2663 addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2664
2665 /**
2666 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2667 * delivered via dataCollected events.
2668 */
2669 addListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
2670
2671 /**
2672 * Issued when attached to a worker.
2673 */
2674 addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2675
2676 /**
2677 * Issued when detached from the worker.
2678 */
2679 addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2680
2681 /**
2682 * Notifies about a new protocol message received from the session
2683 * (session ID is provided in attachedToWorker notification).
2684 */
2685 addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2686
2687 emit(event: string | symbol, ...args: any[]): boolean;
2688 emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean;
2689 emit(event: "Console.messageAdded", message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
2690 emit(event: "Debugger.breakpointResolved", message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
2691 emit(event: "Debugger.paused", message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
2692 emit(event: "Debugger.resumed"): boolean;
2693 emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
2694 emit(event: "Debugger.scriptParsed", message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
2695 emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
2696 emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
2697 emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
2698 emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
2699 emit(event: "HeapProfiler.resetProfiles"): boolean;
2700 emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
2701 emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
2702 emit(event: "Runtime.bindingCalled", message: InspectorNotification<Runtime.BindingCalledEventDataType>): boolean;
2703 emit(event: "Runtime.consoleAPICalled", message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
2704 emit(event: "Runtime.exceptionRevoked", message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
2705 emit(event: "Runtime.exceptionThrown", message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
2706 emit(event: "Runtime.executionContextCreated", message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
2707 emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
2708 emit(event: "Runtime.executionContextsCleared"): boolean;
2709 emit(event: "Runtime.inspectRequested", message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
2710 emit(event: "NodeTracing.dataCollected", message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
2711 emit(event: "NodeTracing.tracingComplete"): boolean;
2712 emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
2713 emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
2714 emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
2715
2716 on(event: string, listener: (...args: any[]) => void): this;
2717
2718 /**
2719 * Emitted when any notification from the V8 Inspector is received.
2720 */
2721 on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2722
2723 /**
2724 * Issued when new console message is added.
2725 */
2726 on(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2727
2728 /**
2729 * Fired when breakpoint is resolved to an actual script and location.
2730 */
2731 on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2732
2733 /**
2734 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2735 */
2736 on(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2737
2738 /**
2739 * Fired when the virtual machine resumed execution.
2740 */
2741 on(event: "Debugger.resumed", listener: () => void): this;
2742
2743 /**
2744 * Fired when virtual machine fails to parse the script.
2745 */
2746 on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2747
2748 /**
2749 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2750 * scripts upon enabling debugger.
2751 */
2752 on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2753
2754 on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2755
2756 /**
2757 * If heap objects tracking has been started then backend may send update for one or more fragments
2758 */
2759 on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2760
2761 /**
2762 * If heap objects tracking has been started then backend regularly sends a current value for last
2763 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2764 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2765 */
2766 on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2767
2768 on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2769 on(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2770 on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2771
2772 /**
2773 * Sent when new profile recording is started using console.profile() call.
2774 */
2775 on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2776
2777 /**
2778 * Notification is issued every time when binding is called.
2779 * @experimental
2780 */
2781 on(event: "Runtime.bindingCalled", listener: (message: InspectorNotification<Runtime.BindingCalledEventDataType>) => void): this;
2782
2783 /**
2784 * Issued when console API was called.
2785 */
2786 on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2787
2788 /**
2789 * Issued when unhandled exception was revoked.
2790 */
2791 on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2792
2793 /**
2794 * Issued when exception was thrown and unhandled.
2795 */
2796 on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2797
2798 /**
2799 * Issued when new execution context is created.
2800 */
2801 on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2802
2803 /**
2804 * Issued when execution context is destroyed.
2805 */
2806 on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2807
2808 /**
2809 * Issued when all executionContexts were cleared in browser
2810 */
2811 on(event: "Runtime.executionContextsCleared", listener: () => void): this;
2812
2813 /**
2814 * Issued when object should be inspected (for example, as a result of inspect() command line API
2815 * call).
2816 */
2817 on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2818
2819 /**
2820 * Contains an bucket of collected trace events.
2821 */
2822 on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2823
2824 /**
2825 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2826 * delivered via dataCollected events.
2827 */
2828 on(event: "NodeTracing.tracingComplete", listener: () => void): this;
2829
2830 /**
2831 * Issued when attached to a worker.
2832 */
2833 on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2834
2835 /**
2836 * Issued when detached from the worker.
2837 */
2838 on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2839
2840 /**
2841 * Notifies about a new protocol message received from the session
2842 * (session ID is provided in attachedToWorker notification).
2843 */
2844 on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2845
2846 once(event: string, listener: (...args: any[]) => void): this;
2847
2848 /**
2849 * Emitted when any notification from the V8 Inspector is received.
2850 */
2851 once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2852
2853 /**
2854 * Issued when new console message is added.
2855 */
2856 once(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2857
2858 /**
2859 * Fired when breakpoint is resolved to an actual script and location.
2860 */
2861 once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2862
2863 /**
2864 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2865 */
2866 once(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2867
2868 /**
2869 * Fired when the virtual machine resumed execution.
2870 */
2871 once(event: "Debugger.resumed", listener: () => void): this;
2872
2873 /**
2874 * Fired when virtual machine fails to parse the script.
2875 */
2876 once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2877
2878 /**
2879 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
2880 * scripts upon enabling debugger.
2881 */
2882 once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2883
2884 once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2885
2886 /**
2887 * If heap objects tracking has been started then backend may send update for one or more fragments
2888 */
2889 once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2890
2891 /**
2892 * If heap objects tracking has been started then backend regularly sends a current value for last
2893 * seen object id and corresponding timestamp. If the were changes in the heap since last event
2894 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
2895 */
2896 once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2897
2898 once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2899 once(event: "HeapProfiler.resetProfiles", listener: () => void): this;
2900 once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2901
2902 /**
2903 * Sent when new profile recording is started using console.profile() call.
2904 */
2905 once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2906
2907 /**
2908 * Notification is issued every time when binding is called.
2909 * @experimental
2910 */
2911 once(event: "Runtime.bindingCalled", listener: (message: InspectorNotification<Runtime.BindingCalledEventDataType>) => void): this;
2912
2913 /**
2914 * Issued when console API was called.
2915 */
2916 once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2917
2918 /**
2919 * Issued when unhandled exception was revoked.
2920 */
2921 once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2922
2923 /**
2924 * Issued when exception was thrown and unhandled.
2925 */
2926 once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2927
2928 /**
2929 * Issued when new execution context is created.
2930 */
2931 once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2932
2933 /**
2934 * Issued when execution context is destroyed.
2935 */
2936 once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2937
2938 /**
2939 * Issued when all executionContexts were cleared in browser
2940 */
2941 once(event: "Runtime.executionContextsCleared", listener: () => void): this;
2942
2943 /**
2944 * Issued when object should be inspected (for example, as a result of inspect() command line API
2945 * call).
2946 */
2947 once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2948
2949 /**
2950 * Contains an bucket of collected trace events.
2951 */
2952 once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2953
2954 /**
2955 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2956 * delivered via dataCollected events.
2957 */
2958 once(event: "NodeTracing.tracingComplete", listener: () => void): this;
2959
2960 /**
2961 * Issued when attached to a worker.
2962 */
2963 once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2964
2965 /**
2966 * Issued when detached from the worker.
2967 */
2968 once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2969
2970 /**
2971 * Notifies about a new protocol message received from the session
2972 * (session ID is provided in attachedToWorker notification).
2973 */
2974 once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2975
2976 prependListener(event: string, listener: (...args: any[]) => void): this;
2977
2978 /**
2979 * Emitted when any notification from the V8 Inspector is received.
2980 */
2981 prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
2982
2983 /**
2984 * Issued when new console message is added.
2985 */
2986 prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2987
2988 /**
2989 * Fired when breakpoint is resolved to an actual script and location.
2990 */
2991 prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2992
2993 /**
2994 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2995 */
2996 prependListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2997
2998 /**
2999 * Fired when the virtual machine resumed execution.
3000 */
3001 prependListener(event: "Debugger.resumed", listener: () => void): this;
3002
3003 /**
3004 * Fired when virtual machine fails to parse the script.
3005 */
3006 prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3007
3008 /**
3009 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
3010 * scripts upon enabling debugger.
3011 */
3012 prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3013
3014 prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3015
3016 /**
3017 * If heap objects tracking has been started then backend may send update for one or more fragments
3018 */
3019 prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
3020
3021 /**
3022 * If heap objects tracking has been started then backend regularly sends a current value for last
3023 * seen object id and corresponding timestamp. If the were changes in the heap since last event
3024 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
3025 */
3026 prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
3027
3028 prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3029 prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
3030 prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3031
3032 /**
3033 * Sent when new profile recording is started using console.profile() call.
3034 */
3035 prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3036
3037 /**
3038 * Notification is issued every time when binding is called.
3039 * @experimental
3040 */
3041 prependListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification<Runtime.BindingCalledEventDataType>) => void): this;
3042
3043 /**
3044 * Issued when console API was called.
3045 */
3046 prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3047
3048 /**
3049 * Issued when unhandled exception was revoked.
3050 */
3051 prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3052
3053 /**
3054 * Issued when exception was thrown and unhandled.
3055 */
3056 prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3057
3058 /**
3059 * Issued when new execution context is created.
3060 */
3061 prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3062
3063 /**
3064 * Issued when execution context is destroyed.
3065 */
3066 prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3067
3068 /**
3069 * Issued when all executionContexts were cleared in browser
3070 */
3071 prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
3072
3073 /**
3074 * Issued when object should be inspected (for example, as a result of inspect() command line API
3075 * call).
3076 */
3077 prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3078
3079 /**
3080 * Contains an bucket of collected trace events.
3081 */
3082 prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
3083
3084 /**
3085 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
3086 * delivered via dataCollected events.
3087 */
3088 prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
3089
3090 /**
3091 * Issued when attached to a worker.
3092 */
3093 prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3094
3095 /**
3096 * Issued when detached from the worker.
3097 */
3098 prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3099
3100 /**
3101 * Notifies about a new protocol message received from the session
3102 * (session ID is provided in attachedToWorker notification).
3103 */
3104 prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3105
3106 prependOnceListener(event: string, listener: (...args: any[]) => void): this;
3107
3108 /**
3109 * Emitted when any notification from the V8 Inspector is received.
3110 */
3111 prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
3112
3113 /**
3114 * Issued when new console message is added.
3115 */
3116 prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
3117
3118 /**
3119 * Fired when breakpoint is resolved to an actual script and location.
3120 */
3121 prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
3122
3123 /**
3124 * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
3125 */
3126 prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
3127
3128 /**
3129 * Fired when the virtual machine resumed execution.
3130 */
3131 prependOnceListener(event: "Debugger.resumed", listener: () => void): this;
3132
3133 /**
3134 * Fired when virtual machine fails to parse the script.
3135 */
3136 prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3137
3138 /**
3139 * Fired when virtual machine parses script. This event is also fired for all known and uncollected
3140 * scripts upon enabling debugger.
3141 */
3142 prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3143
3144 prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3145
3146 /**
3147 * If heap objects tracking has been started then backend may send update for one or more fragments
3148 */
3149 prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
3150
3151 /**
3152 * If heap objects tracking has been started then backend regularly sends a current value for last
3153 * seen object id and corresponding timestamp. If the were changes in the heap since last event
3154 * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
3155 */
3156 prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
3157
3158 prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3159 prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
3160 prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3161
3162 /**
3163 * Sent when new profile recording is started using console.profile() call.
3164 */
3165 prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3166
3167 /**
3168 * Notification is issued every time when binding is called.
3169 * @experimental
3170 */
3171 prependOnceListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification<Runtime.BindingCalledEventDataType>) => void): this;
3172
3173 /**
3174 * Issued when console API was called.
3175 */
3176 prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3177
3178 /**
3179 * Issued when unhandled exception was revoked.
3180 */
3181 prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3182
3183 /**
3184 * Issued when exception was thrown and unhandled.
3185 */
3186 prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3187
3188 /**
3189 * Issued when new execution context is created.
3190 */
3191 prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3192
3193 /**
3194 * Issued when execution context is destroyed.
3195 */
3196 prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3197
3198 /**
3199 * Issued when all executionContexts were cleared in browser
3200 */
3201 prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
3202
3203 /**
3204 * Issued when object should be inspected (for example, as a result of inspect() command line API
3205 * call).
3206 */
3207 prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3208
3209 /**
3210 * Contains an bucket of collected trace events.
3211 */
3212 prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
3213
3214 /**
3215 * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
3216 * delivered via dataCollected events.
3217 */
3218 prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
3219
3220 /**
3221 * Issued when attached to a worker.
3222 */
3223 prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3224
3225 /**
3226 * Issued when detached from the worker.
3227 */
3228 prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3229
3230 /**
3231 * Notifies about a new protocol message received from the session
3232 * (session ID is provided in attachedToWorker notification).
3233 */
3234 prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3235 }
3236
3237 // Top Level API
3238
3239 /**
3240 * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started.
3241 * 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.
3242 * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI.
3243 * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI.
3244 * @param wait Block until a client has connected. Optional, defaults to false.
3245 */
3246 function open(port?: number, host?: string, wait?: boolean): void;
3247
3248 /**
3249 * Deactivate the inspector. Blocks until there are no active connections.
3250 */
3251 function close(): void;
3252
3253 /**
3254 * Return the URL of the active inspector, or undefined if there is none.
3255 */
3256 function url(): string;
3257}