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) : Promise<unit>
    abstract member postConsoleClearMessages () : Promise<unit>
    abstract member postConsoleDisable () : Promise<unit>
    abstract member postConsoleEnable () : Promise<unit>
    abstract member postDebuggerContinueToLocation (?params: ContinueToLocationParameterType) : Promise<unit>
    abstract member postDebuggerDisable () : Promise<unit>
    abstract member postDebuggerEnable () : Promise<EnableReturnType>
    abstract member postDebuggerEvaluateOnCallFrame (?params: EvaluateOnCallFrameParameterType) : Promise<EvaluateOnCallFrameReturnType>
    abstract member postDebuggerGetPossibleBreakpoints (?params: GetPossibleBreakpointsParameterType) : Promise<GetPossibleBreakpointsReturnType>
    abstract member postDebuggerGetScriptSource (?params: GetScriptSourceParameterType) : Promise<GetScriptSourceReturnType>
    abstract member postDebuggerGetStackTrace (?params: GetStackTraceParameterType) : Promise<GetStackTraceReturnType>
    abstract member postDebuggerPause () : Promise<unit>
    abstract member postDebuggerPauseOnAsyncCall (?params: PauseOnAsyncCallParameterType) : Promise<unit>
    abstract member postDebuggerRemoveBreakpoint (?params: RemoveBreakpointParameterType) : Promise<unit>
    abstract member postDebuggerRestartFrame (?params: RestartFrameParameterType) : Promise<RestartFrameReturnType>
    abstract member postDebuggerResume () : Promise<unit>
    abstract member postDebuggerScheduleStepIntoAsync () : Promise<unit>
    abstract member postDebuggerSearchInContent (?params: SearchInContentParameterType) : Promise<SearchInContentReturnType>
    abstract member postDebuggerSetAsyncCallStackDepth (?params: SetAsyncCallStackDepthParameterType) : Promise<unit>
    abstract member postDebuggerSetBlackboxPatterns (?params: SetBlackboxPatternsParameterType) : Promise<unit>
    abstract member postDebuggerSetBlackboxedRanges (?params: SetBlackboxedRangesParameterType) : Promise<unit>
    abstract member postDebuggerSetBreakpoint (?params: SetBreakpointParameterType) : Promise<SetBreakpointReturnType>
    abstract member postDebuggerSetBreakpointByUrl (?params: SetBreakpointByUrlParameterType) : Promise<SetBreakpointByUrlReturnType>
    abstract member postDebuggerSetBreakpointsActive (?params: SetBreakpointsActiveParameterType) : Promise<unit>
    abstract member postDebuggerSetPauseOnExceptions (?params: SetPauseOnExceptionsParameterType) : Promise<unit>
    abstract member postDebuggerSetReturnValue (?params: SetReturnValueParameterType) : Promise<unit>
    abstract member postDebuggerSetScriptSource (?params: SetScriptSourceParameterType) : Promise<SetScriptSourceReturnType>
    abstract member postDebuggerSetSkipAllPauses (?params: SetSkipAllPausesParameterType) : Promise<unit>
    abstract member postDebuggerSetVariableValue (?params: SetVariableValueParameterType) : Promise<unit>
    abstract member postDebuggerStepInto (?params: StepIntoParameterType) : Promise<unit>
    abstract member postDebuggerStepOut () : Promise<unit>
    abstract member postDebuggerStepOver () : Promise<unit>
    abstract member postHeapProfilerAddInspectedHeapObject (?params: AddInspectedHeapObjectParameterType) : Promise<unit>
    abstract member postHeapProfilerCollectGarbage () : Promise<unit>
    abstract member postHeapProfilerDisable () : Promise<unit>
    abstract member postHeapProfilerEnable () : Promise<unit>
    abstract member postHeapProfilerGetHeapObjectId (?params: GetHeapObjectIdParameterType) : Promise<GetHeapObjectIdReturnType>
    abstract member postHeapProfilerGetObjectByHeapObjectId (?params: GetObjectByHeapObjectIdParameterType) : Promise<GetObjectByHeapObjectIdReturnType>
    abstract member postHeapProfilerGetSamplingProfile () : Promise<GetSamplingProfileReturnType>
    abstract member postHeapProfilerStartSampling (?params: StartSamplingParameterType) : Promise<unit>
    abstract member postHeapProfilerStartTrackingHeapObjects (?params: StartTrackingHeapObjectsParameterType) : Promise<unit>
    abstract member postHeapProfilerStopSampling () : Promise<StopSamplingReturnType>
    abstract member postHeapProfilerStopTrackingHeapObjects (?params: StopTrackingHeapObjectsParameterType) : Promise<unit>
    abstract member postHeapProfilerTakeHeapSnapshot (?params: TakeHeapSnapshotParameterType) : Promise<unit>
    abstract member postIOClose (?params: CloseParameterType) : Promise<unit>
    abstract member postIORead (?params: ReadParameterType) : Promise<ReadReturnType>
    abstract member postNetworkDisable () : Promise<unit>
    abstract member postNetworkEnable () : Promise<unit>
    abstract member postNetworkGetRequestPostData (?params: GetRequestPostDataParameterType) : Promise<GetRequestPostDataReturnType>
    abstract member postNetworkGetResponseBody (?params: GetResponseBodyParameterType) : Promise<GetResponseBodyReturnType>
    abstract member postNetworkLoadNetworkResource (?params: LoadNetworkResourceParameterType) : Promise<LoadNetworkResourceReturnType>
    abstract member postNetworkStreamResourceContent (?params: StreamResourceContentParameterType) : Promise<StreamResourceContentReturnType>
    abstract member postNodeRuntimeDisable () : Promise<unit>
    abstract member postNodeRuntimeEnable () : Promise<unit>
    abstract member postNodeRuntimeNotifyWhenWaitingForDisconnect (?params: NotifyWhenWaitingForDisconnectParameterType) : Promise<unit>
    abstract member postNodeTracingGetCategories () : Promise<GetCategoriesReturnType>
    abstract member postNodeTracingStart (?params: StartParameterType) : Promise<unit>
    abstract member postNodeTracingStop () : Promise<unit>
    abstract member postNodeWorkerDetach (?params: DetachParameterType) : Promise<unit>
    abstract member postNodeWorkerDisable () : Promise<unit>
    abstract member postNodeWorkerEnable (?params: EnableParameterType) : Promise<unit>
    abstract member postNodeWorkerSendMessageToWorker (?params: SendMessageToWorkerParameterType) : Promise<unit>
    abstract member postProfilerDisable () : Promise<unit>
    abstract member postProfilerEnable () : Promise<unit>
    abstract member postProfilerGetBestEffortCoverage () : Promise<GetBestEffortCoverageReturnType>
    abstract member postProfilerSetSamplingInterval (?params: SetSamplingIntervalParameterType) : Promise<unit>
    abstract member postProfilerStart () : Promise<unit>
    abstract member postProfilerStartPreciseCoverage (?params: StartPreciseCoverageParameterType) : Promise<unit>
    abstract member postProfilerStop () : Promise<StopReturnType>
    abstract member postProfilerStopPreciseCoverage () : Promise<unit>
    abstract member postProfilerTakePreciseCoverage () : Promise<TakePreciseCoverageReturnType>
    abstract member postRuntimeAwaitPromise (?params: AwaitPromiseParameterType) : Promise<AwaitPromiseReturnType>
    abstract member postRuntimeCallFunctionOn (?params: CallFunctionOnParameterType) : Promise<CallFunctionOnReturnType>
    abstract member postRuntimeCompileScript (?params: CompileScriptParameterType) : Promise<CompileScriptReturnType>
    abstract member postRuntimeDisable () : Promise<unit>
    abstract member postRuntimeDiscardConsoleEntries () : Promise<unit>
    abstract member postRuntimeEnable () : Promise<unit>
    abstract member postRuntimeEvaluate (?params: EvaluateParameterType) : Promise<EvaluateReturnType>
    abstract member postRuntimeGetProperties (?params: GetPropertiesParameterType) : Promise<GetPropertiesReturnType>
    abstract member postRuntimeGlobalLexicalScopeNames (?params: GlobalLexicalScopeNamesParameterType) : Promise<GlobalLexicalScopeNamesReturnType>
    abstract member postRuntimeQueryObjects (?params: QueryObjectsParameterType) : Promise<QueryObjectsReturnType>
    abstract member postRuntimeReleaseObject (?params: ReleaseObjectParameterType) : Promise<unit>
    abstract member postRuntimeReleaseObjectGroup (?params: ReleaseObjectGroupParameterType) : Promise<unit>
    abstract member postRuntimeRunIfWaitingForDebugger () : Promise<unit>
    abstract member postRuntimeRunScript (?params: RunScriptParameterType) : Promise<RunScriptReturnType>
    abstract member postRuntimeSetCustomObjectFormatterEnabled (?params: SetCustomObjectFormatterEnabledParameterType) : Promise<unit>
    abstract member postSchemaGetDomains () : Promise<GetDomainsReturnType>
    abstract member postTargetSetAutoAttach (?params: SetAutoAttachParameterType) : Promise<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.

