aws-delivlib 15.4.1 → 15.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/custom-resource-handlers/src/certificate-signing-request.tsbuildinfo +1 -1
- package/lib/custom-resource-handlers/src/pgp-secret.tsbuildinfo +1 -1
- package/lib/custom-resource-handlers/src/private-key.tsbuildinfo +1 -1
- package/lib/package-integrity/handler/validate.bundle.js +11361 -9248
- package/lib/publishing/github/node_modules/.yarn-integrity +5 -5
- package/lib/publishing/github/node_modules/@types/aws-lambda/README.md +1 -1
- package/lib/publishing/github/node_modules/@types/aws-lambda/package.json +2 -2
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +2 -2
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/README.md +3 -3
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/assert/strict.d.ts +13 -56
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/assert.d.ts +189 -190
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/async_hooks.d.ts +151 -43
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/buffer.buffer.d.ts +12 -13
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/buffer.d.ts +103 -237
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/child_process.d.ts +40 -155
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/cluster.d.ts +238 -384
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/console.d.ts +45 -404
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/constants.d.ts +3 -10
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/crypto.d.ts +1019 -1600
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dgram.d.ts +133 -81
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/diagnostics_channel.d.ts +277 -59
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns/promises.d.ts +9 -15
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns.d.ts +136 -183
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/domain.d.ts +12 -32
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/events.d.ts +872 -840
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ffi.d.ts +500 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs/promises.d.ts +256 -85
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs.d.ts +865 -525
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.d.ts +12 -34
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.typedarray.d.ts +63 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http.d.ts +433 -312
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http2.d.ts +548 -893
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/https.d.ts +64 -243
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/index.d.ts +25 -7
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector.d.ts +70 -58
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector.generated.d.ts +764 -410
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/module.d.ts +54 -219
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/net.d.ts +224 -226
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/os.d.ts +41 -49
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/package.json +13 -18
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path/posix.d.ts +8 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path/win32.d.ts +8 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path.d.ts +119 -141
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/perf_hooks.d.ts +339 -690
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/process.d.ts +390 -205
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/punycode.d.ts +3 -31
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/querystring.d.ts +3 -16
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/quic.d.ts +2191 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline/promises.d.ts +3 -6
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline.d.ts +66 -152
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/repl.d.ts +101 -109
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/sea.d.ts +1 -116
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/sqlite.d.ts +486 -68
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream/consumers.d.ts +91 -15
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream/iter.d.ts +449 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream/web.d.ts +197 -454
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream.d.ts +603 -491
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/string_decoder.d.ts +3 -43
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/test/reporters.d.ts +60 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/test.d.ts +585 -292
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers/promises.d.ts +3 -18
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers.d.ts +3 -141
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tls.d.ts +180 -267
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/trace_events.d.ts +3 -97
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -8
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/index.d.ts +26 -6
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tty.d.ts +61 -43
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/url.d.ts +156 -584
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/util/types.d.ts +558 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/util.d.ts +173 -1099
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/v8.d.ts +175 -36
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/vfs.d.ts +211 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/vm.d.ts +293 -209
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/wasi.d.ts +24 -74
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/streams.d.ts +97 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/worker_threads.d.ts +260 -407
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/zlib.d.ts +782 -165
- package/lib/publishing/github/node_modules/semver/classes/range.js +2 -2
- package/lib/publishing/github/node_modules/semver/internal/constants.js +30 -0
- package/lib/publishing/github/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/lib/publishing/github/node_modules/semver/package.json +1 -1
- package/lib/publishing/github/node_modules/undici-types/agent.d.ts +12 -13
- package/lib/publishing/github/node_modules/undici-types/api.d.ts +26 -26
- package/lib/publishing/github/node_modules/undici-types/balanced-pool.d.ts +13 -12
- package/lib/publishing/github/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/lib/publishing/github/node_modules/undici-types/client-stats.d.ts +15 -0
- package/lib/publishing/github/node_modules/undici-types/client.d.ts +63 -37
- package/lib/publishing/github/node_modules/undici-types/connector.d.ts +5 -2
- package/lib/publishing/github/node_modules/undici-types/cookies.d.ts +3 -1
- package/lib/publishing/github/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/lib/publishing/github/node_modules/undici-types/dispatcher.d.ts +136 -139
- package/lib/publishing/github/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/lib/publishing/github/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/lib/publishing/github/node_modules/undici-types/errors.d.ts +92 -54
- package/lib/publishing/github/node_modules/undici-types/eventsource.d.ts +9 -4
- package/lib/publishing/github/node_modules/undici-types/fetch.d.ts +51 -25
- package/lib/publishing/github/node_modules/undici-types/formdata.d.ts +7 -7
- package/lib/publishing/github/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/lib/publishing/github/node_modules/undici-types/global-origin.d.ts +5 -5
- package/lib/publishing/github/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/lib/publishing/github/node_modules/undici-types/handlers.d.ts +10 -9
- package/lib/publishing/github/node_modules/undici-types/header.d.ts +162 -1
- package/lib/publishing/github/node_modules/undici-types/index.d.ts +69 -47
- package/lib/publishing/github/node_modules/undici-types/interceptors.d.ts +72 -9
- package/lib/publishing/github/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/lib/publishing/github/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/lib/publishing/github/node_modules/undici-types/mock-client.d.ts +6 -4
- package/lib/publishing/github/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/lib/publishing/github/node_modules/undici-types/mock-interceptor.d.ts +26 -21
- package/lib/publishing/github/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/lib/publishing/github/node_modules/undici-types/package.json +1 -1
- package/lib/publishing/github/node_modules/undici-types/patch.d.ts +0 -4
- package/lib/publishing/github/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/lib/publishing/github/node_modules/undici-types/pool.d.ts +14 -14
- package/lib/publishing/github/node_modules/undici-types/proxy-agent.d.ts +14 -6
- package/lib/publishing/github/node_modules/undici-types/readable.d.ts +19 -16
- package/lib/publishing/github/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/lib/publishing/github/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/lib/publishing/github/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/lib/publishing/github/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/lib/publishing/github/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/lib/publishing/github/node_modules/undici-types/util.d.ts +3 -3
- package/lib/publishing/github/node_modules/undici-types/utility.d.ts +7 -0
- package/lib/publishing/github/node_modules/undici-types/webidl.d.ts +148 -30
- package/lib/publishing/github/node_modules/undici-types/websocket.d.ts +48 -10
- package/lib/shellable.d.ts +7 -3
- package/lib/shellable.js +37 -27
- package/package.json +11 -11
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/lib/publishing/github/node_modules/undici-types/file.d.ts +0 -39
- package/lib/publishing/github/node_modules/undici-types/filereader.d.ts +0 -54
package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/net.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
* > Stability: 2 - Stable
|
|
3
|
-
*
|
|
4
|
-
* The `node:net` module provides an asynchronous network API for creating stream-based
|
|
5
|
-
* TCP or `IPC` servers ({@link createServer}) and clients
|
|
6
|
-
* ({@link createConnection}).
|
|
7
|
-
*
|
|
8
|
-
* It can be accessed using:
|
|
9
|
-
*
|
|
10
|
-
* ```js
|
|
11
|
-
* import net from 'node:net';
|
|
12
|
-
* ```
|
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/net.js)
|
|
14
|
-
*/
|
|
15
|
-
declare module "net" {
|
|
1
|
+
declare module "node:net" {
|
|
16
2
|
import { NonSharedBuffer } from "node:buffer";
|
|
17
|
-
import * as stream from "node:stream";
|
|
18
|
-
import { Abortable, EventEmitter } from "node:events";
|
|
19
3
|
import * as dns from "node:dns";
|
|
4
|
+
import { Abortable, EventEmitter, InternalEventEmitter } from "node:events";
|
|
5
|
+
import * as stream from "node:stream";
|
|
20
6
|
type LookupFunction = (
|
|
21
7
|
hostname: string,
|
|
22
8
|
options: dns.LookupOptions,
|
|
@@ -34,6 +20,12 @@ declare module "net" {
|
|
|
34
20
|
readable?: boolean | undefined;
|
|
35
21
|
writable?: boolean | undefined;
|
|
36
22
|
signal?: AbortSignal | undefined;
|
|
23
|
+
noDelay?: boolean | undefined;
|
|
24
|
+
keepAlive?: boolean | undefined;
|
|
25
|
+
keepAliveInitialDelay?: number | undefined;
|
|
26
|
+
blockList?: BlockList | undefined;
|
|
27
|
+
typeOfService?: number | undefined;
|
|
28
|
+
handle?: BoundSocket | undefined;
|
|
37
29
|
}
|
|
38
30
|
interface OnReadOpts {
|
|
39
31
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -44,9 +36,6 @@ declare module "net" {
|
|
|
44
36
|
*/
|
|
45
37
|
callback(bytesWritten: number, buffer: Uint8Array): boolean;
|
|
46
38
|
}
|
|
47
|
-
// TODO: remove empty ConnectOpts placeholder at next major @types/node version.
|
|
48
|
-
/** @deprecated */
|
|
49
|
-
interface ConnectOpts {}
|
|
50
39
|
interface TcpSocketConnectOpts {
|
|
51
40
|
port: number;
|
|
52
41
|
host?: string | undefined;
|
|
@@ -55,9 +44,6 @@ declare module "net" {
|
|
|
55
44
|
hints?: number | undefined;
|
|
56
45
|
family?: number | undefined;
|
|
57
46
|
lookup?: LookupFunction | undefined;
|
|
58
|
-
noDelay?: boolean | undefined;
|
|
59
|
-
keepAlive?: boolean | undefined;
|
|
60
|
-
keepAliveInitialDelay?: number | undefined;
|
|
61
47
|
/**
|
|
62
48
|
* @since v18.13.0
|
|
63
49
|
*/
|
|
@@ -66,13 +52,29 @@ declare module "net" {
|
|
|
66
52
|
* @since v18.13.0
|
|
67
53
|
*/
|
|
68
54
|
autoSelectFamilyAttemptTimeout?: number | undefined;
|
|
69
|
-
blockList?: BlockList | undefined;
|
|
70
55
|
}
|
|
71
56
|
interface IpcSocketConnectOpts {
|
|
72
57
|
path: string;
|
|
73
58
|
}
|
|
74
59
|
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
|
75
60
|
type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
|
|
61
|
+
interface SetKeepAliveOptions {
|
|
62
|
+
enable?: boolean | undefined;
|
|
63
|
+
initialDelay?: number | undefined;
|
|
64
|
+
interval?: number | undefined;
|
|
65
|
+
count?: number | undefined;
|
|
66
|
+
}
|
|
67
|
+
interface SocketEventMap extends Omit<stream.DuplexEventMap, "close"> {
|
|
68
|
+
"close": [hadError: boolean];
|
|
69
|
+
"connect": [];
|
|
70
|
+
"connectionAttempt": [ip: string, port: number, family: number];
|
|
71
|
+
"connectionAttemptFailed": [ip: string, port: number, family: number, error: Error];
|
|
72
|
+
"connectionAttemptTimeout": [ip: string, port: number, family: number];
|
|
73
|
+
"data": [data: string | NonSharedBuffer];
|
|
74
|
+
"lookup": [err: Error | null, address: string, family: number | null, host: string];
|
|
75
|
+
"ready": [];
|
|
76
|
+
"timeout": [];
|
|
77
|
+
}
|
|
76
78
|
/**
|
|
77
79
|
* This class is an abstraction of a TCP socket or a streaming `IPC` endpoint
|
|
78
80
|
* (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
|
|
@@ -204,25 +206,58 @@ declare module "net" {
|
|
|
204
206
|
*/
|
|
205
207
|
setNoDelay(noDelay?: boolean): this;
|
|
206
208
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
+
* Configure keep-alive using an options object. See `socket.setKeepAlive()`
|
|
210
|
+
* for a description of each property.
|
|
211
|
+
*
|
|
212
|
+
* ```js
|
|
213
|
+
* socket.setKeepAlive({ enable: true, initialDelay: 1000, interval: 1000, count: 10 });
|
|
214
|
+
* ```
|
|
215
|
+
* @since v26.4.0
|
|
216
|
+
* @returns The socket itself.
|
|
217
|
+
*/
|
|
218
|
+
setKeepAlive(options: SetKeepAliveOptions): this;
|
|
219
|
+
/**
|
|
220
|
+
* Configure keep-alive using positional arguments. See
|
|
221
|
+
* `socket.setKeepAlive()` for a description of each argument.
|
|
222
|
+
* @since v0.1.92
|
|
223
|
+
* @param enable **Default:** `false`
|
|
224
|
+
* @param initialDelay **Default:** `0`
|
|
225
|
+
* @param interval **Default:** `1000`
|
|
226
|
+
* @param count **Default:** `10`
|
|
227
|
+
* @returns The socket itself.
|
|
228
|
+
*/
|
|
229
|
+
setKeepAlive(enable?: boolean, initialDelay?: number, interval?: number, count?: number): this;
|
|
230
|
+
/**
|
|
231
|
+
* Returns the current Type of Service (TOS) field for IPv4 packets or Traffic
|
|
232
|
+
* Class for IPv6 packets for this socket.
|
|
209
233
|
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* (
|
|
234
|
+
* `setTypeOfService()` may be called before the socket is connected; the value
|
|
235
|
+
* will be cached and applied when the socket establishes a connection.
|
|
236
|
+
* `getTypeOfService()` will return the currently set value even before connection.
|
|
213
237
|
*
|
|
214
|
-
*
|
|
238
|
+
* On some platforms (e.g., Linux), certain TOS/ECN bits may be masked or ignored,
|
|
239
|
+
* and behavior can differ between IPv4 and IPv6 or dual-stack sockets. Callers
|
|
240
|
+
* should verify platform-specific semantics.
|
|
241
|
+
* @since v25.6.0
|
|
242
|
+
* @returns The current TOS value.
|
|
243
|
+
*/
|
|
244
|
+
getTypeOfService(): number;
|
|
245
|
+
/**
|
|
246
|
+
* Sets the Type of Service (TOS) field for IPv4 packets or Traffic Class for IPv6
|
|
247
|
+
* Packets sent from this socket. This can be used to prioritize network traffic.
|
|
215
248
|
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* @
|
|
249
|
+
* `setTypeOfService()` may be called before the socket is connected; the value
|
|
250
|
+
* will be cached and applied when the socket establishes a connection.
|
|
251
|
+
* `getTypeOfService()` will return the currently set value even before connection.
|
|
252
|
+
*
|
|
253
|
+
* On some platforms (e.g., Linux), certain TOS/ECN bits may be masked or ignored,
|
|
254
|
+
* and behavior can differ between IPv4 and IPv6 or dual-stack sockets. Callers
|
|
255
|
+
* should verify platform-specific semantics.
|
|
256
|
+
* @since v25.6.0
|
|
257
|
+
* @param tos The TOS value to set (0-255).
|
|
258
|
+
* @returns The socket itself.
|
|
224
259
|
*/
|
|
225
|
-
|
|
260
|
+
setTypeOfService(tos: number): this;
|
|
226
261
|
/**
|
|
227
262
|
* Returns the bound `address`, the address `family` name and `port` of the
|
|
228
263
|
* socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
|
|
@@ -318,10 +353,11 @@ declare module "net" {
|
|
|
318
353
|
/**
|
|
319
354
|
* This property represents the state of the connection as a string.
|
|
320
355
|
*
|
|
321
|
-
* * If the
|
|
322
|
-
* * If the
|
|
323
|
-
* * If the
|
|
324
|
-
* * If the
|
|
356
|
+
* * If the socket is connecting, `socket.readyState` is `opening`.
|
|
357
|
+
* * If the socket is readable and writable, it is `open`.
|
|
358
|
+
* * If the socket is readable and not writable, it is `readOnly`.
|
|
359
|
+
* * If the socket is not readable and writable, it is `writeOnly`.
|
|
360
|
+
* * Otherwise, it is `closed`.
|
|
325
361
|
* @since v0.5.0
|
|
326
362
|
*/
|
|
327
363
|
readonly readyState: SocketReadyState;
|
|
@@ -343,6 +379,12 @@ declare module "net" {
|
|
|
343
379
|
* @since v0.5.10
|
|
344
380
|
*/
|
|
345
381
|
readonly remotePort: number | undefined;
|
|
382
|
+
/**
|
|
383
|
+
* Reference to the server that accepted the socket. This is `null` for sockets
|
|
384
|
+
* that were not accepted by a server.
|
|
385
|
+
* @since v0.3.4
|
|
386
|
+
*/
|
|
387
|
+
readonly server: Server | null;
|
|
346
388
|
/**
|
|
347
389
|
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
348
390
|
* It is `undefined` if a timeout has not been set.
|
|
@@ -376,145 +418,137 @@ declare module "net" {
|
|
|
376
418
|
* @return The socket itself.
|
|
377
419
|
*/
|
|
378
420
|
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
listener: (ip: string, port: number, family: number, error: Error) => void,
|
|
401
|
-
): this;
|
|
402
|
-
addListener(
|
|
403
|
-
event: "connectionAttemptTimeout",
|
|
404
|
-
listener: (ip: string, port: number, family: number) => void,
|
|
405
|
-
): this;
|
|
406
|
-
addListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
407
|
-
addListener(event: "drain", listener: () => void): this;
|
|
408
|
-
addListener(event: "end", listener: () => void): this;
|
|
409
|
-
addListener(event: "error", listener: (err: Error) => void): this;
|
|
410
|
-
addListener(
|
|
411
|
-
event: "lookup",
|
|
412
|
-
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
|
413
|
-
): this;
|
|
414
|
-
addListener(event: "ready", listener: () => void): this;
|
|
415
|
-
addListener(event: "timeout", listener: () => void): this;
|
|
416
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
417
|
-
emit(event: "close", hadError: boolean): boolean;
|
|
418
|
-
emit(event: "connect"): boolean;
|
|
419
|
-
emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
|
|
420
|
-
emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean;
|
|
421
|
-
emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
|
|
422
|
-
emit(event: "data", data: NonSharedBuffer): boolean;
|
|
423
|
-
emit(event: "drain"): boolean;
|
|
424
|
-
emit(event: "end"): boolean;
|
|
425
|
-
emit(event: "error", err: Error): boolean;
|
|
426
|
-
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
|
|
427
|
-
emit(event: "ready"): boolean;
|
|
428
|
-
emit(event: "timeout"): boolean;
|
|
429
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
430
|
-
on(event: "close", listener: (hadError: boolean) => void): this;
|
|
431
|
-
on(event: "connect", listener: () => void): this;
|
|
432
|
-
on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
433
|
-
on(
|
|
434
|
-
event: "connectionAttemptFailed",
|
|
435
|
-
listener: (ip: string, port: number, family: number, error: Error) => void,
|
|
436
|
-
): this;
|
|
437
|
-
on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
438
|
-
on(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
439
|
-
on(event: "drain", listener: () => void): this;
|
|
440
|
-
on(event: "end", listener: () => void): this;
|
|
441
|
-
on(event: "error", listener: (err: Error) => void): this;
|
|
442
|
-
on(
|
|
443
|
-
event: "lookup",
|
|
444
|
-
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
|
445
|
-
): this;
|
|
446
|
-
on(event: "ready", listener: () => void): this;
|
|
447
|
-
on(event: "timeout", listener: () => void): this;
|
|
448
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
449
|
-
once(event: "close", listener: (hadError: boolean) => void): this;
|
|
450
|
-
once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
451
|
-
once(
|
|
452
|
-
event: "connectionAttemptFailed",
|
|
453
|
-
listener: (ip: string, port: number, family: number, error: Error) => void,
|
|
454
|
-
): this;
|
|
455
|
-
once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
456
|
-
once(event: "connect", listener: () => void): this;
|
|
457
|
-
once(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
458
|
-
once(event: "drain", listener: () => void): this;
|
|
459
|
-
once(event: "end", listener: () => void): this;
|
|
460
|
-
once(event: "error", listener: (err: Error) => void): this;
|
|
461
|
-
once(
|
|
462
|
-
event: "lookup",
|
|
463
|
-
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
|
464
|
-
): this;
|
|
465
|
-
once(event: "ready", listener: () => void): this;
|
|
466
|
-
once(event: "timeout", listener: () => void): this;
|
|
467
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
468
|
-
prependListener(event: "close", listener: (hadError: boolean) => void): this;
|
|
469
|
-
prependListener(event: "connect", listener: () => void): this;
|
|
470
|
-
prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
471
|
-
prependListener(
|
|
472
|
-
event: "connectionAttemptFailed",
|
|
473
|
-
listener: (ip: string, port: number, family: number, error: Error) => void,
|
|
474
|
-
): this;
|
|
475
|
-
prependListener(
|
|
476
|
-
event: "connectionAttemptTimeout",
|
|
477
|
-
listener: (ip: string, port: number, family: number) => void,
|
|
478
|
-
): this;
|
|
479
|
-
prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
480
|
-
prependListener(event: "drain", listener: () => void): this;
|
|
481
|
-
prependListener(event: "end", listener: () => void): this;
|
|
482
|
-
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
483
|
-
prependListener(
|
|
484
|
-
event: "lookup",
|
|
485
|
-
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
|
421
|
+
// #region InternalEventEmitter
|
|
422
|
+
addListener<E extends keyof SocketEventMap>(eventName: E, listener: (...args: SocketEventMap[E]) => void): this;
|
|
423
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
424
|
+
emit<E extends keyof SocketEventMap>(eventName: E, ...args: SocketEventMap[E]): boolean;
|
|
425
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
426
|
+
listenerCount<E extends keyof SocketEventMap>(
|
|
427
|
+
eventName: E,
|
|
428
|
+
listener?: (...args: SocketEventMap[E]) => void,
|
|
429
|
+
): number;
|
|
430
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
431
|
+
listeners<E extends keyof SocketEventMap>(eventName: E): ((...args: SocketEventMap[E]) => void)[];
|
|
432
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
433
|
+
off<E extends keyof SocketEventMap>(eventName: E, listener: (...args: SocketEventMap[E]) => void): this;
|
|
434
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
435
|
+
on<E extends keyof SocketEventMap>(eventName: E, listener: (...args: SocketEventMap[E]) => void): this;
|
|
436
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
437
|
+
once<E extends keyof SocketEventMap>(eventName: E, listener: (...args: SocketEventMap[E]) => void): this;
|
|
438
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
439
|
+
prependListener<E extends keyof SocketEventMap>(
|
|
440
|
+
eventName: E,
|
|
441
|
+
listener: (...args: SocketEventMap[E]) => void,
|
|
486
442
|
): this;
|
|
487
|
-
prependListener(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
prependOnceListener(event: "connect", listener: () => void): this;
|
|
492
|
-
prependOnceListener(
|
|
493
|
-
event: "connectionAttempt",
|
|
494
|
-
listener: (ip: string, port: number, family: number) => void,
|
|
443
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
444
|
+
prependOnceListener<E extends keyof SocketEventMap>(
|
|
445
|
+
eventName: E,
|
|
446
|
+
listener: (...args: SocketEventMap[E]) => void,
|
|
495
447
|
): this;
|
|
496
|
-
prependOnceListener(
|
|
497
|
-
|
|
498
|
-
|
|
448
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
449
|
+
rawListeners<E extends keyof SocketEventMap>(eventName: E): ((...args: SocketEventMap[E]) => void)[];
|
|
450
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
451
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
452
|
+
removeAllListeners<E extends keyof SocketEventMap>(eventName?: E): this;
|
|
453
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
454
|
+
removeListener<E extends keyof SocketEventMap>(
|
|
455
|
+
eventName: E,
|
|
456
|
+
listener: (...args: SocketEventMap[E]) => void,
|
|
499
457
|
): this;
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
458
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
459
|
+
// #endregion
|
|
460
|
+
}
|
|
461
|
+
interface BoundSocketOptions {
|
|
462
|
+
/**
|
|
463
|
+
* Local address to bind. Must be a numeric IP literal; no DNS
|
|
464
|
+
* resolution is performed. **Default:** `'0.0.0.0'`, or `'::'` when
|
|
465
|
+
* `ipv6Only` is `true`.
|
|
466
|
+
*/
|
|
467
|
+
host?: string | undefined;
|
|
468
|
+
/**
|
|
469
|
+
* Local port. `0` requests an OS-assigned ephemeral port.
|
|
470
|
+
* **Default:** `0`.
|
|
471
|
+
*/
|
|
472
|
+
port?: number | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* Sets `IPV6_V6ONLY`, disabling dual-stack support so the
|
|
475
|
+
* socket binds IPv6 only. Only meaningful for IPv6 binds. **Default:**
|
|
476
|
+
* `false`.
|
|
477
|
+
*/
|
|
478
|
+
ipv6Only?: boolean | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* Sets `SO_REUSEPORT`, allowing multiple sockets to bind
|
|
481
|
+
* the same address and port for kernel-level load balancing. Support is
|
|
482
|
+
* platform-dependent. **Default:** `false`.
|
|
483
|
+
*/
|
|
484
|
+
reusePort?: boolean | undefined;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Allows for the synchronous creation of a pre-bound socket, that can be passed
|
|
488
|
+
* to `listen()` or `new net.Socket()` later on. For `listen()` this enables
|
|
489
|
+
* synchronous port reservation, while for `new net.Socket()`, it allows control
|
|
490
|
+
* over the local egress port/IP, via `bind(2)` semantics.
|
|
491
|
+
*
|
|
492
|
+
* Adoption transfers ownership of the socket; afterwards `address()` and `close()`
|
|
493
|
+
* throw `ERR_SOCKET_HANDLE_ADOPTED`. A handle that is never adopted must be
|
|
494
|
+
* closed to avoid leaking the socket.
|
|
495
|
+
*
|
|
496
|
+
* When an adopted `BoundSocket` connects to a numeric IP literal, `connect(2)` is
|
|
497
|
+
* issued synchronously, so `socket.localAddress` is resolved once
|
|
498
|
+
* `socket.connect()` returns. Connection failures are still reported via a
|
|
499
|
+
* deferred `'error'` event.
|
|
500
|
+
*
|
|
501
|
+
* ```js
|
|
502
|
+
* import net from 'node:net';
|
|
503
|
+
*
|
|
504
|
+
* const bound = new net.BoundSocket();
|
|
505
|
+
* const { port } = bound.address();
|
|
506
|
+
* console.log(`Reserved port ${port} for server`);
|
|
507
|
+
*
|
|
508
|
+
* const server = net.createServer();
|
|
509
|
+
* server.listen(bound); // Adopt as a server, or pass to new net.Socket() instead.
|
|
510
|
+
* ```
|
|
511
|
+
* @since v26.4.0
|
|
512
|
+
*/
|
|
513
|
+
class BoundSocket {
|
|
514
|
+
/**
|
|
515
|
+
* @since v26.4.0
|
|
516
|
+
*/
|
|
517
|
+
constructor(options?: BoundSocketOptions);
|
|
518
|
+
/**
|
|
519
|
+
* Returns the bound local address. When bound with `port: 0`, `port` is the
|
|
520
|
+
* OS-assigned ephemeral port.
|
|
521
|
+
* @since v26.4.0
|
|
522
|
+
* @returns An object with `address`, `family`, and `port` properties,
|
|
523
|
+
* as `server.address()` returns.
|
|
524
|
+
*/
|
|
525
|
+
address(): AddressInfo;
|
|
526
|
+
/**
|
|
527
|
+
* Returns the file descriptor of the bound socket. Ownership remains with the
|
|
528
|
+
* `BoundSocket`, so the descriptor must not be closed by the caller. The
|
|
529
|
+
* descriptor is only available before the handle is adopted; afterwards it belongs
|
|
530
|
+
* to the adopting `net.Server` or `net.Socket` and `fd()` throws
|
|
531
|
+
* `ERR_SOCKET_HANDLE_ADOPTED`.
|
|
532
|
+
* @since v26.4.0
|
|
533
|
+
* @returns The underlying OS file descriptor, or `-1` on platforms
|
|
534
|
+
* that do not expose one for sockets (such as Windows).
|
|
535
|
+
*/
|
|
536
|
+
fd(): number;
|
|
537
|
+
/**
|
|
538
|
+
* Releases the bound socket. Only needed when the handle is never adopted.
|
|
539
|
+
* @since v26.4.0
|
|
540
|
+
*/
|
|
541
|
+
close(): void;
|
|
542
|
+
/**
|
|
543
|
+
* Closes the handle if it has not been adopted or closed; otherwise a no-op.
|
|
544
|
+
* @since v26.4.0
|
|
545
|
+
*/
|
|
546
|
+
[Symbol.dispose](): void;
|
|
514
547
|
}
|
|
515
548
|
interface ListenOptions extends Abortable {
|
|
516
549
|
backlog?: number | undefined;
|
|
517
550
|
exclusive?: boolean | undefined;
|
|
551
|
+
handle?: BoundSocket | undefined;
|
|
518
552
|
host?: string | undefined;
|
|
519
553
|
/**
|
|
520
554
|
* @default false
|
|
@@ -558,7 +592,7 @@ declare module "net" {
|
|
|
558
592
|
keepAliveInitialDelay?: number | undefined;
|
|
559
593
|
/**
|
|
560
594
|
* Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
|
|
561
|
-
* @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-
|
|
595
|
+
* @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v26.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode).
|
|
562
596
|
* @since v18.17.0, v20.1.0
|
|
563
597
|
*/
|
|
564
598
|
highWaterMark?: number | undefined;
|
|
@@ -580,11 +614,18 @@ declare module "net" {
|
|
|
580
614
|
remotePort?: number;
|
|
581
615
|
remoteFamily?: string;
|
|
582
616
|
}
|
|
617
|
+
interface ServerEventMap {
|
|
618
|
+
"close": [];
|
|
619
|
+
"connection": [socket: Socket];
|
|
620
|
+
"error": [err: Error];
|
|
621
|
+
"listening": [];
|
|
622
|
+
"drop": [data?: DropArgument];
|
|
623
|
+
}
|
|
583
624
|
/**
|
|
584
625
|
* This class is used to create a TCP or `IPC` server.
|
|
585
626
|
* @since v0.1.90
|
|
586
627
|
*/
|
|
587
|
-
class Server
|
|
628
|
+
class Server implements EventEmitter {
|
|
588
629
|
constructor(connectionListener?: (socket: Socket) => void);
|
|
589
630
|
constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
|
|
590
631
|
/**
|
|
@@ -710,56 +751,13 @@ declare module "net" {
|
|
|
710
751
|
* @since v5.7.0
|
|
711
752
|
*/
|
|
712
753
|
readonly listening: boolean;
|
|
713
|
-
/**
|
|
714
|
-
* events.EventEmitter
|
|
715
|
-
* 1. close
|
|
716
|
-
* 2. connection
|
|
717
|
-
* 3. error
|
|
718
|
-
* 4. listening
|
|
719
|
-
* 5. drop
|
|
720
|
-
*/
|
|
721
|
-
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
722
|
-
addListener(event: "close", listener: () => void): this;
|
|
723
|
-
addListener(event: "connection", listener: (socket: Socket) => void): this;
|
|
724
|
-
addListener(event: "error", listener: (err: Error) => void): this;
|
|
725
|
-
addListener(event: "listening", listener: () => void): this;
|
|
726
|
-
addListener(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
727
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
728
|
-
emit(event: "close"): boolean;
|
|
729
|
-
emit(event: "connection", socket: Socket): boolean;
|
|
730
|
-
emit(event: "error", err: Error): boolean;
|
|
731
|
-
emit(event: "listening"): boolean;
|
|
732
|
-
emit(event: "drop", data?: DropArgument): boolean;
|
|
733
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
734
|
-
on(event: "close", listener: () => void): this;
|
|
735
|
-
on(event: "connection", listener: (socket: Socket) => void): this;
|
|
736
|
-
on(event: "error", listener: (err: Error) => void): this;
|
|
737
|
-
on(event: "listening", listener: () => void): this;
|
|
738
|
-
on(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
739
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
740
|
-
once(event: "close", listener: () => void): this;
|
|
741
|
-
once(event: "connection", listener: (socket: Socket) => void): this;
|
|
742
|
-
once(event: "error", listener: (err: Error) => void): this;
|
|
743
|
-
once(event: "listening", listener: () => void): this;
|
|
744
|
-
once(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
745
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
746
|
-
prependListener(event: "close", listener: () => void): this;
|
|
747
|
-
prependListener(event: "connection", listener: (socket: Socket) => void): this;
|
|
748
|
-
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
749
|
-
prependListener(event: "listening", listener: () => void): this;
|
|
750
|
-
prependListener(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
751
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
752
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
753
|
-
prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
|
|
754
|
-
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
755
|
-
prependOnceListener(event: "listening", listener: () => void): this;
|
|
756
|
-
prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
757
754
|
/**
|
|
758
755
|
* Calls {@link Server.close()} and returns a promise that fulfills when the server has closed.
|
|
759
756
|
* @since v20.5.0
|
|
760
757
|
*/
|
|
761
758
|
[Symbol.asyncDispose](): Promise<void>;
|
|
762
759
|
}
|
|
760
|
+
interface Server extends InternalEventEmitter<ServerEventMap> {}
|
|
763
761
|
type IPVersion = "ipv4" | "ipv6";
|
|
764
762
|
/**
|
|
765
763
|
* The `BlockList` object can be used with some network APIs to specify rules for
|
|
@@ -840,12 +838,12 @@ declare module "net" {
|
|
|
840
838
|
* blockList.fromJSON(data);
|
|
841
839
|
* blockList.fromJSON(JSON.stringify(data));
|
|
842
840
|
* ```
|
|
843
|
-
* @since
|
|
841
|
+
* @since v24.5.0
|
|
844
842
|
* @experimental
|
|
845
843
|
*/
|
|
846
844
|
fromJSON(data: string | readonly string[]): void;
|
|
847
845
|
/**
|
|
848
|
-
* @since
|
|
846
|
+
* @since v24.5.0
|
|
849
847
|
* @experimental
|
|
850
848
|
*/
|
|
851
849
|
toJSON(): readonly string[];
|
|
@@ -968,7 +966,7 @@ declare module "net" {
|
|
|
968
966
|
function setDefaultAutoSelectFamily(value: boolean): void;
|
|
969
967
|
/**
|
|
970
968
|
* Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
|
|
971
|
-
* The initial default value is `
|
|
969
|
+
* The initial default value is `500` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`.
|
|
972
970
|
* @returns The current default value of the `autoSelectFamilyAttemptTimeout` option.
|
|
973
971
|
* @since v19.8.0, v18.8.0
|
|
974
972
|
*/
|
|
@@ -1071,6 +1069,6 @@ declare module "net" {
|
|
|
1071
1069
|
static parse(input: string): SocketAddress | undefined;
|
|
1072
1070
|
}
|
|
1073
1071
|
}
|
|
1074
|
-
declare module "
|
|
1075
|
-
export * from "net";
|
|
1072
|
+
declare module "net" {
|
|
1073
|
+
export * from "node:net";
|
|
1076
1074
|
}
|