Skip to content

Session

[<Interface>]
type Session =
    abstract member EventEmitter: EventEmitterConstructor with get, set
    abstract member EventEmitterAsyncResource: EventEmitterAsyncResourceConstructor with get, set
    abstract member captureRejectionSymbol: Symbol
    abstract member captureRejections: bool with get, set
    abstract member defaultMaxListeners: float with get, set
    abstract member errorMonitor: Symbol
    static member addAbortListener (signal: AbortSignal, resource: Event -> unit) : Disposable
    abstract member addListener (event: string, listener: obj array -> unit) : Session
    abstract member addListenerConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session
    abstract member addListenerDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session
    abstract member addListenerDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session
    abstract member addListenerDebuggerResumed (listener: unit -> unit) : Session
    abstract member addListenerDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session
    abstract member addListenerDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session
    abstract member addListenerHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
    abstract member addListenerHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session
    abstract member addListenerHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session
    abstract member addListenerHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
    abstract member addListenerHeapProfilerResetProfiles (listener: unit -> unit) : Session
    abstract member addListenerInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session
    abstract member addListenerNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session
    abstract member addListenerNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
    abstract member addListenerNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
    abstract member addListenerNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session
    abstract member addListenerNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session
    abstract member addListenerNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session
    abstract member addListenerNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session
    abstract member addListenerNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session
    abstract member addListenerNodeTracingTracingComplete (listener: unit -> unit) : Session
    abstract member addListenerNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session
    abstract member addListenerNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session
    abstract member addListenerNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session
    abstract member addListenerProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
    abstract member addListenerProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session
    abstract member addListenerRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session
    abstract member addListenerRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session
    abstract member addListenerRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session
    abstract member addListenerRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session
    abstract member addListenerRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session
    abstract member addListenerRuntimeExecutionContextsCleared (listener: unit -> unit) : Session
    abstract member addListenerRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session
    abstract member addListenerTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
    abstract member addListenerTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
    abstract member connect () : unit
    abstract member connectToMainThread () : unit
    abstract member disconnect () : unit
    abstract member emit (event: U2<string,Symbol>, args: obj array) : bool
    abstract member emitConsoleMessageAdded (message: InspectorNotification<MessageAddedEventDataType>) : bool
    abstract member emitDebuggerBreakpointResolved (message: InspectorNotification<BreakpointResolvedEventDataType>) : bool
    abstract member emitDebuggerPaused (message: InspectorNotification<PausedEventDataType>) : bool
    abstract member emitDebuggerResumed () : bool
    abstract member emitDebuggerScriptFailedToParse (message: InspectorNotification<ScriptFailedToParseEventDataType>) : bool
    abstract member emitDebuggerScriptParsed (message: InspectorNotification<ScriptParsedEventDataType>) : bool
    abstract member emitHeapProfilerAddHeapSnapshotChunk (message: InspectorNotification<AddHeapSnapshotChunkEventDataType>) : bool
    abstract member emitHeapProfilerHeapStatsUpdate (message: InspectorNotification<HeapStatsUpdateEventDataType>) : bool
    abstract member emitHeapProfilerLastSeenObjectId (message: InspectorNotification<LastSeenObjectIdEventDataType>) : bool
    abstract member emitHeapProfilerReportHeapSnapshotProgress (message: InspectorNotification<ReportHeapSnapshotProgressEventDataType>) : bool
    abstract member emitHeapProfilerResetProfiles () : bool
    abstract member emitInspectorNotification (message: InspectorNotification<obj>) : bool
    abstract member emitNetworkDataReceived (message: InspectorNotification<DataReceivedEventDataType>) : bool
    abstract member emitNetworkLoadingFailed (message: InspectorNotification<LoadingFailedEventDataType>) : bool
    abstract member emitNetworkLoadingFinished (message: InspectorNotification<LoadingFinishedEventDataType>) : bool
    abstract member emitNetworkRequestWillBeSent (message: InspectorNotification<RequestWillBeSentEventDataType>) : bool
    abstract member emitNetworkResponseReceived (message: InspectorNotification<ResponseReceivedEventDataType>) : bool
    abstract member emitNodeRuntimeWaitingForDebugger () : bool
    abstract member emitNodeRuntimeWaitingForDisconnect () : bool
    abstract member emitNodeTracingDataCollected (message: InspectorNotification<DataCollectedEventDataType>) : bool
    abstract member emitNodeTracingTracingComplete () : bool
    abstract member emitNodeWorkerAttachedToWorker (message: InspectorNotification<AttachedToWorkerEventDataType>) : bool
    abstract member emitNodeWorkerDetachedFromWorker (message: InspectorNotification<DetachedFromWorkerEventDataType>) : bool
    abstract member emitNodeWorkerReceivedMessageFromWorker (message: InspectorNotification<ReceivedMessageFromWorkerEventDataType>) : bool
    abstract member emitProfilerConsoleProfileFinished (message: InspectorNotification<ConsoleProfileFinishedEventDataType>) : bool
    abstract member emitProfilerConsoleProfileStarted (message: InspectorNotification<ConsoleProfileStartedEventDataType>) : bool
    abstract member emitRuntimeConsoleAPICalled (message: InspectorNotification<ConsoleAPICalledEventDataType>) : bool
    abstract member emitRuntimeExceptionRevoked (message: InspectorNotification<ExceptionRevokedEventDataType>) : bool
    abstract member emitRuntimeExceptionThrown (message: InspectorNotification<ExceptionThrownEventDataType>) : bool
    abstract member emitRuntimeExecutionContextCreated (message: InspectorNotification<ExecutionContextCreatedEventDataType>) : bool
    abstract member emitRuntimeExecutionContextDestroyed (message: InspectorNotification<ExecutionContextDestroyedEventDataType>) : bool
    abstract member emitRuntimeExecutionContextsCleared () : bool
    abstract member emitRuntimeInspectRequested (message: InspectorNotification<InspectRequestedEventDataType>) : bool
    abstract member emitTargetAttachedToTarget (message: InspectorNotification<AttachedToTargetEventDataType>) : bool
    abstract member emitTargetTargetCreated (message: InspectorNotification<TargetCreatedEventDataType>) : bool
    abstract member eventNames () : U2<string,Symbol> array
    static member getEventListeners (emitter: U2<EventEmitter<unit array>,EventTarget>, name: U2<string,Symbol>) : Function array
    static member getMaxListeners (emitter: U2<EventEmitter<unit array>,EventTarget>) : float
    static member listenerCount (emitter: EventEmitter<unit array>, eventName: U2<string,Symbol>) : float
    abstract member listenerCount (eventName: U2<string,Symbol>, ?listener: Function) : float
    abstract member listeners (eventName: U2<string,Symbol>) : Function array
    abstract member off (eventName: U2<string,Symbol>, listener: obj array -> unit) : Session
    static member on (emitter: EventTarget, eventName: string, ?options: StaticEventEmitterIteratorOptions) : AsyncIterator<obj array,obj,obj>
    static member on (emitter: EventEmitter<unit array>, eventName: U2<string,Symbol>, ?options: StaticEventEmitterIteratorOptions) : AsyncIterator<obj array,obj,obj>
    abstract member on (event: string, listener: obj array -> unit) : Session
    abstract member onConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session
    abstract member onDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session
    abstract member onDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session
    abstract member onDebuggerResumed (listener: unit -> unit) : Session
    abstract member onDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session
    abstract member onDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session
    abstract member onHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
    abstract member onHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session
    abstract member onHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session
    abstract member onHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
    abstract member onHeapProfilerResetProfiles (listener: unit -> unit) : Session
    abstract member onInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session
    abstract member onNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session
    abstract member onNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
    abstract member onNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
    abstract member onNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session
    abstract member onNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session
    abstract member onNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session
    abstract member onNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session
    abstract member onNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session
    abstract member onNodeTracingTracingComplete (listener: unit -> unit) : Session
    abstract member onNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session
    abstract member onNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session
    abstract member onNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session
    abstract member onProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
    abstract member onProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session
    abstract member onRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session
    abstract member onRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session
    abstract member onRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session
    abstract member onRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session
    abstract member onRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session
    abstract member onRuntimeExecutionContextsCleared (listener: unit -> unit) : Session
    abstract member onRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session
    abstract member onTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
    abstract member onTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
    static member once (emitter: EventTarget, eventName: string, ?options: StaticEventEmitterOptions) : Promise<obj array>
    static member once (emitter: EventEmitter<unit array>, eventName: U2<string,Symbol>, ?options: StaticEventEmitterOptions) : Promise<obj array>
    abstract member once (event: string, listener: obj array -> unit) : Session
    abstract member onceConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session
    abstract member onceDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session
    abstract member onceDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session
    abstract member onceDebuggerResumed (listener: unit -> unit) : Session
    abstract member onceDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session
    abstract member onceDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session
    abstract member onceHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
    abstract member onceHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session
    abstract member onceHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session
    abstract member onceHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
    abstract member onceHeapProfilerResetProfiles (listener: unit -> unit) : Session
    abstract member onceInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session
    abstract member onceNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session
    abstract member onceNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
    abstract member onceNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
    abstract member onceNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session
    abstract member onceNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session
    abstract member onceNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session
    abstract member onceNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session
    abstract member onceNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session
    abstract member onceNodeTracingTracingComplete (listener: unit -> unit) : Session
    abstract member onceNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session
    abstract member onceNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session
    abstract member onceNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session
    abstract member onceProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
    abstract member onceProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session
    abstract member onceRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session
    abstract member onceRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session
    abstract member onceRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session
    abstract member onceRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session
    abstract member onceRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session
    abstract member onceRuntimeExecutionContextsCleared (listener: unit -> unit) : Session
    abstract member onceRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session
    abstract member onceTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
    abstract member onceTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
    abstract member post (method: string, ?params: obj, ?callback: Callback2) : unit
    abstract member post (method: string, ?callback: Callback) : unit
    abstract member postConsoleClearMessages (?callback: (exn option -> unit)) : unit
    abstract member postConsoleDisable (?callback: (exn option -> unit)) : unit
    abstract member postConsoleEnable (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerContinueToLocation (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerContinueToLocation (?params: ContinueToLocationParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerDisable (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerEnable (?callback: Callback20) : unit
    abstract member postDebuggerEvaluateOnCallFrame (?callback: Callback38) : unit
    abstract member postDebuggerEvaluateOnCallFrame (?params: EvaluateOnCallFrameParameterType, ?callback: Callback37) : unit
    abstract member postDebuggerGetPossibleBreakpoints (?callback: Callback26) : unit
    abstract member postDebuggerGetPossibleBreakpoints (?params: GetPossibleBreakpointsParameterType, ?callback: Callback25) : unit
    abstract member postDebuggerGetScriptSource (?callback: Callback36) : unit
    abstract member postDebuggerGetScriptSource (?params: GetScriptSourceParameterType, ?callback: Callback35) : unit
    abstract member postDebuggerGetStackTrace (?callback: Callback28) : unit
    abstract member postDebuggerGetStackTrace (?params: GetStackTraceParameterType, ?callback: Callback27) : unit
    abstract member postDebuggerPause (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerPauseOnAsyncCall (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerPauseOnAsyncCall (?params: PauseOnAsyncCallParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerRemoveBreakpoint (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerRemoveBreakpoint (?params: RemoveBreakpointParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerRestartFrame (?callback: Callback34) : unit
    abstract member postDebuggerRestartFrame (?params: RestartFrameParameterType, ?callback: Callback33) : unit
    abstract member postDebuggerResume (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerScheduleStepIntoAsync (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSearchInContent (?callback: Callback30) : unit
    abstract member postDebuggerSearchInContent (?params: SearchInContentParameterType, ?callback: Callback29) : unit
    abstract member postDebuggerSetAsyncCallStackDepth (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetAsyncCallStackDepth (?params: SetAsyncCallStackDepthParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetBlackboxPatterns (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetBlackboxPatterns (?params: SetBlackboxPatternsParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetBlackboxedRanges (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetBlackboxedRanges (?params: SetBlackboxedRangesParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetBreakpoint (?callback: Callback24) : unit
    abstract member postDebuggerSetBreakpoint (?params: SetBreakpointParameterType, ?callback: Callback23) : unit
    abstract member postDebuggerSetBreakpointByUrl (?callback: Callback22) : unit
    abstract member postDebuggerSetBreakpointByUrl (?params: SetBreakpointByUrlParameterType, ?callback: Callback21) : unit
    abstract member postDebuggerSetBreakpointsActive (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetBreakpointsActive (?params: SetBreakpointsActiveParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetPauseOnExceptions (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetPauseOnExceptions (?params: SetPauseOnExceptionsParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetReturnValue (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetReturnValue (?params: SetReturnValueParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetScriptSource (?callback: Callback32) : unit
    abstract member postDebuggerSetScriptSource (?params: SetScriptSourceParameterType, ?callback: Callback31) : unit
    abstract member postDebuggerSetSkipAllPauses (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetSkipAllPauses (?params: SetSkipAllPausesParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetVariableValue (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerSetVariableValue (?params: SetVariableValueParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerStepInto (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerStepInto (?params: StepIntoParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postDebuggerStepOut (?callback: (exn option -> unit)) : unit
    abstract member postDebuggerStepOver (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerAddInspectedHeapObject (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerAddInspectedHeapObject (?params: AddInspectedHeapObjectParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerCollectGarbage (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerDisable (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerEnable (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerGetHeapObjectId (?callback: Callback45) : unit
    abstract member postHeapProfilerGetHeapObjectId (?params: GetHeapObjectIdParameterType, ?callback: Callback44) : unit
    abstract member postHeapProfilerGetObjectByHeapObjectId (?callback: Callback43) : unit
    abstract member postHeapProfilerGetObjectByHeapObjectId (?params: GetObjectByHeapObjectIdParameterType, ?callback: Callback42) : unit
    abstract member postHeapProfilerGetSamplingProfile (?callback: Callback47) : unit
    abstract member postHeapProfilerStartSampling (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerStartSampling (?params: StartSamplingParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerStartTrackingHeapObjects (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerStartTrackingHeapObjects (?params: StartTrackingHeapObjectsParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerStopSampling (?callback: Callback46) : unit
    abstract member postHeapProfilerStopTrackingHeapObjects (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerStopTrackingHeapObjects (?params: StopTrackingHeapObjectsParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerTakeHeapSnapshot (?callback: (exn option -> unit)) : unit
    abstract member postHeapProfilerTakeHeapSnapshot (?params: TakeHeapSnapshotParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postIOClose (?callback: (exn option -> unit)) : unit
    abstract member postIOClose (?params: CloseParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postIORead (?callback: Callback58) : unit
    abstract member postIORead (?params: ReadParameterType, ?callback: Callback57) : unit
    abstract member postNetworkDisable (?callback: (exn option -> unit)) : unit
    abstract member postNetworkEnable (?callback: (exn option -> unit)) : unit
    abstract member postNetworkGetRequestPostData (?callback: Callback50) : unit
    abstract member postNetworkGetRequestPostData (?params: GetRequestPostDataParameterType, ?callback: Callback49) : unit
    abstract member postNetworkGetResponseBody (?callback: Callback52) : unit
    abstract member postNetworkGetResponseBody (?params: GetResponseBodyParameterType, ?callback: Callback51) : unit
    abstract member postNetworkLoadNetworkResource (?callback: Callback56) : unit
    abstract member postNetworkLoadNetworkResource (?params: LoadNetworkResourceParameterType, ?callback: Callback55) : unit
    abstract member postNetworkStreamResourceContent (?callback: Callback54) : unit
    abstract member postNetworkStreamResourceContent (?params: StreamResourceContentParameterType, ?callback: Callback53) : unit
    abstract member postNodeRuntimeDisable (?callback: (exn option -> unit)) : unit
    abstract member postNodeRuntimeEnable (?callback: (exn option -> unit)) : unit
    abstract member postNodeRuntimeNotifyWhenWaitingForDisconnect (?callback: (exn option -> unit)) : unit
    abstract member postNodeRuntimeNotifyWhenWaitingForDisconnect (?params: NotifyWhenWaitingForDisconnectParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postNodeTracingGetCategories (?callback: Callback48) : unit
    abstract member postNodeTracingStart (?callback: (exn option -> unit)) : unit
    abstract member postNodeTracingStart (?params: StartParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postNodeTracingStop (?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerDetach (?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerDetach (?params: DetachParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerDisable (?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerEnable (?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerEnable (?params: EnableParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerSendMessageToWorker (?callback: (exn option -> unit)) : unit
    abstract member postNodeWorkerSendMessageToWorker (?params: SendMessageToWorkerParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postProfilerDisable (?callback: (exn option -> unit)) : unit
    abstract member postProfilerEnable (?callback: (exn option -> unit)) : unit
    abstract member postProfilerGetBestEffortCoverage (?callback: Callback41) : unit
    abstract member postProfilerSetSamplingInterval (?callback: (exn option -> unit)) : unit
    abstract member postProfilerSetSamplingInterval (?params: SetSamplingIntervalParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postProfilerStart (?callback: (exn option -> unit)) : unit
    abstract member postProfilerStartPreciseCoverage (?callback: (exn option -> unit)) : unit
    abstract member postProfilerStartPreciseCoverage (?params: StartPreciseCoverageParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postProfilerStop (?callback: Callback39) : unit
    abstract member postProfilerStopPreciseCoverage (?callback: (exn option -> unit)) : unit
    abstract member postProfilerTakePreciseCoverage (?callback: Callback40) : unit
    abstract member postRuntimeAwaitPromise (?callback: Callback7) : unit
    abstract member postRuntimeAwaitPromise (?params: AwaitPromiseParameterType, ?callback: Callback6) : unit
    abstract member postRuntimeCallFunctionOn (?callback: Callback9) : unit
    abstract member postRuntimeCallFunctionOn (?params: CallFunctionOnParameterType, ?callback: Callback8) : unit
    abstract member postRuntimeCompileScript (?callback: Callback13) : unit
    abstract member postRuntimeCompileScript (?params: CompileScriptParameterType, ?callback: Callback12) : unit
    abstract member postRuntimeDisable (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeDiscardConsoleEntries (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeEnable (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeEvaluate (?callback: Callback5) : unit
    abstract member postRuntimeEvaluate (?params: EvaluateParameterType, ?callback: Callback4) : unit
    abstract member postRuntimeGetProperties (?callback: Callback11) : unit
    abstract member postRuntimeGetProperties (?params: GetPropertiesParameterType, ?callback: Callback10) : unit
    abstract member postRuntimeGlobalLexicalScopeNames (?callback: Callback19) : unit
    abstract member postRuntimeGlobalLexicalScopeNames (?params: GlobalLexicalScopeNamesParameterType, ?callback: Callback18) : unit
    abstract member postRuntimeQueryObjects (?callback: Callback17) : unit
    abstract member postRuntimeQueryObjects (?params: QueryObjectsParameterType, ?callback: Callback16) : unit
    abstract member postRuntimeReleaseObject (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeReleaseObject (?params: ReleaseObjectParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postRuntimeReleaseObjectGroup (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeReleaseObjectGroup (?params: ReleaseObjectGroupParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postRuntimeRunIfWaitingForDebugger (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeRunScript (?callback: Callback15) : unit
    abstract member postRuntimeRunScript (?params: RunScriptParameterType, ?callback: Callback14) : unit
    abstract member postRuntimeSetCustomObjectFormatterEnabled (?callback: (exn option -> unit)) : unit
    abstract member postRuntimeSetCustomObjectFormatterEnabled (?params: SetCustomObjectFormatterEnabledParameterType, ?callback: (exn option -> unit)) : unit
    abstract member postSchemaGetDomains (?callback: Callback3) : unit
    abstract member postTargetSetAutoAttach (?callback: (exn option -> unit)) : unit
    abstract member postTargetSetAutoAttach (?params: SetAutoAttachParameterType, ?callback: (exn option -> unit)) : unit
    abstract member prependListener (event: string, listener: obj array -> unit) : Session
    abstract member prependListenerConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session
    abstract member prependListenerDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session
    abstract member prependListenerDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session
    abstract member prependListenerDebuggerResumed (listener: unit -> unit) : Session
    abstract member prependListenerDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session
    abstract member prependListenerDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session
    abstract member prependListenerHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
    abstract member prependListenerHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session
    abstract member prependListenerHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session
    abstract member prependListenerHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
    abstract member prependListenerHeapProfilerResetProfiles (listener: unit -> unit) : Session
    abstract member prependListenerInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session
    abstract member prependListenerNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session
    abstract member prependListenerNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
    abstract member prependListenerNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
    abstract member prependListenerNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session
    abstract member prependListenerNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session
    abstract member prependListenerNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session
    abstract member prependListenerNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session
    abstract member prependListenerNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session
    abstract member prependListenerNodeTracingTracingComplete (listener: unit -> unit) : Session
    abstract member prependListenerNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session
    abstract member prependListenerNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session
    abstract member prependListenerNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session
    abstract member prependListenerProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
    abstract member prependListenerProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session
    abstract member prependListenerRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session
    abstract member prependListenerRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session
    abstract member prependListenerRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session
    abstract member prependListenerRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session
    abstract member prependListenerRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session
    abstract member prependListenerRuntimeExecutionContextsCleared (listener: unit -> unit) : Session
    abstract member prependListenerRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session
    abstract member prependListenerTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
    abstract member prependListenerTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
    abstract member prependOnceListener (event: string, listener: obj array -> unit) : Session
    abstract member prependOnceListenerConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session
    abstract member prependOnceListenerDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session
    abstract member prependOnceListenerDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session
    abstract member prependOnceListenerDebuggerResumed (listener: unit -> unit) : Session
    abstract member prependOnceListenerDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session
    abstract member prependOnceListenerDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session
    abstract member prependOnceListenerHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
    abstract member prependOnceListenerHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session
    abstract member prependOnceListenerHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session
    abstract member prependOnceListenerHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
    abstract member prependOnceListenerHeapProfilerResetProfiles (listener: unit -> unit) : Session
    abstract member prependOnceListenerInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session
    abstract member prependOnceListenerNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session
    abstract member prependOnceListenerNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
    abstract member prependOnceListenerNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
    abstract member prependOnceListenerNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session
    abstract member prependOnceListenerNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session
    abstract member prependOnceListenerNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session
    abstract member prependOnceListenerNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session
    abstract member prependOnceListenerNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session
    abstract member prependOnceListenerNodeTracingTracingComplete (listener: unit -> unit) : Session
    abstract member prependOnceListenerNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session
    abstract member prependOnceListenerNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session
    abstract member prependOnceListenerNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session
    abstract member prependOnceListenerProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
    abstract member prependOnceListenerProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session
    abstract member prependOnceListenerRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session
    abstract member prependOnceListenerRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session
    abstract member prependOnceListenerRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session
    abstract member prependOnceListenerRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session
    abstract member prependOnceListenerRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session
    abstract member prependOnceListenerRuntimeExecutionContextsCleared (listener: unit -> unit) : Session
    abstract member prependOnceListenerRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session
    abstract member prependOnceListenerTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
    abstract member prependOnceListenerTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
    abstract member rawListeners (eventName: U2<string,Symbol>) : Function array
    abstract member removeAllListeners (?eventName: U2<string,Symbol>) : Session
    abstract member removeListener (eventName: U2<string,Symbol>, listener: obj array -> unit) : Session
    static member setMaxListeners (n: float option, eventTargets: U2<EventEmitter<unit array>,EventTarget> array) : unit
    abstract member setMaxListeners (n: float) : Session
AssemblyXantham.Fable.Node
ImplementsEventEmitter<unit array>
Attributes[<Interface>] [<Import>]

The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.

Declared inside

Post

Properties

abstract member EventEmitter: EventEmitterConstructor with get, set
abstract member EventEmitterAsyncResource: EventEmitterAsyncResourceConstructor with get, set

Integrates EventEmitter with AsyncResource for EventEmitters that require manual async tracking. Specifically, all events emitted by instances of events.EventEmitterAsyncResource will run within its async context.

import { EventEmitterAsyncResource, EventEmitter } from 'node:events';
import { notStrictEqual, strictEqual } from 'node:assert';
import { executionAsyncId, triggerAsyncId } from 'node:async_hooks';

// Async tracking tooling will identify this as 'Q'.
const ee1 = new EventEmitterAsyncResource({ name: 'Q' });

// 'foo' listeners will run in the EventEmitters async context.
ee1.on('foo', () => {
strictEqual(executionAsyncId(), ee1.asyncId);
strictEqual(triggerAsyncId(), ee1.triggerAsyncId);
});

const ee2 = new EventEmitter();

// 'foo' listeners on ordinary EventEmitters that do not track async
// context, however, run in the same async context as the emit().
ee2.on('foo', () => {
notStrictEqual(executionAsyncId(), ee2.asyncId);
notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);
});

Promise.resolve().then(() => {
ee1.emit('foo');
ee2.emit('foo');
});

The EventEmitterAsyncResource class has the same methods and takes the same options as EventEmitter and AsyncResource themselves.

@since v17.4.0, v16.14.0

abstract member captureRejectionSymbol: Symbol

Value: Symbol.for('nodejs.rejection')

See how to write a custom rejection handler.

@since v13.4.0, v12.16.0

abstract member captureRejections: bool with get, set

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

@since v13.4.0, v12.16.0

abstract member defaultMaxListeners: float with get, set

By default, a maximum of 10 listeners can be registered for any single event. This limit can be changed for individual EventEmitter instances using the emitter.setMaxListeners(n) method. To change the default for allEventEmitter instances, the events.defaultMaxListeners property can be used. If this value is not a positive number, a RangeError is thrown.

Take caution when setting the events.defaultMaxListeners because the change affects all EventEmitter instances, including those created before the change is made. However, calling emitter.setMaxListeners(n) still has precedence over events.defaultMaxListeners.

This is not a hard limit. The EventEmitter instance will allow more listeners to be added but will output a trace warning to stderr indicating that a "possible EventEmitter memory leak" has been detected. For any single EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to temporarily avoid this warning:

import { EventEmitter } from 'node:events';
const emitter = new EventEmitter();
emitter.setMaxListeners(emitter.getMaxListeners() + 1);
emitter.once('event', () => {
// do stuff
emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
});

The --trace-warnings command-line flag can be used to display the stack trace for such warnings.

The emitted warning can be inspected with process.on('warning') and will have the additional emitter, type, and count properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its name property is set to 'MaxListenersExceededWarning'.

@since v0.11.2

abstract member errorMonitor: Symbol

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

@since v13.6.0, v12.17.0

Methods

static member addAbortListener (signal: AbortSignal, resource: Event -> unit) : Disposable

Listens once to the abort event on the provided signal.

Listening to the abort event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call e.stopImmediatePropagation(). Unfortunately Node.js cannot change this since it would violate the web standard. Additionally, the original API makes it easy to forget to remove listeners.

This API allows safely using AbortSignals in Node.js APIs by solving these two issues by listening to the event such that stopImmediatePropagation does not prevent the listener from running.

Returns a disposable so that it may be unsubscribed from more easily.

import { addAbortListener } from 'node:events';

function example(signal) {
let disposable;
try {
signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
disposable = addAbortListener(signal, (e) => {
// Do something when signal is aborted.
});
} finally {
disposable?.[Symbol.dispose]();
}
}

@since v20.5.0

Returns. Disposable that removes the abort listener.

abstract member addListener (event: string, listener: obj array -> unit) : Session

Emitted when any notification from the V8 Inspector is received. Issued when new execution context is created. Issued when execution context is destroyed. Issued when all executionContexts were cleared in browser Issued when exception was thrown and unhandled. Issued when unhandled exception was revoked. Issued when console API was called. Issued when object should be inspected (for example, as a result of inspect() command line API call). Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. Fired when virtual machine fails to parse the script. Fired when breakpoint is resolved to an actual script and location. Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. Fired when the virtual machine resumed execution. Issued when new console message is added. Sent when new profile recording is started using console.profile() call. 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. If heap objects tracking has been started then backend may send update for one or more fragments Contains an bucket of collected trace events. Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events. Issued when attached to a worker. Issued when detached from the worker. Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification). Fired when page is about to send HTTP request. Fired when HTTP response is available. Fired when data chunk was received over the network. This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect. This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

abstract member addListenerConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session

Issued when new console message is added.

addListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this
abstract member addListenerDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session

Fired when breakpoint is resolved to an actual script and location.

addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this
abstract member addListenerDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

addListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this
abstract member addListenerDebuggerResumed (listener: unit -> unit) : Session

Fired when the virtual machine resumed execution.

addListener(event: "Debugger.resumed", listener: () => void): this
abstract member addListenerDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session

Fired when virtual machine fails to parse the script.

addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this
abstract member addListenerDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this
abstract member addListenerHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this
abstract member addListenerHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session

If heap objects tracking has been started then backend may send update for one or more fragments

addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this
abstract member addListenerHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session

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.

addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this
abstract member addListenerHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this
abstract member addListenerHeapProfilerResetProfiles (listener: unit -> unit) : Session
addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this
abstract member addListenerInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session

Emitted when any notification from the V8 Inspector is received.

addListener(event: "inspectorNotification", listener: (message: InspectorNotification<object>) => void): this
abstract member addListenerNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session

Fired when data chunk was received over the network.

addListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this
abstract member addListenerNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
addListener(event: "Network.loadingFailed", listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this
abstract member addListenerNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
addListener(event: "Network.loadingFinished", listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this
abstract member addListenerNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session

Fired when page is about to send HTTP request.

addListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this
abstract member addListenerNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session

Fired when HTTP response is available.

addListener(event: "Network.responseReceived", listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this
abstract member addListenerNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

addListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this
abstract member addListenerNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session

This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect.

addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this
abstract member addListenerNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session

Contains an bucket of collected trace events.

addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this
abstract member addListenerNodeTracingTracingComplete (listener: unit -> unit) : Session

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

addListener(event: "NodeTracing.tracingComplete", listener: () => void): this
abstract member addListenerNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session

Issued when attached to a worker.

addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this
abstract member addListenerNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session

Issued when detached from the worker.

addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this
abstract member addListenerNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this
abstract member addListenerProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this
abstract member addListenerProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session

Sent when new profile recording is started using console.profile() call.

addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this
abstract member addListenerRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session

Issued when console API was called.

addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this
abstract member addListenerRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session

Issued when unhandled exception was revoked.

addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this
abstract member addListenerRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session

Issued when exception was thrown and unhandled.

addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this
abstract member addListenerRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session

Issued when new execution context is created.

addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this
abstract member addListenerRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session

Issued when execution context is destroyed.

addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this
abstract member addListenerRuntimeExecutionContextsCleared (listener: unit -> unit) : Session

Issued when all executionContexts were cleared in browser

addListener(event: "Runtime.executionContextsCleared", listener: () => void): this
abstract member addListenerRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session

Issued when object should be inspected (for example, as a result of inspect() command line API call).

addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this
abstract member addListenerTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
addListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this
abstract member addListenerTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
addListener(event: "Target.targetCreated", listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this
abstract member connect () : unit

Connects a session to the inspector back-end.

abstract member connectToMainThread () : unit

Connects a session to the inspector back-end. An exception will be thrown if this API was not called on a Worker thread.

@since v12.11.0

abstract member disconnect () : unit

Immediately close the session. All pending message callbacks will be called with an error. session.connect() will need to be called to be able to send messages again. Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.

abstract member emit (event: U2<string,Symbol>, args: obj array) : bool
abstract member emitConsoleMessageAdded (message: InspectorNotification<MessageAddedEventDataType>) : bool
emit(event: "Console.messageAdded", message: InspectorNotification<Console.MessageAddedEventDataType>): boolean
abstract member emitDebuggerBreakpointResolved (message: InspectorNotification<BreakpointResolvedEventDataType>) : bool
emit(event: "Debugger.breakpointResolved", message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean
abstract member emitDebuggerPaused (message: InspectorNotification<PausedEventDataType>) : bool
emit(event: "Debugger.paused", message: InspectorNotification<Debugger.PausedEventDataType>): boolean
abstract member emitDebuggerResumed () : bool
emit(event: "Debugger.resumed"): boolean
abstract member emitDebuggerScriptFailedToParse (message: InspectorNotification<ScriptFailedToParseEventDataType>) : bool
emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean
abstract member emitDebuggerScriptParsed (message: InspectorNotification<ScriptParsedEventDataType>) : bool
emit(event: "Debugger.scriptParsed", message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean
abstract member emitHeapProfilerAddHeapSnapshotChunk (message: InspectorNotification<AddHeapSnapshotChunkEventDataType>) : bool
emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean
abstract member emitHeapProfilerHeapStatsUpdate (message: InspectorNotification<HeapStatsUpdateEventDataType>) : bool
emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean
abstract member emitHeapProfilerLastSeenObjectId (message: InspectorNotification<LastSeenObjectIdEventDataType>) : bool
emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean
abstract member emitHeapProfilerReportHeapSnapshotProgress (message: InspectorNotification<ReportHeapSnapshotProgressEventDataType>) : bool
emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean
abstract member emitHeapProfilerResetProfiles () : bool
emit(event: "HeapProfiler.resetProfiles"): boolean
abstract member emitInspectorNotification (message: InspectorNotification<obj>) : bool
emit(event: "inspectorNotification", message: InspectorNotification<object>): boolean
abstract member emitNetworkDataReceived (message: InspectorNotification<DataReceivedEventDataType>) : bool
emit(event: "Network.dataReceived", message: InspectorNotification<Network.DataReceivedEventDataType>): boolean
abstract member emitNetworkLoadingFailed (message: InspectorNotification<LoadingFailedEventDataType>) : bool
emit(event: "Network.loadingFailed", message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean
abstract member emitNetworkLoadingFinished (message: InspectorNotification<LoadingFinishedEventDataType>) : bool
emit(event: "Network.loadingFinished", message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean
abstract member emitNetworkRequestWillBeSent (message: InspectorNotification<RequestWillBeSentEventDataType>) : bool
emit(event: "Network.requestWillBeSent", message: InspectorNotification<Network.RequestWillBeSentEventDataType>): boolean
abstract member emitNetworkResponseReceived (message: InspectorNotification<ResponseReceivedEventDataType>) : bool
emit(event: "Network.responseReceived", message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean
abstract member emitNodeRuntimeWaitingForDebugger () : bool
emit(event: "NodeRuntime.waitingForDebugger"): boolean
abstract member emitNodeRuntimeWaitingForDisconnect () : bool
emit(event: "NodeRuntime.waitingForDisconnect"): boolean
abstract member emitNodeTracingDataCollected (message: InspectorNotification<DataCollectedEventDataType>) : bool
emit(event: "NodeTracing.dataCollected", message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean
abstract member emitNodeTracingTracingComplete () : bool
emit(event: "NodeTracing.tracingComplete"): boolean
abstract member emitNodeWorkerAttachedToWorker (message: InspectorNotification<AttachedToWorkerEventDataType>) : bool
emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean
abstract member emitNodeWorkerDetachedFromWorker (message: InspectorNotification<DetachedFromWorkerEventDataType>) : bool
emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean
abstract member emitNodeWorkerReceivedMessageFromWorker (message: InspectorNotification<ReceivedMessageFromWorkerEventDataType>) : bool
emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean
abstract member emitProfilerConsoleProfileFinished (message: InspectorNotification<ConsoleProfileFinishedEventDataType>) : bool
emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean
abstract member emitProfilerConsoleProfileStarted (message: InspectorNotification<ConsoleProfileStartedEventDataType>) : bool
emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean
abstract member emitRuntimeConsoleAPICalled (message: InspectorNotification<ConsoleAPICalledEventDataType>) : bool
emit(event: "Runtime.consoleAPICalled", message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean
abstract member emitRuntimeExceptionRevoked (message: InspectorNotification<ExceptionRevokedEventDataType>) : bool
emit(event: "Runtime.exceptionRevoked", message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean
abstract member emitRuntimeExceptionThrown (message: InspectorNotification<ExceptionThrownEventDataType>) : bool
emit(event: "Runtime.exceptionThrown", message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean
abstract member emitRuntimeExecutionContextCreated (message: InspectorNotification<ExecutionContextCreatedEventDataType>) : bool
emit(event: "Runtime.executionContextCreated", message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean
abstract member emitRuntimeExecutionContextDestroyed (message: InspectorNotification<ExecutionContextDestroyedEventDataType>) : bool
emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean
abstract member emitRuntimeExecutionContextsCleared () : bool
emit(event: "Runtime.executionContextsCleared"): boolean
abstract member emitRuntimeInspectRequested (message: InspectorNotification<InspectRequestedEventDataType>) : bool
emit(event: "Runtime.inspectRequested", message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean
abstract member emitTargetAttachedToTarget (message: InspectorNotification<AttachedToTargetEventDataType>) : bool
emit(event: "Target.attachedToTarget", message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean
abstract member emitTargetTargetCreated (message: InspectorNotification<TargetCreatedEventDataType>) : bool
emit(event: "Target.targetCreated", message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean
abstract member eventNames () : U2<string,Symbol> array

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

import { EventEmitter } from 'node:events';

const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});

const sym = Symbol('symbol');
myEE.on(sym, () => {});

console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]

@since v6.0.0

static member getEventListeners (emitter: U2<EventEmitter<unit array>,EventTarget>, name: U2<string,Symbol>) : Function array

Returns a copy of the array of listeners for the event named eventName.

For EventEmitters this behaves exactly the same as calling .listeners on the emitter.

For EventTargets this is the only way to get the event listeners for the event target. This is useful for debugging and diagnostic purposes.

import { getEventListeners, EventEmitter } from 'node:events';

{
const ee = new EventEmitter();
const listener = () => console.log('Events are fun');
ee.on('foo', listener);
console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
}
{
const et = new EventTarget();
const listener = () => console.log('Events are fun');
et.addEventListener('foo', listener);
console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
}

@since v15.2.0, v14.17.0

static member getMaxListeners (emitter: U2<EventEmitter<unit array>,EventTarget>) : float

Returns the currently set max amount of listeners.

For EventEmitters this behaves exactly the same as calling .getMaxListeners on the emitter.

For EventTargets this is the only way to get the max event listeners for the event target. If the number of event handlers on a single EventTarget exceeds the max set, the EventTarget will print a warning.

import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';

{
const ee = new EventEmitter();
console.log(getMaxListeners(ee)); // 10
setMaxListeners(11, ee);
console.log(getMaxListeners(ee)); // 11
}
{
const et = new EventTarget();
console.log(getMaxListeners(et)); // 10
setMaxListeners(11, et);
console.log(getMaxListeners(et)); // 11
}

@since v19.9.0

static member listenerCount (emitter: EventEmitter<unit array>, eventName: U2<string,Symbol>) : float

A class method that returns the number of listeners for the given eventName registered on the given emitter.

import { EventEmitter, listenerCount } from 'node:events';

const myEmitter = new EventEmitter();
myEmitter.on('event', () => {});
myEmitter.on('event', () => {});
console.log(listenerCount(myEmitter, 'event'));
// Prints: 2

@since v0.9.12

Parameter
emitterThe emitter to query
eventNameThe event name
abstract member listenerCount (eventName: U2<string,Symbol>, ?listener: Function) : float

Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

@since v3.2.0

Parameter
eventNameThe name of the event being listened for
listenerThe event handler function
abstract member listeners (eventName: U2<string,Symbol>) : Function array

Returns a copy of the array of listeners for the event named eventName.

server.on('connection', (stream) => {
console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]

@since v0.1.26

abstract member off (eventName: U2<string,Symbol>, listener: obj array -> unit) : Session

Alias for emitter.removeListener().

@since v10.0.0

static member on (emitter: EventTarget, eventName: string, ?options: StaticEventEmitterIteratorOptions) : AsyncIterator<obj array,obj,obj>
import { on, EventEmitter } from 'node:events';
import process from 'node:process';

const ee = new EventEmitter();

// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
});

for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
console.log(event); // prints ['bar'] [42]
}
// Unreachable here

Returns an AsyncIterator that iterates eventName events. It will throw if the EventEmitter emits 'error'. It removes all listeners when exiting the loop. The value returned by each iteration is an array composed of the emitted event arguments.

An AbortSignal can be used to cancel waiting on events:

import { on, EventEmitter } from 'node:events';
import process from 'node:process';

const ac = new AbortController();

(async () => {
const ee = new EventEmitter();

// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
});

for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
console.log(event); // prints ['bar'] [42]
}
// Unreachable here
})();

process.nextTick(() => ac.abort());

Use the close option to specify an array of event names that will end the iteration:

import { on, EventEmitter } from 'node:events';
import process from 'node:process';

const ee = new EventEmitter();

// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
ee.emit('close');
});

for await (const event of on(ee, 'foo', { close: ['close'] })) {
console.log(event); // prints ['bar'] [42]
}
// the loop will exit after 'close' is emitted
console.log('done'); // prints 'done'

@since v13.6.0, v12.16.0

Returns. An AsyncIterator that iterates eventName events emitted by the emitter

static member on (emitter: EventEmitter<unit array>, eventName: U2<string,Symbol>, ?options: StaticEventEmitterIteratorOptions) : AsyncIterator<obj array,obj,obj>
import { on, EventEmitter } from 'node:events';
import process from 'node:process';

const ee = new EventEmitter();

// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
});

for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
console.log(event); // prints ['bar'] [42]
}
// Unreachable here

Returns an AsyncIterator that iterates eventName events. It will throw if the EventEmitter emits 'error'. It removes all listeners when exiting the loop. The value returned by each iteration is an array composed of the emitted event arguments.

An AbortSignal can be used to cancel waiting on events:

import { on, EventEmitter } from 'node:events';
import process from 'node:process';

const ac = new AbortController();

(async () => {
const ee = new EventEmitter();

// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
});

for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
console.log(event); // prints ['bar'] [42]
}
// Unreachable here
})();

process.nextTick(() => ac.abort());

Use the close option to specify an array of event names that will end the iteration:

import { on, EventEmitter } from 'node:events';
import process from 'node:process';

const ee = new EventEmitter();

// Emit later on
process.nextTick(() => {
ee.emit('foo', 'bar');
ee.emit('foo', 42);
ee.emit('close');
});

for await (const event of on(ee, 'foo', { close: ['close'] })) {
console.log(event); // prints ['bar'] [42]
}
// the loop will exit after 'close' is emitted
console.log('done'); // prints 'done'

@since v13.6.0, v12.16.0

Returns. An AsyncIterator that iterates eventName events emitted by the emitter

abstract member on (event: string, listener: obj array -> unit) : Session

Emitted when any notification from the V8 Inspector is received. Issued when new execution context is created. Issued when execution context is destroyed. Issued when all executionContexts were cleared in browser Issued when exception was thrown and unhandled. Issued when unhandled exception was revoked. Issued when console API was called. Issued when object should be inspected (for example, as a result of inspect() command line API call). Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. Fired when virtual machine fails to parse the script. Fired when breakpoint is resolved to an actual script and location. Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. Fired when the virtual machine resumed execution. Issued when new console message is added. Sent when new profile recording is started using console.profile() call. 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. If heap objects tracking has been started then backend may send update for one or more fragments Contains an bucket of collected trace events. Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events. Issued when attached to a worker. Issued when detached from the worker. Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification). Fired when page is about to send HTTP request. Fired when HTTP response is available. Fired when data chunk was received over the network. This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect. This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

abstract member onConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session

Issued when new console message is added.

on(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this
abstract member onDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session

Fired when breakpoint is resolved to an actual script and location.

on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this
abstract member onDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

on(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this
abstract member onDebuggerResumed (listener: unit -> unit) : Session

Fired when the virtual machine resumed execution.

on(event: "Debugger.resumed", listener: () => void): this
abstract member onDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session

Fired when virtual machine fails to parse the script.

on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this
abstract member onDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this
abstract member onHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this
abstract member onHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session

If heap objects tracking has been started then backend may send update for one or more fragments

on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this
abstract member onHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session

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.

on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this
abstract member onHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this
abstract member onHeapProfilerResetProfiles (listener: unit -> unit) : Session
on(event: "HeapProfiler.resetProfiles", listener: () => void): this
abstract member onInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session

Emitted when any notification from the V8 Inspector is received.

on(event: "inspectorNotification", listener: (message: InspectorNotification<object>) => void): this
abstract member onNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session

Fired when data chunk was received over the network.

on(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this
abstract member onNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
on(event: "Network.loadingFailed", listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this
abstract member onNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
on(event: "Network.loadingFinished", listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this
abstract member onNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session

Fired when page is about to send HTTP request.

on(event: "Network.requestWillBeSent", listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this
abstract member onNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session

Fired when HTTP response is available.

on(event: "Network.responseReceived", listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this
abstract member onNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

on(event: "NodeRuntime.waitingForDebugger", listener: () => void): this
abstract member onNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session

This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect.

on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this
abstract member onNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session

Contains an bucket of collected trace events.

on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this
abstract member onNodeTracingTracingComplete (listener: unit -> unit) : Session

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

on(event: "NodeTracing.tracingComplete", listener: () => void): this
abstract member onNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session

Issued when attached to a worker.

on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this
abstract member onNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session

Issued when detached from the worker.

on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this
abstract member onNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this
abstract member onProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this
abstract member onProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session

Sent when new profile recording is started using console.profile() call.

on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this
abstract member onRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session

Issued when console API was called.

on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this
abstract member onRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session

Issued when unhandled exception was revoked.

on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this
abstract member onRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session

Issued when exception was thrown and unhandled.

on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this
abstract member onRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session

Issued when new execution context is created.

on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this
abstract member onRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session

Issued when execution context is destroyed.

on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this
abstract member onRuntimeExecutionContextsCleared (listener: unit -> unit) : Session

Issued when all executionContexts were cleared in browser

on(event: "Runtime.executionContextsCleared", listener: () => void): this
abstract member onRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session

Issued when object should be inspected (for example, as a result of inspect() command line API call).

on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this
abstract member onTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
on(event: "Target.attachedToTarget", listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this
abstract member onTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
on(event: "Target.targetCreated", listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this
static member once (emitter: EventTarget, eventName: string, ?options: StaticEventEmitterOptions) : Promise<obj array>

Creates a Promise that is fulfilled when the EventEmitter emits the given event or that is rejected if the EventEmitter emits 'error' while waiting. The Promise will resolve with an array of all the arguments emitted to the given event.

This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event semantics and does not listen to the 'error' event.

import { once, EventEmitter } from 'node:events';
import process from 'node:process';

const ee = new EventEmitter();

process.nextTick(() => {
ee.emit('myevent', 42);
});

const [value] = await once(ee, 'myevent');
console.log(value);

const err = new Error('kaboom');
process.nextTick(() => {
ee.emit('error', err);
});

try {
await once(ee, 'myevent');
} catch (err) {
console.error('error happened', err);
}

The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the 'error' event itself, then it is treated as any other kind of event without special handling:

import { EventEmitter, once } from 'node:events';

const ee = new EventEmitter();

once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
.catch((err) => console.error('error', err.message));

ee.emit('error', new Error('boom'));

// Prints: ok boom

An AbortSignal can be used to cancel waiting for the event:

import { EventEmitter, once } from 'node:events';

const ee = new EventEmitter();
const ac = new AbortController();

async function foo(emitter, event, signal) {
try {
await once(emitter, event, { signal });
console.log('event emitted!');
} catch (error) {
if (error.name === 'AbortError') {
console.error('Waiting for the event was canceled!');
} else {
console.error('There was an error', error.message);
}
}
}

foo(ee, 'foo', ac.signal);
ac.abort(); // Abort waiting for the event
ee.emit('foo'); // Prints: Waiting for the event was canceled!

@since v11.13.0, v10.16.0

static member once (emitter: EventEmitter<unit array>, eventName: U2<string,Symbol>, ?options: StaticEventEmitterOptions) : Promise<obj array>

Creates a Promise that is fulfilled when the EventEmitter emits the given event or that is rejected if the EventEmitter emits 'error' while waiting. The Promise will resolve with an array of all the arguments emitted to the given event.

This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event semantics and does not listen to the 'error' event.

import { once, EventEmitter } from 'node:events';
import process from 'node:process';

const ee = new EventEmitter();

process.nextTick(() => {
ee.emit('myevent', 42);
});

const [value] = await once(ee, 'myevent');
console.log(value);

const err = new Error('kaboom');
process.nextTick(() => {
ee.emit('error', err);
});

try {
await once(ee, 'myevent');
} catch (err) {
console.error('error happened', err);
}

The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the 'error' event itself, then it is treated as any other kind of event without special handling:

import { EventEmitter, once } from 'node:events';

const ee = new EventEmitter();

once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
.catch((err) => console.error('error', err.message));

ee.emit('error', new Error('boom'));

// Prints: ok boom

An AbortSignal can be used to cancel waiting for the event:

import { EventEmitter, once } from 'node:events';

const ee = new EventEmitter();
const ac = new AbortController();

async function foo(emitter, event, signal) {
try {
await once(emitter, event, { signal });
console.log('event emitted!');
} catch (error) {
if (error.name === 'AbortError') {
console.error('Waiting for the event was canceled!');
} else {
console.error('There was an error', error.message);
}
}
}

foo(ee, 'foo', ac.signal);
ac.abort(); // Abort waiting for the event
ee.emit('foo'); // Prints: Waiting for the event was canceled!

@since v11.13.0, v10.16.0

abstract member once (event: string, listener: obj array -> unit) : Session

Emitted when any notification from the V8 Inspector is received. Issued when new execution context is created. Issued when execution context is destroyed. Issued when all executionContexts were cleared in browser Issued when exception was thrown and unhandled. Issued when unhandled exception was revoked. Issued when console API was called. Issued when object should be inspected (for example, as a result of inspect() command line API call). Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. Fired when virtual machine fails to parse the script. Fired when breakpoint is resolved to an actual script and location. Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. Fired when the virtual machine resumed execution. Issued when new console message is added. Sent when new profile recording is started using console.profile() call. 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. If heap objects tracking has been started then backend may send update for one or more fragments Contains an bucket of collected trace events. Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events. Issued when attached to a worker. Issued when detached from the worker. Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification). Fired when page is about to send HTTP request. Fired when HTTP response is available. Fired when data chunk was received over the network. This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect. This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

abstract member onceConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session

Issued when new console message is added.

once(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this
abstract member onceDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session

Fired when breakpoint is resolved to an actual script and location.

once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this
abstract member onceDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

once(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this
abstract member onceDebuggerResumed (listener: unit -> unit) : Session

Fired when the virtual machine resumed execution.

once(event: "Debugger.resumed", listener: () => void): this
abstract member onceDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session

Fired when virtual machine fails to parse the script.

once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this
abstract member onceDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this
abstract member onceHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this
abstract member onceHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session

If heap objects tracking has been started then backend may send update for one or more fragments

once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this
abstract member onceHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session

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.

once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this
abstract member onceHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this
abstract member onceHeapProfilerResetProfiles (listener: unit -> unit) : Session
once(event: "HeapProfiler.resetProfiles", listener: () => void): this
abstract member onceInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session

Emitted when any notification from the V8 Inspector is received.

once(event: "inspectorNotification", listener: (message: InspectorNotification<object>) => void): this
abstract member onceNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session

Fired when data chunk was received over the network.

once(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this
abstract member onceNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
once(event: "Network.loadingFailed", listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this
abstract member onceNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
once(event: "Network.loadingFinished", listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this
abstract member onceNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session

Fired when page is about to send HTTP request.

once(event: "Network.requestWillBeSent", listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this
abstract member onceNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session

Fired when HTTP response is available.

once(event: "Network.responseReceived", listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this
abstract member onceNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

once(event: "NodeRuntime.waitingForDebugger", listener: () => void): this
abstract member onceNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session

This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect.

once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this
abstract member onceNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session

Contains an bucket of collected trace events.

once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this
abstract member onceNodeTracingTracingComplete (listener: unit -> unit) : Session

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

once(event: "NodeTracing.tracingComplete", listener: () => void): this
abstract member onceNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session

Issued when attached to a worker.

once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this
abstract member onceNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session

Issued when detached from the worker.

once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this
abstract member onceNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this
abstract member onceProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this
abstract member onceProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session

Sent when new profile recording is started using console.profile() call.

once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this
abstract member onceRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session

Issued when console API was called.

once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this
abstract member onceRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session

Issued when unhandled exception was revoked.

once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this
abstract member onceRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session

Issued when exception was thrown and unhandled.

once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this
abstract member onceRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session

Issued when new execution context is created.

once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this
abstract member onceRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session

Issued when execution context is destroyed.

once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this
abstract member onceRuntimeExecutionContextsCleared (listener: unit -> unit) : Session

Issued when all executionContexts were cleared in browser

once(event: "Runtime.executionContextsCleared", listener: () => void): this
abstract member onceRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session

Issued when object should be inspected (for example, as a result of inspect() command line API call).

once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this
abstract member onceTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
once(event: "Target.attachedToTarget", listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this
abstract member onceTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
once(event: "Target.targetCreated", listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this
abstract member post (method: string, ?params: obj, ?callback: Callback2) : unit

Posts a message to the inspector back-end. callback will be notified when a response is received. callback is a function that accepts two optional arguments: error and message-specific result.

session.post('Runtime.evaluate', { expression: '2 + 2' },
(error, { result }) => console.log(result));
// Output: { type: 'number', value: 4, description: '4' }

The latest version of the V8 inspector protocol is published on the Chrome DevTools Protocol Viewer.

Node.js inspector supports all the Chrome DevTools Protocol domains declared by V8. Chrome DevTools Protocol domain provides an interface for interacting with one of the runtime agents used to inspect the application state and listen to the run-time events. Returns supported domains. Evaluates expression on global object. Add handler to promise with given promise object id. Calls function with given declaration on the given object. Object group of the result is inherited from the target object. Returns properties of a given object. Object group of the result is inherited from the target object. Releases remote object with given id. Releases all remote objects that belong to a given group. Tells inspected instance to run if it was waiting for debugger to attach. Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. Disables reporting of execution contexts creation. Discards collected exceptions and console API calls. Compiles expression. Runs script with given id in a given context. Returns all let, const and class variables from global scope. Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. Disables debugger for given page. Activates / deactivates all breakpoints on the page. Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). 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 locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. Sets JavaScript breakpoint at a given location. Removes JavaScript breakpoint. Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. Continues execution until specific location is reached. Steps over the statement. Steps into the function call. Steps out of the function call. Stops on the next JavaScript statement. 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. Resumes JavaScript execution. Returns stack trace with given stackTraceId. Searches for given string in script content. Edits JavaScript source live. Restarts particular call frame from the beginning. Returns source for the script with given id. Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. Evaluates expression on a given call frame. Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. Changes return value in top frame. Available only at return break position. Enables or disables async call stacks tracking. 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. 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. Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. Disables console domain, prevents further console messages from being reported to the client. Does nothing. Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. 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. Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). Gets supported tracing categories. Start trace events collection. Stop trace events collection. Remaining collected events will be sent as a sequence of dataCollected events followed by tracingComplete event. Sends protocol message over session with given id. Instructs the inspector to attach to running workers. Will also attach to new workers as they start Detaches from all running workers and disables attaching to new workers as they are started. Detached from the worker with given sessionId. Disables network tracking, prevents network events from being sent to the client. Enables network tracking, network events will now be delivered to the client. Returns post data sent with the request. Returns an error when no data was sent with the request. Returns content served for the given request. Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming. Fetches the resource and returns the content. Enable the NodeRuntime events except by NodeRuntime.waitingForDisconnect. Disable NodeRuntime events Enable the NodeRuntime.waitingForDisconnect. Read a chunk of the stream

@experimental

abstract member post (method: string, ?callback: Callback) : unit

Posts a message to the inspector back-end. callback will be notified when a response is received. callback is a function that accepts two optional arguments: error and message-specific result.

session.post('Runtime.evaluate', { expression: '2 + 2' },
(error, { result }) => console.log(result));
// Output: { type: 'number', value: 4, description: '4' }

The latest version of the V8 inspector protocol is published on the Chrome DevTools Protocol Viewer.

Node.js inspector supports all the Chrome DevTools Protocol domains declared by V8. Chrome DevTools Protocol domain provides an interface for interacting with one of the runtime agents used to inspect the application state and listen to the run-time events. Returns supported domains. Evaluates expression on global object. Add handler to promise with given promise object id. Calls function with given declaration on the given object. Object group of the result is inherited from the target object. Returns properties of a given object. Object group of the result is inherited from the target object. Releases remote object with given id. Releases all remote objects that belong to a given group. Tells inspected instance to run if it was waiting for debugger to attach. Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. Disables reporting of execution contexts creation. Discards collected exceptions and console API calls. Compiles expression. Runs script with given id in a given context. Returns all let, const and class variables from global scope. Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. Disables debugger for given page. Activates / deactivates all breakpoints on the page. Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). 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 locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. Sets JavaScript breakpoint at a given location. Removes JavaScript breakpoint. Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. Continues execution until specific location is reached. Steps over the statement. Steps into the function call. Steps out of the function call. Stops on the next JavaScript statement. 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. Resumes JavaScript execution. Returns stack trace with given stackTraceId. Searches for given string in script content. Edits JavaScript source live. Restarts particular call frame from the beginning. Returns source for the script with given id. Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. Evaluates expression on a given call frame. Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. Changes return value in top frame. Available only at return break position. Enables or disables async call stacks tracking. 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. 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. Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. Disables console domain, prevents further console messages from being reported to the client. Does nothing. Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. 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. Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). Gets supported tracing categories. Start trace events collection. Stop trace events collection. Remaining collected events will be sent as a sequence of dataCollected events followed by tracingComplete event. Sends protocol message over session with given id. Instructs the inspector to attach to running workers. Will also attach to new workers as they start Detaches from all running workers and disables attaching to new workers as they are started. Detached from the worker with given sessionId. Disables network tracking, prevents network events from being sent to the client. Enables network tracking, network events will now be delivered to the client. Returns post data sent with the request. Returns an error when no data was sent with the request. Returns content served for the given request. Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming. Fetches the resource and returns the content. Enable the NodeRuntime events except by NodeRuntime.waitingForDisconnect. Disable NodeRuntime events Enable the NodeRuntime.waitingForDisconnect. Read a chunk of the stream

abstract member postConsoleClearMessages (?callback: (exn option -> unit)) : unit

Does nothing.

post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void
abstract member postConsoleDisable (?callback: (exn option -> unit)) : unit

Disables console domain, prevents further console messages from being reported to the client.

post(method: "Console.disable", callback?: (err: Error | null) => void): void
abstract member postConsoleEnable (?callback: (exn option -> unit)) : unit

Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification.

post(method: "Console.enable", callback?: (err: Error | null) => void): void
abstract member postDebuggerContinueToLocation (?callback: (exn option -> unit)) : unit
post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerContinueToLocation (?params: ContinueToLocationParameterType, ?callback: (exn option -> unit)) : unit

Continues execution until specific location is reached.

post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerDisable (?callback: (exn option -> unit)) : unit

Disables debugger for given page.

post(method: "Debugger.disable", callback?: (err: Error | null) => void): void
abstract member postDebuggerEnable (?callback: Callback20) : unit

Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.

post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void
abstract member postDebuggerEvaluateOnCallFrame (?callback: Callback38) : unit
post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void

@experimental

abstract member postDebuggerEvaluateOnCallFrame (?params: EvaluateOnCallFrameParameterType, ?callback: Callback37) : unit

Evaluates expression on a given call frame.

post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void
abstract member postDebuggerGetPossibleBreakpoints (?callback: Callback26) : unit
post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void

@experimental

abstract member postDebuggerGetPossibleBreakpoints (?params: GetPossibleBreakpointsParameterType, ?callback: Callback25) : unit

Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.

post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void
abstract member postDebuggerGetScriptSource (?callback: Callback36) : unit
post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void

@experimental

abstract member postDebuggerGetScriptSource (?params: GetScriptSourceParameterType, ?callback: Callback35) : unit

Returns source for the script with given id.

post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void
abstract member postDebuggerGetStackTrace (?callback: Callback28) : unit
post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void

@experimental

abstract member postDebuggerGetStackTrace (?params: GetStackTraceParameterType, ?callback: Callback27) : unit

Returns stack trace with given stackTraceId.

post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void

@experimental

abstract member postDebuggerPause (?callback: (exn option -> unit)) : unit

Stops on the next JavaScript statement.

post(method: "Debugger.pause", callback?: (err: Error | null) => void): void
abstract member postDebuggerPauseOnAsyncCall (?callback: (exn option -> unit)) : unit
post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerPauseOnAsyncCall (?params: PauseOnAsyncCallParameterType, ?callback: (exn option -> unit)) : unit
post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerRemoveBreakpoint (?callback: (exn option -> unit)) : unit
post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerRemoveBreakpoint (?params: RemoveBreakpointParameterType, ?callback: (exn option -> unit)) : unit

Removes JavaScript breakpoint.

post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerRestartFrame (?callback: Callback34) : unit
post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void

@experimental

abstract member postDebuggerRestartFrame (?params: RestartFrameParameterType, ?callback: Callback33) : unit

Restarts particular call frame from the beginning.

post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void
abstract member postDebuggerResume (?callback: (exn option -> unit)) : unit

Resumes JavaScript execution.

post(method: "Debugger.resume", callback?: (err: Error | null) => void): void
abstract member postDebuggerScheduleStepIntoAsync (?callback: (exn option -> unit)) : unit

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.

post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSearchInContent (?callback: Callback30) : unit
post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void

@experimental

abstract member postDebuggerSearchInContent (?params: SearchInContentParameterType, ?callback: Callback29) : unit

Searches for given string in script content.

post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void
abstract member postDebuggerSetAsyncCallStackDepth (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetAsyncCallStackDepth (?params: SetAsyncCallStackDepthParameterType, ?callback: (exn option -> unit)) : unit

Enables or disables async call stacks tracking.

post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerSetBlackboxPatterns (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetBlackboxPatterns (?params: SetBlackboxPatternsParameterType, ?callback: (exn option -> unit)) : unit

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.

post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetBlackboxedRanges (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetBlackboxedRanges (?params: SetBlackboxedRangesParameterType, ?callback: (exn option -> unit)) : unit

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.

post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetBreakpoint (?callback: Callback24) : unit
post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void

@experimental

abstract member postDebuggerSetBreakpoint (?params: SetBreakpointParameterType, ?callback: Callback23) : unit

Sets JavaScript breakpoint at a given location.

post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void
abstract member postDebuggerSetBreakpointByUrl (?callback: Callback22) : unit
post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void

@experimental

abstract member postDebuggerSetBreakpointByUrl (?params: SetBreakpointByUrlParameterType, ?callback: Callback21) : unit

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 locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.

post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void
abstract member postDebuggerSetBreakpointsActive (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetBreakpointsActive (?params: SetBreakpointsActiveParameterType, ?callback: (exn option -> unit)) : unit

Activates / deactivates all breakpoints on the page.

post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerSetPauseOnExceptions (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetPauseOnExceptions (?params: SetPauseOnExceptionsParameterType, ?callback: (exn option -> unit)) : unit

Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none.

post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerSetReturnValue (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetReturnValue (?params: SetReturnValueParameterType, ?callback: (exn option -> unit)) : unit

Changes return value in top frame. Available only at return break position.

post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetScriptSource (?callback: Callback32) : unit
post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void

@experimental

abstract member postDebuggerSetScriptSource (?params: SetScriptSourceParameterType, ?callback: Callback31) : unit

Edits JavaScript source live.

post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void
abstract member postDebuggerSetSkipAllPauses (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetSkipAllPauses (?params: SetSkipAllPausesParameterType, ?callback: (exn option -> unit)) : unit

Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerSetVariableValue (?callback: (exn option -> unit)) : unit
post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerSetVariableValue (?params: SetVariableValueParameterType, ?callback: (exn option -> unit)) : unit

Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.

post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerStepInto (?callback: (exn option -> unit)) : unit
post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void

@experimental

abstract member postDebuggerStepInto (?params: StepIntoParameterType, ?callback: (exn option -> unit)) : unit

Steps into the function call.

post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void
abstract member postDebuggerStepOut (?callback: (exn option -> unit)) : unit

Steps out of the function call.

post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void
abstract member postDebuggerStepOver (?callback: (exn option -> unit)) : unit

Steps over the statement.

post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void
abstract member postHeapProfilerAddInspectedHeapObject (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerAddInspectedHeapObject (?params: AddInspectedHeapObjectParameterType, ?callback: (exn option -> unit)) : unit

Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void
abstract member postHeapProfilerCollectGarbage (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerDisable (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerEnable (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerGetHeapObjectId (?callback: Callback45) : unit
post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void

@experimental

abstract member postHeapProfilerGetHeapObjectId (?params: GetHeapObjectIdParameterType, ?callback: Callback44) : unit
post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void

@experimental

abstract member postHeapProfilerGetObjectByHeapObjectId (?callback: Callback43) : unit
post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void

@experimental

abstract member postHeapProfilerGetObjectByHeapObjectId (?params: GetObjectByHeapObjectIdParameterType, ?callback: Callback42) : unit
post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void

@experimental

abstract member postHeapProfilerGetSamplingProfile (?callback: Callback47) : unit
post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void

@experimental

abstract member postHeapProfilerStartSampling (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerStartSampling (?params: StartSamplingParameterType, ?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerStartTrackingHeapObjects (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerStartTrackingHeapObjects (?params: StartTrackingHeapObjectsParameterType, ?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerStopSampling (?callback: Callback46) : unit
post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void

@experimental

abstract member postHeapProfilerStopTrackingHeapObjects (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerStopTrackingHeapObjects (?params: StopTrackingHeapObjectsParameterType, ?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerTakeHeapSnapshot (?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void

@experimental

abstract member postHeapProfilerTakeHeapSnapshot (?params: TakeHeapSnapshotParameterType, ?callback: (exn option -> unit)) : unit
post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postIOClose (?callback: (exn option -> unit)) : unit
post(method: "IO.close", callback?: (err: Error | null) => void): void

@experimental

abstract member postIOClose (?params: CloseParameterType, ?callback: (exn option -> unit)) : unit
post(method: "IO.close", params?: IO.CloseParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postIORead (?callback: Callback58) : unit
post(method: "IO.read", callback?: (err: Error | null, params: IO.ReadReturnType) => void): void

@experimental

abstract member postIORead (?params: ReadParameterType, ?callback: Callback57) : unit

Read a chunk of the stream

post(method: "IO.read", params?: IO.ReadParameterType, callback?: (err: Error | null, params: IO.ReadReturnType) => void): void
abstract member postNetworkDisable (?callback: (exn option -> unit)) : unit

Disables network tracking, prevents network events from being sent to the client.

post(method: "Network.disable", callback?: (err: Error | null) => void): void
abstract member postNetworkEnable (?callback: (exn option -> unit)) : unit

Enables network tracking, network events will now be delivered to the client.

post(method: "Network.enable", callback?: (err: Error | null) => void): void
abstract member postNetworkGetRequestPostData (?callback: Callback50) : unit
post(method: "Network.getRequestPostData", callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void

@experimental

abstract member postNetworkGetRequestPostData (?params: GetRequestPostDataParameterType, ?callback: Callback49) : unit

Returns post data sent with the request. Returns an error when no data was sent with the request.

post(method: "Network.getRequestPostData", params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void
abstract member postNetworkGetResponseBody (?callback: Callback52) : unit
post(method: "Network.getResponseBody", callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void

@experimental

abstract member postNetworkGetResponseBody (?params: GetResponseBodyParameterType, ?callback: Callback51) : unit

Returns content served for the given request.

post(method: "Network.getResponseBody", params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void
abstract member postNetworkLoadNetworkResource (?callback: Callback56) : unit
post(method: "Network.loadNetworkResource", callback?: (err: Error | null, params: Network.LoadNetworkResourceReturnType) => void): void

@experimental

abstract member postNetworkLoadNetworkResource (?params: LoadNetworkResourceParameterType, ?callback: Callback55) : unit

Fetches the resource and returns the content.

post(method: "Network.loadNetworkResource", params?: Network.LoadNetworkResourceParameterType, callback?: (err: Error | null, params: Network.LoadNetworkResourceReturnType) => void): void
abstract member postNetworkStreamResourceContent (?callback: Callback54) : unit
post(method: "Network.streamResourceContent", callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void

@experimental

abstract member postNetworkStreamResourceContent (?params: StreamResourceContentParameterType, ?callback: Callback53) : unit

Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming.

post(method: "Network.streamResourceContent", params?: Network.StreamResourceContentParameterType, callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void

@experimental

abstract member postNodeRuntimeDisable (?callback: (exn option -> unit)) : unit

Disable NodeRuntime events

post(method: "NodeRuntime.disable", callback?: (err: Error | null) => void): void
abstract member postNodeRuntimeEnable (?callback: (exn option -> unit)) : unit

Enable the NodeRuntime events except by NodeRuntime.waitingForDisconnect.

post(method: "NodeRuntime.enable", callback?: (err: Error | null) => void): void
abstract member postNodeRuntimeNotifyWhenWaitingForDisconnect (?callback: (exn option -> unit)) : unit
post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void

@experimental

abstract member postNodeRuntimeNotifyWhenWaitingForDisconnect (?params: NotifyWhenWaitingForDisconnectParameterType, ?callback: (exn option -> unit)) : unit

Enable the NodeRuntime.waitingForDisconnect.

post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void
abstract member postNodeTracingGetCategories (?callback: Callback48) : unit

Gets supported tracing categories.

post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void
abstract member postNodeTracingStart (?callback: (exn option -> unit)) : unit
post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void

@experimental

abstract member postNodeTracingStart (?params: StartParameterType, ?callback: (exn option -> unit)) : unit

Start trace events collection.

post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void
abstract member postNodeTracingStop (?callback: (exn option -> unit)) : unit

Stop trace events collection. Remaining collected events will be sent as a sequence of dataCollected events followed by tracingComplete event.

post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void
abstract member postNodeWorkerDetach (?callback: (exn option -> unit)) : unit
post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void

@experimental

abstract member postNodeWorkerDetach (?params: DetachParameterType, ?callback: (exn option -> unit)) : unit

Detached from the worker with given sessionId.

post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void
abstract member postNodeWorkerDisable (?callback: (exn option -> unit)) : unit

Detaches from all running workers and disables attaching to new workers as they are started.

post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void
abstract member postNodeWorkerEnable (?callback: (exn option -> unit)) : unit
post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void

@experimental

abstract member postNodeWorkerEnable (?params: EnableParameterType, ?callback: (exn option -> unit)) : unit

Instructs the inspector to attach to running workers. Will also attach to new workers as they start

post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void
abstract member postNodeWorkerSendMessageToWorker (?callback: (exn option -> unit)) : unit
post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void

@experimental

abstract member postNodeWorkerSendMessageToWorker (?params: SendMessageToWorkerParameterType, ?callback: (exn option -> unit)) : unit

Sends protocol message over session with given id.

post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void
abstract member postProfilerDisable (?callback: (exn option -> unit)) : unit
post(method: "Profiler.disable", callback?: (err: Error | null) => void): void

@experimental

abstract member postProfilerEnable (?callback: (exn option -> unit)) : unit
post(method: "Profiler.enable", callback?: (err: Error | null) => void): void

@experimental

abstract member postProfilerGetBestEffortCoverage (?callback: Callback41) : unit

Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.

post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void
abstract member postProfilerSetSamplingInterval (?callback: (exn option -> unit)) : unit
post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void

@experimental

abstract member postProfilerSetSamplingInterval (?params: SetSamplingIntervalParameterType, ?callback: (exn option -> unit)) : unit

Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void
abstract member postProfilerStart (?callback: (exn option -> unit)) : unit
post(method: "Profiler.start", callback?: (err: Error | null) => void): void

@experimental

abstract member postProfilerStartPreciseCoverage (?callback: (exn option -> unit)) : unit
post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void

@experimental

abstract member postProfilerStartPreciseCoverage (?params: StartPreciseCoverageParameterType, ?callback: (exn option -> unit)) : unit

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.

post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void
abstract member postProfilerStop (?callback: Callback39) : unit
post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void

@experimental

abstract member postProfilerStopPreciseCoverage (?callback: (exn option -> unit)) : unit

Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.

post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void
abstract member postProfilerTakePreciseCoverage (?callback: Callback40) : unit

Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.

post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void
abstract member postRuntimeAwaitPromise (?callback: Callback7) : unit
post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void

@experimental

abstract member postRuntimeAwaitPromise (?params: AwaitPromiseParameterType, ?callback: Callback6) : unit

Add handler to promise with given promise object id.

post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void
abstract member postRuntimeCallFunctionOn (?callback: Callback9) : unit
post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void

@experimental

abstract member postRuntimeCallFunctionOn (?params: CallFunctionOnParameterType, ?callback: Callback8) : unit

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void
abstract member postRuntimeCompileScript (?callback: Callback13) : unit
post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void

@experimental

abstract member postRuntimeCompileScript (?params: CompileScriptParameterType, ?callback: Callback12) : unit

Compiles expression.

post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void
abstract member postRuntimeDisable (?callback: (exn option -> unit)) : unit

Disables reporting of execution contexts creation.

post(method: "Runtime.disable", callback?: (err: Error | null) => void): void
abstract member postRuntimeDiscardConsoleEntries (?callback: (exn option -> unit)) : unit

Discards collected exceptions and console API calls.

post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void
abstract member postRuntimeEnable (?callback: (exn option -> unit)) : unit

Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

post(method: "Runtime.enable", callback?: (err: Error | null) => void): void
abstract member postRuntimeEvaluate (?callback: Callback5) : unit
post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void

@experimental

abstract member postRuntimeEvaluate (?params: EvaluateParameterType, ?callback: Callback4) : unit

Evaluates expression on global object.

post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void
abstract member postRuntimeGetProperties (?callback: Callback11) : unit
post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void

@experimental

abstract member postRuntimeGetProperties (?params: GetPropertiesParameterType, ?callback: Callback10) : unit

Returns properties of a given object. Object group of the result is inherited from the target object.

post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void
abstract member postRuntimeGlobalLexicalScopeNames (?callback: Callback19) : unit
post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void

@experimental

abstract member postRuntimeGlobalLexicalScopeNames (?params: GlobalLexicalScopeNamesParameterType, ?callback: Callback18) : unit

Returns all let, const and class variables from global scope.

post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType, callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void
abstract member postRuntimeQueryObjects (?callback: Callback17) : unit
post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void

@experimental

abstract member postRuntimeQueryObjects (?params: QueryObjectsParameterType, ?callback: Callback16) : unit
post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void

@experimental

abstract member postRuntimeReleaseObject (?callback: (exn option -> unit)) : unit
post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void

@experimental

abstract member postRuntimeReleaseObject (?params: ReleaseObjectParameterType, ?callback: (exn option -> unit)) : unit

Releases remote object with given id.

post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void
abstract member postRuntimeReleaseObjectGroup (?callback: (exn option -> unit)) : unit
post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void

@experimental

abstract member postRuntimeReleaseObjectGroup (?params: ReleaseObjectGroupParameterType, ?callback: (exn option -> unit)) : unit

Releases all remote objects that belong to a given group.

post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void
abstract member postRuntimeRunIfWaitingForDebugger (?callback: (exn option -> unit)) : unit

Tells inspected instance to run if it was waiting for debugger to attach.

post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void
abstract member postRuntimeRunScript (?callback: Callback15) : unit
post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void

@experimental

abstract member postRuntimeRunScript (?params: RunScriptParameterType, ?callback: Callback14) : unit

Runs script with given id in a given context.

post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void
abstract member postRuntimeSetCustomObjectFormatterEnabled (?callback: (exn option -> unit)) : unit
post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void

@experimental

abstract member postRuntimeSetCustomObjectFormatterEnabled (?params: SetCustomObjectFormatterEnabledParameterType, ?callback: (exn option -> unit)) : unit
post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member postSchemaGetDomains (?callback: Callback3) : unit

Returns supported domains.

post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void
abstract member postTargetSetAutoAttach (?callback: (exn option -> unit)) : unit
post(method: "Target.setAutoAttach", callback?: (err: Error | null) => void): void

@experimental

abstract member postTargetSetAutoAttach (?params: SetAutoAttachParameterType, ?callback: (exn option -> unit)) : unit
post(method: "Target.setAutoAttach", params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void

@experimental

abstract member prependListener (event: string, listener: obj array -> unit) : Session

Emitted when any notification from the V8 Inspector is received. Issued when new execution context is created. Issued when execution context is destroyed. Issued when all executionContexts were cleared in browser Issued when exception was thrown and unhandled. Issued when unhandled exception was revoked. Issued when console API was called. Issued when object should be inspected (for example, as a result of inspect() command line API call). Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. Fired when virtual machine fails to parse the script. Fired when breakpoint is resolved to an actual script and location. Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. Fired when the virtual machine resumed execution. Issued when new console message is added. Sent when new profile recording is started using console.profile() call. 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. If heap objects tracking has been started then backend may send update for one or more fragments Contains an bucket of collected trace events. Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events. Issued when attached to a worker. Issued when detached from the worker. Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification). Fired when page is about to send HTTP request. Fired when HTTP response is available. Fired when data chunk was received over the network. This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect. This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

abstract member prependListenerConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session

Issued when new console message is added.

prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this
abstract member prependListenerDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session

Fired when breakpoint is resolved to an actual script and location.

prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this
abstract member prependListenerDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

prependListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this
abstract member prependListenerDebuggerResumed (listener: unit -> unit) : Session

Fired when the virtual machine resumed execution.

prependListener(event: "Debugger.resumed", listener: () => void): this
abstract member prependListenerDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session

Fired when virtual machine fails to parse the script.

prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this
abstract member prependListenerDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this
abstract member prependListenerHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this
abstract member prependListenerHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session

If heap objects tracking has been started then backend may send update for one or more fragments

prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this
abstract member prependListenerHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session

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.

prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this
abstract member prependListenerHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this
abstract member prependListenerHeapProfilerResetProfiles (listener: unit -> unit) : Session
prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this
abstract member prependListenerInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session

Emitted when any notification from the V8 Inspector is received.

prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<object>) => void): this
abstract member prependListenerNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session

Fired when data chunk was received over the network.

prependListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this
abstract member prependListenerNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
prependListener(event: "Network.loadingFailed", listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this
abstract member prependListenerNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
prependListener(event: "Network.loadingFinished", listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this
abstract member prependListenerNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session

Fired when page is about to send HTTP request.

prependListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this
abstract member prependListenerNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session

Fired when HTTP response is available.

prependListener(event: "Network.responseReceived", listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this
abstract member prependListenerNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

prependListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this
abstract member prependListenerNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session

This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect.

prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this
abstract member prependListenerNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session

Contains an bucket of collected trace events.

prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this
abstract member prependListenerNodeTracingTracingComplete (listener: unit -> unit) : Session

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this
abstract member prependListenerNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session

Issued when attached to a worker.

prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this
abstract member prependListenerNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session

Issued when detached from the worker.

prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this
abstract member prependListenerNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this
abstract member prependListenerProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this
abstract member prependListenerProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session

Sent when new profile recording is started using console.profile() call.

prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this
abstract member prependListenerRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session

Issued when console API was called.

prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this
abstract member prependListenerRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session

Issued when unhandled exception was revoked.

prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this
abstract member prependListenerRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session

Issued when exception was thrown and unhandled.

prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this
abstract member prependListenerRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session

Issued when new execution context is created.

prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this
abstract member prependListenerRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session

Issued when execution context is destroyed.

prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this
abstract member prependListenerRuntimeExecutionContextsCleared (listener: unit -> unit) : Session

Issued when all executionContexts were cleared in browser

prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this
abstract member prependListenerRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session

Issued when object should be inspected (for example, as a result of inspect() command line API call).

prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this
abstract member prependListenerTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
prependListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this
abstract member prependListenerTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
prependListener(event: "Target.targetCreated", listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this
abstract member prependOnceListener (event: string, listener: obj array -> unit) : Session

Emitted when any notification from the V8 Inspector is received. Issued when new execution context is created. Issued when execution context is destroyed. Issued when all executionContexts were cleared in browser Issued when exception was thrown and unhandled. Issued when unhandled exception was revoked. Issued when console API was called. Issued when object should be inspected (for example, as a result of inspect() command line API call). Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. Fired when virtual machine fails to parse the script. Fired when breakpoint is resolved to an actual script and location. Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. Fired when the virtual machine resumed execution. Issued when new console message is added. Sent when new profile recording is started using console.profile() call. 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. If heap objects tracking has been started then backend may send update for one or more fragments Contains an bucket of collected trace events. Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events. Issued when attached to a worker. Issued when detached from the worker. Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification). Fired when page is about to send HTTP request. Fired when HTTP response is available. Fired when data chunk was received over the network. This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect. This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

abstract member prependOnceListenerConsoleMessageAdded (listener: InspectorNotification<MessageAddedEventDataType> -> unit) : Session

Issued when new console message is added.

prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this
abstract member prependOnceListenerDebuggerBreakpointResolved (listener: InspectorNotification<BreakpointResolvedEventDataType> -> unit) : Session

Fired when breakpoint is resolved to an actual script and location.

prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this
abstract member prependOnceListenerDebuggerPaused (listener: InspectorNotification<PausedEventDataType> -> unit) : Session

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this
abstract member prependOnceListenerDebuggerResumed (listener: unit -> unit) : Session

Fired when the virtual machine resumed execution.

prependOnceListener(event: "Debugger.resumed", listener: () => void): this
abstract member prependOnceListenerDebuggerScriptFailedToParse (listener: InspectorNotification<ScriptFailedToParseEventDataType> -> unit) : Session

Fired when virtual machine fails to parse the script.

prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this
abstract member prependOnceListenerDebuggerScriptParsed (listener: InspectorNotification<ScriptParsedEventDataType> -> unit) : Session

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this
abstract member prependOnceListenerHeapProfilerAddHeapSnapshotChunk (listener: InspectorNotification<AddHeapSnapshotChunkEventDataType> -> unit) : Session
prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this
abstract member prependOnceListenerHeapProfilerHeapStatsUpdate (listener: InspectorNotification<HeapStatsUpdateEventDataType> -> unit) : Session

If heap objects tracking has been started then backend may send update for one or more fragments

prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this
abstract member prependOnceListenerHeapProfilerLastSeenObjectId (listener: InspectorNotification<LastSeenObjectIdEventDataType> -> unit) : Session

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.

prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this
abstract member prependOnceListenerHeapProfilerReportHeapSnapshotProgress (listener: InspectorNotification<ReportHeapSnapshotProgressEventDataType> -> unit) : Session
prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this
abstract member prependOnceListenerHeapProfilerResetProfiles (listener: unit -> unit) : Session
prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this
abstract member prependOnceListenerInspectorNotification (listener: InspectorNotification<obj> -> unit) : Session

Emitted when any notification from the V8 Inspector is received.

prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<object>) => void): this
abstract member prependOnceListenerNetworkDataReceived (listener: InspectorNotification<DataReceivedEventDataType> -> unit) : Session

Fired when data chunk was received over the network.

prependOnceListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this
abstract member prependOnceListenerNetworkLoadingFailed (listener: InspectorNotification<LoadingFailedEventDataType> -> unit) : Session
prependOnceListener(event: "Network.loadingFailed", listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this
abstract member prependOnceListenerNetworkLoadingFinished (listener: InspectorNotification<LoadingFinishedEventDataType> -> unit) : Session
prependOnceListener(event: "Network.loadingFinished", listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this
abstract member prependOnceListenerNetworkRequestWillBeSent (listener: InspectorNotification<RequestWillBeSentEventDataType> -> unit) : Session

Fired when page is about to send HTTP request.

prependOnceListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void): this
abstract member prependOnceListenerNetworkResponseReceived (listener: InspectorNotification<ResponseReceivedEventDataType> -> unit) : Session

Fired when HTTP response is available.

prependOnceListener(event: "Network.responseReceived", listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this
abstract member prependOnceListenerNodeRuntimeWaitingForDebugger (listener: unit -> unit) : Session

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

prependOnceListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this
abstract member prependOnceListenerNodeRuntimeWaitingForDisconnect (listener: unit -> unit) : Session

This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect.

prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this
abstract member prependOnceListenerNodeTracingDataCollected (listener: InspectorNotification<DataCollectedEventDataType> -> unit) : Session

Contains an bucket of collected trace events.

prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this
abstract member prependOnceListenerNodeTracingTracingComplete (listener: unit -> unit) : Session

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this
abstract member prependOnceListenerNodeWorkerAttachedToWorker (listener: InspectorNotification<AttachedToWorkerEventDataType> -> unit) : Session

Issued when attached to a worker.

prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this
abstract member prependOnceListenerNodeWorkerDetachedFromWorker (listener: InspectorNotification<DetachedFromWorkerEventDataType> -> unit) : Session

Issued when detached from the worker.

prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this
abstract member prependOnceListenerNodeWorkerReceivedMessageFromWorker (listener: InspectorNotification<ReceivedMessageFromWorkerEventDataType> -> unit) : Session

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this
abstract member prependOnceListenerProfilerConsoleProfileFinished (listener: InspectorNotification<ConsoleProfileFinishedEventDataType> -> unit) : Session
prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this
abstract member prependOnceListenerProfilerConsoleProfileStarted (listener: InspectorNotification<ConsoleProfileStartedEventDataType> -> unit) : Session

Sent when new profile recording is started using console.profile() call.

prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this
abstract member prependOnceListenerRuntimeConsoleAPICalled (listener: InspectorNotification<ConsoleAPICalledEventDataType> -> unit) : Session

Issued when console API was called.

prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this
abstract member prependOnceListenerRuntimeExceptionRevoked (listener: InspectorNotification<ExceptionRevokedEventDataType> -> unit) : Session

Issued when unhandled exception was revoked.

prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this
abstract member prependOnceListenerRuntimeExceptionThrown (listener: InspectorNotification<ExceptionThrownEventDataType> -> unit) : Session

Issued when exception was thrown and unhandled.

prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this
abstract member prependOnceListenerRuntimeExecutionContextCreated (listener: InspectorNotification<ExecutionContextCreatedEventDataType> -> unit) : Session

Issued when new execution context is created.

prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this
abstract member prependOnceListenerRuntimeExecutionContextDestroyed (listener: InspectorNotification<ExecutionContextDestroyedEventDataType> -> unit) : Session

Issued when execution context is destroyed.

prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this
abstract member prependOnceListenerRuntimeExecutionContextsCleared (listener: unit -> unit) : Session

Issued when all executionContexts were cleared in browser

prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this
abstract member prependOnceListenerRuntimeInspectRequested (listener: InspectorNotification<InspectRequestedEventDataType> -> unit) : Session

Issued when object should be inspected (for example, as a result of inspect() command line API call).

prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this
abstract member prependOnceListenerTargetAttachedToTarget (listener: InspectorNotification<AttachedToTargetEventDataType> -> unit) : Session
prependOnceListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this
abstract member prependOnceListenerTargetTargetCreated (listener: InspectorNotification<TargetCreatedEventDataType> -> unit) : Session
prependOnceListener(event: "Target.targetCreated", listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this
abstract member rawListeners (eventName: U2<string,Symbol>) : Function array

Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

import { EventEmitter } from 'node:events';
const emitter = new EventEmitter();
emitter.once('log', () => console.log('log once'));

// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];

// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();

// Logs "log once" to the console and removes the listener
logFnWrapper();

emitter.on('log', () => console.log('log persistently'));
// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');

// Logs "log persistently" twice
newListeners[0]();
emitter.emit('log');

@since v9.4.0

abstract member removeAllListeners (?eventName: U2<string,Symbol>) : Session

Removes all listeners, or those of the specified eventName.

It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

Returns a reference to the EventEmitter, so that calls can be chained.

@since v0.1.26

abstract member removeListener (eventName: U2<string,Symbol>, listener: obj array -> unit) : Session

Removes the specified listener from the listener array for the event named eventName.

const callback = (stream) => {
console.log('someone connected!');
};
server.on('connection', callback);
// ...
server.removeListener('connection', callback);

removeListener() will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified eventName, then removeListener() must be called multiple times to remove each instance.

Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution will not remove them fromemit() in progress. Subsequent events behave as expected.

import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();

const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};

const callbackB = () => {
console.log('B');
};

myEmitter.on('event', callbackA);

myEmitter.on('event', callbackB);

// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
//   A
//   B

// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
//   A

Because listeners are managed using an internal array, calling this will change the position indices of any listener registered after the listener being removed. This will not impact the order in which listeners are called, but it means that any copies of the listener array as returned by the emitter.listeners() method will need to be recreated.

When a single function has been added as a handler multiple times for a single event (as in the example below), removeListener() will remove the most recently added instance. In the example the once('ping') listener is removed:

import { EventEmitter } from 'node:events';
const ee = new EventEmitter();

function pong() {
console.log('pong');
}

ee.on('ping', pong);
ee.once('ping', pong);
ee.removeListener('ping', pong);

ee.emit('ping');
ee.emit('ping');

Returns a reference to the EventEmitter, so that calls can be chained.

@since v0.1.26

static member setMaxListeners (n: float option, eventTargets: U2<EventEmitter<unit array>,EventTarget> array) : unit
import { setMaxListeners, EventEmitter } from 'node:events';

const target = new EventTarget();
const emitter = new EventEmitter();

setMaxListeners(5, target, emitter);

@since v15.4.0

Parameter
nA non-negative number. The maximum number of listeners per EventTarget event.
eventTargetsZero or more or instances. If none are specified, n is set as the default max for all newly created and objects.
abstract member setMaxListeners (n: float) : Session

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

Returns a reference to the EventEmitter, so that calls can be chained.

@since v0.3.5