@since v19.0.0

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) : Promise<unit>

Posts a message to the inspector back-end.

import { Session } from 'node:inspector/promises';
try {
const session = new Session();
session.connect();
const result = await session.post('Runtime.evaluate', { expression: '2 + 2' });
console.log(result);
} catch (error) {
console.error(error);
}
// Output: { result: { 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 () : Promise<unit>

Does nothing.

post(method: "Console.clearMessages"): Promise<void>
abstract member postConsoleDisable () : Promise<unit>

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

post(method: "Console.disable"): Promise<void>
abstract member postConsoleEnable () : Promise<unit>

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

post(method: "Console.enable"): Promise<void>
abstract member postDebuggerContinueToLocation (?params: ContinueToLocationParameterType) : Promise<unit>

Continues execution until specific location is reached.

post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType): Promise<void>
abstract member postDebuggerDisable () : Promise<unit>

Disables debugger for given page.

post(method: "Debugger.disable"): Promise<void>
abstract member postDebuggerEnable () : Promise<EnableReturnType>

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"): Promise<Debugger.EnableReturnType>
abstract member postDebuggerEvaluateOnCallFrame (?params: EvaluateOnCallFrameParameterType) : Promise<EvaluateOnCallFrameReturnType>

Evaluates expression on a given call frame.

