UNPKG

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