UNPKG

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