@types/node 16.11.54 → 16.11.57
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.
- node v16.11/README.md +1 -1
- node v16.11/http.d.ts +19 -0
- node v16.11/http2.d.ts +1 -1
- node v16.11/index.d.ts +1 -0
- node v16.11/net.d.ts +22 -0
- node v16.11/package.json +3 -3
- node v16.11/test.d.ts +190 -0
node v16.11/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 05 Sep 2022 08:02:43 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
|
14
14
|
|
node v16.11/http.d.ts
CHANGED
|
@@ -155,6 +155,25 @@ declare module 'http' {
|
|
|
155
155
|
* @default false
|
|
156
156
|
*/
|
|
157
157
|
insecureHTTPParser?: boolean | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
|
|
160
|
+
* @default false
|
|
161
|
+
* @since v16.5.0
|
|
162
|
+
*/
|
|
163
|
+
noDelay?: boolean | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
|
166
|
+
* similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
|
|
167
|
+
* @default false
|
|
168
|
+
* @since v16.5.0
|
|
169
|
+
*/
|
|
170
|
+
keepAlive?: boolean | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
|
|
173
|
+
* @default 0
|
|
174
|
+
* @since v16.5.0
|
|
175
|
+
*/
|
|
176
|
+
keepAliveInitialDelay?: number | undefined;
|
|
158
177
|
}
|
|
159
178
|
type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|
|
160
179
|
/**
|
node v16.11/http2.d.ts
CHANGED
|
@@ -780,7 +780,7 @@ declare module 'http2' {
|
|
|
780
780
|
* @since v8.4.0
|
|
781
781
|
* @param callback Callback that is called once the session is connected or right away if the session is already connected.
|
|
782
782
|
*/
|
|
783
|
-
settings(settings: Settings): void;
|
|
783
|
+
settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void;
|
|
784
784
|
/**
|
|
785
785
|
* Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`.
|
|
786
786
|
* @since v9.4.0
|
node v16.11/index.d.ts
CHANGED
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
/// <reference path="stream/consumers.d.ts" />
|
|
115
115
|
/// <reference path="stream/web.d.ts" />
|
|
116
116
|
/// <reference path="string_decoder.d.ts" />
|
|
117
|
+
/// <reference path="test.d.ts" />
|
|
117
118
|
/// <reference path="timers.d.ts" />
|
|
118
119
|
/// <reference path="timers/promises.d.ts" />
|
|
119
120
|
/// <reference path="tls.d.ts" />
|
node v16.11/net.d.ts
CHANGED
|
@@ -54,6 +54,9 @@ declare module 'net' {
|
|
|
54
54
|
hints?: number | undefined;
|
|
55
55
|
family?: number | undefined;
|
|
56
56
|
lookup?: LookupFunction | undefined;
|
|
57
|
+
noDelay?: boolean | undefined;
|
|
58
|
+
keepAlive?: boolean | undefined;
|
|
59
|
+
keepAliveInitialDelay?: number | undefined;
|
|
57
60
|
}
|
|
58
61
|
interface IpcSocketConnectOpts extends ConnectOpts {
|
|
59
62
|
path: string;
|
|
@@ -399,6 +402,25 @@ declare module 'net' {
|
|
|
399
402
|
* @default false
|
|
400
403
|
*/
|
|
401
404
|
pauseOnConnect?: boolean | undefined;
|
|
405
|
+
/**
|
|
406
|
+
* If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
|
|
407
|
+
* @default false
|
|
408
|
+
* @since v16.5.0
|
|
409
|
+
*/
|
|
410
|
+
noDelay?: boolean | undefined;
|
|
411
|
+
/**
|
|
412
|
+
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
|
413
|
+
* similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
|
|
414
|
+
* @default false
|
|
415
|
+
* @since v16.5.0
|
|
416
|
+
*/
|
|
417
|
+
keepAlive?: boolean | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
|
|
420
|
+
* @default 0
|
|
421
|
+
* @since v16.5.0
|
|
422
|
+
*/
|
|
423
|
+
keepAliveInitialDelay?: number | undefined;
|
|
402
424
|
}
|
|
403
425
|
/**
|
|
404
426
|
* This class is used to create a TCP or `IPC` server.
|
node v16.11/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.11.
|
|
3
|
+
"version": "16.11.57",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -220,6 +220,6 @@
|
|
|
220
220
|
},
|
|
221
221
|
"scripts": {},
|
|
222
222
|
"dependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
224
|
-
"typeScriptVersion": "4.
|
|
223
|
+
"typesPublisherContentHash": "263b86af9892dc8b5e33e6379a30cb71fc2b63627044ea09b2e90ec4a6c10fe2",
|
|
224
|
+
"typeScriptVersion": "4.1"
|
|
225
225
|
}
|
node v16.11/test.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `node:test` module provides a standalone testing module.
|
|
3
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.17.0/lib/test.js)
|
|
4
|
+
*/
|
|
5
|
+
declare module 'node:test' {
|
|
6
|
+
/**
|
|
7
|
+
* The `test()` function is the value imported from the test module. Each invocation of this
|
|
8
|
+
* function results in the creation of a test point in the TAP output.
|
|
9
|
+
*
|
|
10
|
+
* The {@link TestContext} object passed to the fn argument can be used to perform actions
|
|
11
|
+
* related to the current test. Examples include skipping the test, adding additional TAP
|
|
12
|
+
* diagnostic information, or creating subtests.
|
|
13
|
+
*
|
|
14
|
+
* `test()` returns a {@link Promise} that resolves once the test completes. The return value
|
|
15
|
+
* can usually be discarded for top level tests. However, the return value from subtests should
|
|
16
|
+
* be used to prevent the parent test from finishing first and cancelling the subtest as shown
|
|
17
|
+
* in the following example.
|
|
18
|
+
*
|
|
19
|
+
* ```js
|
|
20
|
+
* test('top level test', async (t) => {
|
|
21
|
+
* // The setTimeout() in the following subtest would cause it to outlive its
|
|
22
|
+
* // parent test if 'await' is removed on the next line. Once the parent test
|
|
23
|
+
* // completes, it will cancel any outstanding subtests.
|
|
24
|
+
* await t.test('longer running subtest', async (t) => {
|
|
25
|
+
* return new Promise((resolve, reject) => {
|
|
26
|
+
* setTimeout(resolve, 1000);
|
|
27
|
+
* });
|
|
28
|
+
* });
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
* @since v16.17.0
|
|
32
|
+
* @param name The name of the test, which is displayed when reporting test results.
|
|
33
|
+
* Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
|
|
34
|
+
* @param options Configuration options for the test
|
|
35
|
+
* @param fn The function under test. The first argument to this function is a
|
|
36
|
+
* {@link TestContext} object. If the test uses callbacks, the callback function is
|
|
37
|
+
* passed as the second argument. Default: A no-op function.
|
|
38
|
+
* @returns A {@link Promise} resolved with `undefined` once the test completes.
|
|
39
|
+
*/
|
|
40
|
+
function test(name?: string, fn?: TestFn): Promise<void>;
|
|
41
|
+
function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
42
|
+
function test(options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
43
|
+
function test(fn?: TestFn): Promise<void>;
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* @since v16.17.0
|
|
47
|
+
* @param name The name of the suite, which is displayed when reporting suite results.
|
|
48
|
+
* Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
|
|
49
|
+
* @param options Configuration options for the suite
|
|
50
|
+
* @param fn The function under suite. Default: A no-op function.
|
|
51
|
+
*/
|
|
52
|
+
function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void;
|
|
53
|
+
function describe(name?: string, fn?: SuiteFn): void;
|
|
54
|
+
function describe(options?: TestOptions, fn?: SuiteFn): void;
|
|
55
|
+
function describe(fn?: SuiteFn): void;
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* @since v16.17.0
|
|
59
|
+
* @param name The name of the test, which is displayed when reporting test results.
|
|
60
|
+
* Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
|
|
61
|
+
* @param options Configuration options for the test
|
|
62
|
+
* @param fn The function under test. If the test uses callbacks, the callback function is
|
|
63
|
+
* passed as the second argument. Default: A no-op function.
|
|
64
|
+
*/
|
|
65
|
+
function it(name?: string, options?: TestOptions, fn?: ItFn): void;
|
|
66
|
+
function it(name?: string, fn?: ItFn): void;
|
|
67
|
+
function it(options?: TestOptions, fn?: ItFn): void;
|
|
68
|
+
function it(fn?: ItFn): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The type of a function under test. The first argument to this function is a
|
|
72
|
+
* {@link TestContext} object. If the test uses callbacks, the callback function is passed as
|
|
73
|
+
* the second argument.
|
|
74
|
+
*/
|
|
75
|
+
type TestFn = (t: TestContext, done: (result?: any) => void) => any;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The type of a function under Suite.
|
|
79
|
+
* If the test uses callbacks, the callback function is passed as an argument
|
|
80
|
+
*/
|
|
81
|
+
type SuiteFn = (done: (result?: any) => void) => void;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The type of a function under test.
|
|
85
|
+
* If the test uses callbacks, the callback function is passed as an argument
|
|
86
|
+
*/
|
|
87
|
+
type ItFn = (done: (result?: any) => void) => any;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* An instance of `TestContext` is passed to each test function in order to interact with the
|
|
91
|
+
* test runner. However, the `TestContext` constructor is not exposed as part of the API.
|
|
92
|
+
* @since v16.17.0
|
|
93
|
+
*/
|
|
94
|
+
interface TestContext {
|
|
95
|
+
/**
|
|
96
|
+
* This function is used to write TAP diagnostics to the output. Any diagnostic information is
|
|
97
|
+
* included at the end of the test's results. This function does not return a value.
|
|
98
|
+
* @param message Message to be displayed as a TAP diagnostic.
|
|
99
|
+
* @since v16.17.0
|
|
100
|
+
*/
|
|
101
|
+
diagnostic(message: string): void;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
|
|
105
|
+
* option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
|
|
106
|
+
* command-line option, this function is a no-op.
|
|
107
|
+
* @param shouldRunOnlyTests Whether or not to run `only` tests.
|
|
108
|
+
* @since v16.17.0
|
|
109
|
+
*/
|
|
110
|
+
runOnly(shouldRunOnlyTests: boolean): void;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* This function causes the test's output to indicate the test as skipped. If `message` is
|
|
114
|
+
* provided, it is included in the TAP output. Calling `skip()` does not terminate execution of
|
|
115
|
+
* the test function. This function does not return a value.
|
|
116
|
+
* @param message Optional skip message to be displayed in TAP output.
|
|
117
|
+
* @since v16.17.0
|
|
118
|
+
*/
|
|
119
|
+
skip(message?: string): void;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* This function adds a `TODO` directive to the test's output. If `message` is provided, it is
|
|
123
|
+
* included in the TAP output. Calling `todo()` does not terminate execution of the test
|
|
124
|
+
* function. This function does not return a value.
|
|
125
|
+
* @param message Optional `TODO` message to be displayed in TAP output.
|
|
126
|
+
* @since v16.17.0
|
|
127
|
+
*/
|
|
128
|
+
todo(message?: string): void;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* This function is used to create subtests under the current test. This function behaves in
|
|
132
|
+
* the same fashion as the top level {@link test} function.
|
|
133
|
+
* @since v16.17.0
|
|
134
|
+
* @param name The name of the test, which is displayed when reporting test results.
|
|
135
|
+
* Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
|
|
136
|
+
* @param options Configuration options for the test
|
|
137
|
+
* @param fn The function under test. This first argument to this function is a
|
|
138
|
+
* {@link TestContext} object. If the test uses callbacks, the callback function is
|
|
139
|
+
* passed as the second argument. Default: A no-op function.
|
|
140
|
+
* @returns A {@link Promise} resolved with `undefined` once the test completes.
|
|
141
|
+
*/
|
|
142
|
+
test: typeof test;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface TestOptions {
|
|
146
|
+
/**
|
|
147
|
+
* The number of tests that can be run at the same time. If unspecified, subtests inherit this
|
|
148
|
+
* value from their parent.
|
|
149
|
+
* @default 1
|
|
150
|
+
*/
|
|
151
|
+
concurrency?: number;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* If truthy, and the test context is configured to run `only` tests, then this test will be
|
|
155
|
+
* run. Otherwise, the test is skipped.
|
|
156
|
+
* @default false
|
|
157
|
+
*/
|
|
158
|
+
only?: boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Allows aborting an in-progress test.
|
|
162
|
+
* @since v16.17.0
|
|
163
|
+
*/
|
|
164
|
+
signal?: AbortSignal;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* If truthy, the test is skipped. If a string is provided, that string is displayed in the
|
|
168
|
+
* test results as the reason for skipping the test.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
skip?: boolean | string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
|
|
175
|
+
* value from their parent.
|
|
176
|
+
* @default Infinity
|
|
177
|
+
* @since v16.17.0
|
|
178
|
+
*/
|
|
179
|
+
timeout?: number;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
|
|
183
|
+
* the test results as the reason why the test is `TODO`.
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
todo?: boolean | string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export { test as default, test, describe, it };
|
|
190
|
+
}
|