UNPKG

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