post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType): Promise<Debugger.EvaluateOnCallFrameReturnType>
abstract member postDebuggerGetPossibleBreakpoints (?params: GetPossibleBreakpointsParameterType) : Promise<GetPossibleBreakpointsReturnType>

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

post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType): Promise<Debugger.GetPossibleBreakpointsReturnType>
abstract member postDebuggerGetScriptSource (?params: GetScriptSourceParameterType) : Promise<GetScriptSourceReturnType>

Returns source for the script with given id.

post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType): Promise<Debugger.GetScriptSourceReturnType>
abstract member postDebuggerGetStackTrace (?params: GetStackTraceParameterType) : Promise<GetStackTraceReturnType>

Returns stack trace with given stackTraceId.

post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType): Promise<Debugger.GetStackTraceReturnType>

@experimental

abstract member postDebuggerPause () : Promise<unit>

Stops on the next JavaScript statement.

post(method: "Debugger.pause"): Promise<void>
abstract member postDebuggerPauseOnAsyncCall (?params: PauseOnAsyncCallParameterType) : Promise<unit>
post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType): Promise<void>

@experimental

abstract member postDebuggerRemoveBreakpoint (?params: RemoveBreakpointParameterType) : Promise<unit>

Removes JavaScript breakpoint.

post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType): Promise<void>
abstract member postDebuggerRestartFrame (?params: RestartFrameParameterType) : Promise<RestartFrameReturnType>

Restarts particular call frame from the beginning.

post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType): Promise<Debugger.RestartFrameReturnType>
abstract member postDebuggerResume () : Promise<unit>

Resumes JavaScript execution.

post(method: "Debugger.resume"): Promise<void>
abstract member postDebuggerScheduleStepIntoAsync () : Promise<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"): Promise<void>

@experimental

abstract member postDebuggerSearchInContent (?params: SearchInContentParameterType) : Promise<SearchInContentReturnType>

Searches for given string in script content.

