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