@types/node 24.3.3 → 24.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node/inspector.d.ts CHANGED
@@ -1,4204 +1,246 @@
1
- // These definitions are automatically generated by the generate-inspector script.
2
- // Do not edit this file directly.
3
- // See scripts/generate-inspector/README.md for information on how to update the protocol definitions.
4
- // Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template).
5
-
6
1
  /**
7
2
  * The `node:inspector` module provides an API for interacting with the V8
8
3
  * inspector.
9
4
  * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector.js)
10
5
  */
11
- declare module 'inspector' {
12
- import EventEmitter = require('node:events');
13
-
14
- interface InspectorNotification<T> {
15
- method: string;
16
- params: T;
17
- }
18
-
19
- namespace Schema {
20
- /**
21
- * Description of the protocol domain.
22
- */
23
- interface Domain {
24
- /**
25
- * Domain name.
26
- */
27
- name: string;
28
- /**
29
- * Domain version.
30
- */
31
- version: string;
32
- }
33
- interface GetDomainsReturnType {
34
- /**
35
- * List of supported domains.
36
- */
37
- domains: Domain[];
38
- }
39
- }
40
- namespace Runtime {
41
- /**
42
- * Unique script identifier.
43
- */
44
- type ScriptId = string;
45
- /**
46
- * Unique object identifier.
47
- */
48
- type RemoteObjectId = string;
49
- /**
50
- * Primitive value which cannot be JSON-stringified.
51
- */
52
- type UnserializableValue = string;
53
- /**
54
- * Mirror object referencing original JavaScript object.
55
- */
56
- interface RemoteObject {
57
- /**
58
- * Object type.
59
- */
60
- type: string;
61
- /**
62
- * Object subtype hint. Specified for <code>object</code> type values only.
63
- */
64
- subtype?: string | undefined;
65
- /**
66
- * Object class (constructor) name. Specified for <code>object</code> type values only.
67
- */
68
- className?: string | undefined;
69
- /**
70
- * Remote object value in case of primitive values or JSON values (if it was requested).
71
- */
72
- value?: any;
73
- /**
74
- * Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property.
75
- */
76
- unserializableValue?: UnserializableValue | undefined;
77
- /**
78
- * String representation of the object.
79
- */
80
- description?: string | undefined;
81
- /**
82
- * Unique object identifier (for non-primitive values).
83
- */
84
- objectId?: RemoteObjectId | undefined;
85
- /**
86
- * Preview containing abbreviated property values. Specified for <code>object</code> type values only.
87
- * @experimental
88
- */
89
- preview?: ObjectPreview | undefined;
90
- /**
91
- * @experimental
92
- */
93
- customPreview?: CustomPreview | undefined;
94
- }
95
- /**
96
- * @experimental
97
- */
98
- interface CustomPreview {
99
- header: string;
100
- hasBody: boolean;
101
- formatterObjectId: RemoteObjectId;
102
- bindRemoteObjectFunctionId: RemoteObjectId;
103
- configObjectId?: RemoteObjectId | undefined;
104
- }
105
- /**
106
- * Object containing abbreviated remote object value.
107
- * @experimental
108
- */
109
- interface ObjectPreview {
110
- /**
111
- * Object type.
112
- */
113
- type: string;
114
- /**
115
- * Object subtype hint. Specified for <code>object</code> type values only.
116
- */
117
- subtype?: string | undefined;
118
- /**
119
- * String representation of the object.
120
- */
121
- description?: string | undefined;
122
- /**
123
- * True iff some of the properties or entries of the original object did not fit.
124
- */
125
- overflow: boolean;
126
- /**
127
- * List of the properties.
128
- */
129
- properties: PropertyPreview[];
130
- /**
131
- * List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only.
132
- */
133
- entries?: EntryPreview[] | undefined;
134
- }
135
- /**
136
- * @experimental
137
- */
138
- interface PropertyPreview {
139
- /**
140
- * Property name.
141
- */
142
- name: string;
143
- /**
144
- * Object type. Accessor means that the property itself is an accessor property.
145
- */
146
- type: string;
147
- /**
148
- * User-friendly property value string.
149
- */
150
- value?: string | undefined;
151
- /**
152
- * Nested value preview.
153
- */
154
- valuePreview?: ObjectPreview | undefined;
155
- /**
156
- * Object subtype hint. Specified for <code>object</code> type values only.
157
- */
158
- subtype?: string | undefined;
159
- }
160
- /**
161
- * @experimental
162
- */
163
- interface EntryPreview {
164
- /**
165
- * Preview of the key. Specified for map-like collection entries.
166
- */
167
- key?: ObjectPreview | undefined;
168
- /**
169
- * Preview of the value.
170
- */
171
- value: ObjectPreview;
172
- }
173
- /**
174
- * Object property descriptor.
175
- */
176
- interface PropertyDescriptor {
177
- /**
178
- * Property name or symbol description.
179
- */
180
- name: string;
181
- /**
182
- * The value associated with the property.
183
- */
184
- value?: RemoteObject | undefined;
185
- /**
186
- * True if the value associated with the property may be changed (data descriptors only).
187
- */
188
- writable?: boolean | undefined;
189
- /**
190
- * A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only).
191
- */
192
- get?: RemoteObject | undefined;
193
- /**
194
- * A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only).
195
- */
196
- set?: RemoteObject | undefined;
197
- /**
198
- * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
199
- */
200
- configurable: boolean;
201
- /**
202
- * True if this property shows up during enumeration of the properties on the corresponding object.
203
- */
204
- enumerable: boolean;
205
- /**
206
- * True if the result was thrown during the evaluation.
207
- */
208
- wasThrown?: boolean | undefined;
209
- /**
210
- * True if the property is owned for the object.
211
- */
212
- isOwn?: boolean | undefined;
213
- /**
214
- * Property symbol object, if the property is of the <code>symbol</code> type.
215
- */
216
- symbol?: RemoteObject | undefined;
217
- }
218
- /**
219
- * Object internal property descriptor. This property isn't normally visible in JavaScript code.
220
- */
221
- interface InternalPropertyDescriptor {
222
- /**
223
- * Conventional property name.
224
- */
225
- name: string;
226
- /**
227
- * The value associated with the property.
228
- */
229
- value?: RemoteObject | undefined;
230
- }
231
- /**
232
- * 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.
233
- */
234
- interface CallArgument {
235
- /**
236
- * Primitive value or serializable javascript object.
237
- */
238
- value?: any;
239
- /**
240
- * Primitive value which can not be JSON-stringified.
241
- */
242
- unserializableValue?: UnserializableValue | undefined;
243
- /**
244
- * Remote object handle.
245
- */
246
- objectId?: RemoteObjectId | undefined;
247
- }
248
- /**
249
- * Id of an execution context.
250
- */
251
- type ExecutionContextId = number;
252
- /**
253
- * Description of an isolated world.
254
- */
255
- interface ExecutionContextDescription {
256
- /**
257
- * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
258
- */
259
- id: ExecutionContextId;
260
- /**
261
- * Execution context origin.
262
- */
263
- origin: string;
264
- /**
265
- * Human readable name describing given context.
266
- */
267
- name: string;
268
- /**
269
- * Embedder-specific auxiliary data.
270
- */
271
- auxData?: object | undefined;
272
- }
273
- /**
274
- * Detailed information about exception (or error) that was thrown during script compilation or execution.
275
- */
276
- interface ExceptionDetails {
277
- /**
278
- * Exception id.
279
- */
280
- exceptionId: number;
281
- /**
282
- * Exception text, which should be used together with exception object when available.
283
- */
284
- text: string;
285
- /**
286
- * Line number of the exception location (0-based).
287
- */
288
- lineNumber: number;
289
- /**
290
- * Column number of the exception location (0-based).
291
- */
292
- columnNumber: number;
293
- /**
294
- * Script ID of the exception location.
295
- */
296
- scriptId?: ScriptId | undefined;
297
- /**
298
- * URL of the exception location, to be used when the script was not reported.
299
- */
300
- url?: string | undefined;
301
- /**
302
- * JavaScript stack trace if available.
303
- */
304
- stackTrace?: StackTrace | undefined;
305
- /**
306
- * Exception object if available.
307
- */
308
- exception?: RemoteObject | undefined;
309
- /**
310
- * Identifier of the context where exception happened.
311
- */
312
- executionContextId?: ExecutionContextId | undefined;
313
- }
314
- /**
315
- * Number of milliseconds since epoch.
316
- */
317
- type Timestamp = number;
318
- /**
319
- * Stack entry for runtime errors and assertions.
320
- */
321
- interface CallFrame {
322
- /**
323
- * JavaScript function name.
324
- */
325
- functionName: string;
326
- /**
327
- * JavaScript script id.
328
- */
329
- scriptId: ScriptId;
330
- /**
331
- * JavaScript script name or url.
332
- */
333
- url: string;
334
- /**
335
- * JavaScript script line number (0-based).
336
- */
337
- lineNumber: number;
338
- /**
339
- * JavaScript script column number (0-based).
340
- */
341
- columnNumber: number;
342
- }
343
- /**
344
- * Call frames for assertions or error messages.
345
- */
346
- interface StackTrace {
347
- /**
348
- * String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
349
- */
350
- description?: string | undefined;
351
- /**
352
- * JavaScript function name.
353
- */
354
- callFrames: CallFrame[];
355
- /**
356
- * Asynchronous JavaScript stack trace that preceded this stack, if available.
357
- */
358
- parent?: StackTrace | undefined;
359
- /**
360
- * Asynchronous JavaScript stack trace that preceded this stack, if available.
361
- * @experimental
362
- */
363
- parentId?: StackTraceId | undefined;
364
- }
365
- /**
366
- * Unique identifier of current debugger.
367
- * @experimental
368
- */
369
- type UniqueDebuggerId = string;
370
- /**
371
- * 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.
372
- * @experimental
373
- */
374
- interface StackTraceId {
375
- id: string;
376
- debuggerId?: UniqueDebuggerId | undefined;
377
- }
378
- interface EvaluateParameterType {
379
- /**
380
- * Expression to evaluate.
381
- */
382
- expression: string;
383
- /**
384
- * Symbolic group name that can be used to release multiple objects.
385
- */
386
- objectGroup?: string | undefined;
387
- /**
388
- * Determines whether Command Line API should be available during the evaluation.
389
- */
390
- includeCommandLineAPI?: boolean | undefined;
391
- /**
392
- * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
393
- */
394
- silent?: boolean | undefined;
395
- /**
396
- * 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.
397
- */
398
- contextId?: ExecutionContextId | undefined;
399
- /**
400
- * Whether the result is expected to be a JSON object that should be sent by value.
401
- */
402
- returnByValue?: boolean | undefined;
403
- /**
404
- * Whether preview should be generated for the result.
405
- * @experimental
406
- */
407
- generatePreview?: boolean | undefined;
408
- /**
409
- * Whether execution should be treated as initiated by user in the UI.
410
- */
411
- userGesture?: boolean | undefined;
412
- /**
413
- * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
414
- */
415
- awaitPromise?: boolean | undefined;
416
- }
417
- interface AwaitPromiseParameterType {
418
- /**
419
- * Identifier of the promise.
420
- */
421
- promiseObjectId: RemoteObjectId;
422
- /**
423
- * Whether the result is expected to be a JSON object that should be sent by value.
424
- */
425
- returnByValue?: boolean | undefined;
426
- /**
427
- * Whether preview should be generated for the result.
428
- */
429
- generatePreview?: boolean | undefined;
430
- }
431
- interface CallFunctionOnParameterType {
432
- /**
433
- * Declaration of the function to call.
434
- */
435
- functionDeclaration: string;
436
- /**
437
- * Identifier of the object to call function on. Either objectId or executionContextId should be specified.
438
- */
439
- objectId?: RemoteObjectId | undefined;
440
- /**
441
- * Call arguments. All call arguments must belong to the same JavaScript world as the target object.
442
- */
443
- arguments?: CallArgument[] | undefined;
444
- /**
445
- * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
446
- */
447
- silent?: boolean | undefined;
448
- /**
449
- * Whether the result is expected to be a JSON object which should be sent by value.
450
- */
451
- returnByValue?: boolean | undefined;
452
- /**
453
- * Whether preview should be generated for the result.
454
- * @experimental
455
- */
456
- generatePreview?: boolean | undefined;
457
- /**
458
- * Whether execution should be treated as initiated by user in the UI.
459
- */
460
- userGesture?: boolean | undefined;
461
- /**
462
- * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
463
- */
464
- awaitPromise?: boolean | undefined;
465
- /**
466
- * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
467
- */
468
- executionContextId?: ExecutionContextId | undefined;
469
- /**
470
- * 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.
471
- */
472
- objectGroup?: string | undefined;
473
- }
474
- interface GetPropertiesParameterType {
475
- /**
476
- * Identifier of the object to return properties for.
477
- */
478
- objectId: RemoteObjectId;
479
- /**
480
- * If true, returns properties belonging only to the element itself, not to its prototype chain.
481
- */
482
- ownProperties?: boolean | undefined;
483
- /**
484
- * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
485
- * @experimental
486
- */
487
- accessorPropertiesOnly?: boolean | undefined;
488
- /**
489
- * Whether preview should be generated for the results.
490
- * @experimental
491
- */
492
- generatePreview?: boolean | undefined;
493
- }
494
- interface ReleaseObjectParameterType {
495
- /**
496
- * Identifier of the object to release.
497
- */
498
- objectId: RemoteObjectId;
499
- }
500
- interface ReleaseObjectGroupParameterType {
501
- /**
502
- * Symbolic object group name.
503
- */
504
- objectGroup: string;
505
- }
506
- interface SetCustomObjectFormatterEnabledParameterType {
507
- enabled: boolean;
508
- }
509
- interface CompileScriptParameterType {
510
- /**
511
- * Expression to compile.
512
- */
513
- expression: string;
514
- /**
515
- * Source url to be set for the script.
516
- */
517
- sourceURL: string;
518
- /**
519
- * Specifies whether the compiled script should be persisted.
520
- */
521
- persistScript: boolean;
522
- /**
523
- * 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.
524
- */
525
- executionContextId?: ExecutionContextId | undefined;
526
- }
527
- interface RunScriptParameterType {
528
- /**
529
- * Id of the script to run.
530
- */
531
- scriptId: ScriptId;
532
- /**
533
- * 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.
534
- */
535
- executionContextId?: ExecutionContextId | undefined;
536
- /**
537
- * Symbolic group name that can be used to release multiple objects.
538
- */
539
- objectGroup?: string | undefined;
540
- /**
541
- * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
542
- */
543
- silent?: boolean | undefined;
544
- /**
545
- * Determines whether Command Line API should be available during the evaluation.
546
- */
547
- includeCommandLineAPI?: boolean | undefined;
548
- /**
549
- * Whether the result is expected to be a JSON object which should be sent by value.
550
- */
551
- returnByValue?: boolean | undefined;
552
- /**
553
- * Whether preview should be generated for the result.
554
- */
555
- generatePreview?: boolean | undefined;
556
- /**
557
- * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
558
- */
559
- awaitPromise?: boolean | undefined;
560
- }
561
- interface QueryObjectsParameterType {
562
- /**
563
- * Identifier of the prototype to return objects for.
564
- */
565
- prototypeObjectId: RemoteObjectId;
566
- }
567
- interface GlobalLexicalScopeNamesParameterType {
568
- /**
569
- * Specifies in which execution context to lookup global scope variables.
570
- */
571
- executionContextId?: ExecutionContextId | undefined;
572
- }
573
- interface EvaluateReturnType {
574
- /**
575
- * Evaluation result.
576
- */
577
- result: RemoteObject;
578
- /**
579
- * Exception details.
580
- */
581
- exceptionDetails?: ExceptionDetails | undefined;
582
- }
583
- interface AwaitPromiseReturnType {
584
- /**
585
- * Promise result. Will contain rejected value if promise was rejected.
586
- */
587
- result: RemoteObject;
588
- /**
589
- * Exception details if stack strace is available.
590
- */
591
- exceptionDetails?: ExceptionDetails | undefined;
592
- }
593
- interface CallFunctionOnReturnType {
594
- /**
595
- * Call result.
596
- */
597
- result: RemoteObject;
598
- /**
599
- * Exception details.
600
- */
601
- exceptionDetails?: ExceptionDetails | undefined;
602
- }
603
- interface GetPropertiesReturnType {
604
- /**
605
- * Object properties.
606
- */
607
- result: PropertyDescriptor[];
608
- /**
609
- * Internal object properties (only of the element itself).
610
- */
611
- internalProperties?: InternalPropertyDescriptor[] | undefined;
612
- /**
613
- * Exception details.
614
- */
615
- exceptionDetails?: ExceptionDetails | undefined;
616
- }
617
- interface CompileScriptReturnType {
618
- /**
619
- * Id of the script.
620
- */
621
- scriptId?: ScriptId | undefined;
622
- /**
623
- * Exception details.
624
- */
625
- exceptionDetails?: ExceptionDetails | undefined;
626
- }
627
- interface RunScriptReturnType {
628
- /**
629
- * Run result.
630
- */
631
- result: RemoteObject;
632
- /**
633
- * Exception details.
634
- */
635
- exceptionDetails?: ExceptionDetails | undefined;
636
- }
637
- interface QueryObjectsReturnType {
638
- /**
639
- * Array with objects.
640
- */
641
- objects: RemoteObject;
642
- }
643
- interface GlobalLexicalScopeNamesReturnType {
644
- names: string[];
645
- }
646
- interface ExecutionContextCreatedEventDataType {
647
- /**
648
- * A newly created execution context.
649
- */
650
- context: ExecutionContextDescription;
651
- }
652
- interface ExecutionContextDestroyedEventDataType {
653
- /**
654
- * Id of the destroyed context
655
- */
656
- executionContextId: ExecutionContextId;
657
- }
658
- interface ExceptionThrownEventDataType {
659
- /**
660
- * Timestamp of the exception.
661
- */
662
- timestamp: Timestamp;
663
- exceptionDetails: ExceptionDetails;
664
- }
665
- interface ExceptionRevokedEventDataType {
666
- /**
667
- * Reason describing why exception was revoked.
668
- */
669
- reason: string;
670
- /**
671
- * The id of revoked exception, as reported in <code>exceptionThrown</code>.
672
- */
673
- exceptionId: number;
674
- }
675
- interface ConsoleAPICalledEventDataType {
676
- /**
677
- * Type of the call.
678
- */
679
- type: string;
680
- /**
681
- * Call arguments.
682
- */
683
- args: RemoteObject[];
684
- /**
685
- * Identifier of the context where the call was made.
686
- */
687
- executionContextId: ExecutionContextId;
688
- /**
689
- * Call timestamp.
690
- */
691
- timestamp: Timestamp;
692
- /**
693
- * Stack trace captured when the call was made.
694
- */
695
- stackTrace?: StackTrace | undefined;
696
- /**
697
- * 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.
698
- * @experimental
699
- */
700
- context?: string | undefined;
701
- }
702
- interface InspectRequestedEventDataType {
703
- object: RemoteObject;
704
- hints: object;
705
- }
706
- }
707
- namespace Debugger {
708
- /**
709
- * Breakpoint identifier.
710
- */
711
- type BreakpointId = string;
712
- /**
713
- * Call frame identifier.
714
- */
715
- type CallFrameId = string;
716
- /**
717
- * Location in the source code.
718
- */
719
- interface Location {
720
- /**
721
- * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
722
- */
723
- scriptId: Runtime.ScriptId;
724
- /**
725
- * Line number in the script (0-based).
726
- */
727
- lineNumber: number;
728
- /**
729
- * Column number in the script (0-based).
730
- */
731
- columnNumber?: number | undefined;
732
- }
733
- /**
734
- * Location in the source code.
735
- * @experimental
736
- */
737
- interface ScriptPosition {
738
- lineNumber: number;
739
- columnNumber: number;
740
- }
741
- /**
742
- * JavaScript call frame. Array of call frames form the call stack.
743
- */
744
- interface CallFrame {
745
- /**
746
- * Call frame identifier. This identifier is only valid while the virtual machine is paused.
747
- */
748
- callFrameId: CallFrameId;
749
- /**
750
- * Name of the JavaScript function called on this call frame.
751
- */
752
- functionName: string;
753
- /**
754
- * Location in the source code.
755
- */
756
- functionLocation?: Location | undefined;
757
- /**
758
- * Location in the source code.
759
- */
760
- location: Location;
761
- /**
762
- * JavaScript script name or url.
763
- */
764
- url: string;
765
- /**
766
- * Scope chain for this call frame.
767
- */
768
- scopeChain: 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 | undefined;
777
- }
778
- /**
779
- * Scope description.
780
- */
781
- interface Scope {
782
- /**
783
- * Scope type.
784
- */
785
- type: string;
786
- /**
787
- * 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.
788
- */
789
- object: Runtime.RemoteObject;
790
- name?: string | undefined;
791
- /**
792
- * Location in the source code where scope starts
793
- */
794
- startLocation?: Location | undefined;
795
- /**
796
- * Location in the source code where scope ends
797
- */
798
- endLocation?: Location | undefined;
799
- }
800
- /**
801
- * Search match for resource.
802
- */
803
- interface SearchMatch {
804
- /**
805
- * Line number in resource content.
806
- */
807
- lineNumber: number;
808
- /**
809
- * Line with match content.
810
- */
811
- lineContent: string;
812
- }
813
- interface BreakLocation {
814
- /**
815
- * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
816
- */
817
- scriptId: Runtime.ScriptId;
818
- /**
819
- * Line number in the script (0-based).
820
- */
821
- lineNumber: number;
822
- /**
823
- * Column number in the script (0-based).
824
- */
825
- columnNumber?: number | undefined;
826
- type?: string | undefined;
827
- }
828
- interface SetBreakpointsActiveParameterType {
829
- /**
830
- * New value for breakpoints active state.
831
- */
832
- active: boolean;
833
- }
834
- interface SetSkipAllPausesParameterType {
835
- /**
836
- * New value for skip pauses state.
837
- */
838
- skip: boolean;
839
- }
840
- interface SetBreakpointByUrlParameterType {
841
- /**
842
- * Line number to set breakpoint at.
843
- */
844
- lineNumber: number;
845
- /**
846
- * URL of the resources to set breakpoint on.
847
- */
848
- url?: string | undefined;
849
- /**
850
- * Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified.
851
- */
852
- urlRegex?: string | undefined;
853
- /**
854
- * Script hash of the resources to set breakpoint on.
855
- */
856
- scriptHash?: string | undefined;
857
- /**
858
- * Offset in the line to set breakpoint at.
859
- */
860
- columnNumber?: number | undefined;
861
- /**
862
- * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
863
- */
864
- condition?: string | undefined;
865
- }
866
- interface SetBreakpointParameterType {
867
- /**
868
- * Location to set breakpoint in.
869
- */
870
- location: Location;
871
- /**
872
- * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
873
- */
874
- condition?: string | undefined;
875
- }
876
- interface RemoveBreakpointParameterType {
877
- breakpointId: BreakpointId;
878
- }
879
- interface GetPossibleBreakpointsParameterType {
880
- /**
881
- * Start of range to search possible breakpoint locations in.
882
- */
883
- start: Location;
884
- /**
885
- * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
886
- */
887
- end?: Location | undefined;
888
- /**
889
- * Only consider locations which are in the same (non-nested) function as start.
890
- */
891
- restrictToFunction?: boolean | undefined;
892
- }
893
- interface ContinueToLocationParameterType {
894
- /**
895
- * Location to continue to.
896
- */
897
- location: Location;
898
- targetCallFrames?: string | undefined;
899
- }
900
- interface PauseOnAsyncCallParameterType {
901
- /**
902
- * Debugger will pause when async call with given stack trace is started.
903
- */
904
- parentStackTraceId: Runtime.StackTraceId;
905
- }
906
- interface StepIntoParameterType {
907
- /**
908
- * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause.
909
- * @experimental
910
- */
911
- breakOnAsyncCall?: boolean | undefined;
912
- }
913
- interface GetStackTraceParameterType {
914
- stackTraceId: Runtime.StackTraceId;
915
- }
916
- interface SearchInContentParameterType {
917
- /**
918
- * Id of the script to search in.
919
- */
920
- scriptId: Runtime.ScriptId;
921
- /**
922
- * String to search for.
923
- */
924
- query: string;
925
- /**
926
- * If true, search is case sensitive.
927
- */
928
- caseSensitive?: boolean | undefined;
929
- /**
930
- * If true, treats string parameter as regex.
931
- */
932
- isRegex?: boolean | undefined;
933
- }
934
- interface SetScriptSourceParameterType {
935
- /**
936
- * Id of the script to edit.
937
- */
938
- scriptId: Runtime.ScriptId;
939
- /**
940
- * New content of the script.
941
- */
942
- scriptSource: string;
943
- /**
944
- * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
945
- */
946
- dryRun?: boolean | undefined;
947
- }
948
- interface RestartFrameParameterType {
949
- /**
950
- * Call frame identifier to evaluate on.
951
- */
952
- callFrameId: CallFrameId;
953
- }
954
- interface GetScriptSourceParameterType {
955
- /**
956
- * Id of the script to get source for.
957
- */
958
- scriptId: Runtime.ScriptId;
959
- }
960
- interface SetPauseOnExceptionsParameterType {
961
- /**
962
- * Pause on exceptions mode.
963
- */
964
- state: string;
965
- }
966
- interface EvaluateOnCallFrameParameterType {
967
- /**
968
- * Call frame identifier to evaluate on.
969
- */
970
- callFrameId: CallFrameId;
971
- /**
972
- * Expression to evaluate.
973
- */
974
- expression: string;
975
- /**
976
- * String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>).
977
- */
978
- objectGroup?: string | undefined;
979
- /**
980
- * Specifies whether command line API should be available to the evaluated expression, defaults to false.
981
- */
982
- includeCommandLineAPI?: boolean | undefined;
983
- /**
984
- * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
985
- */
986
- silent?: boolean | undefined;
987
- /**
988
- * Whether the result is expected to be a JSON object that should be sent by value.
989
- */
990
- returnByValue?: boolean | undefined;
991
- /**
992
- * Whether preview should be generated for the result.
993
- * @experimental
994
- */
995
- generatePreview?: boolean | undefined;
996
- /**
997
- * Whether to throw an exception if side effect cannot be ruled out during evaluation.
998
- */
999
- throwOnSideEffect?: boolean | undefined;
1000
- }
1001
- interface SetVariableValueParameterType {
1002
- /**
1003
- * 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.
1004
- */
1005
- scopeNumber: number;
1006
- /**
1007
- * Variable name.
1008
- */
1009
- variableName: string;
1010
- /**
1011
- * New variable value.
1012
- */
1013
- newValue: Runtime.CallArgument;
1014
- /**
1015
- * Id of callframe that holds variable.
1016
- */
1017
- callFrameId: CallFrameId;
1018
- }
1019
- interface SetReturnValueParameterType {
1020
- /**
1021
- * New return value.
1022
- */
1023
- newValue: Runtime.CallArgument;
1024
- }
1025
- 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
- interface SetBlackboxPatternsParameterType {
1032
- /**
1033
- * Array of regexps that will be used to check script url for blackbox state.
1034
- */
1035
- patterns: string[];
1036
- }
1037
- interface SetBlackboxedRangesParameterType {
1038
- /**
1039
- * Id of the script.
1040
- */
1041
- scriptId: Runtime.ScriptId;
1042
- positions: ScriptPosition[];
1043
- }
1044
- interface EnableReturnType {
1045
- /**
1046
- * Unique identifier of the debugger.
1047
- * @experimental
1048
- */
1049
- debuggerId: Runtime.UniqueDebuggerId;
1050
- }
1051
- interface SetBreakpointByUrlReturnType {
1052
- /**
1053
- * Id of the created breakpoint for further reference.
1054
- */
1055
- breakpointId: BreakpointId;
1056
- /**
1057
- * List of the locations this breakpoint resolved into upon addition.
1058
- */
1059
- locations: Location[];
1060
- }
1061
- interface SetBreakpointReturnType {
1062
- /**
1063
- * Id of the created breakpoint for further reference.
1064
- */
1065
- breakpointId: BreakpointId;
1066
- /**
1067
- * Location this breakpoint resolved into.
1068
- */
1069
- actualLocation: Location;
1070
- }
1071
- interface GetPossibleBreakpointsReturnType {
1072
- /**
1073
- * List of the possible breakpoint locations.
1074
- */
1075
- locations: BreakLocation[];
1076
- }
1077
- interface GetStackTraceReturnType {
1078
- stackTrace: Runtime.StackTrace;
1079
- }
1080
- interface SearchInContentReturnType {
1081
- /**
1082
- * List of search matches.
1083
- */
1084
- result: SearchMatch[];
1085
- }
1086
- interface SetScriptSourceReturnType {
1087
- /**
1088
- * New stack trace in case editing has happened while VM was stopped.
1089
- */
1090
- callFrames?: CallFrame[] | undefined;
1091
- /**
1092
- * Whether current call stack was modified after applying the changes.
1093
- */
1094
- stackChanged?: boolean | undefined;
1095
- /**
1096
- * Async stack trace, if any.
1097
- */
1098
- asyncStackTrace?: Runtime.StackTrace | undefined;
1099
- /**
1100
- * Async stack trace, if any.
1101
- * @experimental
1102
- */
1103
- asyncStackTraceId?: Runtime.StackTraceId | undefined;
1104
- /**
1105
- * Exception details if any.
1106
- */
1107
- exceptionDetails?: Runtime.ExceptionDetails | undefined;
1108
- }
1109
- interface RestartFrameReturnType {
1110
- /**
1111
- * New stack trace.
1112
- */
1113
- callFrames: CallFrame[];
1114
- /**
1115
- * Async stack trace, if any.
1116
- */
1117
- asyncStackTrace?: Runtime.StackTrace | undefined;
1118
- /**
1119
- * Async stack trace, if any.
1120
- * @experimental
1121
- */
1122
- asyncStackTraceId?: Runtime.StackTraceId | undefined;
1123
- }
1124
- interface GetScriptSourceReturnType {
1125
- /**
1126
- * Script source.
1127
- */
1128
- scriptSource: string;
1129
- }
1130
- interface EvaluateOnCallFrameReturnType {
1131
- /**
1132
- * Object wrapper for the evaluation result.
1133
- */
1134
- result: Runtime.RemoteObject;
1135
- /**
1136
- * Exception details.
1137
- */
1138
- exceptionDetails?: Runtime.ExceptionDetails | undefined;
1139
- }
1140
- interface ScriptParsedEventDataType {
1141
- /**
1142
- * Identifier of the script parsed.
1143
- */
1144
- scriptId: Runtime.ScriptId;
1145
- /**
1146
- * URL or name of the script parsed (if any).
1147
- */
1148
- url: string;
1149
- /**
1150
- * Line offset of the script within the resource with given URL (for script tags).
1151
- */
1152
- startLine: number;
1153
- /**
1154
- * Column offset of the script within the resource with given URL.
1155
- */
1156
- startColumn: number;
1157
- /**
1158
- * Last line of the script.
1159
- */
1160
- endLine: number;
1161
- /**
1162
- * Length of the last line of the script.
1163
- */
1164
- endColumn: number;
1165
- /**
1166
- * Specifies script creation context.
1167
- */
1168
- executionContextId: Runtime.ExecutionContextId;
1169
- /**
1170
- * Content hash of the script.
1171
- */
1172
- hash: string;
1173
- /**
1174
- * Embedder-specific auxiliary data.
1175
- */
1176
- executionContextAuxData?: object | undefined;
1177
- /**
1178
- * True, if this script is generated as a result of the live edit operation.
1179
- * @experimental
1180
- */
1181
- isLiveEdit?: boolean | undefined;
1182
- /**
1183
- * URL of source map associated with script (if any).
1184
- */
1185
- sourceMapURL?: string | undefined;
1186
- /**
1187
- * True, if this script has sourceURL.
1188
- */
1189
- hasSourceURL?: boolean | undefined;
1190
- /**
1191
- * True, if this script is ES6 module.
1192
- */
1193
- isModule?: boolean | undefined;
1194
- /**
1195
- * This script length.
1196
- */
1197
- length?: number | undefined;
1198
- /**
1199
- * JavaScript top stack frame of where the script parsed event was triggered if available.
1200
- * @experimental
1201
- */
1202
- stackTrace?: Runtime.StackTrace | undefined;
1203
- }
1204
- interface ScriptFailedToParseEventDataType {
1205
- /**
1206
- * Identifier of the script parsed.
1207
- */
1208
- scriptId: Runtime.ScriptId;
1209
- /**
1210
- * URL or name of the script parsed (if any).
1211
- */
1212
- url: string;
1213
- /**
1214
- * Line offset of the script within the resource with given URL (for script tags).
1215
- */
1216
- startLine: number;
1217
- /**
1218
- * Column offset of the script within the resource with given URL.
1219
- */
1220
- startColumn: number;
1221
- /**
1222
- * Last line of the script.
1223
- */
1224
- endLine: number;
1225
- /**
1226
- * Length of the last line of the script.
1227
- */
1228
- endColumn: number;
1229
- /**
1230
- * Specifies script creation context.
1231
- */
1232
- executionContextId: Runtime.ExecutionContextId;
1233
- /**
1234
- * Content hash of the script.
1235
- */
1236
- hash: string;
1237
- /**
1238
- * Embedder-specific auxiliary data.
1239
- */
1240
- executionContextAuxData?: object | undefined;
1241
- /**
1242
- * URL of source map associated with script (if any).
1243
- */
1244
- sourceMapURL?: string | undefined;
1245
- /**
1246
- * True, if this script has sourceURL.
1247
- */
1248
- hasSourceURL?: boolean | undefined;
1249
- /**
1250
- * True, if this script is ES6 module.
1251
- */
1252
- isModule?: boolean | undefined;
1253
- /**
1254
- * This script length.
1255
- */
1256
- length?: number | undefined;
1257
- /**
1258
- * JavaScript top stack frame of where the script parsed event was triggered if available.
1259
- * @experimental
1260
- */
1261
- stackTrace?: Runtime.StackTrace | undefined;
1262
- }
1263
- interface BreakpointResolvedEventDataType {
1264
- /**
1265
- * Breakpoint unique identifier.
1266
- */
1267
- breakpointId: BreakpointId;
1268
- /**
1269
- * Actual breakpoint location.
1270
- */
1271
- location: Location;
1272
- }
1273
- interface PausedEventDataType {
1274
- /**
1275
- * Call stack the virtual machine stopped on.
1276
- */
1277
- callFrames: CallFrame[];
1278
- /**
1279
- * Pause reason.
1280
- */
1281
- reason: string;
1282
- /**
1283
- * Object containing break-specific auxiliary properties.
1284
- */
1285
- data?: object | undefined;
1286
- /**
1287
- * Hit breakpoints IDs
1288
- */
1289
- hitBreakpoints?: string[] | undefined;
1290
- /**
1291
- * Async stack trace, if any.
1292
- */
1293
- asyncStackTrace?: Runtime.StackTrace | undefined;
1294
- /**
1295
- * Async stack trace, if any.
1296
- * @experimental
1297
- */
1298
- asyncStackTraceId?: Runtime.StackTraceId | undefined;
1299
- /**
1300
- * 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.
1301
- * @experimental
1302
- */
1303
- asyncCallStackTraceId?: Runtime.StackTraceId | undefined;
1304
- }
1305
- }
1306
- namespace Console {
1307
- /**
1308
- * Console message.
1309
- */
1310
- interface ConsoleMessage {
1311
- /**
1312
- * Message source.
1313
- */
1314
- source: string;
1315
- /**
1316
- * Message severity.
1317
- */
1318
- level: string;
1319
- /**
1320
- * Message text.
1321
- */
1322
- text: string;
1323
- /**
1324
- * URL of the message origin.
1325
- */
1326
- url?: string | undefined;
1327
- /**
1328
- * Line number in the resource that generated this message (1-based).
1329
- */
1330
- line?: number | undefined;
1331
- /**
1332
- * Column number in the resource that generated this message (1-based).
1333
- */
1334
- column?: number | undefined;
1335
- }
1336
- interface MessageAddedEventDataType {
1337
- /**
1338
- * Console message that has been added.
1339
- */
1340
- message: ConsoleMessage;
1341
- }
1342
- }
1343
- namespace Profiler {
1344
- /**
1345
- * Profile node. Holds callsite information, execution statistics and child nodes.
1346
- */
1347
- interface ProfileNode {
1348
- /**
1349
- * Unique id of the node.
1350
- */
1351
- id: number;
1352
- /**
1353
- * Function location.
1354
- */
1355
- callFrame: Runtime.CallFrame;
1356
- /**
1357
- * Number of samples where this node was on top of the call stack.
1358
- */
1359
- hitCount?: number | undefined;
1360
- /**
1361
- * Child node ids.
1362
- */
1363
- children?: number[] | undefined;
1364
- /**
1365
- * The reason of being not optimized. The function may be deoptimized or marked as don't optimize.
1366
- */
1367
- deoptReason?: string | undefined;
1368
- /**
1369
- * An array of source position ticks.
1370
- */
1371
- positionTicks?: PositionTickInfo[] | undefined;
1372
- }
1373
- /**
1374
- * Profile.
1375
- */
1376
- interface Profile {
1377
- /**
1378
- * The list of profile nodes. First item is the root node.
1379
- */
1380
- nodes: ProfileNode[];
1381
- /**
1382
- * Profiling start timestamp in microseconds.
1383
- */
1384
- startTime: number;
1385
- /**
1386
- * Profiling end timestamp in microseconds.
1387
- */
1388
- endTime: number;
1389
- /**
1390
- * Ids of samples top nodes.
1391
- */
1392
- samples?: number[] | undefined;
1393
- /**
1394
- * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
1395
- */
1396
- timeDeltas?: number[] | undefined;
1397
- }
1398
- /**
1399
- * Specifies a number of samples attributed to a certain source position.
1400
- */
1401
- interface PositionTickInfo {
1402
- /**
1403
- * Source line number (1-based).
1404
- */
1405
- line: number;
1406
- /**
1407
- * Number of samples attributed to the source line.
1408
- */
1409
- ticks: number;
1410
- }
1411
- /**
1412
- * Coverage data for a source range.
1413
- */
1414
- 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
- * Coverage data for a JavaScript function.
1430
- */
1431
- interface FunctionCoverage {
1432
- /**
1433
- * JavaScript function name.
1434
- */
1435
- functionName: string;
1436
- /**
1437
- * Source ranges inside the function with coverage data.
1438
- */
1439
- ranges: CoverageRange[];
1440
- /**
1441
- * Whether coverage data for this function has block granularity.
1442
- */
1443
- isBlockCoverage: boolean;
1444
- }
6
+ declare module "inspector" {
7
+ import EventEmitter = require("node:events");
8
+ /**
9
+ * The `inspector.Session` is used for dispatching messages to the V8 inspector
10
+ * back-end and receiving message responses and notifications.
11
+ */
12
+ class Session extends EventEmitter {
1445
13
  /**
1446
- * Coverage data for a JavaScript script.
14
+ * Create a new instance of the inspector.Session class.
15
+ * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend.
1447
16
  */
1448
- interface ScriptCoverage {
1449
- /**
1450
- * JavaScript script id.
1451
- */
1452
- scriptId: Runtime.ScriptId;
1453
- /**
1454
- * JavaScript script name or url.
1455
- */
1456
- url: string;
1457
- /**
1458
- * Functions contained in the script that has coverage data.
1459
- */
1460
- functions: FunctionCoverage[];
1461
- }
1462
- interface SetSamplingIntervalParameterType {
1463
- /**
1464
- * New sampling interval in microseconds.
1465
- */
1466
- interval: number;
1467
- }
1468
- interface StartPreciseCoverageParameterType {
1469
- /**
1470
- * Collect accurate call counts beyond simple 'covered' or 'not covered'.
1471
- */
1472
- callCount?: boolean | undefined;
1473
- /**
1474
- * Collect block-based coverage.
1475
- */
1476
- detailed?: boolean | undefined;
1477
- }
1478
- interface StopReturnType {
1479
- /**
1480
- * Recorded profile.
1481
- */
1482
- profile: Profile;
1483
- }
1484
- interface TakePreciseCoverageReturnType {
1485
- /**
1486
- * Coverage data for the current isolate.
1487
- */
1488
- result: ScriptCoverage[];
1489
- }
1490
- interface GetBestEffortCoverageReturnType {
1491
- /**
1492
- * Coverage data for the current isolate.
1493
- */
1494
- result: ScriptCoverage[];
1495
- }
1496
- interface ConsoleProfileStartedEventDataType {
1497
- id: string;
1498
- /**
1499
- * Location of console.profile().
1500
- */
1501
- location: Debugger.Location;
1502
- /**
1503
- * Profile title passed as an argument to console.profile().
1504
- */
1505
- title?: string | undefined;
1506
- }
1507
- interface ConsoleProfileFinishedEventDataType {
1508
- id: string;
1509
- /**
1510
- * Location of console.profileEnd().
1511
- */
1512
- location: Debugger.Location;
1513
- profile: Profile;
1514
- /**
1515
- * Profile title passed as an argument to console.profile().
1516
- */
1517
- title?: string | undefined;
1518
- }
1519
- }
1520
- namespace HeapProfiler {
17
+ constructor();
1521
18
  /**
1522
- * Heap snapshot object id.
19
+ * Connects a session to the inspector back-end.
1523
20
  */
1524
- type HeapSnapshotObjectId = string;
21
+ connect(): void;
1525
22
  /**
1526
- * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
23
+ * Connects a session to the inspector back-end.
24
+ * An exception will be thrown if this API was not called on a Worker thread.
25
+ * @since v12.11.0
1527
26
  */
1528
- interface SamplingHeapProfileNode {
1529
- /**
1530
- * Function location.
1531
- */
1532
- callFrame: Runtime.CallFrame;
1533
- /**
1534
- * Allocations size in bytes for the node excluding children.
1535
- */
1536
- selfSize: number;
1537
- /**
1538
- * Child nodes.
1539
- */
1540
- children: SamplingHeapProfileNode[];
1541
- }
27
+ connectToMainThread(): void;
1542
28
  /**
1543
- * Profile.
29
+ * Immediately close the session. All pending message callbacks will be called with an error.
30
+ * `session.connect()` will need to be called to be able to send messages again.
31
+ * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
1544
32
  */
1545
- interface SamplingHeapProfile {
1546
- head: SamplingHeapProfileNode;
1547
- }
1548
- interface StartTrackingHeapObjectsParameterType {
1549
- trackAllocations?: boolean | undefined;
1550
- }
1551
- interface StopTrackingHeapObjectsParameterType {
1552
- /**
1553
- * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
1554
- */
1555
- reportProgress?: boolean | undefined;
1556
- }
1557
- interface TakeHeapSnapshotParameterType {
1558
- /**
1559
- * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
1560
- */
1561
- reportProgress?: boolean | undefined;
1562
- }
1563
- interface GetObjectByHeapObjectIdParameterType {
1564
- objectId: HeapSnapshotObjectId;
1565
- /**
1566
- * Symbolic group name that can be used to release multiple objects.
1567
- */
1568
- objectGroup?: string | undefined;
1569
- }
1570
- interface AddInspectedHeapObjectParameterType {
1571
- /**
1572
- * Heap snapshot object id to be accessible by means of $x command line API.
1573
- */
1574
- heapObjectId: HeapSnapshotObjectId;
1575
- }
1576
- interface GetHeapObjectIdParameterType {
1577
- /**
1578
- * Identifier of the object to get heap object id for.
1579
- */
1580
- objectId: Runtime.RemoteObjectId;
1581
- }
1582
- interface StartSamplingParameterType {
1583
- /**
1584
- * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
1585
- */
1586
- samplingInterval?: number | undefined;
1587
- }
1588
- interface GetObjectByHeapObjectIdReturnType {
1589
- /**
1590
- * Evaluation result.
1591
- */
1592
- result: Runtime.RemoteObject;
1593
- }
1594
- interface GetHeapObjectIdReturnType {
1595
- /**
1596
- * Id of the heap snapshot object corresponding to the passed remote object id.
1597
- */
1598
- heapSnapshotObjectId: HeapSnapshotObjectId;
1599
- }
1600
- interface StopSamplingReturnType {
1601
- /**
1602
- * Recorded sampling heap profile.
1603
- */
1604
- profile: SamplingHeapProfile;
1605
- }
1606
- interface GetSamplingProfileReturnType {
1607
- /**
1608
- * Return the sampling profile being collected.
1609
- */
1610
- profile: SamplingHeapProfile;
1611
- }
1612
- interface AddHeapSnapshotChunkEventDataType {
1613
- chunk: string;
1614
- }
1615
- interface ReportHeapSnapshotProgressEventDataType {
1616
- done: number;
1617
- total: number;
1618
- finished?: boolean | undefined;
1619
- }
1620
- interface LastSeenObjectIdEventDataType {
1621
- lastSeenObjectId: number;
1622
- timestamp: number;
1623
- }
1624
- interface HeapStatsUpdateEventDataType {
1625
- /**
1626
- * 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.
1627
- */
1628
- statsUpdate: number[];
1629
- }
1630
- }
1631
- namespace NodeTracing {
1632
- interface TraceConfig {
1633
- /**
1634
- * Controls how the trace buffer stores data.
1635
- */
1636
- recordMode?: string | undefined;
1637
- /**
1638
- * Included category filters.
1639
- */
1640
- includedCategories: string[];
1641
- }
1642
- interface StartParameterType {
1643
- traceConfig: TraceConfig;
1644
- }
1645
- interface GetCategoriesReturnType {
1646
- /**
1647
- * A list of supported tracing categories.
1648
- */
1649
- categories: string[];
1650
- }
1651
- interface DataCollectedEventDataType {
1652
- value: object[];
1653
- }
33
+ disconnect(): void;
1654
34
  }
1655
- namespace NodeWorker {
1656
- type WorkerID = string;
1657
- /**
1658
- * Unique identifier of attached debugging session.
1659
- */
1660
- type SessionID = string;
1661
- interface WorkerInfo {
1662
- workerId: WorkerID;
1663
- type: string;
1664
- title: string;
1665
- url: string;
1666
- }
1667
- interface SendMessageToWorkerParameterType {
1668
- message: string;
1669
- /**
1670
- * Identifier of the session.
1671
- */
1672
- sessionId: SessionID;
1673
- }
1674
- interface EnableParameterType {
1675
- /**
1676
- * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
1677
- * message to run them.
1678
- */
1679
- waitForDebuggerOnStart: boolean;
1680
- }
1681
- interface DetachParameterType {
1682
- sessionId: SessionID;
1683
- }
1684
- interface AttachedToWorkerEventDataType {
1685
- /**
1686
- * Identifier assigned to the session used to send/receive messages.
1687
- */
1688
- sessionId: SessionID;
1689
- workerInfo: WorkerInfo;
1690
- waitingForDebugger: boolean;
1691
- }
1692
- interface DetachedFromWorkerEventDataType {
1693
- /**
1694
- * Detached session identifier.
1695
- */
1696
- sessionId: SessionID;
1697
- }
1698
- interface ReceivedMessageFromWorkerEventDataType {
1699
- /**
1700
- * Identifier of a session which sends a message.
1701
- */
1702
- sessionId: SessionID;
1703
- message: string;
1704
- }
35
+ /**
36
+ * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has
37
+ * started.
38
+ *
39
+ * If wait is `true`, will block until a client has connected to the inspect port
40
+ * and flow control has been passed to the debugger client.
41
+ *
42
+ * See the [security warning](https://nodejs.org/docs/latest-v24.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure)
43
+ * regarding the `host` parameter usage.
44
+ * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI.
45
+ * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI.
46
+ * @param wait Block until a client has connected. Defaults to what was specified on the CLI.
47
+ * @returns Disposable that calls `inspector.close()`.
48
+ */
49
+ function open(port?: number, host?: string, wait?: boolean): Disposable;
50
+ /**
51
+ * Deactivate the inspector. Blocks until there are no active connections.
52
+ */
53
+ function close(): void;
54
+ /**
55
+ * Return the URL of the active inspector, or `undefined` if there is none.
56
+ *
57
+ * ```console
58
+ * $ node --inspect -p 'inspector.url()'
59
+ * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
60
+ * For help, see: https://nodejs.org/en/docs/inspector
61
+ * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
62
+ *
63
+ * $ node --inspect=localhost:3000 -p 'inspector.url()'
64
+ * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
65
+ * For help, see: https://nodejs.org/en/docs/inspector
66
+ * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
67
+ *
68
+ * $ node -p 'inspector.url()'
69
+ * undefined
70
+ * ```
71
+ */
72
+ function url(): string | undefined;
73
+ /**
74
+ * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command.
75
+ *
76
+ * An exception will be thrown if there is no active inspector.
77
+ * @since v12.7.0
78
+ */
79
+ function waitForDebugger(): void;
80
+ // These methods are exposed by the V8 inspector console API (inspector/v8-console.h).
81
+ // The method signatures differ from those of the Node.js console, and are deliberately
82
+ // typed permissively.
83
+ interface InspectorConsole {
84
+ debug(...data: any[]): void;
85
+ error(...data: any[]): void;
86
+ info(...data: any[]): void;
87
+ log(...data: any[]): void;
88
+ warn(...data: any[]): void;
89
+ dir(...data: any[]): void;
90
+ dirxml(...data: any[]): void;
91
+ table(...data: any[]): void;
92
+ trace(...data: any[]): void;
93
+ group(...data: any[]): void;
94
+ groupCollapsed(...data: any[]): void;
95
+ groupEnd(...data: any[]): void;
96
+ clear(...data: any[]): void;
97
+ count(label?: any): void;
98
+ countReset(label?: any): void;
99
+ assert(value?: any, ...data: any[]): void;
100
+ profile(label?: any): void;
101
+ profileEnd(label?: any): void;
102
+ time(label?: any): void;
103
+ timeLog(label?: any): void;
104
+ timeStamp(label?: any): void;
1705
105
  }
106
+ /**
107
+ * An object to send messages to the remote inspector console.
108
+ * @since v11.0.0
109
+ */
110
+ const console: InspectorConsole;
111
+ // DevTools protocol event broadcast methods
1706
112
  namespace Network {
1707
113
  /**
1708
- * Resource type as it was perceived by the rendering engine.
1709
- */
1710
- type ResourceType = string;
1711
- /**
1712
- * Unique request identifier.
114
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
115
+ *
116
+ * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
117
+ * the application is about to send an HTTP request.
118
+ * @since v22.6.0
1713
119
  */
1714
- type RequestId = string;
120
+ function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
1715
121
  /**
1716
- * UTC time in seconds, counted from January 1, 1970.
122
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
123
+ *
124
+ * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
125
+ * `Network.streamResourceContent` command was not invoked for the given request yet.
126
+ *
127
+ * Also enables `Network.getResponseBody` command to retrieve the response data.
128
+ * @since v24.2.0
1717
129
  */
1718
- type TimeSinceEpoch = number;
130
+ function dataReceived(params: DataReceivedEventDataType): void;
1719
131
  /**
1720
- * Monotonically increasing time in seconds since an arbitrary point in the past.
132
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
133
+ *
134
+ * Enables `Network.getRequestPostData` command to retrieve the request data.
135
+ * @since v24.3.0
1721
136
  */
1722
- type MonotonicTime = number;
137
+ function dataSent(params: unknown): void;
1723
138
  /**
1724
- * Information about the request initiator.
139
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
140
+ *
141
+ * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
142
+ * HTTP response is available.
143
+ * @since v22.6.0
1725
144
  */
1726
- interface Initiator {
1727
- /**
1728
- * Type of this initiator.
1729
- */
1730
- type: string;
1731
- /**
1732
- * Initiator JavaScript stack trace, set for Script only.
1733
- * Requires the Debugger domain to be enabled.
1734
- */
1735
- stack?: Runtime.StackTrace | undefined;
1736
- /**
1737
- * Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
1738
- */
1739
- url?: string | undefined;
1740
- /**
1741
- * Initiator line number, set for Parser type or for Script type (when script is importing
1742
- * module) (0-based).
1743
- */
1744
- lineNumber?: number | undefined;
1745
- /**
1746
- * Initiator column number, set for Parser type or for Script type (when script is importing
1747
- * module) (0-based).
1748
- */
1749
- columnNumber?: number | undefined;
1750
- /**
1751
- * Set if another request triggered this request (e.g. preflight).
1752
- */
1753
- requestId?: RequestId | undefined;
1754
- }
145
+ function responseReceived(params: ResponseReceivedEventDataType): void;
1755
146
  /**
1756
- * HTTP request data.
147
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
148
+ *
149
+ * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
150
+ * HTTP request has finished loading.
151
+ * @since v22.6.0
1757
152
  */
1758
- interface Request {
1759
- url: string;
1760
- method: string;
1761
- headers: Headers;
1762
- hasPostData: boolean;
1763
- }
153
+ function loadingFinished(params: LoadingFinishedEventDataType): void;
1764
154
  /**
1765
- * HTTP response data.
155
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
156
+ *
157
+ * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
158
+ * HTTP request has failed to load.
159
+ * @since v22.7.0
1766
160
  */
1767
- interface Response {
1768
- url: string;
1769
- status: number;
1770
- statusText: string;
1771
- headers: Headers;
1772
- mimeType: string;
1773
- charset: string;
1774
- }
161
+ function loadingFailed(params: LoadingFailedEventDataType): void;
162
+ }
163
+ namespace NetworkResources {
1775
164
  /**
1776
- * Request / response headers as keys / values of JSON object.
165
+ * This feature is only available with the `--experimental-inspector-network-resource` flag enabled.
166
+ *
167
+ * The inspector.NetworkResources.put method is used to provide a response for a loadNetworkResource
168
+ * request issued via the Chrome DevTools Protocol (CDP).
169
+ * This is typically triggered when a source map is specified by URL, and a DevTools frontend—such as
170
+ * Chrome—requests the resource to retrieve the source map.
171
+ *
172
+ * This method allows developers to predefine the resource content to be served in response to such CDP requests.
173
+ *
174
+ * ```js
175
+ * const inspector = require('node:inspector');
176
+ * // By preemptively calling put to register the resource, a source map can be resolved when
177
+ * // a loadNetworkResource request is made from the frontend.
178
+ * async function setNetworkResources() {
179
+ * const mapUrl = 'http://localhost:3000/dist/app.js.map';
180
+ * const tsUrl = 'http://localhost:3000/src/app.ts';
181
+ * const distAppJsMap = await fetch(mapUrl).then((res) => res.text());
182
+ * const srcAppTs = await fetch(tsUrl).then((res) => res.text());
183
+ * inspector.NetworkResources.put(mapUrl, distAppJsMap);
184
+ * inspector.NetworkResources.put(tsUrl, srcAppTs);
185
+ * };
186
+ * setNetworkResources().then(() => {
187
+ * require('./dist/app');
188
+ * });
189
+ * ```
190
+ *
191
+ * For more details, see the official CDP documentation: [Network.loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)
192
+ * @since v24.5.0
193
+ * @experimental
1777
194
  */
1778
- interface Headers {
1779
- }
1780
- interface GetRequestPostDataParameterType {
1781
- /**
1782
- * Identifier of the network request to get content for.
1783
- */
1784
- requestId: RequestId;
1785
- }
1786
- interface GetResponseBodyParameterType {
1787
- /**
1788
- * Identifier of the network request to get content for.
1789
- */
1790
- requestId: RequestId;
1791
- }
1792
- interface StreamResourceContentParameterType {
1793
- /**
1794
- * Identifier of the request to stream.
1795
- */
1796
- requestId: RequestId;
1797
- }
1798
- interface GetRequestPostDataReturnType {
1799
- /**
1800
- * Request body string, omitting files from multipart requests
1801
- */
1802
- postData: string;
1803
- }
1804
- interface GetResponseBodyReturnType {
1805
- /**
1806
- * Response body.
1807
- */
1808
- body: string;
1809
- /**
1810
- * True, if content was sent as base64.
1811
- */
1812
- base64Encoded: boolean;
1813
- }
1814
- interface StreamResourceContentReturnType {
1815
- /**
1816
- * Data that has been buffered until streaming is enabled.
1817
- */
1818
- bufferedData: string;
1819
- }
1820
- interface RequestWillBeSentEventDataType {
1821
- /**
1822
- * Request identifier.
1823
- */
1824
- requestId: RequestId;
1825
- /**
1826
- * Request data.
1827
- */
1828
- request: Request;
1829
- /**
1830
- * Request initiator.
1831
- */
1832
- initiator: Initiator;
1833
- /**
1834
- * Timestamp.
1835
- */
1836
- timestamp: MonotonicTime;
1837
- /**
1838
- * Timestamp.
1839
- */
1840
- wallTime: TimeSinceEpoch;
1841
- }
1842
- interface ResponseReceivedEventDataType {
1843
- /**
1844
- * Request identifier.
1845
- */
1846
- requestId: RequestId;
1847
- /**
1848
- * Timestamp.
1849
- */
1850
- timestamp: MonotonicTime;
1851
- /**
1852
- * Resource type.
1853
- */
1854
- type: ResourceType;
1855
- /**
1856
- * Response data.
1857
- */
1858
- response: Response;
1859
- }
1860
- interface LoadingFailedEventDataType {
1861
- /**
1862
- * Request identifier.
1863
- */
1864
- requestId: RequestId;
1865
- /**
1866
- * Timestamp.
1867
- */
1868
- timestamp: MonotonicTime;
1869
- /**
1870
- * Resource type.
1871
- */
1872
- type: ResourceType;
1873
- /**
1874
- * Error message.
1875
- */
1876
- errorText: string;
1877
- }
1878
- interface LoadingFinishedEventDataType {
1879
- /**
1880
- * Request identifier.
1881
- */
1882
- requestId: RequestId;
1883
- /**
1884
- * Timestamp.
1885
- */
1886
- timestamp: MonotonicTime;
1887
- }
1888
- interface DataReceivedEventDataType {
1889
- /**
1890
- * Request identifier.
1891
- */
1892
- requestId: RequestId;
1893
- /**
1894
- * Timestamp.
1895
- */
1896
- timestamp: MonotonicTime;
1897
- /**
1898
- * Data chunk length.
1899
- */
1900
- dataLength: number;
1901
- /**
1902
- * Actual bytes received (might be less than dataLength for compressed encodings).
1903
- */
1904
- encodedDataLength: number;
1905
- /**
1906
- * Data that was received.
1907
- * @experimental
1908
- */
1909
- data?: string | undefined;
1910
- }
1911
- }
1912
- namespace NodeRuntime {
1913
- interface NotifyWhenWaitingForDisconnectParameterType {
1914
- enabled: boolean;
1915
- }
1916
- }
1917
- namespace Target {
1918
- type SessionID = string;
1919
- type TargetID = string;
1920
- interface TargetInfo {
1921
- targetId: TargetID;
1922
- type: string;
1923
- title: string;
1924
- url: string;
1925
- attached: boolean;
1926
- canAccessOpener: boolean;
1927
- }
1928
- interface SetAutoAttachParameterType {
1929
- autoAttach: boolean;
1930
- waitForDebuggerOnStart: boolean;
1931
- }
1932
- interface TargetCreatedEventDataType {
1933
- targetInfo: TargetInfo;
1934
- }
1935
- interface AttachedToTargetEventDataType {
1936
- sessionId: SessionID;
1937
- targetInfo: TargetInfo;
1938
- waitingForDebugger: boolean;
1939
- }
195
+ function put(url: string, data: string): void;
1940
196
  }
197
+ }
198
+
199
+ /**
200
+ * The `node:inspector` module provides an API for interacting with the V8
201
+ * inspector.
202
+ */
203
+ declare module "node:inspector" {
204
+ export * from "inspector";
205
+ }
1941
206
 
207
+ /**
208
+ * The `node:inspector/promises` module provides an API for interacting with the V8
209
+ * inspector.
210
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector/promises.js)
211
+ * @since v19.0.0
212
+ */
213
+ declare module "inspector/promises" {
214
+ import EventEmitter = require("node:events");
215
+ export { close, console, NetworkResources, open, url, waitForDebugger } from "inspector";
1942
216
  /**
1943
217
  * The `inspector.Session` is used for dispatching messages to the V8 inspector
1944
218
  * back-end and receiving message responses and notifications.
219
+ * @since v19.0.0
1945
220
  */
1946
- class Session extends EventEmitter {
221
+ export class Session extends EventEmitter {
1947
222
  /**
1948
223
  * Create a new instance of the inspector.Session class.
1949
224
  * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend.
1950
225
  */
1951
226
  constructor();
1952
-
1953
227
  /**
1954
228
  * Connects a session to the inspector back-end.
1955
229
  */
1956
230
  connect(): void;
1957
-
1958
231
  /**
1959
232
  * Connects a session to the inspector back-end.
1960
233
  * An exception will be thrown if this API was not called on a Worker thread.
1961
234
  * @since v12.11.0
1962
235
  */
1963
236
  connectToMainThread(): void;
1964
-
1965
237
  /**
1966
238
  * Immediately close the session. All pending message callbacks will be called with an error.
1967
239
  * `session.connect()` will need to be called to be able to send messages again.
1968
240
  * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
1969
241
  */
1970
242
  disconnect(): void;
1971
-
1972
- /**
1973
- * Posts a message to the inspector back-end. `callback` will be notified when
1974
- * a response is received. `callback` is a function that accepts two optional
1975
- * arguments: error and message-specific result.
1976
- *
1977
- * ```js
1978
- * session.post('Runtime.evaluate', { expression: '2 + 2' },
1979
- * (error, { result }) => console.log(result));
1980
- * // Output: { type: 'number', value: 4, description: '4' }
1981
- * ```
1982
- *
1983
- * The latest version of the V8 inspector protocol is published on the
1984
- * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
1985
- *
1986
- * Node.js inspector supports all the Chrome DevTools Protocol domains declared
1987
- * by V8. Chrome DevTools Protocol domain provides an interface for interacting
1988
- * with one of the runtime agents used to inspect the application state and listen
1989
- * to the run-time events.
1990
- */
1991
- post(method: string, callback?: (err: Error | null, params?: object) => void): void;
1992
- post(method: string, params?: object, callback?: (err: Error | null, params?: object) => void): void;
1993
- /**
1994
- * Returns supported domains.
1995
- */
1996
- post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void;
1997
- /**
1998
- * Evaluates expression on global object.
1999
- */
2000
- post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
2001
- post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
2002
- /**
2003
- * Add handler to promise with given promise object id.
2004
- */
2005
- post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
2006
- post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
2007
- /**
2008
- * Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
2009
- */
2010
- post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
2011
- post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
2012
- /**
2013
- * Returns properties of a given object. Object group of the result is inherited from the target object.
2014
- */
2015
- post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
2016
- post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
2017
- /**
2018
- * Releases remote object with given id.
2019
- */
2020
- post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void;
2021
- post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void;
2022
- /**
2023
- * Releases all remote objects that belong to a given group.
2024
- */
2025
- post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void;
2026
- post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void;
2027
- /**
2028
- * Tells inspected instance to run if it was waiting for debugger to attach.
2029
- */
2030
- post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void;
2031
- /**
2032
- * 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.
2033
- */
2034
- post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void;
2035
- /**
2036
- * Disables reporting of execution contexts creation.
2037
- */
2038
- post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void;
2039
- /**
2040
- * Discards collected exceptions and console API calls.
2041
- */
2042
- post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void;
2043
- /**
2044
- * @experimental
2045
- */
2046
- post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void;
2047
- post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void;
2048
- /**
2049
- * Compiles expression.
2050
- */
2051
- post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
2052
- post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
2053
- /**
2054
- * Runs script with given id in a given context.
2055
- */
2056
- post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
2057
- post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
2058
- post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
2059
- post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
2060
- /**
2061
- * Returns all let, const and class variables from global scope.
2062
- */
2063
- post(
2064
- method: 'Runtime.globalLexicalScopeNames',
2065
- params?: Runtime.GlobalLexicalScopeNamesParameterType,
2066
- callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void
2067
- ): void;
2068
- post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
2069
- /**
2070
- * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
2071
- */
2072
- post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void;
2073
- /**
2074
- * Disables debugger for given page.
2075
- */
2076
- post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void;
2077
- /**
2078
- * Activates / deactivates all breakpoints on the page.
2079
- */
2080
- post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void;
2081
- post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void;
2082
- /**
2083
- * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
2084
- */
2085
- post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void;
2086
- post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void;
2087
- /**
2088
- * 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.
2089
- */
2090
- post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
2091
- post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
2092
- /**
2093
- * Sets JavaScript breakpoint at a given location.
2094
- */
2095
- post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
2096
- post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
2097
- /**
2098
- * Removes JavaScript breakpoint.
2099
- */
2100
- post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void;
2101
- post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void;
2102
- /**
2103
- * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
2104
- */
2105
- post(
2106
- method: 'Debugger.getPossibleBreakpoints',
2107
- params?: Debugger.GetPossibleBreakpointsParameterType,
2108
- callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void
2109
- ): void;
2110
- post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void;
2111
- /**
2112
- * Continues execution until specific location is reached.
2113
- */
2114
- post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void;
2115
- post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void;
2116
- /**
2117
- * @experimental
2118
- */
2119
- post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void;
2120
- post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void;
2121
- /**
2122
- * Steps over the statement.
2123
- */
2124
- post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void;
2125
- /**
2126
- * Steps into the function call.
2127
- */
2128
- post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void;
2129
- post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void;
2130
- /**
2131
- * Steps out of the function call.
2132
- */
2133
- post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void;
2134
- /**
2135
- * Stops on the next JavaScript statement.
2136
- */
2137
- post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void;
2138
- /**
2139
- * 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.
2140
- * @experimental
2141
- */
2142
- post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void;
2143
- /**
2144
- * Resumes JavaScript execution.
2145
- */
2146
- post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void;
2147
- /**
2148
- * Returns stack trace with given <code>stackTraceId</code>.
2149
- * @experimental
2150
- */
2151
- post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
2152
- post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
2153
- /**
2154
- * Searches for given string in script content.
2155
- */
2156
- post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
2157
- post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
2158
- /**
2159
- * Edits JavaScript source live.
2160
- */
2161
- post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
2162
- post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
2163
- /**
2164
- * Restarts particular call frame from the beginning.
2165
- */
2166
- post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
2167
- post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
2168
- /**
2169
- * Returns source for the script with given id.
2170
- */
2171
- post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
2172
- post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
2173
- /**
2174
- * 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>.
2175
- */
2176
- post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void;
2177
- post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void;
2178
- /**
2179
- * Evaluates expression on a given call frame.
2180
- */
2181
- post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
2182
- post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
2183
- /**
2184
- * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
2185
- */
2186
- post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void;
2187
- post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void;
2188
- /**
2189
- * Changes return value in top frame. Available only at return break position.
2190
- * @experimental
2191
- */
2192
- post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void;
2193
- post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void;
2194
- /**
2195
- * Enables or disables async call stacks tracking.
2196
- */
2197
- post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
2198
- post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void;
2199
- /**
2200
- * 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.
2201
- * @experimental
2202
- */
2203
- post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void;
2204
- post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void;
2205
- /**
2206
- * 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.
2207
- * @experimental
2208
- */
2209
- post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void;
2210
- post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void;
2211
- /**
2212
- * Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification.
2213
- */
2214
- post(method: 'Console.enable', callback?: (err: Error | null) => void): void;
2215
- /**
2216
- * Disables console domain, prevents further console messages from being reported to the client.
2217
- */
2218
- post(method: 'Console.disable', callback?: (err: Error | null) => void): void;
2219
- /**
2220
- * Does nothing.
2221
- */
2222
- post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void;
2223
- post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void;
2224
- post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void;
2225
- /**
2226
- * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
2227
- */
2228
- post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void;
2229
- post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void;
2230
- post(method: 'Profiler.start', callback?: (err: Error | null) => void): void;
2231
- post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void;
2232
- /**
2233
- * 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.
2234
- */
2235
- post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void;
2236
- post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void;
2237
- /**
2238
- * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
2239
- */
2240
- post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void;
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
- * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
2247
- */
2248
- post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void;
2249
- post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void;
2250
- post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void;
2251
- post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
2252
- post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void;
2253
- post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
2254
- post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void;
2255
- post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void;
2256
- post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void;
2257
- post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void;
2258
- post(
2259
- method: 'HeapProfiler.getObjectByHeapObjectId',
2260
- params?: HeapProfiler.GetObjectByHeapObjectIdParameterType,
2261
- callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void
2262
- ): void;
2263
- post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void;
2264
- /**
2265
- * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
2266
- */
2267
- post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void;
2268
- post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void;
2269
- post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
2270
- post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
2271
- post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void;
2272
- post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void;
2273
- post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void;
2274
- post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
2275
- /**
2276
- * Gets supported tracing categories.
2277
- */
2278
- post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
2279
- /**
2280
- * Start trace events collection.
2281
- */
2282
- post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
2283
- post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void;
2284
- /**
2285
- * Stop trace events collection. Remaining collected events will be sent as a sequence of
2286
- * dataCollected events followed by tracingComplete event.
2287
- */
2288
- post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void;
2289
- /**
2290
- * Sends protocol message over session with given id.
2291
- */
2292
- post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
2293
- post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void;
2294
- /**
2295
- * Instructs the inspector to attach to running workers. Will also attach to new workers
2296
- * as they start
2297
- */
2298
- post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
2299
- post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void;
2300
- /**
2301
- * Detaches from all running workers and disables attaching to new workers as they are started.
2302
- */
2303
- post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void;
2304
- /**
2305
- * Detached from the worker with given sessionId.
2306
- */
2307
- post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void;
2308
- post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void;
2309
- /**
2310
- * Disables network tracking, prevents network events from being sent to the client.
2311
- */
2312
- post(method: 'Network.disable', callback?: (err: Error | null) => void): void;
2313
- /**
2314
- * Enables network tracking, network events will now be delivered to the client.
2315
- */
2316
- post(method: 'Network.enable', callback?: (err: Error | null) => void): void;
2317
- /**
2318
- * Returns post data sent with the request. Returns an error when no data was sent with the request.
2319
- */
2320
- post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
2321
- post(method: 'Network.getRequestPostData', callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
2322
- /**
2323
- * Returns content served for the given request.
2324
- */
2325
- post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
2326
- post(method: 'Network.getResponseBody', callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
2327
- /**
2328
- * Enables streaming of the response for the given requestId.
2329
- * If enabled, the dataReceived event contains the data that was received during streaming.
2330
- * @experimental
2331
- */
2332
- post(
2333
- method: 'Network.streamResourceContent',
2334
- params?: Network.StreamResourceContentParameterType,
2335
- callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void
2336
- ): void;
2337
- post(method: 'Network.streamResourceContent', callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void;
2338
- /**
2339
- * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
2340
- */
2341
- post(method: 'NodeRuntime.enable', callback?: (err: Error | null) => void): void;
2342
- /**
2343
- * Disable NodeRuntime events
2344
- */
2345
- post(method: 'NodeRuntime.disable', callback?: (err: Error | null) => void): void;
2346
- /**
2347
- * Enable the `NodeRuntime.waitingForDisconnect`.
2348
- */
2349
- post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
2350
- post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void;
2351
- post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void;
2352
- post(method: 'Target.setAutoAttach', callback?: (err: Error | null) => void): void;
2353
-
2354
- addListener(event: string, listener: (...args: any[]) => void): this;
2355
- /**
2356
- * Emitted when any notification from the V8 Inspector is received.
2357
- */
2358
- addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
2359
- /**
2360
- * Issued when new execution context is created.
2361
- */
2362
- addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2363
- /**
2364
- * Issued when execution context is destroyed.
2365
- */
2366
- addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2367
- /**
2368
- * Issued when all executionContexts were cleared in browser
2369
- */
2370
- addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
2371
- /**
2372
- * Issued when exception was thrown and unhandled.
2373
- */
2374
- addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2375
- /**
2376
- * Issued when unhandled exception was revoked.
2377
- */
2378
- addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2379
- /**
2380
- * Issued when console API was called.
2381
- */
2382
- addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2383
- /**
2384
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
2385
- */
2386
- addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2387
- /**
2388
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
2389
- */
2390
- addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2391
- /**
2392
- * Fired when virtual machine fails to parse the script.
2393
- */
2394
- addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2395
- /**
2396
- * Fired when breakpoint is resolved to an actual script and location.
2397
- */
2398
- addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2399
- /**
2400
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2401
- */
2402
- addListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2403
- /**
2404
- * Fired when the virtual machine resumed execution.
2405
- */
2406
- addListener(event: 'Debugger.resumed', listener: () => void): this;
2407
- /**
2408
- * Issued when new console message is added.
2409
- */
2410
- addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2411
- /**
2412
- * Sent when new profile recording is started using console.profile() call.
2413
- */
2414
- addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2415
- addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2416
- addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2417
- addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
2418
- addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2419
- /**
2420
- * 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.
2421
- */
2422
- addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2423
- /**
2424
- * If heap objects tracking has been started then backend may send update for one or more fragments
2425
- */
2426
- addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2427
- /**
2428
- * Contains an bucket of collected trace events.
2429
- */
2430
- addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2431
- /**
2432
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2433
- * delivered via dataCollected events.
2434
- */
2435
- addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
2436
- /**
2437
- * Issued when attached to a worker.
2438
- */
2439
- addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2440
- /**
2441
- * Issued when detached from the worker.
2442
- */
2443
- addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2444
- /**
2445
- * Notifies about a new protocol message received from the session
2446
- * (session ID is provided in attachedToWorker notification).
2447
- */
2448
- addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2449
- /**
2450
- * Fired when page is about to send HTTP request.
2451
- */
2452
- addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
2453
- /**
2454
- * Fired when HTTP response is available.
2455
- */
2456
- addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2457
- addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2458
- addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2459
- /**
2460
- * Fired when data chunk was received over the network.
2461
- */
2462
- addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2463
- /**
2464
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2465
- * enabled.
2466
- * It is fired when the Node process finished all code execution and is
2467
- * waiting for all frontends to disconnect.
2468
- */
2469
- addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
2470
- /**
2471
- * This event is fired when the runtime is waiting for the debugger. For
2472
- * example, when inspector.waitingForDebugger is called
2473
- */
2474
- addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2475
- addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2476
- addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2477
- emit(event: string | symbol, ...args: any[]): boolean;
2478
- emit(event: 'inspectorNotification', message: InspectorNotification<object>): boolean;
2479
- emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
2480
- emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
2481
- emit(event: 'Runtime.executionContextsCleared'): boolean;
2482
- emit(event: 'Runtime.exceptionThrown', message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
2483
- emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
2484
- emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
2485
- emit(event: 'Runtime.inspectRequested', message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
2486
- emit(event: 'Debugger.scriptParsed', message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
2487
- emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
2488
- emit(event: 'Debugger.breakpointResolved', message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
2489
- emit(event: 'Debugger.paused', message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
2490
- emit(event: 'Debugger.resumed'): boolean;
2491
- emit(event: 'Console.messageAdded', message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
2492
- emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
2493
- emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
2494
- emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
2495
- emit(event: 'HeapProfiler.resetProfiles'): boolean;
2496
- emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
2497
- emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
2498
- emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
2499
- emit(event: 'NodeTracing.dataCollected', message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
2500
- emit(event: 'NodeTracing.tracingComplete'): boolean;
2501
- emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
2502
- emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
2503
- emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
2504
- emit(event: 'Network.requestWillBeSent', message: InspectorNotification<Network.RequestWillBeSentEventDataType>): boolean;
2505
- emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
2506
- emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
2507
- emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
2508
- emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
2509
- emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
2510
- emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
2511
- emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
2512
- emit(event: 'Target.attachedToTarget', message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean;
2513
- on(event: string, listener: (...args: any[]) => void): this;
2514
- /**
2515
- * Emitted when any notification from the V8 Inspector is received.
2516
- */
2517
- on(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
2518
- /**
2519
- * Issued when new execution context is created.
2520
- */
2521
- on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2522
- /**
2523
- * Issued when execution context is destroyed.
2524
- */
2525
- on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2526
- /**
2527
- * Issued when all executionContexts were cleared in browser
2528
- */
2529
- on(event: 'Runtime.executionContextsCleared', listener: () => void): this;
2530
- /**
2531
- * Issued when exception was thrown and unhandled.
2532
- */
2533
- on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2534
- /**
2535
- * Issued when unhandled exception was revoked.
2536
- */
2537
- on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2538
- /**
2539
- * Issued when console API was called.
2540
- */
2541
- on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2542
- /**
2543
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
2544
- */
2545
- on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2546
- /**
2547
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
2548
- */
2549
- on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2550
- /**
2551
- * Fired when virtual machine fails to parse the script.
2552
- */
2553
- on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2554
- /**
2555
- * Fired when breakpoint is resolved to an actual script and location.
2556
- */
2557
- on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2558
- /**
2559
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2560
- */
2561
- on(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2562
- /**
2563
- * Fired when the virtual machine resumed execution.
2564
- */
2565
- on(event: 'Debugger.resumed', listener: () => void): this;
2566
- /**
2567
- * Issued when new console message is added.
2568
- */
2569
- on(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2570
- /**
2571
- * Sent when new profile recording is started using console.profile() call.
2572
- */
2573
- on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2574
- on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2575
- on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2576
- on(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
2577
- on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2578
- /**
2579
- * 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.
2580
- */
2581
- on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2582
- /**
2583
- * If heap objects tracking has been started then backend may send update for one or more fragments
2584
- */
2585
- on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2586
- /**
2587
- * Contains an bucket of collected trace events.
2588
- */
2589
- on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2590
- /**
2591
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2592
- * delivered via dataCollected events.
2593
- */
2594
- on(event: 'NodeTracing.tracingComplete', listener: () => void): this;
2595
- /**
2596
- * Issued when attached to a worker.
2597
- */
2598
- on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2599
- /**
2600
- * Issued when detached from the worker.
2601
- */
2602
- on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2603
- /**
2604
- * Notifies about a new protocol message received from the session
2605
- * (session ID is provided in attachedToWorker notification).
2606
- */
2607
- on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2608
- /**
2609
- * Fired when page is about to send HTTP request.
2610
- */
2611
- on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
2612
- /**
2613
- * Fired when HTTP response is available.
2614
- */
2615
- on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2616
- on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2617
- on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2618
- /**
2619
- * Fired when data chunk was received over the network.
2620
- */
2621
- on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2622
- /**
2623
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2624
- * enabled.
2625
- * It is fired when the Node process finished all code execution and is
2626
- * waiting for all frontends to disconnect.
2627
- */
2628
- on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
2629
- /**
2630
- * This event is fired when the runtime is waiting for the debugger. For
2631
- * example, when inspector.waitingForDebugger is called
2632
- */
2633
- on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2634
- on(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2635
- on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2636
- once(event: string, listener: (...args: any[]) => void): this;
2637
- /**
2638
- * Emitted when any notification from the V8 Inspector is received.
2639
- */
2640
- once(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
2641
- /**
2642
- * Issued when new execution context is created.
2643
- */
2644
- once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2645
- /**
2646
- * Issued when execution context is destroyed.
2647
- */
2648
- once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2649
- /**
2650
- * Issued when all executionContexts were cleared in browser
2651
- */
2652
- once(event: 'Runtime.executionContextsCleared', listener: () => void): this;
2653
- /**
2654
- * Issued when exception was thrown and unhandled.
2655
- */
2656
- once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2657
- /**
2658
- * Issued when unhandled exception was revoked.
2659
- */
2660
- once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2661
- /**
2662
- * Issued when console API was called.
2663
- */
2664
- once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2665
- /**
2666
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
2667
- */
2668
- once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2669
- /**
2670
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
2671
- */
2672
- once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2673
- /**
2674
- * Fired when virtual machine fails to parse the script.
2675
- */
2676
- once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2677
- /**
2678
- * Fired when breakpoint is resolved to an actual script and location.
2679
- */
2680
- once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2681
- /**
2682
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2683
- */
2684
- once(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2685
- /**
2686
- * Fired when the virtual machine resumed execution.
2687
- */
2688
- once(event: 'Debugger.resumed', listener: () => void): this;
2689
- /**
2690
- * Issued when new console message is added.
2691
- */
2692
- once(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2693
- /**
2694
- * Sent when new profile recording is started using console.profile() call.
2695
- */
2696
- once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2697
- once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2698
- once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2699
- once(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
2700
- once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2701
- /**
2702
- * 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.
2703
- */
2704
- once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2705
- /**
2706
- * If heap objects tracking has been started then backend may send update for one or more fragments
2707
- */
2708
- once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2709
- /**
2710
- * Contains an bucket of collected trace events.
2711
- */
2712
- once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2713
- /**
2714
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2715
- * delivered via dataCollected events.
2716
- */
2717
- once(event: 'NodeTracing.tracingComplete', listener: () => void): this;
2718
- /**
2719
- * Issued when attached to a worker.
2720
- */
2721
- once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2722
- /**
2723
- * Issued when detached from the worker.
2724
- */
2725
- once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2726
- /**
2727
- * Notifies about a new protocol message received from the session
2728
- * (session ID is provided in attachedToWorker notification).
2729
- */
2730
- once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2731
- /**
2732
- * Fired when page is about to send HTTP request.
2733
- */
2734
- once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
2735
- /**
2736
- * Fired when HTTP response is available.
2737
- */
2738
- once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2739
- once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2740
- once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2741
- /**
2742
- * Fired when data chunk was received over the network.
2743
- */
2744
- once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2745
- /**
2746
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2747
- * enabled.
2748
- * It is fired when the Node process finished all code execution and is
2749
- * waiting for all frontends to disconnect.
2750
- */
2751
- once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
2752
- /**
2753
- * This event is fired when the runtime is waiting for the debugger. For
2754
- * example, when inspector.waitingForDebugger is called
2755
- */
2756
- once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2757
- once(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2758
- once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2759
- prependListener(event: string, listener: (...args: any[]) => void): this;
2760
- /**
2761
- * Emitted when any notification from the V8 Inspector is received.
2762
- */
2763
- prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
2764
- /**
2765
- * Issued when new execution context is created.
2766
- */
2767
- prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2768
- /**
2769
- * Issued when execution context is destroyed.
2770
- */
2771
- prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2772
- /**
2773
- * Issued when all executionContexts were cleared in browser
2774
- */
2775
- prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
2776
- /**
2777
- * Issued when exception was thrown and unhandled.
2778
- */
2779
- prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2780
- /**
2781
- * Issued when unhandled exception was revoked.
2782
- */
2783
- prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2784
- /**
2785
- * Issued when console API was called.
2786
- */
2787
- prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2788
- /**
2789
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
2790
- */
2791
- prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2792
- /**
2793
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
2794
- */
2795
- prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2796
- /**
2797
- * Fired when virtual machine fails to parse the script.
2798
- */
2799
- prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2800
- /**
2801
- * Fired when breakpoint is resolved to an actual script and location.
2802
- */
2803
- prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2804
- /**
2805
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2806
- */
2807
- prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2808
- /**
2809
- * Fired when the virtual machine resumed execution.
2810
- */
2811
- prependListener(event: 'Debugger.resumed', listener: () => void): this;
2812
- /**
2813
- * Issued when new console message is added.
2814
- */
2815
- prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2816
- /**
2817
- * Sent when new profile recording is started using console.profile() call.
2818
- */
2819
- prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2820
- prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2821
- prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2822
- prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
2823
- prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2824
- /**
2825
- * 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.
2826
- */
2827
- prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2828
- /**
2829
- * If heap objects tracking has been started then backend may send update for one or more fragments
2830
- */
2831
- prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2832
- /**
2833
- * Contains an bucket of collected trace events.
2834
- */
2835
- prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2836
- /**
2837
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2838
- * delivered via dataCollected events.
2839
- */
2840
- prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
2841
- /**
2842
- * Issued when attached to a worker.
2843
- */
2844
- prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2845
- /**
2846
- * Issued when detached from the worker.
2847
- */
2848
- prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2849
- /**
2850
- * Notifies about a new protocol message received from the session
2851
- * (session ID is provided in attachedToWorker notification).
2852
- */
2853
- prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2854
- /**
2855
- * Fired when page is about to send HTTP request.
2856
- */
2857
- prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
2858
- /**
2859
- * Fired when HTTP response is available.
2860
- */
2861
- prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2862
- prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2863
- prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2864
- /**
2865
- * Fired when data chunk was received over the network.
2866
- */
2867
- prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2868
- /**
2869
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2870
- * enabled.
2871
- * It is fired when the Node process finished all code execution and is
2872
- * waiting for all frontends to disconnect.
2873
- */
2874
- prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
2875
- /**
2876
- * This event is fired when the runtime is waiting for the debugger. For
2877
- * example, when inspector.waitingForDebugger is called
2878
- */
2879
- prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2880
- prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2881
- prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2882
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
2883
- /**
2884
- * Emitted when any notification from the V8 Inspector is received.
2885
- */
2886
- prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
2887
- /**
2888
- * Issued when new execution context is created.
2889
- */
2890
- prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
2891
- /**
2892
- * Issued when execution context is destroyed.
2893
- */
2894
- prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
2895
- /**
2896
- * Issued when all executionContexts were cleared in browser
2897
- */
2898
- prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
2899
- /**
2900
- * Issued when exception was thrown and unhandled.
2901
- */
2902
- prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
2903
- /**
2904
- * Issued when unhandled exception was revoked.
2905
- */
2906
- prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
2907
- /**
2908
- * Issued when console API was called.
2909
- */
2910
- prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
2911
- /**
2912
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
2913
- */
2914
- prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
2915
- /**
2916
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
2917
- */
2918
- prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
2919
- /**
2920
- * Fired when virtual machine fails to parse the script.
2921
- */
2922
- prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
2923
- /**
2924
- * Fired when breakpoint is resolved to an actual script and location.
2925
- */
2926
- prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
2927
- /**
2928
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
2929
- */
2930
- prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
2931
- /**
2932
- * Fired when the virtual machine resumed execution.
2933
- */
2934
- prependOnceListener(event: 'Debugger.resumed', listener: () => void): this;
2935
- /**
2936
- * Issued when new console message is added.
2937
- */
2938
- prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
2939
- /**
2940
- * Sent when new profile recording is started using console.profile() call.
2941
- */
2942
- prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
2943
- prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
2944
- prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
2945
- prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
2946
- prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
2947
- /**
2948
- * 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.
2949
- */
2950
- prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
2951
- /**
2952
- * If heap objects tracking has been started then backend may send update for one or more fragments
2953
- */
2954
- prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2955
- /**
2956
- * Contains an bucket of collected trace events.
2957
- */
2958
- prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2959
- /**
2960
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2961
- * delivered via dataCollected events.
2962
- */
2963
- prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
2964
- /**
2965
- * Issued when attached to a worker.
2966
- */
2967
- prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2968
- /**
2969
- * Issued when detached from the worker.
2970
- */
2971
- prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2972
- /**
2973
- * Notifies about a new protocol message received from the session
2974
- * (session ID is provided in attachedToWorker notification).
2975
- */
2976
- prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2977
- /**
2978
- * Fired when page is about to send HTTP request.
2979
- */
2980
- prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
2981
- /**
2982
- * Fired when HTTP response is available.
2983
- */
2984
- prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2985
- prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2986
- prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2987
- /**
2988
- * Fired when data chunk was received over the network.
2989
- */
2990
- prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2991
- /**
2992
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2993
- * enabled.
2994
- * It is fired when the Node process finished all code execution and is
2995
- * waiting for all frontends to disconnect.
2996
- */
2997
- prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
2998
- /**
2999
- * This event is fired when the runtime is waiting for the debugger. For
3000
- * example, when inspector.waitingForDebugger is called
3001
- */
3002
- prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3003
- prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3004
- prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3005
- }
3006
-
3007
- /**
3008
- * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has
3009
- * started.
3010
- *
3011
- * If wait is `true`, will block until a client has connected to the inspect port
3012
- * and flow control has been passed to the debugger client.
3013
- *
3014
- * See the [security warning](https://nodejs.org/docs/latest-v24.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure)
3015
- * regarding the `host` parameter usage.
3016
- * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI.
3017
- * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI.
3018
- * @param wait Block until a client has connected. Defaults to what was specified on the CLI.
3019
- * @returns Disposable that calls `inspector.close()`.
3020
- */
3021
- function open(port?: number, host?: string, wait?: boolean): Disposable;
3022
-
3023
- /**
3024
- * Deactivate the inspector. Blocks until there are no active connections.
3025
- */
3026
- function close(): void;
3027
-
3028
- /**
3029
- * Return the URL of the active inspector, or `undefined` if there is none.
3030
- *
3031
- * ```console
3032
- * $ node --inspect -p 'inspector.url()'
3033
- * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
3034
- * For help, see: https://nodejs.org/en/docs/inspector
3035
- * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
3036
- *
3037
- * $ node --inspect=localhost:3000 -p 'inspector.url()'
3038
- * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
3039
- * For help, see: https://nodejs.org/en/docs/inspector
3040
- * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
3041
- *
3042
- * $ node -p 'inspector.url()'
3043
- * undefined
3044
- * ```
3045
- */
3046
- function url(): string | undefined;
3047
-
3048
- /**
3049
- * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command.
3050
- *
3051
- * An exception will be thrown if there is no active inspector.
3052
- * @since v12.7.0
3053
- */
3054
- function waitForDebugger(): void;
3055
-
3056
- // These methods are exposed by the V8 inspector console API (inspector/v8-console.h).
3057
- // The method signatures differ from those of the Node.js console, and are deliberately
3058
- // typed permissively.
3059
- interface InspectorConsole {
3060
- debug(...data: any[]): void;
3061
- error(...data: any[]): void;
3062
- info(...data: any[]): void;
3063
- log(...data: any[]): void;
3064
- warn(...data: any[]): void;
3065
- dir(...data: any[]): void;
3066
- dirxml(...data: any[]): void;
3067
- table(...data: any[]): void;
3068
- trace(...data: any[]): void;
3069
- group(...data: any[]): void;
3070
- groupCollapsed(...data: any[]): void;
3071
- groupEnd(...data: any[]): void;
3072
- clear(...data: any[]): void;
3073
- count(label?: any): void;
3074
- countReset(label?: any): void;
3075
- assert(value?: any, ...data: any[]): void;
3076
- profile(label?: any): void;
3077
- profileEnd(label?: any): void;
3078
- time(label?: any): void;
3079
- timeLog(label?: any): void;
3080
- timeStamp(label?: any): void;
3081
- }
3082
-
3083
- /**
3084
- * An object to send messages to the remote inspector console.
3085
- * @since v11.0.0
3086
- */
3087
- const console: InspectorConsole;
3088
-
3089
- // DevTools protocol event broadcast methods
3090
- namespace Network {
3091
- /**
3092
- * This feature is only available with the `--experimental-network-inspection` flag enabled.
3093
- *
3094
- * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
3095
- * the application is about to send an HTTP request.
3096
- * @since v22.6.0
3097
- */
3098
- function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
3099
- /**
3100
- * This feature is only available with the `--experimental-network-inspection` flag enabled.
3101
- *
3102
- * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
3103
- * `Network.streamResourceContent` command was not invoked for the given request yet.
3104
- *
3105
- * Also enables `Network.getResponseBody` command to retrieve the response data.
3106
- * @since v24.2.0
3107
- */
3108
- function dataReceived(params: DataReceivedEventDataType): void;
3109
- /**
3110
- * This feature is only available with the `--experimental-network-inspection` flag enabled.
3111
- *
3112
- * Enables `Network.getRequestPostData` command to retrieve the request data.
3113
- * @since v24.3.0
3114
- */
3115
- function dataSent(params: unknown): void;
3116
- /**
3117
- * This feature is only available with the `--experimental-network-inspection` flag enabled.
3118
- *
3119
- * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
3120
- * HTTP response is available.
3121
- * @since v22.6.0
3122
- */
3123
- function responseReceived(params: ResponseReceivedEventDataType): void;
3124
- /**
3125
- * This feature is only available with the `--experimental-network-inspection` flag enabled.
3126
- *
3127
- * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
3128
- * HTTP request has finished loading.
3129
- * @since v22.6.0
3130
- */
3131
- function loadingFinished(params: LoadingFinishedEventDataType): void;
3132
- /**
3133
- * This feature is only available with the `--experimental-network-inspection` flag enabled.
3134
- *
3135
- * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
3136
- * HTTP request has failed to load.
3137
- * @since v22.7.0
3138
- */
3139
- function loadingFailed(params: LoadingFailedEventDataType): void;
3140
- }
3141
- }
3142
-
3143
- /**
3144
- * The `node:inspector` module provides an API for interacting with the V8
3145
- * inspector.
3146
- */
3147
- declare module 'node:inspector' {
3148
- export * from 'inspector';
3149
- }
3150
-
3151
- /**
3152
- * The `node:inspector/promises` module provides an API for interacting with the V8
3153
- * inspector.
3154
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector/promises.js)
3155
- * @since v19.0.0
3156
- */
3157
- declare module 'inspector/promises' {
3158
- import EventEmitter = require('node:events');
3159
- import {
3160
- open,
3161
- close,
3162
- url,
3163
- waitForDebugger,
3164
- console,
3165
- InspectorNotification,
3166
- Schema,
3167
- Runtime,
3168
- Debugger,
3169
- Console,
3170
- Profiler,
3171
- HeapProfiler,
3172
- NodeTracing,
3173
- NodeWorker,
3174
- Network,
3175
- NodeRuntime,
3176
- Target,
3177
- } from 'inspector';
3178
-
3179
- /**
3180
- * The `inspector.Session` is used for dispatching messages to the V8 inspector
3181
- * back-end and receiving message responses and notifications.
3182
- * @since v19.0.0
3183
- */
3184
- class Session extends EventEmitter {
3185
- /**
3186
- * Create a new instance of the `inspector.Session` class.
3187
- * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend.
3188
- */
3189
- constructor();
3190
-
3191
- /**
3192
- * Connects a session to the inspector back-end.
3193
- */
3194
- connect(): void;
3195
-
3196
- /**
3197
- * Connects a session to the inspector back-end.
3198
- * An exception will be thrown if this API was not called on a Worker thread.
3199
- */
3200
- connectToMainThread(): void;
3201
-
3202
- /**
3203
- * Immediately close the session. All pending message callbacks will be called with an error.
3204
- * `session.connect()` will need to be called to be able to send messages again.
3205
- * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
3206
- */
3207
- disconnect(): void;
3208
-
3209
- /**
3210
- * Posts a message to the inspector back-end.
3211
- *
3212
- * ```js
3213
- * import { Session } from 'node:inspector/promises';
3214
- * try {
3215
- * const session = new Session();
3216
- * session.connect();
3217
- * const result = await session.post('Runtime.evaluate', { expression: '2 + 2' });
3218
- * console.log(result);
3219
- * } catch (error) {
3220
- * console.error(error);
3221
- * }
3222
- * // Output: { result: { type: 'number', value: 4, description: '4' } }
3223
- * ```
3224
- *
3225
- * The latest version of the V8 inspector protocol is published on the
3226
- * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
3227
- *
3228
- * Node.js inspector supports all the Chrome DevTools Protocol domains declared
3229
- * by V8. Chrome DevTools Protocol domain provides an interface for interacting
3230
- * with one of the runtime agents used to inspect the application state and listen
3231
- * to the run-time events.
3232
- */
3233
- post(method: string, params?: object): Promise<void>;
3234
- /**
3235
- * Returns supported domains.
3236
- */
3237
- post(method: 'Schema.getDomains'): Promise<Schema.GetDomainsReturnType>;
3238
- /**
3239
- * Evaluates expression on global object.
3240
- */
3241
- post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType): Promise<Runtime.EvaluateReturnType>;
3242
- /**
3243
- * Add handler to promise with given promise object id.
3244
- */
3245
- post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType): Promise<Runtime.AwaitPromiseReturnType>;
3246
- /**
3247
- * Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
3248
- */
3249
- post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType): Promise<Runtime.CallFunctionOnReturnType>;
3250
- /**
3251
- * Returns properties of a given object. Object group of the result is inherited from the target object.
3252
- */
3253
- post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType): Promise<Runtime.GetPropertiesReturnType>;
3254
- /**
3255
- * Releases remote object with given id.
3256
- */
3257
- post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType): Promise<void>;
3258
- /**
3259
- * Releases all remote objects that belong to a given group.
3260
- */
3261
- post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType): Promise<void>;
3262
- /**
3263
- * Tells inspected instance to run if it was waiting for debugger to attach.
3264
- */
3265
- post(method: 'Runtime.runIfWaitingForDebugger'): Promise<void>;
3266
- /**
3267
- * 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.
3268
- */
3269
- post(method: 'Runtime.enable'): Promise<void>;
3270
- /**
3271
- * Disables reporting of execution contexts creation.
3272
- */
3273
- post(method: 'Runtime.disable'): Promise<void>;
3274
- /**
3275
- * Discards collected exceptions and console API calls.
3276
- */
3277
- post(method: 'Runtime.discardConsoleEntries'): Promise<void>;
3278
- /**
3279
- * @experimental
3280
- */
3281
- post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise<void>;
3282
- /**
3283
- * Compiles expression.
3284
- */
3285
- post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType): Promise<Runtime.CompileScriptReturnType>;
3286
- /**
3287
- * Runs script with given id in a given context.
3288
- */
3289
- post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType): Promise<Runtime.RunScriptReturnType>;
3290
- post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType): Promise<Runtime.QueryObjectsReturnType>;
3291
- /**
3292
- * Returns all let, const and class variables from global scope.
3293
- */
3294
- post(method: 'Runtime.globalLexicalScopeNames', params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise<Runtime.GlobalLexicalScopeNamesReturnType>;
3295
- /**
3296
- * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
3297
- */
3298
- post(method: 'Debugger.enable'): Promise<Debugger.EnableReturnType>;
3299
- /**
3300
- * Disables debugger for given page.
3301
- */
3302
- post(method: 'Debugger.disable'): Promise<void>;
3303
- /**
3304
- * Activates / deactivates all breakpoints on the page.
3305
- */
3306
- post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType): Promise<void>;
3307
- /**
3308
- * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
3309
- */
3310
- post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType): Promise<void>;
3311
- /**
3312
- * 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.
3313
- */
3314
- post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType): Promise<Debugger.SetBreakpointByUrlReturnType>;
3315
- /**
3316
- * Sets JavaScript breakpoint at a given location.
3317
- */
3318
- post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType): Promise<Debugger.SetBreakpointReturnType>;
3319
- /**
3320
- * Removes JavaScript breakpoint.
3321
- */
3322
- post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType): Promise<void>;
3323
- /**
3324
- * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
3325
- */
3326
- post(method: 'Debugger.getPossibleBreakpoints', params?: Debugger.GetPossibleBreakpointsParameterType): Promise<Debugger.GetPossibleBreakpointsReturnType>;
3327
- /**
3328
- * Continues execution until specific location is reached.
3329
- */
3330
- post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType): Promise<void>;
3331
- /**
3332
- * @experimental
3333
- */
3334
- post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType): Promise<void>;
3335
- /**
3336
- * Steps over the statement.
3337
- */
3338
- post(method: 'Debugger.stepOver'): Promise<void>;
3339
- /**
3340
- * Steps into the function call.
3341
- */
3342
- post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType): Promise<void>;
3343
- /**
3344
- * Steps out of the function call.
3345
- */
3346
- post(method: 'Debugger.stepOut'): Promise<void>;
3347
- /**
3348
- * Stops on the next JavaScript statement.
3349
- */
3350
- post(method: 'Debugger.pause'): Promise<void>;
3351
- /**
3352
- * 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.
3353
- * @experimental
3354
- */
3355
- post(method: 'Debugger.scheduleStepIntoAsync'): Promise<void>;
3356
- /**
3357
- * Resumes JavaScript execution.
3358
- */
3359
- post(method: 'Debugger.resume'): Promise<void>;
3360
- /**
3361
- * Returns stack trace with given <code>stackTraceId</code>.
3362
- * @experimental
3363
- */
3364
- post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType): Promise<Debugger.GetStackTraceReturnType>;
3365
- /**
3366
- * Searches for given string in script content.
3367
- */
3368
- post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType): Promise<Debugger.SearchInContentReturnType>;
3369
- /**
3370
- * Edits JavaScript source live.
3371
- */
3372
- post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType): Promise<Debugger.SetScriptSourceReturnType>;
3373
- /**
3374
- * Restarts particular call frame from the beginning.
3375
- */
3376
- post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType): Promise<Debugger.RestartFrameReturnType>;
3377
- /**
3378
- * Returns source for the script with given id.
3379
- */
3380
- post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType): Promise<Debugger.GetScriptSourceReturnType>;
3381
- /**
3382
- * 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>.
3383
- */
3384
- post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType): Promise<void>;
3385
- /**
3386
- * Evaluates expression on a given call frame.
3387
- */
3388
- post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType): Promise<Debugger.EvaluateOnCallFrameReturnType>;
3389
- /**
3390
- * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
3391
- */
3392
- post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType): Promise<void>;
3393
- /**
3394
- * Changes return value in top frame. Available only at return break position.
3395
- * @experimental
3396
- */
3397
- post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType): Promise<void>;
3398
- /**
3399
- * Enables or disables async call stacks tracking.
3400
- */
3401
- post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType): Promise<void>;
3402
- /**
3403
- * 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.
3404
- * @experimental
3405
- */
3406
- post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType): Promise<void>;
3407
- /**
3408
- * 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.
3409
- * @experimental
3410
- */
3411
- post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType): Promise<void>;
3412
- /**
3413
- * Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification.
3414
- */
3415
- post(method: 'Console.enable'): Promise<void>;
3416
- /**
3417
- * Disables console domain, prevents further console messages from being reported to the client.
3418
- */
3419
- post(method: 'Console.disable'): Promise<void>;
3420
- /**
3421
- * Does nothing.
3422
- */
3423
- post(method: 'Console.clearMessages'): Promise<void>;
3424
- post(method: 'Profiler.enable'): Promise<void>;
3425
- post(method: 'Profiler.disable'): Promise<void>;
3426
- /**
3427
- * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
3428
- */
3429
- post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType): Promise<void>;
3430
- post(method: 'Profiler.start'): Promise<void>;
3431
- post(method: 'Profiler.stop'): Promise<Profiler.StopReturnType>;
3432
- /**
3433
- * 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.
3434
- */
3435
- post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType): Promise<void>;
3436
- /**
3437
- * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
3438
- */
3439
- post(method: 'Profiler.stopPreciseCoverage'): Promise<void>;
3440
- /**
3441
- * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
3442
- */
3443
- post(method: 'Profiler.takePreciseCoverage'): Promise<Profiler.TakePreciseCoverageReturnType>;
3444
- /**
3445
- * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
3446
- */
3447
- post(method: 'Profiler.getBestEffortCoverage'): Promise<Profiler.GetBestEffortCoverageReturnType>;
3448
- post(method: 'HeapProfiler.enable'): Promise<void>;
3449
- post(method: 'HeapProfiler.disable'): Promise<void>;
3450
- post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise<void>;
3451
- post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise<void>;
3452
- post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise<void>;
3453
- post(method: 'HeapProfiler.collectGarbage'): Promise<void>;
3454
- post(method: 'HeapProfiler.getObjectByHeapObjectId', params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise<HeapProfiler.GetObjectByHeapObjectIdReturnType>;
3455
- /**
3456
- * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
3457
- */
3458
- post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise<void>;
3459
- post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType): Promise<HeapProfiler.GetHeapObjectIdReturnType>;
3460
- post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType): Promise<void>;
3461
- post(method: 'HeapProfiler.stopSampling'): Promise<HeapProfiler.StopSamplingReturnType>;
3462
- post(method: 'HeapProfiler.getSamplingProfile'): Promise<HeapProfiler.GetSamplingProfileReturnType>;
3463
- /**
3464
- * Gets supported tracing categories.
3465
- */
3466
- post(method: 'NodeTracing.getCategories'): Promise<NodeTracing.GetCategoriesReturnType>;
3467
- /**
3468
- * Start trace events collection.
3469
- */
3470
- post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType): Promise<void>;
3471
- /**
3472
- * Stop trace events collection. Remaining collected events will be sent as a sequence of
3473
- * dataCollected events followed by tracingComplete event.
3474
- */
3475
- post(method: 'NodeTracing.stop'): Promise<void>;
3476
- /**
3477
- * Sends protocol message over session with given id.
3478
- */
3479
- post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType): Promise<void>;
3480
- /**
3481
- * Instructs the inspector to attach to running workers. Will also attach to new workers
3482
- * as they start
3483
- */
3484
- post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType): Promise<void>;
3485
- /**
3486
- * Detaches from all running workers and disables attaching to new workers as they are started.
3487
- */
3488
- post(method: 'NodeWorker.disable'): Promise<void>;
3489
- /**
3490
- * Detached from the worker with given sessionId.
3491
- */
3492
- post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType): Promise<void>;
3493
- /**
3494
- * Disables network tracking, prevents network events from being sent to the client.
3495
- */
3496
- post(method: 'Network.disable'): Promise<void>;
3497
- /**
3498
- * Enables network tracking, network events will now be delivered to the client.
3499
- */
3500
- post(method: 'Network.enable'): Promise<void>;
3501
- /**
3502
- * Returns post data sent with the request. Returns an error when no data was sent with the request.
3503
- */
3504
- post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType): Promise<Network.GetRequestPostDataReturnType>;
3505
- /**
3506
- * Returns content served for the given request.
3507
- */
3508
- post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType): Promise<Network.GetResponseBodyReturnType>;
3509
- /**
3510
- * Enables streaming of the response for the given requestId.
3511
- * If enabled, the dataReceived event contains the data that was received during streaming.
3512
- * @experimental
3513
- */
3514
- post(method: 'Network.streamResourceContent', params?: Network.StreamResourceContentParameterType): Promise<Network.StreamResourceContentReturnType>;
3515
- /**
3516
- * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
3517
- */
3518
- post(method: 'NodeRuntime.enable'): Promise<void>;
3519
- /**
3520
- * Disable NodeRuntime events
3521
- */
3522
- post(method: 'NodeRuntime.disable'): Promise<void>;
3523
- /**
3524
- * Enable the `NodeRuntime.waitingForDisconnect`.
3525
- */
3526
- post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise<void>;
3527
- post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType): Promise<void>;
3528
-
3529
- addListener(event: string, listener: (...args: any[]) => void): this;
3530
- /**
3531
- * Emitted when any notification from the V8 Inspector is received.
3532
- */
3533
- addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
3534
- /**
3535
- * Issued when new execution context is created.
3536
- */
3537
- addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3538
- /**
3539
- * Issued when execution context is destroyed.
3540
- */
3541
- addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3542
- /**
3543
- * Issued when all executionContexts were cleared in browser
3544
- */
3545
- addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
3546
- /**
3547
- * Issued when exception was thrown and unhandled.
3548
- */
3549
- addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3550
- /**
3551
- * Issued when unhandled exception was revoked.
3552
- */
3553
- addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3554
- /**
3555
- * Issued when console API was called.
3556
- */
3557
- addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3558
- /**
3559
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
3560
- */
3561
- addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3562
- /**
3563
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
3564
- */
3565
- addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3566
- /**
3567
- * Fired when virtual machine fails to parse the script.
3568
- */
3569
- addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3570
- /**
3571
- * Fired when breakpoint is resolved to an actual script and location.
3572
- */
3573
- addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
3574
- /**
3575
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
3576
- */
3577
- addListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
3578
- /**
3579
- * Fired when the virtual machine resumed execution.
3580
- */
3581
- addListener(event: 'Debugger.resumed', listener: () => void): this;
3582
- /**
3583
- * Issued when new console message is added.
3584
- */
3585
- addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
3586
- /**
3587
- * Sent when new profile recording is started using console.profile() call.
3588
- */
3589
- addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3590
- addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3591
- addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3592
- addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
3593
- addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3594
- /**
3595
- * 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.
3596
- */
3597
- addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
3598
- /**
3599
- * If heap objects tracking has been started then backend may send update for one or more fragments
3600
- */
3601
- addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
3602
- /**
3603
- * Contains an bucket of collected trace events.
3604
- */
3605
- addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
3606
- /**
3607
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
3608
- * delivered via dataCollected events.
3609
- */
3610
- addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
3611
- /**
3612
- * Issued when attached to a worker.
3613
- */
3614
- addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3615
- /**
3616
- * Issued when detached from the worker.
3617
- */
3618
- addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3619
- /**
3620
- * Notifies about a new protocol message received from the session
3621
- * (session ID is provided in attachedToWorker notification).
3622
- */
3623
- addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3624
- /**
3625
- * Fired when page is about to send HTTP request.
3626
- */
3627
- addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
3628
- /**
3629
- * Fired when HTTP response is available.
3630
- */
3631
- addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3632
- addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3633
- addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3634
- /**
3635
- * Fired when data chunk was received over the network.
3636
- */
3637
- addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3638
- /**
3639
- * This event is fired instead of `Runtime.executionContextDestroyed` when
3640
- * enabled.
3641
- * It is fired when the Node process finished all code execution and is
3642
- * waiting for all frontends to disconnect.
3643
- */
3644
- addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
3645
- /**
3646
- * This event is fired when the runtime is waiting for the debugger. For
3647
- * example, when inspector.waitingForDebugger is called
3648
- */
3649
- addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3650
- addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3651
- addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3652
- emit(event: string | symbol, ...args: any[]): boolean;
3653
- emit(event: 'inspectorNotification', message: InspectorNotification<object>): boolean;
3654
- emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
3655
- emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
3656
- emit(event: 'Runtime.executionContextsCleared'): boolean;
3657
- emit(event: 'Runtime.exceptionThrown', message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
3658
- emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
3659
- emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
3660
- emit(event: 'Runtime.inspectRequested', message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
3661
- emit(event: 'Debugger.scriptParsed', message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
3662
- emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
3663
- emit(event: 'Debugger.breakpointResolved', message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
3664
- emit(event: 'Debugger.paused', message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
3665
- emit(event: 'Debugger.resumed'): boolean;
3666
- emit(event: 'Console.messageAdded', message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
3667
- emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
3668
- emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
3669
- emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
3670
- emit(event: 'HeapProfiler.resetProfiles'): boolean;
3671
- emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
3672
- emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
3673
- emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
3674
- emit(event: 'NodeTracing.dataCollected', message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
3675
- emit(event: 'NodeTracing.tracingComplete'): boolean;
3676
- emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
3677
- emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
3678
- emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
3679
- emit(event: 'Network.requestWillBeSent', message: InspectorNotification<Network.RequestWillBeSentEventDataType>): boolean;
3680
- emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
3681
- emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
3682
- emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
3683
- emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
3684
- emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
3685
- emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
3686
- emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
3687
- emit(event: 'Target.attachedToTarget', message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean;
3688
- on(event: string, listener: (...args: any[]) => void): this;
3689
- /**
3690
- * Emitted when any notification from the V8 Inspector is received.
3691
- */
3692
- on(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
3693
- /**
3694
- * Issued when new execution context is created.
3695
- */
3696
- on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3697
- /**
3698
- * Issued when execution context is destroyed.
3699
- */
3700
- on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3701
- /**
3702
- * Issued when all executionContexts were cleared in browser
3703
- */
3704
- on(event: 'Runtime.executionContextsCleared', listener: () => void): this;
3705
- /**
3706
- * Issued when exception was thrown and unhandled.
3707
- */
3708
- on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3709
- /**
3710
- * Issued when unhandled exception was revoked.
3711
- */
3712
- on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3713
- /**
3714
- * Issued when console API was called.
3715
- */
3716
- on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3717
- /**
3718
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
3719
- */
3720
- on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3721
- /**
3722
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
3723
- */
3724
- on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3725
- /**
3726
- * Fired when virtual machine fails to parse the script.
3727
- */
3728
- on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3729
- /**
3730
- * Fired when breakpoint is resolved to an actual script and location.
3731
- */
3732
- on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
3733
- /**
3734
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
3735
- */
3736
- on(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
3737
- /**
3738
- * Fired when the virtual machine resumed execution.
3739
- */
3740
- on(event: 'Debugger.resumed', listener: () => void): this;
3741
- /**
3742
- * Issued when new console message is added.
3743
- */
3744
- on(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
3745
- /**
3746
- * Sent when new profile recording is started using console.profile() call.
3747
- */
3748
- on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3749
- on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3750
- on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3751
- on(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
3752
- on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3753
- /**
3754
- * 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.
3755
- */
3756
- on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
3757
- /**
3758
- * If heap objects tracking has been started then backend may send update for one or more fragments
3759
- */
3760
- on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
3761
- /**
3762
- * Contains an bucket of collected trace events.
3763
- */
3764
- on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
3765
- /**
3766
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
3767
- * delivered via dataCollected events.
3768
- */
3769
- on(event: 'NodeTracing.tracingComplete', listener: () => void): this;
3770
- /**
3771
- * Issued when attached to a worker.
3772
- */
3773
- on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3774
- /**
3775
- * Issued when detached from the worker.
3776
- */
3777
- on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3778
- /**
3779
- * Notifies about a new protocol message received from the session
3780
- * (session ID is provided in attachedToWorker notification).
3781
- */
3782
- on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3783
- /**
3784
- * Fired when page is about to send HTTP request.
3785
- */
3786
- on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
3787
- /**
3788
- * Fired when HTTP response is available.
3789
- */
3790
- on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3791
- on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3792
- on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3793
- /**
3794
- * Fired when data chunk was received over the network.
3795
- */
3796
- on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3797
- /**
3798
- * This event is fired instead of `Runtime.executionContextDestroyed` when
3799
- * enabled.
3800
- * It is fired when the Node process finished all code execution and is
3801
- * waiting for all frontends to disconnect.
3802
- */
3803
- on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
3804
- /**
3805
- * This event is fired when the runtime is waiting for the debugger. For
3806
- * example, when inspector.waitingForDebugger is called
3807
- */
3808
- on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3809
- on(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3810
- on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3811
- once(event: string, listener: (...args: any[]) => void): this;
3812
- /**
3813
- * Emitted when any notification from the V8 Inspector is received.
3814
- */
3815
- once(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
3816
- /**
3817
- * Issued when new execution context is created.
3818
- */
3819
- once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3820
- /**
3821
- * Issued when execution context is destroyed.
3822
- */
3823
- once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3824
- /**
3825
- * Issued when all executionContexts were cleared in browser
3826
- */
3827
- once(event: 'Runtime.executionContextsCleared', listener: () => void): this;
3828
- /**
3829
- * Issued when exception was thrown and unhandled.
3830
- */
3831
- once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3832
- /**
3833
- * Issued when unhandled exception was revoked.
3834
- */
3835
- once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3836
- /**
3837
- * Issued when console API was called.
3838
- */
3839
- once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3840
- /**
3841
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
3842
- */
3843
- once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3844
- /**
3845
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
3846
- */
3847
- once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3848
- /**
3849
- * Fired when virtual machine fails to parse the script.
3850
- */
3851
- once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3852
- /**
3853
- * Fired when breakpoint is resolved to an actual script and location.
3854
- */
3855
- once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
3856
- /**
3857
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
3858
- */
3859
- once(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
3860
- /**
3861
- * Fired when the virtual machine resumed execution.
3862
- */
3863
- once(event: 'Debugger.resumed', listener: () => void): this;
3864
- /**
3865
- * Issued when new console message is added.
3866
- */
3867
- once(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
3868
- /**
3869
- * Sent when new profile recording is started using console.profile() call.
3870
- */
3871
- once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3872
- once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3873
- once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3874
- once(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
3875
- once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3876
- /**
3877
- * 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.
3878
- */
3879
- once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
3880
- /**
3881
- * If heap objects tracking has been started then backend may send update for one or more fragments
3882
- */
3883
- once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
3884
- /**
3885
- * Contains an bucket of collected trace events.
3886
- */
3887
- once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
3888
- /**
3889
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
3890
- * delivered via dataCollected events.
3891
- */
3892
- once(event: 'NodeTracing.tracingComplete', listener: () => void): this;
3893
- /**
3894
- * Issued when attached to a worker.
3895
- */
3896
- once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
3897
- /**
3898
- * Issued when detached from the worker.
3899
- */
3900
- once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
3901
- /**
3902
- * Notifies about a new protocol message received from the session
3903
- * (session ID is provided in attachedToWorker notification).
3904
- */
3905
- once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3906
- /**
3907
- * Fired when page is about to send HTTP request.
3908
- */
3909
- once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
3910
- /**
3911
- * Fired when HTTP response is available.
3912
- */
3913
- once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3914
- once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3915
- once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3916
- /**
3917
- * Fired when data chunk was received over the network.
3918
- */
3919
- once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3920
- /**
3921
- * This event is fired instead of `Runtime.executionContextDestroyed` when
3922
- * enabled.
3923
- * It is fired when the Node process finished all code execution and is
3924
- * waiting for all frontends to disconnect.
3925
- */
3926
- once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
3927
- /**
3928
- * This event is fired when the runtime is waiting for the debugger. For
3929
- * example, when inspector.waitingForDebugger is called
3930
- */
3931
- once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3932
- once(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3933
- once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3934
- prependListener(event: string, listener: (...args: any[]) => void): this;
3935
- /**
3936
- * Emitted when any notification from the V8 Inspector is received.
3937
- */
3938
- prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
3939
- /**
3940
- * Issued when new execution context is created.
3941
- */
3942
- prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
3943
- /**
3944
- * Issued when execution context is destroyed.
3945
- */
3946
- prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
3947
- /**
3948
- * Issued when all executionContexts were cleared in browser
3949
- */
3950
- prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
3951
- /**
3952
- * Issued when exception was thrown and unhandled.
3953
- */
3954
- prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
3955
- /**
3956
- * Issued when unhandled exception was revoked.
3957
- */
3958
- prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
3959
- /**
3960
- * Issued when console API was called.
3961
- */
3962
- prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
3963
- /**
3964
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
3965
- */
3966
- prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
3967
- /**
3968
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
3969
- */
3970
- prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
3971
- /**
3972
- * Fired when virtual machine fails to parse the script.
3973
- */
3974
- prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
3975
- /**
3976
- * Fired when breakpoint is resolved to an actual script and location.
3977
- */
3978
- prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
3979
- /**
3980
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
3981
- */
3982
- prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
3983
- /**
3984
- * Fired when the virtual machine resumed execution.
3985
- */
3986
- prependListener(event: 'Debugger.resumed', listener: () => void): this;
3987
- /**
3988
- * Issued when new console message is added.
3989
- */
3990
- prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
3991
- /**
3992
- * Sent when new profile recording is started using console.profile() call.
3993
- */
3994
- prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
3995
- prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
3996
- prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
3997
- prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
3998
- prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
3999
- /**
4000
- * 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.
4001
- */
4002
- prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
4003
- /**
4004
- * If heap objects tracking has been started then backend may send update for one or more fragments
4005
- */
4006
- prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
4007
- /**
4008
- * Contains an bucket of collected trace events.
4009
- */
4010
- prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
4011
- /**
4012
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
4013
- * delivered via dataCollected events.
4014
- */
4015
- prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
4016
- /**
4017
- * Issued when attached to a worker.
4018
- */
4019
- prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
4020
- /**
4021
- * Issued when detached from the worker.
4022
- */
4023
- prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
4024
- /**
4025
- * Notifies about a new protocol message received from the session
4026
- * (session ID is provided in attachedToWorker notification).
4027
- */
4028
- prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
4029
- /**
4030
- * Fired when page is about to send HTTP request.
4031
- */
4032
- prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
4033
- /**
4034
- * Fired when HTTP response is available.
4035
- */
4036
- prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
4037
- prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
4038
- prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
4039
- /**
4040
- * Fired when data chunk was received over the network.
4041
- */
4042
- prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
4043
- /**
4044
- * This event is fired instead of `Runtime.executionContextDestroyed` when
4045
- * enabled.
4046
- * It is fired when the Node process finished all code execution and is
4047
- * waiting for all frontends to disconnect.
4048
- */
4049
- prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
4050
- /**
4051
- * This event is fired when the runtime is waiting for the debugger. For
4052
- * example, when inspector.waitingForDebugger is called
4053
- */
4054
- prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
4055
- prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
4056
- prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
4057
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
4058
- /**
4059
- * Emitted when any notification from the V8 Inspector is received.
4060
- */
4061
- prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<object>) => void): this;
4062
- /**
4063
- * Issued when new execution context is created.
4064
- */
4065
- prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
4066
- /**
4067
- * Issued when execution context is destroyed.
4068
- */
4069
- prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
4070
- /**
4071
- * Issued when all executionContexts were cleared in browser
4072
- */
4073
- prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this;
4074
- /**
4075
- * Issued when exception was thrown and unhandled.
4076
- */
4077
- prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
4078
- /**
4079
- * Issued when unhandled exception was revoked.
4080
- */
4081
- prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
4082
- /**
4083
- * Issued when console API was called.
4084
- */
4085
- prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
4086
- /**
4087
- * Issued when object should be inspected (for example, as a result of inspect() command line API call).
4088
- */
4089
- prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
4090
- /**
4091
- * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
4092
- */
4093
- prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
4094
- /**
4095
- * Fired when virtual machine fails to parse the script.
4096
- */
4097
- prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
4098
- /**
4099
- * Fired when breakpoint is resolved to an actual script and location.
4100
- */
4101
- prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
4102
- /**
4103
- * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
4104
- */
4105
- prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
4106
- /**
4107
- * Fired when the virtual machine resumed execution.
4108
- */
4109
- prependOnceListener(event: 'Debugger.resumed', listener: () => void): this;
4110
- /**
4111
- * Issued when new console message is added.
4112
- */
4113
- prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
4114
- /**
4115
- * Sent when new profile recording is started using console.profile() call.
4116
- */
4117
- prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
4118
- prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
4119
- prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
4120
- prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this;
4121
- prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
4122
- /**
4123
- * 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.
4124
- */
4125
- prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
4126
- /**
4127
- * If heap objects tracking has been started then backend may send update for one or more fragments
4128
- */
4129
- prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
4130
- /**
4131
- * Contains an bucket of collected trace events.
4132
- */
4133
- prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
4134
- /**
4135
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
4136
- * delivered via dataCollected events.
4137
- */
4138
- prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this;
4139
- /**
4140
- * Issued when attached to a worker.
4141
- */
4142
- prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
4143
- /**
4144
- * Issued when detached from the worker.
4145
- */
4146
- prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
4147
- /**
4148
- * Notifies about a new protocol message received from the session
4149
- * (session ID is provided in attachedToWorker notification).
4150
- */
4151
- prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
4152
- /**
4153
- * Fired when page is about to send HTTP request.
4154
- */
4155
- prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this;
4156
- /**
4157
- * Fired when HTTP response is available.
4158
- */
4159
- prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
4160
- prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
4161
- prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
4162
- /**
4163
- * Fired when data chunk was received over the network.
4164
- */
4165
- prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
4166
- /**
4167
- * This event is fired instead of `Runtime.executionContextDestroyed` when
4168
- * enabled.
4169
- * It is fired when the Node process finished all code execution and is
4170
- * waiting for all frontends to disconnect.
4171
- */
4172
- prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
4173
- /**
4174
- * This event is fired when the runtime is waiting for the debugger. For
4175
- * example, when inspector.waitingForDebugger is called
4176
- */
4177
- prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
4178
- prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
4179
- prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
4180
243
  }
4181
-
4182
- export {
4183
- Session,
4184
- open,
4185
- close,
4186
- url,
4187
- waitForDebugger,
4188
- console,
4189
- InspectorNotification,
4190
- Schema,
4191
- Runtime,
4192
- Debugger,
4193
- Console,
4194
- Profiler,
4195
- HeapProfiler,
4196
- NodeTracing,
4197
- NodeWorker,
4198
- Network,
4199
- NodeRuntime,
4200
- Target,
4201
- };
4202
244
  }
4203
245
 
4204
246
  /**
@@ -4206,6 +248,6 @@ declare module 'inspector/promises' {
4206
248
  * inspector.
4207
249
  * @since v19.0.0
4208
250
  */
4209
- declare module 'node:inspector/promises' {
4210
- export * from 'inspector/promises';
251
+ declare module "node:inspector/promises" {
252
+ export * from "inspector/promises";
4211
253
  }