@emulsify/cli 1.11.0 → 1.11.1
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/dist/node_modules/.package-lock.json +18 -18
- package/dist/node_modules/@types/node/README.md +1 -1
- package/dist/node_modules/@types/node/assert.d.ts +2 -2
- package/dist/node_modules/@types/node/buffer.buffer.d.ts +385 -0
- package/dist/node_modules/@types/node/buffer.d.ts +30 -390
- package/dist/node_modules/@types/node/child_process.d.ts +32 -28
- package/dist/node_modules/@types/node/cluster.d.ts +1 -1
- package/dist/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/dist/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/dist/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/dist/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/dist/node_modules/@types/node/console.d.ts +2 -2
- package/dist/node_modules/@types/node/crypto.d.ts +3 -3
- package/dist/node_modules/@types/node/dns/promises.d.ts +6 -5
- package/dist/node_modules/@types/node/dns.d.ts +5 -5
- package/dist/node_modules/@types/node/domain.d.ts +2 -2
- package/dist/node_modules/@types/node/events.d.ts +3 -3
- package/dist/node_modules/@types/node/fs/promises.d.ts +2 -2
- package/dist/node_modules/@types/node/fs.d.ts +2 -2
- package/dist/node_modules/@types/node/globals.d.ts +124 -68
- package/dist/node_modules/@types/node/globals.typedarray.d.ts +21 -0
- package/dist/node_modules/@types/node/http.d.ts +43 -7
- package/dist/node_modules/@types/node/http2.d.ts +238 -101
- package/dist/node_modules/@types/node/https.d.ts +17 -23
- package/dist/node_modules/@types/node/index.d.ts +11 -9
- package/dist/node_modules/@types/node/module.d.ts +3 -3
- package/dist/node_modules/@types/node/net.d.ts +8 -2
- package/dist/node_modules/@types/node/os.d.ts +1 -1
- package/dist/node_modules/@types/node/package.json +10 -2
- package/dist/node_modules/@types/node/path.d.ts +10 -1
- package/dist/node_modules/@types/node/perf_hooks.d.ts +19 -19
- package/dist/node_modules/@types/node/punycode.d.ts +1 -1
- package/dist/node_modules/@types/node/querystring.d.ts +1 -1
- package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/dist/node_modules/@types/node/readline.d.ts +10 -10
- package/dist/node_modules/@types/node/repl.d.ts +4 -4
- package/dist/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/dist/node_modules/@types/node/stream/web.d.ts +182 -25
- package/dist/node_modules/@types/node/stream.d.ts +36 -17
- package/dist/node_modules/@types/node/string_decoder.d.ts +3 -3
- package/dist/node_modules/@types/node/test.d.ts +85 -12
- package/dist/node_modules/@types/node/timers/promises.d.ts +1 -1
- package/dist/node_modules/@types/node/timers.d.ts +1 -1
- package/dist/node_modules/@types/node/tls.d.ts +5 -5
- package/dist/node_modules/@types/node/trace_events.d.ts +4 -4
- package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
- package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
- package/dist/node_modules/@types/node/ts5.6/index.d.ts +91 -0
- package/dist/node_modules/@types/node/tty.d.ts +1 -1
- package/dist/node_modules/@types/node/url.d.ts +14 -11
- package/dist/node_modules/@types/node/util.d.ts +49 -49
- package/dist/node_modules/@types/node/v8.d.ts +12 -12
- package/dist/node_modules/@types/node/vm.d.ts +11 -12
- package/dist/node_modules/@types/node/worker_threads.d.ts +22 -22
- package/dist/node_modules/@types/node/zlib.d.ts +8 -8
- package/dist/node_modules/debug/README.md +1 -1
- package/dist/node_modules/debug/package.json +2 -2
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +2 -2
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
- package/dist/node_modules/fast-uri/index.js +3 -9
- package/dist/node_modules/fast-uri/package.json +4 -4
- package/dist/node_modules/fast-uri/test/ajv.test.js +1 -1
- package/dist/node_modules/fast-uri/test/compatibility.test.js +3 -2
- package/dist/node_modules/fast-uri/test/equal.test.js +1 -2
- package/dist/node_modules/fast-uri/test/parse.test.js +1 -2
- package/dist/node_modules/fast-uri/test/resolve.test.js +1 -2
- package/dist/node_modules/fast-uri/test/serialize.test.js +1 -2
- package/dist/node_modules/fast-uri/test/uri-js.test.js +539 -567
- package/dist/node_modules/fast-uri/test/util.test.js +2 -3
- package/dist/node_modules/ms/index.js +1 -1
- package/dist/node_modules/ms/license.md +1 -1
- package/dist/node_modules/ms/package.json +5 -4
- package/dist/node_modules/ms/readme.md +1 -2
- package/dist/node_modules/simple-git/dist/cjs/index.js +14 -15
- package/dist/node_modules/simple-git/dist/cjs/index.js.map +2 -2
- package/dist/node_modules/simple-git/dist/esm/index.js +14 -15
- package/dist/node_modules/simple-git/dist/esm/index.js.map +2 -2
- package/dist/node_modules/simple-git/dist/typings/response.d.ts +7 -6
- package/dist/node_modules/simple-git/package.json +5 -5
- package/dist/package-lock.json +720 -643
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/node_modules/@types/node/globals.global.d.ts +0 -1
- package/dist/node_modules/fast-uri/.taprc +0 -3
|
@@ -7,13 +7,83 @@ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undi
|
|
|
7
7
|
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
|
|
8
8
|
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
|
|
9
9
|
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
|
|
10
|
+
type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent;
|
|
10
11
|
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
|
|
11
12
|
: import("undici-types").RequestInit;
|
|
12
13
|
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
|
|
13
14
|
: import("undici-types").ResponseInit;
|
|
14
|
-
type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File;
|
|
15
15
|
// #endregion Fetch and friends
|
|
16
16
|
|
|
17
|
+
// #region DOMException
|
|
18
|
+
type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
|
|
19
|
+
interface NodeDOMException extends Error {
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
*
|
|
23
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
|
24
|
+
*/
|
|
25
|
+
readonly code: number;
|
|
26
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
|
|
27
|
+
readonly message: string;
|
|
28
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly INDEX_SIZE_ERR: 1;
|
|
31
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
|
32
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
33
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
|
34
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
|
35
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
36
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
37
|
+
readonly NOT_FOUND_ERR: 8;
|
|
38
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
|
39
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
40
|
+
readonly INVALID_STATE_ERR: 11;
|
|
41
|
+
readonly SYNTAX_ERR: 12;
|
|
42
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
|
43
|
+
readonly NAMESPACE_ERR: 14;
|
|
44
|
+
readonly INVALID_ACCESS_ERR: 15;
|
|
45
|
+
readonly VALIDATION_ERR: 16;
|
|
46
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
|
47
|
+
readonly SECURITY_ERR: 18;
|
|
48
|
+
readonly NETWORK_ERR: 19;
|
|
49
|
+
readonly ABORT_ERR: 20;
|
|
50
|
+
readonly URL_MISMATCH_ERR: 21;
|
|
51
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
52
|
+
readonly TIMEOUT_ERR: 23;
|
|
53
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
54
|
+
readonly DATA_CLONE_ERR: 25;
|
|
55
|
+
}
|
|
56
|
+
interface NodeDOMExceptionConstructor {
|
|
57
|
+
prototype: DOMException;
|
|
58
|
+
new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException;
|
|
59
|
+
readonly INDEX_SIZE_ERR: 1;
|
|
60
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
|
61
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
62
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
|
63
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
|
64
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
65
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
66
|
+
readonly NOT_FOUND_ERR: 8;
|
|
67
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
|
68
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
69
|
+
readonly INVALID_STATE_ERR: 11;
|
|
70
|
+
readonly SYNTAX_ERR: 12;
|
|
71
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
|
72
|
+
readonly NAMESPACE_ERR: 14;
|
|
73
|
+
readonly INVALID_ACCESS_ERR: 15;
|
|
74
|
+
readonly VALIDATION_ERR: 16;
|
|
75
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
|
76
|
+
readonly SECURITY_ERR: 18;
|
|
77
|
+
readonly NETWORK_ERR: 19;
|
|
78
|
+
readonly ABORT_ERR: 20;
|
|
79
|
+
readonly URL_MISMATCH_ERR: 21;
|
|
80
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
81
|
+
readonly TIMEOUT_ERR: 23;
|
|
82
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
83
|
+
readonly DATA_CLONE_ERR: 25;
|
|
84
|
+
}
|
|
85
|
+
// #endregion DOMException
|
|
86
|
+
|
|
17
87
|
declare global {
|
|
18
88
|
// Declare "static" methods in Error
|
|
19
89
|
interface ErrorConstructor {
|
|
@@ -41,6 +111,8 @@ declare global {
|
|
|
41
111
|
interface RequireResolve extends NodeJS.RequireResolve {}
|
|
42
112
|
interface NodeModule extends NodeJS.Module {}
|
|
43
113
|
|
|
114
|
+
var global: typeof globalThis;
|
|
115
|
+
|
|
44
116
|
var process: NodeJS.Process;
|
|
45
117
|
var console: Console;
|
|
46
118
|
|
|
@@ -53,10 +125,22 @@ declare global {
|
|
|
53
125
|
// Same as module.exports
|
|
54
126
|
var exports: any;
|
|
55
127
|
|
|
128
|
+
interface GCFunction {
|
|
129
|
+
(options: {
|
|
130
|
+
execution?: "sync";
|
|
131
|
+
type?: "major" | "minor";
|
|
132
|
+
}): void;
|
|
133
|
+
(options: {
|
|
134
|
+
execution: "async";
|
|
135
|
+
type?: "major" | "minor";
|
|
136
|
+
}): Promise<void>;
|
|
137
|
+
(options?: boolean): void;
|
|
138
|
+
}
|
|
139
|
+
|
|
56
140
|
/**
|
|
57
141
|
* Only available if `--expose-gc` is passed to the process.
|
|
58
142
|
*/
|
|
59
|
-
var gc: undefined |
|
|
143
|
+
var gc: undefined | GCFunction;
|
|
60
144
|
|
|
61
145
|
// #region borrowed
|
|
62
146
|
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
|
|
@@ -100,53 +184,6 @@ declare global {
|
|
|
100
184
|
};
|
|
101
185
|
// #endregion borrowed
|
|
102
186
|
|
|
103
|
-
// #region Disposable
|
|
104
|
-
interface SymbolConstructor {
|
|
105
|
-
/**
|
|
106
|
-
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
|
107
|
-
*/
|
|
108
|
-
readonly dispose: unique symbol;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
|
112
|
-
*/
|
|
113
|
-
readonly asyncDispose: unique symbol;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
interface Disposable {
|
|
117
|
-
[Symbol.dispose](): void;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
interface AsyncDisposable {
|
|
121
|
-
[Symbol.asyncDispose](): PromiseLike<void>;
|
|
122
|
-
}
|
|
123
|
-
// #endregion Disposable
|
|
124
|
-
|
|
125
|
-
// #region ArrayLike.at()
|
|
126
|
-
interface RelativeIndexable<T> {
|
|
127
|
-
/**
|
|
128
|
-
* Takes an integer value and returns the item at that index,
|
|
129
|
-
* allowing for positive and negative integers.
|
|
130
|
-
* Negative integers count back from the last item in the array.
|
|
131
|
-
*/
|
|
132
|
-
at(index: number): T | undefined;
|
|
133
|
-
}
|
|
134
|
-
interface String extends RelativeIndexable<string> {}
|
|
135
|
-
interface Array<T> extends RelativeIndexable<T> {}
|
|
136
|
-
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
137
|
-
interface Int8Array extends RelativeIndexable<number> {}
|
|
138
|
-
interface Uint8Array extends RelativeIndexable<number> {}
|
|
139
|
-
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
140
|
-
interface Int16Array extends RelativeIndexable<number> {}
|
|
141
|
-
interface Uint16Array extends RelativeIndexable<number> {}
|
|
142
|
-
interface Int32Array extends RelativeIndexable<number> {}
|
|
143
|
-
interface Uint32Array extends RelativeIndexable<number> {}
|
|
144
|
-
interface Float32Array extends RelativeIndexable<number> {}
|
|
145
|
-
interface Float64Array extends RelativeIndexable<number> {}
|
|
146
|
-
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
147
|
-
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
148
|
-
// #endregion ArrayLike.at() end
|
|
149
|
-
|
|
150
187
|
/**
|
|
151
188
|
* @since v17.0.0
|
|
152
189
|
*
|
|
@@ -157,6 +194,24 @@ declare global {
|
|
|
157
194
|
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
|
158
195
|
): T;
|
|
159
196
|
|
|
197
|
+
// #region DOMException
|
|
198
|
+
/**
|
|
199
|
+
* @since v17.0.0
|
|
200
|
+
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
|
201
|
+
*
|
|
202
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
|
203
|
+
*/
|
|
204
|
+
interface DOMException extends _DOMException {}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @since v17.0.0
|
|
208
|
+
*
|
|
209
|
+
* The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details.
|
|
210
|
+
*/
|
|
211
|
+
var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
|
|
212
|
+
: NodeDOMExceptionConstructor;
|
|
213
|
+
// #endregion DOMException
|
|
214
|
+
|
|
160
215
|
/*----------------------------------------------*
|
|
161
216
|
* *
|
|
162
217
|
* GLOBAL INTERFACES *
|
|
@@ -281,7 +336,7 @@ declare global {
|
|
|
281
336
|
unpipe(destination?: WritableStream): this;
|
|
282
337
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
283
338
|
wrap(oldStream: ReadableStream): this;
|
|
284
|
-
[Symbol.asyncIterator]():
|
|
339
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string | Buffer>;
|
|
285
340
|
}
|
|
286
341
|
|
|
287
342
|
interface WritableStream extends EventEmitter {
|
|
@@ -300,20 +355,6 @@ declare global {
|
|
|
300
355
|
unref(): this;
|
|
301
356
|
}
|
|
302
357
|
|
|
303
|
-
type TypedArray =
|
|
304
|
-
| Uint8Array
|
|
305
|
-
| Uint8ClampedArray
|
|
306
|
-
| Uint16Array
|
|
307
|
-
| Uint32Array
|
|
308
|
-
| Int8Array
|
|
309
|
-
| Int16Array
|
|
310
|
-
| Int32Array
|
|
311
|
-
| BigUint64Array
|
|
312
|
-
| BigInt64Array
|
|
313
|
-
| Float32Array
|
|
314
|
-
| Float64Array;
|
|
315
|
-
type ArrayBufferView = TypedArray | DataView;
|
|
316
|
-
|
|
317
358
|
interface Require {
|
|
318
359
|
(id: string): any;
|
|
319
360
|
resolve: RequireResolve;
|
|
@@ -364,6 +405,18 @@ declare global {
|
|
|
364
405
|
interface ReadOnlyDict<T> {
|
|
365
406
|
readonly [key: string]: T | undefined;
|
|
366
407
|
}
|
|
408
|
+
|
|
409
|
+
/** An iterable iterator returned by the Node.js API. */
|
|
410
|
+
// Default TReturn/TNext in v20 is `any`, for compatibility with the previously-used IterableIterator.
|
|
411
|
+
interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
|
412
|
+
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** An async iterable iterator returned by the Node.js API. */
|
|
416
|
+
// Default TReturn/TNext in v20 is `any`, for compatibility with the previously-used AsyncIterableIterator.
|
|
417
|
+
interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
|
418
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
|
419
|
+
}
|
|
367
420
|
}
|
|
368
421
|
|
|
369
422
|
interface RequestInit extends _RequestInit {}
|
|
@@ -403,10 +456,13 @@ declare global {
|
|
|
403
456
|
} ? T
|
|
404
457
|
: typeof import("undici-types").Headers;
|
|
405
458
|
|
|
406
|
-
interface
|
|
407
|
-
|
|
459
|
+
interface MessageEvent extends _MessageEvent {}
|
|
460
|
+
/**
|
|
461
|
+
* @since v15.0.0
|
|
462
|
+
*/
|
|
463
|
+
var MessageEvent: typeof globalThis extends {
|
|
408
464
|
onmessage: any;
|
|
409
|
-
|
|
465
|
+
MessageEvent: infer T;
|
|
410
466
|
} ? T
|
|
411
|
-
: typeof import("
|
|
467
|
+
: typeof import("undici-types").MessageEvent;
|
|
412
468
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export {}; // Make this a module
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace NodeJS {
|
|
5
|
+
type TypedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
|
|
6
|
+
| Uint8Array<TArrayBuffer>
|
|
7
|
+
| Uint8ClampedArray<TArrayBuffer>
|
|
8
|
+
| Uint16Array<TArrayBuffer>
|
|
9
|
+
| Uint32Array<TArrayBuffer>
|
|
10
|
+
| Int8Array<TArrayBuffer>
|
|
11
|
+
| Int16Array<TArrayBuffer>
|
|
12
|
+
| Int32Array<TArrayBuffer>
|
|
13
|
+
| BigUint64Array<TArrayBuffer>
|
|
14
|
+
| BigInt64Array<TArrayBuffer>
|
|
15
|
+
| Float32Array<TArrayBuffer>
|
|
16
|
+
| Float64Array<TArrayBuffer>;
|
|
17
|
+
type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
|
|
18
|
+
| TypedArray<TArrayBuffer>
|
|
19
|
+
| DataView<TArrayBuffer>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* To use the HTTP server and client one must `
|
|
2
|
+
* To use the HTTP server and client one must import the `node:http` module.
|
|
3
3
|
*
|
|
4
4
|
* The HTTP interfaces in Node.js are designed to support many features
|
|
5
5
|
* of the protocol which have been traditionally difficult to use.
|
|
@@ -231,7 +231,7 @@ declare module "http" {
|
|
|
231
231
|
}
|
|
232
232
|
interface ServerOptions<
|
|
233
233
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
234
|
-
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
234
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
|
235
235
|
> {
|
|
236
236
|
/**
|
|
237
237
|
* Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
|
|
@@ -315,14 +315,14 @@ declare module "http" {
|
|
|
315
315
|
}
|
|
316
316
|
type RequestListener<
|
|
317
317
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
318
|
-
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
318
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
|
319
319
|
> = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
|
|
320
320
|
/**
|
|
321
321
|
* @since v0.1.17
|
|
322
322
|
*/
|
|
323
323
|
class Server<
|
|
324
324
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
325
|
-
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
325
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
|
326
326
|
> extends NetServer {
|
|
327
327
|
constructor(requestListener?: RequestListener<Request, Response>);
|
|
328
328
|
constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
|
|
@@ -588,6 +588,42 @@ declare module "http" {
|
|
|
588
588
|
* @param value Header value
|
|
589
589
|
*/
|
|
590
590
|
setHeader(name: string, value: number | string | readonly string[]): this;
|
|
591
|
+
/**
|
|
592
|
+
* Sets multiple header values for implicit headers. headers must be an instance of
|
|
593
|
+
* `Headers` or `Map`, if a header already exists in the to-be-sent headers, its
|
|
594
|
+
* value will be replaced.
|
|
595
|
+
*
|
|
596
|
+
* ```js
|
|
597
|
+
* const headers = new Headers({ foo: 'bar' });
|
|
598
|
+
* outgoingMessage.setHeaders(headers);
|
|
599
|
+
* ```
|
|
600
|
+
*
|
|
601
|
+
* or
|
|
602
|
+
*
|
|
603
|
+
* ```js
|
|
604
|
+
* const headers = new Map([['foo', 'bar']]);
|
|
605
|
+
* outgoingMessage.setHeaders(headers);
|
|
606
|
+
* ```
|
|
607
|
+
*
|
|
608
|
+
* When headers have been set with `outgoingMessage.setHeaders()`, they will be
|
|
609
|
+
* merged with any headers passed to `response.writeHead()`, with the headers passed
|
|
610
|
+
* to `response.writeHead()` given precedence.
|
|
611
|
+
*
|
|
612
|
+
* ```js
|
|
613
|
+
* // Returns content-type = text/plain
|
|
614
|
+
* const server = http.createServer((req, res) => {
|
|
615
|
+
* const headers = new Headers({ 'Content-Type': 'text/html' });
|
|
616
|
+
* res.setHeaders(headers);
|
|
617
|
+
* res.writeHead(200, { 'Content-Type': 'text/plain' });
|
|
618
|
+
* res.end('ok');
|
|
619
|
+
* });
|
|
620
|
+
* ```
|
|
621
|
+
*
|
|
622
|
+
* @since v19.6.0, v18.15.0
|
|
623
|
+
* @param name Header name
|
|
624
|
+
* @param value Header value
|
|
625
|
+
*/
|
|
626
|
+
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
|
|
591
627
|
/**
|
|
592
628
|
* Append a single header value to the header object.
|
|
593
629
|
*
|
|
@@ -1447,7 +1483,7 @@ declare module "http" {
|
|
|
1447
1483
|
* To configure any of them, a custom {@link Agent} instance must be created.
|
|
1448
1484
|
*
|
|
1449
1485
|
* ```js
|
|
1450
|
-
*
|
|
1486
|
+
* import http from 'node:http';
|
|
1451
1487
|
* const keepAliveAgent = new http.Agent({ keepAlive: true });
|
|
1452
1488
|
* options.agent = keepAliveAgent;
|
|
1453
1489
|
* http.request(options, onResponseCallback)
|
|
@@ -1553,11 +1589,11 @@ declare module "http" {
|
|
|
1553
1589
|
*/
|
|
1554
1590
|
function createServer<
|
|
1555
1591
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1556
|
-
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
1592
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
|
1557
1593
|
>(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
|
|
1558
1594
|
function createServer<
|
|
1559
1595
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1560
|
-
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
1596
|
+
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
|
1561
1597
|
>(
|
|
1562
1598
|
options: ServerOptions<Request, Response>,
|
|
1563
1599
|
requestListener?: RequestListener<Request, Response>,
|