post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType): Promise<Debugger.SearchInContentReturnType>
abstract member postDebuggerSetAsyncCallStackDepth (?params: SetAsyncCallStackDepthParameterType) : Promise<unit>

Enables or disables async call stacks tracking.

post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType): Promise<void>
abstract member postDebuggerSetBlackboxPatterns (?params: SetBlackboxPatternsParameterType) : Promise<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): Promise<void>

@experimental

abstract member postDebuggerSetBlackboxedRanges (?params: SetBlackboxedRangesParameterType) : Promise<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): Promise<void>

@experimental

abstract member postDebuggerSetBreakpoint (?params: SetBreakpointParameterType) : Promise<SetBreakpointReturnType>

Sets JavaScript breakpoint at a given location.

post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType): Promise<Debugger.SetBreakpointReturnType>
abstract member postDebuggerSetBreakpointByUrl (?params: SetBreakpointByUrlParameterType) : Promise<SetBreakpointByUrlReturnType>

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): Promise<Debugger.SetBreakpointByUrlReturnType>
abstract member postDebuggerSetBreakpointsActive (?params: SetBreakpointsActiveParameterType) : Promise<unit>

Activates / deactivates all breakpoints on the page.

post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType): Promise<void>
abstract member postDebuggerSetPauseOnExceptions (?params: SetPauseOnExceptionsParameterType) : Promise<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): Promise<void>
abstract member postDebuggerSetReturnValue (?params: SetReturnValueParameterType) : Promise<unit>

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

post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType): Promise<void>

@experimental

abstract member postDebuggerSetScriptSource (?params: SetScriptSourceParameterType) : Promise<SetScriptSourceReturnType>

Edits JavaScript source live.

post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType): Promise<Debugger.SetScriptSourceReturnType>
abstract member postDebuggerSetSkipAllPauses (?params: SetSkipAllPausesParameterType) : Promise<unit>

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

post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType): Promise<void>
abstract member postDebuggerSetVariableValue (?params: SetVariableValueParameterType) : Promise<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): Promise<void>
abstract member postDebuggerStepInto (?params: StepIntoParameterType) : Promise<unit>

Steps into the function call.

post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType): Promise<void>
abstract member postDebuggerStepOut () : Promise<unit>

Steps out of the function call.

post(method: "Debugger.stepOut"): Promise<void>
abstract member postDebuggerStepOver () : Promise<unit>

Steps over the statement.

post(method: "Debugger.stepOver"): Promise<void>
abstract member postHeapProfilerAddInspectedHeapObject (?params: AddInspectedHeapObjectParameterType) : Promise<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): Promise<void>
abstract member postHeapProfilerCollectGarbage () : Promise<unit>
post(method: "HeapProfiler.collectGarbage"): Promise<void>

@experimental

abstract member postHeapProfilerDisable () : Promise<unit>
post(method: "HeapProfiler.disable"): Promise<void>

@experimental

abstract member postHeapProfilerEnable () : Promise<unit>
post(method: "HeapProfiler.enable"): Promise<void>

@experimental

abstract member postHeapProfilerGetHeapObjectId (?params: GetHeapObjectIdParameterType) : Promise<GetHeapObjectIdReturnType>
post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType): Promise<HeapProfiler.GetHeapObjectIdReturnType>

@experimental

abstract member postHeapProfilerGetObjectByHeapObjectId (?params: GetObjectByHeapObjectIdParameterType) : Promise<GetObjectByHeapObjectIdReturnType>
post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise<HeapProfiler.GetObjectByHeapObjectIdReturnType>

@experimental

abstract member postHeapProfilerGetSamplingProfile () : Promise<GetSamplingProfileReturnType>
post(method: "HeapProfiler.getSamplingProfile"): Promise<HeapProfiler.GetSamplingProfileReturnType>

@experimental

abstract member postHeapProfilerStartSampling (?params: StartSamplingParameterType) : Promise<unit>
post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType): Promise<void>

@experimental

abstract member postHeapProfilerStartTrackingHeapObjects (?params: StartTrackingHeapObjectsParameterType) : Promise<unit>
post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise<void>

@experimental

abstract member postHeapProfilerStopSampling () : Promise<StopSamplingReturnType>
post(method: "HeapProfiler.stopSampling"): Promise<HeapProfiler.StopSamplingReturnType>

@experimental

abstract member postHeapProfilerStopTrackingHeapObjects (?params: StopTrackingHeapObjectsParameterType) : Promise<unit>
post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise<void>

@experimental

abstract member postHeapProfilerTakeHeapSnapshot (?params: TakeHeapSnapshotParameterType) : Promise<unit>
post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise<void>

@experimental

abstract member postIOClose (?params: CloseParameterType) : Promise<unit>
post(method: "IO.close", params?: IO.CloseParameterType): Promise<void>

@experimental

abstract member postIORead (?params: ReadParameterType) : Promise<ReadReturnType>

Read a chunk of the stream

post(method: "IO.read", params?: IO.ReadParameterType): Promise<IO.ReadReturnType>
abstract member postNetworkDisable () : Promise<unit>

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

post(method: "Network.disable"): Promise<void>
abstract member postNetworkEnable () : Promise<unit>

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

post(method: "Network.enable"): Promise<void>
abstract member postNetworkGetRequestPostData (?params: GetRequestPostDataParameterType) : Promise<GetRequestPostDataReturnType>

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): Promise<Network.GetRequestPostDataReturnType>
abstract member postNetworkGetResponseBody (?params: GetResponseBodyParameterType) : Promise<GetResponseBodyReturnType>

Returns content served for the given request.

post(method: "Network.getResponseBody", params?: Network.GetResponseBodyParameterType): Promise<Network.GetResponseBodyReturnType>
abstract member postNetworkLoadNetworkResource (?params: LoadNetworkResourceParameterType) : Promise<LoadNetworkResourceReturnType>

Fetches the resource and returns the content.

post(method: "Network.loadNetworkResource", params?: Network.LoadNetworkResourceParameterType): Promise<Network.LoadNetworkResourceReturnType>
abstract member postNetworkStreamResourceContent (?params: StreamResourceContentParameterType) : Promise<StreamResourceContentReturnType>

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): Promise<Network.StreamResourceContentReturnType>

@experimental

abstract member postNodeRuntimeDisable () : Promise<unit>

Disable NodeRuntime events

post(method: "NodeRuntime.disable"): Promise<void>
abstract member postNodeRuntimeEnable () : Promise<unit>

Enable the NodeRuntime events except by NodeRuntime.waitingForDisconnect.

post(method: "NodeRuntime.enable"): Promise<void>
abstract member postNodeRuntimeNotifyWhenWaitingForDisconnect (?params: NotifyWhenWaitingForDisconnectParameterType) : Promise<unit>

Enable the NodeRuntime.waitingForDisconnect.

post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise<void>
abstract member postNodeTracingGetCategories () : Promise<GetCategoriesReturnType>

Gets supported tracing categories.

post(method: "NodeTracing.getCategories"): Promise<NodeTracing.GetCategoriesReturnType>
abstract member postNodeTracingStart (?params: StartParameterType) : Promise<unit>

Start trace events collection.

post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType): Promise<void>
abstract member postNodeTracingStop () : Promise<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"): Promise<void>
abstract member postNodeWorkerDetach (?params: DetachParameterType) : Promise<unit>

Detached from the worker with given sessionId.

post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType): Promise<void>
abstract member postNodeWorkerDisable () : Promise<unit>

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

post(method: "NodeWorker.disable"): Promise<void>
abstract member postNodeWorkerEnable (?params: EnableParameterType) : Promise<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): Promise<void>
abstract member postNodeWorkerSendMessageToWorker (?params: SendMessageToWorkerParameterType) : Promise<unit>

Sends protocol message over session with given id.

post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType): Promise<void>
abstract member postProfilerDisable () : Promise<unit>
post(method: "Profiler.disable"): Promise<void>

@experimental

abstract member postProfilerEnable () : Promise<unit>
post(method: "Profiler.enable"): Promise<void>

@experimental

abstract member postProfilerGetBestEffortCoverage () : Promise<GetBestEffortCoverageReturnType>

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

