cloudstructs 0.4.1 → 0.4.5
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/.jsii +3 -3
- package/changelog.md +6 -1
- package/lib/codecommit-mirror/index.js +2 -2
- package/lib/ecs-service-roller/index.js +2 -2
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/saml-identity-provider/index.js +2 -2
- package/lib/slack-app/manifest.js +1 -1
- package/lib/slack-app/slack-app.js +2 -2
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/state-machine-cr-provider/index.js +1 -1
- package/lib/static-website/index.js +7 -3
- package/lib/url-shortener/index.js +1 -1
- package/node_modules/@sindresorhus/is/dist/index.d.ts +4 -2
- package/node_modules/@sindresorhus/is/dist/index.js +3 -1
- package/node_modules/@sindresorhus/is/package.json +1 -1
- package/node_modules/@sindresorhus/is/readme.md +23 -0
- package/node_modules/@slack/logger/node_modules/@types/node/README.md +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +7 -3
- package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +9 -9
- package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +12 -10
- package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +17 -12
- package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +5 -5
- package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +62 -11
- package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +31 -4
- package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +6 -6
- package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +1 -2
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +4 -5
- package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +15 -14
- package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -7
- package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -1
- package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +6 -4
- package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +121 -14
- package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +3 -65
- package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +10 -10
- package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +3 -2
- package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +58 -18
- package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +4 -4
- package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +7 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +9 -9
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +12 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +17 -12
- package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +62 -11
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +31 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +6 -6
- package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +1 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +4 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +15 -14
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -7
- package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +6 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +121 -14
- package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +3 -65
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +10 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +58 -18
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +4 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/is-stream/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -7
- package/node_modules/follow-redirects/index.js +2 -2
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/keyv/.nyc_output/37411020-4142-4b08-b825-343ba2427bf7.json +1 -0
- package/node_modules/keyv/.nyc_output/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +1 -0
- package/node_modules/keyv/.nyc_output/processinfo/37411020-4142-4b08-b825-343ba2427bf7.json +1 -0
- package/node_modules/keyv/.nyc_output/processinfo/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +1 -0
- package/node_modules/keyv/.nyc_output/processinfo/index.json +1 -0
- package/node_modules/keyv/README.md +9 -8
- package/node_modules/keyv/package.json +5 -7
- package/node_modules/keyv/test/test.js +132 -0
- package/node_modules/keyv/test/testdb.sqlite +0 -0
- package/package.json +14 -13
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
- package/node_modules/keyv/LICENSE +0 -21
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ```js
|
|
16
16
|
* const inspector = require('inspector');
|
|
17
17
|
* ```
|
|
18
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
18
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/inspector.js)
|
|
19
19
|
*/
|
|
20
20
|
declare module 'inspector' {
|
|
21
21
|
import EventEmitter = require('node:events');
|
|
@@ -1779,10 +1779,9 @@ declare module 'inspector' {
|
|
|
1779
1779
|
*/
|
|
1780
1780
|
connect(): void;
|
|
1781
1781
|
/**
|
|
1782
|
-
* Connects a session to the main thread inspector back-end.
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1785
|
-
* @since 12.11.0
|
|
1782
|
+
* Connects a session to the main thread inspector back-end. An exception will
|
|
1783
|
+
* be thrown if this API was not called on a Worker thread.
|
|
1784
|
+
* @since v12.11.0
|
|
1786
1785
|
*/
|
|
1787
1786
|
connectToMainThread(): void;
|
|
1788
1787
|
/**
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ```js
|
|
11
11
|
* const net = require('net');
|
|
12
12
|
* ```
|
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/net.js)
|
|
14
14
|
*/
|
|
15
15
|
declare module 'net' {
|
|
16
16
|
import * as stream from 'node:stream';
|
|
@@ -27,6 +27,7 @@ declare module 'net' {
|
|
|
27
27
|
allowHalfOpen?: boolean | undefined;
|
|
28
28
|
readable?: boolean | undefined;
|
|
29
29
|
writable?: boolean | undefined;
|
|
30
|
+
signal?: AbortSignal;
|
|
30
31
|
}
|
|
31
32
|
interface OnReadOpts {
|
|
32
33
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -287,9 +288,9 @@ declare module 'net' {
|
|
|
287
288
|
* @param callback Optional callback for when the socket is finished.
|
|
288
289
|
* @return The socket itself.
|
|
289
290
|
*/
|
|
290
|
-
end(callback?: () => void):
|
|
291
|
-
end(buffer: Uint8Array | string, callback?: () => void):
|
|
292
|
-
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void):
|
|
291
|
+
end(callback?: () => void): this;
|
|
292
|
+
end(buffer: Uint8Array | string, callback?: () => void): this;
|
|
293
|
+
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
|
|
293
294
|
/**
|
|
294
295
|
* events.EventEmitter
|
|
295
296
|
* 1. close
|
|
@@ -560,12 +561,12 @@ declare module 'net' {
|
|
|
560
561
|
* The `BlockList` object can be used with some network APIs to specify rules for
|
|
561
562
|
* disabling inbound or outbound access to specific IP addresses, IP ranges, or
|
|
562
563
|
* IP subnets.
|
|
563
|
-
* @since v15.0.0
|
|
564
|
+
* @since v15.0.0, v14.18.0
|
|
564
565
|
*/
|
|
565
566
|
class BlockList {
|
|
566
567
|
/**
|
|
567
568
|
* Adds a rule to block the given IP address.
|
|
568
|
-
* @since v15.0.0
|
|
569
|
+
* @since v15.0.0, v14.18.0
|
|
569
570
|
* @param address An IPv4 or IPv6 address.
|
|
570
571
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
571
572
|
*/
|
|
@@ -573,7 +574,7 @@ declare module 'net' {
|
|
|
573
574
|
addAddress(address: SocketAddress): void;
|
|
574
575
|
/**
|
|
575
576
|
* Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
|
|
576
|
-
* @since v15.0.0
|
|
577
|
+
* @since v15.0.0, v14.18.0
|
|
577
578
|
* @param start The starting IPv4 or IPv6 address in the range.
|
|
578
579
|
* @param end The ending IPv4 or IPv6 address in the range.
|
|
579
580
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
@@ -582,7 +583,7 @@ declare module 'net' {
|
|
|
582
583
|
addRange(start: SocketAddress, end: SocketAddress): void;
|
|
583
584
|
/**
|
|
584
585
|
* Adds a rule to block a range of IP addresses specified as a subnet mask.
|
|
585
|
-
* @since v15.0.0
|
|
586
|
+
* @since v15.0.0, v14.18.0
|
|
586
587
|
* @param net The network IPv4 or IPv6 address.
|
|
587
588
|
* @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`.
|
|
588
589
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
@@ -606,7 +607,7 @@ declare module 'net' {
|
|
|
606
607
|
* console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true
|
|
607
608
|
* console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true
|
|
608
609
|
* ```
|
|
609
|
-
* @since v15.0.0
|
|
610
|
+
* @since v15.0.0, v14.18.0
|
|
610
611
|
* @param address The IP address to check
|
|
611
612
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
612
613
|
*/
|
|
@@ -754,26 +755,26 @@ declare module 'net' {
|
|
|
754
755
|
port?: number | undefined;
|
|
755
756
|
}
|
|
756
757
|
/**
|
|
757
|
-
* @since v15.14.0
|
|
758
|
+
* @since v15.14.0, v14.18.0
|
|
758
759
|
*/
|
|
759
760
|
class SocketAddress {
|
|
760
761
|
constructor(options: SocketAddressInitOptions);
|
|
761
762
|
/**
|
|
762
763
|
* Either \`'ipv4'\` or \`'ipv6'\`.
|
|
763
|
-
* @since v15.14.0
|
|
764
|
+
* @since v15.14.0, v14.18.0
|
|
764
765
|
*/
|
|
765
766
|
readonly address: string;
|
|
766
767
|
/**
|
|
767
768
|
* Either \`'ipv4'\` or \`'ipv6'\`.
|
|
768
|
-
* @since v15.14.0
|
|
769
|
+
* @since v15.14.0, v14.18.0
|
|
769
770
|
*/
|
|
770
771
|
readonly family: IPVersion;
|
|
771
772
|
/**
|
|
772
|
-
* @since v15.14.0
|
|
773
|
+
* @since v15.14.0, v14.18.0
|
|
773
774
|
*/
|
|
774
775
|
readonly port: number;
|
|
775
776
|
/**
|
|
776
|
-
* @since v15.14.0
|
|
777
|
+
* @since v15.14.0, v14.18.0
|
|
777
778
|
*/
|
|
778
779
|
readonly flowlabel: number;
|
|
779
780
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.10",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -175,11 +175,6 @@
|
|
|
175
175
|
"url": "https://github.com/ExE-Boss",
|
|
176
176
|
"githubUsername": "ExE-Boss"
|
|
177
177
|
},
|
|
178
|
-
{
|
|
179
|
-
"name": "Surasak Chaisurin",
|
|
180
|
-
"url": "https://github.com/Ryan-Willpower",
|
|
181
|
-
"githubUsername": "Ryan-Willpower"
|
|
182
|
-
},
|
|
183
178
|
{
|
|
184
179
|
"name": "Piotr Błażejewicz",
|
|
185
180
|
"url": "https://github.com/peterblazejewicz",
|
|
@@ -225,6 +220,6 @@
|
|
|
225
220
|
},
|
|
226
221
|
"scripts": {},
|
|
227
222
|
"dependencies": {},
|
|
228
|
-
"typesPublisherContentHash": "
|
|
223
|
+
"typesPublisherContentHash": "a2e243404f102a5fd5fbcaefab0a775ffcb1db4d09832612decbd69815f1890b",
|
|
229
224
|
"typeScriptVersion": "3.8"
|
|
230
225
|
}
|
|
@@ -13,7 +13,7 @@ declare module 'path/win32' {
|
|
|
13
13
|
* ```js
|
|
14
14
|
* const path = require('path');
|
|
15
15
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/path.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'path' {
|
|
19
19
|
namespace path {
|
|
@@ -170,3 +170,11 @@ declare module 'node:path' {
|
|
|
170
170
|
import path = require('path');
|
|
171
171
|
export = path;
|
|
172
172
|
}
|
|
173
|
+
declare module 'node:path/posix' {
|
|
174
|
+
import path = require('path/posix');
|
|
175
|
+
export = path;
|
|
176
|
+
}
|
|
177
|
+
declare module 'node:path/win32' {
|
|
178
|
+
import path = require('path/win32');
|
|
179
|
+
export = path;
|
|
180
|
+
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* performance.measure('A to B', 'A', 'B');
|
|
27
27
|
* });
|
|
28
28
|
* ```
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
29
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/perf_hooks.js)
|
|
30
30
|
*/
|
|
31
31
|
declare module 'perf_hooks' {
|
|
32
32
|
import { AsyncResource } from 'node:async_hooks';
|
|
@@ -397,9 +397,11 @@ declare module 'perf_hooks' {
|
|
|
397
397
|
options:
|
|
398
398
|
| {
|
|
399
399
|
entryTypes: ReadonlyArray<EntryType>;
|
|
400
|
+
buffered?: boolean | undefined;
|
|
400
401
|
}
|
|
401
402
|
| {
|
|
402
403
|
type: EntryType;
|
|
404
|
+
buffered?: boolean | undefined;
|
|
403
405
|
}
|
|
404
406
|
): void;
|
|
405
407
|
}
|
|
@@ -485,7 +487,7 @@ declare module 'perf_hooks' {
|
|
|
485
487
|
}
|
|
486
488
|
interface RecordableHistogram extends Histogram {
|
|
487
489
|
/**
|
|
488
|
-
* @since v15.9.0
|
|
490
|
+
* @since v15.9.0, v14.18.0
|
|
489
491
|
* @param val The amount to record in the histogram.
|
|
490
492
|
*/
|
|
491
493
|
record(val: number | bigint): void;
|
|
@@ -494,7 +496,7 @@ declare module 'perf_hooks' {
|
|
|
494
496
|
* previous call to `recordDelta()` and records that amount in the histogram.
|
|
495
497
|
*
|
|
496
498
|
* ## Examples
|
|
497
|
-
* @since v15.9.0
|
|
499
|
+
* @since v15.9.0, v14.18.0
|
|
498
500
|
*/
|
|
499
501
|
recordDelta(): void;
|
|
500
502
|
}
|
|
@@ -546,7 +548,7 @@ declare module 'perf_hooks' {
|
|
|
546
548
|
}
|
|
547
549
|
/**
|
|
548
550
|
* Returns a `RecordableHistogram`.
|
|
549
|
-
* @since v15.9.0
|
|
551
|
+
* @since v15.9.0, v14.18.0
|
|
550
552
|
*/
|
|
551
553
|
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
552
554
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* made available to developers as a convenience. Fixes or other modifications to
|
|
25
25
|
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
|
26
26
|
* @deprecated Since v7.0.0 - Deprecated
|
|
27
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
27
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/punycode.js)
|
|
28
28
|
*/
|
|
29
29
|
declare module 'punycode' {
|
|
30
30
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* The `querystring` API is considered Legacy. While it is still maintained,
|
|
10
10
|
* new code should use the `URLSearchParams` API instead.
|
|
11
11
|
* @deprecated Legacy
|
|
12
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
12
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/querystring.js)
|
|
13
13
|
*/
|
|
14
14
|
declare module 'querystring' {
|
|
15
15
|
interface StringifyOptions {
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
|
|
3
|
-
*
|
|
2
|
+
* The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
|
|
3
|
+
*
|
|
4
|
+
* To use the promise-based APIs:
|
|
4
5
|
*
|
|
5
6
|
* ```js
|
|
6
|
-
*
|
|
7
|
+
* import * as readline from 'node:readline/promises';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* To use the callback and sync APIs:
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* import * as readline from 'node:readline';
|
|
7
14
|
* ```
|
|
8
15
|
*
|
|
9
16
|
* The following simple example illustrates the basic use of the `readline` module.
|
|
10
17
|
*
|
|
11
18
|
* ```js
|
|
12
|
-
*
|
|
19
|
+
* import * as readline from 'node:readline/promises';
|
|
20
|
+
* import { stdin as input, stdout as output } from 'process';
|
|
21
|
+
*
|
|
22
|
+
* const rl = readline.createInterface({ input, output });
|
|
13
23
|
*
|
|
14
|
-
* const
|
|
15
|
-
* input: process.stdin,
|
|
16
|
-
* output: process.stdout
|
|
17
|
-
* });
|
|
24
|
+
* const answer = await rl.question('What do you think of Node.js? ');
|
|
18
25
|
*
|
|
19
|
-
*
|
|
20
|
-
* // TODO: Log the answer in a database
|
|
21
|
-
* console.log(`Thank you for your valuable feedback: ${answer}`);
|
|
26
|
+
* console.log(`Thank you for your valuable feedback: ${answer}`);
|
|
22
27
|
*
|
|
23
|
-
*
|
|
24
|
-
* });
|
|
28
|
+
* rl.close();
|
|
25
29
|
* ```
|
|
26
30
|
*
|
|
27
31
|
* Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
|
|
28
32
|
* received on the `input` stream.
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
33
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/readline.js)
|
|
30
34
|
*/
|
|
31
35
|
declare module 'readline' {
|
|
32
36
|
import { Abortable, EventEmitter } from 'node:events';
|
|
@@ -394,6 +398,109 @@ declare module 'readline' {
|
|
|
394
398
|
* if (process.stdin.isTTY)
|
|
395
399
|
* process.stdin.setRawMode(true);
|
|
396
400
|
* ```
|
|
401
|
+
*
|
|
402
|
+
* ## Example: Tiny CLI
|
|
403
|
+
*
|
|
404
|
+
* The following example illustrates the use of `readline.Interface` class to
|
|
405
|
+
* implement a small command-line interface:
|
|
406
|
+
*
|
|
407
|
+
* ```js
|
|
408
|
+
* const readline = require('readline');
|
|
409
|
+
* const rl = readline.createInterface({
|
|
410
|
+
* input: process.stdin,
|
|
411
|
+
* output: process.stdout,
|
|
412
|
+
* prompt: 'OHAI> '
|
|
413
|
+
* });
|
|
414
|
+
*
|
|
415
|
+
* rl.prompt();
|
|
416
|
+
*
|
|
417
|
+
* rl.on('line', (line) => {
|
|
418
|
+
* switch (line.trim()) {
|
|
419
|
+
* case 'hello':
|
|
420
|
+
* console.log('world!');
|
|
421
|
+
* break;
|
|
422
|
+
* default:
|
|
423
|
+
* console.log(`Say what? I might have heard '${line.trim()}'`);
|
|
424
|
+
* break;
|
|
425
|
+
* }
|
|
426
|
+
* rl.prompt();
|
|
427
|
+
* }).on('close', () => {
|
|
428
|
+
* console.log('Have a great day!');
|
|
429
|
+
* process.exit(0);
|
|
430
|
+
* });
|
|
431
|
+
* ```
|
|
432
|
+
*
|
|
433
|
+
* ## Example: Read file stream line-by-Line
|
|
434
|
+
*
|
|
435
|
+
* A common use case for `readline` is to consume an input file one line at a
|
|
436
|
+
* time. The easiest way to do so is leveraging the `fs.ReadStream` API as
|
|
437
|
+
* well as a `for await...of` loop:
|
|
438
|
+
*
|
|
439
|
+
* ```js
|
|
440
|
+
* const fs = require('fs');
|
|
441
|
+
* const readline = require('readline');
|
|
442
|
+
*
|
|
443
|
+
* async function processLineByLine() {
|
|
444
|
+
* const fileStream = fs.createReadStream('input.txt');
|
|
445
|
+
*
|
|
446
|
+
* const rl = readline.createInterface({
|
|
447
|
+
* input: fileStream,
|
|
448
|
+
* crlfDelay: Infinity
|
|
449
|
+
* });
|
|
450
|
+
* // Note: we use the crlfDelay option to recognize all instances of CR LF
|
|
451
|
+
* // ('\r\n') in input.txt as a single line break.
|
|
452
|
+
*
|
|
453
|
+
* for await (const line of rl) {
|
|
454
|
+
* // Each line in input.txt will be successively available here as `line`.
|
|
455
|
+
* console.log(`Line from file: ${line}`);
|
|
456
|
+
* }
|
|
457
|
+
* }
|
|
458
|
+
*
|
|
459
|
+
* processLineByLine();
|
|
460
|
+
* ```
|
|
461
|
+
*
|
|
462
|
+
* Alternatively, one could use the `'line'` event:
|
|
463
|
+
*
|
|
464
|
+
* ```js
|
|
465
|
+
* const fs = require('fs');
|
|
466
|
+
* const readline = require('readline');
|
|
467
|
+
*
|
|
468
|
+
* const rl = readline.createInterface({
|
|
469
|
+
* input: fs.createReadStream('sample.txt'),
|
|
470
|
+
* crlfDelay: Infinity
|
|
471
|
+
* });
|
|
472
|
+
*
|
|
473
|
+
* rl.on('line', (line) => {
|
|
474
|
+
* console.log(`Line from file: ${line}`);
|
|
475
|
+
* });
|
|
476
|
+
* ```
|
|
477
|
+
*
|
|
478
|
+
* Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
|
|
479
|
+
*
|
|
480
|
+
* ```js
|
|
481
|
+
* const { once } = require('events');
|
|
482
|
+
* const { createReadStream } = require('fs');
|
|
483
|
+
* const { createInterface } = require('readline');
|
|
484
|
+
*
|
|
485
|
+
* (async function processLineByLine() {
|
|
486
|
+
* try {
|
|
487
|
+
* const rl = createInterface({
|
|
488
|
+
* input: createReadStream('big-file.txt'),
|
|
489
|
+
* crlfDelay: Infinity
|
|
490
|
+
* });
|
|
491
|
+
*
|
|
492
|
+
* rl.on('line', (line) => {
|
|
493
|
+
* // Process the line.
|
|
494
|
+
* });
|
|
495
|
+
*
|
|
496
|
+
* await once(rl, 'close');
|
|
497
|
+
*
|
|
498
|
+
* console.log('File processed.');
|
|
499
|
+
* } catch (err) {
|
|
500
|
+
* console.error(err);
|
|
501
|
+
* }
|
|
502
|
+
* })();
|
|
503
|
+
* ```
|
|
397
504
|
* @since v0.7.7
|
|
398
505
|
*/
|
|
399
506
|
function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const repl = require('repl');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/repl.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'repl' {
|
|
12
12
|
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|