UNPKG

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