From d9e0e0e43ae92930cde83618e760be26236f50fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Mon, 3 Nov 2025 01:00:12 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73910=20node:?= =?UTF-8?q?=20v24.10=20by=20@Renegade334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/console.d.ts | 5 +- types/node/package.json | 2 +- types/node/sqlite.d.ts | 107 +++++++++++++++++++++++++++++++++++++ types/node/test/console.ts | 2 + types/node/test/sqlite.ts | 11 ++++ types/node/url.d.ts | 40 +++++++++++--- 6 files changed, 156 insertions(+), 11 deletions(-) diff --git a/types/node/console.d.ts b/types/node/console.d.ts index c923bd0acbc43d..3c8a6825a0c656 100644 --- a/types/node/console.d.ts +++ b/types/node/console.d.ts @@ -431,9 +431,10 @@ declare module "node:console" { colorMode?: boolean | "auto" | undefined; /** * Specifies options that are passed along to - * [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options). + * `util.inspect()`. Can be an options object or, if different options + * for stdout and stderr are desired, a `Map` from stream objects to options. */ - inspectOptions?: InspectOptions | undefined; + inspectOptions?: InspectOptions | ReadonlyMap | undefined; /** * Set group indentation. * @default 2 diff --git a/types/node/package.json b/types/node/package.json index 686f9ed1dc7d35..68b134a3070e39 100644 --- a/types/node/package.json +++ b/types/node/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/node", - "version": "24.9.9999", + "version": "24.10.9999", "nonNpm": "conflict", "nonNpmDescription": "Node.js", "projects": [ diff --git a/types/node/sqlite.d.ts b/types/node/sqlite.d.ts index d10855b02cf953..6ff7943ab8b003 100644 --- a/types/node/sqlite.d.ts +++ b/types/node/sqlite.d.ts @@ -329,6 +329,64 @@ declare module "node:sqlite" { func: (...args: SQLOutputValue[]) => SQLInputValue, ): void; function(name: string, func: (...args: SQLOutputValue[]) => SQLInputValue): void; + /** + * Sets an authorizer callback that SQLite will invoke whenever it attempts to + * access data or modify the database schema through prepared statements. + * This can be used to implement security policies, audit access, or restrict certain operations. + * This method is a wrapper around [`sqlite3_set_authorizer()`](https://sqlite.org/c3ref/set_authorizer.html). + * + * When invoked, the callback receives five arguments: + * + * * `actionCode` {number} The type of operation being performed (e.g., + * `SQLITE_INSERT`, `SQLITE_UPDATE`, `SQLITE_SELECT`). + * * `arg1` {string|null} The first argument (context-dependent, often a table name). + * * `arg2` {string|null} The second argument (context-dependent, often a column name). + * * `dbName` {string|null} The name of the database. + * * `triggerOrView` {string|null} The name of the trigger or view causing the access. + * + * The callback must return one of the following constants: + * + * * `SQLITE_OK` - Allow the operation. + * * `SQLITE_DENY` - Deny the operation (causes an error). + * * `SQLITE_IGNORE` - Ignore the operation (silently skip). + * + * ```js + * import { DatabaseSync, constants } from 'node:sqlite'; + * const db = new DatabaseSync(':memory:'); + * + * // Set up an authorizer that denies all table creation + * db.setAuthorizer((actionCode) => { + * if (actionCode === constants.SQLITE_CREATE_TABLE) { + * return constants.SQLITE_DENY; + * } + * return constants.SQLITE_OK; + * }); + * + * // This will work + * db.prepare('SELECT 1').get(); + * + * // This will throw an error due to authorization denial + * try { + * db.exec('CREATE TABLE blocked (id INTEGER)'); + * } catch (err) { + * console.log('Operation blocked:', err.message); + * } + * ``` + * @since v24.10.0 + * @param callback The authorizer function to set, or `null` to + * clear the current authorizer. + */ + setAuthorizer( + callback: + | (( + actionCode: number, + arg1: string | null, + arg2: string | null, + dbName: string | null, + triggerOrView: string | null, + ) => number) + | null, + ): void; /** * Whether the database is currently open or not. * @since v22.15.0 @@ -826,5 +884,54 @@ declare module "node:sqlite" { * @since v22.12.0 */ const SQLITE_CHANGESET_ABORT: number; + /** + * Deny the operation and cause an error to be returned. + * @since v24.10.0 + */ + const SQLITE_DENY: number; + /** + * Ignore the operation and continue as if it had never been requested. + * @since 24.10.0 + */ + const SQLITE_IGNORE: number; + /** + * Allow the operation to proceed normally. + * @since v24.10.0 + */ + const SQLITE_OK: number; + const SQLITE_CREATE_INDEX: number; + const SQLITE_CREATE_TABLE: number; + const SQLITE_CREATE_TEMP_INDEX: number; + const SQLITE_CREATE_TEMP_TABLE: number; + const SQLITE_CREATE_TEMP_TRIGGER: number; + const SQLITE_CREATE_TEMP_VIEW: number; + const SQLITE_CREATE_TRIGGER: number; + const SQLITE_CREATE_VIEW: number; + const SQLITE_DELETE: number; + const SQLITE_DROP_INDEX: number; + const SQLITE_DROP_TABLE: number; + const SQLITE_DROP_TEMP_INDEX: number; + const SQLITE_DROP_TEMP_TABLE: number; + const SQLITE_DROP_TEMP_TRIGGER: number; + const SQLITE_DROP_TEMP_VIEW: number; + const SQLITE_DROP_TRIGGER: number; + const SQLITE_DROP_VIEW: number; + const SQLITE_INSERT: number; + const SQLITE_PRAGMA: number; + const SQLITE_READ: number; + const SQLITE_SELECT: number; + const SQLITE_TRANSACTION: number; + const SQLITE_UPDATE: number; + const SQLITE_ATTACH: number; + const SQLITE_DETACH: number; + const SQLITE_ALTER_TABLE: number; + const SQLITE_REINDEX: number; + const SQLITE_ANALYZE: number; + const SQLITE_CREATE_VTABLE: number; + const SQLITE_DROP_VTABLE: number; + const SQLITE_FUNCTION: number; + const SQLITE_SAVEPOINT: number; + const SQLITE_COPY: number; + const SQLITE_RECURSIVE: number; } } diff --git a/types/node/test/console.ts b/types/node/test/console.ts index f4730e6eda20a7..fade95e4b9c6fb 100644 --- a/types/node/test/console.ts +++ b/types/node/test/console.ts @@ -18,11 +18,13 @@ import { createWriteStream } from "node:fs"; colorMode: "auto", ignoreErrors: true, groupIndentation: 2, + inspectOptions: { depth: 1 }, }; consoleInstance = new console.Console(opts); consoleInstance = new console.Console({ stdout: writeStream, colorMode: false, + inspectOptions: new Map([[writeStream, { depth: 1 }]]), }); consoleInstance = new console.Console({ stdout: writeStream, diff --git a/types/node/test/sqlite.ts b/types/node/test/sqlite.ts index 7b64d962492d63..8fda4f1c2324d0 100644 --- a/types/node/test/sqlite.ts +++ b/types/node/test/sqlite.ts @@ -163,3 +163,14 @@ import { TextEncoder } from "node:util"; tagStore.db; // $ExpectType DatabaseSync tagStore.clear(); } + +{ + const db = new DatabaseSync(":memory:"); + + db.setAuthorizer((actionCode) => { + if (actionCode === constants.SQLITE_CREATE_TABLE) { + return constants.SQLITE_DENY; + } + return constants.SQLITE_OK; + }); +} diff --git a/types/node/url.d.ts b/types/node/url.d.ts index 14319f4257098d..8d0fb65801cc07 100644 --- a/types/node/url.d.ts +++ b/types/node/url.d.ts @@ -71,20 +71,44 @@ declare module "url" { * A `URIError` is thrown if the `auth` property is present but cannot be decoded. * * `url.parse()` uses a lenient, non-standard algorithm for parsing URL - * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted - * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead. + * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) + * and incorrect handling of usernames and passwords. Do not use with untrusted + * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the + * [WHATWG URL](https://nodejs.org/docs/latest-v24.x/api/url.html#the-whatwg-url-api) API instead, for example: + * + * ```js + * function getURL(req) { + * const proto = req.headers['x-forwarded-proto'] || 'https'; + * const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com'; + * return new URL(req.url || '/', `${proto}://${host}`); + * } + * ``` + * + * The example above assumes well-formed headers are forwarded from a reverse + * proxy to your Node.js server. If you are not using a reverse proxy, you should + * use the example below: + * + * ```js + * function getURL(req) { + * return new URL(req.url || '/', 'https://example.com'); + * } + * ``` * @since v0.1.25 * @deprecated Use the WHATWG URL API instead. * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. + * @param parseQueryString If `true`, the `query` property will always + * be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v24.x/api/querystring.html) module's `parse()` + * method. If `false`, the `query` property on the returned URL object will be an + * unparsed, undecoded string. **Default:** `false`. + * @param slashesDenoteHost If `true`, the first token after the literal + * string `//` and preceding the next `/` will be interpreted as the `host`. + * For instance, given `//foo/bar`, the result would be + * `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. + * **Default:** `false`. */ - function parse(urlString: string): UrlWithStringQuery; function parse( urlString: string, - parseQueryString: false | undefined, + parseQueryString?: false, slashesDenoteHost?: boolean, ): UrlWithStringQuery; function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; From c1d22eb33a7751ffa37f3b244ecb8501945f074d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Mon, 3 Nov 2025 01:00:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73937=20node:?= =?UTF-8?q?=20v22.19=20by=20@Renegade334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/v22/assert.d.ts | 195 +-- types/node/v22/assert/strict.d.ts | 107 +- types/node/v22/dns.d.ts | 5 + types/node/v22/http.d.ts | 31 +- types/node/v22/index.d.ts | 1 + types/node/v22/inspector.d.ts | 253 ++++ types/node/v22/inspector.generated.d.ts | 1613 ++++++++++------------- types/node/v22/net.d.ts | 21 + types/node/v22/package.json | 2 +- types/node/v22/process.d.ts | 12 + types/node/v22/sqlite.d.ts | 7 + types/node/v22/test/assert.ts | 118 +- types/node/v22/test/dns.ts | 2 +- types/node/v22/test/http.ts | 2 + types/node/v22/test/https.ts | 1 + types/node/v22/test/net.ts | 2 + types/node/v22/test/sqlite.ts | 1 + types/node/v22/test/test.ts | 2 +- types/node/v22/test/tls.ts | 2 + types/node/v22/test/util.ts | 2 + types/node/v22/test/worker_threads.ts | 3 + types/node/v22/tls.d.ts | 32 + types/node/v22/ts5.6/index.d.ts | 1 + types/node/v22/url.d.ts | 13 +- types/node/v22/util.d.ts | 15 +- types/node/v22/worker_threads.d.ts | 7 + types/node/v22/zlib.d.ts | 6 + 27 files changed, 1405 insertions(+), 1051 deletions(-) create mode 100644 types/node/v22/inspector.d.ts diff --git a/types/node/v22/assert.d.ts b/types/node/v22/assert.d.ts index f01d48e2138fa3..330d860cda78db 100644 --- a/types/node/v22/assert.d.ts +++ b/types/node/v22/assert.d.ts @@ -4,12 +4,14 @@ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert.js) */ declare module "assert" { + import strict = require("assert/strict"); /** - * An alias of {@link ok}. + * An alias of {@link assert.ok}. * @since v0.5.9 * @param value The input that is checked for being truthy. */ function assert(value: unknown, message?: string | Error): asserts value; + const kOptions: unique symbol; namespace assert { type AssertMethodNames = | "deepEqual" @@ -30,10 +32,100 @@ declare module "assert" { | "rejects" | "strictEqual" | "throws"; + interface AssertOptions { + /** + * If set to `'full'`, shows the full diff in assertion errors. + * @default 'simple' + */ + diff?: "simple" | "full" | undefined; + /** + * If set to `true`, non-strict methods behave like their + * corresponding strict methods. + * @default true + */ + strict?: boolean | undefined; + } + interface Assert extends Pick { + readonly [kOptions]: AssertOptions & { strict: false }; + } + interface AssertStrict extends Pick { + readonly [kOptions]: AssertOptions & { strict: true }; + } + /** + * The `Assert` class allows creating independent assertion instances with custom options. + * @since v22.19.0 + */ + var Assert: { + /** + * Creates a new assertion instance. The `diff` option controls the verbosity of diffs in assertion error messages. + * + * ```js + * const { Assert } = require('node:assert'); + * const assertInstance = new Assert({ diff: 'full' }); + * assertInstance.deepStrictEqual({ a: 1 }, { a: 2 }); + * // Shows a full diff in the error message. + * ``` + * + * **Important**: When destructuring assertion methods from an `Assert` instance, + * the methods lose their connection to the instance's configuration options (such as `diff` and `strict` settings). + * The destructured methods will fall back to default behavior instead. + * + * ```js + * const myAssert = new Assert({ diff: 'full' }); + * + * // This works as expected - uses 'full' diff + * myAssert.strictEqual({ a: 1 }, { b: { c: 1 } }); + * + * // This loses the 'full' diff setting - falls back to default 'simple' diff + * const { strictEqual } = myAssert; + * strictEqual({ a: 1 }, { b: { c: 1 } }); + * ``` + * + * When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior + * (diff: 'simple', non-strict mode). + * To maintain custom options when using destructured methods, avoid + * destructuring and call methods directly on the instance. + * @since v22.19.0 + */ + new( + options?: AssertOptions & { strict?: true }, + ): AssertStrict; + new( + options: AssertOptions, + ): Assert; + }; + interface AssertionErrorOptions { + /** + * If provided, the error message is set to this value. + */ + message?: string | undefined; + /** + * The `actual` property on the error instance. + */ + actual?: unknown; + /** + * The `expected` property on the error instance. + */ + expected?: unknown; + /** + * The `operator` property on the error instance. + */ + operator?: string | undefined; + /** + * If provided, the generated stack trace omits frames before this function. + */ + stackStartFn?: Function | undefined; + /** + * If set to `'full'`, shows the full diff in assertion errors. + * @default 'simple' + */ + diff?: "simple" | "full" | undefined; + } /** * Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class. */ class AssertionError extends Error { + constructor(options: AssertionErrorOptions); /** * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. */ @@ -42,10 +134,6 @@ declare module "assert" { * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. */ expected: unknown; - /** - * Set to the passed in operator value. - */ - operator: string; /** * Indicates if the message was auto-generated (`true`) or not. */ @@ -54,19 +142,10 @@ declare module "assert" { * Value is always `ERR_ASSERTION` to show that the error is an assertion error. */ code: "ERR_ASSERTION"; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - stackStartFn?: Function | undefined; - }); + /** + * Set to the passed in operator value. + */ + operator: string; } /** * This feature is deprecated and will be removed in a future version. @@ -987,83 +1066,9 @@ declare module "assert" { * @since v22.13.0 */ function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, - * {@link deepEqual} will behave like {@link deepStrictEqual}. - * - * In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error - * messages for objects display the objects, often truncated. - * - * To use strict assertion mode: - * - * ```js - * import { strict as assert } from 'node:assert'; - * import assert from 'node:assert/strict'; - * ``` - * - * Example error diff: - * - * ```js - * import { strict as assert } from 'node:assert'; - * - * assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); - * // AssertionError: Expected inputs to be strictly deep-equal: - * // + actual - expected ... Lines skipped - * // - * // [ - * // [ - * // ... - * // 2, - * // + 3 - * // - '3' - * // ], - * // ... - * // 5 - * // ] - * ``` - * - * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also - * deactivate the colors in the REPL. For more on color support in terminal environments, read the tty - * `getColorDepth()` documentation. - * - * @since v15.0.0, v13.9.0, v12.16.2, v9.9.0 - */ - namespace strict { - type AssertionError = assert.AssertionError; - type AssertPredicate = assert.AssertPredicate; - type CallTrackerCall = assert.CallTrackerCall; - type CallTrackerReportInformation = assert.CallTrackerReportInformation; - } - const strict: - & Omit< - typeof assert, - | "equal" - | "notEqual" - | "deepEqual" - | "notDeepEqual" - | "ok" - | "strictEqual" - | "deepStrictEqual" - | "ifError" - | "strict" - | "AssertionError" - > - & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - AssertionError: typeof AssertionError; - }; + } + namespace assert { + export { strict }; } export = assert; } diff --git a/types/node/v22/assert/strict.d.ts b/types/node/v22/assert/strict.d.ts index f333913a4565f7..83ce1fe39e67ef 100644 --- a/types/node/v22/assert/strict.d.ts +++ b/types/node/v22/assert/strict.d.ts @@ -1,8 +1,111 @@ +/** + * In strict assertion mode, non-strict methods behave like their corresponding + * strict methods. For example, `assert.deepEqual()` will behave like + * `assert.deepStrictEqual()`. + * + * In strict assertion mode, error messages for objects display a diff. In legacy + * assertion mode, error messages for objects display the objects, often truncated. + * + * To use strict assertion mode: + * + * ```js + * import { strict as assert } from 'node:assert'; + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * ``` + * + * Example error diff: + * + * ```js + * import { strict as assert } from 'node:assert'; + * + * assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); + * // AssertionError: Expected inputs to be strictly deep-equal: + * // + actual - expected ... Lines skipped + * // + * // [ + * // [ + * // ... + * // 2, + * // + 3 + * // - '3' + * // ], + * // ... + * // 5 + * // ] + * ``` + * + * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` + * environment variables. This will also deactivate the colors in the REPL. For + * more on color support in terminal environments, read the tty + * [`getColorDepth()`](https://nodejs.org/docs/latest-v22.x/api/tty.html#writestreamgetcolordepthenv) documentation. + * @since v15.0.0 + * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert/strict.js) + */ declare module "assert/strict" { - import { strict } from "node:assert"; + import { + Assert, + AssertionError, + AssertionErrorOptions, + AssertOptions, + AssertPredicate, + AssertStrict, + CallTracker, + CallTrackerCall, + CallTrackerReportInformation, + deepStrictEqual, + doesNotMatch, + doesNotReject, + doesNotThrow, + fail, + ifError, + match, + notDeepStrictEqual, + notStrictEqual, + ok, + partialDeepStrictEqual, + rejects, + strictEqual, + throws, + } from "node:assert"; + function strict(value: unknown, message?: string | Error): asserts value; + namespace strict { + export { + Assert, + AssertionError, + AssertionErrorOptions, + AssertOptions, + AssertPredicate, + AssertStrict, + CallTracker, + CallTrackerCall, + CallTrackerReportInformation, + deepStrictEqual, + deepStrictEqual as deepEqual, + doesNotMatch, + doesNotReject, + doesNotThrow, + fail, + ifError, + match, + notDeepStrictEqual, + notDeepStrictEqual as notDeepEqual, + notStrictEqual, + notStrictEqual as notEqual, + ok, + partialDeepStrictEqual, + rejects, + strict, + strictEqual, + strictEqual as equal, + throws, + }; + } export = strict; } declare module "node:assert/strict" { - import { strict } from "node:assert"; + import strict = require("assert/strict"); export = strict; } diff --git a/types/node/v22/dns.d.ts b/types/node/v22/dns.d.ts index f167a36822aad0..9cb20559fa551a 100644 --- a/types/node/v22/dns.d.ts +++ b/types/node/v22/dns.d.ts @@ -830,6 +830,11 @@ declare module "dns" { * @default 4 */ tries?: number | undefined; + /** + * The max retry timeout, in milliseconds. + * @default 0 + */ + maxTimeout?: number | undefined; } /** * An independent resolver for DNS requests. diff --git a/types/node/v22/http.d.ts b/types/node/v22/http.d.ts index ebc932010a9353..744a19f745b561 100644 --- a/types/node/v22/http.d.ts +++ b/types/node/v22/http.d.ts @@ -269,6 +269,13 @@ declare module "http" { * @since v18.0.0 */ keepAliveTimeout?: number | undefined; + /** + * An additional buffer time added to the + * `server.keepAliveTimeout` to extend the internal socket timeout. + * @since 22.19.0 + * @default 1000 + */ + keepAliveTimeoutBuffer?: number | undefined; /** * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. * @default 30000 @@ -413,12 +420,18 @@ declare module "http" { /** * The number of milliseconds of inactivity a server needs to wait for additional * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`. + * will be destroyed. + * + * This timeout value is combined with the + * `server.keepAliveTimeoutBuffer` option to determine the actual socket + * timeout, calculated as: + * socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer + * If the server receives new data before the keep-alive timeout has fired, it + * will reset the regular inactivity timeout, i.e., `server.timeout`. * * A value of `0` will disable the keep-alive timeout behavior on incoming * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior + * A value of `0` makes the HTTP server behave similarly to Node.js versions prior * to 8.0.0, which did not have a keep-alive timeout. * * The socket timeout logic is set up on connection, so changing this value only @@ -426,6 +439,18 @@ declare module "http" { * @since v8.0.0 */ keepAliveTimeout: number; + /** + * An additional buffer time added to the + * `server.keepAliveTimeout` to extend the internal socket timeout. + * + * This buffer helps reduce connection reset (`ECONNRESET`) errors by increasing + * the socket timeout slightly beyond the advertised keep-alive timeout. + * + * This option applies only to new incoming connections. + * @since v22.19.0 + * @default 1000 + */ + keepAliveTimeoutBuffer: number; /** * Sets the timeout value in milliseconds for receiving the entire request from * the client. diff --git a/types/node/v22/index.d.ts b/types/node/v22/index.d.ts index 956e7469f3d033..c9edbd78860ac2 100644 --- a/types/node/v22/index.d.ts +++ b/types/node/v22/index.d.ts @@ -62,6 +62,7 @@ /// /// /// +/// /// /// /// diff --git a/types/node/v22/inspector.d.ts b/types/node/v22/inspector.d.ts new file mode 100644 index 00000000000000..1f1a6fefdbe640 --- /dev/null +++ b/types/node/v22/inspector.d.ts @@ -0,0 +1,253 @@ +/** + * The `node:inspector` module provides an API for interacting with the V8 + * inspector. + * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector.js) + */ +declare module "inspector" { + import EventEmitter = require("node:events"); + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + */ + connect(): void; + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if this API was not called on a Worker thread. + * @since v12.11.0 + */ + connectToMainThread(): void; + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * `session.connect()` will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + } + /** + * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has + * started. + * + * If wait is `true`, will block until a client has connected to the inspect port + * and flow control has been passed to the debugger client. + * + * See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) + * regarding the `host` parameter usage. + * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Defaults to what was specified on the CLI. + * @returns Disposable that calls `inspector.close()`. + */ + function open(port?: number, host?: string, wait?: boolean): Disposable; + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + /** + * Return the URL of the active inspector, or `undefined` if there is none. + * + * ```console + * $ node --inspect -p 'inspector.url()' + * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * For help, see: https://nodejs.org/en/docs/inspector + * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * + * $ node --inspect=localhost:3000 -p 'inspector.url()' + * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * For help, see: https://nodejs.org/en/docs/inspector + * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * + * $ node -p 'inspector.url()' + * undefined + * ``` + */ + 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. + * @since v12.7.0 + */ + function waitForDebugger(): void; + // These methods are exposed by the V8 inspector console API (inspector/v8-console.h). + // The method signatures differ from those of the Node.js console, and are deliberately + // typed permissively. + interface InspectorConsole { + debug(...data: any[]): void; + error(...data: any[]): void; + info(...data: any[]): void; + log(...data: any[]): void; + warn(...data: any[]): void; + dir(...data: any[]): void; + dirxml(...data: any[]): void; + table(...data: any[]): void; + trace(...data: any[]): void; + group(...data: any[]): void; + groupCollapsed(...data: any[]): void; + groupEnd(...data: any[]): void; + clear(...data: any[]): void; + count(label?: any): void; + countReset(label?: any): void; + assert(value?: any, ...data: any[]): void; + profile(label?: any): void; + profileEnd(label?: any): void; + time(label?: any): void; + timeLog(label?: any): void; + timeStamp(label?: any): void; + } + /** + * An object to send messages to the remote inspector console. + * @since v11.0.0 + */ + const console: InspectorConsole; + // DevTools protocol event broadcast methods + namespace Network { + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that + * the application is about to send an HTTP request. + * @since v22.6.0 + */ + function requestWillBeSent(params: RequestWillBeSentEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if + * `Network.streamResourceContent` command was not invoked for the given request yet. + * + * Also enables `Network.getResponseBody` command to retrieve the response data. + * @since v22.17.0 + */ + function dataReceived(params: DataReceivedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Enables `Network.getRequestPostData` command to retrieve the request data. + * @since v22.18.0 + */ + function dataSent(params: unknown): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that + * HTTP response is available. + * @since v22.6.0 + */ + function responseReceived(params: ResponseReceivedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that + * HTTP request has finished loading. + * @since v22.6.0 + */ + function loadingFinished(params: LoadingFinishedEventDataType): void; + /** + * This feature is only available with the `--experimental-network-inspection` flag enabled. + * + * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that + * HTTP request has failed to load. + * @since v22.7.0 + */ + function loadingFailed(params: LoadingFailedEventDataType): void; + } + namespace NetworkResources { + /** + * This feature is only available with the `--experimental-inspector-network-resource` flag enabled. + * + * The inspector.NetworkResources.put method is used to provide a response for a loadNetworkResource + * request issued via the Chrome DevTools Protocol (CDP). + * This is typically triggered when a source map is specified by URL, and a DevTools frontend—such as + * Chrome—requests the resource to retrieve the source map. + * + * This method allows developers to predefine the resource content to be served in response to such CDP requests. + * + * ```js + * const inspector = require('node:inspector'); + * // By preemptively calling put to register the resource, a source map can be resolved when + * // a loadNetworkResource request is made from the frontend. + * async function setNetworkResources() { + * const mapUrl = 'http://localhost:3000/dist/app.js.map'; + * const tsUrl = 'http://localhost:3000/src/app.ts'; + * const distAppJsMap = await fetch(mapUrl).then((res) => res.text()); + * const srcAppTs = await fetch(tsUrl).then((res) => res.text()); + * inspector.NetworkResources.put(mapUrl, distAppJsMap); + * inspector.NetworkResources.put(tsUrl, srcAppTs); + * }; + * setNetworkResources().then(() => { + * require('./dist/app'); + * }); + * ``` + * + * For more details, see the official CDP documentation: [Network.loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource) + * @since v22.19.0 + * @experimental + */ + function put(url: string, data: string): void; + } +} + +/** + * The `node:inspector` module provides an API for interacting with the V8 + * inspector. + */ +declare module "node:inspector" { + export * from "inspector"; +} + +/** + * The `node:inspector/promises` module provides an API for interacting with the V8 + * inspector. + * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector/promises.js) + * @since v19.0.0 + */ +declare module "inspector/promises" { + import EventEmitter = require("node:events"); + export { close, console, NetworkResources, open, url, waitForDebugger } from "inspector"; + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + * @since v19.0.0 + */ + export class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + */ + connect(): void; + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if this API was not called on a Worker thread. + * @since v12.11.0 + */ + connectToMainThread(): void; + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * `session.connect()` will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + } +} + +/** + * The `node:inspector/promises` module provides an API for interacting with the V8 + * inspector. + * @since v19.0.0 + */ +declare module "node:inspector/promises" { + export * from "inspector/promises"; +} diff --git a/types/node/v22/inspector.generated.d.ts b/types/node/v22/inspector.generated.d.ts index 7fcd3c03972c8a..bcf0b3bb0ec95a 100644 --- a/types/node/v22/inspector.generated.d.ts +++ b/types/node/v22/inspector.generated.d.ts @@ -3,14 +3,7 @@ // See scripts/generate-inspector/README.md for information on how to update the protocol definitions. // Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template). -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - +declare module "inspector" { interface InspectorNotification { method: string; params: T; @@ -1777,6 +1770,10 @@ declare module 'inspector' { */ interface Headers { } + interface LoadNetworkResourcePageResult { + success: boolean; + stream?: IO.StreamHandle | undefined; + } interface GetRequestPostDataParameterType { /** * Identifier of the network request to get content for. @@ -1795,6 +1792,12 @@ declare module 'inspector' { */ requestId: RequestId; } + interface LoadNetworkResourceParameterType { + /** + * URL of the resource to get content for. + */ + url: string; + } interface GetRequestPostDataReturnType { /** * Request body string, omitting files from multipart requests @@ -1817,6 +1820,9 @@ declare module 'inspector' { */ bufferedData: string; } + interface LoadNetworkResourceReturnType { + resource: LoadNetworkResourcePageResult; + } interface RequestWillBeSentEventDataType { /** * Request identifier. @@ -1938,37 +1944,42 @@ declare module 'inspector' { waitingForDebugger: boolean; } } + namespace IO { + type StreamHandle = string; + interface ReadParameterType { + /** + * Handle of the stream to read. + */ + handle: StreamHandle; + /** + * Seek to the specified offset before reading (if not specified, proceed with offset + * following the last read). Some types of streams may only support sequential reads. + */ + offset?: number | undefined; + /** + * Maximum number of bytes to read (left upon the agent discretion if not specified). + */ + size?: number | undefined; + } + interface CloseParameterType { + /** + * Handle of the stream to close. + */ + handle: StreamHandle; + } + interface ReadReturnType { + /** + * Data that were read. + */ + data: string; + /** + * Set if the end-of-file condition occurred while reading. + */ + eof: boolean; + } + } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - * @since v12.11.0 - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - + interface Session { /** * Posts a message to the inspector back-end. `callback` will be notified when * a response is received. `callback` is a function that accepts two optional @@ -1993,1175 +2004,1049 @@ declare module 'inspector' { /** * Returns supported domains. */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; /** * Evaluates expression on global object. */ - 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: "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; /** * Add handler to promise with given promise object id. */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => 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; /** * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => 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; /** * Returns properties of a given object. Object group of the result is inherited from the target object. */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => 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; /** * 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: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; /** * Releases all remote objects that belong to a given group. */ - 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: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", 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: "Runtime.runIfWaitingForDebugger", 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. */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; /** * Disables reporting of execution contexts creation. */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; /** * Discards collected exceptions and console API calls. */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; /** * @experimental */ - 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: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; /** * Compiles expression. */ - 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: "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; /** * Runs script with given id in a given context. */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - 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; + 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; /** * Returns all let, const and class variables from global scope. */ post( - method: 'Runtime.globalLexicalScopeNames', + 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: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => 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. */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; /** * Disables debugger for given page. */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; + post(method: "Debugger.disable", callback?: (err: Error | null) => 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.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => 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.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => 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. */ - 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.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. */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; /** * Removes JavaScript breakpoint. */ - 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: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; /** * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. */ post( - method: 'Debugger.getPossibleBreakpoints', + 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: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; /** * Continues execution until specific location is reached. */ - 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: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", 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: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; /** * Steps over the statement. */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; /** * Steps into the function call. */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; /** * Steps out of the function call. */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; /** * Stops on the next JavaScript statement. */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; + post(method: "Debugger.pause", callback?: (err: Error | null) => 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 */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; /** * Resumes JavaScript execution. */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; /** * Returns stack trace with given stackTraceId. * @experimental */ - 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: "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; /** * Searches for given string in script content. */ - 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.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; /** * 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; + 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; /** * Restarts particular call frame from the beginning. */ - 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: "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; /** * Returns source for the script with given id. */ - 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: "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; /** * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => 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; /** * Evaluates expression on a given call frame. */ - 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: "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; /** * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', 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; /** * 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; + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; /** * Enables or disables async call stacks tracking. */ - 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.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", 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 */ - 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.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", 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 */ - 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.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; /** * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; + post(method: "Console.enable", callback?: (err: Error | null) => void): void; /** * Disables console domain, prevents further console messages from being reported to the client. */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; + post(method: "Console.disable", callback?: (err: Error | null) => void): void; /** * Does nothing. */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; /** * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', 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; + 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: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => 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. */ - 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: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => 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: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; /** * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; /** * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - 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: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => 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', + 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.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => 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.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; + 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. */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; /** * Start trace events collection. */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; + post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void; /** * Stop trace events collection. Remaining collected events will be sent as a sequence of * dataCollected events followed by tracingComplete event. */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; + post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void; /** * Sends protocol message over session with given id. */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void; /** * Instructs the inspector to attach to running workers. Will also attach to new workers * as they start */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void; /** * Detaches from all running workers and disables attaching to new workers as they are started. */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; + 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; + post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void; /** * Disables network tracking, prevents network events from being sent to the client. */ - post(method: 'Network.disable', callback?: (err: Error | null) => void): void; + post(method: "Network.disable", callback?: (err: Error | null) => void): void; /** * Enables network tracking, network events will now be delivered to the client. */ - post(method: 'Network.enable', callback?: (err: Error | null) => void): void; + post(method: "Network.enable", callback?: (err: Error | null) => void): void; /** * Returns post data sent with the request. Returns an error when no data was sent with the request. */ - post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void; - post(method: 'Network.getRequestPostData', callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void; + post(method: "Network.getRequestPostData", params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void; + post(method: "Network.getRequestPostData", callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void; /** * Returns content served for the given request. */ - post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void; - post(method: 'Network.getResponseBody', callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void; + post(method: "Network.getResponseBody", params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void; + post(method: "Network.getResponseBody", callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void; /** * Enables streaming of the response for the given requestId. * If enabled, the dataReceived event contains the data that was received during streaming. * @experimental */ post( - method: 'Network.streamResourceContent', + method: "Network.streamResourceContent", params?: Network.StreamResourceContentParameterType, callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void ): void; - post(method: 'Network.streamResourceContent', callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void; + post(method: "Network.streamResourceContent", callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void; + /** + * Fetches the resource and returns the content. + */ + post(method: "Network.loadNetworkResource", params?: Network.LoadNetworkResourceParameterType, callback?: (err: Error | null, params: Network.LoadNetworkResourceReturnType) => void): void; + post(method: "Network.loadNetworkResource", callback?: (err: Error | null, params: Network.LoadNetworkResourceReturnType) => void): void; /** * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. */ - post(method: 'NodeRuntime.enable', callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.enable", callback?: (err: Error | null) => void): void; /** * Disable NodeRuntime events */ - post(method: 'NodeRuntime.disable', callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.disable", 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; - post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Target.setAutoAttach', callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void; + post(method: "Target.setAutoAttach", params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void; + post(method: "Target.setAutoAttach", callback?: (err: Error | null) => void): void; + /** + * Read a chunk of the stream + */ + post(method: "IO.read", params?: IO.ReadParameterType, callback?: (err: Error | null, params: IO.ReadReturnType) => void): void; + post(method: "IO.read", callback?: (err: Error | null, params: IO.ReadReturnType) => void): void; + post(method: "IO.close", params?: IO.CloseParameterType, callback?: (err: Error | null) => void): void; + post(method: "IO.close", callback?: (err: Error | null) => void): void; addListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + addListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.inspectRequested", 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. */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - addListener(event: 'Debugger.resumed', listener: () => void): this; + addListener(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - addListener(event: 'Profiler.consoleProfileStarted', 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; + addListener(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.dataReceived", 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; + addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + addListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + addListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', 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: '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.resetProfiles'): 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: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'Network.dataReceived', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - emit(event: 'Target.targetCreated', message: InspectorNotification): boolean; - emit(event: 'Target.attachedToTarget', message: InspectorNotification): boolean; + emit(event: "inspectorNotification", 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: "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.resetProfiles"): 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: "Network.requestWillBeSent", message: InspectorNotification): boolean; + emit(event: "Network.responseReceived", message: InspectorNotification): boolean; + emit(event: "Network.loadingFailed", message: InspectorNotification): boolean; + emit(event: "Network.loadingFinished", message: InspectorNotification): boolean; + emit(event: "Network.dataReceived", message: InspectorNotification): boolean; + emit(event: "NodeRuntime.waitingForDisconnect"): boolean; + emit(event: "NodeRuntime.waitingForDebugger"): boolean; + emit(event: "Target.targetCreated", message: InspectorNotification): boolean; + emit(event: "Target.attachedToTarget", message: InspectorNotification): boolean; on(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + on(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; + on(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.inspectRequested", 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. */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - on(event: 'Debugger.resumed', listener: () => void): this; + on(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - 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; + 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; + on(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + on(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + on(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - on(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + on(event: "Network.dataReceived", 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; + on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - on(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + on(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + on(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + on(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; once(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + once(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; + once(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.inspectRequested", 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. */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - once(event: 'Debugger.resumed', listener: () => void): this; + once(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - once(event: 'Profiler.consoleProfileStarted', 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; + once(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; + once(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + once(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + once(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - once(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + once(event: "Network.dataReceived", 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; + once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + once(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + once(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + once(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.inspectRequested", 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. */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; + prependListener(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - prependListener(event: 'Profiler.consoleProfileStarted', 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; + prependListener(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.dataReceived", 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; + prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + prependListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.inspectRequested", 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. */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', 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; + prependOnceListener(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.dataReceived", 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; + prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; - } - - /** - * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) - * regarding the `host` parameter usage. - * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param wait Block until a client has connected. Defaults to what was specified on the CLI. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - 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. - * @since v12.7.0 - */ - function waitForDebugger(): void; - - // These methods are exposed by the V8 inspector console API (inspector/v8-console.h). - // The method signatures differ from those of the Node.js console, and are deliberately - // typed permissively. - interface InspectorConsole { - debug(...data: any[]): void; - error(...data: any[]): void; - info(...data: any[]): void; - log(...data: any[]): void; - warn(...data: any[]): void; - dir(...data: any[]): void; - dirxml(...data: any[]): void; - table(...data: any[]): void; - trace(...data: any[]): void; - group(...data: any[]): void; - groupCollapsed(...data: any[]): void; - groupEnd(...data: any[]): void; - clear(...data: any[]): void; - count(label?: any): void; - countReset(label?: any): void; - assert(value?: any, ...data: any[]): void; - profile(label?: any): void; - profileEnd(label?: any): void; - time(label?: any): void; - timeLog(label?: any): void; - timeStamp(label?: any): void; - } - - /** - * An object to send messages to the remote inspector console. - * @since v11.0.0 - */ - const console: InspectorConsole; - - // DevTools protocol event broadcast methods - namespace Network { - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that - * the application is about to send an HTTP request. - * @since v22.6.0 - */ - function requestWillBeSent(params: RequestWillBeSentEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if - * `Network.streamResourceContent` command was not invoked for the given request yet. - * - * Also enables `Network.getResponseBody` command to retrieve the response data. - * @since v22.17.0 - */ - function dataReceived(params: DataReceivedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Enables `Network.getRequestPostData` command to retrieve the request data. - * @since v22.18.0 - */ - function dataSent(params: unknown): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that - * HTTP response is available. - * @since v22.6.0 - */ - function responseReceived(params: ResponseReceivedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that - * HTTP request has finished loading. - * @since v22.6.0 - */ - function loadingFinished(params: LoadingFinishedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that - * HTTP request has failed to load. - * @since v22.7.0 - */ - function loadingFailed(params: LoadingFailedEventDataType): void; + prependOnceListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + prependOnceListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; } } -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - */ -declare module 'node:inspector' { - export * from 'inspector'; +declare module "inspector/promises" { + export { + Schema, + Runtime, + Debugger, + Console, + Profiler, + HeapProfiler, + NodeTracing, + NodeWorker, + Network, + NodeRuntime, + Target, + IO, + } from 'inspector'; } -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector/promises.js) - * @since v19.0.0 - */ -declare module 'inspector/promises' { - import EventEmitter = require('node:events'); +declare module "inspector/promises" { import { - open, - close, - url, - waitForDebugger, - console, InspectorNotification, Schema, Runtime, @@ -3174,38 +3059,15 @@ declare module 'inspector/promises' { Network, NodeRuntime, Target, - } from 'inspector'; + IO, + } from "inspector"; /** * The `inspector.Session` is used for dispatching messages to the V8 inspector * back-end and receiving message responses and notifications. * @since v19.0.0 */ - class Session extends EventEmitter { - /** - * Create a new instance of the `inspector.Session` class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - + interface Session { /** * Posts a message to the inspector back-end. * @@ -3234,978 +3096,957 @@ declare module 'inspector/promises' { /** * Returns supported domains. */ - post(method: 'Schema.getDomains'): Promise; + post(method: "Schema.getDomains"): Promise; /** * Evaluates expression on global object. */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType): Promise; + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType): Promise; /** * Add handler to promise with given promise object id. */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType): Promise; + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType): Promise; /** * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType): Promise; + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType): Promise; /** * Returns properties of a given object. Object group of the result is inherited from the target object. */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType): Promise; + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType): Promise; /** * Releases remote object with given id. */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType): Promise; + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType): Promise; /** * Releases all remote objects that belong to a given group. */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType): Promise; + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType): Promise; /** * Tells inspected instance to run if it was waiting for debugger to attach. */ - post(method: 'Runtime.runIfWaitingForDebugger'): Promise; + post(method: "Runtime.runIfWaitingForDebugger"): Promise; /** * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. */ - post(method: 'Runtime.enable'): Promise; + post(method: "Runtime.enable"): Promise; /** * Disables reporting of execution contexts creation. */ - post(method: 'Runtime.disable'): Promise; + post(method: "Runtime.disable"): Promise; /** * Discards collected exceptions and console API calls. */ - post(method: 'Runtime.discardConsoleEntries'): Promise; + post(method: "Runtime.discardConsoleEntries"): Promise; /** * @experimental */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise; + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise; /** * Compiles expression. */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType): Promise; + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType): Promise; /** * Runs script with given id in a given context. */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType): Promise; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType): Promise; + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType): Promise; + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType): Promise; /** * Returns all let, const and class variables from global scope. */ - post(method: 'Runtime.globalLexicalScopeNames', params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise; + post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise; /** * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. */ - post(method: 'Debugger.enable'): Promise; + post(method: "Debugger.enable"): Promise; /** * Disables debugger for given page. */ - post(method: 'Debugger.disable'): Promise; + post(method: "Debugger.disable"): Promise; /** * Activates / deactivates all breakpoints on the page. */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType): Promise; + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType): Promise; /** * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType): Promise; + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType): Promise; /** * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType): Promise; + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType): Promise; /** * Sets JavaScript breakpoint at a given location. */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType): Promise; + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType): Promise; /** * Removes JavaScript breakpoint. */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType): Promise; + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType): Promise; /** * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. */ - post(method: 'Debugger.getPossibleBreakpoints', params?: Debugger.GetPossibleBreakpointsParameterType): Promise; + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType): Promise; /** * Continues execution until specific location is reached. */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType): Promise; + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType): Promise; /** * @experimental */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType): Promise; + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType): Promise; /** * Steps over the statement. */ - post(method: 'Debugger.stepOver'): Promise; + post(method: "Debugger.stepOver"): Promise; /** * Steps into the function call. */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType): Promise; + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType): Promise; /** * Steps out of the function call. */ - post(method: 'Debugger.stepOut'): Promise; + post(method: "Debugger.stepOut"): Promise; /** * Stops on the next JavaScript statement. */ - post(method: 'Debugger.pause'): Promise; + post(method: "Debugger.pause"): Promise; /** * 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: 'Debugger.scheduleStepIntoAsync'): Promise; + post(method: "Debugger.scheduleStepIntoAsync"): Promise; /** * Resumes JavaScript execution. */ - post(method: 'Debugger.resume'): Promise; + post(method: "Debugger.resume"): Promise; /** * Returns stack trace with given stackTraceId. * @experimental */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType): Promise; + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType): Promise; /** * Searches for given string in script content. */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType): Promise; + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType): Promise; /** * Edits JavaScript source live. */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType): Promise; + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType): Promise; /** * Restarts particular call frame from the beginning. */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType): Promise; + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType): Promise; /** * Returns source for the script with given id. */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType): Promise; + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType): Promise; /** * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType): Promise; + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType): Promise; /** * Evaluates expression on a given call frame. */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType): Promise; + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType): Promise; /** * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType): Promise; + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType): Promise; /** * Changes return value in top frame. Available only at return break position. * @experimental */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType): Promise; + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType): Promise; /** * Enables or disables async call stacks tracking. */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType): Promise; + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType): Promise; /** * 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: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType): Promise; + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType): Promise; /** * 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: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType): Promise; + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType): Promise; /** * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. */ - post(method: 'Console.enable'): Promise; + post(method: "Console.enable"): Promise; /** * Disables console domain, prevents further console messages from being reported to the client. */ - post(method: 'Console.disable'): Promise; + post(method: "Console.disable"): Promise; /** * Does nothing. */ - post(method: 'Console.clearMessages'): Promise; - post(method: 'Profiler.enable'): Promise; - post(method: 'Profiler.disable'): Promise; + post(method: "Console.clearMessages"): Promise; + post(method: "Profiler.enable"): Promise; + post(method: "Profiler.disable"): Promise; /** * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType): Promise; - post(method: 'Profiler.start'): Promise; - post(method: 'Profiler.stop'): Promise; + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType): Promise; + post(method: "Profiler.start"): Promise; + post(method: "Profiler.stop"): Promise; /** * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType): Promise; + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType): Promise; /** * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. */ - post(method: 'Profiler.stopPreciseCoverage'): Promise; + post(method: "Profiler.stopPreciseCoverage"): Promise; /** * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. */ - post(method: 'Profiler.takePreciseCoverage'): Promise; + post(method: "Profiler.takePreciseCoverage"): Promise; /** * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. */ - post(method: 'Profiler.getBestEffortCoverage'): Promise; - post(method: 'HeapProfiler.enable'): Promise; - post(method: 'HeapProfiler.disable'): Promise; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise; - post(method: 'HeapProfiler.collectGarbage'): Promise; - post(method: 'HeapProfiler.getObjectByHeapObjectId', params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise; + post(method: "Profiler.getBestEffortCoverage"): Promise; + post(method: "HeapProfiler.enable"): Promise; + post(method: "HeapProfiler.disable"): Promise; + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise; + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise; + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise; + post(method: "HeapProfiler.collectGarbage"): Promise; + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise; /** * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType): Promise; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType): Promise; - post(method: 'HeapProfiler.stopSampling'): Promise; - post(method: 'HeapProfiler.getSamplingProfile'): Promise; + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise; + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType): Promise; + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType): Promise; + post(method: "HeapProfiler.stopSampling"): Promise; + post(method: "HeapProfiler.getSamplingProfile"): Promise; /** * Gets supported tracing categories. */ - post(method: 'NodeTracing.getCategories'): Promise; + post(method: "NodeTracing.getCategories"): Promise; /** * Start trace events collection. */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType): Promise; + post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType): Promise; /** * Stop trace events collection. Remaining collected events will be sent as a sequence of * dataCollected events followed by tracingComplete event. */ - post(method: 'NodeTracing.stop'): Promise; + post(method: "NodeTracing.stop"): Promise; /** * Sends protocol message over session with given id. */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType): Promise; + post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType): Promise; /** * Instructs the inspector to attach to running workers. Will also attach to new workers * as they start */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType): Promise; + post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType): Promise; /** * Detaches from all running workers and disables attaching to new workers as they are started. */ - post(method: 'NodeWorker.disable'): Promise; + post(method: "NodeWorker.disable"): Promise; /** * Detached from the worker with given sessionId. */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType): Promise; + post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType): Promise; /** * Disables network tracking, prevents network events from being sent to the client. */ - post(method: 'Network.disable'): Promise; + post(method: "Network.disable"): Promise; /** * Enables network tracking, network events will now be delivered to the client. */ - post(method: 'Network.enable'): Promise; + post(method: "Network.enable"): Promise; /** * Returns post data sent with the request. Returns an error when no data was sent with the request. */ - post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType): Promise; + post(method: "Network.getRequestPostData", params?: Network.GetRequestPostDataParameterType): Promise; /** * Returns content served for the given request. */ - post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType): Promise; + post(method: "Network.getResponseBody", params?: Network.GetResponseBodyParameterType): Promise; /** * Enables streaming of the response for the given requestId. * If enabled, the dataReceived event contains the data that was received during streaming. * @experimental */ - post(method: 'Network.streamResourceContent', params?: Network.StreamResourceContentParameterType): Promise; + post(method: "Network.streamResourceContent", params?: Network.StreamResourceContentParameterType): Promise; + /** + * Fetches the resource and returns the content. + */ + post(method: "Network.loadNetworkResource", params?: Network.LoadNetworkResourceParameterType): Promise; /** * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. */ - post(method: 'NodeRuntime.enable'): Promise; + post(method: "NodeRuntime.enable"): Promise; /** * Disable NodeRuntime events */ - post(method: 'NodeRuntime.disable'): Promise; + post(method: "NodeRuntime.disable"): Promise; /** * Enable the `NodeRuntime.waitingForDisconnect`. */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise; - post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType): Promise; + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise; + post(method: "Target.setAutoAttach", params?: Target.SetAutoAttachParameterType): Promise; + /** + * Read a chunk of the stream + */ + post(method: "IO.read", params?: IO.ReadParameterType): Promise; + post(method: "IO.close", params?: IO.CloseParameterType): Promise; addListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + addListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + addListener(event: "Runtime.inspectRequested", 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. */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - addListener(event: 'Debugger.resumed', listener: () => void): this; + addListener(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - addListener(event: 'Profiler.consoleProfileStarted', 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; + addListener(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + addListener(event: "Network.dataReceived", 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; + addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + addListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + addListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + addListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', 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: '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.resetProfiles'): 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: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'Network.dataReceived', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - emit(event: 'Target.targetCreated', message: InspectorNotification): boolean; - emit(event: 'Target.attachedToTarget', message: InspectorNotification): boolean; + emit(event: "inspectorNotification", 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: "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.resetProfiles"): 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: "Network.requestWillBeSent", message: InspectorNotification): boolean; + emit(event: "Network.responseReceived", message: InspectorNotification): boolean; + emit(event: "Network.loadingFailed", message: InspectorNotification): boolean; + emit(event: "Network.loadingFinished", message: InspectorNotification): boolean; + emit(event: "Network.dataReceived", message: InspectorNotification): boolean; + emit(event: "NodeRuntime.waitingForDisconnect"): boolean; + emit(event: "NodeRuntime.waitingForDebugger"): boolean; + emit(event: "Target.targetCreated", message: InspectorNotification): boolean; + emit(event: "Target.attachedToTarget", message: InspectorNotification): boolean; on(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + on(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; + on(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.inspectRequested", 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. */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - on(event: 'Debugger.resumed', listener: () => void): this; + on(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - 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; + 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; + on(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + on(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + on(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + on(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - on(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + on(event: "Network.dataReceived", 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; + on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - on(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + on(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + on(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + on(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; once(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + once(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; + once(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.inspectRequested", 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. */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - once(event: 'Debugger.resumed', listener: () => void): this; + once(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - once(event: 'Profiler.consoleProfileStarted', 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; + once(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; + once(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + once(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + once(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + once(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - once(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + once(event: "Network.dataReceived", 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; + once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + once(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + once(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + once(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.inspectRequested", 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. */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; + prependListener(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - prependListener(event: 'Profiler.consoleProfileStarted', 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; + prependListener(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + prependListener(event: "Network.dataReceived", 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; + prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + prependListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + prependListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; /** * Emitted when any notification from the V8 Inspector is received. */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification) => void): this; /** * Issued when new execution context is created. */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; /** * Issued when execution context is destroyed. */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; /** * Issued when all executionContexts were cleared in browser */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; /** * Issued when exception was thrown and unhandled. */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; /** * Issued when unhandled exception was revoked. */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** * Issued when console API was called. */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** * Issued when object should be inspected (for example, as a result of inspect() command line API call). */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.inspectRequested", 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. */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; /** * Fired when virtual machine fails to parse the script. */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; /** * Fired when the virtual machine resumed execution. */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; /** * Issued when new console message is added. */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', 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; + prependOnceListener(event: "Profiler.consoleProfileStarted", 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; /** * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; /** * Contains an bucket of collected trace events. */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; /** * Signals that tracing is stopped and there is no trace buffers pending flush, all data were * delivered via dataCollected events. */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; /** * Issued when attached to a worker. */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; /** * Issued when detached from the worker. */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; /** * Notifies about a new protocol message received from the session * (session ID is provided in attachedToWorker notification). */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; /** * Fired when page is about to send HTTP request. */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.requestWillBeSent", listener: (message: InspectorNotification) => void): this; /** * Fired when HTTP response is available. */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.responseReceived", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFailed", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.loadingFinished", listener: (message: InspectorNotification) => void): this; /** * Fired when data chunk was received over the network. */ - prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Network.dataReceived", 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; + prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; /** * This event is fired when the runtime is waiting for the debugger. For * example, when inspector.waitingForDebugger is called */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "NodeRuntime.waitingForDebugger", listener: () => void): this; + prependOnceListener(event: "Target.targetCreated", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Target.attachedToTarget", listener: (message: InspectorNotification) => void): this; } - - export { - Session, - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - Target, - }; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @since v19.0.0 - */ -declare module 'node:inspector/promises' { - export * from 'inspector/promises'; } diff --git a/types/node/v22/net.d.ts b/types/node/v22/net.d.ts index 4901cbf6bbf116..d29b929a0d179f 100644 --- a/types/node/v22/net.d.ts +++ b/types/node/v22/net.d.ts @@ -809,6 +809,27 @@ declare module "net" { * @param value Any JS value */ static isBlockList(value: unknown): value is BlockList; + /** + * ```js + * const blockList = new net.BlockList(); + * const data = [ + * 'Subnet: IPv4 192.168.1.0/24', + * 'Address: IPv4 10.0.0.5', + * 'Range: IPv4 192.168.2.1-192.168.2.10', + * 'Range: IPv4 10.0.0.1-10.0.0.10', + * ]; + * blockList.fromJSON(data); + * blockList.fromJSON(JSON.stringify(data)); + * ``` + * @since v22.19.0 + * @experimental + */ + fromJSON(data: string | readonly string[]): void; + /** + * @since v22.19.0 + * @experimental + */ + toJSON(): readonly string[]; } interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { timeout?: number | undefined; diff --git a/types/node/v22/package.json b/types/node/v22/package.json index 550bb37809d259..2e47151239274f 100644 --- a/types/node/v22/package.json +++ b/types/node/v22/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/node", - "version": "22.18.9999", + "version": "22.19.9999", "nonNpm": "conflict", "nonNpmDescription": "Node.js", "projects": [ diff --git a/types/node/v22/process.d.ts b/types/node/v22/process.d.ts index 4d5136ab9beae1..80f9c17bb63fe5 100644 --- a/types/node/v22/process.d.ts +++ b/types/node/v22/process.d.ts @@ -1493,6 +1493,18 @@ declare module "process" { * @since v9.2.0, v8.10.0, v6.13.0 */ readonly ppid: number; + /** + * The `process.threadCpuUsage()` method returns the user and system CPU time usage of + * the current worker thread, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). + * + * The result of a previous call to `process.threadCpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * @since v22.19.0 + * @param previousValue A previous return value from calling + * `process.threadCpuUsage()` + */ + threadCpuUsage(previousValue?: CpuUsage): CpuUsage; /** * The `process.title` property returns the current process title (i.e. returns * the current value of `ps`). Assigning a new value to `process.title` modifies diff --git a/types/node/v22/sqlite.d.ts b/types/node/v22/sqlite.d.ts index e5ca642e422a94..19d826d4199a17 100644 --- a/types/node/v22/sqlite.d.ts +++ b/types/node/v22/sqlite.d.ts @@ -593,6 +593,13 @@ declare module "node:sqlite" { * @param enabled Enables or disables support for unknown named parameters. */ setAllowUnknownNamedParameters(enabled: boolean): void; + /** + * When enabled, query results returned by the `all()`, `get()`, and `iterate()` methods will be returned as arrays instead + * of objects. + * @since v22.16.0 + * @param enabled Enables or disables the return of query results as arrays. + */ + setReturnArrays(enabled: boolean): void; /** * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript * numbers by default. However, SQLite `INTEGER`s can store values larger than diff --git a/types/node/v22/test/assert.ts b/types/node/v22/test/assert.ts index a289531f357f9f..d95d08e7e89e14 100644 --- a/types/node/v22/test/assert.ts +++ b/types/node/v22/test/assert.ts @@ -1,28 +1,26 @@ import assert = require("node:assert"); +import strict = require("node:assert/strict"); { - const { stack } = new assert.AssertionError({}); + // Assert that all assert exports are present in assert/strict + const keys: keyof typeof strict = {} as keyof typeof assert; } { - const { message } = new assert.AssertionError({ + const assertionError = new assert.AssertionError({ actual: 1, expected: 2, operator: "strictEqual", + diff: "full", }); - try { - assert.strictEqual(1, 2); - } catch (err) { - assert(err instanceof assert.AssertionError); - assert.strictEqual(err.message, message); - assert.strictEqual(err.name, "AssertionError"); - assert.strictEqual(err.actual, 1); - assert.strictEqual(err.expected, 2); - assert.strictEqual(err.code, "ERR_ASSERTION"); - assert.strictEqual(err.operator, "strictEqual"); - assert.strictEqual(err.generatedMessage, true); - } + // Assertion errors are native errors + const nativeError: Error = assertionError; + + assertionError.message; // $ExpectType string + assertionError.code; // $ExpectType "ERR_ASSERTION" + assertionError.operator; // $ExpectType string + assertionError.generatedMessage; // $ExpectType boolean } { @@ -109,9 +107,6 @@ assert.strict.strict.strict(1); assert.strict.strict(1); assert.strict(1); -const strictAssertionError: assert.strict.AssertionError = new assert.strict.AssertionError(); -assert(1); - assert.match("test", /test/, new Error("yeet")); assert.match("test", /test/, "yeet"); @@ -143,50 +138,67 @@ assert["fail"](true, true, "works like a charm"); assert.partialDeepStrictEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 }); +// Test assert predicates { - const a = null as any; + let a!: Error | null; assert.ifError(a); - a; // $ExpectType null | undefined -} + a; // $ExpectType null -{ - const a = true as boolean; - assert(a); - a; // $ExpectType true -} + let b!: boolean; + assert(b); + b; // $ExpectType true -{ - const a = 13 as number | null | undefined; - assert(a); - a; // $ExpectType number -} + let c!: boolean; + assert.ok(c); + c; // $ExpectType true -{ - const a = true as boolean; - assert.ok(a); - a; // $ExpectType true -} + let d!: unknown; + assert.strictEqual(d, "test"); + d; // $ExpectType "test" -{ - const a = 13 as number | null | undefined; - assert.ok(a); - a; // $ExpectType number -} + let e!: unknown; + strict.equal(e, "test"); + e; // $ExpectType "test" -{ - const a = "test" as any; - assert.strictEqual(a, "test"); - a; // $ExpectType string || "test" + let f!: unknown; + assert.deepStrictEqual(f, { n: 2 as const }); + f; // $ExpectType { n: 2; } + + let g!: unknown; + strict.deepEqual(g, { n: 2 as const }); + g; // $ExpectType { n: 2; } } { - const a = { b: 2 } as any; - assert.deepStrictEqual(a, { b: 2 }); - a; // $ExpectType { b: number; } -} + let n!: number; + let _1: 1; + + const legacyCustomAssert: assert.Assert = new assert.Assert({ + strict: false, + }); + legacyCustomAssert.equal(n, 1); + // @ts-expect-error non-strict assert.equal is not an assert predicate + _1 = n; + + // The type annotation is mandatory here to avoid TS2775 + const strictCustomAssert: assert.AssertStrict = new assert.Assert({ + diff: "full", + }); + strictCustomAssert.equal(n, 1); + _1 = n; -// This is a regression test for https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71889. -// Due to the nature of the bug this can't be switched to `import strict from "node:assert/strict";` -// or to `import strict = require("node:assert/strict");` -import { AssertionError } from "node:assert/strict"; -new AssertionError({ message: "some message" }); + // @ts-expect-error legacy Assert instances should not be assignable to AssertStrict + const invalidAssignment: assert.AssertStrict = new assert.Assert({ + strict: false, + }); + + // Verify that all assertion methods are present on the Assert interfaces + const legacyKeys: keyof assert.Assert = {} as Exclude< + keyof typeof assert, + "Assert" | "AssertionError" | "CallTracker" | "strict" + >; + const strictKeys: keyof assert.AssertStrict = {} as Exclude< + keyof typeof strict, + "Assert" | "AssertionError" | "CallTracker" | "strict" + >; +} diff --git a/types/node/v22/test/dns.ts b/types/node/v22/test/dns.ts index 98a691a3e2b972..389a80fb1bfcb9 100644 --- a/types/node/v22/test/dns.ts +++ b/types/node/v22/test/dns.ts @@ -257,7 +257,7 @@ resolve6("nodejs.org", { ttl: true }, (err, addresses) => { }); resolver.cancel(); - resolver = new Resolver({ timeout: -1, tries: 3 }); + resolver = new Resolver({ timeout: -1, tries: 3, maxTimeout: 0 }); } { diff --git a/types/node/v22/test/http.ts b/types/node/v22/test/http.ts index 7efd061b907149..ffc869f75389ce 100644 --- a/types/node/v22/test/http.ts +++ b/types/node/v22/test/http.ts @@ -36,6 +36,7 @@ import * as url from "node:url"; keepAlive: true, keepAliveInitialDelay: 1000, keepAliveTimeout: 100, + keepAliveTimeoutBuffer: 200, headersTimeout: 50000, requireHostHeader: false, rejectNonStandardBodyWrites: false, @@ -51,6 +52,7 @@ import * as url from "node:url"; const timeout: number = server.timeout; const listening: boolean = server.listening; const keepAliveTimeout: number = server.keepAliveTimeout; + const keepAliveTimeoutBuffer: number = server.keepAliveTimeoutBuffer; const requestTimeout: number = server.requestTimeout; server.setTimeout().setTimeout(1000); server.setTimeout((socket) => { diff --git a/types/node/v22/test/https.ts b/types/node/v22/test/https.ts index 8b71abfc36df9b..c7cd79a7fc3df2 100644 --- a/types/node/v22/test/https.ts +++ b/types/node/v22/test/https.ts @@ -102,6 +102,7 @@ import * as url from "node:url"; const timeout: number = server.timeout; const listening: boolean = server.listening; const keepAliveTimeout: number = server.keepAliveTimeout; + const keepAliveTimeoutBuffer: number = server.keepAliveTimeoutBuffer; const maxHeadersCount: number | null = server.maxHeadersCount; const maxRequestsPerSocket: number | null = server.maxRequestsPerSocket; const headersTimeout: number = server.headersTimeout; diff --git a/types/node/v22/test/net.ts b/types/node/v22/test/net.ts index eca2a7dc8a150d..f5dfba33008cd1 100644 --- a/types/node/v22/test/net.ts +++ b/types/node/v22/test/net.ts @@ -512,5 +512,7 @@ import * as net from "node:net"; bl.addSubnet(sockAddr, 12); const res: boolean = bl.check("127.0.0.1", "ipv4") || bl.check(sockAddr); bl.rules; // $ExpectType readonly string[] + bl.fromJSON(bl.rules); + bl.toJSON(); // $ExpectType readonly string[] net.BlockList.isBlockList(bl); // $ExpectType boolean } diff --git a/types/node/v22/test/sqlite.ts b/types/node/v22/test/sqlite.ts index c830905111fbba..907a714ff8c8b8 100644 --- a/types/node/v22/test/sqlite.ts +++ b/types/node/v22/test/sqlite.ts @@ -43,6 +43,7 @@ import { TextEncoder } from "node:util"; insert.setReadBigInts(true); insert.setAllowBareNamedParameters(true); insert.setAllowUnknownNamedParameters(true); + insert.setReturnArrays(false); insert.columns(); // $ExpectType StatementColumnMetadata[] insert.run(1, 42, 3.14159, "foo", new TextEncoder().encode("a☃b☃c")); insert.run(2, null, null, null, null); diff --git a/types/node/v22/test/test.ts b/types/node/v22/test/test.ts index fe042dc75ed975..e7f2faa70870eb 100644 --- a/types/node/v22/test/test.ts +++ b/types/node/v22/test/test.ts @@ -1004,7 +1004,7 @@ const invalidSuiteContext = new SuiteContext(); test("check all assertion functions are re-exported", t => { type AssertModuleExports = keyof typeof import("assert"); const keys: keyof { [K in keyof typeof t.assert as K extends AssertModuleExports ? K : never]: any } = - {} as Exclude; + {} as Exclude; }); test("planning with streams", (t: TestContext, done) => { diff --git a/types/node/v22/test/tls.ts b/types/node/v22/test/tls.ts index 775881b23febd0..e31bae16b1c682 100644 --- a/types/node/v22/test/tls.ts +++ b/types/node/v22/test/tls.ts @@ -16,6 +16,7 @@ import { rootCertificates, SecureContext, Server, + setDefaultCACertificates, TlsOptions, TLSSocket, } from "node:tls"; @@ -66,6 +67,7 @@ import { const maxVersion: string = DEFAULT_MAX_VERSION; const minVersion: string = DEFAULT_MIN_VERSION; const cyphers: string = DEFAULT_CIPHERS; + setDefaultCACertificates(caCertificates); const buf: Buffer = tlsSocket.exportKeyingMaterial(123, "test", Buffer.from("nope")); diff --git a/types/node/v22/test/util.ts b/types/node/v22/test/util.ts index bc485480f765c4..dc29db5be59d55 100644 --- a/types/node/v22/test/util.ts +++ b/types/node/v22/test/util.ts @@ -255,6 +255,8 @@ const encIntoRes: util.EncodeIntoResult = te.encodeInto("asdf", new Uint8Array(1 const errorMap: Map = util.getSystemErrorMap(); +util.setTraceSigInt(true); + { const logger: util.DebugLogger = util.debuglog("section"); logger.enabled; // $ExpectType boolean diff --git a/types/node/v22/test/worker_threads.ts b/types/node/v22/test/worker_threads.ts index 36edf49a8e808d..1abc5f1fb3c51e 100644 --- a/types/node/v22/test/worker_threads.ts +++ b/types/node/v22/test/worker_threads.ts @@ -67,6 +67,9 @@ import { createContext } from "node:vm"; { const w = new workerThreads.Worker(__filename); + w.cpuUsage().then((usage: NodeJS.CpuUsage) => { + w.cpuUsage(usage); // $ExpectType Promise + }); w.getHeapSnapshot().then((stream: Readable) => { // }); diff --git a/types/node/v22/tls.d.ts b/types/node/v22/tls.d.ts index 1f90e863ca17e4..86e96b89ef2f66 100644 --- a/types/node/v22/tls.d.ts +++ b/types/node/v22/tls.d.ts @@ -1232,6 +1232,38 @@ declare module "tls" { * @since v0.10.2 */ function getCiphers(): string[]; + /** + * Sets the default CA certificates used by Node.js TLS clients. If the provided + * certificates are parsed successfully, they will become the default CA + * certificate list returned by {@link getCACertificates} and used + * by subsequent TLS connections that don't specify their own CA certificates. + * The certificates will be deduplicated before being set as the default. + * + * This function only affects the current Node.js thread. Previous + * sessions cached by the HTTPS agent won't be affected by this change, so + * this method should be called before any unwanted cachable TLS connections are + * made. + * + * To use system CA certificates as the default: + * + * ```js + * import tls from 'node:tls'; + * tls.setDefaultCACertificates(tls.getCACertificates('system')); + * ``` + * + * This function completely replaces the default CA certificate list. To add additional + * certificates to the existing defaults, get the current certificates and append to them: + * + * ```js + * import tls from 'node:tls'; + * const currentCerts = tls.getCACertificates('default'); + * const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...']; + * tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]); + * ``` + * @since v22.19.0 + * @param certs An array of CA certificates in PEM format. + */ + function setDefaultCACertificates(certs: ReadonlyArray): void; /** * The default curve name to use for ECDH key agreement in a tls server. * The default value is `'auto'`. See `{@link createSecureContext()}` for further diff --git a/types/node/v22/ts5.6/index.d.ts b/types/node/v22/ts5.6/index.d.ts index b4315c2f49b4b9..5a5af42a26b768 100644 --- a/types/node/v22/ts5.6/index.d.ts +++ b/types/node/v22/ts5.6/index.d.ts @@ -62,6 +62,7 @@ /// /// /// +/// /// /// /// diff --git a/types/node/v22/url.d.ts b/types/node/v22/url.d.ts index 84736e880621bc..6a0effc782160d 100644 --- a/types/node/v22/url.d.ts +++ b/types/node/v22/url.d.ts @@ -455,12 +455,15 @@ declare module "url" { */ static canParse(input: string, base?: string): boolean; /** - * Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs. - * Returns `null` if `input` is not a valid. - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. + * Parses a string as a URL. If `base` is provided, it will be used as the base + * URL for the purpose of resolving non-absolute `input` URLs. Returns `null` + * if the parameters can't be resolved to a valid URL. * @since v22.1.0 + * @param input The absolute or relative input URL to parse. If `input` + * is relative, then `base` is required. If `input` is absolute, the `base` + * is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first. + * @param base The base URL to resolve against if the `input` is not + * absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first. */ static parse(input: string, base?: string): URL | null; constructor(input: string | { toString: () => string }, base?: string | URL); diff --git a/types/node/v22/util.d.ts b/types/node/v22/util.d.ts index e535f5c5a48e5a..a171f651ebbc16 100644 --- a/types/node/v22/util.d.ts +++ b/types/node/v22/util.d.ts @@ -338,6 +338,11 @@ declare module "util" { * @since v9.7.0 */ export function getSystemErrorName(err: number): string; + /** + * Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread. + * @since 22.19.0 + */ + export function setTraceSigInt(enable: boolean): void; /** * Returns a Map of all system error codes available from the Node.js API. * The mapping between error codes and error names is platform-dependent. @@ -1709,10 +1714,12 @@ declare module "util" { */ short?: string | undefined; /** - * The default value to - * be used if (and only if) the option does not appear in the arguments to be - * parsed. It must be of the same type as the `type` property. When `multiple` - * is `true`, it must be an array. + * The value to assign to + * the option if it does not appear in the arguments to be parsed. The value + * must match the type specified by the `type` property. If `multiple` is + * `true`, it must be an array. No default value is applied when the option + * does appear in the arguments to be parsed, even if the provided value + * is falsy. * @since v18.11.0 */ default?: string | boolean | string[] | boolean[] | undefined; diff --git a/types/node/v22/worker_threads.d.ts b/types/node/v22/worker_threads.d.ts index 39cf89373f83da..c4bbacf6e73bad 100644 --- a/types/node/v22/worker_threads.d.ts +++ b/types/node/v22/worker_threads.d.ts @@ -437,6 +437,13 @@ declare module "worker_threads" { * @since v10.5.0 */ terminate(): Promise; + /** + * This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`, + * or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running. + * This methods allows the statistics to be observed from outside the actual thread. + * @since v22.19.0 + */ + cpuUsage(prev?: NodeJS.CpuUsage): Promise; /** * Returns a readable stream for a V8 snapshot of the current state of the Worker. * See `v8.getHeapSnapshot()` for more details. diff --git a/types/node/v22/zlib.d.ts b/types/node/v22/zlib.d.ts index caeb1ed7c8e26d..da92e3aa97a10e 100644 --- a/types/node/v22/zlib.d.ts +++ b/types/node/v22/zlib.d.ts @@ -181,6 +181,12 @@ declare module "zlib" { * If `true`, returns an object with `buffer` and `engine`. */ info?: boolean | undefined; + /** + * Optional dictionary used to improve compression efficiency when compressing or decompressing data that + * shares common patterns with the dictionary. + * @since v22.19.0 + */ + dictionary?: NodeJS.ArrayBufferView | undefined; } interface Zlib { /** @deprecated Use bytesWritten instead. */