UNPKG

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