Update dependencies

This commit is contained in:
grandeljay 2023-02-08 13:35:10 +01:00
parent efe3c87c15
commit 64b899a72a
1218 changed files with 79658 additions and 39990 deletions

4
node_modules/@types/node/README.md generated vendored
View file

@ -8,9 +8,9 @@ This package contains type definitions for Node.js (https://nodejs.org/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
### Additional Details
* Last updated: Tue, 01 Nov 2022 09:32:58 GMT
* Last updated: Tue, 07 Feb 2023 08:32:36 GMT
* Dependencies: none
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
# 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), [Simon Schick](https://github.com/SimonSchick), [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), and [Matteo Collina](https://github.com/mcollina).
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), [Simon Schick](https://github.com/SimonSchick), [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).

View file

@ -319,6 +319,16 @@ declare module 'async_hooks' {
*/
triggerAsyncId(): number;
}
interface AsyncLocalStorageOptions<T> {
/**
* Optional callback invoked before a store is propagated to a new async resource.
* Returning `true` allows propagation, returning `false` avoids it. Default is to propagate always.
* @param type The type of async event.
* @param store The current store.
* @since v18.13.0
*/
onPropagate?: ((type: string, store: T) => boolean) | undefined;
}
/**
* This class creates stores that stay coherent through asynchronous operations.
*
@ -368,6 +378,8 @@ declare module 'async_hooks' {
* @since v13.10.0, v12.17.0
*/
class AsyncLocalStorage<T> {
constructor(options?: AsyncLocalStorageOptions<T>);
/**
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.

View file

@ -624,7 +624,7 @@ declare module 'child_process' {
}
interface CommonOptions extends ProcessEnvOptions {
/**
* @default true
* @default false
*/
windowsHide?: boolean | undefined;
/**

12
node_modules/@types/node/crypto.d.ts generated vendored
View file

@ -2357,7 +2357,7 @@ declare module 'crypto' {
/** @deprecated since v10.0.0 */
const DEFAULT_ENCODING: BufferEncoding;
type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
type KeyFormat = 'pem' | 'der';
type KeyFormat = 'pem' | 'der' | 'jwk';
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
format: T;
cipher?: string | undefined;
@ -3131,23 +3131,23 @@ declare module 'crypto' {
/**
* @default 'always'
*/
subject: 'always' | 'never';
subject?: 'always' | 'default' | 'never';
/**
* @default true
*/
wildcards: boolean;
wildcards?: boolean;
/**
* @default true
*/
partialWildcards: boolean;
partialWildcards?: boolean;
/**
* @default false
*/
multiLabelWildcards: boolean;
multiLabelWildcards?: boolean;
/**
* @default false
*/
singleLabelSubdomains: boolean;
singleLabelSubdomains?: boolean;
}
/**
* Encapsulates an X509 certificate and provides read-only access to

View file

@ -41,7 +41,7 @@ declare module 'diagnostics_channel' {
* @param name The channel name
* @return If there are active subscribers
*/
function hasSubscribers(name: string): boolean;
function hasSubscribers(name: string | symbol): boolean;
/**
* This is the primary entry-point for anyone wanting to interact with a named
* channel. It produces a channel object which is optimized to reduce overhead at
@ -56,8 +56,8 @@ declare module 'diagnostics_channel' {
* @param name The channel name
* @return The named channel object
*/
function channel(name: string): Channel;
type ChannelListener = (message: unknown, name: string) => void;
function channel(name: string | symbol): Channel;
type ChannelListener = (message: unknown, name: string | symbol) => void;
/**
* The class `Channel` represents an individual named channel within the data
* pipeline. It is use to track subscribers and to publish messages when there
@ -68,7 +68,7 @@ declare module 'diagnostics_channel' {
* @since v15.1.0, v14.17.0
*/
class Channel {
readonly name: string;
readonly name: string | symbol;
/**
* Check if there are active subscribers to this channel. This is helpful if
* the message you want to send might be expensive to prepare.
@ -88,7 +88,7 @@ declare module 'diagnostics_channel' {
* @since v15.1.0, v14.17.0
*/
readonly hasSubscribers: boolean;
private constructor(name: string);
private constructor(name: string | symbol);
/**
* Publish a message to any subscribers to the channel. This will
* trigger message handlers synchronously so they will execute within

91
node_modules/@types/node/http.d.ts generated vendored
View file

@ -43,6 +43,7 @@ declare module 'http' {
import * as stream from 'node:stream';
import { URL } from 'node:url';
import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net';
import { LookupOptions } from 'node:dns';
// incoming headers will never contain number
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
accept?: string | undefined;
@ -113,56 +114,87 @@ declare module 'http' {
type OutgoingHttpHeader = number | string | string[];
interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {}
interface ClientRequestArgs {
signal?: AbortSignal | undefined;
protocol?: string | null | undefined;
host?: string | null | undefined;
hostname?: string | null | undefined;
family?: number | undefined;
port?: number | string | null | undefined;
defaultPort?: number | string | undefined;
localAddress?: string | undefined;
socketPath?: string | undefined;
/**
* @default 8192
*/
maxHeaderSize?: number | undefined;
method?: string | undefined;
path?: string | null | undefined;
headers?: OutgoingHttpHeaders | undefined;
auth?: string | null | undefined;
agent?: Agent | boolean | undefined;
_defaultAgent?: Agent | undefined;
timeout?: number | undefined;
setHost?: boolean | undefined;
agent?: Agent | boolean | undefined;
auth?: string | null | undefined;
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
createConnection?:
| ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket)
| undefined;
defaultPort?: number | string | undefined;
family?: number | undefined;
headers?: OutgoingHttpHeaders | undefined;
hints?: LookupOptions['hints'];
host?: string | null | undefined;
hostname?: string | null | undefined;
insecureHTTPParser?: boolean | undefined;
localAddress?: string | undefined;
localPort?: number | undefined;
lookup?: LookupFunction | undefined;
/**
* @default 16384
*/
maxHeaderSize?: number | undefined;
method?: string | undefined;
path?: string | null | undefined;
port?: number | string | null | undefined;
protocol?: string | null | undefined;
setHost?: boolean | undefined;
signal?: AbortSignal | undefined;
socketPath?: string | undefined;
timeout?: number | undefined;
uniqueHeaders?: Array<string | string[]> | undefined;
}
interface ServerOptions<
Request extends typeof IncomingMessage = typeof IncomingMessage,
Response extends typeof ServerResponse = typeof ServerResponse,
> {
/**
* Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
*/
IncomingMessage?: Request | undefined;
/**
* Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
*/
ServerResponse?: Response | undefined;
/**
* Optionally overrides the value of
* `--max-http-header-size` for requests received by this server, i.e.
* the maximum length of request headers in bytes.
* @default 8192
* Sets the timeout value in milliseconds for receiving the entire request from the client.
* @see Server.requestTimeout for more information.
* @default 300000
* @since v18.0.0
*/
maxHeaderSize?: number | undefined;
requestTimeout?: number | undefined;
/**
* Use an insecure HTTP parser that accepts invalid HTTP headers when true.
* The number of milliseconds of inactivity a server needs to wait for additional incoming data,
* after it has finished writing the last response, before a socket will be destroyed.
* @see Server.keepAliveTimeout for more information.
* @default 5000
* @since v18.0.0
*/
keepAliveTimeout?: number | undefined;
/**
* Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
* @default 30000
*/
connectionsCheckingInterval?: number | undefined;
/**
* Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
* Using the insecure parser should be avoided.
* See --insecure-http-parser for more information.
* @default false
*/
insecureHTTPParser?: boolean | undefined;
/**
* Optionally overrides the value of
* `--max-http-header-size` for requests received by this server, i.e.
* the maximum length of request headers in bytes.
* @default 16384
* @since v13.3.0
*/
maxHeaderSize?: number | undefined;
/**
* If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
* @default false
* @default true
* @since v16.5.0
*/
noDelay?: boolean | undefined;
@ -179,6 +211,11 @@ declare module 'http' {
* @since v16.5.0
*/
keepAliveInitialDelay?: number | undefined;
/**
* A list of response headers that should be sent only once.
* If the header's value is an array, the items will be joined using `; `.
*/
uniqueHeaders?: Array<string | string[]> | undefined;
}
type RequestListener<
Request extends typeof IncomingMessage = typeof IncomingMessage,

View file

@ -14,6 +14,7 @@ declare module 'https' {
> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
type RequestOptions = http.RequestOptions &
tls.SecureContextOptions & {
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
rejectUnauthorized?: boolean | undefined; // Defaults to true
servername?: string | undefined; // SNI TLS Extension
};

View file

@ -1,4 +1,4 @@
// Type definitions for non-npm package Node.js 18.11
// Type definitions for non-npm package Node.js 18.13
// Project: https://nodejs.org/
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
// DefinitelyTyped <https://github.com/DefinitelyTyped>
@ -41,6 +41,7 @@
// 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
/**

View file

@ -85,6 +85,7 @@ declare module 'module' {
static wrap(code: string): string;
static createRequire(path: string | URL): NodeRequire;
static builtinModules: string[];
static isBuiltin(moduleName: string): boolean;
static Module: typeof Module;
constructor(id: string, parent?: Module);
}

8
node_modules/@types/node/net.d.ts generated vendored
View file

@ -57,6 +57,14 @@ declare module 'net' {
noDelay?: boolean | undefined;
keepAlive?: boolean | undefined;
keepAliveInitialDelay?: number | undefined;
/**
* @since v18.13.0
*/
autoSelectFamily?: boolean | undefined;
/**
* @since v18.13.0
*/
autoSelectFamilyAttemptTimeout?: number | undefined;
}
interface IpcSocketConnectOpts extends ConnectOpts {
path: string;

View file

@ -1,6 +1,6 @@
{
"name": "@types/node",
"version": "18.11.9",
"version": "18.13.0",
"description": "TypeScript definitions for Node.js",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
"license": "MIT",
@ -209,12 +209,17 @@
"name": "Matteo Collina",
"url": "https://github.com/mcollina",
"githubUsername": "mcollina"
},
{
"name": "Dmitry Semigradsky",
"url": "https://github.com/Semigradsky",
"githubUsername": "Semigradsky"
}
],
"main": "",
"types": "index.d.ts",
"typesVersions": {
"<4.9.0-0": {
"<=4.8": {
"*": [
"ts4.8/*"
]
@ -227,6 +232,6 @@
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "c4994f0d5655c5ba44d4248f7f2765c3b1f8319a258377d18d73093af02d11b3",
"typeScriptVersion": "4.1"
"typesPublisherContentHash": "6c5087993475c3d03552602e518e6747e3493f7e7dec65e81e1f206b013ad890",
"typeScriptVersion": "4.2"
}

127
node_modules/@types/node/test.d.ts generated vendored
View file

@ -1,6 +1,6 @@
/**
* The `node:test` module provides a standalone testing module.
* @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js)
* @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js)
*/
declare module 'node:test' {
/**
@ -61,6 +61,19 @@ declare module 'node:test' {
function describe(name?: string, fn?: SuiteFn): void;
function describe(options?: TestOptions, fn?: SuiteFn): void;
function describe(fn?: SuiteFn): void;
namespace describe {
// Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
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;
// 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;
}
/**
* @since v18.6.0
@ -74,6 +87,19 @@ declare module 'node:test' {
function it(name?: string, fn?: ItFn): void;
function it(options?: TestOptions, fn?: ItFn): void;
function it(fn?: ItFn): void;
namespace it {
// Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
function skip(name?: string, options?: TestOptions, fn?: ItFn): void;
function skip(name?: string, fn?: ItFn): void;
function skip(options?: TestOptions, fn?: ItFn): void;
function skip(fn?: ItFn): void;
// Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
function todo(name?: string, options?: TestOptions, fn?: ItFn): void;
function todo(name?: string, fn?: ItFn): void;
function todo(options?: TestOptions, fn?: ItFn): void;
function todo(fn?: ItFn): void;
}
/**
* The type of a function under test. The first argument to this function is a
@ -96,32 +122,45 @@ declare module 'node:test' {
interface RunOptions {
/**
* @default false
* If a number is provided, then that many files would run in parallel.
* If truthy, it would run (number of cpu cores - 1) files in parallel.
* If falsy, it would only run one file at a time.
* If unspecified, subtests inherit this value from their parent.
* @default true
*/
concurrency?: number | boolean;
concurrency?: number | boolean | undefined;
/**
* An array containing the list of files to run. If unspecified, the test runner execution model will be used.
* An array containing the list of files to run.
* If unspecified, the test runner execution model will be used.
*/
files?: readonly string[];
files?: readonly string[] | undefined;
/**
* Allows aborting an in-progress test.
* Allows aborting an in-progress test execution.
* @default undefined
*/
signal?: AbortSignal;
signal?: AbortSignal | undefined;
/**
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
* value from their parent.
* A number of milliseconds the test will fail after.
* If unspecified, subtests inherit this value from their parent.
* @default Infinity
*/
timeout?: number;
timeout?: number | undefined;
/**
* Sets inspector port of test child process.
* If a nullish value is provided, each process gets its own port,
* incremented from the primary's `process.debugPort`.
*/
inspectPort?: number | (() => number) | undefined;
}
/**
* A successful call of the run() method will return a new TapStream object, streaming a TAP output.
* TapStream will emit events in the order of the tests' definitions.
* A successful call of the `run()` method will return a new `TapStream` object,
* streaming a [TAP](https://testanything.org/) output.
* `TapStream` will emit events in the order of the tests' definitions.
* @since v18.9.0
*/
interface TapStream extends NodeJS.ReadableStream {
@ -216,6 +255,33 @@ declare module 'node:test' {
* @since v18.0.0
*/
interface TestContext {
/**
* This function is used to create a hook running before each subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.8.0
*/
beforeEach: typeof beforeEach;
/**
* This function is used to create a hook that runs after the current test finishes.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.13.0
*/
after: typeof after;
/**
* This function is used to create a hook running after each subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.8.0
*/
afterEach: typeof afterEach;
/**
* This function is used to write TAP diagnostics to the output. Any diagnostic information is
* included at the end of the test's results. This function does not return a value.
@ -224,6 +290,12 @@ declare module 'node:test' {
*/
diagnostic(message: string): void;
/**
* The name of the test.
* @since v18.8.0
*/
readonly name: string;
/**
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
* option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
@ -233,6 +305,12 @@ declare module 'node:test' {
*/
runOnly(shouldRunOnlyTests: boolean): void;
/**
* Can be used to abort test subtasks when the test has been aborted.
* @since v18.7.0
*/
readonly signal: AbortSignal;
/**
* This function causes the test's output to indicate the test as skipped. If `message` is
* provided, it is included in the TAP output. Calling `skip()` does not terminate execution of
@ -268,31 +346,34 @@ declare module 'node:test' {
interface TestOptions {
/**
* The number of tests that can be run at the same time. If unspecified, subtests inherit this
* value from their parent.
* @default 1
* If a number is provided, then that many tests would run in parallel.
* If truthy, it would run (number of cpu cores - 1) tests in parallel.
* For subtests, it will be `Infinity` tests in parallel.
* If falsy, it would only run one test at a time.
* If unspecified, subtests inherit this value from their parent.
* @default false
*/
concurrency?: number;
concurrency?: number | boolean | undefined;
/**
* If truthy, and the test context is configured to run `only` tests, then this test will be
* run. Otherwise, the test is skipped.
* @default false
*/
only?: boolean;
only?: boolean | undefined;
/**
* Allows aborting an in-progress test.
* @since v18.8.0
*/
signal?: AbortSignal;
signal?: AbortSignal | undefined;
/**
* If truthy, the test is skipped. If a string is provided, that string is displayed in the
* test results as the reason for skipping the test.
* @default false
*/
skip?: boolean | string;
skip?: boolean | string | undefined;
/**
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
@ -300,14 +381,14 @@ declare module 'node:test' {
* @default Infinity
* @since v18.7.0
*/
timeout?: number;
timeout?: number | undefined;
/**
* If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
* the test results as the reason why the test is `TODO`.
* @default false
*/
todo?: boolean | string;
todo?: boolean | string | undefined;
}
/**
@ -360,14 +441,14 @@ declare module 'node:test' {
/**
* Allows aborting an in-progress hook.
*/
signal?: AbortSignal;
signal?: AbortSignal | undefined;
/**
* A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
* value from their parent.
* @default Infinity
*/
timeout?: number;
timeout?: number | undefined;
}
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach };

View file

@ -62,6 +62,31 @@ declare module 'timers/promises' {
* @since v15.9.0
*/
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
interface Scheduler {
/**
* ```js
* import { scheduler } from 'node:timers/promises';
*
* await scheduler.wait(1000); // Wait one second before continuing
* ```
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
* Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
* @since v16.14.0
* @experimental
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
*/
wait: (delay?: number, options?: TimerOptions) => Promise<void>;
/**
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
* Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
* @since v16.14.0
* @experimental
*/
yield: () => Promise<void>;
}
const scheduler: Scheduler;
}
declare module 'node:timers/promises' {
export * from 'timers/promises';

103
node_modules/@types/node/tls.d.ts generated vendored
View file

@ -41,21 +41,100 @@ declare module 'tls' {
CN: string;
}
interface PeerCertificate {
subject: Certificate;
issuer: Certificate;
subjectaltname: string;
infoAccess: NodeJS.Dict<string[]>;
modulus: string;
exponent: string;
valid_from: string;
valid_to: string;
fingerprint: string;
fingerprint256: string;
ext_key_usage: string[];
serialNumber: string;
/**
* `true` if a Certificate Authority (CA), `false` otherwise.
* @since v18.13.0
*/
ca: boolean;
/**
* The DER encoded X.509 certificate data.
*/
raw: Buffer;
/**
* The certificate subject.
*/
subject: Certificate;
/**
* The certificate issuer, described in the same terms as the `subject`.
*/
issuer: Certificate;
/**
* The date-time the certificate is valid from.
*/
valid_from: string;
/**
* The date-time the certificate is valid to.
*/
valid_to: string;
/**
* The certificate serial number, as a hex string.
*/
serialNumber: string;
/**
* The SHA-1 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint: string;
/**
* The SHA-256 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint256: string;
/**
* The SHA-512 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint512: string;
/**
* The extended key usage, a set of OIDs.
*/
ext_key_usage?: string[];
/**
* A string containing concatenated names for the subject,
* an alternative to the `subject` names.
*/
subjectaltname?: string;
/**
* An array describing the AuthorityInfoAccess, used with OCSP.
*/
infoAccess?: NodeJS.Dict<string[]>;
/**
* For RSA keys: The RSA bit size.
*
* For EC keys: The key size in bits.
*/
bits?: number;
/**
* The RSA exponent, as a string in hexadecimal number notation.
*/
exponent?: string;
/**
* The RSA modulus, as a hexadecimal string.
*/
modulus?: string;
/**
* The public key.
*/
pubkey?: Buffer;
/**
* The ASN.1 name of the OID of the elliptic curve.
* Well-known curves are identified by an OID.
* While it is unusual, it is possible that the curve
* is identified by its mathematical properties,
* in which case it will not have an OID.
*/
asn1Curve?: string;
/**
* The NIST name for the elliptic curve,if it has one
* (not all well-known curves have been assigned names by NIST).
*/
nistCurve?: string;
}
interface DetailedPeerCertificate extends PeerCertificate {
/**
* The issuer certificate object.
* For self-signed certificates, this may be a circular reference.
*/
issuerCertificate: DetailedPeerCertificate;
}
interface CipherNameAndProtocol {

View file

@ -319,6 +319,16 @@ declare module 'async_hooks' {
*/
triggerAsyncId(): number;
}
interface AsyncLocalStorageOptions<T> {
/**
* Optional callback invoked before a store is propagated to a new async resource.
* Returning `true` allows propagation, returning `false` avoids it. Default is to propagate always.
* @param type The type of async event.
* @param store The current store.
* @since v18.13.0
*/
onPropagate?: ((type: string, store: T) => boolean) | undefined;
}
/**
* This class creates stores that stay coherent through asynchronous operations.
*
@ -368,6 +378,8 @@ declare module 'async_hooks' {
* @since v13.10.0, v12.17.0
*/
class AsyncLocalStorage<T> {
constructor(options?: AsyncLocalStorageOptions<T>);
/**
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.

View file

@ -624,7 +624,7 @@ declare module 'child_process' {
}
interface CommonOptions extends ProcessEnvOptions {
/**
* @default true
* @default false
*/
windowsHide?: boolean | undefined;
/**

View file

@ -2357,7 +2357,7 @@ declare module 'crypto' {
/** @deprecated since v10.0.0 */
const DEFAULT_ENCODING: BufferEncoding;
type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
type KeyFormat = 'pem' | 'der';
type KeyFormat = 'pem' | 'der' | 'jwk';
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
format: T;
cipher?: string | undefined;
@ -3131,23 +3131,23 @@ declare module 'crypto' {
/**
* @default 'always'
*/
subject: 'always' | 'never';
subject?: 'always' | 'default' | 'never';
/**
* @default true
*/
wildcards: boolean;
wildcards?: boolean;
/**
* @default true
*/
partialWildcards: boolean;
partialWildcards?: boolean;
/**
* @default false
*/
multiLabelWildcards: boolean;
multiLabelWildcards?: boolean;
/**
* @default false
*/
singleLabelSubdomains: boolean;
singleLabelSubdomains?: boolean;
}
/**
* Encapsulates an X509 certificate and provides read-only access to

View file

@ -41,7 +41,7 @@ declare module 'diagnostics_channel' {
* @param name The channel name
* @return If there are active subscribers
*/
function hasSubscribers(name: string): boolean;
function hasSubscribers(name: string | symbol): boolean;
/**
* This is the primary entry-point for anyone wanting to interact with a named
* channel. It produces a channel object which is optimized to reduce overhead at
@ -56,8 +56,8 @@ declare module 'diagnostics_channel' {
* @param name The channel name
* @return The named channel object
*/
function channel(name: string): Channel;
type ChannelListener = (message: unknown, name: string) => void;
function channel(name: string | symbol): Channel;
type ChannelListener = (message: unknown, name: string | symbol) => void;
/**
* The class `Channel` represents an individual named channel within the data
* pipeline. It is use to track subscribers and to publish messages when there
@ -68,7 +68,7 @@ declare module 'diagnostics_channel' {
* @since v15.1.0, v14.17.0
*/
class Channel {
readonly name: string;
readonly name: string | symbol;
/**
* Check if there are active subscribers to this channel. This is helpful if
* the message you want to send might be expensive to prepare.
@ -88,7 +88,7 @@ declare module 'diagnostics_channel' {
* @since v15.1.0, v14.17.0
*/
readonly hasSubscribers: boolean;
private constructor(name: string);
private constructor(name: string | symbol);
/**
* Publish a message to any subscribers to the channel. This will
* trigger message handlers synchronously so they will execute within

View file

@ -43,6 +43,7 @@ declare module 'http' {
import * as stream from 'node:stream';
import { URL } from 'node:url';
import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net';
import { LookupOptions } from 'node:dns';
// incoming headers will never contain number
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
accept?: string | undefined;
@ -113,56 +114,87 @@ declare module 'http' {
type OutgoingHttpHeader = number | string | string[];
interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {}
interface ClientRequestArgs {
signal?: AbortSignal | undefined;
protocol?: string | null | undefined;
host?: string | null | undefined;
hostname?: string | null | undefined;
family?: number | undefined;
port?: number | string | null | undefined;
defaultPort?: number | string | undefined;
localAddress?: string | undefined;
socketPath?: string | undefined;
/**
* @default 8192
*/
maxHeaderSize?: number | undefined;
method?: string | undefined;
path?: string | null | undefined;
headers?: OutgoingHttpHeaders | undefined;
auth?: string | null | undefined;
agent?: Agent | boolean | undefined;
_defaultAgent?: Agent | undefined;
timeout?: number | undefined;
setHost?: boolean | undefined;
agent?: Agent | boolean | undefined;
auth?: string | null | undefined;
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
createConnection?:
| ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket)
| undefined;
defaultPort?: number | string | undefined;
family?: number | undefined;
headers?: OutgoingHttpHeaders | undefined;
hints?: LookupOptions['hints'];
host?: string | null | undefined;
hostname?: string | null | undefined;
insecureHTTPParser?: boolean | undefined;
localAddress?: string | undefined;
localPort?: number | undefined;
lookup?: LookupFunction | undefined;
/**
* @default 16384
*/
maxHeaderSize?: number | undefined;
method?: string | undefined;
path?: string | null | undefined;
port?: number | string | null | undefined;
protocol?: string | null | undefined;
setHost?: boolean | undefined;
signal?: AbortSignal | undefined;
socketPath?: string | undefined;
timeout?: number | undefined;
uniqueHeaders?: Array<string | string[]> | undefined;
}
interface ServerOptions<
Request extends typeof IncomingMessage = typeof IncomingMessage,
Response extends typeof ServerResponse = typeof ServerResponse,
> {
/**
* Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
*/
IncomingMessage?: Request | undefined;
/**
* Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
*/
ServerResponse?: Response | undefined;
/**
* Optionally overrides the value of
* `--max-http-header-size` for requests received by this server, i.e.
* the maximum length of request headers in bytes.
* @default 8192
* Sets the timeout value in milliseconds for receiving the entire request from the client.
* @see Server.requestTimeout for more information.
* @default 300000
* @since v18.0.0
*/
maxHeaderSize?: number | undefined;
requestTimeout?: number | undefined;
/**
* Use an insecure HTTP parser that accepts invalid HTTP headers when true.
* The number of milliseconds of inactivity a server needs to wait for additional incoming data,
* after it has finished writing the last response, before a socket will be destroyed.
* @see Server.keepAliveTimeout for more information.
* @default 5000
* @since v18.0.0
*/
keepAliveTimeout?: number | undefined;
/**
* Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
* @default 30000
*/
connectionsCheckingInterval?: number | undefined;
/**
* Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
* Using the insecure parser should be avoided.
* See --insecure-http-parser for more information.
* @default false
*/
insecureHTTPParser?: boolean | undefined;
/**
* Optionally overrides the value of
* `--max-http-header-size` for requests received by this server, i.e.
* the maximum length of request headers in bytes.
* @default 16384
* @since v13.3.0
*/
maxHeaderSize?: number | undefined;
/**
* If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
* @default false
* @default true
* @since v16.5.0
*/
noDelay?: boolean | undefined;
@ -179,6 +211,11 @@ declare module 'http' {
* @since v16.5.0
*/
keepAliveInitialDelay?: number | undefined;
/**
* A list of response headers that should be sent only once.
* If the header's value is an array, the items will be joined using `; `.
*/
uniqueHeaders?: Array<string | string[]> | undefined;
}
type RequestListener<
Request extends typeof IncomingMessage = typeof IncomingMessage,

View file

@ -14,6 +14,7 @@ declare module 'https' {
> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
type RequestOptions = http.RequestOptions &
tls.SecureContextOptions & {
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
rejectUnauthorized?: boolean | undefined; // Defaults to true
servername?: string | undefined; // SNI TLS Extension
};

View file

@ -85,6 +85,7 @@ declare module 'module' {
static wrap(code: string): string;
static createRequire(path: string | URL): NodeRequire;
static builtinModules: string[];
static isBuiltin(moduleName: string): boolean;
static Module: typeof Module;
constructor(id: string, parent?: Module);
}

View file

@ -57,6 +57,14 @@ declare module 'net' {
noDelay?: boolean | undefined;
keepAlive?: boolean | undefined;
keepAliveInitialDelay?: number | undefined;
/**
* @since v18.13.0
*/
autoSelectFamily?: boolean | undefined;
/**
* @since v18.13.0
*/
autoSelectFamilyAttemptTimeout?: number | undefined;
}
interface IpcSocketConnectOpts extends ConnectOpts {
path: string;
@ -281,7 +289,7 @@ declare module 'net' {
* The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
* @since v18.8.0
*/
readonly localFamily?: string;
readonly localFamily?: string;
/**
* This property represents the state of the connection as a string.
* @see {https://nodejs.org/api/net.html#socketreadystate}

View file

@ -1,6 +1,6 @@
/**
* The `node:test` module provides a standalone testing module.
* @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js)
* @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js)
*/
declare module 'node:test' {
/**
@ -61,6 +61,19 @@ declare module 'node:test' {
function describe(name?: string, fn?: SuiteFn): void;
function describe(options?: TestOptions, fn?: SuiteFn): void;
function describe(fn?: SuiteFn): void;
namespace describe {
// Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
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;
// 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;
}
/**
* @since v18.6.0
@ -74,6 +87,19 @@ declare module 'node:test' {
function it(name?: string, fn?: ItFn): void;
function it(options?: TestOptions, fn?: ItFn): void;
function it(fn?: ItFn): void;
namespace it {
// Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
function skip(name?: string, options?: TestOptions, fn?: ItFn): void;
function skip(name?: string, fn?: ItFn): void;
function skip(options?: TestOptions, fn?: ItFn): void;
function skip(fn?: ItFn): void;
// Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
function todo(name?: string, options?: TestOptions, fn?: ItFn): void;
function todo(name?: string, fn?: ItFn): void;
function todo(options?: TestOptions, fn?: ItFn): void;
function todo(fn?: ItFn): void;
}
/**
* The type of a function under test. The first argument to this function is a
@ -96,32 +122,45 @@ declare module 'node:test' {
interface RunOptions {
/**
* @default false
* If a number is provided, then that many files would run in parallel.
* If truthy, it would run (number of cpu cores - 1) files in parallel.
* If falsy, it would only run one file at a time.
* If unspecified, subtests inherit this value from their parent.
* @default true
*/
concurrency?: number | boolean;
concurrency?: number | boolean | undefined;
/**
* An array containing the list of files to run. If unspecified, the test runner execution model will be used.
* An array containing the list of files to run.
* If unspecified, the test runner execution model will be used.
*/
files?: readonly string[];
files?: readonly string[] | undefined;
/**
* Allows aborting an in-progress test.
* Allows aborting an in-progress test execution.
* @default undefined
*/
signal?: AbortSignal;
signal?: AbortSignal | undefined;
/**
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
* value from their parent.
* A number of milliseconds the test will fail after.
* If unspecified, subtests inherit this value from their parent.
* @default Infinity
*/
timeout?: number;
timeout?: number | undefined;
/**
* Sets inspector port of test child process.
* If a nullish value is provided, each process gets its own port,
* incremented from the primary's `process.debugPort`.
*/
inspectPort?: number | (() => number) | undefined;
}
/**
* A successful call of the run() method will return a new TapStream object, streaming a TAP output.
* TapStream will emit events in the order of the tests' definitions.
* A successful call of the `run()` method will return a new `TapStream` object,
* streaming a [TAP](https://testanything.org/) output.
* `TapStream` will emit events in the order of the tests' definitions.
* @since v18.9.0
*/
interface TapStream extends NodeJS.ReadableStream {
@ -216,6 +255,24 @@ declare module 'node:test' {
* @since v18.0.0
*/
interface TestContext {
/**
* This function is used to create a hook running before each subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.8.0
*/
beforeEach: typeof beforeEach;
/**
* This function is used to create a hook running after each subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as
* the second argument. Default: A no-op function.
* @param options Configuration options for the hook.
* @since v18.8.0
*/
afterEach: typeof afterEach;
/**
* This function is used to write TAP diagnostics to the output. Any diagnostic information is
* included at the end of the test's results. This function does not return a value.
@ -224,6 +281,12 @@ declare module 'node:test' {
*/
diagnostic(message: string): void;
/**
* The name of the test.
* @since v18.8.0
*/
readonly name: string;
/**
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
* option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
@ -233,6 +296,12 @@ declare module 'node:test' {
*/
runOnly(shouldRunOnlyTests: boolean): void;
/**
* Can be used to abort test subtasks when the test has been aborted.
* @since v18.7.0
*/
readonly signal: AbortSignal;
/**
* This function causes the test's output to indicate the test as skipped. If `message` is
* provided, it is included in the TAP output. Calling `skip()` does not terminate execution of
@ -268,31 +337,34 @@ declare module 'node:test' {
interface TestOptions {
/**
* The number of tests that can be run at the same time. If unspecified, subtests inherit this
* value from their parent.
* @default 1
* If a number is provided, then that many tests would run in parallel.
* If truthy, it would run (number of cpu cores - 1) tests in parallel.
* For subtests, it will be `Infinity` tests in parallel.
* If falsy, it would only run one test at a time.
* If unspecified, subtests inherit this value from their parent.
* @default false
*/
concurrency?: number;
concurrency?: number | boolean | undefined;
/**
* If truthy, and the test context is configured to run `only` tests, then this test will be
* run. Otherwise, the test is skipped.
* @default false
*/
only?: boolean;
only?: boolean | undefined;
/**
* Allows aborting an in-progress test.
* @since v18.8.0
*/
signal?: AbortSignal;
signal?: AbortSignal | undefined;
/**
* If truthy, the test is skipped. If a string is provided, that string is displayed in the
* test results as the reason for skipping the test.
* @default false
*/
skip?: boolean | string;
skip?: boolean | string | undefined;
/**
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
@ -300,14 +372,14 @@ declare module 'node:test' {
* @default Infinity
* @since v18.7.0
*/
timeout?: number;
timeout?: number | undefined;
/**
* If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
* the test results as the reason why the test is `TODO`.
* @default false
*/
todo?: boolean | string;
todo?: boolean | string | undefined;
}
/**
@ -360,14 +432,14 @@ declare module 'node:test' {
/**
* Allows aborting an in-progress hook.
*/
signal?: AbortSignal;
signal?: AbortSignal | undefined;
/**
* A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
* value from their parent.
* @default Infinity
*/
timeout?: number;
timeout?: number | undefined;
}
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach };

View file

@ -62,6 +62,31 @@ declare module 'timers/promises' {
* @since v15.9.0
*/
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
interface Scheduler {
/**
* ```js
* import { scheduler } from 'node:timers/promises';
*
* await scheduler.wait(1000); // Wait one second before continuing
* ```
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
* Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
* @since v16.14.0
* @experimental
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
*/
wait: (delay?: number, options?: TimerOptions) => Promise<void>;
/**
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
* Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
* @since v16.14.0
* @experimental
*/
yield: () => Promise<void>;
}
const scheduler: Scheduler;
}
declare module 'node:timers/promises' {
export * from 'timers/promises';

View file

@ -41,21 +41,100 @@ declare module 'tls' {
CN: string;
}
interface PeerCertificate {
subject: Certificate;
issuer: Certificate;
subjectaltname: string;
infoAccess: NodeJS.Dict<string[]>;
modulus: string;
exponent: string;
valid_from: string;
valid_to: string;
fingerprint: string;
fingerprint256: string;
ext_key_usage: string[];
serialNumber: string;
/**
* `true` if a Certificate Authority (CA), `false` otherwise.
* @since v18.13.0
*/
ca: boolean;
/**
* The DER encoded X.509 certificate data.
*/
raw: Buffer;
/**
* The certificate subject.
*/
subject: Certificate;
/**
* The certificate issuer, described in the same terms as the `subject`.
*/
issuer: Certificate;
/**
* The date-time the certificate is valid from.
*/
valid_from: string;
/**
* The date-time the certificate is valid to.
*/
valid_to: string;
/**
* The certificate serial number, as a hex string.
*/
serialNumber: string;
/**
* The SHA-1 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint: string;
/**
* The SHA-256 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint256: string;
/**
* The SHA-512 digest of the DER encoded certificate.
* It is returned as a `:` separated hexadecimal string.
*/
fingerprint512: string;
/**
* The extended key usage, a set of OIDs.
*/
ext_key_usage?: string[];
/**
* A string containing concatenated names for the subject,
* an alternative to the `subject` names.
*/
subjectaltname?: string;
/**
* An array describing the AuthorityInfoAccess, used with OCSP.
*/
infoAccess?: NodeJS.Dict<string[]>;
/**
* For RSA keys: The RSA bit size.
*
* For EC keys: The key size in bits.
*/
bits?: number;
/**
* The RSA exponent, as a string in hexadecimal number notation.
*/
exponent?: string;
/**
* The RSA modulus, as a hexadecimal string.
*/
modulus?: string;
/**
* The public key.
*/
pubkey?: Buffer;
/**
* The ASN.1 name of the OID of the elliptic curve.
* Well-known curves are identified by an OID.
* While it is unusual, it is possible that the curve
* is identified by its mathematical properties,
* in which case it will not have an OID.
*/
asn1Curve?: string;
/**
* The NIST name for the elliptic curve,if it has one
* (not all well-known curves have been assigned names by NIST).
*/
nistCurve?: string;
}
interface DetailedPeerCertificate extends PeerCertificate {
/**
* The issuer certificate object.
* For self-signed certificates, this may be a circular reference.
*/
issuerCertificate: DetailedPeerCertificate;
}
interface CipherNameAndProtocol {

View file

@ -6,28 +6,44 @@
* ```js
* const util = require('util');
* ```
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/util.js)
* @see [source](https://github.com/nodejs/node/blob/v18.x/lib/util.js)
*/
declare module 'util' {
import * as types from 'node:util/types';
export interface InspectOptions {
/**
* If set to `true`, getters are going to be
* inspected as well. If set to `'get'` only getters without setter are going
* to be inspected. If set to `'set'` only getters having a corresponding
* setter are going to be inspected. This might cause side effects depending on
* the getter function.
* @default `false`
* If `true`, object's non-enumerable symbols and properties are included in the formatted result.
* `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties).
* @default false
*/
getters?: 'get' | 'set' | boolean | undefined;
showHidden?: boolean | undefined;
/**
* Specifies the number of times to recurse while formatting object.
* This is useful for inspecting large objects.
* To recurse up to the maximum call stack size pass `Infinity` or `null`.
* @default 2
*/
depth?: number | null | undefined;
/**
* If `true`, the output is styled with ANSI color codes. Colors are customizable.
*/
colors?: boolean | undefined;
/**
* If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked.
* @default true
*/
customInspect?: boolean | undefined;
/**
* If `true`, `Proxy` inspection includes the target and handler objects.
* @default false
*/
showProxy?: boolean | undefined;
/**
* Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements
* to include when formatting. Set to `null` or `Infinity` to show all elements.
* Set to `0` or negative to show no elements.
* @default 100
*/
maxArrayLength?: number | null | undefined;
/**
* Specifies the maximum number of characters to
@ -36,6 +52,12 @@ declare module 'util' {
* @default 10000
*/
maxStringLength?: number | null | undefined;
/**
* The length at which input values are split across multiple lines.
* Set to `Infinity` to format the input as a single line
* (in combination with `compact` set to `true` or any number >= `1`).
* @default 80
*/
breakLength?: number | undefined;
/**
* Setting this to `false` causes each object key
@ -45,13 +67,33 @@ declare module 'util' {
* `breakLength`. Short array elements are also grouped together. Note that no
* text will be reduced below 16 characters, no matter the `breakLength` size.
* For more information, see the example below.
* @default `true`
* @default true
*/
compact?: boolean | number | undefined;
/**
* If set to `true` or a function, all properties of an object, and `Set` and `Map`
* entries are sorted in the resulting string.
* If set to `true` the default sort is used.
* If set to a function, it is used as a compare function.
*/
sorted?: boolean | ((a: string, b: string) => number) | undefined;
/**
* If set to `true`, getters are going to be
* inspected as well. If set to `'get'` only getters without setter are going
* to be inspected. If set to `'set'` only getters having a corresponding
* setter are going to be inspected. This might cause side effects depending on
* the getter function.
* @default false
*/
getters?: 'get' | 'set' | boolean | undefined;
/**
* If set to `true`, an underscore is used to separate every three digits in all bigints and numbers.
* @default false
*/
numericSeparator?: boolean | undefined;
}
export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
export interface InspectOptionsStylized extends InspectOptions {
stylize(text: string, styleType: Style): string;
}
@ -899,7 +941,7 @@ declare module 'util' {
* });
* ```
* @since v8.2.0
* @param original An `async` function
* @param fn An `async` function
* @return a callback style function
*/
export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
@ -1198,16 +1240,31 @@ declare module 'util' {
* - `tokens` Detailed parse information (only if `tokens` was specified).
*
*/
export function parseArgs<T extends ParseArgsConfig>(config: T): ParsedResults<T>;
export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
interface ParseArgsOptionConfig {
type: 'string' | 'boolean';
short?: string;
multiple?: boolean;
/**
* Type of argument.
*/
type: 'string' | 'boolean';
/**
* Whether this option can be provided multiple times.
* If `true`, all values will be collected in an array.
* If `false`, values for the option are last-wins.
* @default false.
*/
multiple?: boolean | undefined;
/**
* A single character alias for the option.
*/
short?: string | undefined;
/**
* The default option value when it is not set by args.
* It must be of the same type as the the `type` property.
* When `multiple` is `true`, it must be an array.
* @since v18.11.0
*/
default?: string | boolean | string[] | boolean[];
default?: string | boolean | string[] | boolean[] | undefined;
}
interface ParseArgsOptionsConfig {
@ -1215,11 +1272,30 @@ declare module 'util' {
}
export interface ParseArgsConfig {
strict?: boolean;
allowPositionals?: boolean;
tokens?: boolean;
options?: ParseArgsOptionsConfig;
args?: string[];
/**
* Array of argument strings.
*/
args?: string[] | undefined;
/**
* Used to describe arguments known to the parser.
*/
options?: ParseArgsOptionsConfig | undefined;
/**
* Should an error be thrown when unknown arguments are encountered,
* or when arguments are passed that do not match the `type` configured in `options`.
* @default true
*/
strict?: boolean | undefined;
/**
* Whether this command accepts positional arguments.
*/
allowPositionals?: boolean | undefined;
/**
* Return the parsed tokens. This is useful for extending the built-in behavior,
* from adding additional checks through to reprocessing the tokens in different ways.
* @default false
*/
tokens?: boolean | undefined;
}
/*
@ -1350,6 +1426,91 @@ declare module 'util' {
tokens?: Token[];
}
: PreciseParsedResults<T>;
/**
* @since v18.13.0
*/
export class MIMEType {
/**
* Creates a new MIMEType object by parsing the input.
*
* A `TypeError` will be thrown if the `input` is not a valid MIME.
* Note that an effort will be made to coerce the given values into strings.
* @param input The input MIME to parse.
*/
constructor(input: string | { toString: () => string });
/**
* Gets and sets the type portion of the MIME.
*/
type: string;
/**
* Gets and sets the subtype portion of the MIME.
*/
subtype: string;
/**
* Gets the essence of the MIME.
*
* Use `mime.type` or `mime.subtype` to alter the MIME.
*/
readonly essence: string;
/**
* Gets the `MIMEParams` object representing the parameters of the MIME.
*/
readonly params: MIMEParams;
/**
* Returns the serialized MIME.
*
* Because of the need for standard compliance, this method
* does not allow users to customize the serialization process of the MIME.
*/
toString(): string;
}
/**
* @since v18.13.0
*/
export class MIMEParams {
/**
* Remove all name-value pairs whose name is `name`.
*/
delete(name: string): void;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
entries(): IterableIterator<[name: string, value: string]>;
/**
* Returns the value of the first name-value pair whose name is `name`.
* If there are no such pairs, `null` is returned.
*/
get(name: string): string | null;
/**
* Returns `true` if there is at least one name-value pair whose name is `name`.
*/
has(name: string): boolean;
/**
* Returns an iterator over the names of each name-value pair.
*/
keys(): IterableIterator<string>;
/**
* Sets the value in the `MIMEParams` object associated with `name` to `value`.
* If there are any pre-existing name-value pairs whose names are `name`,
* set the first such pair's value to `value`.
*/
set(name: string, value: string): void;
/**
* Returns an iterator over the values of each name-value pair.
*/
values(): IterableIterator<string>;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
[Symbol.iterator]: typeof MIMEParams.prototype.entries;
}
}
declare module 'util/types' {
export * from 'util/types';

203
node_modules/@types/node/util.d.ts generated vendored
View file

@ -6,28 +6,44 @@
* ```js
* const util = require('util');
* ```
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/util.js)
* @see [source](https://github.com/nodejs/node/blob/v18.x/lib/util.js)
*/
declare module 'util' {
import * as types from 'node:util/types';
export interface InspectOptions {
/**
* If set to `true`, getters are going to be
* inspected as well. If set to `'get'` only getters without setter are going
* to be inspected. If set to `'set'` only getters having a corresponding
* setter are going to be inspected. This might cause side effects depending on
* the getter function.
* @default `false`
* If `true`, object's non-enumerable symbols and properties are included in the formatted result.
* `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties).
* @default false
*/
getters?: 'get' | 'set' | boolean | undefined;
showHidden?: boolean | undefined;
/**
* Specifies the number of times to recurse while formatting object.
* This is useful for inspecting large objects.
* To recurse up to the maximum call stack size pass `Infinity` or `null`.
* @default 2
*/
depth?: number | null | undefined;
/**
* If `true`, the output is styled with ANSI color codes. Colors are customizable.
*/
colors?: boolean | undefined;
/**
* If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked.
* @default true
*/
customInspect?: boolean | undefined;
/**
* If `true`, `Proxy` inspection includes the target and handler objects.
* @default false
*/
showProxy?: boolean | undefined;
/**
* Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements
* to include when formatting. Set to `null` or `Infinity` to show all elements.
* Set to `0` or negative to show no elements.
* @default 100
*/
maxArrayLength?: number | null | undefined;
/**
* Specifies the maximum number of characters to
@ -36,6 +52,12 @@ declare module 'util' {
* @default 10000
*/
maxStringLength?: number | null | undefined;
/**
* The length at which input values are split across multiple lines.
* Set to `Infinity` to format the input as a single line
* (in combination with `compact` set to `true` or any number >= `1`).
* @default 80
*/
breakLength?: number | undefined;
/**
* Setting this to `false` causes each object key
@ -45,13 +67,33 @@ declare module 'util' {
* `breakLength`. Short array elements are also grouped together. Note that no
* text will be reduced below 16 characters, no matter the `breakLength` size.
* For more information, see the example below.
* @default `true`
* @default true
*/
compact?: boolean | number | undefined;
/**
* If set to `true` or a function, all properties of an object, and `Set` and `Map`
* entries are sorted in the resulting string.
* If set to `true` the default sort is used.
* If set to a function, it is used as a compare function.
*/
sorted?: boolean | ((a: string, b: string) => number) | undefined;
/**
* If set to `true`, getters are going to be
* inspected as well. If set to `'get'` only getters without setter are going
* to be inspected. If set to `'set'` only getters having a corresponding
* setter are going to be inspected. This might cause side effects depending on
* the getter function.
* @default false
*/
getters?: 'get' | 'set' | boolean | undefined;
/**
* If set to `true`, an underscore is used to separate every three digits in all bigints and numbers.
* @default false
*/
numericSeparator?: boolean | undefined;
}
export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
export interface InspectOptionsStylized extends InspectOptions {
stylize(text: string, styleType: Style): string;
}
@ -899,7 +941,7 @@ declare module 'util' {
* });
* ```
* @since v8.2.0
* @param original An `async` function
* @param fn An `async` function
* @return a callback style function
*/
export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
@ -1198,16 +1240,31 @@ declare module 'util' {
* - `tokens` Detailed parse information (only if `tokens` was specified).
*
*/
export function parseArgs<T extends ParseArgsConfig>(config: T): ParsedResults<T>;
export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
interface ParseArgsOptionConfig {
type: 'string' | 'boolean';
short?: string;
multiple?: boolean;
/**
* Type of argument.
*/
type: 'string' | 'boolean';
/**
* Whether this option can be provided multiple times.
* If `true`, all values will be collected in an array.
* If `false`, values for the option are last-wins.
* @default false.
*/
multiple?: boolean | undefined;
/**
* A single character alias for the option.
*/
short?: string | undefined;
/**
* The default option value when it is not set by args.
* It must be of the same type as the the `type` property.
* When `multiple` is `true`, it must be an array.
* @since v18.11.0
*/
default?: string | boolean | string[] | boolean[];
default?: string | boolean | string[] | boolean[] | undefined;
}
interface ParseArgsOptionsConfig {
@ -1215,11 +1272,30 @@ declare module 'util' {
}
export interface ParseArgsConfig {
strict?: boolean;
allowPositionals?: boolean;
tokens?: boolean;
options?: ParseArgsOptionsConfig;
args?: string[];
/**
* Array of argument strings.
*/
args?: string[] | undefined;
/**
* Used to describe arguments known to the parser.
*/
options?: ParseArgsOptionsConfig | undefined;
/**
* Should an error be thrown when unknown arguments are encountered,
* or when arguments are passed that do not match the `type` configured in `options`.
* @default true
*/
strict?: boolean | undefined;
/**
* Whether this command accepts positional arguments.
*/
allowPositionals?: boolean | undefined;
/**
* Return the parsed tokens. This is useful for extending the built-in behavior,
* from adding additional checks through to reprocessing the tokens in different ways.
* @default false
*/
tokens?: boolean | undefined;
}
/*
@ -1350,6 +1426,91 @@ declare module 'util' {
tokens?: Token[];
}
: PreciseParsedResults<T>;
/**
* @since v18.13.0
*/
export class MIMEType {
/**
* Creates a new MIMEType object by parsing the input.
*
* A `TypeError` will be thrown if the `input` is not a valid MIME.
* Note that an effort will be made to coerce the given values into strings.
* @param input The input MIME to parse.
*/
constructor(input: string | { toString: () => string });
/**
* Gets and sets the type portion of the MIME.
*/
type: string;
/**
* Gets and sets the subtype portion of the MIME.
*/
subtype: string;
/**
* Gets the essence of the MIME.
*
* Use `mime.type` or `mime.subtype` to alter the MIME.
*/
readonly essence: string;
/**
* Gets the `MIMEParams` object representing the parameters of the MIME.
*/
readonly params: MIMEParams;
/**
* Returns the serialized MIME.
*
* Because of the need for standard compliance, this method
* does not allow users to customize the serialization process of the MIME.
*/
toString(): string;
}
/**
* @since v18.13.0
*/
export class MIMEParams {
/**
* Remove all name-value pairs whose name is `name`.
*/
delete(name: string): void;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
entries(): IterableIterator<[name: string, value: string]>;
/**
* Returns the value of the first name-value pair whose name is `name`.
* If there are no such pairs, `null` is returned.
*/
get(name: string): string | null;
/**
* Returns `true` if there is at least one name-value pair whose name is `name`.
*/
has(name: string): boolean;
/**
* Returns an iterator over the names of each name-value pair.
*/
keys(): IterableIterator<string>;
/**
* Sets the value in the `MIMEParams` object associated with `name` to `value`.
* If there are any pre-existing name-value pairs whose names are `name`,
* set the first such pair's value to `value`.
*/
set(name: string, value: string): void;
/**
* Returns an iterator over the values of each name-value pair.
*/
values(): IterableIterator<string>;
/**
* Returns an iterator over each of the name-value pairs in the parameters.
*/
[Symbol.iterator]: typeof MIMEParams.prototype.entries;
}
}
declare module 'util/types' {
export * from 'util/types';