post(method: "Profiler.getBestEffortCoverage"): Promise<Profiler.GetBestEffortCoverageReturnType>
abstract member postProfilerSetSamplingInterval (?params: SetSamplingIntervalParameterType) : Promise<unit>

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

post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType): Promise<void>
abstract member postProfilerStart () : Promise<unit>
post(method: "Profiler.start"): Promise<void>

@experimental

abstract member postProfilerStartPreciseCoverage (?params: StartPreciseCoverageParameterType) : Promise<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): Promise<void>
abstract member postProfilerStop () : Promise<StopReturnType>
post(method: "Profiler.stop"): Promise<Profiler.StopReturnType>

@experimental

abstract member postProfilerStopPreciseCoverage () : Promise<unit>

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

post(method: "Profiler.stopPreciseCoverage"): Promise<void>
abstract member postProfilerTakePreciseCoverage () : Promise<TakePreciseCoverageReturnType>

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

post(method: "Profiler.takePreciseCoverage"): Promise<Profiler.TakePreciseCoverageReturnType>
abstract member postRuntimeAwaitPromise (?params: AwaitPromiseParameterType) : Promise<AwaitPromiseReturnType>

Add handler to promise with given promise object id.

post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType): Promise<Runtime.AwaitPromiseReturnType>
abstract member postRuntimeCallFunctionOn (?params: CallFunctionOnParameterType) : Promise<CallFunctionOnReturnType>

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): Promise<Runtime.CallFunctionOnReturnType>
abstract member postRuntimeCompileScript (?params: CompileScriptParameterType) : Promise<CompileScriptReturnType>

Compiles expression.

post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType): Promise<Runtime.CompileScriptReturnType>
abstract member postRuntimeDisable () : Promise<unit>

Disables reporting of execution contexts creation.

post(method: "Runtime.disable"): Promise<void>
abstract member postRuntimeDiscardConsoleEntries () : Promise<unit>

Discards collected exceptions and console API calls.

post(method: "Runtime.discardConsoleEntries"): Promise<void>
abstract member postRuntimeEnable () : Promise<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"): Promise<void>
abstract member postRuntimeEvaluate (?params: EvaluateParameterType) : Promise<EvaluateReturnType>

Evaluates expression on global object.

post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType): Promise<Runtime.EvaluateReturnType>
abstract member postRuntimeGetProperties (?params: GetPropertiesParameterType) : Promise<GetPropertiesReturnType>

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

post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType): Promise<Runtime.GetPropertiesReturnType>
abstract member postRuntimeGlobalLexicalScopeNames (?params: GlobalLexicalScopeNamesParameterType) : Promise<GlobalLexicalScopeNamesReturnType>

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

post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise<Runtime.GlobalLexicalScopeNamesReturnType>
abstract member postRuntimeQueryObjects (?params: QueryObjectsParameterType) : Promise<QueryObjectsReturnType>
post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType): Promise<Runtime.QueryObjectsReturnType>

@experimental

abstract member postRuntimeReleaseObject (?params: ReleaseObjectParameterType) : Promise<unit>

Releases remote object with given id.

post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType): Promise<void>
abstract member postRuntimeReleaseObjectGroup (?params: ReleaseObjectGroupParameterType) : Promise<unit>

Releases all remote objects that belong to a given group.

post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType): Promise<void>
abstract member postRuntimeRunIfWaitingForDebugger () : Promise<unit>

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

post(method: "Runtime.runIfWaitingForDebugger"): Promise<void>
abstract member postRuntimeRunScript (?params: RunScriptParameterType) : Promise<RunScriptReturnType>

Runs script with given id in a given context.

post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType): Promise<Runtime.RunScriptReturnType>
abstract member postRuntimeSetCustomObjectFormatterEnabled (?params: SetCustomObjectFormatterEnabledParameterType) : Promise<unit>
post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise<void>

@experimental

abstract member postSchemaGetDomains () : Promise<GetDomainsReturnType>

Returns supported domains.

post(method: "Schema.getDomains"): Promise<Schema.GetDomainsReturnType>
abstract member postTargetSetAutoAttach (?params: SetAutoAttachParameterType) : Promise<unit>
post(method: "Target.setAutoAttach", params?: Target.SetAutoAttachParameterType): Promise<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