Socket
Socket
Sign inDemoInstall

@types/node

Package Overview
Dependencies
Maintainers
1
Versions
1895
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/node - npm Package Compare versions

Comparing version 20.4.10 to 20.8.10

72

node/assert.d.ts

@@ -6,3 +6,3 @@ /**

*/
declare module 'assert' {
declare module "assert" {
/**

@@ -38,3 +38,3 @@ * An alias of {@link ok}.

*/
code: 'ERR_ASSERTION';
code: "ERR_ASSERTION";
constructor(options?: {

@@ -202,3 +202,3 @@ /** If provided, the error message is set to this value. */

}
type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
/**

@@ -235,3 +235,3 @@ * Throws an `AssertionError` with the provided error message or a default

// tslint:disable-next-line:ban-types
stackStartFn?: Function
stackStartFn?: Function,
): never;

@@ -864,3 +864,7 @@ /**

function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
function rejects(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error,
): Promise<void>;
/**

@@ -908,4 +912,11 @@ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately

*/
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
function doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
message?: string | Error,
): Promise<void>;
function doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error,
): Promise<void>;
/**

@@ -957,23 +968,36 @@ * Expects the `string` input to match the regular expression.

function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
(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;
};
const strict:
& Omit<
typeof assert,
| "equal"
| "notEqual"
| "deepEqual"
| "notDeepEqual"
| "ok"
| "strictEqual"
| "deepStrictEqual"
| "ifError"
| "strict"
>
& {
(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;
};
}
export = assert;
}
declare module 'node:assert' {
import assert = require('assert');
declare module "node:assert" {
import assert = require("assert");
export = assert;
}

@@ -1,8 +0,8 @@

declare module 'assert/strict' {
import { strict } from 'node:assert';
declare module "assert/strict" {
import { strict } from "node:assert";
export = strict;
}
declare module 'node:assert/strict' {
import { strict } from 'node:assert';
declare module "node:assert/strict" {
import { strict } from "node:assert";
export = strict;
}

@@ -17,3 +17,3 @@ /**

*/
declare module 'async_hooks' {
declare module "async_hooks" {
/**

@@ -25,2 +25,3 @@ * ```js

* console.log(executionAsyncId()); // 1 - bootstrap
* const path = '.';
* fs.open(path, 'r', (err, fd) => {

@@ -279,3 +280,7 @@ * console.log(executionAsyncId()); // 6 - open()

*/
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(fn: Func, type?: string, thisArg?: ThisArg): Func;
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
fn: Func,
type?: string,
thisArg?: ThisArg,
): Func;
/**

@@ -297,3 +302,7 @@ * Binds the given function to execute to this `AsyncResource`'s scope.

*/
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
runInAsyncScope<This, Result>(
fn: (this: This, ...args: any[]) => Result,
thisArg?: This,
...args: any[]
): Result;
/**

@@ -312,3 +321,2 @@ * Call all `destroy` hooks. This should only ever be called once. An error will

/**
*
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.

@@ -460,2 +468,3 @@ */

*/
run<R>(store: T, callback: () => R): R;
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;

@@ -534,4 +543,4 @@ /**

}
declare module 'node:async_hooks' {
export * from 'async_hooks';
declare module "node:async_hooks" {
export * from "async_hooks";
}

@@ -55,7 +55,7 @@ /**

*/
declare module 'cluster' {
import * as child from 'node:child_process';
import EventEmitter = require('node:events');
import * as net from 'node:net';
type SerializationType = 'json' | 'advanced';
declare module "cluster" {
import * as child from "node:child_process";
import EventEmitter = require("node:events");
import * as net from "node:net";
type SerializationType = "json" | "advanced";
export interface ClusterSettings {

@@ -77,3 +77,3 @@ execArgv?: string[] | undefined; // default: process.execArgv

port: number;
addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6"
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
}

@@ -130,4 +130,13 @@ /**

send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean;
send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean;
send(
message: child.Serializable,
sendHandle: child.SendHandle,
callback?: (error: Error | null) => void,
): boolean;
send(
message: child.Serializable,
sendHandle: child.SendHandle,
options?: child.MessageOptions,
callback?: (error: Error | null) => void,
): boolean;
/**

@@ -289,43 +298,43 @@ * This function will kill the worker. In the primary worker, it does this by

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'disconnect', listener: () => void): this;
addListener(event: 'error', listener: (error: Error) => void): this;
addListener(event: 'exit', listener: (code: number, signal: string) => void): this;
addListener(event: 'listening', listener: (address: Address) => void): this;
addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: 'online', listener: () => void): this;
addListener(event: "disconnect", listener: () => void): this;
addListener(event: "error", listener: (error: Error) => void): this;
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
addListener(event: "listening", listener: (address: Address) => void): this;
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: "online", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'disconnect'): boolean;
emit(event: 'error', error: Error): boolean;
emit(event: 'exit', code: number, signal: string): boolean;
emit(event: 'listening', address: Address): boolean;
emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean;
emit(event: 'online'): boolean;
emit(event: "disconnect"): boolean;
emit(event: "error", error: Error): boolean;
emit(event: "exit", code: number, signal: string): boolean;
emit(event: "listening", address: Address): boolean;
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
emit(event: "online"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'disconnect', listener: () => void): this;
on(event: 'error', listener: (error: Error) => void): this;
on(event: 'exit', listener: (code: number, signal: string) => void): this;
on(event: 'listening', listener: (address: Address) => void): this;
on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: 'online', listener: () => void): this;
on(event: "disconnect", listener: () => void): this;
on(event: "error", listener: (error: Error) => void): this;
on(event: "exit", listener: (code: number, signal: string) => void): this;
on(event: "listening", listener: (address: Address) => void): this;
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: "online", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'disconnect', listener: () => void): this;
once(event: 'error', listener: (error: Error) => void): this;
once(event: 'exit', listener: (code: number, signal: string) => void): this;
once(event: 'listening', listener: (address: Address) => void): this;
once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: 'online', listener: () => void): this;
once(event: "disconnect", listener: () => void): this;
once(event: "error", listener: (error: Error) => void): this;
once(event: "exit", listener: (code: number, signal: string) => void): this;
once(event: "listening", listener: (address: Address) => void): this;
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: "online", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'disconnect', listener: () => void): this;
prependListener(event: 'error', listener: (error: Error) => void): this;
prependListener(event: 'exit', listener: (code: number, signal: string) => void): this;
prependListener(event: 'listening', listener: (address: Address) => void): this;
prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: 'online', listener: () => void): this;
prependListener(event: "disconnect", listener: () => void): this;
prependListener(event: "error", listener: (error: Error) => void): this;
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
prependListener(event: "listening", listener: (address: Address) => void): this;
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: "online", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'disconnect', listener: () => void): this;
prependOnceListener(event: 'error', listener: (error: Error) => void): this;
prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this;
prependOnceListener(event: 'listening', listener: (address: Address) => void): this;
prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: 'online', listener: () => void): this;
prependOnceListener(event: "disconnect", listener: () => void): this;
prependOnceListener(event: "error", listener: (error: Error) => void): this;
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: "online", listener: () => void): this;
}

@@ -362,51 +371,60 @@ export interface Cluster extends EventEmitter {

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'disconnect', listener: (worker: Worker) => void): this;
addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
addListener(event: 'fork', listener: (worker: Worker) => void): this;
addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: 'online', listener: (worker: Worker) => void): this;
addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
addListener(event: "fork", listener: (worker: Worker) => void): this;
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
addListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: "online", listener: (worker: Worker) => void): this;
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'disconnect', worker: Worker): boolean;
emit(event: 'exit', worker: Worker, code: number, signal: string): boolean;
emit(event: 'fork', worker: Worker): boolean;
emit(event: 'listening', worker: Worker, address: Address): boolean;
emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
emit(event: 'online', worker: Worker): boolean;
emit(event: 'setup', settings: ClusterSettings): boolean;
emit(event: "disconnect", worker: Worker): boolean;
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
emit(event: "fork", worker: Worker): boolean;
emit(event: "listening", worker: Worker, address: Address): boolean;
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
emit(event: "online", worker: Worker): boolean;
emit(event: "setup", settings: ClusterSettings): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'disconnect', listener: (worker: Worker) => void): this;
on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
on(event: 'fork', listener: (worker: Worker) => void): this;
on(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: 'online', listener: (worker: Worker) => void): this;
on(event: 'setup', listener: (settings: ClusterSettings) => void): this;
on(event: "disconnect", listener: (worker: Worker) => void): this;
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
on(event: "fork", listener: (worker: Worker) => void): this;
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: "online", listener: (worker: Worker) => void): this;
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'disconnect', listener: (worker: Worker) => void): this;
once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
once(event: 'fork', listener: (worker: Worker) => void): this;
once(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: 'online', listener: (worker: Worker) => void): this;
once(event: 'setup', listener: (settings: ClusterSettings) => void): this;
once(event: "disconnect", listener: (worker: Worker) => void): this;
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
once(event: "fork", listener: (worker: Worker) => void): this;
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: "online", listener: (worker: Worker) => void): this;
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'disconnect', listener: (worker: Worker) => void): this;
prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
prependListener(event: 'fork', listener: (worker: Worker) => void): this;
prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
prependListener(event: "fork", listener: (worker: Worker) => void): this;
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
// the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this;
prependListener(event: 'online', listener: (worker: Worker) => void): this;
prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
prependListener(
event: "message",
listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
): this;
prependListener(event: "online", listener: (worker: Worker) => void): this;
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this;
prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this;
prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
// the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
prependOnceListener(event: 'online', listener: (worker: Worker) => void): this;
prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
prependOnceListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this;
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
}

@@ -416,5 +434,5 @@ const cluster: Cluster;

}
declare module 'node:cluster' {
export * from 'cluster';
export { default as default } from 'cluster';
declare module "node:cluster" {
export * from "cluster";
export { default as default } from "cluster";
}

@@ -58,8 +58,8 @@ /**

*/
declare module 'console' {
import console = require('node:console');
declare module "console" {
import console = require("node:console");
export = console;
}
declare module 'node:console' {
import { InspectOptions } from 'node:util';
declare module "node:console" {
import { InspectOptions } from "node:util";
global {

@@ -127,3 +127,3 @@ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build

* @since v8.3.0
* @param label The display label for the counter.
* @param [label='default'] The display label for the counter.
*/

@@ -146,3 +146,3 @@ count(label?: string): void;

* @since v8.3.0
* @param label The display label for the counter.
* @param [label='default'] The display label for the counter.
*/

@@ -227,3 +227,3 @@ countReset(label?: string): void;

* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
* logging the argument if it can’t be parsed as tabular.
* logging the argument if it can't be parsed as tabular.
*

@@ -264,2 +264,3 @@ * ```js

* @since v0.1.104
* @param [label='default']
*/

@@ -272,8 +273,9 @@ time(label?: string): void;

* ```js
* console.time('100-elements');
* for (let i = 0; i < 100; i++) {}
* console.timeEnd('100-elements');
* // prints 100-elements: 225.438ms
* console.time('bunch-of-stuff');
* // Do a bunch of stuff.
* console.timeEnd('bunch-of-stuff');
* // Prints: bunch-of-stuff: 225.438ms
* ```
* @since v0.1.104
* @param [label='default']
*/

@@ -294,2 +296,3 @@ timeEnd(label?: string): void;

* @since v10.7.0
* @param [label='default']
*/

@@ -402,3 +405,3 @@ timeLog(label?: string, ...data: any[]): void;

ignoreErrors?: boolean | undefined;
colorMode?: boolean | 'auto' | undefined;
colorMode?: boolean | "auto" | undefined;
inspectOptions?: InspectOptions | undefined;

@@ -413,4 +416,4 @@ /**

prototype: Console;
new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
new (options: ConsoleConstructorOptions): Console;
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
new(options: ConsoleConstructorOptions): Console;
}

@@ -417,0 +420,0 @@ }

/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
declare module 'constants' {
import { constants as osConstants, SignalConstants } from 'node:os';
import { constants as cryptoConstants } from 'node:crypto';
import { constants as fsConstants } from 'node:fs';
declare module "constants" {
import { constants as osConstants, SignalConstants } from "node:os";
import { constants as cryptoConstants } from "node:crypto";
import { constants as fsConstants } from "node:fs";
const exp: typeof osConstants.errno &
typeof osConstants.priority &
SignalConstants &
typeof cryptoConstants &
typeof fsConstants;
const exp:
& typeof osConstants.errno
& typeof osConstants.priority
& SignalConstants
& typeof cryptoConstants
& typeof fsConstants;
export = exp;
}
declare module 'node:constants' {
import constants = require('constants');
declare module "node:constants" {
import constants = require("constants");
export = constants;
}

@@ -28,9 +28,9 @@ /**

*/
declare module 'dgram' {
import { AddressInfo } from 'node:net';
import * as dns from 'node:dns';
import { EventEmitter, Abortable } from 'node:events';
declare module "dgram" {
import { AddressInfo } from "node:net";
import * as dns from "node:dns";
import { Abortable, EventEmitter } from "node:events";
interface RemoteInfo {
address: string;
family: 'IPv4' | 'IPv6';
family: "IPv4" | "IPv6";
port: number;

@@ -45,3 +45,3 @@ size: number;

}
type SocketType = 'udp4' | 'udp6';
type SocketType = "udp4" | "udp6";
interface SocketOptions extends Abortable {

@@ -56,3 +56,9 @@ type: SocketType;

sendBufferSize?: number | undefined;
lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined;
lookup?:
| ((
hostname: string,
options: dns.LookupOneOptions,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
) => void)
| undefined;
}

@@ -341,8 +347,38 @@ /**

*/
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
send(
msg: string | Uint8Array | ReadonlyArray<any>,
port?: number,
address?: string,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array | ReadonlyArray<any>,
port?: number,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array | ReadonlyArray<any>,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array,
offset: number,
length: number,
port?: number,
address?: string,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array,
offset: number,
length: number,
port?: number,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array,
offset: number,
length: number,
callback?: (error: Error | null, bytes: number) => void,
): void;
/**

@@ -510,41 +546,46 @@ * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'connect', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'listening', listener: () => void): this;
addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connect", listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'connect'): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'listening'): boolean;
emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean;
emit(event: "close"): boolean;
emit(event: "connect"): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'connect', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'listening', listener: () => void): this;
on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connect", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'connect', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'listening', listener: () => void): this;
once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connect", listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'connect', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'listening', listener: () => void): this;
prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connect", listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'connect', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'listening', listener: () => void): this;
prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connect", listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
/**
* Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
* @since v20.5.0
*/
[Symbol.asyncDispose](): Promise<void>;
}
}
declare module 'node:dgram' {
export * from 'dgram';
declare module "node:dgram" {
export * from "dgram";
}

@@ -25,3 +25,3 @@ /**

*/
declare module 'diagnostics_channel' {
declare module "diagnostics_channel" {
/**

@@ -190,4 +190,4 @@ * Check if there are active subscribers to the named channel. This is helpful if

}
declare module 'node:diagnostics_channel' {
export * from 'diagnostics_channel';
declare module "node:diagnostics_channel" {
export * from "diagnostics_channel";
}

@@ -47,4 +47,4 @@ /**

*/
declare module 'dns' {
import * as dnsPromises from 'node:dns/promises';
declare module "dns" {
import * as dnsPromises from "node:dns/promises";
// Supported getaddrinfo flags.

@@ -119,7 +119,26 @@ export const ADDRCONFIG: number;

*/
export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
export function lookup(
hostname: string,
family: number,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
): void;
export function lookup(
hostname: string,
options: LookupOneOptions,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
): void;
export function lookup(
hostname: string,
options: LookupAllOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
): void;
export function lookup(
hostname: string,
options: LookupOptions,
callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void,
): void;
export function lookup(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
): void;
export namespace lookup {

@@ -150,7 +169,11 @@ function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;

*/
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
export function lookupService(
address: string,
port: number,
callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
): void;
export namespace lookupService {
function __promisify__(
address: string,
port: number
port: number,
): Promise<{

@@ -174,6 +197,6 @@ hostname: string;

export interface AnyARecord extends RecordWithTtl {
type: 'A';
type: "A";
}
export interface AnyAaaaRecord extends RecordWithTtl {
type: 'AAAA';
type: "AAAA";
}

@@ -193,3 +216,3 @@ export interface CaaRecord {

export interface AnyMxRecord extends MxRecord {
type: 'MX';
type: "MX";
}

@@ -205,3 +228,3 @@ export interface NaptrRecord {

export interface AnyNaptrRecord extends NaptrRecord {
type: 'NAPTR';
type: "NAPTR";
}

@@ -218,3 +241,3 @@ export interface SoaRecord {

export interface AnySoaRecord extends SoaRecord {
type: 'SOA';
type: "SOA";
}

@@ -228,21 +251,31 @@ export interface SrvRecord {

export interface AnySrvRecord extends SrvRecord {
type: 'SRV';
type: "SRV";
}
export interface AnyTxtRecord {
type: 'TXT';
type: "TXT";
entries: string[];
}
export interface AnyNsRecord {
type: 'NS';
type: "NS";
value: string;
}
export interface AnyPtrRecord {
type: 'PTR';
type: "PTR";
value: string;
}
export interface AnyCnameRecord {
type: 'CNAME';
type: "CNAME";
value: string;
}
export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord;
export type AnyRecord =
| AnyARecord
| AnyAaaaRecord
| AnyCnameRecord
| AnyMxRecord
| AnyNaptrRecord
| AnyNsRecord
| AnyPtrRecord
| AnySoaRecord
| AnySrvRecord
| AnyTxtRecord;
/**

@@ -260,28 +293,81 @@ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array

*/
export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
export function resolve(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "A",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "AAAA",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "ANY",
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "CNAME",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "MX",
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "NAPTR",
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "NS",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "PTR",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "SOA",
callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void,
): void;
export function resolve(
hostname: string,
rrtype: "SRV",
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "TXT",
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
): void;
export function resolve(
hostname: string,
rrtype: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void
callback: (
err: NodeJS.ErrnoException | null,
addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
) => void,
): void;
export namespace resolve {
function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>;
function __promisify__(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
function __promisify__(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
function __promisify__(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
function __promisify__(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
function __promisify__(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
function __promisify__(
hostname: string,
rrtype: string,
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
}

@@ -294,5 +380,16 @@ /**

*/
export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
export function resolve4(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve4(
hostname: string,
options: ResolveWithTtlOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
): void;
export function resolve4(
hostname: string,
options: ResolveOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
): void;
export namespace resolve4 {

@@ -309,5 +406,16 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
export function resolve6(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve6(
hostname: string,
options: ResolveWithTtlOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
): void;
export function resolve6(
hostname: string,
options: ResolveOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
): void;
export namespace resolve6 {

@@ -323,3 +431,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolveCname(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export namespace resolveCname {

@@ -334,3 +445,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
export function resolveCaa(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
): void;
export namespace resolveCaa {

@@ -344,3 +458,6 @@ function __promisify__(hostname: string): Promise<CaaRecord[]>;

*/
export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
export function resolveMx(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
): void;
export namespace resolveMx {

@@ -372,3 +489,6 @@ function __promisify__(hostname: string): Promise<MxRecord[]>;

*/
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
export function resolveNaptr(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
): void;
export namespace resolveNaptr {

@@ -382,3 +502,6 @@ function __promisify__(hostname: string): Promise<NaptrRecord[]>;

*/
export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolveNs(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export namespace resolveNs {

@@ -392,3 +515,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolvePtr(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export namespace resolvePtr {

@@ -423,3 +549,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
export function resolveSoa(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
): void;
export namespace resolveSoa {

@@ -447,3 +576,6 @@ function __promisify__(hostname: string): Promise<SoaRecord>;

*/
export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
export function resolveSrv(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
): void;
export namespace resolveSrv {

@@ -459,3 +591,6 @@ function __promisify__(hostname: string): Promise<SrvRecord[]>;

*/
export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
export function resolveTxt(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
): void;
export namespace resolveTxt {

@@ -494,3 +629,6 @@ function __promisify__(hostname: string): Promise<string[][]>;

*/
export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
export function resolveAny(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
): void;
export namespace resolveAny {

@@ -507,3 +645,6 @@ function __promisify__(hostname: string): Promise<AnyRecord[]>;

*/
export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
export function reverse(
ip: string,
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
): void;
/**

@@ -516,3 +657,3 @@ * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:

*/
export function getDefaultResultOrder(): 'ipv4first' | 'verbatim';
export function getDefaultResultOrder(): "ipv4first" | "verbatim";
/**

@@ -575,3 +716,3 @@ * Sets the IP address and port of servers to be used when performing DNS

*/
export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
// Error codes

@@ -690,4 +831,4 @@ export const NODATA: string;

}
declare module 'node:dns' {
export * from 'dns';
declare module "node:dns" {
export * from "dns";
}

@@ -7,19 +7,19 @@ /**

*/
declare module 'dns/promises' {
declare module "dns/promises" {
import {
AnyRecord,
CaaRecord,
LookupAddress,
LookupAllOptions,
LookupOneOptions,
LookupAllOptions,
LookupOptions,
AnyRecord,
CaaRecord,
MxRecord,
NaptrRecord,
SoaRecord,
SrvRecord,
ResolveWithTtlOptions,
RecordWithTtl,
ResolveOptions,
ResolverOptions,
} from 'node:dns';
ResolveWithTtlOptions,
SoaRecord,
SrvRecord,
} from "node:dns";
/**

@@ -110,3 +110,3 @@ * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),

address: string,
port: number
port: number,
): Promise<{

@@ -130,15 +130,18 @@ hostname: string;

function resolve(hostname: string): Promise<string[]>;
function resolve(hostname: string, rrtype: 'A'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'AAAA'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
function resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
function resolve(hostname: string, rrtype: 'CNAME'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
function resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
function resolve(hostname: string, rrtype: 'NS'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'PTR'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
function resolve(
hostname: string,
rrtype: string,
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
/**

@@ -349,3 +352,3 @@ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4

*/
function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
/**

@@ -416,4 +419,4 @@ * An independent resolver for DNS requests.

}
declare module 'node:dns/promises' {
export * from 'dns/promises';
declare module "node:dns/promises" {
export * from "dns/promises";
}

@@ -11,68 +11,66 @@ export {}; // Don't export anything!

// the copy below in a Node environment.
type __Event = typeof globalThis extends { onmessage: any, Event: any }
? {}
: {
/** This is not used in Node.js and is provided purely for completeness. */
readonly bubbles: boolean;
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
cancelBubble: () => void;
/** True if the event was created with the cancelable option */
readonly cancelable: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly composed: boolean;
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
composedPath(): [EventTarget?]
/** Alias for event.target. */
readonly currentTarget: EventTarget | null;
/** Is true if cancelable is true and event.preventDefault() has been called. */
readonly defaultPrevented: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly eventPhase: 0 | 2;
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
readonly isTrusted: boolean;
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
preventDefault(): void;
/** This is not used in Node.js and is provided purely for completeness. */
returnValue: boolean;
/** Alias for event.target. */
readonly srcElement: EventTarget | null;
/** Stops the invocation of event listeners after the current one completes. */
stopImmediatePropagation(): void;
/** This is not used in Node.js and is provided purely for completeness. */
stopPropagation(): void;
/** The `EventTarget` dispatching the event */
readonly target: EventTarget | null;
/** The millisecond timestamp when the Event object was created. */
readonly timeStamp: number;
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
readonly type: string;
};
type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {}
: {
/** This is not used in Node.js and is provided purely for completeness. */
readonly bubbles: boolean;
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
cancelBubble: () => void;
/** True if the event was created with the cancelable option */
readonly cancelable: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly composed: boolean;
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
composedPath(): [EventTarget?];
/** Alias for event.target. */
readonly currentTarget: EventTarget | null;
/** Is true if cancelable is true and event.preventDefault() has been called. */
readonly defaultPrevented: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly eventPhase: 0 | 2;
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
readonly isTrusted: boolean;
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
preventDefault(): void;
/** This is not used in Node.js and is provided purely for completeness. */
returnValue: boolean;
/** Alias for event.target. */
readonly srcElement: EventTarget | null;
/** Stops the invocation of event listeners after the current one completes. */
stopImmediatePropagation(): void;
/** This is not used in Node.js and is provided purely for completeness. */
stopPropagation(): void;
/** The `EventTarget` dispatching the event */
readonly target: EventTarget | null;
/** The millisecond timestamp when the Event object was created. */
readonly timeStamp: number;
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
readonly type: string;
};
// See comment above explaining conditional type
type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any }
? {}
: {
/**
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
*
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
*
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
*/
addEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: AddEventListenerOptions | boolean,
): void;
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
dispatchEvent(event: Event): boolean;
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
removeEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: EventListenerOptions | boolean,
): void;
};
type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {}
: {
/**
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
*
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
*
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
*/
addEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: AddEventListenerOptions | boolean,
): void;
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
dispatchEvent(event: Event): boolean;
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
removeEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: EventListenerOptions | boolean,
): void;
};

@@ -105,11 +103,10 @@ interface EventInit {

import {} from 'events'; // Make this an ambient declaration
import {} from "events"; // Make this an ambient declaration
declare global {
/** An event which takes place in the DOM. */
interface Event extends __Event {}
var Event: typeof globalThis extends { onmessage: any, Event: infer T }
? T
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
: {
prototype: __Event;
new (type: string, eventInitDict?: EventInit): __Event;
new(type: string, eventInitDict?: EventInit): __Event;
};

@@ -122,8 +119,7 @@

interface EventTarget extends __EventTarget {}
var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T }
? T
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
: {
prototype: __EventTarget;
new (): __EventTarget;
new(): __EventTarget;
};
}

@@ -17,4 +17,4 @@ /**

*/
declare module 'domain' {
import EventEmitter = require('node:events');
declare module "domain" {
import EventEmitter = require("node:events");
/**

@@ -169,4 +169,4 @@ * The `Domain` class encapsulates the functionality of routing errors and

}
declare module 'node:domain' {
export * from 'domain';
declare module "node:domain" {
export * from "domain";
}

@@ -37,3 +37,4 @@ /**

*/
declare module 'events' {
declare module "events" {
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
// NOTE: This class is in the docs but is **not actually exported** by Node.

@@ -89,3 +90,3 @@ // If https://github.com/nodejs/node/issues/39903 gets resolved and Node

once: boolean;
}
},
): any;

@@ -112,2 +113,5 @@ }

constructor(options?: EventEmitterOptions);
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
/**

@@ -192,3 +196,7 @@ * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given

*/
static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
static once(
emitter: _NodeEventTarget,
eventName: string | symbol,
options?: StaticEventEmitterOptions,
): Promise<any[]>;
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;

@@ -254,3 +262,7 @@ /**

*/
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
static on(
emitter: NodeJS.EventEmitter,
eventName: string,
options?: StaticEventEmitterOptions,
): AsyncIterableIterator<any>;
/**

@@ -347,2 +359,37 @@ * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.

/**
* Listens once to the `abort` event on the provided `signal`.
*
* Listening to the `abort` event on abort signals is unsafe and may
* lead to resource leaks since another third party with the signal can
* call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change
* this since it would violate the web standard. Additionally, the original
* API makes it easy to forget to remove listeners.
*
* This API allows safely using `AbortSignal`s in Node.js APIs by solving these
* two issues by listening to the event such that `stopImmediatePropagation` does
* not prevent the listener from running.
*
* Returns a disposable so that it may be unsubscribed from more easily.
*
* ```js
* import { addAbortListener } from 'node:events';
*
* function example(signal) {
* let disposable;
* try {
* signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
* disposable = addAbortListener(signal, (e) => {
* // Do something when signal is aborted.
* });
* } finally {
* disposable?.[Symbol.dispose]();
* }
* }
* ```
* @since v20.5.0
* @experimental
* @return Disposable that removes the `abort` listener.
*/
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
/**
* This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called.

@@ -407,3 +454,3 @@ *

}
import internal = require('node:events');
import internal = require("node:events");
namespace EventEmitter {

@@ -418,2 +465,45 @@ // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4

}
export interface EventEmitterReferencingAsyncResource extends AsyncResource {
readonly eventEmitter: EventEmitterAsyncResource;
}
export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
/**
* The type of async event, this is required when instantiating `EventEmitterAsyncResource`
* directly rather than as a child class.
* @default new.target.name if instantiated as a child class.
*/
name?: string;
}
/**
* Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that require
* manual async tracking. Specifically, all events emitted by instances of
* `EventEmitterAsyncResource` will run within its async context.
*
* The EventEmitterAsyncResource class has the same methods and takes the
* same options as EventEmitter and AsyncResource themselves.
* @throws if `options.name` is not provided when instantiated directly.
* @since v17.4.0, v16.14.0
*/
export class EventEmitterAsyncResource extends EventEmitter {
/**
* @param options Only optional in child class.
*/
constructor(options?: EventEmitterAsyncResourceOptions);
/**
* Call all destroy hooks. This should only ever be called once. An
* error will be thrown if it is called more than once. This must be
* manually called. If the resource is left to be collected by the GC then
* the destroy hooks will never be called.
*/
emitDestroy(): void;
/** The unique asyncId assigned to the resource. */
readonly asyncId: number;
/** The same triggerAsyncId that is passed to the AsyncResource constructor. */
readonly triggerAsyncId: number;
/** The underlying AsyncResource */
readonly asyncResource: EventEmitterReferencingAsyncResource;
}
}

@@ -423,2 +513,3 @@ global {

interface EventEmitter {
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
/**

@@ -759,5 +850,5 @@ * Alias for `emitter.on(eventName, listener)`.

}
declare module 'node:events' {
import events = require('events');
declare module "node:events" {
import events = require("events");
export = events;
}

@@ -11,6 +11,6 @@ /**

*/
declare module 'fs/promises' {
import { Abortable } from 'node:events';
import { Stream } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
declare module "fs/promises" {
import { Abortable } from "node:events";
import { Stream } from "node:stream";
import { ReadableStream } from "node:stream/web";
import {

@@ -34,4 +34,4 @@ BigIntStats,

RmOptions,
StatFsOptions,
StatOptions,
StatFsOptions,
Stats,

@@ -44,4 +44,4 @@ StatsFs,

WriteVResult,
} from 'node:fs';
import { Interface as ReadlineInterface } from 'node:readline';
} from "node:fs";
import { Interface as ReadlineInterface } from "node:readline";
interface FileChangeInfo<T extends string | Buffer> {

@@ -87,2 +87,3 @@ eventType: WatchEventType;

start?: number | undefined;
highWaterMark?: number | undefined;
}

@@ -94,3 +95,3 @@ interface ReadableWebStreamOptions {

*/
type?: 'bytes' | undefined;
type?: "bytes" | undefined;
}

@@ -112,3 +113,6 @@ // TODO: Add `EventEmitter` close

*/
appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
appendFile(
data: string | Uint8Array,
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
): Promise<void>;
/**

@@ -230,3 +234,8 @@ * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).

*/
read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
read<T extends NodeJS.ArrayBufferView>(
buffer: T,
offset?: number | null,
length?: number | null,
position?: number | null,
): Promise<FileReadResult<T>>;
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;

@@ -276,3 +285,3 @@ /**

flag?: OpenMode | undefined;
} | null
} | null,
): Promise<Buffer>;

@@ -288,6 +297,6 @@ /**

| {
encoding: BufferEncoding;
flag?: OpenMode | undefined;
}
| BufferEncoding
encoding: BufferEncoding;
flag?: OpenMode | undefined;
}
| BufferEncoding,
): Promise<string>;

@@ -303,6 +312,6 @@ /**

| (ObjectEncodingOptions & {
flag?: OpenMode | undefined;
})
flag?: OpenMode | undefined;
})
| BufferEncoding
| null
| null,
): Promise<string | Buffer>;

@@ -332,3 +341,3 @@ /**

bigint?: false | undefined;
}
},
): Promise<Stats>;

@@ -338,3 +347,3 @@ stat(

bigint: true;
}
},
): Promise<BigIntStats>;

@@ -394,3 +403,6 @@ stat(opts?: StatOptions): Promise<Stats | BigIntStats>;

*/
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
writeFile(
data: string | Uint8Array,
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
): Promise<void>;
/**

@@ -418,3 +430,3 @@ * Write `buffer` to the file.

length?: number | null,
position?: number | null
position?: number | null,
): Promise<{

@@ -427,3 +439,3 @@ bytesWritten: number;

position?: number | null,
encoding?: BufferEncoding | null
encoding?: BufferEncoding | null,
): Promise<{

@@ -474,2 +486,7 @@ bytesWritten: number;

close(): Promise<void>;
/**
* An alias for {@link FileHandle.close()}.
* @since v20.4.0
*/
[Symbol.asyncDispose](): Promise<void>;
}

@@ -615,3 +632,3 @@ const constants: typeof fsConstants;

recursive: true;
}
},
): Promise<string | undefined>;

@@ -629,5 +646,5 @@ /**

| (MakeDirectoryOptions & {
recursive?: false | undefined;
})
| null
recursive?: false | undefined;
})
| null,
): Promise<void>;

@@ -669,7 +686,7 @@ /**

| (ObjectEncodingOptions & {
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
| BufferEncoding
| null
| null,
): Promise<string[]>;

@@ -685,7 +702,7 @@ /**

| {
encoding: 'buffer';
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
}
| 'buffer'
encoding: "buffer";
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
}
| "buffer",
): Promise<Buffer[]>;

@@ -701,7 +718,7 @@ /**

| (ObjectEncodingOptions & {
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
| BufferEncoding
| null
| null,
): Promise<string[] | Buffer[]>;

@@ -718,3 +735,3 @@ /**

recursive?: boolean | undefined;
}
},
): Promise<Dirent[]>;

@@ -770,3 +787,3 @@ /**

bigint?: false | undefined;
}
},
): Promise<Stats>;

@@ -777,3 +794,3 @@ function lstat(

bigint: true;
}
},
): Promise<BigIntStats>;

@@ -789,3 +806,3 @@ function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;

bigint?: false | undefined;
}
},
): Promise<Stats>;

@@ -796,3 +813,3 @@ function stat(

bigint: true;
}
},
): Promise<BigIntStats>;

@@ -808,3 +825,3 @@ function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;

bigint?: false | undefined;
}
},
): Promise<StatsFs>;

@@ -815,3 +832,3 @@ function statfs(

bigint: true;
}
},
): Promise<BigIntStatsFs>;

@@ -907,3 +924,6 @@ function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;

*/
function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
function realpath(
path: PathLike,
options?: ObjectEncodingOptions | BufferEncoding | null,
): Promise<string | Buffer>;
/**

@@ -1003,10 +1023,15 @@ * Creates a unique temporary directory. A unique directory name is generated by

file: PathLike | FileHandle,
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
data:
| string
| NodeJS.ArrayBufferView
| Iterable<string | NodeJS.ArrayBufferView>
| AsyncIterable<string | NodeJS.ArrayBufferView>
| Stream,
options?:
| (ObjectEncodingOptions & {
mode?: Mode | undefined;
flag?: OpenMode | undefined;
} & Abortable)
mode?: Mode | undefined;
flag?: OpenMode | undefined;
} & Abortable)
| BufferEncoding
| null
| null,
): Promise<void>;

@@ -1027,3 +1052,7 @@ /**

*/
function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
function appendFile(
path: PathLike | FileHandle,
data: string | Uint8Array,
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
): Promise<void>;
/**

@@ -1089,6 +1118,6 @@ * Asynchronously reads the entire contents of a file.

| ({
encoding?: null | undefined;
flag?: OpenMode | undefined;
} & Abortable)
| null
encoding?: null | undefined;
flag?: OpenMode | undefined;
} & Abortable)
| null,
): Promise<Buffer>;

@@ -1106,6 +1135,6 @@ /**

| ({
encoding: BufferEncoding;
flag?: OpenMode | undefined;
} & Abortable)
| BufferEncoding
encoding: BufferEncoding;
flag?: OpenMode | undefined;
} & Abortable)
| BufferEncoding,
): Promise<string>;

@@ -1122,8 +1151,11 @@ /**

options?:
| (ObjectEncodingOptions &
Abortable & {
flag?: OpenMode | undefined;
})
| (
& ObjectEncodingOptions
& Abortable
& {
flag?: OpenMode | undefined;
}
)
| BufferEncoding
| null
| null,
): Promise<string | Buffer>;

@@ -1193,5 +1225,5 @@ /**

| (WatchOptions & {
encoding: 'buffer';
})
| 'buffer'
encoding: "buffer";
})
| "buffer",
): AsyncIterable<FileChangeInfo<Buffer>>;

@@ -1215,3 +1247,6 @@ /**

*/
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
function watch(
filename: PathLike,
options: WatchOptions | string,
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
/**

@@ -1231,4 +1266,4 @@ * Asynchronously copies the entire directory structure from `src` to `dest`,

}
declare module 'node:fs/promises' {
export * from 'fs/promises';
declare module "node:fs/promises" {
export * from "fs/promises";
}

@@ -23,5 +23,5 @@ // Declare "static" methods in Error

// For backwards compability
interface NodeRequire extends NodeJS.Require { }
interface RequireResolve extends NodeJS.RequireResolve { }
interface NodeModule extends NodeJS.Module { }
interface NodeRequire extends NodeJS.Require {}
interface RequireResolve extends NodeJS.RequireResolve {}
interface NodeModule extends NodeJS.Module {}

@@ -45,3 +45,3 @@ declare var process: NodeJS.Process;

//#region borrowed
// #region borrowed
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib

@@ -72,4 +72,3 @@ /** A controller object that allows you to abort one or more DOM requests as and when desired. */

declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T}
? T
declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
: {

@@ -80,4 +79,3 @@ prototype: AbortController;

declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T}
? T
declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
: {

@@ -89,5 +87,27 @@ prototype: AbortSignal;

};
//#endregion borrowed
// #endregion borrowed
//#region ArrayLike.at()
// #region Disposable
interface SymbolConstructor {
/**
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
*/
readonly dispose: unique symbol;
/**
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
*/
readonly asyncDispose: unique symbol;
}
interface Disposable {
[Symbol.dispose](): void;
}
interface AsyncDisposable {
[Symbol.asyncDispose](): PromiseLike<void>;
}
// #endregion Disposable
// #region ArrayLike.at()
interface RelativeIndexable<T> {

@@ -115,3 +135,3 @@ /**

interface BigUint64Array extends RelativeIndexable<bigint> {}
//#endregion ArrayLike.at() end
// #endregion ArrayLike.at() end

@@ -125,3 +145,3 @@ /**

value: T,
transfer?: { transfer: ReadonlyArray<import('worker_threads').TransferListItem> },
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
): T;

@@ -223,3 +243,3 @@

isPaused(): boolean;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
unpipe(destination?: WritableStream): this;

@@ -240,3 +260,3 @@ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;

interface ReadWriteStream extends ReadableStream, WritableStream { }
interface ReadWriteStream extends ReadableStream, WritableStream {}

@@ -274,3 +294,3 @@ interface RefCounted {

interface RequireResolve {
(id: string, options?: { paths?: string[] | undefined; }): string;
(id: string, options?: { paths?: string[] | undefined }): string;
paths(request: string): string[] | null;

@@ -280,5 +300,5 @@ }

interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
'.js': (m: Module, filename: string) => any;
'.json': (m: Module, filename: string) => any;
'.node': (m: Module, filename: string) => any;
".js": (m: Module, filename: string) => any;
".json": (m: Module, filename: string) => any;
".node": (m: Module, filename: string) => any;
}

@@ -314,2 +334,60 @@ interface Module {

}
namespace fetch {
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
: import("undici-types").RequestInit;
type Request = globalThis.Request;
type Response = globalThis.Response;
type Headers = globalThis.Headers;
type FormData = globalThis.FormData;
type RequestInit = globalThis.RequestInit;
type RequestInfo = import("undici-types").RequestInfo;
type HeadersInit = import("undici-types").HeadersInit;
type BodyInit = import("undici-types").BodyInit;
type RequestRedirect = import("undici-types").RequestRedirect;
type RequestCredentials = import("undici-types").RequestCredentials;
type RequestMode = import("undici-types").RequestMode;
type ReferrerPolicy = import("undici-types").ReferrerPolicy;
type Dispatcher = import("undici-types").Dispatcher;
type RequestDuplex = import("undici-types").RequestDuplex;
}
}
interface RequestInit extends NodeJS.fetch._RequestInit {}
declare function fetch(
input: NodeJS.fetch.RequestInfo,
init?: RequestInit,
): Promise<Response>;
interface Request extends NodeJS.fetch._Request {}
declare var Request: typeof globalThis extends {
onmessage: any;
Request: infer T;
} ? T
: typeof import("undici-types").Request;
interface Response extends NodeJS.fetch._Response {}
declare var Response: typeof globalThis extends {
onmessage: any;
Response: infer T;
} ? T
: typeof import("undici-types").Response;
interface FormData extends NodeJS.fetch._FormData {}
declare var FormData: typeof globalThis extends {
onmessage: any;
FormData: infer T;
} ? T
: typeof import("undici-types").FormData;
interface Headers extends NodeJS.fetch._Headers {}
declare var Headers: typeof globalThis extends {
onmessage: any;
Headers: infer T;
} ? T
: typeof import("undici-types").Headers;

@@ -6,7 +6,7 @@ /**

*/
declare module 'https' {
import { Duplex } from 'node:stream';
import * as tls from 'node:tls';
import * as http from 'node:http';
import { URL } from 'node:url';
declare module "https" {
import { Duplex } from "node:stream";
import * as tls from "node:tls";
import * as http from "node:http";
import { URL } from "node:url";
type ServerOptions<

@@ -16,4 +16,6 @@ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,

> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
type RequestOptions = http.RequestOptions &
tls.SecureContextOptions & {
type RequestOptions =
& http.RequestOptions
& tls.SecureContextOptions
& {
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;

@@ -63,121 +65,214 @@ rejectUnauthorized?: boolean | undefined; // Defaults to true

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'connection', listener: (socket: Duplex) => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'listening', listener: () => void): this;
addListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
addListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
addListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
addListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
addListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
addListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
addListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
addListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connection", listener: (socket: Duplex) => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
addListener(
event: "connect",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
addListener(
event: "upgrade",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
emit(event: string, ...args: any[]): boolean;
emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean;
emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean;
emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean;
emit(event: 'close'): boolean;
emit(event: 'connection', socket: Duplex): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'listening'): boolean;
emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
emit(
event: 'checkContinue',
event: "newSession",
sessionId: Buffer,
sessionData: Buffer,
callback: (err: Error, resp: Buffer) => void,
): boolean;
emit(
event: "OCSPRequest",
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
): boolean;
emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
emit(event: "close"): boolean;
emit(event: "connection", socket: Duplex): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(
event: "checkContinue",
req: InstanceType<Request>,
res: InstanceType<Response> & {
req: InstanceType<Request>;
}
},
): boolean;
emit(
event: 'checkExpectation',
event: "checkExpectation",
req: InstanceType<Request>,
res: InstanceType<Response> & {
req: InstanceType<Request>;
}
},
): boolean;
emit(event: 'clientError', err: Error, socket: Duplex): boolean;
emit(event: 'connect', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
emit(event: "clientError", err: Error, socket: Duplex): boolean;
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
emit(
event: 'request',
event: "request",
req: InstanceType<Request>,
res: InstanceType<Response> & {
req: InstanceType<Request>;
}
},
): boolean;
emit(event: 'upgrade', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'connection', listener: (socket: Duplex) => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'listening', listener: () => void): this;
on(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
on(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
on(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
on(event: 'request', listener: http.RequestListener<Request, Response>): this;
on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
on(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
on(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
on(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connection", listener: (socket: Duplex) => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
on(event: "request", listener: http.RequestListener<Request, Response>): this;
on(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'connection', listener: (socket: Duplex) => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'listening', listener: () => void): this;
once(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
once(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
once(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: 'request', listener: http.RequestListener<Request, Response>): this;
once(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
once(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
once(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
once(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connection", listener: (socket: Duplex) => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: "request", listener: http.RequestListener<Request, Response>): this;
once(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'connection', listener: (socket: Duplex) => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'listening', listener: () => void): this;
prependListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
prependListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
prependListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
prependListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
prependListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connection", listener: (socket: Duplex) => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
prependListener(
event: "connect",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
prependListener(
event: "upgrade",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'listening', listener: () => void): this;
prependOnceListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
prependOnceListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependOnceListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
prependOnceListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependOnceListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
prependOnceListener(
event: "connect",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
prependOnceListener(
event: "upgrade",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
}

@@ -412,4 +507,11 @@ /**

*/
function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function request(
options: RequestOptions | string | URL,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
function request(
url: string | URL,
options: RequestOptions,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
/**

@@ -439,8 +541,15 @@ * Like `http.get()` but for HTTPS.

*/
function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function get(
options: RequestOptions | string | URL,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
function get(
url: string | URL,
options: RequestOptions,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
let globalAgent: Agent;
}
declare module 'node:https' {
export * from 'https';
declare module "node:https" {
export * from "https";
}

@@ -1,46 +0,1 @@

// Type definitions for non-npm package Node.js 20.4
// Project: https://nodejs.org/
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
// DefinitelyTyped <https://github.com/DefinitelyTyped>
// Alberto Schiabel <https://github.com/jkomyno>
// Alvis HT Tang <https://github.com/alvis>
// Andrew Makarov <https://github.com/r3nya>
// Benjamin Toueg <https://github.com/btoueg>
// Chigozirim C. <https://github.com/smac89>
// David Junger <https://github.com/touffy>
// Deividas Bakanas <https://github.com/DeividasBakanas>
// Eugene Y. Q. Shen <https://github.com/eyqs>
// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
// Huw <https://github.com/hoo29>
// Kelvin Jin <https://github.com/kjin>
// Klaus Meinhardt <https://github.com/ajafff>
// Lishude <https://github.com/islishude>
// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
// Mohsen Azimi <https://github.com/mohsen1>
// Nicolas Even <https://github.com/n-e>
// Nikita Galkin <https://github.com/galkin>
// Parambir Singh <https://github.com/parambirs>
// Sebastian Silbermann <https://github.com/eps1lon>
// Thomas den Hollander <https://github.com/ThomasdenH>
// Wilco Bakker <https://github.com/WilcoBakker>
// wwwy3y3 <https://github.com/wwwy3y3>
// Samuel Ainsworth <https://github.com/samuela>
// Kyle Uehlein <https://github.com/kuehlein>
// Thanik Bhongbhibhat <https://github.com/bhongy>
// Marcin Kopacz <https://github.com/chyzwar>
// Trivikram Kamat <https://github.com/trivikr>
// Junxiao Shi <https://github.com/yoursunny>
// Ilia Baryshnikov <https://github.com/qwelias>
// ExE Boss <https://github.com/ExE-Boss>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Anna Henningsen <https://github.com/addaleax>
// Victor Perin <https://github.com/victorperin>
// Yongsheng Zhang <https://github.com/ZYSzys>
// NodeJS Contributors <https://github.com/NodeJS>
// Linus Unnebäck <https://github.com/LinusU>
// wafuwafu13 <https://github.com/wafuwafu13>
// Matteo Collina <https://github.com/mcollina>
// Dmitry Semigradsky <https://github.com/Semigradsky>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**

@@ -47,0 +2,0 @@ * License for programmatically and manually incorporated

/**
* @since v0.3.7
* @experimental
*/
declare module 'module' {
import { URL } from 'node:url';
declare module "module" {
import { URL } from "node:url";
import { MessagePort } from "node:worker_threads";
namespace Module {

@@ -66,2 +68,20 @@ /**

}
interface SourceOrigin {
/**
* The name of the range in the source map, if one was provided
*/
name?: string;
/**
* The file name of the original source, as reported in the SourceMap
*/
fileName: string;
/**
* The 1-indexed lineNumber of the corresponding call site in the original source
*/
lineNumber: number;
/**
* The 1-indexed columnNumber of the corresponding call site in the original source
*/
columnNumber: number;
}
/**

@@ -95,4 +115,135 @@ * @since v13.7.0, v12.17.0

findEntry(lineOffset: number, columnOffset: number): SourceMapping;
/**
* Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source,
* find the corresponding call site location in the original source.
*
* If the `lineNumber` and `columnNumber` provided are not found in any source map,
* then an empty object is returned.
* @param lineNumber The 1-indexed line number of the call site in the generated source
* @param columnNumber The 1-indexed column number of the call site in the generated source
*/
findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {};
}
interface ImportAssertions extends NodeJS.Dict<string> {
type?: string | undefined;
}
type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm";
type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
interface GlobalPreloadContext {
port: MessagePort;
}
/**
* @deprecated This hook will be removed in a future version.
* Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored.
*
* Sometimes it might be necessary to run some code inside of the same global scope that the application runs in.
* This hook allows the return of a string that is run as a sloppy-mode script on startup.
*
* @param context Information to assist the preload code
* @return Code to run before application startup
*/
type GlobalPreloadHook = (context: GlobalPreloadContext) => string;
/**
* The `initialize` hook provides a way to define a custom function that runs in the hooks thread
* when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`.
*
* This hook can receive data from a `register` invocation, including ports and other transferrable objects.
* The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes.
*/
type InitializeHook<Data = any> = (data: Data) => void | Promise<void>;
interface ResolveHookContext {
/**
* Export conditions of the relevant `package.json`
*/
conditions: string[];
/**
* An object whose key-value pairs represent the assertions for the module to import
*/
importAssertions: ImportAssertions;
/**
* The module importing this one, or undefined if this is the Node.js entry point
*/
parentURL: string | undefined;
}
interface ResolveFnOutput {
/**
* A hint to the load hook (it might be ignored)
*/
format?: ModuleFormat | null | undefined;
/**
* The import assertions to use when caching the module (optional; if excluded the input will be used)
*/
importAssertions?: ImportAssertions | undefined;
/**
* A signal that this hook intends to terminate the chain of `resolve` hooks.
* @default false
*/
shortCircuit?: boolean | undefined;
/**
* The absolute URL to which this input resolves
*/
url: string;
}
/**
* The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook.
* If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`);
* if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook.
*
* @param specifier The specified URL path of the module to be resolved
* @param context
* @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook
*/
type ResolveHook = (
specifier: string,
context: ResolveHookContext,
nextResolve: (
specifier: string,
context?: ResolveHookContext,
) => ResolveFnOutput | Promise<ResolveFnOutput>,
) => ResolveFnOutput | Promise<ResolveFnOutput>;
interface LoadHookContext {
/**
* Export conditions of the relevant `package.json`
*/
conditions: string[];
/**
* The format optionally supplied by the `resolve` hook chain
*/
format: ModuleFormat;
/**
* An object whose key-value pairs represent the assertions for the module to import
*/
importAssertions: ImportAssertions;
}
interface LoadFnOutput {
format: ModuleFormat;
/**
* A signal that this hook intends to terminate the chain of `resolve` hooks.
* @default false
*/
shortCircuit?: boolean | undefined;
/**
* The source for Node.js to evaluate
*/
source?: ModuleSource;
}
/**
* The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed.
* It is also in charge of validating the import assertion.
*
* @param url The URL/path of the module to be loaded
* @param context Metadata about the module
* @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook
*/
type LoadHook = (
url: string,
context: LoadHookContext,
nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>,
) => LoadFnOutput | Promise<LoadFnOutput>;
}
interface RegisterOptions<Data> {
parentURL: string | URL;
data?: Data | undefined;
transferList?: any[] | undefined;
}
interface Module extends NodeModule {}

@@ -106,2 +257,8 @@ class Module {

static Module: typeof Module;
static register<Data = any>(
specifier: string | URL,
parentURL?: string | URL,
options?: RegisterOptions<Data>,
): void;
static register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
constructor(id: string, parent?: Module);

@@ -113,4 +270,13 @@ }

/**
* @experimental
* This feature is only available with the `--experimental-import-meta-resolve`
* Provides a module-relative resolution function scoped to each module, returning
* the URL string.
*
* @since v20.6.0
*
* @param specifier The module specifier to resolve relative to the current module.
* @returns The absolute (`file:`) URL string for the resolved module.
*/
resolve(specifier: string): string;
/**
* This `parent` parameter is only used when the `--experimental-import-meta-resolve`
* command flag enabled.

@@ -121,7 +287,9 @@ *

*
* @param specified The module specifier to resolve relative to `parent`.
* @param parent The absolute parent module URL to resolve from. If none
* is specified, the value of `import.meta.url` is used as the default.
* @since v20.6.0
*
* @param specifier The module specifier to resolve relative to `parent`.
* @param parent The absolute parent module URL to resolve from.
* @returns The absolute (`file:`) URL string for the resolved module.
*/
resolve?(specified: string, parent?: string | URL): Promise<string>;
resolve(specifier: string, parent: string | URL): string;
}

@@ -131,5 +299,5 @@ }

}
declare module 'node:module' {
import module = require('module');
declare module "node:module" {
import module = require("module");
export = module;
}

@@ -15,7 +15,11 @@ /**

*/
declare module 'net' {
import * as stream from 'node:stream';
import { Abortable, EventEmitter } from 'node:events';
import * as dns from 'node:dns';
type LookupFunction = (hostname: string, options: dns.LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void) => void;
declare module "net" {
import * as stream from "node:stream";
import { Abortable, EventEmitter } from "node:events";
import * as dns from "node:dns";
type LookupFunction = (
hostname: string,
options: dns.LookupAllOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void,
) => void;
interface AddressInfo {

@@ -74,3 +78,3 @@ address: string;

type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed';
type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
/**

@@ -93,2 +97,8 @@ * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint

/**
* Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately.
* If the socket is still writable it implicitly calls `socket.end()`.
* @since v0.3.4
*/
destroySoon(): void;
/**
* Sends data on the socket. The second parameter specifies the encoding in the

@@ -237,2 +247,11 @@ * case of a string. It defaults to UTF8 encoding.

/**
* This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)`
* and it is an array of the addresses that have been attempted.
*
* Each address is a string in the form of `$IP:$PORT`.
* If the connection was successful, then the last address is the one that the socket is currently connected to.
* @since v19.4.0
*/
readonly autoSelectFamilyAttemptedAddresses: string[];
/**
* This property shows the number of characters buffered for writing. The buffer

@@ -360,61 +379,76 @@ * may contain strings whose length after encoding is not yet known. So this number

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: (hadError: boolean) => void): this;
addListener(event: 'connect', listener: () => void): this;
addListener(event: 'data', listener: (data: Buffer) => void): this;
addListener(event: 'drain', listener: () => void): this;
addListener(event: 'end', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
addListener(event: 'ready', listener: () => void): this;
addListener(event: 'timeout', listener: () => void): this;
addListener(event: "close", listener: (hadError: boolean) => void): this;
addListener(event: "connect", listener: () => void): this;
addListener(event: "data", listener: (data: Buffer) => void): this;
addListener(event: "drain", listener: () => void): this;
addListener(event: "end", listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
addListener(event: "ready", listener: () => void): this;
addListener(event: "timeout", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close', hadError: boolean): boolean;
emit(event: 'connect'): boolean;
emit(event: 'data', data: Buffer): boolean;
emit(event: 'drain'): boolean;
emit(event: 'end'): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean;
emit(event: 'ready'): boolean;
emit(event: 'timeout'): boolean;
emit(event: "close", hadError: boolean): boolean;
emit(event: "connect"): boolean;
emit(event: "data", data: Buffer): boolean;
emit(event: "drain"): boolean;
emit(event: "end"): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
emit(event: "ready"): boolean;
emit(event: "timeout"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: (hadError: boolean) => void): this;
on(event: 'connect', listener: () => void): this;
on(event: 'data', listener: (data: Buffer) => void): this;
on(event: 'drain', listener: () => void): this;
on(event: 'end', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
on(event: 'ready', listener: () => void): this;
on(event: 'timeout', listener: () => void): this;
on(event: "close", listener: (hadError: boolean) => void): this;
on(event: "connect", listener: () => void): this;
on(event: "data", listener: (data: Buffer) => void): this;
on(event: "drain", listener: () => void): this;
on(event: "end", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
on(event: "ready", listener: () => void): this;
on(event: "timeout", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: (hadError: boolean) => void): this;
once(event: 'connect', listener: () => void): this;
once(event: 'data', listener: (data: Buffer) => void): this;
once(event: 'drain', listener: () => void): this;
once(event: 'end', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
once(event: 'ready', listener: () => void): this;
once(event: 'timeout', listener: () => void): this;
once(event: "close", listener: (hadError: boolean) => void): this;
once(event: "connect", listener: () => void): this;
once(event: "data", listener: (data: Buffer) => void): this;
once(event: "drain", listener: () => void): this;
once(event: "end", listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
once(event: "ready", listener: () => void): this;
once(event: "timeout", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: (hadError: boolean) => void): this;
prependListener(event: 'connect', listener: () => void): this;
prependListener(event: 'data', listener: (data: Buffer) => void): this;
prependListener(event: 'drain', listener: () => void): this;
prependListener(event: 'end', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
prependListener(event: 'ready', listener: () => void): this;
prependListener(event: 'timeout', listener: () => void): this;
prependListener(event: "close", listener: (hadError: boolean) => void): this;
prependListener(event: "connect", listener: () => void): this;
prependListener(event: "data", listener: (data: Buffer) => void): this;
prependListener(event: "drain", listener: () => void): this;
prependListener(event: "end", listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
prependListener(event: "ready", listener: () => void): this;
prependListener(event: "timeout", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this;
prependOnceListener(event: 'connect', listener: () => void): this;
prependOnceListener(event: 'data', listener: (data: Buffer) => void): this;
prependOnceListener(event: 'drain', listener: () => void): this;
prependOnceListener(event: 'end', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
prependOnceListener(event: 'ready', listener: () => void): this;
prependOnceListener(event: 'timeout', listener: () => void): this;
prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
prependOnceListener(event: "connect", listener: () => void): this;
prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
prependOnceListener(event: "drain", listener: () => void): this;
prependOnceListener(event: "end", listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
prependOnceListener(event: "ready", listener: () => void): this;
prependOnceListener(event: "timeout", listener: () => void): this;
}

@@ -612,39 +646,44 @@ interface ListenOptions extends Abortable {

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'connection', listener: (socket: Socket) => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'listening', listener: () => void): this;
addListener(event: 'drop', listener: (data?: DropArgument) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connection", listener: (socket: Socket) => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "drop", listener: (data?: DropArgument) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'connection', socket: Socket): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'listening'): boolean;
emit(event: 'drop', data?: DropArgument): boolean;
emit(event: "close"): boolean;
emit(event: "connection", socket: Socket): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(event: "drop", data?: DropArgument): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'connection', listener: (socket: Socket) => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'listening', listener: () => void): this;
on(event: 'drop', listener: (data?: DropArgument) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connection", listener: (socket: Socket) => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "drop", listener: (data?: DropArgument) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'connection', listener: (socket: Socket) => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'listening', listener: () => void): this;
once(event: 'drop', listener: (data?: DropArgument) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connection", listener: (socket: Socket) => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "drop", listener: (data?: DropArgument) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'connection', listener: (socket: Socket) => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'listening', listener: () => void): this;
prependListener(event: 'drop', listener: (data?: DropArgument) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connection", listener: (socket: Socket) => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "drop", listener: (data?: DropArgument) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'listening', listener: () => void): this;
prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this;
/**
* Calls {@link Server.close()} and returns a promise that fulfills when the server has closed.
* @since v20.5.0
*/
[Symbol.asyncDispose](): Promise<void>;
}
type IPVersion = 'ipv4' | 'ipv6';
type IPVersion = "ipv4" | "ipv6";
/**

@@ -810,2 +849,24 @@ * The `BlockList` object can be used with some network APIs to specify rules for

/**
* Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`.
* The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided.
* @since v19.4.0
*/
function getDefaultAutoSelectFamily(): boolean;
/**
* Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`.
* @since v19.4.0
*/
function setDefaultAutoSelectFamily(value: boolean): void;
/**
* Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
* The initial default value is `250`.
* @since v19.8.0
*/
function getDefaultAutoSelectFamilyAttemptTimeout(): number;
/**
* Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
* @since v19.8.0
*/
function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void;
/**
* Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4

@@ -893,4 +954,4 @@ * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`.

}
declare module 'node:net' {
export * from 'net';
declare module "node:net" {
export * from "net";
}

@@ -10,3 +10,3 @@ /**

*/
declare module 'os' {
declare module "os" {
interface CpuInfo {

@@ -31,7 +31,7 @@ model: string;

interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
family: 'IPv4';
family: "IPv4";
scopeid?: undefined;
}
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
family: 'IPv6';
family: "IPv6";
scopeid: number;

@@ -43,3 +43,3 @@ }

gid: number;
shell: T;
shell: T | null;
homedir: T;

@@ -245,3 +245,3 @@ }

*/
function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;

@@ -407,3 +407,3 @@ type SignalConstants = {

* Returns the operating system CPU architecture for which the Node.js binary was
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
*

@@ -455,3 +455,3 @@ * The return value is equivalent to `process.arch`.

*/
function endianness(): 'BE' | 'LE';
function endianness(): "BE" | "LE";
/**

@@ -481,4 +481,4 @@ * Returns the scheduling priority for the process specified by `pid`. If `pid` is

}
declare module 'node:os' {
export * from 'os';
declare module "node:os" {
export * from "os";
}
{
"name": "@types/node",
"version": "20.4.10",
"description": "TypeScript definitions for Node.js",
"version": "20.8.10",
"description": "TypeScript definitions for node",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",

@@ -10,204 +10,199 @@ "license": "MIT",

"name": "Microsoft TypeScript",
"url": "https://github.com/Microsoft",
"githubUsername": "Microsoft"
"githubUsername": "Microsoft",
"url": "https://github.com/Microsoft"
},
{
"name": "DefinitelyTyped",
"url": "https://github.com/DefinitelyTyped",
"githubUsername": "DefinitelyTyped"
},
{
"name": "Alberto Schiabel",
"url": "https://github.com/jkomyno",
"githubUsername": "jkomyno"
"githubUsername": "jkomyno",
"url": "https://github.com/jkomyno"
},
{
"name": "Alvis HT Tang",
"url": "https://github.com/alvis",
"githubUsername": "alvis"
"githubUsername": "alvis",
"url": "https://github.com/alvis"
},
{
"name": "Andrew Makarov",
"url": "https://github.com/r3nya",
"githubUsername": "r3nya"
"githubUsername": "r3nya",
"url": "https://github.com/r3nya"
},
{
"name": "Benjamin Toueg",
"url": "https://github.com/btoueg",
"githubUsername": "btoueg"
"githubUsername": "btoueg",
"url": "https://github.com/btoueg"
},
{
"name": "Chigozirim C.",
"url": "https://github.com/smac89",
"githubUsername": "smac89"
"githubUsername": "smac89",
"url": "https://github.com/smac89"
},
{
"name": "David Junger",
"url": "https://github.com/touffy",
"githubUsername": "touffy"
"githubUsername": "touffy",
"url": "https://github.com/touffy"
},
{
"name": "Deividas Bakanas",
"url": "https://github.com/DeividasBakanas",
"githubUsername": "DeividasBakanas"
"githubUsername": "DeividasBakanas",
"url": "https://github.com/DeividasBakanas"
},
{
"name": "Eugene Y. Q. Shen",
"url": "https://github.com/eyqs",
"githubUsername": "eyqs"
"githubUsername": "eyqs",
"url": "https://github.com/eyqs"
},
{
"name": "Hannes Magnusson",
"url": "https://github.com/Hannes-Magnusson-CK",
"githubUsername": "Hannes-Magnusson-CK"
"githubUsername": "Hannes-Magnusson-CK",
"url": "https://github.com/Hannes-Magnusson-CK"
},
{
"name": "Huw",
"url": "https://github.com/hoo29",
"githubUsername": "hoo29"
"githubUsername": "hoo29",
"url": "https://github.com/hoo29"
},
{
"name": "Kelvin Jin",
"url": "https://github.com/kjin",
"githubUsername": "kjin"
"githubUsername": "kjin",
"url": "https://github.com/kjin"
},
{
"name": "Klaus Meinhardt",
"url": "https://github.com/ajafff",
"githubUsername": "ajafff"
"githubUsername": "ajafff",
"url": "https://github.com/ajafff"
},
{
"name": "Lishude",
"url": "https://github.com/islishude",
"githubUsername": "islishude"
"githubUsername": "islishude",
"url": "https://github.com/islishude"
},
{
"name": "Mariusz Wiktorczyk",
"url": "https://github.com/mwiktorczyk",
"githubUsername": "mwiktorczyk"
"githubUsername": "mwiktorczyk",
"url": "https://github.com/mwiktorczyk"
},
{
"name": "Mohsen Azimi",
"url": "https://github.com/mohsen1",
"githubUsername": "mohsen1"
"githubUsername": "mohsen1",
"url": "https://github.com/mohsen1"
},
{
"name": "Nicolas Even",
"url": "https://github.com/n-e",
"githubUsername": "n-e"
"githubUsername": "n-e",
"url": "https://github.com/n-e"
},
{
"name": "Nikita Galkin",
"url": "https://github.com/galkin",
"githubUsername": "galkin"
"githubUsername": "galkin",
"url": "https://github.com/galkin"
},
{
"name": "Parambir Singh",
"url": "https://github.com/parambirs",
"githubUsername": "parambirs"
"githubUsername": "parambirs",
"url": "https://github.com/parambirs"
},
{
"name": "Sebastian Silbermann",
"url": "https://github.com/eps1lon",
"githubUsername": "eps1lon"
"githubUsername": "eps1lon",
"url": "https://github.com/eps1lon"
},
{
"name": "Thomas den Hollander",
"url": "https://github.com/ThomasdenH",
"githubUsername": "ThomasdenH"
"githubUsername": "ThomasdenH",
"url": "https://github.com/ThomasdenH"
},
{
"name": "Wilco Bakker",
"url": "https://github.com/WilcoBakker",
"githubUsername": "WilcoBakker"
"githubUsername": "WilcoBakker",
"url": "https://github.com/WilcoBakker"
},
{
"name": "wwwy3y3",
"url": "https://github.com/wwwy3y3",
"githubUsername": "wwwy3y3"
"githubUsername": "wwwy3y3",
"url": "https://github.com/wwwy3y3"
},
{
"name": "Samuel Ainsworth",
"url": "https://github.com/samuela",
"githubUsername": "samuela"
"githubUsername": "samuela",
"url": "https://github.com/samuela"
},
{
"name": "Kyle Uehlein",
"url": "https://github.com/kuehlein",
"githubUsername": "kuehlein"
"githubUsername": "kuehlein",
"url": "https://github.com/kuehlein"
},
{
"name": "Thanik Bhongbhibhat",
"url": "https://github.com/bhongy",
"githubUsername": "bhongy"
"githubUsername": "bhongy",
"url": "https://github.com/bhongy"
},
{
"name": "Marcin Kopacz",
"url": "https://github.com/chyzwar",
"githubUsername": "chyzwar"
"githubUsername": "chyzwar",
"url": "https://github.com/chyzwar"
},
{
"name": "Trivikram Kamat",
"url": "https://github.com/trivikr",
"githubUsername": "trivikr"
"githubUsername": "trivikr",
"url": "https://github.com/trivikr"
},
{
"name": "Junxiao Shi",
"url": "https://github.com/yoursunny",
"githubUsername": "yoursunny"
"githubUsername": "yoursunny",
"url": "https://github.com/yoursunny"
},
{
"name": "Ilia Baryshnikov",
"url": "https://github.com/qwelias",
"githubUsername": "qwelias"
"githubUsername": "qwelias",
"url": "https://github.com/qwelias"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss",
"githubUsername": "ExE-Boss"
"githubUsername": "ExE-Boss",
"url": "https://github.com/ExE-Boss"
},
{
"name": "Piotr Błażejewicz",
"url": "https://github.com/peterblazejewicz",
"githubUsername": "peterblazejewicz"
"githubUsername": "peterblazejewicz",
"url": "https://github.com/peterblazejewicz"
},
{
"name": "Anna Henningsen",
"url": "https://github.com/addaleax",
"githubUsername": "addaleax"
"githubUsername": "addaleax",
"url": "https://github.com/addaleax"
},
{
"name": "Victor Perin",
"url": "https://github.com/victorperin",
"githubUsername": "victorperin"
"githubUsername": "victorperin",
"url": "https://github.com/victorperin"
},
{
"name": "Yongsheng Zhang",
"url": "https://github.com/ZYSzys",
"githubUsername": "ZYSzys"
"githubUsername": "ZYSzys",
"url": "https://github.com/ZYSzys"
},
{
"name": "NodeJS Contributors",
"url": "https://github.com/NodeJS",
"githubUsername": "NodeJS"
"githubUsername": "NodeJS",
"url": "https://github.com/NodeJS"
},
{
"name": "Linus Unnebäck",
"url": "https://github.com/LinusU",
"githubUsername": "LinusU"
"githubUsername": "LinusU",
"url": "https://github.com/LinusU"
},
{
"name": "wafuwafu13",
"url": "https://github.com/wafuwafu13",
"githubUsername": "wafuwafu13"
"githubUsername": "wafuwafu13",
"url": "https://github.com/wafuwafu13"
},
{
"name": "Matteo Collina",
"url": "https://github.com/mcollina",
"githubUsername": "mcollina"
"githubUsername": "mcollina",
"url": "https://github.com/mcollina"
},
{
"name": "Dmitry Semigradsky",
"url": "https://github.com/Semigradsky",
"githubUsername": "Semigradsky"
"githubUsername": "Semigradsky",
"url": "https://github.com/Semigradsky"
}

@@ -230,5 +225,8 @@ ],

"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "ab8936d8ab7c8e19ee6116553fef5551d895d64cdaa027308b2a4f33e0c6c024",
"typeScriptVersion": "4.3"
"dependencies": {
"undici-types": "~5.26.4"
},
"typesPublisherContentHash": "16184642b8bb9cb6f84a0d6245e7b26fc0133a47f604465cfae9c1ace3eeb2ba",
"typeScriptVersion": "4.5",
"nonNpm": true
}

@@ -1,7 +0,7 @@

declare module 'path/posix' {
import path = require('path');
declare module "path/posix" {
import path = require("path");
export = path;
}
declare module 'path/win32' {
import path = require('path');
declare module "path/win32" {
import path = require("path");
export = path;

@@ -18,3 +18,3 @@ }

*/
declare module 'path' {
declare module "path" {
namespace path {

@@ -141,7 +141,7 @@ /**

*/
readonly sep: '\\' | '/';
readonly sep: "\\" | "/";
/**
* The platform-specific file delimiter. ';' or ':'.
*/
readonly delimiter: ';' | ':';
readonly delimiter: ";" | ":";
/**

@@ -182,13 +182,13 @@ * Returns an object from a path string - the opposite of format().

}
declare module 'node:path' {
import path = require('path');
declare module "node:path" {
import path = require("path");
export = path;
}
declare module 'node:path/posix' {
import path = require('path/posix');
declare module "node:path/posix" {
import path = require("path/posix");
export = path;
}
declare module 'node:path/win32' {
import path = require('path/win32');
declare module "node:path/win32" {
import path = require("path/win32");
export = path;
}

@@ -32,5 +32,5 @@ /**

*/
declare module 'perf_hooks' {
import { AsyncResource } from 'node:async_hooks';
type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http' | 'dns';
declare module "perf_hooks" {
import { AsyncResource } from "node:async_hooks";
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net";
interface NodeGCPerformanceDetail {

@@ -99,3 +99,3 @@ /**

readonly duration: 0;
readonly entryType: 'mark';
readonly entryType: "mark";
}

@@ -109,3 +109,3 @@ /**

class PerformanceMeasure extends PerformanceEntry {
readonly entryType: 'measure';
readonly entryType: "measure";
}

@@ -172,3 +172,6 @@ /**

*/
type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization;
type EventLoopUtilityFunction = (
util1?: EventLoopUtilization,
util2?: EventLoopUtilization,
) => EventLoopUtilization;
interface MarkOptions {

@@ -328,3 +331,2 @@ /**

*
*
* performance.clearMarks();

@@ -466,9 +468,9 @@ * performance.clearMeasures();

| {
entryTypes: ReadonlyArray<EntryType>;
buffered?: boolean | undefined;
}
entryTypes: ReadonlyArray<EntryType>;
buffered?: boolean | undefined;
}
| {
type: EntryType;
buffered?: boolean | undefined;
}
type: EntryType;
buffered?: boolean | undefined;
},
): void;

@@ -627,3 +629,3 @@ }

function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
import { performance as _performance } from 'perf_hooks';
import { performance as _performance } from "perf_hooks";
global {

@@ -638,9 +640,8 @@ /**

performance: infer T;
}
? T
} ? T
: typeof _performance;
}
}
declare module 'node:perf_hooks' {
export * from 'perf_hooks';
declare module "node:perf_hooks" {
export * from "perf_hooks";
}

@@ -29,3 +29,3 @@ /**

*/
declare module 'punycode' {
declare module "punycode" {
/**

@@ -116,4 +116,4 @@ * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only

}
declare module 'node:punycode' {
export * from 'punycode';
declare module "node:punycode" {
export * from "punycode";
}

@@ -14,3 +14,3 @@ /**

*/
declare module 'querystring' {
declare module "querystring" {
interface StringifyOptions {

@@ -24,3 +24,13 @@ encodeURIComponent?: ((str: string) => string) | undefined;

interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {}
interface ParsedUrlQueryInput extends
NodeJS.Dict<
| string
| number
| boolean
| ReadonlyArray<string>
| ReadonlyArray<number>
| ReadonlyArray<boolean>
| null
>
{}
/**

@@ -131,4 +141,4 @@ * The `querystring.stringify()` method produces a URL query string from a

}
declare module 'node:querystring' {
export * from 'querystring';
declare module "node:querystring" {
export * from "querystring";
}

@@ -35,5 +35,5 @@ /**

*/
declare module 'readline' {
import { Abortable, EventEmitter } from 'node:events';
import * as promises from 'node:readline/promises';
declare module "readline" {
import { Abortable, EventEmitter } from "node:events";
import * as promises from "node:readline/promises";
export { promises };

@@ -105,3 +105,8 @@ export interface Key {

*/
protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
protected constructor(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
);
/**

@@ -250,55 +255,55 @@ * NOTE: According to the documentation:

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'line', listener: (input: string) => void): this;
addListener(event: 'pause', listener: () => void): this;
addListener(event: 'resume', listener: () => void): this;
addListener(event: 'SIGCONT', listener: () => void): this;
addListener(event: 'SIGINT', listener: () => void): this;
addListener(event: 'SIGTSTP', listener: () => void): this;
addListener(event: 'history', listener: (history: string[]) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "line", listener: (input: string) => void): this;
addListener(event: "pause", listener: () => void): this;
addListener(event: "resume", listener: () => void): this;
addListener(event: "SIGCONT", listener: () => void): this;
addListener(event: "SIGINT", listener: () => void): this;
addListener(event: "SIGTSTP", listener: () => void): this;
addListener(event: "history", listener: (history: string[]) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'line', input: string): boolean;
emit(event: 'pause'): boolean;
emit(event: 'resume'): boolean;
emit(event: 'SIGCONT'): boolean;
emit(event: 'SIGINT'): boolean;
emit(event: 'SIGTSTP'): boolean;
emit(event: 'history', history: string[]): boolean;
emit(event: "close"): boolean;
emit(event: "line", input: string): boolean;
emit(event: "pause"): boolean;
emit(event: "resume"): boolean;
emit(event: "SIGCONT"): boolean;
emit(event: "SIGINT"): boolean;
emit(event: "SIGTSTP"): boolean;
emit(event: "history", history: string[]): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'line', listener: (input: string) => void): this;
on(event: 'pause', listener: () => void): this;
on(event: 'resume', listener: () => void): this;
on(event: 'SIGCONT', listener: () => void): this;
on(event: 'SIGINT', listener: () => void): this;
on(event: 'SIGTSTP', listener: () => void): this;
on(event: 'history', listener: (history: string[]) => void): this;
on(event: "close", listener: () => void): this;
on(event: "line", listener: (input: string) => void): this;
on(event: "pause", listener: () => void): this;
on(event: "resume", listener: () => void): this;
on(event: "SIGCONT", listener: () => void): this;
on(event: "SIGINT", listener: () => void): this;
on(event: "SIGTSTP", listener: () => void): this;
on(event: "history", listener: (history: string[]) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'line', listener: (input: string) => void): this;
once(event: 'pause', listener: () => void): this;
once(event: 'resume', listener: () => void): this;
once(event: 'SIGCONT', listener: () => void): this;
once(event: 'SIGINT', listener: () => void): this;
once(event: 'SIGTSTP', listener: () => void): this;
once(event: 'history', listener: (history: string[]) => void): this;
once(event: "close", listener: () => void): this;
once(event: "line", listener: (input: string) => void): this;
once(event: "pause", listener: () => void): this;
once(event: "resume", listener: () => void): this;
once(event: "SIGCONT", listener: () => void): this;
once(event: "SIGINT", listener: () => void): this;
once(event: "SIGTSTP", listener: () => void): this;
once(event: "history", listener: (history: string[]) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'line', listener: (input: string) => void): this;
prependListener(event: 'pause', listener: () => void): this;
prependListener(event: 'resume', listener: () => void): this;
prependListener(event: 'SIGCONT', listener: () => void): this;
prependListener(event: 'SIGINT', listener: () => void): this;
prependListener(event: 'SIGTSTP', listener: () => void): this;
prependListener(event: 'history', listener: (history: string[]) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "line", listener: (input: string) => void): this;
prependListener(event: "pause", listener: () => void): this;
prependListener(event: "resume", listener: () => void): this;
prependListener(event: "SIGCONT", listener: () => void): this;
prependListener(event: "SIGINT", listener: () => void): this;
prependListener(event: "SIGTSTP", listener: () => void): this;
prependListener(event: "history", listener: (history: string[]) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'line', listener: (input: string) => void): this;
prependOnceListener(event: 'pause', listener: () => void): this;
prependOnceListener(event: 'resume', listener: () => void): this;
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
prependOnceListener(event: 'SIGINT', listener: () => void): this;
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
prependOnceListener(event: 'history', listener: (history: string[]) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "line", listener: (input: string) => void): this;
prependOnceListener(event: "pause", listener: () => void): this;
prependOnceListener(event: "resume", listener: () => void): this;
prependOnceListener(event: "SIGCONT", listener: () => void): this;
prependOnceListener(event: "SIGINT", listener: () => void): this;
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
[Symbol.asyncIterator](): AsyncIterableIterator<string>;

@@ -308,3 +313,6 @@ }

export type Completer = (line: string) => CompleterResult;
export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
export type AsyncCompleter = (
line: string,
callback: (err?: null | Error, result?: CompleterResult) => void,
) => void;
export type CompleterResult = [string[], string];

@@ -366,3 +374,8 @@ export interface ReadLineOptions {

*/
export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
export function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
): Interface;
export function createInterface(options: ReadLineOptions): Interface;

@@ -529,4 +542,4 @@ /**

}
declare module 'node:readline' {
export * from 'readline';
declare module "node:readline" {
export * from "readline";
}

@@ -5,5 +5,5 @@ /**

*/
declare module 'readline/promises' {
import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline';
import { Abortable } from 'node:events';
declare module "readline/promises" {
import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
import { Abortable } from "node:events";
/**

@@ -65,3 +65,3 @@ * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a

autoCommit?: boolean;
}
},
);

@@ -142,7 +142,12 @@ /**

*/
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
): Interface;
function createInterface(options: ReadLineOptions): Interface;
}
declare module 'node:readline/promises' {
export * from 'readline/promises';
declare module "node:readline/promises" {
export * from "readline/promises";
}

@@ -5,3 +5,3 @@ # Installation

# Summary
This package contains type definitions for Node.js (https://nodejs.org/).
This package contains type definitions for node (https://nodejs.org/).

@@ -12,7 +12,6 @@ # Details

### Additional Details
* Last updated: Fri, 11 Aug 2023 19:32:47 GMT
* Dependencies: none
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
* Last updated: Tue, 31 Oct 2023 08:42:08 GMT
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
# Credits
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).

@@ -11,6 +11,6 @@ /**

*/
declare module 'repl' {
import { Interface, Completer, AsyncCompleter } from 'node:readline';
import { Context } from 'node:vm';
import { InspectOptions } from 'node:util';
declare module "repl" {
import { AsyncCompleter, Completer, Interface } from "node:readline";
import { Context } from "node:vm";
import { InspectOptions } from "node:util";
interface ReplOptions {

@@ -103,3 +103,9 @@ /**

}
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
type REPLEval = (
this: REPLServer,
evalCmd: string,
context: Context,
file: string,
cb: (err: Error | null, result: any) => void,
) => void;
type REPLWriter = (this: REPLServer, obj: any) => string;

@@ -331,61 +337,61 @@ /**

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'line', listener: (input: string) => void): this;
addListener(event: 'pause', listener: () => void): this;
addListener(event: 'resume', listener: () => void): this;
addListener(event: 'SIGCONT', listener: () => void): this;
addListener(event: 'SIGINT', listener: () => void): this;
addListener(event: 'SIGTSTP', listener: () => void): this;
addListener(event: 'exit', listener: () => void): this;
addListener(event: 'reset', listener: (context: Context) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "line", listener: (input: string) => void): this;
addListener(event: "pause", listener: () => void): this;
addListener(event: "resume", listener: () => void): this;
addListener(event: "SIGCONT", listener: () => void): this;
addListener(event: "SIGINT", listener: () => void): this;
addListener(event: "SIGTSTP", listener: () => void): this;
addListener(event: "exit", listener: () => void): this;
addListener(event: "reset", listener: (context: Context) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'line', input: string): boolean;
emit(event: 'pause'): boolean;
emit(event: 'resume'): boolean;
emit(event: 'SIGCONT'): boolean;
emit(event: 'SIGINT'): boolean;
emit(event: 'SIGTSTP'): boolean;
emit(event: 'exit'): boolean;
emit(event: 'reset', context: Context): boolean;
emit(event: "close"): boolean;
emit(event: "line", input: string): boolean;
emit(event: "pause"): boolean;
emit(event: "resume"): boolean;
emit(event: "SIGCONT"): boolean;
emit(event: "SIGINT"): boolean;
emit(event: "SIGTSTP"): boolean;
emit(event: "exit"): boolean;
emit(event: "reset", context: Context): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'line', listener: (input: string) => void): this;
on(event: 'pause', listener: () => void): this;
on(event: 'resume', listener: () => void): this;
on(event: 'SIGCONT', listener: () => void): this;
on(event: 'SIGINT', listener: () => void): this;
on(event: 'SIGTSTP', listener: () => void): this;
on(event: 'exit', listener: () => void): this;
on(event: 'reset', listener: (context: Context) => void): this;
on(event: "close", listener: () => void): this;
on(event: "line", listener: (input: string) => void): this;
on(event: "pause", listener: () => void): this;
on(event: "resume", listener: () => void): this;
on(event: "SIGCONT", listener: () => void): this;
on(event: "SIGINT", listener: () => void): this;
on(event: "SIGTSTP", listener: () => void): this;
on(event: "exit", listener: () => void): this;
on(event: "reset", listener: (context: Context) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'line', listener: (input: string) => void): this;
once(event: 'pause', listener: () => void): this;
once(event: 'resume', listener: () => void): this;
once(event: 'SIGCONT', listener: () => void): this;
once(event: 'SIGINT', listener: () => void): this;
once(event: 'SIGTSTP', listener: () => void): this;
once(event: 'exit', listener: () => void): this;
once(event: 'reset', listener: (context: Context) => void): this;
once(event: "close", listener: () => void): this;
once(event: "line", listener: (input: string) => void): this;
once(event: "pause", listener: () => void): this;
once(event: "resume", listener: () => void): this;
once(event: "SIGCONT", listener: () => void): this;
once(event: "SIGINT", listener: () => void): this;
once(event: "SIGTSTP", listener: () => void): this;
once(event: "exit", listener: () => void): this;
once(event: "reset", listener: (context: Context) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'line', listener: (input: string) => void): this;
prependListener(event: 'pause', listener: () => void): this;
prependListener(event: 'resume', listener: () => void): this;
prependListener(event: 'SIGCONT', listener: () => void): this;
prependListener(event: 'SIGINT', listener: () => void): this;
prependListener(event: 'SIGTSTP', listener: () => void): this;
prependListener(event: 'exit', listener: () => void): this;
prependListener(event: 'reset', listener: (context: Context) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "line", listener: (input: string) => void): this;
prependListener(event: "pause", listener: () => void): this;
prependListener(event: "resume", listener: () => void): this;
prependListener(event: "SIGCONT", listener: () => void): this;
prependListener(event: "SIGINT", listener: () => void): this;
prependListener(event: "SIGTSTP", listener: () => void): this;
prependListener(event: "exit", listener: () => void): this;
prependListener(event: "reset", listener: (context: Context) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'line', listener: (input: string) => void): this;
prependOnceListener(event: 'pause', listener: () => void): this;
prependOnceListener(event: 'resume', listener: () => void): this;
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
prependOnceListener(event: 'SIGINT', listener: () => void): this;
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
prependOnceListener(event: 'exit', listener: () => void): this;
prependOnceListener(event: 'reset', listener: (context: Context) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "line", listener: (input: string) => void): this;
prependOnceListener(event: "pause", listener: () => void): this;
prependOnceListener(event: "resume", listener: () => void): this;
prependOnceListener(event: "SIGCONT", listener: () => void): this;
prependOnceListener(event: "SIGINT", listener: () => void): this;
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
prependOnceListener(event: "exit", listener: () => void): this;
prependOnceListener(event: "reset", listener: (context: Context) => void): this;
}

@@ -425,4 +431,4 @@ /**

}
declare module 'node:repl' {
export * from 'repl';
declare module "node:repl" {
export * from "repl";
}

@@ -1,12 +0,12 @@

declare module 'stream/consumers' {
import { Blob as NodeBlob } from 'node:buffer';
import { Readable } from 'node:stream';
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<NodeBlob>;
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
declare module "stream/consumers" {
import { Blob as NodeBlob } from "node:buffer";
import { Readable } from "node:stream";
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
}
declare module 'node:stream/consumers' {
export * from 'stream/consumers';
declare module "node:stream/consumers" {
export * from "stream/consumers";
}

@@ -1,12 +0,35 @@

declare module 'stream/promises' {
import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream';
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
declare module "stream/promises" {
import {
FinishedOptions,
PipelineDestination,
PipelineOptions,
PipelinePromise,
PipelineSource,
PipelineTransform,
} from "node:stream";
function finished(
stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
options?: FinishedOptions,
): Promise<void>;
function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
source: A,
destination: B,
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline<
A extends PipelineSource<any>,
T1 extends PipelineTransform<A, any>,
B extends PipelineDestination<T1, any>,
>(
source: A,
transform1: T1,
destination: B,
options?: PipelineOptions
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
function pipeline<
A extends PipelineSource<any>,
T1 extends PipelineTransform<A, any>,
T2 extends PipelineTransform<T1, any>,
B extends PipelineDestination<T2, any>,
>(
source: A,

@@ -16,3 +39,3 @@ transform1: T1,

destination: B,
options?: PipelineOptions
options?: PipelineOptions,
): PipelinePromise<B>;

@@ -24,4 +47,11 @@ function pipeline<

T3 extends PipelineTransform<T2, any>,
B extends PipelineDestination<T3, any>
>(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
B extends PipelineDestination<T3, any>,
>(
source: A,
transform1: T1,
transform2: T2,
transform3: T3,
destination: B,
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline<

@@ -33,6 +63,17 @@ A extends PipelineSource<any>,

T4 extends PipelineTransform<T3, any>,
B extends PipelineDestination<T4, any>
>(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
function pipeline(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
B extends PipelineDestination<T4, any>,
>(
source: A,
transform1: T1,
transform2: T2,
transform3: T3,
transform4: T4,
destination: B,
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline(
streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
options?: PipelineOptions,
): Promise<void>;
function pipeline(
stream1: NodeJS.ReadableStream,

@@ -43,4 +84,4 @@ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,

}
declare module 'node:stream/promises' {
export * from 'stream/promises';
declare module "node:stream/promises" {
export * from "stream/promises";
}

@@ -1,2 +0,2 @@

declare module 'stream/web' {
declare module "stream/web" {
// stub module, pending copy&paste from .d.ts or manual impl

@@ -77,3 +77,14 @@ // copy from lib.dom.d.ts

type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
type ReadableStreamDefaultReadResult<T> =
| ReadableStreamDefaultReadValueResult<T>
| ReadableStreamDefaultReadDoneResult;
interface ReadableStreamReadValueResult<T> {
done: false;
value: T;
}
interface ReadableStreamReadDoneResult<T> {
done: true;
value?: T;
}
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
interface ReadableByteStreamControllerCallback {

@@ -117,3 +128,3 @@ (controller: ReadableByteStreamController): void | PromiseLike<void>;

start?: ReadableByteStreamControllerCallback;
type: 'bytes';
type: "bytes";
}

@@ -141,2 +152,3 @@ interface UnderlyingSource<R = any> {

getReader(): ReadableStreamDefaultReader<R>;
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;

@@ -150,4 +162,4 @@ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;

prototype: ReadableStream;
new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
};

@@ -158,5 +170,9 @@ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {

}
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
releaseLock(): void;
}
const ReadableStreamDefaultReader: {
prototype: ReadableStreamDefaultReader;
new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
};

@@ -174,3 +190,3 @@ const ReadableStreamBYOBReader: any;

prototype: ReadableByteStreamController;
new (): ReadableByteStreamController;
new(): ReadableByteStreamController;
};

@@ -185,3 +201,3 @@ interface ReadableStreamDefaultController<R = any> {

prototype: ReadableStreamDefaultController;
new (): ReadableStreamDefaultController;
new(): ReadableStreamDefaultController;
};

@@ -201,3 +217,7 @@ interface Transformer<I = any, O = any> {

prototype: TransformStream;
new <I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;
new<I = any, O = any>(
transformer?: Transformer<I, O>,
writableStrategy?: QueuingStrategy<I>,
readableStrategy?: QueuingStrategy<O>,
): TransformStream<I, O>;
};

@@ -212,3 +232,3 @@ interface TransformStreamDefaultController<O = any> {

prototype: TransformStreamDefaultController;
new (): TransformStreamDefaultController;
new(): TransformStreamDefaultController;
};

@@ -228,3 +248,3 @@ /**

prototype: WritableStream;
new <W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
};

@@ -248,3 +268,3 @@ /**

prototype: WritableStreamDefaultWriter;
new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
};

@@ -262,3 +282,3 @@ /**

prototype: WritableStreamDefaultController;
new (): WritableStreamDefaultController;
new(): WritableStreamDefaultController;
};

@@ -294,3 +314,3 @@ interface QueuingStrategy<T = any> {

prototype: ByteLengthQueuingStrategy;
new (init: QueuingStrategyInit): ByteLengthQueuingStrategy;
new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
};

@@ -307,7 +327,7 @@ /**

prototype: CountQueuingStrategy;
new (init: QueuingStrategyInit): CountQueuingStrategy;
new(init: QueuingStrategyInit): CountQueuingStrategy;
};
interface TextEncoderStream {
/** Returns "utf-8". */
readonly encoding: 'utf-8';
readonly encoding: "utf-8";
readonly readable: ReadableStream<Uint8Array>;

@@ -319,3 +339,3 @@ readonly writable: WritableStream<string>;

prototype: TextEncoderStream;
new (): TextEncoderStream;
new(): TextEncoderStream;
};

@@ -340,7 +360,7 @@ interface TextDecoderOptions {

prototype: TextDecoderStream;
new (label?: string, options?: TextDecoderOptions): TextDecoderStream;
new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
};
}
declare module 'node:stream/web' {
export * from 'stream/web';
declare module "node:stream/web" {
export * from "stream/web";
}

@@ -17,6 +17,6 @@ /**

* const cent = Buffer.from([0xC2, 0xA2]);
* console.log(decoder.write(cent));
* console.log(decoder.write(cent)); // Prints: ¢
*
* const euro = Buffer.from([0xE2, 0x82, 0xAC]);
* console.log(decoder.write(euro));
* console.log(decoder.write(euro)); // Prints: €
* ```

@@ -38,7 +38,7 @@ *

* decoder.write(Buffer.from([0x82]));
* console.log(decoder.end(Buffer.from([0xAC])));
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
* ```
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js)
*/
declare module 'string_decoder' {
declare module "string_decoder" {
class StringDecoder {

@@ -51,3 +51,3 @@ constructor(encoding?: BufferEncoding);

* @since v0.1.99
* @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
* @param buffer The bytes to decode.
*/

@@ -63,3 +63,3 @@ write(buffer: Buffer): string;

* @since v0.9.3
* @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
* @param buffer The bytes to decode.
*/

@@ -69,4 +69,4 @@ end(buffer?: Buffer): string;

}
declare module 'node:string_decoder' {
export * from 'string_decoder';
declare module "node:string_decoder" {
export * from "string_decoder";
}

@@ -81,9 +81,11 @@ /**

*/
declare module 'node:test' {
import { Readable } from 'node:stream';
import { AsyncResource } from 'node:async_hooks';
declare module "node:test" {
import { Readable } from "node:stream";
import { AsyncResource } from "node:async_hooks";
/**
* ```js
* import { tap } from 'node:test/reporters';
* import { run } from 'node:test';
* import process from 'node:process';
* import path from 'node:path';
*

@@ -141,16 +143,3 @@ * run({ files: [path.resolve('./tests/test.js')] })

namespace test {
export {
after,
afterEach,
before,
beforeEach,
describe,
it,
run,
mock,
test,
skip,
todo,
only
};
export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
}

@@ -261,5 +250,14 @@ /**

* The type of a function under Suite.
* If the test uses callbacks, the callback function is passed as an argument
*/
type SuiteFn = (s: SuiteContext) => void | Promise<void>;
interface TestShard {
/**
* A positive integer between 1 and `<total>` that specifies the index of the shard to run.
*/
index: number;
/**
* A positive integer that specifies the total number of shards to split the test files to.
*/
total: number;
}
interface RunOptions {

@@ -303,2 +301,6 @@ /**

/**
* If truthy, the test context will only run tests that have the `only` option set
*/
only?: boolean;
/**
* A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.

@@ -308,5 +310,11 @@ */

/**
* Whether to run in watch mode or not. Default: false.
* Whether to run in watch mode or not.
* @default false
*/
watch?: boolean;
watch?: boolean | undefined;
/**
* Running tests in a specific shard.
* @default undefined
*/
shard?: TestShard | undefined;
}

@@ -328,49 +336,49 @@ class Test extends AsyncResource {

class TestsStream extends Readable implements NodeJS.ReadableStream {
addListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
addListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
addListener(event: 'test:start', listener: (data: TestStart) => void): this;
addListener(event: 'test:stderr', listener: (data: TestStderr) => void): this;
addListener(event: 'test:stdout', listener: (data: TestStdout) => void): this;
addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
addListener(event: "test:fail", listener: (data: TestFail) => void): this;
addListener(event: "test:pass", listener: (data: TestPass) => void): this;
addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
addListener(event: "test:start", listener: (data: TestStart) => void): this;
addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
addListener(event: string, listener: (...args: any[]) => void): this;
emit(event: 'test:diagnostic', data: DiagnosticData): boolean;
emit(event: 'test:fail', data: TestFail): boolean;
emit(event: 'test:pass', data: TestPass): boolean;
emit(event: 'test:plan', data: TestPlan): boolean;
emit(event: 'test:start', data: TestStart): boolean;
emit(event: 'test:stderr', data: TestStderr): boolean;
emit(event: 'test:stdout', data: TestStdout): boolean;
emit(event: "test:diagnostic", data: DiagnosticData): boolean;
emit(event: "test:fail", data: TestFail): boolean;
emit(event: "test:pass", data: TestPass): boolean;
emit(event: "test:plan", data: TestPlan): boolean;
emit(event: "test:start", data: TestStart): boolean;
emit(event: "test:stderr", data: TestStderr): boolean;
emit(event: "test:stdout", data: TestStdout): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
on(event: 'test:fail', listener: (data: TestFail) => void): this;
on(event: 'test:pass', listener: (data: TestPass) => void): this;
on(event: 'test:plan', listener: (data: TestPlan) => void): this;
on(event: 'test:start', listener: (data: TestStart) => void): this;
on(event: 'test:stderr', listener: (data: TestStderr) => void): this;
on(event: 'test:stdout', listener: (data: TestStdout) => void): this;
on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
on(event: "test:fail", listener: (data: TestFail) => void): this;
on(event: "test:pass", listener: (data: TestPass) => void): this;
on(event: "test:plan", listener: (data: TestPlan) => void): this;
on(event: "test:start", listener: (data: TestStart) => void): this;
on(event: "test:stderr", listener: (data: TestStderr) => void): this;
on(event: "test:stdout", listener: (data: TestStdout) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
once(event: 'test:fail', listener: (data: TestFail) => void): this;
once(event: 'test:pass', listener: (data: TestPass) => void): this;
once(event: 'test:plan', listener: (data: TestPlan) => void): this;
once(event: 'test:start', listener: (data: TestStart) => void): this;
once(event: 'test:stderr', listener: (data: TestStderr) => void): this;
once(event: 'test:stdout', listener: (data: TestStdout) => void): this;
once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
once(event: "test:fail", listener: (data: TestFail) => void): this;
once(event: "test:pass", listener: (data: TestPass) => void): this;
once(event: "test:plan", listener: (data: TestPlan) => void): this;
once(event: "test:start", listener: (data: TestStart) => void): this;
once(event: "test:stderr", listener: (data: TestStderr) => void): this;
once(event: "test:stdout", listener: (data: TestStdout) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependListener(event: 'test:stderr', listener: (data: TestStderr) => void): this;
prependListener(event: 'test:stdout', listener: (data: TestStdout) => void): this;
prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
prependListener(event: "test:start", listener: (data: TestStart) => void): this;
prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependOnceListener(event: 'test:stderr', listener: (data: TestStderr) => void): this;
prependOnceListener(event: 'test:stdout', listener: (data: TestStdout) => void): this;
prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this;
prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;

@@ -642,3 +650,3 @@ }

*/
type HookFn = (done: (result?: any) => void) => any;
type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
/**

@@ -734,3 +742,7 @@ * Configuration options for hooks.

fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(original?: F, implementation?: Implementation, options?: MockFunctionOptions): Mock<F | Implementation>;
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
original?: F,
implementation?: Implementation,
options?: MockFunctionOptions,
): Mock<F | Implementation>;
/**

@@ -779,4 +791,3 @@ * This function is used to create a mock on an existing object method. The

options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName]>
): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
: never;

@@ -792,4 +803,3 @@ method<

options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName] | Implementation>
): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
: never;

@@ -875,12 +885,8 @@ method<MockedObject extends object>(

F extends Function,
ReturnType = F extends (...args: any) => infer T
? T
: F extends abstract new (...args: any) => infer T
? T
: unknown,
Args = F extends (...args: infer Y) => any
? Y
: F extends abstract new (...args: infer Y) => any
? Y
: unknown[],
ReturnType = F extends (...args: any) => infer T ? T
: F extends abstract new(...args: any) => infer T ? T
: unknown,
Args = F extends (...args: infer Y) => any ? Y
: F extends abstract new(...args: infer Y) => any ? Y
: unknown[],
> {

@@ -909,3 +915,3 @@ /**

*/
target: F extends abstract new (...args: any) => any ? F : undefined;
target: F extends abstract new(...args: any) => any ? F : undefined;
/**

@@ -1016,3 +1022,3 @@ * The mocked function's `this` value.

}
type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout';
type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout";
/**

@@ -1042,7 +1048,2 @@ * Mocking timers is a technique commonly used in software testing to simulate and

*
* ```js
* const { mock } = require('node:test');
* mock.timers.enable(['setInterval']);
* ```
*
* The above example enables mocking for the `setInterval` timer and

@@ -1071,7 +1072,2 @@ * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked.

* ```
*
* ```js
* const { mock } = require('node:test');
* mock.timers.reset();
* ```
* @since v20.4.0

@@ -1111,20 +1107,2 @@ */

*
* ```js
* const assert = require('node:assert');
* const { test } = require('node:test');
*
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
* const fn = context.mock.fn();
* context.mock.timers.enable(['setTimeout']);
*
* setTimeout(fn, 9999);
* assert.strictEqual(fn.mock.callCount(), 0);
*
* // Advance in time
* context.mock.timers.tick(9999);
*
* assert.strictEqual(fn.mock.callCount(), 1);
* });
* ```
*
* Alternativelly, the `.tick` function can be called many times

@@ -1150,21 +1128,2 @@ *

* ```
*
* ```js
* const assert = require('node:assert');
* const { test } = require('node:test');
*
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
* const fn = context.mock.fn();
* context.mock.timers.enable(['setTimeout']);
* const nineSecs = 9000;
* setTimeout(fn, nineSecs);
*
* const twoSeconds = 3000;
* context.mock.timers.tick(twoSeconds);
* context.mock.timers.tick(twoSeconds);
* context.mock.timers.tick(twoSeconds);
*
* assert.strictEqual(fn.mock.callCount(), 1);
* });
* ```
* @since v20.4.0

@@ -1201,24 +1160,2 @@ */

*
* ```js
* const assert = require('node:assert');
* const { test } = require('node:test');
*
* test('runAll functions following the given order', (context) => {
* context.mock.timers.enable(['setTimeout']);
* const results = [];
* setTimeout(() => results.push(1), 9999);
*
* // Notice that if both timers have the same timeout,
* // the order of execution is guaranteed
* setTimeout(() => results.push(3), 8888);
* setTimeout(() => results.push(2), 8888);
*
* assert.deepStrictEqual(results, []);
*
* context.mock.timers.runAll();
*
* assert.deepStrictEqual(results, [3, 2, 1]);
* });
* ```
*
* **Note:** The `runAll()` function is specifically designed for

@@ -1231,8 +1168,43 @@ * triggering timers in the context of timer mocking.

runAll(): void;
/**
* Calls {@link MockTimers.reset()}.
*/
[Symbol.dispose](): void;
}
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo };
export {
after,
afterEach,
before,
beforeEach,
describe,
it,
Mock,
mock,
only,
run,
skip,
test,
test as default,
todo,
};
}
interface DiagnosticData {
interface TestLocationInfo {
/**
* The column number where the test is defined, or
* `undefined` if the test was run through the REPL.
*/
column?: number;
/**
* The path of the test file, `undefined` if test is not ran through a file.
*/
file?: string;
/**
* The line number where the test is defined, or
* `undefined` if the test was run through the REPL.
*/
line?: number;
}
interface DiagnosticData extends TestLocationInfo {
/**
* The diagnostic message.

@@ -1245,8 +1217,4 @@ */

nesting: number;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestFail {
interface TestFail extends TestLocationInfo {
/**

@@ -1268,3 +1236,3 @@ * Additional execution metadata.

*/
type?: 'suite';
type?: "suite";
};

@@ -1291,8 +1259,4 @@ /**

skip?: string | boolean;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestPass {
interface TestPass extends TestLocationInfo {
/**

@@ -1310,3 +1274,3 @@ * Additional execution metadata.

*/
type?: 'suite';
type?: "suite";
};

@@ -1333,8 +1297,4 @@ /**

skip?: string | boolean;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestPlan {
interface TestPlan extends TestLocationInfo {
/**

@@ -1348,8 +1308,4 @@ * The nesting level of the test.

count: number;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestStart {
interface TestStart extends TestLocationInfo {
/**

@@ -1363,13 +1319,5 @@ * The test name.

nesting: number;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestStderr {
interface TestStderr extends TestLocationInfo {
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The message written to `stderr`

@@ -1379,8 +1327,4 @@ */

}
interface TestStdout {
interface TestStdout extends TestLocationInfo {
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The message written to `stdout`

@@ -1390,3 +1334,3 @@ */

}
interface TestEnqueue {
interface TestEnqueue extends TestLocationInfo {
/**

@@ -1397,6 +1341,2 @@ * The test name

/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The nesting level of the test.

@@ -1406,3 +1346,3 @@ */

}
interface TestDequeue {
interface TestDequeue extends TestLocationInfo {
/**

@@ -1413,6 +1353,2 @@ * The test name

/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The nesting level of the test.

@@ -1440,16 +1376,16 @@ */

*/
declare module 'node:test/reporters' {
import { Transform } from 'node:stream';
declare module "node:test/reporters" {
import { Transform } from "node:stream";
type TestEvent =
| { type: 'test:diagnostic', data: DiagnosticData }
| { type: 'test:fail', data: TestFail }
| { type: 'test:pass', data: TestPass }
| { type: 'test:plan', data: TestPlan }
| { type: 'test:start', data: TestStart }
| { type: 'test:stderr', data: TestStderr }
| { type: 'test:stdout', data: TestStdout }
| { type: 'test:enqueue', data: TestEnqueue }
| { type: 'test:dequeue', data: TestDequeue }
| { type: 'test:watch:drained' };
| { type: "test:diagnostic"; data: DiagnosticData }
| { type: "test:fail"; data: TestFail }
| { type: "test:pass"; data: TestPass }
| { type: "test:plan"; data: TestPlan }
| { type: "test:start"; data: TestStart }
| { type: "test:stderr"; data: TestStderr }
| { type: "test:stdout"; data: TestStdout }
| { type: "test:enqueue"; data: TestEnqueue }
| { type: "test:dequeue"; data: TestDequeue }
| { type: "test:watch:drained" };
type TestEventGenerator = AsyncGenerator<TestEvent, void>;

@@ -1462,3 +1398,3 @@

*/
function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>;
function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
/**

@@ -1474,3 +1410,7 @@ * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.

}
export { dot, tap, Spec as spec, TestEvent };
/**
* The `junit` reporter outputs test results in a jUnit XML format
*/
function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
export { dot, junit, Spec as spec, tap, TestEvent };
}

@@ -11,5 +11,9 @@ /**

*/
declare module 'timers' {
import { Abortable } from 'node:events';
import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises';
declare module "timers" {
import { Abortable } from "node:events";
import {
setImmediate as setImmediatePromise,
setInterval as setIntervalPromise,
setTimeout as setTimeoutPromise,
} from "node:timers/promises";
interface TimerOptions extends Abortable {

@@ -72,2 +76,7 @@ /**

_onImmediate: Function; // to distinguish it from the Timeout class
/**
* Cancels the immediate. This is similar to calling `clearImmediate()`.
* @since v20.5.0
*/
[Symbol.dispose](): void;
}

@@ -119,2 +128,7 @@ /**

[Symbol.toPrimitive](): number;
/**
* Cancels the timeout.
* @since v20.5.0
*/
[Symbol.dispose](): void;
}

@@ -141,3 +155,7 @@ }

*/
function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
function setTimeout<TArgs extends any[]>(
callback: (...args: TArgs) => void,
ms?: number,
...args: TArgs
): NodeJS.Timeout;
// util.promisify no rest args compability

@@ -170,6 +188,10 @@ // tslint:disable-next-line void-return

*/
function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
function setInterval<TArgs extends any[]>(
callback: (...args: TArgs) => void,
ms?: number,
...args: TArgs
): NodeJS.Timeout;
// util.promisify no rest args compability
// tslint:disable-next-line void-return
function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer;
function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
namespace setInterval {

@@ -202,3 +224,6 @@ const __promisify__: typeof setIntervalPromise;

*/
function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
function setImmediate<TArgs extends any[]>(
callback: (...args: TArgs) => void,
...args: TArgs
): NodeJS.Immediate;
// util.promisify no rest args compability

@@ -219,4 +244,4 @@ // tslint:disable-next-line void-return

}
declare module 'node:timers' {
export * from 'timers';
declare module "node:timers" {
export * from "timers";
}

@@ -14,4 +14,4 @@ /**

*/
declare module 'timers/promises' {
import { TimerOptions } from 'node:timers';
declare module "timers/promises" {
import { TimerOptions } from "node:timers";
/**

@@ -92,4 +92,4 @@ * ```js

}
declare module 'node:timers/promises' {
export * from 'timers/promises';
declare module "node:timers/promises" {
export * from "timers/promises";
}

@@ -11,6 +11,6 @@ /**

*/
declare module 'tls' {
import { X509Certificate } from 'node:crypto';
import * as net from 'node:net';
import * as stream from 'stream';
declare module "tls" {
import { X509Certificate } from "node:crypto";
import * as net from "node:net";
import * as stream from "stream";
const CLIENT_RENEG_LIMIT: number;

@@ -400,3 +400,3 @@ const CLIENT_RENEG_WINDOW: number;

},
callback: (err: Error | null) => void
callback: (err: Error | null) => void,
): undefined | boolean;

@@ -477,31 +477,31 @@ /**

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
addListener(event: 'secureConnect', listener: () => void): this;
addListener(event: 'session', listener: (session: Buffer) => void): this;
addListener(event: 'keylog', listener: (line: Buffer) => void): this;
addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
addListener(event: "secureConnect", listener: () => void): this;
addListener(event: "session", listener: (session: Buffer) => void): this;
addListener(event: "keylog", listener: (line: Buffer) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'OCSPResponse', response: Buffer): boolean;
emit(event: 'secureConnect'): boolean;
emit(event: 'session', session: Buffer): boolean;
emit(event: 'keylog', line: Buffer): boolean;
emit(event: "OCSPResponse", response: Buffer): boolean;
emit(event: "secureConnect"): boolean;
emit(event: "session", session: Buffer): boolean;
emit(event: "keylog", line: Buffer): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
on(event: 'secureConnect', listener: () => void): this;
on(event: 'session', listener: (session: Buffer) => void): this;
on(event: 'keylog', listener: (line: Buffer) => void): this;
on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
on(event: "secureConnect", listener: () => void): this;
on(event: "session", listener: (session: Buffer) => void): this;
on(event: "keylog", listener: (line: Buffer) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
once(event: 'secureConnect', listener: () => void): this;
once(event: 'session', listener: (session: Buffer) => void): this;
once(event: 'keylog', listener: (line: Buffer) => void): this;
once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
once(event: "secureConnect", listener: () => void): this;
once(event: "session", listener: (session: Buffer) => void): this;
once(event: "keylog", listener: (line: Buffer) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
prependListener(event: 'secureConnect', listener: () => void): this;
prependListener(event: 'session', listener: (session: Buffer) => void): this;
prependListener(event: 'keylog', listener: (line: Buffer) => void): this;
prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
prependListener(event: "secureConnect", listener: () => void): this;
prependListener(event: "session", listener: (session: Buffer) => void): this;
prependListener(event: "keylog", listener: (line: Buffer) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
prependOnceListener(event: 'secureConnect', listener: () => void): this;
prependOnceListener(event: 'session', listener: (session: Buffer) => void): this;
prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this;
prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
prependOnceListener(event: "secureConnect", listener: () => void): this;
prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
}

@@ -567,3 +567,2 @@ interface CommonConnectionOptions {

/**
*
* @param socket

@@ -684,43 +683,114 @@ * @param identity identity parameter sent from the client.

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
addListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
addListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
addListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean;
emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean;
emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean;
emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean;
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
emit(
event: "OCSPRequest",
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
): boolean;
emit(
event: "resumeSession",
sessionId: Buffer,
callback: (err: Error | null, sessionData: Buffer | null) => void,
): boolean;
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
on(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
on(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
once(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
once(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
once(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
prependListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependOnceListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
prependOnceListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependOnceListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
}

@@ -734,3 +804,3 @@ /**

}
type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
interface SecureContextOptions {

@@ -1017,3 +1087,8 @@ /**

function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
function connect(
port: number,
host?: string,
options?: ConnectionOptions,
secureConnectListener?: () => void,
): TLSSocket;
function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;

@@ -1053,3 +1128,8 @@ /**

*/
function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
function createSecurePair(
context?: SecureContext,
isServer?: boolean,
requestCert?: boolean,
rejectUnauthorized?: boolean,
): SecurePair;
/**

@@ -1136,4 +1216,4 @@ * {@link createServer} sets the default value of the `honorCipherOrder` option

}
declare module 'node:tls' {
export * from 'tls';
declare module "node:tls" {
export * from "tls";
}

@@ -99,3 +99,3 @@ /**

*/
declare module 'trace_events' {
declare module "trace_events" {
/**

@@ -181,4 +181,4 @@ * The `Tracing` object is used to enable or disable tracing for sets of

}
declare module 'node:trace_events' {
export * from 'trace_events';
declare module "node:trace_events" {
export * from "trace_events";
}

@@ -6,3 +6,3 @@ /**

*/
declare module 'assert' {
declare module "assert" {
/**

@@ -38,3 +38,3 @@ * An alias of {@link ok}.

*/
code: 'ERR_ASSERTION';
code: "ERR_ASSERTION";
constructor(options?: {

@@ -202,3 +202,3 @@ /** If provided, the error message is set to this value. */

}
type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
/**

@@ -235,3 +235,3 @@ * Throws an `AssertionError` with the provided error message or a default

// tslint:disable-next-line:ban-types
stackStartFn?: Function
stackStartFn?: Function,
): never;

@@ -864,3 +864,7 @@ /**

function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
function rejects(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error,
): Promise<void>;
/**

@@ -908,4 +912,11 @@ * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately

*/
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
function doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
message?: string | Error,
): Promise<void>;
function doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error,
): Promise<void>;
/**

@@ -957,23 +968,36 @@ * Expects the `string` input to match the regular expression.

function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
(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;
};
const strict:
& Omit<
typeof assert,
| "equal"
| "notEqual"
| "deepEqual"
| "notDeepEqual"
| "ok"
| "strictEqual"
| "deepStrictEqual"
| "ifError"
| "strict"
>
& {
(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;
};
}
export = assert;
}
declare module 'node:assert' {
import assert = require('assert');
declare module "node:assert" {
import assert = require("assert");
export = assert;
}

@@ -1,8 +0,8 @@

declare module 'assert/strict' {
import { strict } from 'node:assert';
declare module "assert/strict" {
import { strict } from "node:assert";
export = strict;
}
declare module 'node:assert/strict' {
import { strict } from 'node:assert';
declare module "node:assert/strict" {
import { strict } from "node:assert";
export = strict;
}

@@ -17,3 +17,3 @@ /**

*/
declare module 'async_hooks' {
declare module "async_hooks" {
/**

@@ -25,2 +25,3 @@ * ```js

* console.log(executionAsyncId()); // 1 - bootstrap
* const path = '.';
* fs.open(path, 'r', (err, fd) => {

@@ -279,3 +280,7 @@ * console.log(executionAsyncId()); // 6 - open()

*/
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(fn: Func, type?: string, thisArg?: ThisArg): Func;
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
fn: Func,
type?: string,
thisArg?: ThisArg,
): Func;
/**

@@ -297,3 +302,7 @@ * Binds the given function to execute to this `AsyncResource`'s scope.

*/
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
runInAsyncScope<This, Result>(
fn: (this: This, ...args: any[]) => Result,
thisArg?: This,
...args: any[]
): Result;
/**

@@ -312,3 +321,2 @@ * Call all `destroy` hooks. This should only ever be called once. An error will

/**
*
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.

@@ -460,2 +468,3 @@ */

*/
run<R>(store: T, callback: () => R): R;
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;

@@ -534,4 +543,4 @@ /**

}
declare module 'node:async_hooks' {
export * from 'async_hooks';
declare module "node:async_hooks" {
export * from "async_hooks";
}

@@ -55,7 +55,7 @@ /**

*/
declare module 'cluster' {
import * as child from 'node:child_process';
import EventEmitter = require('node:events');
import * as net from 'node:net';
type SerializationType = 'json' | 'advanced';
declare module "cluster" {
import * as child from "node:child_process";
import EventEmitter = require("node:events");
import * as net from "node:net";
type SerializationType = "json" | "advanced";
export interface ClusterSettings {

@@ -77,3 +77,3 @@ execArgv?: string[] | undefined; // default: process.execArgv

port: number;
addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6"
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
}

@@ -130,4 +130,13 @@ /**

send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean;
send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean;
send(
message: child.Serializable,
sendHandle: child.SendHandle,
callback?: (error: Error | null) => void,
): boolean;
send(
message: child.Serializable,
sendHandle: child.SendHandle,
options?: child.MessageOptions,
callback?: (error: Error | null) => void,
): boolean;
/**

@@ -289,43 +298,43 @@ * This function will kill the worker. In the primary worker, it does this by

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'disconnect', listener: () => void): this;
addListener(event: 'error', listener: (error: Error) => void): this;
addListener(event: 'exit', listener: (code: number, signal: string) => void): this;
addListener(event: 'listening', listener: (address: Address) => void): this;
addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: 'online', listener: () => void): this;
addListener(event: "disconnect", listener: () => void): this;
addListener(event: "error", listener: (error: Error) => void): this;
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
addListener(event: "listening", listener: (address: Address) => void): this;
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: "online", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'disconnect'): boolean;
emit(event: 'error', error: Error): boolean;
emit(event: 'exit', code: number, signal: string): boolean;
emit(event: 'listening', address: Address): boolean;
emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean;
emit(event: 'online'): boolean;
emit(event: "disconnect"): boolean;
emit(event: "error", error: Error): boolean;
emit(event: "exit", code: number, signal: string): boolean;
emit(event: "listening", address: Address): boolean;
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
emit(event: "online"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'disconnect', listener: () => void): this;
on(event: 'error', listener: (error: Error) => void): this;
on(event: 'exit', listener: (code: number, signal: string) => void): this;
on(event: 'listening', listener: (address: Address) => void): this;
on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: 'online', listener: () => void): this;
on(event: "disconnect", listener: () => void): this;
on(event: "error", listener: (error: Error) => void): this;
on(event: "exit", listener: (code: number, signal: string) => void): this;
on(event: "listening", listener: (address: Address) => void): this;
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: "online", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'disconnect', listener: () => void): this;
once(event: 'error', listener: (error: Error) => void): this;
once(event: 'exit', listener: (code: number, signal: string) => void): this;
once(event: 'listening', listener: (address: Address) => void): this;
once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: 'online', listener: () => void): this;
once(event: "disconnect", listener: () => void): this;
once(event: "error", listener: (error: Error) => void): this;
once(event: "exit", listener: (code: number, signal: string) => void): this;
once(event: "listening", listener: (address: Address) => void): this;
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: "online", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'disconnect', listener: () => void): this;
prependListener(event: 'error', listener: (error: Error) => void): this;
prependListener(event: 'exit', listener: (code: number, signal: string) => void): this;
prependListener(event: 'listening', listener: (address: Address) => void): this;
prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: 'online', listener: () => void): this;
prependListener(event: "disconnect", listener: () => void): this;
prependListener(event: "error", listener: (error: Error) => void): this;
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
prependListener(event: "listening", listener: (address: Address) => void): this;
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: "online", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'disconnect', listener: () => void): this;
prependOnceListener(event: 'error', listener: (error: Error) => void): this;
prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this;
prependOnceListener(event: 'listening', listener: (address: Address) => void): this;
prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: 'online', listener: () => void): this;
prependOnceListener(event: "disconnect", listener: () => void): this;
prependOnceListener(event: "error", listener: (error: Error) => void): this;
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: "online", listener: () => void): this;
}

@@ -362,51 +371,60 @@ export interface Cluster extends EventEmitter {

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'disconnect', listener: (worker: Worker) => void): this;
addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
addListener(event: 'fork', listener: (worker: Worker) => void): this;
addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: 'online', listener: (worker: Worker) => void): this;
addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
addListener(event: "fork", listener: (worker: Worker) => void): this;
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
addListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: "online", listener: (worker: Worker) => void): this;
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'disconnect', worker: Worker): boolean;
emit(event: 'exit', worker: Worker, code: number, signal: string): boolean;
emit(event: 'fork', worker: Worker): boolean;
emit(event: 'listening', worker: Worker, address: Address): boolean;
emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
emit(event: 'online', worker: Worker): boolean;
emit(event: 'setup', settings: ClusterSettings): boolean;
emit(event: "disconnect", worker: Worker): boolean;
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
emit(event: "fork", worker: Worker): boolean;
emit(event: "listening", worker: Worker, address: Address): boolean;
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
emit(event: "online", worker: Worker): boolean;
emit(event: "setup", settings: ClusterSettings): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'disconnect', listener: (worker: Worker) => void): this;
on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
on(event: 'fork', listener: (worker: Worker) => void): this;
on(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: 'online', listener: (worker: Worker) => void): this;
on(event: 'setup', listener: (settings: ClusterSettings) => void): this;
on(event: "disconnect", listener: (worker: Worker) => void): this;
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
on(event: "fork", listener: (worker: Worker) => void): this;
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: "online", listener: (worker: Worker) => void): this;
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'disconnect', listener: (worker: Worker) => void): this;
once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
once(event: 'fork', listener: (worker: Worker) => void): this;
once(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: 'online', listener: (worker: Worker) => void): this;
once(event: 'setup', listener: (settings: ClusterSettings) => void): this;
once(event: "disconnect", listener: (worker: Worker) => void): this;
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
once(event: "fork", listener: (worker: Worker) => void): this;
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: "online", listener: (worker: Worker) => void): this;
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'disconnect', listener: (worker: Worker) => void): this;
prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
prependListener(event: 'fork', listener: (worker: Worker) => void): this;
prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
prependListener(event: "fork", listener: (worker: Worker) => void): this;
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
// the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this;
prependListener(event: 'online', listener: (worker: Worker) => void): this;
prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
prependListener(
event: "message",
listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
): this;
prependListener(event: "online", listener: (worker: Worker) => void): this;
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this;
prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this;
prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
// the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
prependOnceListener(event: 'online', listener: (worker: Worker) => void): this;
prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
prependOnceListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this;
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
}

@@ -416,5 +434,5 @@ const cluster: Cluster;

}
declare module 'node:cluster' {
export * from 'cluster';
export { default as default } from 'cluster';
declare module "node:cluster" {
export * from "cluster";
export { default as default } from "cluster";
}

@@ -58,8 +58,8 @@ /**

*/
declare module 'console' {
import console = require('node:console');
declare module "console" {
import console = require("node:console");
export = console;
}
declare module 'node:console' {
import { InspectOptions } from 'node:util';
declare module "node:console" {
import { InspectOptions } from "node:util";
global {

@@ -127,3 +127,3 @@ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build

* @since v8.3.0
* @param label The display label for the counter.
* @param [label='default'] The display label for the counter.
*/

@@ -146,3 +146,3 @@ count(label?: string): void;

* @since v8.3.0
* @param label The display label for the counter.
* @param [label='default'] The display label for the counter.
*/

@@ -227,3 +227,3 @@ countReset(label?: string): void;

* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
* logging the argument if it can’t be parsed as tabular.
* logging the argument if it can't be parsed as tabular.
*

@@ -264,2 +264,3 @@ * ```js

* @since v0.1.104
* @param [label='default']
*/

@@ -272,8 +273,9 @@ time(label?: string): void;

* ```js
* console.time('100-elements');
* for (let i = 0; i < 100; i++) {}
* console.timeEnd('100-elements');
* // prints 100-elements: 225.438ms
* console.time('bunch-of-stuff');
* // Do a bunch of stuff.
* console.timeEnd('bunch-of-stuff');
* // Prints: bunch-of-stuff: 225.438ms
* ```
* @since v0.1.104
* @param [label='default']
*/

@@ -294,2 +296,3 @@ timeEnd(label?: string): void;

* @since v10.7.0
* @param [label='default']
*/

@@ -402,3 +405,3 @@ timeLog(label?: string, ...data: any[]): void;

ignoreErrors?: boolean | undefined;
colorMode?: boolean | 'auto' | undefined;
colorMode?: boolean | "auto" | undefined;
inspectOptions?: InspectOptions | undefined;

@@ -413,4 +416,4 @@ /**

prototype: Console;
new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
new (options: ConsoleConstructorOptions): Console;
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
new(options: ConsoleConstructorOptions): Console;
}

@@ -417,0 +420,0 @@ }

/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
declare module 'constants' {
import { constants as osConstants, SignalConstants } from 'node:os';
import { constants as cryptoConstants } from 'node:crypto';
import { constants as fsConstants } from 'node:fs';
declare module "constants" {
import { constants as osConstants, SignalConstants } from "node:os";
import { constants as cryptoConstants } from "node:crypto";
import { constants as fsConstants } from "node:fs";
const exp: typeof osConstants.errno &
typeof osConstants.priority &
SignalConstants &
typeof cryptoConstants &
typeof fsConstants;
const exp:
& typeof osConstants.errno
& typeof osConstants.priority
& SignalConstants
& typeof cryptoConstants
& typeof fsConstants;
export = exp;
}
declare module 'node:constants' {
import constants = require('constants');
declare module "node:constants" {
import constants = require("constants");
export = constants;
}

@@ -28,9 +28,9 @@ /**

*/
declare module 'dgram' {
import { AddressInfo } from 'node:net';
import * as dns from 'node:dns';
import { EventEmitter, Abortable } from 'node:events';
declare module "dgram" {
import { AddressInfo } from "node:net";
import * as dns from "node:dns";
import { Abortable, EventEmitter } from "node:events";
interface RemoteInfo {
address: string;
family: 'IPv4' | 'IPv6';
family: "IPv4" | "IPv6";
port: number;

@@ -45,3 +45,3 @@ size: number;

}
type SocketType = 'udp4' | 'udp6';
type SocketType = "udp4" | "udp6";
interface SocketOptions extends Abortable {

@@ -56,3 +56,9 @@ type: SocketType;

sendBufferSize?: number | undefined;
lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined;
lookup?:
| ((
hostname: string,
options: dns.LookupOneOptions,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
) => void)
| undefined;
}

@@ -341,8 +347,38 @@ /**

*/
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
send(
msg: string | Uint8Array | ReadonlyArray<any>,
port?: number,
address?: string,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array | ReadonlyArray<any>,
port?: number,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array | ReadonlyArray<any>,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array,
offset: number,
length: number,
port?: number,
address?: string,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array,
offset: number,
length: number,
port?: number,
callback?: (error: Error | null, bytes: number) => void,
): void;
send(
msg: string | Uint8Array,
offset: number,
length: number,
callback?: (error: Error | null, bytes: number) => void,
): void;
/**

@@ -510,41 +546,46 @@ * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'connect', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'listening', listener: () => void): this;
addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connect", listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'connect'): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'listening'): boolean;
emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean;
emit(event: "close"): boolean;
emit(event: "connect"): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'connect', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'listening', listener: () => void): this;
on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connect", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'connect', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'listening', listener: () => void): this;
once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connect", listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'connect', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'listening', listener: () => void): this;
prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connect", listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'connect', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'listening', listener: () => void): this;
prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connect", listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
/**
* Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
* @since v20.5.0
*/
[Symbol.asyncDispose](): Promise<void>;
}
}
declare module 'node:dgram' {
export * from 'dgram';
declare module "node:dgram" {
export * from "dgram";
}

@@ -25,3 +25,3 @@ /**

*/
declare module 'diagnostics_channel' {
declare module "diagnostics_channel" {
/**

@@ -190,4 +190,4 @@ * Check if there are active subscribers to the named channel. This is helpful if

}
declare module 'node:diagnostics_channel' {
export * from 'diagnostics_channel';
declare module "node:diagnostics_channel" {
export * from "diagnostics_channel";
}

@@ -47,4 +47,4 @@ /**

*/
declare module 'dns' {
import * as dnsPromises from 'node:dns/promises';
declare module "dns" {
import * as dnsPromises from "node:dns/promises";
// Supported getaddrinfo flags.

@@ -119,7 +119,26 @@ export const ADDRCONFIG: number;

*/
export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
export function lookup(
hostname: string,
family: number,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
): void;
export function lookup(
hostname: string,
options: LookupOneOptions,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
): void;
export function lookup(
hostname: string,
options: LookupAllOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
): void;
export function lookup(
hostname: string,
options: LookupOptions,
callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void,
): void;
export function lookup(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
): void;
export namespace lookup {

@@ -150,7 +169,11 @@ function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;

*/
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
export function lookupService(
address: string,
port: number,
callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
): void;
export namespace lookupService {
function __promisify__(
address: string,
port: number
port: number,
): Promise<{

@@ -174,6 +197,6 @@ hostname: string;

export interface AnyARecord extends RecordWithTtl {
type: 'A';
type: "A";
}
export interface AnyAaaaRecord extends RecordWithTtl {
type: 'AAAA';
type: "AAAA";
}

@@ -193,3 +216,3 @@ export interface CaaRecord {

export interface AnyMxRecord extends MxRecord {
type: 'MX';
type: "MX";
}

@@ -205,3 +228,3 @@ export interface NaptrRecord {

export interface AnyNaptrRecord extends NaptrRecord {
type: 'NAPTR';
type: "NAPTR";
}

@@ -218,3 +241,3 @@ export interface SoaRecord {

export interface AnySoaRecord extends SoaRecord {
type: 'SOA';
type: "SOA";
}

@@ -228,21 +251,31 @@ export interface SrvRecord {

export interface AnySrvRecord extends SrvRecord {
type: 'SRV';
type: "SRV";
}
export interface AnyTxtRecord {
type: 'TXT';
type: "TXT";
entries: string[];
}
export interface AnyNsRecord {
type: 'NS';
type: "NS";
value: string;
}
export interface AnyPtrRecord {
type: 'PTR';
type: "PTR";
value: string;
}
export interface AnyCnameRecord {
type: 'CNAME';
type: "CNAME";
value: string;
}
export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord;
export type AnyRecord =
| AnyARecord
| AnyAaaaRecord
| AnyCnameRecord
| AnyMxRecord
| AnyNaptrRecord
| AnyNsRecord
| AnyPtrRecord
| AnySoaRecord
| AnySrvRecord
| AnyTxtRecord;
/**

@@ -260,28 +293,81 @@ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array

*/
export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
export function resolve(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "A",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "AAAA",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "ANY",
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "CNAME",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "MX",
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "NAPTR",
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "NS",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "PTR",
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "SOA",
callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void,
): void;
export function resolve(
hostname: string,
rrtype: "SRV",
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
): void;
export function resolve(
hostname: string,
rrtype: "TXT",
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
): void;
export function resolve(
hostname: string,
rrtype: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void
callback: (
err: NodeJS.ErrnoException | null,
addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
) => void,
): void;
export namespace resolve {
function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>;
function __promisify__(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
function __promisify__(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
function __promisify__(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
function __promisify__(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
function __promisify__(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
function __promisify__(
hostname: string,
rrtype: string,
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
}

@@ -294,5 +380,16 @@ /**

*/
export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
export function resolve4(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve4(
hostname: string,
options: ResolveWithTtlOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
): void;
export function resolve4(
hostname: string,
options: ResolveOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
): void;
export namespace resolve4 {

@@ -309,5 +406,16 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
export function resolve6(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export function resolve6(
hostname: string,
options: ResolveWithTtlOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
): void;
export function resolve6(
hostname: string,
options: ResolveOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
): void;
export namespace resolve6 {

@@ -323,3 +431,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolveCname(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export namespace resolveCname {

@@ -334,3 +445,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
export function resolveCaa(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
): void;
export namespace resolveCaa {

@@ -344,3 +458,6 @@ function __promisify__(hostname: string): Promise<CaaRecord[]>;

*/
export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
export function resolveMx(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
): void;
export namespace resolveMx {

@@ -372,3 +489,6 @@ function __promisify__(hostname: string): Promise<MxRecord[]>;

*/
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
export function resolveNaptr(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
): void;
export namespace resolveNaptr {

@@ -382,3 +502,6 @@ function __promisify__(hostname: string): Promise<NaptrRecord[]>;

*/
export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolveNs(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export namespace resolveNs {

@@ -392,3 +515,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
export function resolvePtr(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
): void;
export namespace resolvePtr {

@@ -423,3 +549,6 @@ function __promisify__(hostname: string): Promise<string[]>;

*/
export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
export function resolveSoa(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
): void;
export namespace resolveSoa {

@@ -447,3 +576,6 @@ function __promisify__(hostname: string): Promise<SoaRecord>;

*/
export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
export function resolveSrv(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
): void;
export namespace resolveSrv {

@@ -459,3 +591,6 @@ function __promisify__(hostname: string): Promise<SrvRecord[]>;

*/
export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
export function resolveTxt(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
): void;
export namespace resolveTxt {

@@ -494,3 +629,6 @@ function __promisify__(hostname: string): Promise<string[][]>;

*/
export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
export function resolveAny(
hostname: string,
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
): void;
export namespace resolveAny {

@@ -507,3 +645,6 @@ function __promisify__(hostname: string): Promise<AnyRecord[]>;

*/
export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
export function reverse(
ip: string,
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
): void;
/**

@@ -516,3 +657,3 @@ * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:

*/
export function getDefaultResultOrder(): 'ipv4first' | 'verbatim';
export function getDefaultResultOrder(): "ipv4first" | "verbatim";
/**

@@ -575,3 +716,3 @@ * Sets the IP address and port of servers to be used when performing DNS

*/
export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
// Error codes

@@ -690,4 +831,4 @@ export const NODATA: string;

}
declare module 'node:dns' {
export * from 'dns';
declare module "node:dns" {
export * from "dns";
}

@@ -7,19 +7,19 @@ /**

*/
declare module 'dns/promises' {
declare module "dns/promises" {
import {
AnyRecord,
CaaRecord,
LookupAddress,
LookupAllOptions,
LookupOneOptions,
LookupAllOptions,
LookupOptions,
AnyRecord,
CaaRecord,
MxRecord,
NaptrRecord,
SoaRecord,
SrvRecord,
ResolveWithTtlOptions,
RecordWithTtl,
ResolveOptions,
ResolverOptions,
} from 'node:dns';
ResolveWithTtlOptions,
SoaRecord,
SrvRecord,
} from "node:dns";
/**

@@ -110,3 +110,3 @@ * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),

address: string,
port: number
port: number,
): Promise<{

@@ -130,15 +130,18 @@ hostname: string;

function resolve(hostname: string): Promise<string[]>;
function resolve(hostname: string, rrtype: 'A'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'AAAA'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
function resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
function resolve(hostname: string, rrtype: 'CNAME'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
function resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
function resolve(hostname: string, rrtype: 'NS'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'PTR'): Promise<string[]>;
function resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
function resolve(
hostname: string,
rrtype: string,
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
/**

@@ -349,3 +352,3 @@ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4

*/
function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
/**

@@ -416,4 +419,4 @@ * An independent resolver for DNS requests.

}
declare module 'node:dns/promises' {
export * from 'dns/promises';
declare module "node:dns/promises" {
export * from "dns/promises";
}

@@ -11,68 +11,66 @@ export {}; // Don't export anything!

// the copy below in a Node environment.
type __Event = typeof globalThis extends { onmessage: any, Event: any }
? {}
: {
/** This is not used in Node.js and is provided purely for completeness. */
readonly bubbles: boolean;
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
cancelBubble: () => void;
/** True if the event was created with the cancelable option */
readonly cancelable: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly composed: boolean;
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
composedPath(): [EventTarget?]
/** Alias for event.target. */
readonly currentTarget: EventTarget | null;
/** Is true if cancelable is true and event.preventDefault() has been called. */
readonly defaultPrevented: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly eventPhase: 0 | 2;
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
readonly isTrusted: boolean;
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
preventDefault(): void;
/** This is not used in Node.js and is provided purely for completeness. */
returnValue: boolean;
/** Alias for event.target. */
readonly srcElement: EventTarget | null;
/** Stops the invocation of event listeners after the current one completes. */
stopImmediatePropagation(): void;
/** This is not used in Node.js and is provided purely for completeness. */
stopPropagation(): void;
/** The `EventTarget` dispatching the event */
readonly target: EventTarget | null;
/** The millisecond timestamp when the Event object was created. */
readonly timeStamp: number;
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
readonly type: string;
};
type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {}
: {
/** This is not used in Node.js and is provided purely for completeness. */
readonly bubbles: boolean;
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
cancelBubble: () => void;
/** True if the event was created with the cancelable option */
readonly cancelable: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly composed: boolean;
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
composedPath(): [EventTarget?];
/** Alias for event.target. */
readonly currentTarget: EventTarget | null;
/** Is true if cancelable is true and event.preventDefault() has been called. */
readonly defaultPrevented: boolean;
/** This is not used in Node.js and is provided purely for completeness. */
readonly eventPhase: 0 | 2;
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
readonly isTrusted: boolean;
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
preventDefault(): void;
/** This is not used in Node.js and is provided purely for completeness. */
returnValue: boolean;
/** Alias for event.target. */
readonly srcElement: EventTarget | null;
/** Stops the invocation of event listeners after the current one completes. */
stopImmediatePropagation(): void;
/** This is not used in Node.js and is provided purely for completeness. */
stopPropagation(): void;
/** The `EventTarget` dispatching the event */
readonly target: EventTarget | null;
/** The millisecond timestamp when the Event object was created. */
readonly timeStamp: number;
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
readonly type: string;
};
// See comment above explaining conditional type
type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any }
? {}
: {
/**
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
*
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
*
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
*/
addEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: AddEventListenerOptions | boolean,
): void;
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
dispatchEvent(event: Event): boolean;
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
removeEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: EventListenerOptions | boolean,
): void;
};
type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {}
: {
/**
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
*
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
*
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
*/
addEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: AddEventListenerOptions | boolean,
): void;
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
dispatchEvent(event: Event): boolean;
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
removeEventListener(
type: string,
listener: EventListener | EventListenerObject,
options?: EventListenerOptions | boolean,
): void;
};

@@ -105,11 +103,10 @@ interface EventInit {

import {} from 'events'; // Make this an ambient declaration
import {} from "events"; // Make this an ambient declaration
declare global {
/** An event which takes place in the DOM. */
interface Event extends __Event {}
var Event: typeof globalThis extends { onmessage: any, Event: infer T }
? T
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
: {
prototype: __Event;
new (type: string, eventInitDict?: EventInit): __Event;
new(type: string, eventInitDict?: EventInit): __Event;
};

@@ -122,8 +119,7 @@

interface EventTarget extends __EventTarget {}
var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T }
? T
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
: {
prototype: __EventTarget;
new (): __EventTarget;
new(): __EventTarget;
};
}

@@ -17,4 +17,4 @@ /**

*/
declare module 'domain' {
import EventEmitter = require('node:events');
declare module "domain" {
import EventEmitter = require("node:events");
/**

@@ -169,4 +169,4 @@ * The `Domain` class encapsulates the functionality of routing errors and

}
declare module 'node:domain' {
export * from 'domain';
declare module "node:domain" {
export * from "domain";
}

@@ -37,3 +37,3 @@ /**

*/
declare module 'events' {
declare module "events" {
// NOTE: This class is in the docs but is **not actually exported** by Node.

@@ -89,3 +89,3 @@ // If https://github.com/nodejs/node/issues/39903 gets resolved and Node

once: boolean;
}
},
): any;

@@ -191,3 +191,7 @@ }

*/
static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
static once(
emitter: _NodeEventTarget,
eventName: string | symbol,
options?: StaticEventEmitterOptions,
): Promise<any[]>;
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;

@@ -253,3 +257,7 @@ /**

*/
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
static on(
emitter: NodeJS.EventEmitter,
eventName: string,
options?: StaticEventEmitterOptions,
): AsyncIterableIterator<any>;
/**

@@ -346,2 +354,37 @@ * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.

/**
* Listens once to the `abort` event on the provided `signal`.
*
* Listening to the `abort` event on abort signals is unsafe and may
* lead to resource leaks since another third party with the signal can
* call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change
* this since it would violate the web standard. Additionally, the original
* API makes it easy to forget to remove listeners.
*
* This API allows safely using `AbortSignal`s in Node.js APIs by solving these
* two issues by listening to the event such that `stopImmediatePropagation` does
* not prevent the listener from running.
*
* Returns a disposable so that it may be unsubscribed from more easily.
*
* ```js
* import { addAbortListener } from 'node:events';
*
* function example(signal) {
* let disposable;
* try {
* signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
* disposable = addAbortListener(signal, (e) => {
* // Do something when signal is aborted.
* });
* } finally {
* disposable?.[Symbol.dispose]();
* }
* }
* ```
* @since v20.5.0
* @experimental
* @return that removes the `abort` listener.
*/
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
/**
* This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called.

@@ -406,3 +449,3 @@ *

}
import internal = require('node:events');
import internal = require("node:events");
namespace EventEmitter {

@@ -756,5 +799,5 @@ // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4

}
declare module 'node:events' {
import events = require('events');
declare module "node:events" {
import events = require("events");
export = events;
}

@@ -11,6 +11,6 @@ /**

*/
declare module 'fs/promises' {
import { Abortable } from 'node:events';
import { Stream } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
declare module "fs/promises" {
import { Abortable } from "node:events";
import { Stream } from "node:stream";
import { ReadableStream } from "node:stream/web";
import {

@@ -34,4 +34,4 @@ BigIntStats,

RmOptions,
StatFsOptions,
StatOptions,
StatFsOptions,
Stats,

@@ -44,4 +44,4 @@ StatsFs,

WriteVResult,
} from 'node:fs';
import { Interface as ReadlineInterface } from 'node:readline';
} from "node:fs";
import { Interface as ReadlineInterface } from "node:readline";
interface FileChangeInfo<T extends string | Buffer> {

@@ -87,2 +87,3 @@ eventType: WatchEventType;

start?: number | undefined;
highWaterMark?: number | undefined;
}

@@ -94,3 +95,3 @@ interface ReadableWebStreamOptions {

*/
type?: 'bytes' | undefined;
type?: "bytes" | undefined;
}

@@ -112,3 +113,6 @@ // TODO: Add `EventEmitter` close

*/
appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
appendFile(
data: string | Uint8Array,
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
): Promise<void>;
/**

@@ -230,3 +234,8 @@ * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).

*/
read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
read<T extends NodeJS.ArrayBufferView>(
buffer: T,
offset?: number | null,
length?: number | null,
position?: number | null,
): Promise<FileReadResult<T>>;
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;

@@ -276,3 +285,3 @@ /**

flag?: OpenMode | undefined;
} | null
} | null,
): Promise<Buffer>;

@@ -288,6 +297,6 @@ /**

| {
encoding: BufferEncoding;
flag?: OpenMode | undefined;
}
| BufferEncoding
encoding: BufferEncoding;
flag?: OpenMode | undefined;
}
| BufferEncoding,
): Promise<string>;

@@ -303,6 +312,6 @@ /**

| (ObjectEncodingOptions & {
flag?: OpenMode | undefined;
})
flag?: OpenMode | undefined;
})
| BufferEncoding
| null
| null,
): Promise<string | Buffer>;

@@ -332,3 +341,3 @@ /**

bigint?: false | undefined;
}
},
): Promise<Stats>;

@@ -338,3 +347,3 @@ stat(

bigint: true;
}
},
): Promise<BigIntStats>;

@@ -394,3 +403,6 @@ stat(opts?: StatOptions): Promise<Stats | BigIntStats>;

*/
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
writeFile(
data: string | Uint8Array,
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
): Promise<void>;
/**

@@ -418,3 +430,3 @@ * Write `buffer` to the file.

length?: number | null,
position?: number | null
position?: number | null,
): Promise<{

@@ -427,3 +439,3 @@ bytesWritten: number;

position?: number | null,
encoding?: BufferEncoding | null
encoding?: BufferEncoding | null,
): Promise<{

@@ -474,2 +486,7 @@ bytesWritten: number;

close(): Promise<void>;
/**
* An alias for {@link FileHandle.close()}.
* @since v20.4.0
*/
[Symbol.asyncDispose](): Promise<void>;
}

@@ -615,3 +632,3 @@ const constants: typeof fsConstants;

recursive: true;
}
},
): Promise<string | undefined>;

@@ -629,5 +646,5 @@ /**

| (MakeDirectoryOptions & {
recursive?: false | undefined;
})
| null
recursive?: false | undefined;
})
| null,
): Promise<void>;

@@ -669,7 +686,7 @@ /**

| (ObjectEncodingOptions & {
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
| BufferEncoding
| null
| null,
): Promise<string[]>;

@@ -685,7 +702,7 @@ /**

| {
encoding: 'buffer';
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
}
| 'buffer'
encoding: "buffer";
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
}
| "buffer",
): Promise<Buffer[]>;

@@ -701,7 +718,7 @@ /**

| (ObjectEncodingOptions & {
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
withFileTypes?: false | undefined;
recursive?: boolean | undefined;
})
| BufferEncoding
| null
| null,
): Promise<string[] | Buffer[]>;

@@ -718,3 +735,3 @@ /**

recursive?: boolean | undefined;
}
},
): Promise<Dirent[]>;

@@ -770,3 +787,3 @@ /**

bigint?: false | undefined;
}
},
): Promise<Stats>;

@@ -777,3 +794,3 @@ function lstat(

bigint: true;
}
},
): Promise<BigIntStats>;

@@ -789,3 +806,3 @@ function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;

bigint?: false | undefined;
}
},
): Promise<Stats>;

@@ -796,3 +813,3 @@ function stat(

bigint: true;
}
},
): Promise<BigIntStats>;

@@ -808,3 +825,3 @@ function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;

bigint?: false | undefined;
}
},
): Promise<StatsFs>;

@@ -815,3 +832,3 @@ function statfs(

bigint: true;
}
},
): Promise<BigIntStatsFs>;

@@ -907,3 +924,6 @@ function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;

*/
function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
function realpath(
path: PathLike,
options?: ObjectEncodingOptions | BufferEncoding | null,
): Promise<string | Buffer>;
/**

@@ -1003,10 +1023,15 @@ * Creates a unique temporary directory. A unique directory name is generated by

file: PathLike | FileHandle,
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
data:
| string
| NodeJS.ArrayBufferView
| Iterable<string | NodeJS.ArrayBufferView>
| AsyncIterable<string | NodeJS.ArrayBufferView>
| Stream,
options?:
| (ObjectEncodingOptions & {
mode?: Mode | undefined;
flag?: OpenMode | undefined;
} & Abortable)
mode?: Mode | undefined;
flag?: OpenMode | undefined;
} & Abortable)
| BufferEncoding
| null
| null,
): Promise<void>;

@@ -1027,3 +1052,7 @@ /**

*/
function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
function appendFile(
path: PathLike | FileHandle,
data: string | Uint8Array,
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
): Promise<void>;
/**

@@ -1089,6 +1118,6 @@ * Asynchronously reads the entire contents of a file.

| ({
encoding?: null | undefined;
flag?: OpenMode | undefined;
} & Abortable)
| null
encoding?: null | undefined;
flag?: OpenMode | undefined;
} & Abortable)
| null,
): Promise<Buffer>;

@@ -1106,6 +1135,6 @@ /**

| ({
encoding: BufferEncoding;
flag?: OpenMode | undefined;
} & Abortable)
| BufferEncoding
encoding: BufferEncoding;
flag?: OpenMode | undefined;
} & Abortable)
| BufferEncoding,
): Promise<string>;

@@ -1122,8 +1151,11 @@ /**

options?:
| (ObjectEncodingOptions &
Abortable & {
flag?: OpenMode | undefined;
})
| (
& ObjectEncodingOptions
& Abortable
& {
flag?: OpenMode | undefined;
}
)
| BufferEncoding
| null
| null,
): Promise<string | Buffer>;

@@ -1193,5 +1225,5 @@ /**

| (WatchOptions & {
encoding: 'buffer';
})
| 'buffer'
encoding: "buffer";
})
| "buffer",
): AsyncIterable<FileChangeInfo<Buffer>>;

@@ -1215,3 +1247,6 @@ /**

*/
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
function watch(
filename: PathLike,
options: WatchOptions | string,
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
/**

@@ -1231,4 +1266,4 @@ * Asynchronously copies the entire directory structure from `src` to `dest`,

}
declare module 'node:fs/promises' {
export * from 'fs/promises';
declare module "node:fs/promises" {
export * from "fs/promises";
}

@@ -23,5 +23,5 @@ // Declare "static" methods in Error

// For backwards compability
interface NodeRequire extends NodeJS.Require { }
interface RequireResolve extends NodeJS.RequireResolve { }
interface NodeModule extends NodeJS.Module { }
interface NodeRequire extends NodeJS.Require {}
interface RequireResolve extends NodeJS.RequireResolve {}
interface NodeModule extends NodeJS.Module {}

@@ -45,3 +45,3 @@ declare var process: NodeJS.Process;

//#region borrowed
// #region borrowed
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib

@@ -72,4 +72,3 @@ /** A controller object that allows you to abort one or more DOM requests as and when desired. */

declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T}
? T
declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
: {

@@ -80,4 +79,3 @@ prototype: AbortController;

declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T}
? T
declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
: {

@@ -89,5 +87,27 @@ prototype: AbortSignal;

};
//#endregion borrowed
// #endregion borrowed
//#region ArrayLike.at()
// #region Disposable
interface SymbolConstructor {
/**
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
*/
readonly dispose: unique symbol;
/**
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
*/
readonly asyncDispose: unique symbol;
}
interface Disposable {
[Symbol.dispose](): void;
}
interface AsyncDisposable {
[Symbol.asyncDispose](): PromiseLike<void>;
}
// #endregion Disposable
// #region ArrayLike.at()
interface RelativeIndexable<T> {

@@ -115,3 +135,3 @@ /**

interface BigUint64Array extends RelativeIndexable<bigint> {}
//#endregion ArrayLike.at() end
// #endregion ArrayLike.at() end

@@ -125,3 +145,3 @@ /**

value: T,
transfer?: { transfer: ReadonlyArray<import('worker_threads').TransferListItem> },
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
): T;

@@ -223,3 +243,3 @@

isPaused(): boolean;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
unpipe(destination?: WritableStream): this;

@@ -240,3 +260,3 @@ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;

interface ReadWriteStream extends ReadableStream, WritableStream { }
interface ReadWriteStream extends ReadableStream, WritableStream {}

@@ -274,3 +294,3 @@ interface RefCounted {

interface RequireResolve {
(id: string, options?: { paths?: string[] | undefined; }): string;
(id: string, options?: { paths?: string[] | undefined }): string;
paths(request: string): string[] | null;

@@ -280,5 +300,5 @@ }

interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
'.js': (m: Module, filename: string) => any;
'.json': (m: Module, filename: string) => any;
'.node': (m: Module, filename: string) => any;
".js": (m: Module, filename: string) => any;
".json": (m: Module, filename: string) => any;
".node": (m: Module, filename: string) => any;
}

@@ -314,2 +334,60 @@ interface Module {

}
namespace fetch {
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
: import("undici-types").RequestInit;
type Request = globalThis.Request;
type Response = globalThis.Response;
type Headers = globalThis.Headers;
type FormData = globalThis.FormData;
type RequestInit = globalThis.RequestInit;
type RequestInfo = import("undici-types").RequestInfo;
type HeadersInit = import("undici-types").HeadersInit;
type BodyInit = import("undici-types").BodyInit;
type RequestRedirect = import("undici-types").RequestRedirect;
type RequestCredentials = import("undici-types").RequestCredentials;
type RequestMode = import("undici-types").RequestMode;
type ReferrerPolicy = import("undici-types").ReferrerPolicy;
type Dispatcher = import("undici-types").Dispatcher;
type RequestDuplex = import("undici-types").RequestDuplex;
}
}
interface RequestInit extends NodeJS.fetch._RequestInit {}
declare function fetch(
input: NodeJS.fetch.RequestInfo,
init?: RequestInit,
): Promise<Response>;
interface Request extends NodeJS.fetch._Request {}
declare var Request: typeof globalThis extends {
onmessage: any;
Request: infer T;
} ? T
: typeof import("undici-types").Request;
interface Response extends NodeJS.fetch._Response {}
declare var Response: typeof globalThis extends {
onmessage: any;
Response: infer T;
} ? T
: typeof import("undici-types").Response;
interface FormData extends NodeJS.fetch._FormData {}
declare var FormData: typeof globalThis extends {
onmessage: any;
FormData: infer T;
} ? T
: typeof import("undici-types").FormData;
interface Headers extends NodeJS.fetch._Headers {}
declare var Headers: typeof globalThis extends {
onmessage: any;
Headers: infer T;
} ? T
: typeof import("undici-types").Headers;

@@ -6,7 +6,7 @@ /**

*/
declare module 'https' {
import { Duplex } from 'node:stream';
import * as tls from 'node:tls';
import * as http from 'node:http';
import { URL } from 'node:url';
declare module "https" {
import { Duplex } from "node:stream";
import * as tls from "node:tls";
import * as http from "node:http";
import { URL } from "node:url";
type ServerOptions<

@@ -16,4 +16,6 @@ Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,

> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
type RequestOptions = http.RequestOptions &
tls.SecureContextOptions & {
type RequestOptions =
& http.RequestOptions
& tls.SecureContextOptions
& {
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;

@@ -63,121 +65,214 @@ rejectUnauthorized?: boolean | undefined; // Defaults to true

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'connection', listener: (socket: Duplex) => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'listening', listener: () => void): this;
addListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
addListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
addListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
addListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
addListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
addListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
addListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
addListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connection", listener: (socket: Duplex) => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
addListener(
event: "connect",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
addListener(
event: "upgrade",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
emit(event: string, ...args: any[]): boolean;
emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean;
emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean;
emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean;
emit(event: 'close'): boolean;
emit(event: 'connection', socket: Duplex): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'listening'): boolean;
emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
emit(
event: 'checkContinue',
event: "newSession",
sessionId: Buffer,
sessionData: Buffer,
callback: (err: Error, resp: Buffer) => void,
): boolean;
emit(
event: "OCSPRequest",
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
): boolean;
emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
emit(event: "close"): boolean;
emit(event: "connection", socket: Duplex): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(
event: "checkContinue",
req: InstanceType<Request>,
res: InstanceType<Response> & {
req: InstanceType<Request>;
}
},
): boolean;
emit(
event: 'checkExpectation',
event: "checkExpectation",
req: InstanceType<Request>,
res: InstanceType<Response> & {
req: InstanceType<Request>;
}
},
): boolean;
emit(event: 'clientError', err: Error, socket: Duplex): boolean;
emit(event: 'connect', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
emit(event: "clientError", err: Error, socket: Duplex): boolean;
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
emit(
event: 'request',
event: "request",
req: InstanceType<Request>,
res: InstanceType<Response> & {
req: InstanceType<Request>;
}
},
): boolean;
emit(event: 'upgrade', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'connection', listener: (socket: Duplex) => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'listening', listener: () => void): this;
on(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
on(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
on(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
on(event: 'request', listener: http.RequestListener<Request, Response>): this;
on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
on(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
on(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
on(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connection", listener: (socket: Duplex) => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
on(event: "request", listener: http.RequestListener<Request, Response>): this;
on(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'connection', listener: (socket: Duplex) => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'listening', listener: () => void): this;
once(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
once(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
once(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: 'request', listener: http.RequestListener<Request, Response>): this;
once(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
once(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
once(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
once(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connection", listener: (socket: Duplex) => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
once(event: "request", listener: http.RequestListener<Request, Response>): this;
once(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'connection', listener: (socket: Duplex) => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'listening', listener: () => void): this;
prependListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
prependListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
prependListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
prependListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
prependListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connection", listener: (socket: Duplex) => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
prependListener(
event: "connect",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
prependListener(
event: "upgrade",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'listening', listener: () => void): this;
prependOnceListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
prependOnceListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependOnceListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
): this;
prependOnceListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependOnceListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
): this;
prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
prependOnceListener(
event: "connect",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
prependOnceListener(
event: "upgrade",
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
): this;
}

@@ -412,4 +507,11 @@ /**

*/
function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function request(
options: RequestOptions | string | URL,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
function request(
url: string | URL,
options: RequestOptions,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
/**

@@ -439,8 +541,15 @@ * Like `http.get()` but for HTTPS.

*/
function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
function get(
options: RequestOptions | string | URL,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
function get(
url: string | URL,
options: RequestOptions,
callback?: (res: http.IncomingMessage) => void,
): http.ClientRequest;
let globalAgent: Agent;
}
declare module 'node:https' {
export * from 'https';
declare module "node:https" {
export * from "https";
}
/**
* @since v0.3.7
* @experimental
*/
declare module 'module' {
import { URL } from 'node:url';
declare module "module" {
import { URL } from "node:url";
import { MessagePort } from "node:worker_threads";
namespace Module {

@@ -66,2 +68,20 @@ /**

}
interface SourceOrigin {
/**
* The name of the range in the source map, if one was provided
*/
name?: string;
/**
* The file name of the original source, as reported in the SourceMap
*/
fileName: string;
/**
* The 1-indexed lineNumber of the corresponding call site in the original source
*/
lineNumber: number;
/**
* The 1-indexed columnNumber of the corresponding call site in the original source
*/
columnNumber: number;
}
/**

@@ -95,4 +115,135 @@ * @since v13.7.0, v12.17.0

findEntry(lineOffset: number, columnOffset: number): SourceMapping;
/**
* Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source,
* find the corresponding call site location in the original source.
*
* If the `lineNumber` and `columnNumber` provided are not found in any source map,
* then an empty object is returned.
* @param lineNumber The 1-indexed line number of the call site in the generated source
* @param columnNumber The 1-indexed column number of the call site in the generated source
*/
findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {};
}
interface ImportAssertions extends NodeJS.Dict<string> {
type?: string | undefined;
}
type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm";
type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
interface GlobalPreloadContext {
port: MessagePort;
}
/**
* @deprecated This hook will be removed in a future version.
* Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored.
*
* Sometimes it might be necessary to run some code inside of the same global scope that the application runs in.
* This hook allows the return of a string that is run as a sloppy-mode script on startup.
*
* @param context Information to assist the preload code
* @return Code to run before application startup
*/
type GlobalPreloadHook = (context: GlobalPreloadContext) => string;
/**
* The `initialize` hook provides a way to define a custom function that runs in the hooks thread
* when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`.
*
* This hook can receive data from a `register` invocation, including ports and other transferrable objects.
* The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes.
*/
type InitializeHook<Data = any> = (data: Data) => void | Promise<void>;
interface ResolveHookContext {
/**
* Export conditions of the relevant `package.json`
*/
conditions: string[];
/**
* An object whose key-value pairs represent the assertions for the module to import
*/
importAssertions: ImportAssertions;
/**
* The module importing this one, or undefined if this is the Node.js entry point
*/
parentURL: string | undefined;
}
interface ResolveFnOutput {
/**
* A hint to the load hook (it might be ignored)
*/
format?: ModuleFormat | null | undefined;
/**
* The import assertions to use when caching the module (optional; if excluded the input will be used)
*/
importAssertions?: ImportAssertions | undefined;
/**
* A signal that this hook intends to terminate the chain of `resolve` hooks.
* @default false
*/
shortCircuit?: boolean | undefined;
/**
* The absolute URL to which this input resolves
*/
url: string;
}
/**
* The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook.
* If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`);
* if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook.
*
* @param specifier The specified URL path of the module to be resolved
* @param context
* @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook
*/
type ResolveHook = (
specifier: string,
context: ResolveHookContext,
nextResolve: (
specifier: string,
context?: ResolveHookContext,
) => ResolveFnOutput | Promise<ResolveFnOutput>,
) => ResolveFnOutput | Promise<ResolveFnOutput>;
interface LoadHookContext {
/**
* Export conditions of the relevant `package.json`
*/
conditions: string[];
/**
* The format optionally supplied by the `resolve` hook chain
*/
format: ModuleFormat;
/**
* An object whose key-value pairs represent the assertions for the module to import
*/
importAssertions: ImportAssertions;
}
interface LoadFnOutput {
format: ModuleFormat;
/**
* A signal that this hook intends to terminate the chain of `resolve` hooks.
* @default false
*/
shortCircuit?: boolean | undefined;
/**
* The source for Node.js to evaluate
*/
source?: ModuleSource;
}
/**
* The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed.
* It is also in charge of validating the import assertion.
*
* @param url The URL/path of the module to be loaded
* @param context Metadata about the module
* @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook
*/
type LoadHook = (
url: string,
context: LoadHookContext,
nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>,
) => LoadFnOutput | Promise<LoadFnOutput>;
}
interface RegisterOptions<Data> {
parentURL: string | URL;
data?: Data | undefined;
transferList?: any[] | undefined;
}
interface Module extends NodeModule {}

@@ -106,2 +257,8 @@ class Module {

static Module: typeof Module;
static register<Data = any>(
specifier: string | URL,
parentURL?: string | URL,
options?: RegisterOptions<Data>,
): void;
static register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
constructor(id: string, parent?: Module);

@@ -113,4 +270,13 @@ }

/**
* @experimental
* This feature is only available with the `--experimental-import-meta-resolve`
* Provides a module-relative resolution function scoped to each module, returning
* the URL string.
*
* @since v20.6.0
*
* @param specifier The module specifier to resolve relative to the current module.
* @returns The absolute (`file:`) URL string for the resolved module.
*/
resolve(specifier: string): string;
/**
* This `parent` parameter is only used when the `--experimental-import-meta-resolve`
* command flag enabled.

@@ -121,7 +287,9 @@ *

*
* @param specified The module specifier to resolve relative to `parent`.
* @param parent The absolute parent module URL to resolve from. If none
* is specified, the value of `import.meta.url` is used as the default.
* @since v20.6.0
*
* @param specifier The module specifier to resolve relative to `parent`.
* @param parent The absolute parent module URL to resolve from.
* @returns The absolute (`file:`) URL string for the resolved module.
*/
resolve?(specified: string, parent?: string | URL): Promise<string>;
resolve(specifier: string, parent: string | URL): string;
}

@@ -131,5 +299,5 @@ }

}
declare module 'node:module' {
import module = require('module');
declare module "node:module" {
import module = require("module");
export = module;
}

@@ -15,7 +15,11 @@ /**

*/
declare module 'net' {
import * as stream from 'node:stream';
import { Abortable, EventEmitter } from 'node:events';
import * as dns from 'node:dns';
type LookupFunction = (hostname: string, options: dns.LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void) => void;
declare module "net" {
import * as stream from "node:stream";
import { Abortable, EventEmitter } from "node:events";
import * as dns from "node:dns";
type LookupFunction = (
hostname: string,
options: dns.LookupAllOptions,
callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void,
) => void;
interface AddressInfo {

@@ -74,3 +78,3 @@ address: string;

type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed';
type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
/**

@@ -93,2 +97,8 @@ * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint

/**
* Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately.
* If the socket is still writable it implicitly calls `socket.end()`.
* @since v0.3.4
*/
destroySoon(): void;
/**
* Sends data on the socket. The second parameter specifies the encoding in the

@@ -237,2 +247,11 @@ * case of a string. It defaults to UTF8 encoding.

/**
* This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)`
* and it is an array of the addresses that have been attempted.
*
* Each address is a string in the form of `$IP:$PORT`.
* If the connection was successful, then the last address is the one that the socket is currently connected to.
* @since v19.4.0
*/
readonly autoSelectFamilyAttemptedAddresses: string[];
/**
* This property shows the number of characters buffered for writing. The buffer

@@ -360,61 +379,76 @@ * may contain strings whose length after encoding is not yet known. So this number

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: (hadError: boolean) => void): this;
addListener(event: 'connect', listener: () => void): this;
addListener(event: 'data', listener: (data: Buffer) => void): this;
addListener(event: 'drain', listener: () => void): this;
addListener(event: 'end', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
addListener(event: 'ready', listener: () => void): this;
addListener(event: 'timeout', listener: () => void): this;
addListener(event: "close", listener: (hadError: boolean) => void): this;
addListener(event: "connect", listener: () => void): this;
addListener(event: "data", listener: (data: Buffer) => void): this;
addListener(event: "drain", listener: () => void): this;
addListener(event: "end", listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
addListener(event: "ready", listener: () => void): this;
addListener(event: "timeout", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close', hadError: boolean): boolean;
emit(event: 'connect'): boolean;
emit(event: 'data', data: Buffer): boolean;
emit(event: 'drain'): boolean;
emit(event: 'end'): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean;
emit(event: 'ready'): boolean;
emit(event: 'timeout'): boolean;
emit(event: "close", hadError: boolean): boolean;
emit(event: "connect"): boolean;
emit(event: "data", data: Buffer): boolean;
emit(event: "drain"): boolean;
emit(event: "end"): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
emit(event: "ready"): boolean;
emit(event: "timeout"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: (hadError: boolean) => void): this;
on(event: 'connect', listener: () => void): this;
on(event: 'data', listener: (data: Buffer) => void): this;
on(event: 'drain', listener: () => void): this;
on(event: 'end', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
on(event: 'ready', listener: () => void): this;
on(event: 'timeout', listener: () => void): this;
on(event: "close", listener: (hadError: boolean) => void): this;
on(event: "connect", listener: () => void): this;
on(event: "data", listener: (data: Buffer) => void): this;
on(event: "drain", listener: () => void): this;
on(event: "end", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
on(event: "ready", listener: () => void): this;
on(event: "timeout", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: (hadError: boolean) => void): this;
once(event: 'connect', listener: () => void): this;
once(event: 'data', listener: (data: Buffer) => void): this;
once(event: 'drain', listener: () => void): this;
once(event: 'end', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
once(event: 'ready', listener: () => void): this;
once(event: 'timeout', listener: () => void): this;
once(event: "close", listener: (hadError: boolean) => void): this;
once(event: "connect", listener: () => void): this;
once(event: "data", listener: (data: Buffer) => void): this;
once(event: "drain", listener: () => void): this;
once(event: "end", listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
once(event: "ready", listener: () => void): this;
once(event: "timeout", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: (hadError: boolean) => void): this;
prependListener(event: 'connect', listener: () => void): this;
prependListener(event: 'data', listener: (data: Buffer) => void): this;
prependListener(event: 'drain', listener: () => void): this;
prependListener(event: 'end', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
prependListener(event: 'ready', listener: () => void): this;
prependListener(event: 'timeout', listener: () => void): this;
prependListener(event: "close", listener: (hadError: boolean) => void): this;
prependListener(event: "connect", listener: () => void): this;
prependListener(event: "data", listener: (data: Buffer) => void): this;
prependListener(event: "drain", listener: () => void): this;
prependListener(event: "end", listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
prependListener(event: "ready", listener: () => void): this;
prependListener(event: "timeout", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this;
prependOnceListener(event: 'connect', listener: () => void): this;
prependOnceListener(event: 'data', listener: (data: Buffer) => void): this;
prependOnceListener(event: 'drain', listener: () => void): this;
prependOnceListener(event: 'end', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
prependOnceListener(event: 'ready', listener: () => void): this;
prependOnceListener(event: 'timeout', listener: () => void): this;
prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
prependOnceListener(event: "connect", listener: () => void): this;
prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
prependOnceListener(event: "drain", listener: () => void): this;
prependOnceListener(event: "end", listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(
event: "lookup",
listener: (err: Error, address: string, family: string | number, host: string) => void,
): this;
prependOnceListener(event: "ready", listener: () => void): this;
prependOnceListener(event: "timeout", listener: () => void): this;
}

@@ -612,39 +646,44 @@ interface ListenOptions extends Abortable {

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'connection', listener: (socket: Socket) => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'listening', listener: () => void): this;
addListener(event: 'drop', listener: (data?: DropArgument) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connection", listener: (socket: Socket) => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "drop", listener: (data?: DropArgument) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'connection', socket: Socket): boolean;
emit(event: 'error', err: Error): boolean;
emit(event: 'listening'): boolean;
emit(event: 'drop', data?: DropArgument): boolean;
emit(event: "close"): boolean;
emit(event: "connection", socket: Socket): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(event: "drop", data?: DropArgument): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'connection', listener: (socket: Socket) => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'listening', listener: () => void): this;
on(event: 'drop', listener: (data?: DropArgument) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connection", listener: (socket: Socket) => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "drop", listener: (data?: DropArgument) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'connection', listener: (socket: Socket) => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'listening', listener: () => void): this;
once(event: 'drop', listener: (data?: DropArgument) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connection", listener: (socket: Socket) => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "drop", listener: (data?: DropArgument) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'connection', listener: (socket: Socket) => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'listening', listener: () => void): this;
prependListener(event: 'drop', listener: (data?: DropArgument) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connection", listener: (socket: Socket) => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "drop", listener: (data?: DropArgument) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'listening', listener: () => void): this;
prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this;
/**
* Calls {@link Server.close()} and returns a promise that fulfills when the server has closed.
* @since v20.5.0
*/
[Symbol.asyncDispose](): Promise<void>;
}
type IPVersion = 'ipv4' | 'ipv6';
type IPVersion = "ipv4" | "ipv6";
/**

@@ -810,2 +849,24 @@ * The `BlockList` object can be used with some network APIs to specify rules for

/**
* Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`.
* The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided.
* @since v19.4.0
*/
function getDefaultAutoSelectFamily(): boolean;
/**
* Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`.
* @since v19.4.0
*/
function setDefaultAutoSelectFamily(value: boolean): void;
/**
* Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
* The initial default value is `250`.
* @since v19.8.0
*/
function getDefaultAutoSelectFamilyAttemptTimeout(): number;
/**
* Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
* @since v19.8.0
*/
function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void;
/**
* Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4

@@ -893,4 +954,4 @@ * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`.

}
declare module 'node:net' {
export * from 'net';
declare module "node:net" {
export * from "net";
}

@@ -10,3 +10,3 @@ /**

*/
declare module 'os' {
declare module "os" {
interface CpuInfo {

@@ -31,7 +31,7 @@ model: string;

interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
family: 'IPv4';
family: "IPv4";
scopeid?: undefined;
}
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
family: 'IPv6';
family: "IPv6";
scopeid: number;

@@ -43,3 +43,3 @@ }

gid: number;
shell: T;
shell: T | null;
homedir: T;

@@ -245,3 +245,3 @@ }

*/
function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;

@@ -407,3 +407,3 @@ type SignalConstants = {

* Returns the operating system CPU architecture for which the Node.js binary was
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
*

@@ -455,3 +455,3 @@ * The return value is equivalent to `process.arch`.

*/
function endianness(): 'BE' | 'LE';
function endianness(): "BE" | "LE";
/**

@@ -481,4 +481,4 @@ * Returns the scheduling priority for the process specified by `pid`. If `pid` is

}
declare module 'node:os' {
export * from 'os';
declare module "node:os" {
export * from "os";
}

@@ -1,7 +0,7 @@

declare module 'path/posix' {
import path = require('path');
declare module "path/posix" {
import path = require("path");
export = path;
}
declare module 'path/win32' {
import path = require('path');
declare module "path/win32" {
import path = require("path");
export = path;

@@ -18,3 +18,3 @@ }

*/
declare module 'path' {
declare module "path" {
namespace path {

@@ -141,7 +141,7 @@ /**

*/
readonly sep: '\\' | '/';
readonly sep: "\\" | "/";
/**
* The platform-specific file delimiter. ';' or ':'.
*/
readonly delimiter: ';' | ':';
readonly delimiter: ";" | ":";
/**

@@ -182,13 +182,13 @@ * Returns an object from a path string - the opposite of format().

}
declare module 'node:path' {
import path = require('path');
declare module "node:path" {
import path = require("path");
export = path;
}
declare module 'node:path/posix' {
import path = require('path/posix');
declare module "node:path/posix" {
import path = require("path/posix");
export = path;
}
declare module 'node:path/win32' {
import path = require('path/win32');
declare module "node:path/win32" {
import path = require("path/win32");
export = path;
}

@@ -32,5 +32,5 @@ /**

*/
declare module 'perf_hooks' {
import { AsyncResource } from 'node:async_hooks';
type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
declare module "perf_hooks" {
import { AsyncResource } from "node:async_hooks";
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http";
interface NodeGCPerformanceDetail {

@@ -99,3 +99,3 @@ /**

readonly duration: 0;
readonly entryType: 'mark';
readonly entryType: "mark";
}

@@ -109,3 +109,3 @@ /**

class PerformanceMeasure extends PerformanceEntry {
readonly entryType: 'measure';
readonly entryType: "measure";
}

@@ -172,3 +172,6 @@ /**

*/
type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization;
type EventLoopUtilityFunction = (
util1?: EventLoopUtilization,
util2?: EventLoopUtilization,
) => EventLoopUtilization;
interface MarkOptions {

@@ -328,3 +331,2 @@ /**

*
*
* performance.clearMarks();

@@ -466,9 +468,9 @@ * performance.clearMeasures();

| {
entryTypes: ReadonlyArray<EntryType>;
buffered?: boolean | undefined;
}
entryTypes: ReadonlyArray<EntryType>;
buffered?: boolean | undefined;
}
| {
type: EntryType;
buffered?: boolean | undefined;
}
type: EntryType;
buffered?: boolean | undefined;
},
): void;

@@ -627,3 +629,3 @@ }

function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
import { performance as _performance } from 'perf_hooks';
import { performance as _performance } from "perf_hooks";
global {

@@ -638,9 +640,8 @@ /**

performance: infer T;
}
? T
} ? T
: typeof _performance;
}
}
declare module 'node:perf_hooks' {
export * from 'perf_hooks';
declare module "node:perf_hooks" {
export * from "perf_hooks";
}

@@ -29,3 +29,3 @@ /**

*/
declare module 'punycode' {
declare module "punycode" {
/**

@@ -116,4 +116,4 @@ * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only

}
declare module 'node:punycode' {
export * from 'punycode';
declare module "node:punycode" {
export * from "punycode";
}

@@ -14,3 +14,3 @@ /**

*/
declare module 'querystring' {
declare module "querystring" {
interface StringifyOptions {

@@ -24,3 +24,13 @@ encodeURIComponent?: ((str: string) => string) | undefined;

interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {}
interface ParsedUrlQueryInput extends
NodeJS.Dict<
| string
| number
| boolean
| ReadonlyArray<string>
| ReadonlyArray<number>
| ReadonlyArray<boolean>
| null
>
{}
/**

@@ -131,4 +141,4 @@ * The `querystring.stringify()` method produces a URL query string from a

}
declare module 'node:querystring' {
export * from 'querystring';
declare module "node:querystring" {
export * from "querystring";
}

@@ -35,5 +35,5 @@ /**

*/
declare module 'readline' {
import { Abortable, EventEmitter } from 'node:events';
import * as promises from 'node:readline/promises';
declare module "readline" {
import { Abortable, EventEmitter } from "node:events";
import * as promises from "node:readline/promises";
export { promises };

@@ -105,3 +105,8 @@ export interface Key {

*/
protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
protected constructor(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
);
/**

@@ -250,55 +255,55 @@ * NOTE: According to the documentation:

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'line', listener: (input: string) => void): this;
addListener(event: 'pause', listener: () => void): this;
addListener(event: 'resume', listener: () => void): this;
addListener(event: 'SIGCONT', listener: () => void): this;
addListener(event: 'SIGINT', listener: () => void): this;
addListener(event: 'SIGTSTP', listener: () => void): this;
addListener(event: 'history', listener: (history: string[]) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "line", listener: (input: string) => void): this;
addListener(event: "pause", listener: () => void): this;
addListener(event: "resume", listener: () => void): this;
addListener(event: "SIGCONT", listener: () => void): this;
addListener(event: "SIGINT", listener: () => void): this;
addListener(event: "SIGTSTP", listener: () => void): this;
addListener(event: "history", listener: (history: string[]) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'line', input: string): boolean;
emit(event: 'pause'): boolean;
emit(event: 'resume'): boolean;
emit(event: 'SIGCONT'): boolean;
emit(event: 'SIGINT'): boolean;
emit(event: 'SIGTSTP'): boolean;
emit(event: 'history', history: string[]): boolean;
emit(event: "close"): boolean;
emit(event: "line", input: string): boolean;
emit(event: "pause"): boolean;
emit(event: "resume"): boolean;
emit(event: "SIGCONT"): boolean;
emit(event: "SIGINT"): boolean;
emit(event: "SIGTSTP"): boolean;
emit(event: "history", history: string[]): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'line', listener: (input: string) => void): this;
on(event: 'pause', listener: () => void): this;
on(event: 'resume', listener: () => void): this;
on(event: 'SIGCONT', listener: () => void): this;
on(event: 'SIGINT', listener: () => void): this;
on(event: 'SIGTSTP', listener: () => void): this;
on(event: 'history', listener: (history: string[]) => void): this;
on(event: "close", listener: () => void): this;
on(event: "line", listener: (input: string) => void): this;
on(event: "pause", listener: () => void): this;
on(event: "resume", listener: () => void): this;
on(event: "SIGCONT", listener: () => void): this;
on(event: "SIGINT", listener: () => void): this;
on(event: "SIGTSTP", listener: () => void): this;
on(event: "history", listener: (history: string[]) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'line', listener: (input: string) => void): this;
once(event: 'pause', listener: () => void): this;
once(event: 'resume', listener: () => void): this;
once(event: 'SIGCONT', listener: () => void): this;
once(event: 'SIGINT', listener: () => void): this;
once(event: 'SIGTSTP', listener: () => void): this;
once(event: 'history', listener: (history: string[]) => void): this;
once(event: "close", listener: () => void): this;
once(event: "line", listener: (input: string) => void): this;
once(event: "pause", listener: () => void): this;
once(event: "resume", listener: () => void): this;
once(event: "SIGCONT", listener: () => void): this;
once(event: "SIGINT", listener: () => void): this;
once(event: "SIGTSTP", listener: () => void): this;
once(event: "history", listener: (history: string[]) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'line', listener: (input: string) => void): this;
prependListener(event: 'pause', listener: () => void): this;
prependListener(event: 'resume', listener: () => void): this;
prependListener(event: 'SIGCONT', listener: () => void): this;
prependListener(event: 'SIGINT', listener: () => void): this;
prependListener(event: 'SIGTSTP', listener: () => void): this;
prependListener(event: 'history', listener: (history: string[]) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "line", listener: (input: string) => void): this;
prependListener(event: "pause", listener: () => void): this;
prependListener(event: "resume", listener: () => void): this;
prependListener(event: "SIGCONT", listener: () => void): this;
prependListener(event: "SIGINT", listener: () => void): this;
prependListener(event: "SIGTSTP", listener: () => void): this;
prependListener(event: "history", listener: (history: string[]) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'line', listener: (input: string) => void): this;
prependOnceListener(event: 'pause', listener: () => void): this;
prependOnceListener(event: 'resume', listener: () => void): this;
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
prependOnceListener(event: 'SIGINT', listener: () => void): this;
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
prependOnceListener(event: 'history', listener: (history: string[]) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "line", listener: (input: string) => void): this;
prependOnceListener(event: "pause", listener: () => void): this;
prependOnceListener(event: "resume", listener: () => void): this;
prependOnceListener(event: "SIGCONT", listener: () => void): this;
prependOnceListener(event: "SIGINT", listener: () => void): this;
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
[Symbol.asyncIterator](): AsyncIterableIterator<string>;

@@ -308,3 +313,6 @@ }

export type Completer = (line: string) => CompleterResult;
export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
export type AsyncCompleter = (
line: string,
callback: (err?: null | Error, result?: CompleterResult) => void,
) => void;
export type CompleterResult = [string[], string];

@@ -366,3 +374,8 @@ export interface ReadLineOptions {

*/
export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
export function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
): Interface;
export function createInterface(options: ReadLineOptions): Interface;

@@ -529,4 +542,4 @@ /**

}
declare module 'node:readline' {
export * from 'readline';
declare module "node:readline" {
export * from "readline";
}

@@ -5,5 +5,5 @@ /**

*/
declare module 'readline/promises' {
import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline';
import { Abortable } from 'node:events';
declare module "readline/promises" {
import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
import { Abortable } from "node:events";
/**

@@ -65,3 +65,3 @@ * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a

autoCommit?: boolean;
}
},
);

@@ -142,7 +142,12 @@ /**

*/
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
): Interface;
function createInterface(options: ReadLineOptions): Interface;
}
declare module 'node:readline/promises' {
export * from 'readline/promises';
declare module "node:readline/promises" {
export * from "readline/promises";
}

@@ -11,6 +11,6 @@ /**

*/
declare module 'repl' {
import { Interface, Completer, AsyncCompleter } from 'node:readline';
import { Context } from 'node:vm';
import { InspectOptions } from 'node:util';
declare module "repl" {
import { AsyncCompleter, Completer, Interface } from "node:readline";
import { Context } from "node:vm";
import { InspectOptions } from "node:util";
interface ReplOptions {

@@ -103,3 +103,9 @@ /**

}
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
type REPLEval = (
this: REPLServer,
evalCmd: string,
context: Context,
file: string,
cb: (err: Error | null, result: any) => void,
) => void;
type REPLWriter = (this: REPLServer, obj: any) => string;

@@ -331,61 +337,61 @@ /**

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'line', listener: (input: string) => void): this;
addListener(event: 'pause', listener: () => void): this;
addListener(event: 'resume', listener: () => void): this;
addListener(event: 'SIGCONT', listener: () => void): this;
addListener(event: 'SIGINT', listener: () => void): this;
addListener(event: 'SIGTSTP', listener: () => void): this;
addListener(event: 'exit', listener: () => void): this;
addListener(event: 'reset', listener: (context: Context) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "line", listener: (input: string) => void): this;
addListener(event: "pause", listener: () => void): this;
addListener(event: "resume", listener: () => void): this;
addListener(event: "SIGCONT", listener: () => void): this;
addListener(event: "SIGINT", listener: () => void): this;
addListener(event: "SIGTSTP", listener: () => void): this;
addListener(event: "exit", listener: () => void): this;
addListener(event: "reset", listener: (context: Context) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'close'): boolean;
emit(event: 'line', input: string): boolean;
emit(event: 'pause'): boolean;
emit(event: 'resume'): boolean;
emit(event: 'SIGCONT'): boolean;
emit(event: 'SIGINT'): boolean;
emit(event: 'SIGTSTP'): boolean;
emit(event: 'exit'): boolean;
emit(event: 'reset', context: Context): boolean;
emit(event: "close"): boolean;
emit(event: "line", input: string): boolean;
emit(event: "pause"): boolean;
emit(event: "resume"): boolean;
emit(event: "SIGCONT"): boolean;
emit(event: "SIGINT"): boolean;
emit(event: "SIGTSTP"): boolean;
emit(event: "exit"): boolean;
emit(event: "reset", context: Context): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'line', listener: (input: string) => void): this;
on(event: 'pause', listener: () => void): this;
on(event: 'resume', listener: () => void): this;
on(event: 'SIGCONT', listener: () => void): this;
on(event: 'SIGINT', listener: () => void): this;
on(event: 'SIGTSTP', listener: () => void): this;
on(event: 'exit', listener: () => void): this;
on(event: 'reset', listener: (context: Context) => void): this;
on(event: "close", listener: () => void): this;
on(event: "line", listener: (input: string) => void): this;
on(event: "pause", listener: () => void): this;
on(event: "resume", listener: () => void): this;
on(event: "SIGCONT", listener: () => void): this;
on(event: "SIGINT", listener: () => void): this;
on(event: "SIGTSTP", listener: () => void): this;
on(event: "exit", listener: () => void): this;
on(event: "reset", listener: (context: Context) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'line', listener: (input: string) => void): this;
once(event: 'pause', listener: () => void): this;
once(event: 'resume', listener: () => void): this;
once(event: 'SIGCONT', listener: () => void): this;
once(event: 'SIGINT', listener: () => void): this;
once(event: 'SIGTSTP', listener: () => void): this;
once(event: 'exit', listener: () => void): this;
once(event: 'reset', listener: (context: Context) => void): this;
once(event: "close", listener: () => void): this;
once(event: "line", listener: (input: string) => void): this;
once(event: "pause", listener: () => void): this;
once(event: "resume", listener: () => void): this;
once(event: "SIGCONT", listener: () => void): this;
once(event: "SIGINT", listener: () => void): this;
once(event: "SIGTSTP", listener: () => void): this;
once(event: "exit", listener: () => void): this;
once(event: "reset", listener: (context: Context) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'line', listener: (input: string) => void): this;
prependListener(event: 'pause', listener: () => void): this;
prependListener(event: 'resume', listener: () => void): this;
prependListener(event: 'SIGCONT', listener: () => void): this;
prependListener(event: 'SIGINT', listener: () => void): this;
prependListener(event: 'SIGTSTP', listener: () => void): this;
prependListener(event: 'exit', listener: () => void): this;
prependListener(event: 'reset', listener: (context: Context) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "line", listener: (input: string) => void): this;
prependListener(event: "pause", listener: () => void): this;
prependListener(event: "resume", listener: () => void): this;
prependListener(event: "SIGCONT", listener: () => void): this;
prependListener(event: "SIGINT", listener: () => void): this;
prependListener(event: "SIGTSTP", listener: () => void): this;
prependListener(event: "exit", listener: () => void): this;
prependListener(event: "reset", listener: (context: Context) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'line', listener: (input: string) => void): this;
prependOnceListener(event: 'pause', listener: () => void): this;
prependOnceListener(event: 'resume', listener: () => void): this;
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
prependOnceListener(event: 'SIGINT', listener: () => void): this;
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
prependOnceListener(event: 'exit', listener: () => void): this;
prependOnceListener(event: 'reset', listener: (context: Context) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "line", listener: (input: string) => void): this;
prependOnceListener(event: "pause", listener: () => void): this;
prependOnceListener(event: "resume", listener: () => void): this;
prependOnceListener(event: "SIGCONT", listener: () => void): this;
prependOnceListener(event: "SIGINT", listener: () => void): this;
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
prependOnceListener(event: "exit", listener: () => void): this;
prependOnceListener(event: "reset", listener: (context: Context) => void): this;
}

@@ -425,4 +431,4 @@ /**

}
declare module 'node:repl' {
export * from 'repl';
declare module "node:repl" {
export * from "repl";
}

@@ -1,12 +0,12 @@

declare module 'stream/consumers' {
import { Blob as NodeBlob } from 'node:buffer';
import { Readable } from 'node:stream';
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<NodeBlob>;
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
declare module "stream/consumers" {
import { Blob as NodeBlob } from "node:buffer";
import { Readable } from "node:stream";
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
}
declare module 'node:stream/consumers' {
export * from 'stream/consumers';
declare module "node:stream/consumers" {
export * from "stream/consumers";
}

@@ -1,12 +0,35 @@

declare module 'stream/promises' {
import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream';
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
declare module "stream/promises" {
import {
FinishedOptions,
PipelineDestination,
PipelineOptions,
PipelinePromise,
PipelineSource,
PipelineTransform,
} from "node:stream";
function finished(
stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
options?: FinishedOptions,
): Promise<void>;
function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
source: A,
destination: B,
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline<
A extends PipelineSource<any>,
T1 extends PipelineTransform<A, any>,
B extends PipelineDestination<T1, any>,
>(
source: A,
transform1: T1,
destination: B,
options?: PipelineOptions
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
function pipeline<
A extends PipelineSource<any>,
T1 extends PipelineTransform<A, any>,
T2 extends PipelineTransform<T1, any>,
B extends PipelineDestination<T2, any>,
>(
source: A,

@@ -16,3 +39,3 @@ transform1: T1,

destination: B,
options?: PipelineOptions
options?: PipelineOptions,
): PipelinePromise<B>;

@@ -24,4 +47,11 @@ function pipeline<

T3 extends PipelineTransform<T2, any>,
B extends PipelineDestination<T3, any>
>(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
B extends PipelineDestination<T3, any>,
>(
source: A,
transform1: T1,
transform2: T2,
transform3: T3,
destination: B,
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline<

@@ -33,6 +63,17 @@ A extends PipelineSource<any>,

T4 extends PipelineTransform<T3, any>,
B extends PipelineDestination<T4, any>
>(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
function pipeline(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
B extends PipelineDestination<T4, any>,
>(
source: A,
transform1: T1,
transform2: T2,
transform3: T3,
transform4: T4,
destination: B,
options?: PipelineOptions,
): PipelinePromise<B>;
function pipeline(
streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
options?: PipelineOptions,
): Promise<void>;
function pipeline(
stream1: NodeJS.ReadableStream,

@@ -43,4 +84,4 @@ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,

}
declare module 'node:stream/promises' {
export * from 'stream/promises';
declare module "node:stream/promises" {
export * from "stream/promises";
}

@@ -1,2 +0,2 @@

declare module 'stream/web' {
declare module "stream/web" {
// stub module, pending copy&paste from .d.ts or manual impl

@@ -77,3 +77,14 @@ // copy from lib.dom.d.ts

type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
type ReadableStreamDefaultReadResult<T> =
| ReadableStreamDefaultReadValueResult<T>
| ReadableStreamDefaultReadDoneResult;
interface ReadableStreamReadValueResult<T> {
done: false;
value: T;
}
interface ReadableStreamReadDoneResult<T> {
done: true;
value?: T;
}
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
interface ReadableByteStreamControllerCallback {

@@ -117,3 +128,3 @@ (controller: ReadableByteStreamController): void | PromiseLike<void>;

start?: ReadableByteStreamControllerCallback;
type: 'bytes';
type: "bytes";
}

@@ -141,2 +152,3 @@ interface UnderlyingSource<R = any> {

getReader(): ReadableStreamDefaultReader<R>;
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;

@@ -150,4 +162,4 @@ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;

prototype: ReadableStream;
new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
};

@@ -158,5 +170,9 @@ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {

}
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
releaseLock(): void;
}
const ReadableStreamDefaultReader: {
prototype: ReadableStreamDefaultReader;
new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
};

@@ -174,3 +190,3 @@ const ReadableStreamBYOBReader: any;

prototype: ReadableByteStreamController;
new (): ReadableByteStreamController;
new(): ReadableByteStreamController;
};

@@ -185,3 +201,3 @@ interface ReadableStreamDefaultController<R = any> {

prototype: ReadableStreamDefaultController;
new (): ReadableStreamDefaultController;
new(): ReadableStreamDefaultController;
};

@@ -201,3 +217,7 @@ interface Transformer<I = any, O = any> {

prototype: TransformStream;
new <I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;
new<I = any, O = any>(
transformer?: Transformer<I, O>,
writableStrategy?: QueuingStrategy<I>,
readableStrategy?: QueuingStrategy<O>,
): TransformStream<I, O>;
};

@@ -212,3 +232,3 @@ interface TransformStreamDefaultController<O = any> {

prototype: TransformStreamDefaultController;
new (): TransformStreamDefaultController;
new(): TransformStreamDefaultController;
};

@@ -228,3 +248,3 @@ /**

prototype: WritableStream;
new <W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
};

@@ -248,3 +268,3 @@ /**

prototype: WritableStreamDefaultWriter;
new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
};

@@ -262,3 +282,3 @@ /**

prototype: WritableStreamDefaultController;
new (): WritableStreamDefaultController;
new(): WritableStreamDefaultController;
};

@@ -294,3 +314,3 @@ interface QueuingStrategy<T = any> {

prototype: ByteLengthQueuingStrategy;
new (init: QueuingStrategyInit): ByteLengthQueuingStrategy;
new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
};

@@ -307,7 +327,7 @@ /**

prototype: CountQueuingStrategy;
new (init: QueuingStrategyInit): CountQueuingStrategy;
new(init: QueuingStrategyInit): CountQueuingStrategy;
};
interface TextEncoderStream {
/** Returns "utf-8". */
readonly encoding: 'utf-8';
readonly encoding: "utf-8";
readonly readable: ReadableStream<Uint8Array>;

@@ -319,3 +339,3 @@ readonly writable: WritableStream<string>;

prototype: TextEncoderStream;
new (): TextEncoderStream;
new(): TextEncoderStream;
};

@@ -340,7 +360,7 @@ interface TextDecoderOptions {

prototype: TextDecoderStream;
new (label?: string, options?: TextDecoderOptions): TextDecoderStream;
new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
};
}
declare module 'node:stream/web' {
export * from 'stream/web';
declare module "node:stream/web" {
export * from "stream/web";
}

@@ -17,6 +17,6 @@ /**

* const cent = Buffer.from([0xC2, 0xA2]);
* console.log(decoder.write(cent));
* console.log(decoder.write(cent)); // Prints: ¢
*
* const euro = Buffer.from([0xE2, 0x82, 0xAC]);
* console.log(decoder.write(euro));
* console.log(decoder.write(euro)); // Prints: €
* ```

@@ -38,7 +38,7 @@ *

* decoder.write(Buffer.from([0x82]));
* console.log(decoder.end(Buffer.from([0xAC])));
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
* ```
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js)
*/
declare module 'string_decoder' {
declare module "string_decoder" {
class StringDecoder {

@@ -51,3 +51,3 @@ constructor(encoding?: BufferEncoding);

* @since v0.1.99
* @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
* @param buffer The bytes to decode.
*/

@@ -63,3 +63,3 @@ write(buffer: Buffer): string;

* @since v0.9.3
* @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
* @param buffer The bytes to decode.
*/

@@ -69,4 +69,4 @@ end(buffer?: Buffer): string;

}
declare module 'node:string_decoder' {
export * from 'string_decoder';
declare module "node:string_decoder" {
export * from "string_decoder";
}

@@ -79,11 +79,13 @@ /**

* @since v18.0.0, v16.17.0
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test.js)
* @see [source](https://github.com/nodejs/node/blob/v20.4.0/lib/test.js)
*/
declare module 'node:test' {
import { Readable } from 'node:stream';
import { AsyncResource } from 'node:async_hooks';
declare module "node:test" {
import { Readable } from "node:stream";
import { AsyncResource } from "node:async_hooks";
/**
* ```js
* import { tap } from 'node:test/reporters';
* import { run } from 'node:test';
* import process from 'node:process';
* import path from 'node:path';
*

@@ -141,16 +143,3 @@ * run({ files: [path.resolve('./tests/test.js')] })

namespace test {
export {
after,
afterEach,
before,
beforeEach,
describe,
it,
run,
mock,
test,
skip,
todo,
only
};
export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
}

@@ -167,6 +156,6 @@ /**

*/
function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void;
function describe(name?: string, fn?: SuiteFn): void;
function describe(options?: TestOptions, fn?: SuiteFn): void;
function describe(fn?: SuiteFn): void;
function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
function describe(name?: string, fn?: SuiteFn): Promise<void>;
function describe(options?: TestOptions, fn?: SuiteFn): Promise<void>;
function describe(fn?: SuiteFn): Promise<void>;
namespace describe {

@@ -176,13 +165,13 @@ /**

*/
function skip(name?: string, options?: TestOptions, fn?: SuiteFn): void;
function skip(name?: string, fn?: SuiteFn): void;
function skip(options?: TestOptions, fn?: SuiteFn): void;
function skip(fn?: SuiteFn): void;
function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
function skip(name?: string, fn?: SuiteFn): Promise<void>;
function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
function skip(fn?: SuiteFn): Promise<void>;
/**
* Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`.
*/
function todo(name?: string, options?: TestOptions, fn?: SuiteFn): void;
function todo(name?: string, fn?: SuiteFn): void;
function todo(options?: TestOptions, fn?: SuiteFn): void;
function todo(fn?: SuiteFn): void;
function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
function todo(name?: string, fn?: SuiteFn): Promise<void>;
function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
function todo(fn?: SuiteFn): Promise<void>;
/**

@@ -192,6 +181,6 @@ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.

*/
function only(name?: string, options?: TestOptions, fn?: SuiteFn): void;
function only(name?: string, fn?: SuiteFn): void;
function only(options?: TestOptions, fn?: SuiteFn): void;
function only(fn?: SuiteFn): void;
function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
function only(name?: string, fn?: SuiteFn): Promise<void>;
function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
function only(fn?: SuiteFn): Promise<void>;
}

@@ -204,6 +193,6 @@ /**

*/
function it(name?: string, options?: TestOptions, fn?: TestFn): void;
function it(name?: string, fn?: TestFn): void;
function it(options?: TestOptions, fn?: TestFn): void;
function it(fn?: TestFn): void;
function it(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function it(name?: string, fn?: TestFn): Promise<void>;
function it(options?: TestOptions, fn?: TestFn): Promise<void>;
function it(fn?: TestFn): Promise<void>;
namespace it {

@@ -213,13 +202,13 @@ /**

*/
function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
function skip(name?: string, fn?: TestFn): void;
function skip(options?: TestOptions, fn?: TestFn): void;
function skip(fn?: TestFn): void;
function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function skip(name?: string, fn?: TestFn): Promise<void>;
function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
function skip(fn?: TestFn): Promise<void>;
/**
* Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
*/
function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
function todo(name?: string, fn?: TestFn): void;
function todo(options?: TestOptions, fn?: TestFn): void;
function todo(fn?: TestFn): void;
function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function todo(name?: string, fn?: TestFn): Promise<void>;
function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
function todo(fn?: TestFn): Promise<void>;
/**

@@ -229,6 +218,6 @@ * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.

*/
function only(name?: string, options?: TestOptions, fn?: TestFn): void;
function only(name?: string, fn?: TestFn): void;
function only(options?: TestOptions, fn?: TestFn): void;
function only(fn?: TestFn): void;
function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function only(name?: string, fn?: TestFn): Promise<void>;
function only(options?: TestOptions, fn?: TestFn): Promise<void>;
function only(fn?: TestFn): Promise<void>;
}

@@ -239,6 +228,6 @@ /**

*/
function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
function skip(name?: string, fn?: TestFn): void;
function skip(options?: TestOptions, fn?: TestFn): void;
function skip(fn?: TestFn): void;
function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function skip(name?: string, fn?: TestFn): Promise<void>;
function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
function skip(fn?: TestFn): Promise<void>;
/**

@@ -248,6 +237,6 @@ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.

*/
function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
function todo(name?: string, fn?: TestFn): void;
function todo(options?: TestOptions, fn?: TestFn): void;
function todo(fn?: TestFn): void;
function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function todo(name?: string, fn?: TestFn): Promise<void>;
function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
function todo(fn?: TestFn): Promise<void>;
/**

@@ -257,6 +246,6 @@ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.

*/
function only(name?: string, options?: TestOptions, fn?: TestFn): void;
function only(name?: string, fn?: TestFn): void;
function only(options?: TestOptions, fn?: TestFn): void;
function only(fn?: TestFn): void;
function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
function only(name?: string, fn?: TestFn): Promise<void>;
function only(options?: TestOptions, fn?: TestFn): Promise<void>;
function only(fn?: TestFn): Promise<void>;
/**

@@ -267,8 +256,17 @@ * The type of a function under test. The first argument to this function is a

*/
type TestFn = (t: TestContext, done: (result?: any) => void) => any;
type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise<void>;
/**
* The type of a function under Suite.
* If the test uses callbacks, the callback function is passed as an argument
*/
type SuiteFn = (done: (result?: any) => void) => void;
type SuiteFn = (s: SuiteContext) => void | Promise<void>;
interface TestShard {
/**
* A positive integer between 1 and `<total>` that specifies the index of the shard to run.
*/
index: number;
/**
* A positive integer that specifies the total number of shards to split the test files to.
*/
total: number;
}
interface RunOptions {

@@ -312,9 +310,19 @@ /**

/**
* If truthy, the test context will only run tests that have the `only` option set
*/
only?: boolean;
/**
* A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
*/
setup?: (root: unknown) => void | Promise<void>;
setup?: (root: Test) => void | Promise<void>;
/**
* Whether to run in watch mode or not. Default: false.
* Whether to run in watch mode or not.
* @default false
*/
watch?: boolean;
watch?: boolean | undefined;
/**
* Running tests in a specific shard.
* @default undefined
*/
shard?: TestShard | undefined;
}

@@ -336,49 +344,49 @@ class Test extends AsyncResource {

class TestsStream extends Readable implements NodeJS.ReadableStream {
addListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
addListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
addListener(event: 'test:start', listener: (data: TestStart) => void): this;
addListener(event: 'test:stderr', listener: (data: TestStderr) => void): this;
addListener(event: 'test:stdout', listener: (data: TestStdout) => void): this;
addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
addListener(event: "test:fail", listener: (data: TestFail) => void): this;
addListener(event: "test:pass", listener: (data: TestPass) => void): this;
addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
addListener(event: "test:start", listener: (data: TestStart) => void): this;
addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
addListener(event: string, listener: (...args: any[]) => void): this;
emit(event: 'test:diagnostic', data: DiagnosticData): boolean;
emit(event: 'test:fail', data: TestFail): boolean;
emit(event: 'test:pass', data: TestPass): boolean;
emit(event: 'test:plan', data: TestPlan): boolean;
emit(event: 'test:start', data: TestStart): boolean;
emit(event: 'test:stderr', data: TestStderr): boolean;
emit(event: 'test:stdout', data: TestStdout): boolean;
emit(event: "test:diagnostic", data: DiagnosticData): boolean;
emit(event: "test:fail", data: TestFail): boolean;
emit(event: "test:pass", data: TestPass): boolean;
emit(event: "test:plan", data: TestPlan): boolean;
emit(event: "test:start", data: TestStart): boolean;
emit(event: "test:stderr", data: TestStderr): boolean;
emit(event: "test:stdout", data: TestStdout): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
on(event: 'test:fail', listener: (data: TestFail) => void): this;
on(event: 'test:pass', listener: (data: TestPass) => void): this;
on(event: 'test:plan', listener: (data: TestPlan) => void): this;
on(event: 'test:start', listener: (data: TestStart) => void): this;
on(event: 'test:stderr', listener: (data: TestStderr) => void): this;
on(event: 'test:stdout', listener: (data: TestStdout) => void): this;
on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
on(event: "test:fail", listener: (data: TestFail) => void): this;
on(event: "test:pass", listener: (data: TestPass) => void): this;
on(event: "test:plan", listener: (data: TestPlan) => void): this;
on(event: "test:start", listener: (data: TestStart) => void): this;
on(event: "test:stderr", listener: (data: TestStderr) => void): this;
on(event: "test:stdout", listener: (data: TestStdout) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
once(event: 'test:fail', listener: (data: TestFail) => void): this;
once(event: 'test:pass', listener: (data: TestPass) => void): this;
once(event: 'test:plan', listener: (data: TestPlan) => void): this;
once(event: 'test:start', listener: (data: TestStart) => void): this;
once(event: 'test:stderr', listener: (data: TestStderr) => void): this;
once(event: 'test:stdout', listener: (data: TestStdout) => void): this;
once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
once(event: "test:fail", listener: (data: TestFail) => void): this;
once(event: "test:pass", listener: (data: TestPass) => void): this;
once(event: "test:plan", listener: (data: TestPlan) => void): this;
once(event: "test:start", listener: (data: TestStart) => void): this;
once(event: "test:stderr", listener: (data: TestStderr) => void): this;
once(event: "test:stdout", listener: (data: TestStdout) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependListener(event: 'test:stderr', listener: (data: TestStderr) => void): this;
prependListener(event: 'test:stdout', listener: (data: TestStdout) => void): this;
prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
prependListener(event: "test:start", listener: (data: TestStart) => void): this;
prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this;
prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this;
prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this;
prependOnceListener(event: 'test:stderr', listener: (data: TestStderr) => void): this;
prependOnceListener(event: 'test:stdout', listener: (data: TestStdout) => void): this;
prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this;
prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;

@@ -521,2 +529,20 @@ }

}
/**
* An instance of `SuiteContext` is passed to each suite function in order to
* interact with the test runner. However, the `SuiteContext` constructor is not
* exposed as part of the API.
* @since v18.7.0, v16.17.0
*/
class SuiteContext {
/**
* The name of the suite.
* @since v18.8.0, v16.18.0
*/
readonly name: string;
/**
* Can be used to abort test subtasks when the test has been aborted.
* @since v18.7.0, v16.17.0
*/
readonly signal: AbortSignal;
}
interface TestOptions {

@@ -633,3 +659,3 @@ /**

*/
type HookFn = (done: (result?: any) => void) => any;
type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
/**

@@ -725,3 +751,7 @@ * Configuration options for hooks.

fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(original?: F, implementation?: Implementation, options?: MockFunctionOptions): Mock<F | Implementation>;
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
original?: F,
implementation?: Implementation,
options?: MockFunctionOptions,
): Mock<F | Implementation>;
/**

@@ -770,4 +800,3 @@ * This function is used to create a mock on an existing object method. The

options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName]>
): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
: never;

@@ -783,4 +812,3 @@ method<

options?: MockFunctionOptions,
): MockedObject[MethodName] extends Function
? Mock<MockedObject[MethodName] | Implementation>
): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
: never;

@@ -866,12 +894,8 @@ method<MockedObject extends object>(

F extends Function,
ReturnType = F extends (...args: any) => infer T
? T
: F extends abstract new (...args: any) => infer T
? T
: unknown,
Args = F extends (...args: infer Y) => any
? Y
: F extends abstract new (...args: infer Y) => any
? Y
: unknown[],
ReturnType = F extends (...args: any) => infer T ? T
: F extends abstract new(...args: any) => infer T ? T
: unknown,
Args = F extends (...args: infer Y) => any ? Y
: F extends abstract new(...args: infer Y) => any ? Y
: unknown[],
> {

@@ -900,3 +924,3 @@ /**

*/
target: F extends abstract new (...args: any) => any ? F : undefined;
target: F extends abstract new(...args: any) => any ? F : undefined;
/**

@@ -1007,3 +1031,3 @@ * The mocked function's `this` value.

}
type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout';
type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout";
/**

@@ -1033,7 +1057,2 @@ * Mocking timers is a technique commonly used in software testing to simulate and

*
* ```js
* const { mock } = require('node:test');
* mock.timers.enable(['setInterval']);
* ```
*
* The above example enables mocking for the `setInterval` timer and

@@ -1062,7 +1081,2 @@ * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked.

* ```
*
* ```js
* const { mock } = require('node:test');
* mock.timers.reset();
* ```
* @since v20.4.0

@@ -1102,20 +1116,2 @@ */

*
* ```js
* const assert = require('node:assert');
* const { test } = require('node:test');
*
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
* const fn = context.mock.fn();
* context.mock.timers.enable(['setTimeout']);
*
* setTimeout(fn, 9999);
* assert.strictEqual(fn.mock.callCount(), 0);
*
* // Advance in time
* context.mock.timers.tick(9999);
*
* assert.strictEqual(fn.mock.callCount(), 1);
* });
* ```
*
* Alternativelly, the `.tick` function can be called many times

@@ -1141,21 +1137,2 @@ *

* ```
*
* ```js
* const assert = require('node:assert');
* const { test } = require('node:test');
*
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
* const fn = context.mock.fn();
* context.mock.timers.enable(['setTimeout']);
* const nineSecs = 9000;
* setTimeout(fn, nineSecs);
*
* const twoSeconds = 3000;
* context.mock.timers.tick(twoSeconds);
* context.mock.timers.tick(twoSeconds);
* context.mock.timers.tick(twoSeconds);
*
* assert.strictEqual(fn.mock.callCount(), 1);
* });
* ```
* @since v20.4.0

@@ -1192,24 +1169,2 @@ */

*
* ```js
* const assert = require('node:assert');
* const { test } = require('node:test');
*
* test('runAll functions following the given order', (context) => {
* context.mock.timers.enable(['setTimeout']);
* const results = [];
* setTimeout(() => results.push(1), 9999);
*
* // Notice that if both timers have the same timeout,
* // the order of execution is guaranteed
* setTimeout(() => results.push(3), 8888);
* setTimeout(() => results.push(2), 8888);
*
* assert.deepStrictEqual(results, []);
*
* context.mock.timers.runAll();
*
* assert.deepStrictEqual(results, [3, 2, 1]);
* });
* ```
*
* **Note:** The `runAll()` function is specifically designed for

@@ -1222,8 +1177,43 @@ * triggering timers in the context of timer mocking.

runAll(): void;
/**
* Calls {@link MockTimers.reset()}.
*/
[Symbol.dispose](): void;
}
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo };
export {
after,
afterEach,
before,
beforeEach,
describe,
it,
Mock,
mock,
only,
run,
skip,
test,
test as default,
todo,
};
}
interface DiagnosticData {
interface TestLocationInfo {
/**
* The column number where the test is defined, or
* `undefined` if the test was run through the REPL.
*/
column?: number;
/**
* The path of the test file, `undefined` if test is not ran through a file.
*/
file?: string;
/**
* The line number where the test is defined, or
* `undefined` if the test was run through the REPL.
*/
line?: number;
}
interface DiagnosticData extends TestLocationInfo {
/**
* The diagnostic message.

@@ -1236,8 +1226,4 @@ */

nesting: number;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestFail {
interface TestFail extends TestLocationInfo {
/**

@@ -1259,3 +1245,3 @@ * Additional execution metadata.

*/
type?: 'suite';
type?: "suite";
};

@@ -1282,8 +1268,4 @@ /**

skip?: string | boolean;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestPass {
interface TestPass extends TestLocationInfo {
/**

@@ -1301,3 +1283,3 @@ * Additional execution metadata.

*/
type?: 'suite';
type?: "suite";
};

@@ -1324,8 +1306,4 @@ /**

skip?: string | boolean;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestPlan {
interface TestPlan extends TestLocationInfo {
/**

@@ -1339,8 +1317,4 @@ * The nesting level of the test.

count: number;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestStart {
interface TestStart extends TestLocationInfo {
/**

@@ -1354,13 +1328,5 @@ * The test name.

nesting: number;
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
}
interface TestStderr {
interface TestStderr extends TestLocationInfo {
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The message written to `stderr`

@@ -1370,8 +1336,4 @@ */

}
interface TestStdout {
interface TestStdout extends TestLocationInfo {
/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The message written to `stdout`

@@ -1381,3 +1343,3 @@ */

}
interface TestEnqueue {
interface TestEnqueue extends TestLocationInfo {
/**

@@ -1388,6 +1350,2 @@ * The test name

/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The nesting level of the test.

@@ -1397,3 +1355,3 @@ */

}
interface TestDequeue {
interface TestDequeue extends TestLocationInfo {
/**

@@ -1404,6 +1362,2 @@ * The test name

/**
* The path of the test file, undefined if test is not ran through a file.
*/
file?: string;
/**
* The nesting level of the test.

@@ -1431,16 +1385,16 @@ */

*/
declare module 'node:test/reporters' {
import { Transform } from 'node:stream';
declare module "node:test/reporters" {
import { Transform } from "node:stream";
type TestEvent =
| { type: 'test:diagnostic', data: DiagnosticData }
| { type: 'test:fail', data: TestFail }
| { type: 'test:pass', data: TestPass }
| { type: 'test:plan', data: TestPlan }
| { type: 'test:start', data: TestStart }
| { type: 'test:stderr', data: TestStderr }
| { type: 'test:stdout', data: TestStdout }
| { type: 'test:enqueue', data: TestEnqueue }
| { type: 'test:dequeue', data: TestDequeue }
| { type: 'test:watch:drained' };
| { type: "test:diagnostic"; data: DiagnosticData }
| { type: "test:fail"; data: TestFail }
| { type: "test:pass"; data: TestPass }
| { type: "test:plan"; data: TestPlan }
| { type: "test:start"; data: TestStart }
| { type: "test:stderr"; data: TestStderr }
| { type: "test:stdout"; data: TestStdout }
| { type: "test:enqueue"; data: TestEnqueue }
| { type: "test:dequeue"; data: TestDequeue }
| { type: "test:watch:drained" };
type TestEventGenerator = AsyncGenerator<TestEvent, void>;

@@ -1453,3 +1407,3 @@

*/
function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>;
function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
/**

@@ -1465,3 +1419,7 @@ * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.

}
export { dot, tap, Spec as spec, TestEvent };
/**
* The `junit` reporter outputs test results in a jUnit XML format
*/
function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
export { dot, junit, Spec as spec, tap, TestEvent };
}

@@ -11,5 +11,9 @@ /**

*/
declare module 'timers' {
import { Abortable } from 'node:events';
import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises';
declare module "timers" {
import { Abortable } from "node:events";
import {
setImmediate as setImmediatePromise,
setInterval as setIntervalPromise,
setTimeout as setTimeoutPromise,
} from "node:timers/promises";
interface TimerOptions extends Abortable {

@@ -72,2 +76,7 @@ /**

_onImmediate: Function; // to distinguish it from the Timeout class
/**
* Cancels the immediate. This is similar to calling `clearImmediate()`.
* @since v20.5.0
*/
[Symbol.dispose](): void;
}

@@ -119,2 +128,7 @@ /**

[Symbol.toPrimitive](): number;
/**
* Cancels the timeout.
* @since v20.5.0
*/
[Symbol.dispose](): void;
}

@@ -141,3 +155,7 @@ }

*/
function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
function setTimeout<TArgs extends any[]>(
callback: (...args: TArgs) => void,
ms?: number,
...args: TArgs
): NodeJS.Timeout;
// util.promisify no rest args compability

@@ -170,6 +188,10 @@ // tslint:disable-next-line void-return

*/
function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
function setInterval<TArgs extends any[]>(
callback: (...args: TArgs) => void,
ms?: number,
...args: TArgs
): NodeJS.Timeout;
// util.promisify no rest args compability
// tslint:disable-next-line void-return
function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer;
function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
namespace setInterval {

@@ -202,3 +224,6 @@ const __promisify__: typeof setIntervalPromise;

*/
function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
function setImmediate<TArgs extends any[]>(
callback: (...args: TArgs) => void,
...args: TArgs
): NodeJS.Immediate;
// util.promisify no rest args compability

@@ -219,4 +244,4 @@ // tslint:disable-next-line void-return

}
declare module 'node:timers' {
export * from 'timers';
declare module "node:timers" {
export * from "timers";
}

@@ -14,4 +14,4 @@ /**

*/
declare module 'timers/promises' {
import { TimerOptions } from 'node:timers';
declare module "timers/promises" {
import { TimerOptions } from "node:timers";
/**

@@ -92,4 +92,4 @@ * ```js

}
declare module 'node:timers/promises' {
export * from 'timers/promises';
declare module "node:timers/promises" {
export * from "timers/promises";
}

@@ -11,6 +11,6 @@ /**

*/
declare module 'tls' {
import { X509Certificate } from 'node:crypto';
import * as net from 'node:net';
import * as stream from 'stream';
declare module "tls" {
import { X509Certificate } from "node:crypto";
import * as net from "node:net";
import * as stream from "stream";
const CLIENT_RENEG_LIMIT: number;

@@ -400,3 +400,3 @@ const CLIENT_RENEG_WINDOW: number;

},
callback: (err: Error | null) => void
callback: (err: Error | null) => void,
): undefined | boolean;

@@ -477,31 +477,31 @@ /**

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
addListener(event: 'secureConnect', listener: () => void): this;
addListener(event: 'session', listener: (session: Buffer) => void): this;
addListener(event: 'keylog', listener: (line: Buffer) => void): this;
addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
addListener(event: "secureConnect", listener: () => void): this;
addListener(event: "session", listener: (session: Buffer) => void): this;
addListener(event: "keylog", listener: (line: Buffer) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'OCSPResponse', response: Buffer): boolean;
emit(event: 'secureConnect'): boolean;
emit(event: 'session', session: Buffer): boolean;
emit(event: 'keylog', line: Buffer): boolean;
emit(event: "OCSPResponse", response: Buffer): boolean;
emit(event: "secureConnect"): boolean;
emit(event: "session", session: Buffer): boolean;
emit(event: "keylog", line: Buffer): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
on(event: 'secureConnect', listener: () => void): this;
on(event: 'session', listener: (session: Buffer) => void): this;
on(event: 'keylog', listener: (line: Buffer) => void): this;
on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
on(event: "secureConnect", listener: () => void): this;
on(event: "session", listener: (session: Buffer) => void): this;
on(event: "keylog", listener: (line: Buffer) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
once(event: 'secureConnect', listener: () => void): this;
once(event: 'session', listener: (session: Buffer) => void): this;
once(event: 'keylog', listener: (line: Buffer) => void): this;
once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
once(event: "secureConnect", listener: () => void): this;
once(event: "session", listener: (session: Buffer) => void): this;
once(event: "keylog", listener: (line: Buffer) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
prependListener(event: 'secureConnect', listener: () => void): this;
prependListener(event: 'session', listener: (session: Buffer) => void): this;
prependListener(event: 'keylog', listener: (line: Buffer) => void): this;
prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
prependListener(event: "secureConnect", listener: () => void): this;
prependListener(event: "session", listener: (session: Buffer) => void): this;
prependListener(event: "keylog", listener: (line: Buffer) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this;
prependOnceListener(event: 'secureConnect', listener: () => void): this;
prependOnceListener(event: 'session', listener: (session: Buffer) => void): this;
prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this;
prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
prependOnceListener(event: "secureConnect", listener: () => void): this;
prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
}

@@ -567,3 +567,2 @@ interface CommonConnectionOptions {

/**
*
* @param socket

@@ -684,43 +683,114 @@ * @param identity identity parameter sent from the client.

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
addListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
addListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
addListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean;
emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean;
emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean;
emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean;
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
emit(
event: "OCSPRequest",
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
): boolean;
emit(
event: "resumeSession",
sessionId: Buffer,
callback: (err: Error | null, sessionData: Buffer | null) => void,
): boolean;
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
on(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
on(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
once(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
once(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
once(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
prependListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
prependOnceListener(
event: "newSession",
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
): this;
prependOnceListener(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (err: Error | null, resp: Buffer) => void,
) => void,
): this;
prependOnceListener(
event: "resumeSession",
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
): this;
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
}

@@ -734,3 +804,3 @@ /**

}
type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
interface SecureContextOptions {

@@ -1017,3 +1087,8 @@ /**

function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
function connect(
port: number,
host?: string,
options?: ConnectionOptions,
secureConnectListener?: () => void,
): TLSSocket;
function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;

@@ -1053,3 +1128,8 @@ /**

*/
function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
function createSecurePair(
context?: SecureContext,
isServer?: boolean,
requestCert?: boolean,
rejectUnauthorized?: boolean,
): SecurePair;
/**

@@ -1136,4 +1216,4 @@ * {@link createServer} sets the default value of the `honorCipherOrder` option

}
declare module 'node:tls' {
export * from 'tls';
declare module "node:tls" {
export * from "tls";
}

@@ -99,3 +99,3 @@ /**

*/
declare module 'trace_events' {
declare module "trace_events" {
/**

@@ -181,4 +181,4 @@ * The `Tracing` object is used to enable or disable tracing for sets of

}
declare module 'node:trace_events' {
export * from 'trace_events';
declare module "node:trace_events" {
export * from "trace_events";
}

@@ -26,4 +26,4 @@ /**

*/
declare module 'tty' {
import * as net from 'node:net';
declare module "tty" {
import * as net from "node:net";
/**

@@ -87,13 +87,13 @@ * The `tty.isatty()` method returns `true` if the given `fd` is associated with

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'resize', listener: () => void): this;
addListener(event: "resize", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'resize'): boolean;
emit(event: "resize"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'resize', listener: () => void): this;
on(event: "resize", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'resize', listener: () => void): this;
once(event: "resize", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'resize', listener: () => void): this;
prependListener(event: "resize", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'resize', listener: () => void): this;
prependOnceListener(event: "resize", listener: () => void): this;
/**

@@ -208,4 +208,4 @@ * `writeStream.clearLine()` clears the current line of this `WriteStream` in a

}
declare module 'node:tty' {
export * from 'tty';
declare module "node:tty" {
export * from "tty";
}

@@ -10,6 +10,6 @@ /**

*/
declare module 'url' {
import { Blob as NodeBlob } from 'node:buffer';
import { ClientRequestArgs } from 'node:http';
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring';
declare module "url" {
import { Blob as NodeBlob } from "node:buffer";
import { ClientRequestArgs } from "node:http";
import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
// Input to `url.format`

@@ -70,3 +70,7 @@ interface UrlObject {

function parse(urlString: string): UrlWithStringQuery;
function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
function parse(
urlString: string,
parseQueryString: false | undefined,
slashesDenoteHost?: boolean,
): UrlWithStringQuery;
function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;

@@ -761,3 +765,10 @@ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;

class URLSearchParams implements Iterable<[string, string]> {
constructor(init?: URLSearchParams | string | Record<string, string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
constructor(
init?:
| URLSearchParams
| string
| Record<string, string | ReadonlyArray<string>>
| Iterable<[string, string]>
| ReadonlyArray<[string, string]>,
);
/**

@@ -796,3 +807,6 @@ * Append a new name-value pair to the query string.

*/
forEach<TThis = this>(callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: TThis): void;
forEach<TThis = this>(
callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void,
thisArg?: TThis,
): void;
/**

@@ -885,3 +899,3 @@ * Returns the value of the first name-value pair whose name is `name`. If there

}
import { URL as _URL, URLSearchParams as _URLSearchParams } from 'url';
import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
global {

@@ -902,4 +916,3 @@ interface URLSearchParams extends _URLSearchParams {}

URL: infer T;
}
? T
} ? T
: typeof _URL;

@@ -914,9 +927,8 @@ /**

URLSearchParams: infer T;
}
? T
} ? T
: typeof _URLSearchParams;
}
}
declare module 'node:url' {
export * from 'url';
declare module "node:url" {
export * from "url";
}

@@ -9,4 +9,4 @@ /**

*/
declare module 'v8' {
import { Readable } from 'node:stream';
declare module "v8" {
import { Readable } from "node:stream";
interface HeapSpaceInfo {

@@ -634,4 +634,4 @@ space_name: string;

}
declare module 'node:v8' {
export * from 'v8';
declare module "node:v8" {
export * from "v8";
}

@@ -39,3 +39,4 @@ /**

*/
declare module 'vm' {
declare module "vm" {
import { ImportAssertions } from "node:module";
interface Context extends NodeJS.Dict<any> {}

@@ -70,3 +71,5 @@ interface BaseOptions {

*/
importModuleDynamically?: ((specifier: string, script: Script, importAssertions: Object) => Module) | undefined;
importModuleDynamically?:
| ((specifier: string, script: Script, importAssertions: ImportAssertions) => Module)
| undefined;
}

@@ -96,3 +99,3 @@ interface RunningScriptOptions extends BaseOptions {

*/
contextName?: CreateContextOptions['name'];
contextName?: CreateContextOptions["name"];
/**

@@ -103,16 +106,16 @@ * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,

*/
contextOrigin?: CreateContextOptions['origin'];
contextCodeGeneration?: CreateContextOptions['codeGeneration'];
contextOrigin?: CreateContextOptions["origin"];
contextCodeGeneration?: CreateContextOptions["codeGeneration"];
/**
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
*/
microtaskMode?: CreateContextOptions['microtaskMode'];
microtaskMode?: CreateContextOptions["microtaskMode"];
}
interface RunningCodeOptions extends RunningScriptOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
cachedData?: ScriptOptions["cachedData"];
importModuleDynamically?: ScriptOptions["importModuleDynamically"];
}
interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
cachedData?: ScriptOptions["cachedData"];
importModuleDynamically?: ScriptOptions["importModuleDynamically"];
}

@@ -154,14 +157,14 @@ interface CompileFunctionOptions extends BaseOptions {

| {
/**
* If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
* will throw an EvalError.
* @default true
*/
strings?: boolean | undefined;
/**
* If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
* @default true
*/
wasm?: boolean | undefined;
}
/**
* If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
* will throw an EvalError.
* @default true
*/
strings?: boolean | undefined;
/**
* If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
* @default true
*/
wasm?: boolean | undefined;
}
| undefined;

@@ -171,5 +174,5 @@ /**

*/
microtaskMode?: 'afterEvaluate' | undefined;
microtaskMode?: "afterEvaluate" | undefined;
}
type MeasureMemoryMode = 'summary' | 'detailed';
type MeasureMemoryMode = "summary" | "detailed";
interface MeasureMemoryOptions {

@@ -183,3 +186,3 @@ /**

*/
execution?: 'default' | 'eager' | undefined;
execution?: "default" | "eager" | undefined;
}

@@ -451,3 +454,7 @@ interface MemoryMeasurement {

*/
function runInNewContext(code: string, contextObject?: Context, options?: RunningCodeInNewContextOptions | string): any;
function runInNewContext(
code: string,
contextObject?: Context,
options?: RunningCodeInNewContextOptions | string,
): any;
/**

@@ -527,7 +534,7 @@ * `vm.runInThisContext()` compiles `code`, runs it within the context of the

params?: ReadonlyArray<string>,
options?: CompileFunctionOptions
options?: CompileFunctionOptions,
): Function & {
cachedData?: Script['cachedData'] | undefined;
cachedDataProduced?: Script['cachedDataProduced'] | undefined;
cachedDataRejected?: Script['cachedDataRejected'] | undefined;
cachedData?: Script["cachedData"] | undefined;
cachedDataProduced?: Script["cachedDataProduced"] | undefined;
cachedDataRejected?: Script["cachedDataRejected"] | undefined;
};

@@ -591,4 +598,4 @@ /**

interface ModuleEvaluateOptions {
timeout?: RunningScriptOptions['timeout'] | undefined;
breakOnSigint?: RunningScriptOptions['breakOnSigint'] | undefined;
timeout?: RunningScriptOptions["timeout"] | undefined;
breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
}

@@ -600,5 +607,5 @@ type ModuleLinker = (

assert: Object;
}
},
) => Module | Promise<Module>;
type ModuleStatus = 'unlinked' | 'linking' | 'linked' | 'evaluating' | 'evaluated' | 'errored';
type ModuleStatus = "unlinked" | "linking" | "linked" | "evaluating" | "evaluated" | "errored";
/**

@@ -808,6 +815,6 @@ * This feature is only available with the `--experimental-vm-modules` command

identifier?: string | undefined;
cachedData?: ScriptOptions['cachedData'] | undefined;
cachedData?: ScriptOptions["cachedData"] | undefined;
context?: Context | undefined;
lineOffset?: BaseOptions['lineOffset'] | undefined;
columnOffset?: BaseOptions['columnOffset'] | undefined;
lineOffset?: BaseOptions["lineOffset"] | undefined;
columnOffset?: BaseOptions["columnOffset"] | undefined;
/**

@@ -817,3 +824,3 @@ * Called during evaluation of this module to initialize the `import.meta`.

initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
importModuleDynamically?: ScriptOptions['importModuleDynamically'] | undefined;
importModuleDynamically?: ScriptOptions["importModuleDynamically"] | undefined;
}

@@ -824,4 +831,2 @@ /**

*
*
*
* The `vm.SourceTextModule` class provides the [Source Text Module Record](https://tc39.es/ecma262/#sec-source-text-module-records) as

@@ -854,4 +859,2 @@ * defined in the ECMAScript specification.

*
*
*
* The `vm.SyntheticModule` class provides the [Synthetic Module Record](https://heycam.github.io/webidl/#synthetic-module-records) as

@@ -882,3 +885,7 @@ * defined in the WebIDL specification. The purpose of synthetic modules is to

*/
constructor(exportNames: string[], evaluateCallback: (this: SyntheticModule) => void, options?: SyntheticModuleOptions);
constructor(
exportNames: string[],
evaluateCallback: (this: SyntheticModule) => void,
options?: SyntheticModuleOptions,
);
/**

@@ -908,4 +915,4 @@ * This method is used after the module is linked to set the values of exports. If

}
declare module 'node:vm' {
export * from 'vm';
declare module "node:vm" {
export * from "vm";
}

@@ -67,3 +67,3 @@ /**

*/
declare module 'wasi' {
declare module "wasi" {
interface WASIOptions {

@@ -151,4 +151,4 @@ /**

}
declare module 'node:wasi' {
export * from 'wasi';
declare module "node:wasi" {
export * from "wasi";
}

@@ -54,11 +54,11 @@ /**

*/
declare module 'worker_threads' {
import { Blob } from 'node:buffer';
import { Context } from 'node:vm';
import { EventEmitter } from 'node:events';
import { EventLoopUtilityFunction } from 'node:perf_hooks';
import { FileHandle } from 'node:fs/promises';
import { Readable, Writable } from 'node:stream';
import { URL } from 'node:url';
import { X509Certificate } from 'node:crypto';
declare module "worker_threads" {
import { Blob } from "node:buffer";
import { Context } from "node:vm";
import { EventEmitter } from "node:events";
import { EventLoopUtilityFunction } from "node:perf_hooks";
import { FileHandle } from "node:fs/promises";
import { Readable, Writable } from "node:stream";
import { URL } from "node:url";
import { X509Certificate } from "node:crypto";
const isMainThread: boolean;

@@ -209,33 +209,33 @@ const parentPort: null | MessagePort;

start(): void;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'message', listener: (value: any) => void): this;
addListener(event: 'messageerror', listener: (error: Error) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "message", listener: (value: any) => void): this;
addListener(event: "messageerror", listener: (error: Error) => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
emit(event: 'close'): boolean;
emit(event: 'message', value: any): boolean;
emit(event: 'messageerror', error: Error): boolean;
emit(event: "close"): boolean;
emit(event: "message", value: any): boolean;
emit(event: "messageerror", error: Error): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'close', listener: () => void): this;
on(event: 'message', listener: (value: any) => void): this;
on(event: 'messageerror', listener: (error: Error) => void): this;
on(event: "close", listener: () => void): this;
on(event: "message", listener: (value: any) => void): this;
on(event: "messageerror", listener: (error: Error) => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'message', listener: (value: any) => void): this;
once(event: 'messageerror', listener: (error: Error) => void): this;
once(event: "close", listener: () => void): this;
once(event: "message", listener: (value: any) => void): this;
once(event: "messageerror", listener: (error: Error) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'message', listener: (value: any) => void): this;
prependListener(event: 'messageerror', listener: (error: Error) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "message", listener: (value: any) => void): this;
prependListener(event: "messageerror", listener: (error: Error) => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'message', listener: (value: any) => void): this;
prependOnceListener(event: 'messageerror', listener: (error: Error) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "message", listener: (value: any) => void): this;
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: 'close', listener: () => void): this;
removeListener(event: 'message', listener: (value: any) => void): this;
removeListener(event: 'messageerror', listener: (error: Error) => void): this;
removeListener(event: "close", listener: () => void): this;
removeListener(event: "message", listener: (value: any) => void): this;
removeListener(event: "messageerror", listener: (error: Error) => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
off(event: 'close', listener: () => void): this;
off(event: 'message', listener: (value: any) => void): this;
off(event: 'messageerror', listener: (error: Error) => void): this;
off(event: "close", listener: () => void): this;
off(event: "message", listener: (value: any) => void): this;
off(event: "messageerror", listener: (error: Error) => void): this;
off(event: string | symbol, listener: (...args: any[]) => void): this;

@@ -308,3 +308,4 @@ }

* unless otherwise specified. Changes to one copy are not visible in other
* threads, and are not visible to native add-ons (unless `worker.SHARE_ENV` is passed as the `env` option to the `Worker` constructor).
* threads, and are not visible to native add-ons (unless `worker.SHARE_ENV` is passed as the `env` option to the `Worker` constructor). On Windows, unlike the main thread, a copy of the
* environment variables operates in a case-sensitive manner.
* * `process.title` cannot be modified.

@@ -440,49 +441,49 @@ * * Signals are not delivered through `process.on('...')`.

getHeapSnapshot(): Promise<Readable>;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'exit', listener: (exitCode: number) => void): this;
addListener(event: 'message', listener: (value: any) => void): this;
addListener(event: 'messageerror', listener: (error: Error) => void): this;
addListener(event: 'online', listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "exit", listener: (exitCode: number) => void): this;
addListener(event: "message", listener: (value: any) => void): this;
addListener(event: "messageerror", listener: (error: Error) => void): this;
addListener(event: "online", listener: () => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
emit(event: 'error', err: Error): boolean;
emit(event: 'exit', exitCode: number): boolean;
emit(event: 'message', value: any): boolean;
emit(event: 'messageerror', error: Error): boolean;
emit(event: 'online'): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "exit", exitCode: number): boolean;
emit(event: "message", value: any): boolean;
emit(event: "messageerror", error: Error): boolean;
emit(event: "online"): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'exit', listener: (exitCode: number) => void): this;
on(event: 'message', listener: (value: any) => void): this;
on(event: 'messageerror', listener: (error: Error) => void): this;
on(event: 'online', listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "exit", listener: (exitCode: number) => void): this;
on(event: "message", listener: (value: any) => void): this;
on(event: "messageerror", listener: (error: Error) => void): this;
on(event: "online", listener: () => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'exit', listener: (exitCode: number) => void): this;
once(event: 'message', listener: (value: any) => void): this;
once(event: 'messageerror', listener: (error: Error) => void): this;
once(event: 'online', listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "exit", listener: (exitCode: number) => void): this;
once(event: "message", listener: (value: any) => void): this;
once(event: "messageerror", listener: (error: Error) => void): this;
once(event: "online", listener: () => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'exit', listener: (exitCode: number) => void): this;
prependListener(event: 'message', listener: (value: any) => void): this;
prependListener(event: 'messageerror', listener: (error: Error) => void): this;
prependListener(event: 'online', listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "exit", listener: (exitCode: number) => void): this;
prependListener(event: "message", listener: (value: any) => void): this;
prependListener(event: "messageerror", listener: (error: Error) => void): this;
prependListener(event: "online", listener: () => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'exit', listener: (exitCode: number) => void): this;
prependOnceListener(event: 'message', listener: (value: any) => void): this;
prependOnceListener(event: 'messageerror', listener: (error: Error) => void): this;
prependOnceListener(event: 'online', listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
prependOnceListener(event: "message", listener: (value: any) => void): this;
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
prependOnceListener(event: "online", listener: () => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: 'error', listener: (err: Error) => void): this;
removeListener(event: 'exit', listener: (exitCode: number) => void): this;
removeListener(event: 'message', listener: (value: any) => void): this;
removeListener(event: 'messageerror', listener: (error: Error) => void): this;
removeListener(event: 'online', listener: () => void): this;
removeListener(event: "error", listener: (err: Error) => void): this;
removeListener(event: "exit", listener: (exitCode: number) => void): this;
removeListener(event: "message", listener: (value: any) => void): this;
removeListener(event: "messageerror", listener: (error: Error) => void): this;
removeListener(event: "online", listener: () => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
off(event: 'error', listener: (err: Error) => void): this;
off(event: 'exit', listener: (exitCode: number) => void): this;
off(event: 'message', listener: (value: any) => void): this;
off(event: 'messageerror', listener: (error: Error) => void): this;
off(event: 'online', listener: () => void): this;
off(event: "error", listener: (err: Error) => void): this;
off(event: "exit", listener: (exitCode: number) => void): this;
off(event: "message", listener: (value: any) => void): this;
off(event: "messageerror", listener: (error: Error) => void): this;
off(event: "online", listener: () => void): this;
off(event: string | symbol, listener: (...args: any[]) => void): this;

@@ -616,4 +617,4 @@ }

| {
message: any;
}
message: any;
}
| undefined;

@@ -659,3 +660,3 @@ type Serializable = string | object | number | boolean | bigint;

MessagePort as _MessagePort,
} from 'worker_threads';
} from "worker_threads";
global {

@@ -670,4 +671,3 @@ /**

BroadcastChannel: infer T;
}
? T
} ? T
: typeof _BroadcastChannel;

@@ -682,4 +682,3 @@ /**

MessageChannel: infer T;
}
? T
} ? T
: typeof _MessageChannel;

@@ -694,9 +693,8 @@ /**

MessagePort: infer T;
}
? T
} ? T
: typeof _MessagePort;
}
}
declare module 'node:worker_threads' {
export * from 'worker_threads';
declare module "node:worker_threads" {
export * from "worker_threads";
}

@@ -93,4 +93,4 @@ /**

*/
declare module 'zlib' {
import * as stream from 'node:stream';
declare module "zlib" {
import * as stream from "node:stream";
interface ZlibOptions {

@@ -132,7 +132,7 @@ /**

| {
/**
* Each key is a `constants.BROTLI_*` constant.
*/
[key: number]: boolean | number;
}
/**
* Each key is a `constants.BROTLI_*` constant.
*/
[key: number]: boolean | number;
}
| undefined;

@@ -517,4 +517,4 @@ maxOutputLength?: number | undefined;

}
declare module 'node:zlib' {
export * from 'zlib';
declare module "node:zlib" {
export * from "zlib";
}

@@ -26,4 +26,4 @@ /**

*/
declare module 'tty' {
import * as net from 'node:net';
declare module "tty" {
import * as net from "node:net";
/**

@@ -87,13 +87,13 @@ * The `tty.isatty()` method returns `true` if the given `fd` is associated with

addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'resize', listener: () => void): this;
addListener(event: "resize", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: 'resize'): boolean;
emit(event: "resize"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: 'resize', listener: () => void): this;
on(event: "resize", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: 'resize', listener: () => void): this;
once(event: "resize", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: 'resize', listener: () => void): this;
prependListener(event: "resize", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'resize', listener: () => void): this;
prependOnceListener(event: "resize", listener: () => void): this;
/**

@@ -208,4 +208,4 @@ * `writeStream.clearLine()` clears the current line of this `WriteStream` in a

}
declare module 'node:tty' {
export * from 'tty';
declare module "node:tty" {
export * from "tty";
}

@@ -10,6 +10,6 @@ /**

*/
declare module 'url' {
import { Blob as NodeBlob } from 'node:buffer';
import { ClientRequestArgs } from 'node:http';
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring';
declare module "url" {
import { Blob as NodeBlob } from "node:buffer";
import { ClientRequestArgs } from "node:http";
import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
// Input to `url.format`

@@ -70,3 +70,7 @@ interface UrlObject {

function parse(urlString: string): UrlWithStringQuery;
function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
function parse(
urlString: string,
parseQueryString: false | undefined,
slashesDenoteHost?: boolean,
): UrlWithStringQuery;
function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;

@@ -761,3 +765,10 @@ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;

class URLSearchParams implements Iterable<[string, string]> {
constructor(init?: URLSearchParams | string | Record<string, string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
constructor(
init?:
| URLSearchParams
| string
| Record<string, string | ReadonlyArray<string>>
| Iterable<[string, string]>
| ReadonlyArray<[string, string]>,
);
/**

@@ -796,3 +807,6 @@ * Append a new name-value pair to the query string.

*/
forEach<TThis = this>(callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: TThis): void;
forEach<TThis = this>(
callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void,
thisArg?: TThis,
): void;
/**

@@ -885,3 +899,3 @@ * Returns the value of the first name-value pair whose name is `name`. If there

}
import { URL as _URL, URLSearchParams as _URLSearchParams } from 'url';
import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
global {

@@ -902,4 +916,3 @@ interface URLSearchParams extends _URLSearchParams {}

URL: infer T;
}
? T
} ? T
: typeof _URL;

@@ -914,9 +927,8 @@ /**

URLSearchParams: infer T;
}
? T
} ? T
: typeof _URLSearchParams;
}
}
declare module 'node:url' {
export * from 'url';
declare module "node:url" {
export * from "url";
}

@@ -9,4 +9,4 @@ /**

*/
declare module 'v8' {
import { Readable } from 'node:stream';
declare module "v8" {
import { Readable } from "node:stream";
interface HeapSpaceInfo {

@@ -634,4 +634,4 @@ space_name: string;

}
declare module 'node:v8' {
export * from 'v8';
declare module "node:v8" {
export * from "v8";
}

@@ -39,3 +39,4 @@ /**

*/
declare module 'vm' {
declare module "vm" {
import { ImportAssertions } from "node:module";
interface Context extends NodeJS.Dict<any> {}

@@ -70,3 +71,5 @@ interface BaseOptions {

*/
importModuleDynamically?: ((specifier: string, script: Script, importAssertions: Object) => Module) | undefined;
importModuleDynamically?:
| ((specifier: string, script: Script, importAssertions: ImportAssertions) => Module)
| undefined;
}

@@ -96,3 +99,3 @@ interface RunningScriptOptions extends BaseOptions {

*/
contextName?: CreateContextOptions['name'];
contextName?: CreateContextOptions["name"];
/**

@@ -103,16 +106,16 @@ * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,

*/
contextOrigin?: CreateContextOptions['origin'];
contextCodeGeneration?: CreateContextOptions['codeGeneration'];
contextOrigin?: CreateContextOptions["origin"];
contextCodeGeneration?: CreateContextOptions["codeGeneration"];
/**
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
*/
microtaskMode?: CreateContextOptions['microtaskMode'];
microtaskMode?: CreateContextOptions["microtaskMode"];
}
interface RunningCodeOptions extends RunningScriptOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
cachedData?: ScriptOptions["cachedData"];
importModuleDynamically?: ScriptOptions["importModuleDynamically"];
}
interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
cachedData?: ScriptOptions['cachedData'];
importModuleDynamically?: ScriptOptions['importModuleDynamically'];
cachedData?: ScriptOptions["cachedData"];
importModuleDynamically?: ScriptOptions["importModuleDynamically"];
}

@@ -154,14 +157,14 @@ interface CompileFunctionOptions extends BaseOptions {

| {
/**
* If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
* will throw an EvalError.
* @default true
*/
strings?: boolean | undefined;
/**
* If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
* @default true
*/
wasm?: boolean | undefined;
}
/**
* If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
* will throw an EvalError.
* @default true
*/
strings?: boolean | undefined;
/**
* If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
* @default true
*/
wasm?: boolean | undefined;
}
| undefined;

@@ -171,5 +174,5 @@ /**

*/
microtaskMode?: 'afterEvaluate' | undefined;
microtaskMode?: "afterEvaluate" | undefined;
}
type MeasureMemoryMode = 'summary' | 'detailed';
type MeasureMemoryMode = "summary" | "detailed";
interface MeasureMemoryOptions {

@@ -183,3 +186,3 @@ /**

*/
execution?: 'default' | 'eager' | undefined;
execution?: "default" | "eager" | undefined;
}

@@ -451,3 +454,7 @@ interface MemoryMeasurement {

*/
function runInNewContext(code: string, contextObject?: Context, options?: RunningCodeInNewContextOptions | string): any;
function runInNewContext(
code: string,
contextObject?: Context,
options?: RunningCodeInNewContextOptions | string,
): any;
/**

@@ -527,7 +534,7 @@ * `vm.runInThisContext()` compiles `code`, runs it within the context of the

params?: ReadonlyArray<string>,
options?: CompileFunctionOptions
options?: CompileFunctionOptions,
): Function & {
cachedData?: Script['cachedData'] | undefined;
cachedDataProduced?: Script['cachedDataProduced'] | undefined;
cachedDataRejected?: Script['cachedDataRejected'] | undefined;
cachedData?: Script["cachedData"] | undefined;
cachedDataProduced?: Script["cachedDataProduced"] | undefined;
cachedDataRejected?: Script["cachedDataRejected"] | undefined;
};

@@ -591,4 +598,4 @@ /**

interface ModuleEvaluateOptions {
timeout?: RunningScriptOptions['timeout'] | undefined;
breakOnSigint?: RunningScriptOptions['breakOnSigint'] | undefined;
timeout?: RunningScriptOptions["timeout"] | undefined;
breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
}

@@ -600,5 +607,5 @@ type ModuleLinker = (

assert: Object;
}
},
) => Module | Promise<Module>;
type ModuleStatus = 'unlinked' | 'linking' | 'linked' | 'evaluating' | 'evaluated' | 'errored';
type ModuleStatus = "unlinked" | "linking" | "linked" | "evaluating" | "evaluated" | "errored";
/**

@@ -808,6 +815,6 @@ * This feature is only available with the `--experimental-vm-modules` command

identifier?: string | undefined;
cachedData?: ScriptOptions['cachedData'] | undefined;
cachedData?: ScriptOptions["cachedData"] | undefined;
context?: Context | undefined;
lineOffset?: BaseOptions['lineOffset'] | undefined;
columnOffset?: BaseOptions['columnOffset'] | undefined;
lineOffset?: BaseOptions["lineOffset"] | undefined;
columnOffset?: BaseOptions["columnOffset"] | undefined;
/**

@@ -817,3 +824,3 @@ * Called during evaluation of this module to initialize the `import.meta`.

initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
importModuleDynamically?: ScriptOptions['importModuleDynamically'] | undefined;
importModuleDynamically?: ScriptOptions["importModuleDynamically"] | undefined;
}

@@ -824,4 +831,2 @@ /**

*
*
*
* The `vm.SourceTextModule` class provides the [Source Text Module Record](https://tc39.es/ecma262/#sec-source-text-module-records) as

@@ -854,4 +859,2 @@ * defined in the ECMAScript specification.

*
*
*
* The `vm.SyntheticModule` class provides the [Synthetic Module Record](https://heycam.github.io/webidl/#synthetic-module-records) as

@@ -882,3 +885,7 @@ * defined in the WebIDL specification. The purpose of synthetic modules is to

*/
constructor(exportNames: string[], evaluateCallback: (this: SyntheticModule) => void, options?: SyntheticModuleOptions);
constructor(
exportNames: string[],
evaluateCallback: (this: SyntheticModule) => void,
options?: SyntheticModuleOptions,
);
/**

@@ -908,4 +915,4 @@ * This method is used after the module is linked to set the values of exports. If

}
declare module 'node:vm' {
export * from 'vm';
declare module "node:vm" {
export * from "vm";
}

@@ -67,3 +67,3 @@ /**

*/
declare module 'wasi' {
declare module "wasi" {
interface WASIOptions {

@@ -151,4 +151,4 @@ /**

}
declare module 'node:wasi' {
export * from 'wasi';
declare module "node:wasi" {
export * from "wasi";
}

@@ -54,11 +54,11 @@ /**

*/
declare module 'worker_threads' {
import { Blob } from 'node:buffer';
import { Context } from 'node:vm';
import { EventEmitter } from 'node:events';
import { EventLoopUtilityFunction } from 'node:perf_hooks';
import { FileHandle } from 'node:fs/promises';
import { Readable, Writable } from 'node:stream';
import { URL } from 'node:url';
import { X509Certificate } from 'node:crypto';
declare module "worker_threads" {
import { Blob } from "node:buffer";
import { Context } from "node:vm";
import { EventEmitter } from "node:events";
import { EventLoopUtilityFunction } from "node:perf_hooks";
import { FileHandle } from "node:fs/promises";
import { Readable, Writable } from "node:stream";
import { URL } from "node:url";
import { X509Certificate } from "node:crypto";
const isMainThread: boolean;

@@ -209,33 +209,33 @@ const parentPort: null | MessagePort;

start(): void;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'message', listener: (value: any) => void): this;
addListener(event: 'messageerror', listener: (error: Error) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "message", listener: (value: any) => void): this;
addListener(event: "messageerror", listener: (error: Error) => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
emit(event: 'close'): boolean;
emit(event: 'message', value: any): boolean;
emit(event: 'messageerror', error: Error): boolean;
emit(event: "close"): boolean;
emit(event: "message", value: any): boolean;
emit(event: "messageerror", error: Error): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'close', listener: () => void): this;
on(event: 'message', listener: (value: any) => void): this;
on(event: 'messageerror', listener: (error: Error) => void): this;
on(event: "close", listener: () => void): this;
on(event: "message", listener: (value: any) => void): this;
on(event: "messageerror", listener: (error: Error) => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'message', listener: (value: any) => void): this;
once(event: 'messageerror', listener: (error: Error) => void): this;
once(event: "close", listener: () => void): this;
once(event: "message", listener: (value: any) => void): this;
once(event: "messageerror", listener: (error: Error) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'message', listener: (value: any) => void): this;
prependListener(event: 'messageerror', listener: (error: Error) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "message", listener: (value: any) => void): this;
prependListener(event: "messageerror", listener: (error: Error) => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'message', listener: (value: any) => void): this;
prependOnceListener(event: 'messageerror', listener: (error: Error) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "message", listener: (value: any) => void): this;
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: 'close', listener: () => void): this;
removeListener(event: 'message', listener: (value: any) => void): this;
removeListener(event: 'messageerror', listener: (error: Error) => void): this;
removeListener(event: "close", listener: () => void): this;
removeListener(event: "message", listener: (value: any) => void): this;
removeListener(event: "messageerror", listener: (error: Error) => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
off(event: 'close', listener: () => void): this;
off(event: 'message', listener: (value: any) => void): this;
off(event: 'messageerror', listener: (error: Error) => void): this;
off(event: "close", listener: () => void): this;
off(event: "message", listener: (value: any) => void): this;
off(event: "messageerror", listener: (error: Error) => void): this;
off(event: string | symbol, listener: (...args: any[]) => void): this;

@@ -308,3 +308,4 @@ }

* unless otherwise specified. Changes to one copy are not visible in other
* threads, and are not visible to native add-ons (unless `worker.SHARE_ENV` is passed as the `env` option to the `Worker` constructor).
* threads, and are not visible to native add-ons (unless `worker.SHARE_ENV` is passed as the `env` option to the `Worker` constructor). On Windows, unlike the main thread, a copy of the
* environment variables operates in a case-sensitive manner.
* * `process.title` cannot be modified.

@@ -440,49 +441,49 @@ * * Signals are not delivered through `process.on('...')`.

getHeapSnapshot(): Promise<Readable>;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'exit', listener: (exitCode: number) => void): this;
addListener(event: 'message', listener: (value: any) => void): this;
addListener(event: 'messageerror', listener: (error: Error) => void): this;
addListener(event: 'online', listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "exit", listener: (exitCode: number) => void): this;
addListener(event: "message", listener: (value: any) => void): this;
addListener(event: "messageerror", listener: (error: Error) => void): this;
addListener(event: "online", listener: () => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
emit(event: 'error', err: Error): boolean;
emit(event: 'exit', exitCode: number): boolean;
emit(event: 'message', value: any): boolean;
emit(event: 'messageerror', error: Error): boolean;
emit(event: 'online'): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "exit", exitCode: number): boolean;
emit(event: "message", value: any): boolean;
emit(event: "messageerror", error: Error): boolean;
emit(event: "online"): boolean;
emit(event: string | symbol, ...args: any[]): boolean;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'exit', listener: (exitCode: number) => void): this;
on(event: 'message', listener: (value: any) => void): this;
on(event: 'messageerror', listener: (error: Error) => void): this;
on(event: 'online', listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "exit", listener: (exitCode: number) => void): this;
on(event: "message", listener: (value: any) => void): this;
on(event: "messageerror", listener: (error: Error) => void): this;
on(event: "online", listener: () => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'exit', listener: (exitCode: number) => void): this;
once(event: 'message', listener: (value: any) => void): this;
once(event: 'messageerror', listener: (error: Error) => void): this;
once(event: 'online', listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "exit", listener: (exitCode: number) => void): this;
once(event: "message", listener: (value: any) => void): this;
once(event: "messageerror", listener: (error: Error) => void): this;
once(event: "online", listener: () => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'exit', listener: (exitCode: number) => void): this;
prependListener(event: 'message', listener: (value: any) => void): this;
prependListener(event: 'messageerror', listener: (error: Error) => void): this;
prependListener(event: 'online', listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "exit", listener: (exitCode: number) => void): this;
prependListener(event: "message", listener: (value: any) => void): this;
prependListener(event: "messageerror", listener: (error: Error) => void): this;
prependListener(event: "online", listener: () => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'exit', listener: (exitCode: number) => void): this;
prependOnceListener(event: 'message', listener: (value: any) => void): this;
prependOnceListener(event: 'messageerror', listener: (error: Error) => void): this;
prependOnceListener(event: 'online', listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
prependOnceListener(event: "message", listener: (value: any) => void): this;
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
prependOnceListener(event: "online", listener: () => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: 'error', listener: (err: Error) => void): this;
removeListener(event: 'exit', listener: (exitCode: number) => void): this;
removeListener(event: 'message', listener: (value: any) => void): this;
removeListener(event: 'messageerror', listener: (error: Error) => void): this;
removeListener(event: 'online', listener: () => void): this;
removeListener(event: "error", listener: (err: Error) => void): this;
removeListener(event: "exit", listener: (exitCode: number) => void): this;
removeListener(event: "message", listener: (value: any) => void): this;
removeListener(event: "messageerror", listener: (error: Error) => void): this;
removeListener(event: "online", listener: () => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
off(event: 'error', listener: (err: Error) => void): this;
off(event: 'exit', listener: (exitCode: number) => void): this;
off(event: 'message', listener: (value: any) => void): this;
off(event: 'messageerror', listener: (error: Error) => void): this;
off(event: 'online', listener: () => void): this;
off(event: "error", listener: (err: Error) => void): this;
off(event: "exit", listener: (exitCode: number) => void): this;
off(event: "message", listener: (value: any) => void): this;
off(event: "messageerror", listener: (error: Error) => void): this;
off(event: "online", listener: () => void): this;
off(event: string | symbol, listener: (...args: any[]) => void): this;

@@ -616,4 +617,4 @@ }

| {
message: any;
}
message: any;
}
| undefined;

@@ -659,3 +660,3 @@ type Serializable = string | object | number | boolean | bigint;

MessagePort as _MessagePort,
} from 'worker_threads';
} from "worker_threads";
global {

@@ -670,4 +671,3 @@ /**

BroadcastChannel: infer T;
}
? T
} ? T
: typeof _BroadcastChannel;

@@ -682,4 +682,3 @@ /**

MessageChannel: infer T;
}
? T
} ? T
: typeof _MessageChannel;

@@ -694,9 +693,8 @@ /**

MessagePort: infer T;
}
? T
} ? T
: typeof _MessagePort;
}
}
declare module 'node:worker_threads' {
export * from 'worker_threads';
declare module "node:worker_threads" {
export * from "worker_threads";
}

@@ -93,4 +93,4 @@ /**

*/
declare module 'zlib' {
import * as stream from 'node:stream';
declare module "zlib" {
import * as stream from "node:stream";
interface ZlibOptions {

@@ -132,7 +132,7 @@ /**

| {
/**
* Each key is a `constants.BROTLI_*` constant.
*/
[key: number]: boolean | number;
}
/**
* Each key is a `constants.BROTLI_*` constant.
*/
[key: number]: boolean | number;
}
| undefined;

@@ -517,4 +517,4 @@ maxOutputLength?: number | undefined;

}
declare module 'node:zlib' {
export * from 'zlib';
declare module "node:zlib" {
export * from "zlib";
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc