diff --git a/types/node/dns.d.ts b/types/node/dns.d.ts index 879d69053aa61c..d2b0505648f428 100644 --- a/types/node/dns.d.ts +++ b/types/node/dns.d.ts @@ -31,9 +31,9 @@ declare module "dns" { // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>; - function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>; + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; } function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; diff --git a/types/node/http.d.ts b/types/node/http.d.ts index 31175d76b6673c..49ef45b1b3501e 100644 --- a/types/node/http.d.ts +++ b/types/node/http.d.ts @@ -146,6 +146,7 @@ declare module "http" { class ServerResponse extends OutgoingMessage { statusCode: number; statusMessage: string; + writableFinished: boolean; constructor(req: IncomingMessage); @@ -158,6 +159,16 @@ declare module "http" { writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; } + interface InformationEvent { + statusCode: number; + statusMessage: string; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 class ClientRequest extends OutgoingMessage { connection: Socket; @@ -172,6 +183,86 @@ declare module "http" { setTimeout(timeout: number, callback?: () => void): this; setNoDelay(noDelay?: boolean): void; setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + + addListener(event: 'abort', listener: () => void): this; + addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'continue', listener: () => void): this; + addListener(event: 'information', listener: (info: InformationEvent) => void): this; + addListener(event: 'response', listener: (response: IncomingMessage) => void): this; + addListener(event: 'socket', listener: (socket: Socket) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + on(event: 'abort', listener: () => void): this; + on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'continue', listener: () => void): this; + on(event: 'information', listener: (info: InformationEvent) => void): this; + on(event: 'response', listener: (response: IncomingMessage) => void): this; + on(event: 'socket', listener: (socket: Socket) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: 'abort', listener: () => void): this; + once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'continue', listener: () => void): this; + once(event: 'information', listener: (info: InformationEvent) => void): this; + once(event: 'response', listener: (response: IncomingMessage) => void): this; + once(event: 'socket', listener: (socket: Socket) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: 'abort', listener: () => void): this; + prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'continue', listener: () => void): this; + prependListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependListener(event: 'socket', listener: (socket: Socket) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: 'abort', listener: () => void): this; + prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'continue', listener: () => void): this; + prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; } class IncomingMessage extends stream.Readable { diff --git a/types/node/index.d.ts b/types/node/index.d.ts index e627195ce13775..90f672d03c13ad 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package Node.js 12.6 +// Type definitions for non-npm package Node.js 12.7 // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped diff --git a/types/node/inspector.d.ts b/types/node/inspector.d.ts index 8abee3951f8642..b14aed2b3f5206 100644 --- a/types/node/inspector.d.ts +++ b/types/node/inspector.d.ts @@ -5,6 +5,8 @@ // Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 // for more information. +// tslint:disable:max-line-length + /** * The inspector module provides an API for interacting with the V8 inspector. */ @@ -16,1928 +18,1789 @@ declare module "inspector" { params: T; } - namespace Console { + namespace Schema { /** - * Console message. + * Description of the protocol domain. */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string; + interface Domain { /** - * Line number in the resource that generated this message (1-based). + * Domain name. */ - line?: number; + name: string; /** - * Column number in the resource that generated this message (1-based). + * Domain version. */ - column?: number; + version: string; } - interface MessageAddedEventDataType { + interface GetDomainsReturnType { /** - * Console message that has been added. + * List of supported domains. */ - message: ConsoleMessage; + domains: Domain[]; } } - namespace Debugger { + namespace Runtime { /** - * Breakpoint identifier. + * Unique script identifier. */ - type BreakpointId = string; + type ScriptId = string; /** - * Call frame identifier. + * Unique object identifier. */ - type CallFrameId = string; + type RemoteObjectId = string; /** - * Location in the source code. + * Primitive value which cannot be JSON-stringified. */ - interface Location { + type UnserializableValue = string; + + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { /** - * Script identifier as reported in the `Debugger.scriptParsed`. + * Object type. */ - scriptId: Runtime.ScriptId; + type: string; /** - * Line number in the script (0-based). + * Object subtype hint. Specified for object type values only. */ - lineNumber: number; + subtype?: string; /** - * Column number in the script (0-based). + * Object class (constructor) name. Specified for object type values only. */ - columnNumber?: number; + className?: string; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue; + /** + * String representation of the object. + */ + description?: string; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview; + /** + * @experimental + */ + customPreview?: CustomPreview; } /** - * Location in the source code. * @experimental */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId; } /** - * JavaScript call frame. Array of call frames form the call stack. + * Object containing abbreviated remote object value. + * @experimental */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; + interface ObjectPreview { /** - * Location in the source code. + * Object type. */ - functionLocation?: Location; + type: string; /** - * Location in the source code. + * Object subtype hint. Specified for object type values only. */ - location: Location; + subtype?: string; /** - * JavaScript script name or url. + * String representation of the object. */ - url: string; + description?: string; /** - * Scope chain for this call frame. + * True iff some of the properties or entries of the original object did not fit. */ - scopeChain: Scope[]; + overflow: boolean; /** - * `this` object for this call frame. + * List of the properties. */ - this: Runtime.RemoteObject; + properties: PropertyPreview[]; /** - * The value being returned, if the function is at return point. + * List of the entries. Specified for map and set subtype values only. */ - returnValue?: Runtime.RemoteObject; + entries?: EntryPreview[]; } /** - * Scope description. + * @experimental */ - interface Scope { + interface PropertyPreview { /** - * Scope type. + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. */ type: string; /** - * Object representing the scope. For `global` and `with` scopes it represents the actual - * object; for the rest of the scopes, it is artificial transient object enumerating scope - * variables as its properties. + * User-friendly property value string. */ - object: Runtime.RemoteObject; - name?: string; + value?: string; /** - * Location in the source code where scope starts + * Nested value preview. */ - startLocation?: Location; + valuePreview?: ObjectPreview; /** - * Location in the source code where scope ends + * Object subtype hint. Specified for object type values only. */ - endLocation?: Location; + subtype?: string; } /** - * Search match for resource. + * @experimental */ - interface SearchMatch { + interface EntryPreview { /** - * Line number in resource content. + * Preview of the key. Specified for map-like collection entries. */ - lineNumber: number; + key?: ObjectPreview; /** - * Line with match content. + * Preview of the value. */ - lineContent: string; + value: ObjectPreview; } - interface BreakLocation { - /** - * Script identifier as reported in the `Debugger.scriptParsed`. - */ - scriptId: Runtime.ScriptId; + /** + * Object property descriptor. + */ + interface PropertyDescriptor { /** - * Line number in the script (0-based). + * Property name or symbol description. */ - lineNumber: number; + name: string; /** - * Column number in the script (0-based). + * The value associated with the property. */ - columnNumber?: number; - type?: string; - } - - interface ContinueToLocationParameterType { + value?: RemoteObject; /** - * Location to continue to. + * True if the value associated with the property may be changed (data descriptors only). */ - location: Location; - targetCallFrames?: string; - } - - interface EvaluateOnCallFrameParameterType { + writable?: boolean; /** - * Call frame identifier to evaluate on. + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). */ - callFrameId: CallFrameId; + get?: RemoteObject; /** - * Expression to evaluate. + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). */ - expression: string; + set?: RemoteObject; /** - * String object group name to put result into (allows rapid releasing resulting object handles - * using `releaseObjectGroup`). + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. */ - objectGroup?: string; + configurable: boolean; /** - * Specifies whether command line API should be available to the evaluated expression, defaults - * to false. + * True if this property shows up during enumeration of the properties on the corresponding object. */ - includeCommandLineAPI?: boolean; + enumerable: boolean; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause - * execution. Overrides `setPauseOnException` state. + * True if the result was thrown during the evaluation. */ - silent?: boolean; + wasThrown?: boolean; /** - * Whether the result is expected to be a JSON object that should be sent by value. + * True if the property is owned for the object. */ - returnByValue?: boolean; + isOwn?: boolean; /** - * Whether preview should be generated for the result. - * @experimental + * Property symbol object, if the property is of the symbol type. */ - generatePreview?: boolean; + symbol?: RemoteObject; + } + + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * Conventional property name. */ - throwOnSideEffect?: boolean; + name: string; /** - * Terminate execution after timing out (number of milliseconds). - * @experimental + * The value associated with the property. */ - timeout?: Runtime.TimeDelta; + value?: RemoteObject; } - interface GetPossibleBreakpointsParameterType { + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { /** - * Start of range to search possible breakpoint locations in. + * Primitive value or serializable javascript object. */ - start: Location; + value?: any; /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end - * of scripts is used as end of range. + * Primitive value which can not be JSON-stringified. */ - end?: Location; + unserializableValue?: UnserializableValue; /** - * Only consider locations which are in the same (non-nested) function as start. + * Remote object handle. */ - restrictToFunction?: boolean; + objectId?: RemoteObjectId; } - interface GetScriptSourceParameterType { + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { /** - * Id of the script to get source for. + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. */ - scriptId: Runtime.ScriptId; - } - - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - - interface PauseOnAsyncCallParameterType { + id: ExecutionContextId; /** - * Debugger will pause when async call with given stack trace is started. + * Execution context origin. */ - parentStackTraceId: Runtime.StackTraceId; - } - - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - - interface RestartFrameParameterType { + origin: string; /** - * Call frame identifier to evaluate on. + * Human readable name describing given context. */ - callFrameId: CallFrameId; + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {}; } - interface SearchInContentParameterType { + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { /** - * Id of the script to search in. + * Exception id. */ - scriptId: Runtime.ScriptId; + exceptionId: number; /** - * String to search for. + * Exception text, which should be used together with exception object when available. */ - query: string; + text: string; /** - * If true, search is case sensitive. + * Line number of the exception location (0-based). */ - caseSensitive?: boolean; + lineNumber: number; /** - * If true, treats string parameter as regex. + * Column number of the exception location (0-based). */ - isRegex?: boolean; - } - - interface SetAsyncCallStackDepthParameterType { + columnNumber: number; /** - * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async - * call stacks (default). + * Script ID of the exception location. */ - maxDepth: number; - } - - interface SetBlackboxPatternsParameterType { + scriptId?: ScriptId; /** - * Array of regexps that will be used to check script url for blackbox state. + * URL of the exception location, to be used when the script was not reported. */ - patterns: string[]; - } - - interface SetBlackboxedRangesParameterType { + url?: string; /** - * Id of the script. + * JavaScript stack trace if available. */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - - interface SetBreakpointParameterType { + stackTrace?: StackTrace; /** - * Location to set breakpoint in. + * Exception object if available. */ - location: Location; + exception?: RemoteObject; /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the - * breakpoint if this expression evaluates to true. + * Identifier of the context where exception happened. */ - condition?: string; + executionContextId?: ExecutionContextId; } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { /** - * URL of the resources to set breakpoint on. + * JavaScript function name. */ - url?: string; + functionName: string; /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or - * `urlRegex` must be specified. + * JavaScript script id. */ - urlRegex?: string; + scriptId: ScriptId; /** - * Script hash of the resources to set breakpoint on. + * JavaScript script name or url. */ - scriptHash?: string; + url: string; /** - * Offset in the line to set breakpoint at. + * JavaScript script line number (0-based). */ - columnNumber?: number; + lineNumber: number; /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the - * breakpoint if this expression evaluates to true. + * JavaScript script column number (0-based). */ - condition?: string; + columnNumber: number; } - interface SetBreakpointOnFunctionCallParameterType { + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { /** - * Function object id. + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. */ - objectId: Runtime.RemoteObjectId; + description?: string; /** - * Expression to use as a breakpoint condition. When specified, debugger will - * stop on the breakpoint if this expression evaluates to true. + * JavaScript function name. */ - condition?: string; - } - - interface SetBreakpointsActiveParameterType { + callFrames: CallFrame[]; /** - * New value for breakpoints active state. + * Asynchronous JavaScript stack trace that preceded this stack, if available. */ - active: boolean; - } - - interface SetPauseOnExceptionsParameterType { + parent?: StackTrace; /** - * Pause on exceptions mode. + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental */ - state: string; + parentId?: StackTraceId; } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId; } - interface SetScriptSourceParameterType { + interface EvaluateParameterType { /** - * Id of the script to edit. + * Expression to evaluate. */ - scriptId: Runtime.ScriptId; + expression: string; /** - * New content of the script. + * Symbolic group name that can be used to release multiple objects. */ - scriptSource: string; + objectGroup?: string; /** - * If true the change will not actually be applied. Dry run may be used to get result - * description without actually modifying the code. + * Determines whether Command Line API should be available during the evaluation. */ - dryRun?: boolean; - } - - interface SetSkipAllPausesParameterType { + includeCommandLineAPI?: boolean; /** - * New value for skip pauses state. + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. */ - skip: boolean; - } - - interface SetVariableValueParameterType { + silent?: boolean; /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' - * scope types are allowed. Other scopes could be manipulated manually. + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. */ - scopeNumber: number; + contextId?: ExecutionContextId; /** - * Variable name. + * Whether the result is expected to be a JSON object that should be sent by value. */ - variableName: string; + returnByValue?: boolean; /** - * New variable value. + * Whether preview should be generated for the result. + * @experimental */ - newValue: Runtime.CallArgument; + generatePreview?: boolean; /** - * Id of callframe that holds variable. + * Whether execution should be treated as initiated by user in the UI. */ - callFrameId: CallFrameId; - } - - interface StepIntoParameterType { + userGesture?: boolean; /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled - * before next pause. - * @experimental + * Whether execution should await for resulting value and return once awaited promise is resolved. */ - breakOnAsyncCall?: boolean; + awaitPromise?: boolean; } - interface EnableReturnType { + interface AwaitPromiseParameterType { /** - * Unique identifier of the debugger. - * @experimental + * Identifier of the promise. */ - debuggerId: Runtime.UniqueDebuggerId; - } - - interface EvaluateOnCallFrameReturnType { + promiseObjectId: RemoteObjectId; /** - * Object wrapper for the evaluation result. + * Whether the result is expected to be a JSON object that should be sent by value. */ - result: Runtime.RemoteObject; + returnByValue?: boolean; /** - * Exception details. + * Whether preview should be generated for the result. */ - exceptionDetails?: Runtime.ExceptionDetails; + generatePreview?: boolean; } - interface GetPossibleBreakpointsReturnType { + interface CallFunctionOnParameterType { /** - * List of the possible breakpoint locations. + * Declaration of the function to call. */ - locations: BreakLocation[]; - } - - interface GetScriptSourceReturnType { + functionDeclaration: string; /** - * Script source. + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. */ - scriptSource: string; - } - - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - - interface RestartFrameReturnType { + objectId?: RemoteObjectId; /** - * New stack trace. + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. */ - callFrames: CallFrame[]; + arguments?: CallArgument[]; /** - * Async stack trace, if any. + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. */ - asyncStackTrace?: Runtime.StackTrace; + silent?: boolean; /** - * Async stack trace, if any. + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. * @experimental */ - asyncStackTraceId?: Runtime.StackTraceId; - } - - interface SearchInContentReturnType { + generatePreview?: boolean; /** - * List of search matches. + * Whether execution should be treated as initiated by user in the UI. */ - result: SearchMatch[]; - } - - interface SetBreakpointReturnType { + userGesture?: boolean; /** - * Id of the created breakpoint for further reference. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ - breakpointId: BreakpointId; + awaitPromise?: boolean; /** - * Location this breakpoint resolved into. + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. */ - actualLocation: Location; + executionContextId?: ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string; } - interface SetBreakpointByUrlReturnType { + interface GetPropertiesParameterType { /** - * Id of the created breakpoint for further reference. + * Identifier of the object to return properties for. */ - breakpointId: BreakpointId; + objectId: RemoteObjectId; /** - * List of the locations this breakpoint resolved into upon addition. + * If true, returns properties belonging only to the element itself, not to its prototype chain. */ - locations: Location[]; + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; } - interface SetBreakpointOnFunctionCallReturnType { + interface ReleaseObjectParameterType { /** - * Id of the created breakpoint for further reference. + * Identifier of the object to release. */ - breakpointId: BreakpointId; + objectId: RemoteObjectId; } - interface SetScriptSourceReturnType { + interface ReleaseObjectGroupParameterType { /** - * New stack trace in case editing has happened while VM was stopped. + * Symbolic object group name. */ - callFrames?: CallFrame[]; + objectGroup: string; + } + + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + + interface CompileScriptParameterType { /** - * Whether current call stack was modified after applying the changes. + * Expression to compile. */ - stackChanged?: boolean; + expression: string; /** - * Async stack trace, if any. + * Source url to be set for the script. */ - asyncStackTrace?: Runtime.StackTrace; + sourceURL: string; /** - * Async stack trace, if any. - * @experimental + * Specifies whether the compiled script should be persisted. */ - asyncStackTraceId?: Runtime.StackTraceId; + persistScript: boolean; /** - * Exception details if any. + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. */ - exceptionDetails?: Runtime.ExceptionDetails; + executionContextId?: ExecutionContextId; } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; + interface RunScriptParameterType { /** - * Actual breakpoint location. + * Id of the script to run. */ - location: Location; - } - - interface PausedEventDataType { + scriptId: ScriptId; /** - * Call stack the virtual machine stopped on. + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. */ - callFrames: CallFrame[]; + executionContextId?: ExecutionContextId; /** - * Pause reason. + * Symbolic group name that can be used to release multiple objects. */ - reason: string; + objectGroup?: string; /** - * Object containing break-specific auxiliary properties. + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. */ - data?: {}; + silent?: boolean; /** - * Hit breakpoints IDs + * Determines whether Command Line API should be available during the evaluation. */ - hitBreakpoints?: string[]; + includeCommandLineAPI?: boolean; /** - * Async stack trace, if any. + * Whether the result is expected to be a JSON object which should be sent by value. */ - asyncStackTrace?: Runtime.StackTrace; + returnByValue?: boolean; /** - * Async stack trace, if any. - * @experimental + * Whether preview should be generated for the result. */ - asyncStackTraceId?: Runtime.StackTraceId; + generatePreview?: boolean; /** - * Just scheduled async call will have this stack trace as parent stack during async execution. - * This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag. - * @experimental + * Whether execution should await for resulting value and return once awaited promise is resolved. */ - asyncCallStackTraceId?: Runtime.StackTraceId; + awaitPromise?: boolean; } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; + interface QueryObjectsParameterType { /** - * URL or name of the script parsed (if any). + * Identifier of the prototype to return objects for. */ - url: string; + prototypeObjectId: RemoteObjectId; + } + + interface GlobalLexicalScopeNamesParameterType { /** - * Line offset of the script within the resource with given URL (for script tags). + * Specifies in which execution context to lookup global scope variables. */ - startLine: number; + executionContextId?: ExecutionContextId; + } + + interface EvaluateReturnType { /** - * Column offset of the script within the resource with given URL. + * Evaluation result. */ - startColumn: number; + result: RemoteObject; /** - * Last line of the script. + * Exception details. */ - endLine: number; + exceptionDetails?: ExceptionDetails; + } + + interface AwaitPromiseReturnType { /** - * Length of the last line of the script. + * Promise result. Will contain rejected value if promise was rejected. */ - endColumn: number; + result: RemoteObject; /** - * Specifies script creation context. + * Exception details if stack strace is available. */ - executionContextId: Runtime.ExecutionContextId; + exceptionDetails?: ExceptionDetails; + } + + interface CallFunctionOnReturnType { /** - * Content hash of the script. + * Call result. */ - hash: string; + result: RemoteObject; /** - * Embedder-specific auxiliary data. + * Exception details. */ - executionContextAuxData?: {}; + exceptionDetails?: ExceptionDetails; + } + + interface GetPropertiesReturnType { /** - * URL of source map associated with script (if any). + * Object properties. */ - sourceMapURL?: string; + result: PropertyDescriptor[]; /** - * True, if this script has sourceURL. + * Internal object properties (only of the element itself). */ - hasSourceURL?: boolean; + internalProperties?: InternalPropertyDescriptor[]; /** - * True, if this script is ES6 module. + * Exception details. */ - isModule?: boolean; + exceptionDetails?: ExceptionDetails; + } + + interface CompileScriptReturnType { /** - * This script length. + * Id of the script. */ - length?: number; + scriptId?: ScriptId; /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental + * Exception details. */ - stackTrace?: Runtime.StackTrace; + exceptionDetails?: ExceptionDetails; } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; + interface RunScriptReturnType { /** - * URL or name of the script parsed (if any). + * Run result. */ - url: string; + result: RemoteObject; /** - * Line offset of the script within the resource with given URL (for script tags). + * Exception details. */ - startLine: number; + exceptionDetails?: ExceptionDetails; + } + + interface QueryObjectsReturnType { /** - * Column offset of the script within the resource with given URL. + * Array with objects. */ - startColumn: number; + objects: RemoteObject; + } + + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + + interface ExecutionContextCreatedEventDataType { /** - * Last line of the script. + * A newly created execution context. */ - endLine: number; + context: ExecutionContextDescription; + } + + interface ExecutionContextDestroyedEventDataType { /** - * Length of the last line of the script. + * Id of the destroyed context */ - endColumn: number; + executionContextId: ExecutionContextId; + } + + interface ExceptionThrownEventDataType { /** - * Specifies script creation context. + * Timestamp of the exception. */ - executionContextId: Runtime.ExecutionContextId; + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + + interface ExceptionRevokedEventDataType { /** - * Content hash of the script. + * Reason describing why exception was revoked. */ - hash: string; + reason: string; /** - * Embedder-specific auxiliary data. + * The id of revoked exception, as reported in exceptionThrown. */ - executionContextAuxData?: {}; + exceptionId: number; + } + + interface ConsoleAPICalledEventDataType { /** - * True, if this script is generated as a result of the live edit operation. - * @experimental + * Type of the call. */ - isLiveEdit?: boolean; + type: string; /** - * URL of source map associated with script (if any). + * Call arguments. */ - sourceMapURL?: string; + args: RemoteObject[]; /** - * True, if this script has sourceURL. + * Identifier of the context where the call was made. */ - hasSourceURL?: boolean; + executionContextId: ExecutionContextId; /** - * True, if this script is ES6 module. + * Call timestamp. */ - isModule?: boolean; + timestamp: Timestamp; /** - * This script length. + * Stack trace captured when the call was made. */ - length?: number; + stackTrace?: StackTrace; /** - * JavaScript top stack frame of where the script parsed event was triggered if available. + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. * @experimental */ - stackTrace?: Runtime.StackTrace; + context?: string; + } + + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; } } - namespace HeapProfiler { + namespace Debugger { /** - * Heap snapshot object id. + * Breakpoint identifier. */ - type HeapSnapshotObjectId = string; + type BreakpointId = string; /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + * Call frame identifier. */ - interface SamplingHeapProfileNode { + type CallFrameId = string; + + /** + * Location in the source code. + */ + interface Location { /** - * Function location. + * Script identifier as reported in the Debugger.scriptParsed. */ - callFrame: Runtime.CallFrame; + scriptId: Runtime.ScriptId; /** - * Allocations size in bytes for the node excluding children. + * Line number in the script (0-based). */ - selfSize: number; + lineNumber: number; /** - * Child nodes. + * Column number in the script (0-based). */ - children: SamplingHeapProfileNode[]; + columnNumber?: number; } /** - * Profile. + * Location in the source code. + * @experimental */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; + interface ScriptPosition { + lineNumber: number; + columnNumber: number; } - interface AddInspectedHeapObjectParameterType { + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { /** - * Heap snapshot object id to be accessible by means of $x command line API. + * Call frame identifier. This identifier is only valid while the virtual machine is paused. */ - heapObjectId: HeapSnapshotObjectId; - } - - interface GetHeapObjectIdParameterType { + callFrameId: CallFrameId; /** - * Identifier of the object to get heap object id for. + * Name of the JavaScript function called on this call frame. */ - objectId: Runtime.RemoteObjectId; - } - - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; + functionName: string; /** - * Symbolic group name that can be used to release multiple objects. + * Location in the source code. */ - objectGroup?: string; - } - - interface StartSamplingParameterType { + functionLocation?: Location; /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The - * default value is 32768 bytes. + * Location in the source code. */ - samplingInterval?: number; - } - - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean; - } - - interface StopTrackingHeapObjectsParameterType { + location: Location; /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken - * when the tracking is stopped. + * JavaScript script name or url. */ - reportProgress?: boolean; - } - - interface TakeHeapSnapshotParameterType { + url: string; /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + * Scope chain for this call frame. */ - reportProgress?: boolean; - } - - interface GetHeapObjectIdReturnType { + scopeChain: Scope[]; /** - * Id of the heap snapshot object corresponding to the passed remote object id. + * this object for this call frame. */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - - interface GetObjectByHeapObjectIdReturnType { + this: Runtime.RemoteObject; /** - * Evaluation result. + * The value being returned, if the function is at return point. */ - result: Runtime.RemoteObject; + returnValue?: Runtime.RemoteObject; } - interface GetSamplingProfileReturnType { + /** + * Scope description. + */ + interface Scope { /** - * Return the sampling profile being collected. + * Scope type. */ - profile: SamplingHeapProfile; - } - - interface StopSamplingReturnType { + type: string; /** - * Recorded sampling heap profile. + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. */ - profile: SamplingHeapProfile; - } - - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - - interface HeapStatsUpdateEventDataType { + object: Runtime.RemoteObject; + name?: string; /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment - * index, the second integer is a total count of objects for the fragment, the third integer is - * a total size of the objects for the fragment. + * Location in the source code where scope starts */ - statsUpdate: number[]; - } - - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean; + startLocation?: Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Location; } - } - namespace Profiler { /** - * Profile node. Holds callsite information, execution statistics and child nodes. + * Search match for resource. */ - interface ProfileNode { + interface SearchMatch { /** - * Unique id of the node. + * Line number in resource content. */ - id: number; + lineNumber: number; /** - * Function location. + * Line with match content. */ - callFrame: Runtime.CallFrame; + lineContent: string; + } + + interface BreakLocation { /** - * Number of samples where this node was on top of the call stack. + * Script identifier as reported in the Debugger.scriptParsed. */ - hitCount?: number; + scriptId: Runtime.ScriptId; /** - * Child node ids. + * Line number in the script (0-based). */ - children?: number[]; + lineNumber: number; /** - * The reason of being not optimized. The function may be deoptimized or marked as don't - * optimize. + * Column number in the script (0-based). */ - deoptReason?: string; + columnNumber?: number; + type?: string; + } + + interface SetBreakpointsActiveParameterType { /** - * An array of source position ticks. + * New value for breakpoints active state. */ - positionTicks?: PositionTickInfo[]; + active: boolean; } - /** - * Profile. - */ - interface Profile { + interface SetSkipAllPausesParameterType { /** - * The list of profile nodes. First item is the root node. + * New value for skip pauses state. */ - nodes: ProfileNode[]; + skip: boolean; + } + + interface SetBreakpointByUrlParameterType { /** - * Profiling start timestamp in microseconds. + * Line number to set breakpoint at. */ - startTime: number; + lineNumber: number; /** - * Profiling end timestamp in microseconds. + * URL of the resources to set breakpoint on. */ - endTime: number; + url?: string; /** - * Ids of samples top nodes. + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. */ - samples?: number[]; + urlRegex?: string; /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the - * profile startTime. + * Script hash of the resources to set breakpoint on. */ - timeDeltas?: number[]; - } - - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { + scriptHash?: string; /** - * Source line number (1-based). + * Offset in the line to set breakpoint at. */ - line: number; + columnNumber?: number; /** - * Number of samples attributed to the source line. + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. */ - ticks: number; + condition?: string; } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; + interface SetBreakpointParameterType { /** - * JavaScript script source offset for the range end. + * Location to set breakpoint in. */ - endOffset: number; + location: Location; /** - * Collected execution count of the source range. + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. */ - count: number; + condition?: string; } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + + interface GetPossibleBreakpointsParameterType { /** - * JavaScript function name. + * Start of range to search possible breakpoint locations in. */ - functionName: string; + start: Location; /** - * Source ranges inside the function with coverage data. + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. */ - ranges: CoverageRange[]; + end?: Location; /** - * Whether coverage data for this function has block granularity. + * Only consider locations which are in the same (non-nested) function as start. */ - isBlockCoverage: boolean; + restrictToFunction?: boolean; } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { + interface ContinueToLocationParameterType { /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. + * Location to continue to. */ - functions: FunctionCoverage[]; + location: Location; + targetCallFrames?: string; } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { + interface PauseOnAsyncCallParameterType { /** - * Name of a type collected with type profiling. + * Debugger will pause when async call with given stack trace is started. */ - name: string; + parentStackTraceId: Runtime.StackTraceId; } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; + interface StepIntoParameterType { /** - * The types for this parameter or return value. + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental */ - types: TypeObject[]; + breakOnAsyncCall?: boolean; } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + + interface SearchInContentParameterType { /** - * JavaScript script id. + * Id of the script to search in. */ scriptId: Runtime.ScriptId; /** - * JavaScript script name or url. + * String to search for. */ - url: string; + query: string; /** - * Type profile entries for parameters and return values of the functions in the script. + * If true, search is case sensitive. */ - entries: TypeProfileEntry[]; - } - - interface SetSamplingIntervalParameterType { + caseSensitive?: boolean; /** - * New sampling interval in microseconds. + * If true, treats string parameter as regex. */ - interval: number; + isRegex?: boolean; } - interface StartPreciseCoverageParameterType { + interface SetScriptSourceParameterType { /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. + * Id of the script to edit. */ - callCount?: boolean; + scriptId: Runtime.ScriptId; /** - * Collect block-based coverage. + * New content of the script. */ - detailed?: boolean; - } - - interface GetBestEffortCoverageReturnType { + scriptSource: string; /** - * Coverage data for the current isolate. + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. */ - result: ScriptCoverage[]; + dryRun?: boolean; } - interface StopReturnType { + interface RestartFrameParameterType { /** - * Recorded profile. + * Call frame identifier to evaluate on. */ - profile: Profile; + callFrameId: CallFrameId; } - interface TakePreciseCoverageReturnType { + interface GetScriptSourceParameterType { /** - * Coverage data for the current isolate. + * Id of the script to get source for. */ - result: ScriptCoverage[]; + scriptId: Runtime.ScriptId; } - interface TakeTypeProfileReturnType { + interface SetPauseOnExceptionsParameterType { /** - * Type profile for all scripts since startTypeProfile() was turned on. + * Pause on exceptions mode. */ - result: ScriptTypeProfile[]; + state: string; } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; + interface EvaluateOnCallFrameParameterType { /** - * Profile title passed as an argument to console.profile(). + * Call frame identifier to evaluate on. */ - title?: string; - } - - interface ConsoleProfileStartedEventDataType { - id: string; + callFrameId: CallFrameId; /** - * Location of console.profile(). + * Expression to evaluate. */ - location: Debugger.Location; + expression: string; /** - * Profile title passed as an argument to console.profile(). + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). */ - title?: string; - } - } - - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - - /** - * Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`, - * `-Infinity`, and bigint literals. - */ - type UnserializableValue = string; - - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { + objectGroup?: string; /** - * Object type. + * Specifies whether command line API should be available to the evaluated expression, defaults to false. */ - type: string; + includeCommandLineAPI?: boolean; /** - * Object subtype hint. Specified for `object` type values only. + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. */ - subtype?: string; + silent?: boolean; /** - * Object class (constructor) name. Specified for `object` type values only. + * Whether the result is expected to be a JSON object that should be sent by value. */ - className?: string; + returnByValue?: boolean; /** - * Remote object value in case of primitive values or JSON values (if it was requested). + * Whether preview should be generated for the result. + * @experimental */ - value?: any; + generatePreview?: boolean; /** - * Primitive value which can not be JSON-stringified does not have `value`, but gets this - * property. + * Whether to throw an exception if side effect cannot be ruled out during evaluation. */ - unserializableValue?: UnserializableValue; + throwOnSideEffect?: boolean; + } + + interface SetVariableValueParameterType { /** - * String representation of the object. + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. */ - description?: string; + scopeNumber: number; /** - * Unique object identifier (for non-primitive values). + * Variable name. */ - objectId?: RemoteObjectId; + variableName: string; /** - * Preview containing abbreviated property values. Specified for `object` type values only. - * @experimental + * New variable value. */ - preview?: ObjectPreview; + newValue: Runtime.CallArgument; /** - * @experimental + * Id of callframe that holds variable. */ - customPreview?: CustomPreview; - } - - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId; + callFrameId: CallFrameId; } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for `object` type values only. - */ - subtype?: string; + interface SetReturnValueParameterType { /** - * String representation of the object. + * New return value. */ - description?: string; + newValue: Runtime.CallArgument; + } + + interface SetAsyncCallStackDepthParameterType { /** - * True iff some of the properties or entries of the original object did not fit. + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). */ - overflow: boolean; + maxDepth: number; + } + + interface SetBlackboxPatternsParameterType { /** - * List of the properties. + * Array of regexps that will be used to check script url for blackbox state. */ - properties: PropertyPreview[]; + patterns: string[]; + } + + interface SetBlackboxedRangesParameterType { /** - * List of the entries. Specified for `map` and `set` subtype values only. + * Id of the script. */ - entries?: EntryPreview[]; + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; } - /** - * @experimental - */ - interface PropertyPreview { + interface EnableReturnType { /** - * Property name. + * Unique identifier of the debugger. + * @experimental */ - name: string; + debuggerId: Runtime.UniqueDebuggerId; + } + + interface SetBreakpointByUrlReturnType { /** - * Object type. Accessor means that the property itself is an accessor property. + * Id of the created breakpoint for further reference. */ - type: string; + breakpointId: BreakpointId; /** - * User-friendly property value string. + * List of the locations this breakpoint resolved into upon addition. */ - value?: string; + locations: Location[]; + } + + interface SetBreakpointReturnType { /** - * Nested value preview. + * Id of the created breakpoint for further reference. */ - valuePreview?: ObjectPreview; + breakpointId: BreakpointId; /** - * Object subtype hint. Specified for `object` type values only. + * Location this breakpoint resolved into. */ - subtype?: string; + actualLocation: Location; } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview; + interface GetPossibleBreakpointsReturnType { /** - * Preview of the value. + * List of the possible breakpoint locations. */ - value: ObjectPreview; + locations: BreakLocation[]; } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + + interface SearchInContentReturnType { /** - * Property name or symbol description. + * List of search matches. */ - name: string; + result: SearchMatch[]; + } + + interface SetScriptSourceReturnType { /** - * The value associated with the property. + * New stack trace in case editing has happened while VM was stopped. */ - value?: RemoteObject; + callFrames?: CallFrame[]; /** - * True if the value associated with the property may be changed (data descriptors only). + * Whether current call stack was modified after applying the changes. */ - writable?: boolean; + stackChanged?: boolean; /** - * A function which serves as a getter for the property, or `undefined` if there is no getter - * (accessor descriptors only). + * Async stack trace, if any. */ - get?: RemoteObject; + asyncStackTrace?: Runtime.StackTrace; /** - * A function which serves as a setter for the property, or `undefined` if there is no setter - * (accessor descriptors only). + * Async stack trace, if any. + * @experimental */ - set?: RemoteObject; + asyncStackTraceId?: Runtime.StackTraceId; /** - * True if the type of this property descriptor may be changed and if the property may be - * deleted from the corresponding object. + * Exception details if any. */ - configurable: boolean; + exceptionDetails?: Runtime.ExceptionDetails; + } + + interface RestartFrameReturnType { /** - * True if this property shows up during enumeration of the properties on the corresponding - * object. + * New stack trace. */ - enumerable: boolean; + callFrames: CallFrame[]; /** - * True if the result was thrown during the evaluation. + * Async stack trace, if any. */ - wasThrown?: boolean; + asyncStackTrace?: Runtime.StackTrace; /** - * True if the property is owned for the object. + * Async stack trace, if any. + * @experimental */ - isOwn?: boolean; + asyncStackTraceId?: Runtime.StackTraceId; + } + + interface GetScriptSourceReturnType { /** - * Property symbol object, if the property is of the `symbol` type. + * Script source. */ - symbol?: RemoteObject; + scriptSource: string; } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { + interface EvaluateOnCallFrameReturnType { /** - * Conventional property name. + * Object wrapper for the evaluation result. */ - name: string; + result: Runtime.RemoteObject; /** - * The value associated with the property. + * Exception details. */ - value?: RemoteObject; + exceptionDetails?: Runtime.ExceptionDetails; } - /** - * Represents function call argument. Either remote object id `objectId`, primitive `value`, - * unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { + interface ScriptParsedEventDataType { /** - * Primitive value or serializable javascript object. + * Identifier of the script parsed. */ - value?: any; + scriptId: Runtime.ScriptId; /** - * Primitive value which can not be JSON-stringified. + * URL or name of the script parsed (if any). */ - unserializableValue?: UnserializableValue; + url: string; /** - * Remote object handle. + * Line offset of the script within the resource with given URL (for script tags). */ - objectId?: RemoteObjectId; - } - - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { + startLine: number; /** - * Unique id of the execution context. It can be used to specify in which execution context - * script evaluation should be performed. + * Column offset of the script within the resource with given URL. */ - id: ExecutionContextId; + startColumn: number; /** - * Execution context origin. + * Last line of the script. */ - origin: string; + endLine: number; /** - * Human readable name describing given context. + * Length of the last line of the script. */ - name: string; + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; /** * Embedder-specific auxiliary data. */ - auxData?: {}; - } - - /** - * Detailed information about exception (or error) that was thrown during script compilation or - * execution. - */ - interface ExceptionDetails { + executionContextAuxData?: {}; /** - * Exception id. + * True, if this script is generated as a result of the live edit operation. + * @experimental */ - exceptionId: number; + isLiveEdit?: boolean; /** - * Exception text, which should be used together with exception object when available. + * URL of source map associated with script (if any). */ - text: string; + sourceMapURL?: string; /** - * Line number of the exception location (0-based). + * True, if this script has sourceURL. */ - lineNumber: number; + hasSourceURL?: boolean; /** - * Column number of the exception location (0-based). + * True, if this script is ES6 module. */ - columnNumber: number; + isModule?: boolean; /** - * Script ID of the exception location. + * This script length. */ - scriptId?: ScriptId; + length?: number; /** - * URL of the exception location, to be used when the script was not reported. + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental */ - url?: string; + stackTrace?: Runtime.StackTrace; + } + + interface ScriptFailedToParseEventDataType { /** - * JavaScript stack trace if available. + * Identifier of the script parsed. */ - stackTrace?: StackTrace; + scriptId: Runtime.ScriptId; /** - * Exception object if available. + * URL or name of the script parsed (if any). */ - exception?: RemoteObject; + url: string; /** - * Identifier of the context where exception happened. + * Line offset of the script within the resource with given URL (for script tags). */ - executionContextId?: ExecutionContextId; - } - - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - - /** - * Number of milliseconds. - */ - type TimeDelta = number; - - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { + startLine: number; /** - * JavaScript function name. + * Column offset of the script within the resource with given URL. */ - functionName: string; + startColumn: number; /** - * JavaScript script id. + * Last line of the script. */ - scriptId: ScriptId; + endLine: number; /** - * JavaScript script name or url. + * Length of the last line of the script. */ - url: string; + endColumn: number; /** - * JavaScript script line number (0-based). + * Specifies script creation context. */ - lineNumber: number; + executionContextId: Runtime.ExecutionContextId; /** - * JavaScript script column number (0-based). + * Content hash of the script. */ - columnNumber: number; - } - - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; /** - * String label of this stack trace. For async traces this may be a name of the function that - * initiated the async call. + * True, if this script has sourceURL. */ - description?: string; + hasSourceURL?: boolean; /** - * JavaScript function name. + * True, if this script is ES6 module. */ - callFrames: CallFrame[]; + isModule?: boolean; /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. + * This script length. */ - parent?: StackTrace; + length?: number; /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. + * JavaScript top stack frame of where the script parsed event was triggered if available. * @experimental */ - parentId?: StackTraceId; - } - - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - - /** - * If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This - * allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId; + stackTrace?: Runtime.StackTrace; } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; + interface BreakpointResolvedEventDataType { /** - * Whether the result is expected to be a JSON object that should be sent by value. + * Breakpoint unique identifier. */ - returnByValue?: boolean; + breakpointId: BreakpointId; /** - * Whether preview should be generated for the result. + * Actual breakpoint location. */ - generatePreview?: boolean; + location: Location; } - interface CallFunctionOnParameterType { + interface PausedEventDataType { /** - * Declaration of the function to call. + * Call stack the virtual machine stopped on. */ - functionDeclaration: string; + callFrames: CallFrame[]; /** - * Identifier of the object to call function on. Either objectId or executionContextId should - * be specified. + * Pause reason. */ - objectId?: RemoteObjectId; + reason: string; /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target - * object. + * Object containing break-specific auxiliary properties. */ - arguments?: CallArgument[]; + data?: {}; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause - * execution. Overrides `setPauseOnException` state. + * Hit breakpoints IDs */ - silent?: boolean; + hitBreakpoints?: string[]; /** - * Whether the result is expected to be a JSON object which should be sent by value. + * Async stack trace, if any. */ - returnByValue?: boolean; + asyncStackTrace?: Runtime.StackTrace; /** - * Whether preview should be generated for the result. + * Async stack trace, if any. * @experimental */ - generatePreview?: boolean; + asyncStackTraceId?: Runtime.StackTraceId; /** - * Whether execution should be treated as initiated by user in the UI. + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental */ - userGesture?: boolean; + asyncCallStackTraceId?: Runtime.StackTraceId; + } + } + + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { /** - * Whether execution should `await` for resulting value and return once awaited promise is - * resolved. + * Message source. */ - awaitPromise?: boolean; + source: string; /** - * Specifies execution context which global object will be used to call function on. Either - * executionContextId or objectId should be specified. + * Message severity. */ - executionContextId?: ExecutionContextId; + level: string; /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not - * specified and objectId is, objectGroup will be inherited from object. + * Message text. */ - objectGroup?: string; - } - - interface CompileScriptParameterType { + text: string; /** - * Expression to compile. + * URL of the message origin. */ - expression: string; + url?: string; /** - * Source url to be set for the script. + * Line number in the resource that generated this message (1-based). */ - sourceURL: string; + line?: number; /** - * Specifies whether the compiled script should be persisted. + * Column number in the resource that generated this message (1-based). */ - persistScript: boolean; + column?: number; + } + + interface MessageAddedEventDataType { /** - * Specifies in which execution context to perform script run. If the parameter is omitted the - * evaluation will be performed in the context of the inspected page. + * Console message that has been added. */ - executionContextId?: ExecutionContextId; + message: ConsoleMessage; } + } - interface EvaluateParameterType { + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { /** - * Expression to evaluate. + * Unique id of the node. */ - expression: string; + id: number; /** - * Symbolic group name that can be used to release multiple objects. + * Function location. */ - objectGroup?: string; + callFrame: Runtime.CallFrame; /** - * Determines whether Command Line API should be available during the evaluation. + * Number of samples where this node was on top of the call stack. */ - includeCommandLineAPI?: boolean; + hitCount?: number; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause - * execution. Overrides `setPauseOnException` state. + * Child node ids. */ - silent?: boolean; + children?: number[]; /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the - * evaluation will be performed in the context of the inspected page. + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. */ - contextId?: ExecutionContextId; + deoptReason?: string; /** - * Whether the result is expected to be a JSON object that should be sent by value. + * An array of source position ticks. */ - returnByValue?: boolean; + positionTicks?: PositionTickInfo[]; + } + + /** + * Profile. + */ + interface Profile { /** - * Whether preview should be generated for the result. - * @experimental + * The list of profile nodes. First item is the root node. */ - generatePreview?: boolean; + nodes: ProfileNode[]; /** - * Whether execution should be treated as initiated by user in the UI. + * Profiling start timestamp in microseconds. */ - userGesture?: boolean; + startTime: number; /** - * Whether execution should `await` for resulting value and return once awaited promise is - * resolved. + * Profiling end timestamp in microseconds. */ - awaitPromise?: boolean; + endTime: number; /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - * @experimental + * Ids of samples top nodes. */ - throwOnSideEffect?: boolean; + samples?: number[]; /** - * Terminate execution after timing out (number of milliseconds). - * @experimental + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. */ - timeout?: TimeDelta; + timeDeltas?: number[]; } - interface GetPropertiesParameterType { + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { /** - * Identifier of the object to return properties for. + * Source line number (1-based). */ - objectId: RemoteObjectId; + line: number; /** - * If true, returns properties belonging only to the element itself, not to its prototype - * chain. + * Number of samples attributed to the source line. */ - ownProperties?: boolean; + ticks: number; + } + + /** + * Coverage data for a source range. + */ + interface CoverageRange { /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not - * returned either. - * @experimental + * JavaScript script source offset for the range start. */ - accessorPropertiesOnly?: boolean; + startOffset: number; /** - * Whether preview should be generated for the results. - * @experimental + * JavaScript script source offset for the range end. */ - generatePreview?: boolean; - } - - interface GlobalLexicalScopeNamesParameterType { + endOffset: number; /** - * Specifies in which execution context to lookup global scope variables. + * Collected execution count of the source range. */ - executionContextId?: ExecutionContextId; + count: number; } - interface QueryObjectsParameterType { + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { /** - * Identifier of the prototype to return objects for. + * JavaScript function name. */ - prototypeObjectId: RemoteObjectId; + functionName: string; /** - * Symbolic group name that can be used to release the results. + * Source ranges inside the function with coverage data. */ - objectGroup?: string; - } - - interface ReleaseObjectParameterType { + ranges: CoverageRange[]; /** - * Identifier of the object to release. + * Whether coverage data for this function has block granularity. */ - objectId: RemoteObjectId; + isBlockCoverage: boolean; } - interface ReleaseObjectGroupParameterType { + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { /** - * Symbolic object group name. + * JavaScript script id. */ - objectGroup: string; - } - - interface RunScriptParameterType { + scriptId: Runtime.ScriptId; /** - * Id of the script to run. + * JavaScript script name or url. */ - scriptId: ScriptId; + url: string; /** - * Specifies in which execution context to perform script run. If the parameter is omitted the - * evaluation will be performed in the context of the inspected page. + * Functions contained in the script that has coverage data. */ - executionContextId?: ExecutionContextId; + functions: FunctionCoverage[]; + } + + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { /** - * Symbolic group name that can be used to release multiple objects. + * Name of a type collected with type profiling. */ - objectGroup?: string; + name: string; + } + + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause - * execution. Overrides `setPauseOnException` state. + * Source offset of the parameter or end of function for return values. */ - silent?: boolean; + offset: number; /** - * Determines whether Command Line API should be available during the evaluation. + * The types for this parameter or return value. */ - includeCommandLineAPI?: boolean; + types: TypeObject[]; + } + + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { /** - * Whether the result is expected to be a JSON object which should be sent by value. + * JavaScript script id. */ - returnByValue?: boolean; + scriptId: Runtime.ScriptId; /** - * Whether preview should be generated for the result. + * JavaScript script name or url. */ - generatePreview?: boolean; + url: string; /** - * Whether execution should `await` for resulting value and return once awaited promise is - * resolved. + * Type profile entries for parameters and return values of the functions in the script. */ - awaitPromise?: boolean; + entries: TypeProfileEntry[]; } - interface SetAsyncCallStackDepthParameterType { + interface SetSamplingIntervalParameterType { /** - * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async - * call stacks (default). + * New sampling interval in microseconds. */ - maxDepth: number; - } - - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - - interface SetMaxCallStackSizeToCaptureParameterType { - size: number; - } - - interface AddBindingParameterType { - name: string; - executionContextId?: ExecutionContextId; - } - - interface RemoveBindingParameterType { - name: string; + interval: number; } - interface AwaitPromiseReturnType { + interface StartPreciseCoverageParameterType { /** - * Promise result. Will contain rejected value if promise was rejected. + * Collect accurate call counts beyond simple 'covered' or 'not covered'. */ - result: RemoteObject; + callCount?: boolean; /** - * Exception details if stack strace is available. + * Collect block-based coverage. */ - exceptionDetails?: ExceptionDetails; + detailed?: boolean; } - interface CallFunctionOnReturnType { + interface StopReturnType { /** - * Call result. + * Recorded profile. */ - result: RemoteObject; + profile: Profile; + } + + interface TakePreciseCoverageReturnType { /** - * Exception details. + * Coverage data for the current isolate. */ - exceptionDetails?: ExceptionDetails; + result: ScriptCoverage[]; } - interface CompileScriptReturnType { + interface GetBestEffortCoverageReturnType { /** - * Id of the script. + * Coverage data for the current isolate. */ - scriptId?: ScriptId; + result: ScriptCoverage[]; + } + + interface TakeTypeProfileReturnType { /** - * Exception details. + * Type profile for all scripts since startTypeProfile() was turned on. */ - exceptionDetails?: ExceptionDetails; + result: ScriptTypeProfile[]; } - interface EvaluateReturnType { + interface ConsoleProfileStartedEventDataType { + id: string; /** - * Evaluation result. + * Location of console.profile(). */ - result: RemoteObject; + location: Debugger.Location; /** - * Exception details. + * Profile title passed as an argument to console.profile(). */ - exceptionDetails?: ExceptionDetails; + title?: string; } - interface GetIsolateIdReturnType { - /** - * The isolate id. - */ + interface ConsoleProfileFinishedEventDataType { id: string; - } - - interface GetHeapUsageReturnType { /** - * Used heap size in bytes. + * Location of console.profileEnd(). */ - usedSize: number; + location: Debugger.Location; + profile: Profile; /** - * Allocated heap size in bytes. + * Profile title passed as an argument to console.profile(). */ - totalSize: number; + title?: string; } + } - interface GetPropertiesReturnType { + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { /** - * Object properties. + * Function location. */ - result: PropertyDescriptor[]; + callFrame: Runtime.CallFrame; /** - * Internal object properties (only of the element itself). + * Allocations size in bytes for the node excluding children. */ - internalProperties?: InternalPropertyDescriptor[]; + selfSize: number; /** - * Exception details. + * Child nodes. */ - exceptionDetails?: ExceptionDetails; + children: SamplingHeapProfileNode[]; } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; + interface StopTrackingHeapObjectsParameterType { /** - * Exception details. + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. */ - exceptionDetails?: ExceptionDetails; + reportProgress?: boolean; } - interface BindingCalledEventDataType { - name: string; - payload: string; + interface TakeHeapSnapshotParameterType { /** - * Identifier of the context where the call was made. + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. */ - executionContextId: ExecutionContextId; + reportProgress?: boolean; } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; /** - * Call timestamp. + * Symbolic group name that can be used to release multiple objects. */ - timestamp: Timestamp; + objectGroup?: string; + } + + interface AddInspectedHeapObjectParameterType { /** - * Stack trace captured when the call was made. + * Heap snapshot object id to be accessible by means of $x command line API. */ - stackTrace?: StackTrace; + heapObjectId: HeapSnapshotObjectId; + } + + interface GetHeapObjectIdParameterType { /** - * Console context descriptor for calls on non-default console context (not console.*): - * 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call - * on named context. - * @experimental + * Identifier of the object to get heap object id for. */ - context?: string; + objectId: Runtime.RemoteObjectId; } - interface ExceptionRevokedEventDataType { + interface StartSamplingParameterType { /** - * Reason describing why exception was revoked. + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. */ - reason: string; + samplingInterval?: number; + } + + interface GetObjectByHeapObjectIdReturnType { /** - * The id of revoked exception, as reported in `exceptionThrown`. + * Evaluation result. */ - exceptionId: number; + result: Runtime.RemoteObject; } - interface ExceptionThrownEventDataType { + interface GetHeapObjectIdReturnType { /** - * Timestamp of the exception. + * Id of the heap snapshot object corresponding to the passed remote object id. */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; + heapSnapshotObjectId: HeapSnapshotObjectId; } - interface ExecutionContextCreatedEventDataType { + interface StopSamplingReturnType { /** - * A newly created execution context. + * Recorded sampling heap profile. */ - context: ExecutionContextDescription; + profile: SamplingHeapProfile; } - interface ExecutionContextDestroyedEventDataType { + interface GetSamplingProfileReturnType { /** - * Id of the destroyed context + * Return the sampling profile being collected. */ - executionContextId: ExecutionContextId; + profile: SamplingHeapProfile; } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; + interface AddHeapSnapshotChunkEventDataType { + chunk: string; } - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; } - interface GetDomainsReturnType { + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + interface HeapStatsUpdateEventDataType { /** - * List of supported domains. + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. */ - domains: Domain[]; + statsUpdate: number[]; } } @@ -2000,6 +1863,10 @@ declare module "inspector" { waitForDebuggerOnStart: boolean; } + interface DetachParameterType { + sessionId: SessionID; + } + interface AttachedToWorkerEventDataType { /** * Identifier assigned to the session used to send/receive messages. @@ -2025,6 +1892,12 @@ declare module "inspector" { } } + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + /** * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. */ @@ -2057,135 +1930,124 @@ declare module "inspector" { post(method: string, callback?: (err: Error | null, params?: {}) => void): void; /** - * Does nothing. + * Returns supported domains. */ - post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; /** - * Disables console domain, prevents further console messages from being reported to the client. + * Evaluates expression on global object. */ - post(method: "Console.disable", callback?: (err: Error | null) => void): void; + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; /** - * Enables console domain, sends the messages collected so far to the client by means of the - * `messageAdded` notification. + * Add handler to promise with given promise object id. */ - post(method: "Console.enable", callback?: (err: Error | null) => void): void; + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; /** - * Continues execution until specific location is reached. + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. */ - post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; /** - * Disables debugger for given page. + * Returns properties of a given object. Object group of the result is inherited from the target object. */ - post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; /** - * Enables debugger for the given page. Clients should not assume that the debugging has been - * enabled until the result for this command is received. + * Releases remote object with given id. */ - post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; /** - * Evaluates expression on a given call frame. + * Releases all remote objects that belong to a given group. */ - post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be - * the same. + * Tells inspected instance to run if it was waiting for debugger to attach. */ - post( - method: "Debugger.getPossibleBreakpoints", - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; /** - * Returns source for the script with given id. + * 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: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; /** - * Returns stack trace with given `stackTraceId`. - * @experimental + * Disables reporting of execution contexts creation. */ - post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; /** - * Stops on the next JavaScript statement. + * Discards collected exceptions and console API calls. */ - post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; /** * @experimental */ - post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; /** - * Removes JavaScript breakpoint. + * Compiles expression. */ - post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; /** - * Restarts particular call frame from the beginning. + * Runs script with given id in a given context. */ - post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; /** - * Resumes JavaScript execution. + * Returns all let, const and class variables from global scope. */ - post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + post( + method: "Runtime.globalLexicalScopeNames", + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; /** - * 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. - * @experimental + * 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.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; /** - * Searches for given string in script content. + * Disables debugger for given page. */ - post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; /** - * Enables or disables async call stacks tracking. + * Activates / deactivates all breakpoints on the page. */ - post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; /** - * 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. - * @experimental + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). */ - post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; /** - * 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. - * @experimental + * 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.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; /** * Sets JavaScript breakpoint at a given location. @@ -2194,65 +2056,37 @@ declare module "inspector" { post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; /** - * 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. + * Removes JavaScript breakpoint. */ - post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; /** - * Sets JavaScript breakpoint before each call to the given function. - * If another function was created from the same source as a given one, - * calling it will also trigger the breakpoint. - * @experimental + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. */ post( - method: "Debugger.setBreakpointOnFunctionCall", - params?: Debugger.SetBreakpointOnFunctionCallParameterType, - callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void + method: "Debugger.getPossibleBreakpoints", + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void ): void; - post(method: "Debugger.setBreakpointOnFunctionCall", callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void): void; - - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; /** - * 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`. + * Continues execution until specific location is reached. */ - post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; /** - * Changes return value in top frame. Available only at return break position. * @experimental */ - post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; - - /** - * Edits JavaScript source live. - */ - post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be - * mutated manually. + * Steps over the statement. */ - post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; /** * Steps into the function call. @@ -2266,256 +2100,202 @@ declare module "inspector" { post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; /** - * Steps over the statement. - */ - post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; - - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details - * $x functions). - */ - post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - - post( - method: "HeapProfiler.getObjectByHeapObjectId", - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - - post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - - post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - - post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; - - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to - * garbage collection. + * Stops on the next JavaScript statement. */ - post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + * 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. + * @experimental */ - post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; /** - * 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. + * Resumes JavaScript execution. */ - post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; /** - * Enable type profile. + * Returns stack trace with given stackTraceId. * @experimental */ - post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows - * executing optimized code. - */ - post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental + * Searches for given string in script content. */ - post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code - * coverage needs to have started. + * Edits JavaScript source live. */ - post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; /** - * Collect type profile. - * @experimental + * Restarts particular call frame from the beginning. */ - post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; /** - * Add handler to promise with given promise object id. + * Returns source for the script with given id. */ - post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; /** - * Calls function with given declaration on the given object. Object group of the result is - * inherited from the target object. + * 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: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; /** - * Compiles expression. + * Evaluates expression on a given call frame. */ - post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; /** - * Disables reporting of execution contexts creation. + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. */ - post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; /** - * Discards collected exceptions and console API calls. + * Changes return value in top frame. Available only at return break position. + * @experimental */ - post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; /** - * 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. + * Enables or disables async call stacks tracking. */ - post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; /** - * Evaluates expression on global object. + * 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. + * @experimental */ - post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; /** - * Returns the isolate id. + * 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. * @experimental */ - post(method: "Runtime.getIsolateId", callback?: (err: Error | null, params: Runtime.GetIsolateIdReturnType) => void): void; + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; /** - * Returns the JavaScript heap usage. - * It is the total usage of the corresponding isolate not scoped to a particular Runtime. - * @experimental + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. */ - post(method: "Runtime.getHeapUsage", callback?: (err: Error | null, params: Runtime.GetHeapUsageReturnType) => void): void; + post(method: "Console.enable", callback?: (err: Error | null) => void): void; /** - * Returns properties of a given object. Object group of the result is inherited from the target - * object. + * Disables console domain, prevents further console messages from being reported to the client. */ - post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Console.disable", callback?: (err: Error | null) => void): void; /** - * Returns all let, const and class variables from global scope. + * Does nothing. */ - post( - method: "Runtime.globalLexicalScopeNames", - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; - post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; - /** - * Releases remote object with given id. - */ - post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; /** - * Releases all remote objects that belong to a given group. + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. */ - post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; /** - * Runs script with given id in a given context. + * 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: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; /** - * Enables or disables async call stacks tracking. + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. */ - post(method: "Runtime.setAsyncCallStackDepth", params?: Runtime.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; /** - * @experimental + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. */ - post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; /** - * @experimental + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. */ - post(method: "Runtime.setMaxCallStackSizeToCapture", params?: Runtime.SetMaxCallStackSizeToCaptureParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.setMaxCallStackSizeToCapture", callback?: (err: Error | null) => void): void; + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; /** - * Terminate current or next JavaScript execution. - * Will cancel the termination when the outer-most script execution ends. + * Enable type profile. * @experimental */ - post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void; + post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; /** - * If executionContextId is empty, adds binding with the given name on the - * global objects of all inspected contexts, including those created later, - * bindings survive reloads. - * If executionContextId is specified, adds binding only on global object of - * given execution context. - * Binding function takes exactly one argument, this argument should be string, - * in case of any other input, function throws an exception. - * Each binding function call produces Runtime.bindingCalled notification. + * Disable type profile. Disabling releases type profile data collected so far. * @experimental */ - post(method: "Runtime.addBinding", params?: Runtime.AddBindingParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.addBinding", callback?: (err: Error | null) => void): void; + post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; /** - * This method does not remove binding function from global object but - * unsubscribes current runtime agent from Runtime.bindingCalled notifications. + * Collect type profile. * @experimental */ - post(method: "Runtime.removeBinding", params?: Runtime.RemoveBindingParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.removeBinding", callback?: (err: Error | null) => void): void; + post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post( + method: "HeapProfiler.getObjectByHeapObjectId", + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; /** - * Returns supported domains. + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). */ - post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; /** * Gets supported tracing categories. @@ -2552,6 +2332,18 @@ declare module "inspector" { */ post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void; + /** + * Detached from the worker with given sessionId. + */ + post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void; + + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void; + // Events addListener(event: string, listener: (...args: any[]) => void): this; @@ -2562,100 +2354,89 @@ declare module "inspector" { addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new console message is added. + * Issued when new execution context is created. */ - addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** - * Fired when breakpoint is resolved to an actual script and location. + * Issued when execution context is destroyed. */ - addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + * Issued when all executionContexts were cleared in browser */ - addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** - * Fired when the virtual machine resumed execution. + * Issued when exception was thrown and unhandled. */ - addListener(event: "Debugger.resumed", listener: () => void): this; + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine fails to parse the script. + * Issued when unhandled exception was revoked. */ - addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected - * scripts upon enabling debugger. + * Issued when console API was called. */ - addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; /** - * 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. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. */ - addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine fails to parse the script. */ - addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Notification is issued every time when binding is called. - * @experimental + * Fired when breakpoint is resolved to an actual script and location. */ - addListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** - * Issued when console API was called. + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** - * Issued when unhandled exception was revoked. + * Fired when the virtual machine resumed execution. */ - addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when exception was thrown and unhandled. + * Issued when new console message is added. */ - addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** - * Issued when new execution context is created. + * Sent when new profile recording is started using console.profile() call. */ - addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; /** - * Issued when all executionContexts were cleared in browser + * 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: "Runtime.executionContextsCleared", listener: () => void): this; + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** - * Issued when object should be inspected (for example, as a result of inspect() command line API - * call). + * If heap objects tracking has been started then backend may send update for one or more fragments */ - addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. @@ -2684,34 +2465,42 @@ declare module "inspector" { */ addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * 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; + emit(event: string | symbol, ...args: any[]): boolean; emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; - emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; emit(event: "Debugger.paused", message: InspectorNotification): boolean; emit(event: "Debugger.resumed"): boolean; - emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; emit(event: "HeapProfiler.resetProfiles"): boolean; - emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; - emit(event: "Runtime.bindingCalled", message: InspectorNotification): boolean; - emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; - emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; - emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextsCleared"): boolean; - emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; emit(event: "NodeTracing.dataCollected", message: InspectorNotification): boolean; emit(event: "NodeTracing.tracingComplete"): boolean; emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification): boolean; emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification): boolean; emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification): boolean; + emit(event: "NodeRuntime.waitingForDisconnect"): boolean; on(event: string, listener: (...args: any[]) => void): this; @@ -2721,100 +2510,89 @@ declare module "inspector" { on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new console message is added. - */ - on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when breakpoint is resolved to an actual script and location. + * Issued when new execution context is created. */ - on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + * Issued when execution context is destroyed. */ - on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** - * Fired when the virtual machine resumed execution. + * Issued when all executionContexts were cleared in browser */ - on(event: "Debugger.resumed", listener: () => void): this; + on(event: "Runtime.executionContextsCleared", listener: () => void): this; /** - * Fired when virtual machine fails to parse the script. + * Issued when exception was thrown and unhandled. */ - on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected - * scripts upon enabling debugger. + * Issued when unhandled exception was revoked. */ - on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when console API was called. */ - on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * 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. + * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.resetProfiles", listener: () => void): this; - on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. */ - on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** - * Notification is issued every time when binding is called. - * @experimental + * Fired when virtual machine fails to parse the script. */ - on(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Issued when console API was called. + * Fired when breakpoint is resolved to an actual script and location. */ - on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** - * Issued when unhandled exception was revoked. + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** - * Issued when exception was thrown and unhandled. + * Fired when the virtual machine resumed execution. */ - on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** - * Issued when execution context is destroyed. + * Sent when new profile recording is started using console.profile() call. */ - on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; /** - * Issued when all executionContexts were cleared in browser + * 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: "Runtime.executionContextsCleared", listener: () => void): this; + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** - * Issued when object should be inspected (for example, as a result of inspect() command line API - * call). + * If heap objects tracking has been started then backend may send update for one or more fragments */ - on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. @@ -2843,6 +2621,14 @@ declare module "inspector" { */ on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * 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; + once(event: string, listener: (...args: any[]) => void): this; /** @@ -2851,100 +2637,89 @@ declare module "inspector" { once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new console message is added. + * Issued when new execution context is created. */ - once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** - * Fired when breakpoint is resolved to an actual script and location. + * Issued when execution context is destroyed. */ - once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + * Issued when all executionContexts were cleared in browser */ - once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextsCleared", listener: () => void): this; /** - * Fired when the virtual machine resumed execution. + * Issued when exception was thrown and unhandled. */ - once(event: "Debugger.resumed", listener: () => void): this; + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine fails to parse the script. + * Issued when unhandled exception was revoked. */ - once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected - * scripts upon enabling debugger. + * Issued when console API was called. */ - once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; /** - * 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. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. */ - once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.resetProfiles", listener: () => void): this; - once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine fails to parse the script. */ - once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Notification is issued every time when binding is called. - * @experimental + * Fired when breakpoint is resolved to an actual script and location. */ - once(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** - * Issued when console API was called. + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** - * Issued when unhandled exception was revoked. + * Fired when the virtual machine resumed execution. */ - once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when exception was thrown and unhandled. + * Issued when new console message is added. */ - once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** - * Issued when new execution context is created. + * Sent when new profile recording is started using console.profile() call. */ - once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; /** - * Issued when all executionContexts were cleared in browser + * 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: "Runtime.executionContextsCleared", listener: () => void): this; + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** - * Issued when object should be inspected (for example, as a result of inspect() command line API - * call). + * If heap objects tracking has been started then backend may send update for one or more fragments */ - once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. @@ -2973,6 +2748,14 @@ declare module "inspector" { */ once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * 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; + prependListener(event: string, listener: (...args: any[]) => void): this; /** @@ -2981,100 +2764,89 @@ declare module "inspector" { prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new console message is added. + * Issued when new execution context is created. */ - prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** - * Fired when breakpoint is resolved to an actual script and location. + * Issued when execution context is destroyed. */ - prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + * Issued when all executionContexts were cleared in browser */ - prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** - * Fired when the virtual machine resumed execution. + * Issued when exception was thrown and unhandled. */ - prependListener(event: "Debugger.resumed", listener: () => void): this; + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine fails to parse the script. + * Issued when unhandled exception was revoked. */ - prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected - * scripts upon enabling debugger. + * Issued when console API was called. */ - prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; /** - * 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. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. */ - prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine fails to parse the script. */ - prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Notification is issued every time when binding is called. - * @experimental + * Fired when breakpoint is resolved to an actual script and location. */ - prependListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** - * Issued when console API was called. + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** - * Issued when unhandled exception was revoked. + * Fired when the virtual machine resumed execution. */ - prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when exception was thrown and unhandled. + * Issued when new console message is added. */ - prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** - * Issued when new execution context is created. + * Sent when new profile recording is started using console.profile() call. */ - prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; /** - * Issued when all executionContexts were cleared in browser + * 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: "Runtime.executionContextsCleared", listener: () => void): this; + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** - * Issued when object should be inspected (for example, as a result of inspect() command line API - * call). + * If heap objects tracking has been started then backend may send update for one or more fragments */ - prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. @@ -3103,6 +2875,14 @@ declare module "inspector" { */ prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + /** + * 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; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; /** @@ -3111,100 +2891,89 @@ declare module "inspector" { prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new console message is added. + * Issued when new execution context is created. */ - prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** - * Fired when breakpoint is resolved to an actual script and location. + * Issued when execution context is destroyed. */ - prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + * Issued when all executionContexts were cleared in browser */ - prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** - * Fired when the virtual machine resumed execution. + * Issued when exception was thrown and unhandled. */ - prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine fails to parse the script. + * Issued when unhandled exception was revoked. */ - prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected - * scripts upon enabling debugger. + * Issued when console API was called. */ - prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; /** - * 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. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. */ - prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine fails to parse the script. */ - prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Notification is issued every time when binding is called. - * @experimental + * Fired when breakpoint is resolved to an actual script and location. */ - prependOnceListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** - * Issued when console API was called. + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** - * Issued when unhandled exception was revoked. + * Fired when the virtual machine resumed execution. */ - prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when exception was thrown and unhandled. + * Issued when new console message is added. */ - prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** - * Issued when new execution context is created. + * Sent when new profile recording is started using console.profile() call. */ - prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; /** - * Issued when all executionContexts were cleared in browser + * 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: "Runtime.executionContextsCleared", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** - * Issued when object should be inspected (for example, as a result of inspect() command line API - * call). + * If heap objects tracking has been started then backend may send update for one or more fragments */ - prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. @@ -3232,6 +3001,14 @@ declare module "inspector" { * (session ID is provided in attachedToWorker notification). */ prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * 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; } // Top Level API diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index bff98c0397ed63..7a4af4490f5573 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -4,7 +4,6 @@ import * as url from "url"; import * as util from "util"; import * as http from "http"; import * as https from "https"; -import * as vm from "vm"; import * as console2 from "console"; import * as timers from "timers"; import * as dns from "dns"; diff --git a/types/node/readline.d.ts b/types/node/readline.d.ts index c2518d8dab0c3e..77149d3f116118 100644 --- a/types/node/readline.d.ts +++ b/types/node/readline.d.ts @@ -127,10 +127,24 @@ declare module "readline" { function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; function createInterface(options: ReadLineOptions): Interface; - - function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void; function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: Interface): void; - function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; - function clearLine(stream: NodeJS.WritableStream, dir: number): void; - function clearScreenDown(stream: NodeJS.WritableStream): void; + + type Direction = -1 | 0 | 1; + + /** + * Clears the current line of this WriteStream in a direction identified by `dir`. + */ + function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * Clears this `WriteStream` from the current cursor down. + */ + function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor to the specified position. + */ + function cursorTo(stream: NodeJS.WritableStream, x: number, y: number, callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor relative to its current position. + */ + function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; } diff --git a/types/node/scripts/generate-inspector/index.ts b/types/node/scripts/generate-inspector/index.ts index 3a0e53eff0df94..7cb108bdc783f4 100644 --- a/types/node/scripts/generate-inspector/index.ts +++ b/types/node/scripts/generate-inspector/index.ts @@ -28,7 +28,7 @@ const httpsGet = (url: string) => new Promise((resolve, reject) => { // Input arguments const tag = process.argv[2] || process.version; -const V8_PROTOCOL_URL = `https://raw.githubusercontent.com/nodejs/node/${tag}/deps/v8/src/inspector/js_protocol.json`; +const V8_PROTOCOL_URL = `https://raw.githubusercontent.com/nodejs/node/${tag}/deps/v8/src/inspector/js_protocol-1.3.json`; const NODE_PROTOCOL_URL = `https://raw.githubusercontent.com/nodejs/node/${tag}/src/inspector/node_protocol.pdl`; const INSPECTOR_PROTOCOL_REMOTE = `https://chromium.googlesource.com/deps/inspector_protocol`; const INSPECTOR_PROTOCOL_LOCAL_DIR = "/tmp/inspector_protocol"; @@ -51,7 +51,7 @@ function writeProtocolsToFile(jsonProtocols: string[]) { } const substituteArgs = generateSubstituteArgs(combinedProtocol); const template = readFileSync(`${__dirname}/inspector.d.ts.template`, "utf8"); - + const inspectorDts = substitute(template, substituteArgs).split("\n") .map(line => trimRight(line)) .join("\n"); diff --git a/types/node/scripts/generate-inspector/inspector.d.ts.template b/types/node/scripts/generate-inspector/inspector.d.ts.template index 5b6a02cbb27707..b9c496bcec4dbc 100644 --- a/types/node/scripts/generate-inspector/inspector.d.ts.template +++ b/types/node/scripts/generate-inspector/inspector.d.ts.template @@ -5,6 +5,8 @@ // Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 // for more information. +// tslint:disable:max-line-length + /** * The inspector module provides an API for interacting with the V8 inspector. */ @@ -76,4 +78,11 @@ declare module "inspector" { * Return the URL of the active inspector, or `undefined` if there is none. */ function url(): string | undefined; + + /** + * Blocks until a client (existing or connected later) has sent + * `Runtime.runIfWaitingForDebugger` command. + * An exception will be thrown if there is no active inspector. + */ + waitForDebugger(); } diff --git a/types/node/test/readline.ts b/types/node/test/readline.ts index 0f8fe477cb7bf2..8dfd5a9c1d13c5 100644 --- a/types/node/test/readline.ts +++ b/types/node/test/readline.ts @@ -76,8 +76,8 @@ const rl: readline.ReadLine = readline.createInterface(new stream.Readable()); const x = 1; const y = 1; - readline.cursorTo(strm, x); readline.cursorTo(strm, x, y); + readline.cursorTo(strm, x, y, () => {}); // $ExpectType boolean } { @@ -94,17 +94,20 @@ const rl: readline.ReadLine = readline.createInterface(new stream.Readable()); const dy: number | string = 1; readline.moveCursor(strm, dx, dy); + readline.moveCursor(strm, dx, dy, () => {}); // $ExpectType boolean } { const strm: NodeJS.WritableStream = new stream.Writable(); readline.clearLine(strm, 1); + readline.clearLine(strm, 1, () => {}); // $ExpectType boolean } { const strm: NodeJS.WritableStream = new stream.Writable(); readline.clearScreenDown(strm); + readline.clearScreenDown(strm, () => {}); // $ExpectType boolean } { diff --git a/types/node/tty.d.ts b/types/node/tty.d.ts index d7fc18647ba53a..aa5bd6d35048f5 100644 --- a/types/node/tty.d.ts +++ b/types/node/tty.d.ts @@ -32,9 +32,22 @@ declare module "tty" { prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: "resize", listener: () => void): this; - clearLine(dir: Direction): void; - clearScreenDown(): void; - cursorTo(x: number, y: number): void; + /** + * Clears the current line of this WriteStream in a direction identified by `dir`. + */ + clearLine(dir: Direction, callback?: () => void): boolean; + /** + * Clears this `WriteStream` from the current cursor down. + */ + clearScreenDown(callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor to the specified position. + */ + cursorTo(x: number, y: number, callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor relative to its current position. + */ + moveCursor(dx: number, dy: number, callback?: () => void): boolean; /** * @default `process.env` */