@wbce/projen-d9 0.0.27

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.
Files changed (125) hide show
  1. package/.jsii +552 -0
  2. package/API.md +8472 -0
  3. package/CHANGELOG.md +189 -0
  4. package/LICENSE +674 -0
  5. package/README.md +82 -0
  6. package/lib/cli/commands/init.d.ts +1 -0
  7. package/lib/cli/commands/init.js +8 -0
  8. package/lib/cli/commands/save/apply-snapshot.d.ts +7 -0
  9. package/lib/cli/commands/save/apply-snapshot.js +278 -0
  10. package/lib/cli/commands/save/cli.d.ts +8 -0
  11. package/lib/cli/commands/save/cli.js +33 -0
  12. package/lib/cli/commands/save/draft.d.ts +0 -0
  13. package/lib/cli/commands/save/draft.js +2 -0
  14. package/lib/cli/commands/save/utils.d.ts +9 -0
  15. package/lib/cli/commands/save/utils.js +123 -0
  16. package/lib/cli/commands/sync.d.ts +5 -0
  17. package/lib/cli/commands/sync.js +13 -0
  18. package/lib/cli/index.d.ts +2 -0
  19. package/lib/cli/index.js +44 -0
  20. package/lib/index.d.ts +59 -0
  21. package/lib/index.js +322 -0
  22. package/node_modules/@types/node/LICENSE +21 -0
  23. package/node_modules/@types/node/README.md +16 -0
  24. package/node_modules/@types/node/assert.d.ts +117 -0
  25. package/node_modules/@types/node/async_hooks.d.ts +246 -0
  26. package/node_modules/@types/node/buffer.d.ts +22 -0
  27. package/node_modules/@types/node/child_process.d.ts +507 -0
  28. package/node_modules/@types/node/cluster.d.ts +260 -0
  29. package/node_modules/@types/node/console.d.ts +3 -0
  30. package/node_modules/@types/node/constants.d.ts +448 -0
  31. package/node_modules/@types/node/crypto.d.ts +1183 -0
  32. package/node_modules/@types/node/dgram.d.ts +118 -0
  33. package/node_modules/@types/node/dns.d.ts +372 -0
  34. package/node_modules/@types/node/domain.d.ts +16 -0
  35. package/node_modules/@types/node/events.d.ts +47 -0
  36. package/node_modules/@types/node/fs.d.ts +2567 -0
  37. package/node_modules/@types/node/globals.d.ts +1351 -0
  38. package/node_modules/@types/node/globals.global.d.ts +1 -0
  39. package/node_modules/@types/node/http.d.ts +456 -0
  40. package/node_modules/@types/node/http2.d.ts +952 -0
  41. package/node_modules/@types/node/https.d.ts +156 -0
  42. package/node_modules/@types/node/index.d.ts +91 -0
  43. package/node_modules/@types/node/inspector.d.ts +3040 -0
  44. package/node_modules/@types/node/module.d.ts +3 -0
  45. package/node_modules/@types/node/net.d.ts +290 -0
  46. package/node_modules/@types/node/os.d.ts +263 -0
  47. package/node_modules/@types/node/package.json +195 -0
  48. package/node_modules/@types/node/path.d.ts +159 -0
  49. package/node_modules/@types/node/perf_hooks.d.ts +259 -0
  50. package/node_modules/@types/node/process.d.ts +15 -0
  51. package/node_modules/@types/node/punycode.d.ts +75 -0
  52. package/node_modules/@types/node/querystring.d.ts +29 -0
  53. package/node_modules/@types/node/readline.d.ts +158 -0
  54. package/node_modules/@types/node/repl.d.ts +390 -0
  55. package/node_modules/@types/node/stream.d.ts +334 -0
  56. package/node_modules/@types/node/string_decoder.d.ts +7 -0
  57. package/node_modules/@types/node/timers.d.ts +16 -0
  58. package/node_modules/@types/node/tls.d.ts +713 -0
  59. package/node_modules/@types/node/trace_events.d.ts +61 -0
  60. package/node_modules/@types/node/tty.d.ts +66 -0
  61. package/node_modules/@types/node/url.d.ts +147 -0
  62. package/node_modules/@types/node/util.d.ts +200 -0
  63. package/node_modules/@types/node/v8.d.ts +197 -0
  64. package/node_modules/@types/node/vm.d.ts +112 -0
  65. package/node_modules/@types/node/wasi.d.ts +55 -0
  66. package/node_modules/@types/node/worker_threads.d.ts +207 -0
  67. package/node_modules/@types/node/zlib.d.ts +356 -0
  68. package/node_modules/@types/pg/LICENSE +21 -0
  69. package/node_modules/@types/pg/README.md +15 -0
  70. package/node_modules/@types/pg/index.d.mts +56 -0
  71. package/node_modules/@types/pg/index.d.ts +360 -0
  72. package/node_modules/@types/pg/lib/connection-parameters.d.ts +58 -0
  73. package/node_modules/@types/pg/lib/type-overrides.d.ts +77 -0
  74. package/node_modules/@types/pg/package.json +38 -0
  75. package/node_modules/@types/pg-copy-streams/LICENSE +21 -0
  76. package/node_modules/@types/pg-copy-streams/README.md +38 -0
  77. package/node_modules/@types/pg-copy-streams/index.d.ts +19 -0
  78. package/node_modules/@types/pg-copy-streams/package.json +28 -0
  79. package/node_modules/commander/LICENSE +22 -0
  80. package/node_modules/commander/Readme.md +1176 -0
  81. package/node_modules/commander/esm.mjs +16 -0
  82. package/node_modules/commander/index.js +24 -0
  83. package/node_modules/commander/lib/argument.js +150 -0
  84. package/node_modules/commander/lib/command.js +2777 -0
  85. package/node_modules/commander/lib/error.js +39 -0
  86. package/node_modules/commander/lib/help.js +747 -0
  87. package/node_modules/commander/lib/option.js +380 -0
  88. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  89. package/node_modules/commander/package-support.json +19 -0
  90. package/node_modules/commander/package.json +82 -0
  91. package/node_modules/commander/typings/esm.d.mts +3 -0
  92. package/node_modules/commander/typings/index.d.ts +1113 -0
  93. package/node_modules/pg/LICENSE +21 -0
  94. package/node_modules/pg/README.md +95 -0
  95. package/node_modules/pg/esm/index.mjs +20 -0
  96. package/node_modules/pg/lib/client.js +743 -0
  97. package/node_modules/pg/lib/connection-parameters.js +171 -0
  98. package/node_modules/pg/lib/connection.js +221 -0
  99. package/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  100. package/node_modules/pg/lib/crypto/sasl.js +212 -0
  101. package/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  102. package/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  103. package/node_modules/pg/lib/crypto/utils.js +9 -0
  104. package/node_modules/pg/lib/defaults.js +91 -0
  105. package/node_modules/pg/lib/index.js +73 -0
  106. package/node_modules/pg/lib/native/client.js +323 -0
  107. package/node_modules/pg/lib/native/index.js +2 -0
  108. package/node_modules/pg/lib/native/query.js +165 -0
  109. package/node_modules/pg/lib/query.js +252 -0
  110. package/node_modules/pg/lib/result.js +109 -0
  111. package/node_modules/pg/lib/stream.js +83 -0
  112. package/node_modules/pg/lib/type-overrides.js +35 -0
  113. package/node_modules/pg/lib/utils.js +217 -0
  114. package/node_modules/pg/package.json +76 -0
  115. package/node_modules/pg-copy-streams/Makefile +19 -0
  116. package/node_modules/pg-copy-streams/README.md +315 -0
  117. package/node_modules/pg-copy-streams/copy-both.js +267 -0
  118. package/node_modules/pg-copy-streams/copy-from.js +173 -0
  119. package/node_modules/pg-copy-streams/copy-to.js +177 -0
  120. package/node_modules/pg-copy-streams/eslint.config.js +55 -0
  121. package/node_modules/pg-copy-streams/index.js +17 -0
  122. package/node_modules/pg-copy-streams/message-formats.js +27 -0
  123. package/node_modules/pg-copy-streams/obuf.js +376 -0
  124. package/node_modules/pg-copy-streams/package.json +51 -0
  125. package/package.json +136 -0
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @deprecated since v7.0.0
3
+ * The version of the punycode module bundled in Node.js is being deprecated.
4
+ * In a future major version of Node.js this module will be removed.
5
+ * Users currently depending on the punycode module should switch to using
6
+ * the userland-provided Punycode.js module instead.
7
+ */
8
+ declare module 'punycode' {
9
+ /**
10
+ * @deprecated since v7.0.0
11
+ * The version of the punycode module bundled in Node.js is being deprecated.
12
+ * In a future major version of Node.js this module will be removed.
13
+ * Users currently depending on the punycode module should switch to using
14
+ * the userland-provided Punycode.js module instead.
15
+ */
16
+ function decode(string: string): string;
17
+ /**
18
+ * @deprecated since v7.0.0
19
+ * The version of the punycode module bundled in Node.js is being deprecated.
20
+ * In a future major version of Node.js this module will be removed.
21
+ * Users currently depending on the punycode module should switch to using
22
+ * the userland-provided Punycode.js module instead.
23
+ */
24
+ function encode(string: string): string;
25
+ /**
26
+ * @deprecated since v7.0.0
27
+ * The version of the punycode module bundled in Node.js is being deprecated.
28
+ * In a future major version of Node.js this module will be removed.
29
+ * Users currently depending on the punycode module should switch to using
30
+ * the userland-provided Punycode.js module instead.
31
+ */
32
+ function toUnicode(domain: string): string;
33
+ /**
34
+ * @deprecated since v7.0.0
35
+ * The version of the punycode module bundled in Node.js is being deprecated.
36
+ * In a future major version of Node.js this module will be removed.
37
+ * Users currently depending on the punycode module should switch to using
38
+ * the userland-provided Punycode.js module instead.
39
+ */
40
+ function toASCII(domain: string): string;
41
+ /**
42
+ * @deprecated since v7.0.0
43
+ * The version of the punycode module bundled in Node.js is being deprecated.
44
+ * In a future major version of Node.js this module will be removed.
45
+ * Users currently depending on the punycode module should switch to using
46
+ * the userland-provided Punycode.js module instead.
47
+ */
48
+ const ucs2: ucs2;
49
+ interface ucs2 {
50
+ /**
51
+ * @deprecated since v7.0.0
52
+ * The version of the punycode module bundled in Node.js is being deprecated.
53
+ * In a future major version of Node.js this module will be removed.
54
+ * Users currently depending on the punycode module should switch to using
55
+ * the userland-provided Punycode.js module instead.
56
+ */
57
+ decode(string: string): number[];
58
+ /**
59
+ * @deprecated since v7.0.0
60
+ * The version of the punycode module bundled in Node.js is being deprecated.
61
+ * In a future major version of Node.js this module will be removed.
62
+ * Users currently depending on the punycode module should switch to using
63
+ * the userland-provided Punycode.js module instead.
64
+ */
65
+ encode(codePoints: ReadonlyArray<number>): string;
66
+ }
67
+ /**
68
+ * @deprecated since v7.0.0
69
+ * The version of the punycode module bundled in Node.js is being deprecated.
70
+ * In a future major version of Node.js this module will be removed.
71
+ * Users currently depending on the punycode module should switch to using
72
+ * the userland-provided Punycode.js module instead.
73
+ */
74
+ const version: string;
75
+ }
@@ -0,0 +1,29 @@
1
+ declare module 'querystring' {
2
+ interface StringifyOptions {
3
+ encodeURIComponent?: ((str: string) => string) | undefined;
4
+ }
5
+
6
+ interface ParseOptions {
7
+ maxKeys?: number | undefined;
8
+ decodeURIComponent?: ((str: string) => string) | undefined;
9
+ }
10
+
11
+ interface ParsedUrlQuery { [key: string]: string | string[]; }
12
+
13
+ interface ParsedUrlQueryInput {
14
+ [key: string]: string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | undefined | null;
15
+ }
16
+
17
+ function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
18
+ function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
19
+ /**
20
+ * The querystring.encode() function is an alias for querystring.stringify().
21
+ */
22
+ const encode: typeof stringify;
23
+ /**
24
+ * The querystring.decode() function is an alias for querystring.parse().
25
+ */
26
+ const decode: typeof parse;
27
+ function escape(str: string): string;
28
+ function unescape(str: string): string;
29
+ }
@@ -0,0 +1,158 @@
1
+ declare module 'readline' {
2
+ import EventEmitter = require('events');
3
+
4
+ interface Key {
5
+ sequence?: string | undefined;
6
+ name?: string | undefined;
7
+ ctrl?: boolean | undefined;
8
+ meta?: boolean | undefined;
9
+ shift?: boolean | undefined;
10
+ }
11
+
12
+ class Interface extends EventEmitter {
13
+ readonly terminal: boolean;
14
+
15
+ // Need direct access to line/cursor data, for use in external processes
16
+ // see: https://github.com/nodejs/node/issues/30347
17
+ /** The current input data */
18
+ readonly line: string;
19
+ /** The current cursor position in the input line */
20
+ readonly cursor: number;
21
+
22
+ /**
23
+ * NOTE: According to the documentation:
24
+ *
25
+ * > Instances of the `readline.Interface` class are constructed using the
26
+ * > `readline.createInterface()` method.
27
+ *
28
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
29
+ */
30
+ protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
31
+ /**
32
+ * NOTE: According to the documentation:
33
+ *
34
+ * > Instances of the `readline.Interface` class are constructed using the
35
+ * > `readline.createInterface()` method.
36
+ *
37
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
38
+ */
39
+ protected constructor(options: ReadLineOptions);
40
+
41
+ setPrompt(prompt: string): void;
42
+ prompt(preserveCursor?: boolean): void;
43
+ question(query: string, callback: (answer: string) => void): void;
44
+ pause(): this;
45
+ resume(): this;
46
+ close(): void;
47
+ write(data: string | Buffer, key?: Key): void;
48
+ write(data: undefined | null | string | Buffer, key: Key): void;
49
+
50
+ /**
51
+ * events.EventEmitter
52
+ * 1. close
53
+ * 2. line
54
+ * 3. pause
55
+ * 4. resume
56
+ * 5. SIGCONT
57
+ * 6. SIGINT
58
+ * 7. SIGTSTP
59
+ */
60
+
61
+ addListener(event: string, listener: (...args: any[]) => void): this;
62
+ addListener(event: "close", listener: () => void): this;
63
+ addListener(event: "line", listener: (input: string) => void): this;
64
+ addListener(event: "pause", listener: () => void): this;
65
+ addListener(event: "resume", listener: () => void): this;
66
+ addListener(event: "SIGCONT", listener: () => void): this;
67
+ addListener(event: "SIGINT", listener: () => void): this;
68
+ addListener(event: "SIGTSTP", listener: () => void): this;
69
+
70
+ emit(event: string | symbol, ...args: any[]): boolean;
71
+ emit(event: "close"): boolean;
72
+ emit(event: "line", input: string): boolean;
73
+ emit(event: "pause"): boolean;
74
+ emit(event: "resume"): boolean;
75
+ emit(event: "SIGCONT"): boolean;
76
+ emit(event: "SIGINT"): boolean;
77
+ emit(event: "SIGTSTP"): boolean;
78
+
79
+ on(event: string, listener: (...args: any[]) => void): this;
80
+ on(event: "close", listener: () => void): this;
81
+ on(event: "line", listener: (input: string) => void): this;
82
+ on(event: "pause", listener: () => void): this;
83
+ on(event: "resume", listener: () => void): this;
84
+ on(event: "SIGCONT", listener: () => void): this;
85
+ on(event: "SIGINT", listener: () => void): this;
86
+ on(event: "SIGTSTP", listener: () => void): this;
87
+
88
+ once(event: string, listener: (...args: any[]) => void): this;
89
+ once(event: "close", listener: () => void): this;
90
+ once(event: "line", listener: (input: string) => void): this;
91
+ once(event: "pause", listener: () => void): this;
92
+ once(event: "resume", listener: () => void): this;
93
+ once(event: "SIGCONT", listener: () => void): this;
94
+ once(event: "SIGINT", listener: () => void): this;
95
+ once(event: "SIGTSTP", listener: () => void): this;
96
+
97
+ prependListener(event: string, listener: (...args: any[]) => void): this;
98
+ prependListener(event: "close", listener: () => void): this;
99
+ prependListener(event: "line", listener: (input: string) => void): this;
100
+ prependListener(event: "pause", listener: () => void): this;
101
+ prependListener(event: "resume", listener: () => void): this;
102
+ prependListener(event: "SIGCONT", listener: () => void): this;
103
+ prependListener(event: "SIGINT", listener: () => void): this;
104
+ prependListener(event: "SIGTSTP", listener: () => void): this;
105
+
106
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
107
+ prependOnceListener(event: "close", listener: () => void): this;
108
+ prependOnceListener(event: "line", listener: (input: string) => void): this;
109
+ prependOnceListener(event: "pause", listener: () => void): this;
110
+ prependOnceListener(event: "resume", listener: () => void): this;
111
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
112
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
113
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
114
+ [Symbol.asyncIterator](): AsyncIterableIterator<string>;
115
+ }
116
+
117
+ type ReadLine = Interface; // type forwarded for backwards compatiblity
118
+
119
+ type Completer = (line: string) => CompleterResult;
120
+ type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
121
+
122
+ type CompleterResult = [string[], string];
123
+
124
+ interface ReadLineOptions {
125
+ input: NodeJS.ReadableStream;
126
+ output?: NodeJS.WritableStream | undefined;
127
+ completer?: Completer | AsyncCompleter | undefined;
128
+ terminal?: boolean | undefined;
129
+ historySize?: number | undefined;
130
+ prompt?: string | undefined;
131
+ crlfDelay?: number | undefined;
132
+ removeHistoryDuplicates?: boolean | undefined;
133
+ escapeCodeTimeout?: number | undefined;
134
+ }
135
+
136
+ function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
137
+ function createInterface(options: ReadLineOptions): Interface;
138
+ function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
139
+
140
+ type Direction = -1 | 0 | 1;
141
+
142
+ /**
143
+ * Clears the current line of this WriteStream in a direction identified by `dir`.
144
+ */
145
+ function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
146
+ /**
147
+ * Clears this `WriteStream` from the current cursor down.
148
+ */
149
+ function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
150
+ /**
151
+ * Moves this WriteStream's cursor to the specified position.
152
+ */
153
+ function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
154
+ /**
155
+ * Moves this WriteStream's cursor relative to its current position.
156
+ */
157
+ function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
158
+ }
@@ -0,0 +1,390 @@
1
+ declare module 'repl' {
2
+ import { Interface, Completer, AsyncCompleter } from 'readline';
3
+ import { Context } from 'vm';
4
+ import { InspectOptions } from 'util';
5
+
6
+ interface ReplOptions {
7
+ /**
8
+ * The input prompt to display.
9
+ * @default "> "
10
+ */
11
+ prompt?: string | undefined;
12
+ /**
13
+ * The `Readable` stream from which REPL input will be read.
14
+ * @default process.stdin
15
+ */
16
+ input?: NodeJS.ReadableStream | undefined;
17
+ /**
18
+ * The `Writable` stream to which REPL output will be written.
19
+ * @default process.stdout
20
+ */
21
+ output?: NodeJS.WritableStream | undefined;
22
+ /**
23
+ * If `true`, specifies that the output should be treated as a TTY terminal, and have
24
+ * ANSI/VT100 escape codes written to it.
25
+ * Default: checking the value of the `isTTY` property on the output stream upon
26
+ * instantiation.
27
+ */
28
+ terminal?: boolean | undefined;
29
+ /**
30
+ * The function to be used when evaluating each given line of input.
31
+ * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
32
+ * error with `repl.Recoverable` to indicate the input was incomplete and prompt for
33
+ * additional lines.
34
+ *
35
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
36
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
37
+ */
38
+ eval?: REPLEval | undefined;
39
+ /**
40
+ * If `true`, specifies that the default `writer` function should include ANSI color
41
+ * styling to REPL output. If a custom `writer` function is provided then this has no
42
+ * effect.
43
+ * Default: the REPL instance's `terminal` value.
44
+ */
45
+ useColors?: boolean | undefined;
46
+ /**
47
+ * If `true`, specifies that the default evaluation function will use the JavaScript
48
+ * `global` as the context as opposed to creating a new separate context for the REPL
49
+ * instance. The node CLI REPL sets this value to `true`.
50
+ * Default: `false`.
51
+ */
52
+ useGlobal?: boolean | undefined;
53
+ /**
54
+ * If `true`, specifies that the default writer will not output the return value of a
55
+ * command if it evaluates to `undefined`.
56
+ * Default: `false`.
57
+ */
58
+ ignoreUndefined?: boolean | undefined;
59
+ /**
60
+ * The function to invoke to format the output of each command before writing to `output`.
61
+ * Default: a wrapper for `util.inspect`.
62
+ *
63
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
64
+ */
65
+ writer?: REPLWriter | undefined;
66
+ /**
67
+ * An optional function used for custom Tab auto completion.
68
+ *
69
+ * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
70
+ */
71
+ completer?: Completer | AsyncCompleter | undefined;
72
+ /**
73
+ * A flag that specifies whether the default evaluator executes all JavaScript commands in
74
+ * strict mode or default (sloppy) mode.
75
+ * Accepted values are:
76
+ * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
77
+ * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
78
+ * prefacing every repl statement with `'use strict'`.
79
+ */
80
+ replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
81
+ /**
82
+ * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
83
+ * pressed. This cannot be used together with a custom `eval` function.
84
+ * Default: `false`.
85
+ */
86
+ breakEvalOnSigint?: boolean | undefined;
87
+ }
88
+
89
+ type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
90
+ type REPLWriter = (this: REPLServer, obj: any) => string;
91
+
92
+ /**
93
+ * This is the default "writer" value, if none is passed in the REPL options,
94
+ * and it can be overridden by custom print functions.
95
+ */
96
+ const writer: REPLWriter & { options: InspectOptions };
97
+
98
+ type REPLCommandAction = (this: REPLServer, text: string) => void;
99
+
100
+ interface REPLCommand {
101
+ /**
102
+ * Help text to be displayed when `.help` is entered.
103
+ */
104
+ help?: string | undefined;
105
+ /**
106
+ * The function to execute, optionally accepting a single string argument.
107
+ */
108
+ action: REPLCommandAction;
109
+ }
110
+
111
+ /**
112
+ * Provides a customizable Read-Eval-Print-Loop (REPL).
113
+ *
114
+ * Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those
115
+ * according to a user-defined evaluation function, then output the result. Input and output
116
+ * may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`.
117
+ *
118
+ * Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style
119
+ * line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session
120
+ * state, error recovery, and customizable evaluation functions.
121
+ *
122
+ * Instances of `repl.REPLServer` are created using the `repl.start()` method and _should not_
123
+ * be created directly using the JavaScript `new` keyword.
124
+ *
125
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl
126
+ */
127
+ class REPLServer extends Interface {
128
+ /**
129
+ * The `vm.Context` provided to the `eval` function to be used for JavaScript
130
+ * evaluation.
131
+ */
132
+ readonly context: Context;
133
+ /**
134
+ * Outdated alias for `input`.
135
+ */
136
+ readonly inputStream: NodeJS.ReadableStream;
137
+ /**
138
+ * Outdated alias for `output`.
139
+ */
140
+ readonly outputStream: NodeJS.WritableStream;
141
+ /**
142
+ * The `Readable` stream from which REPL input will be read.
143
+ */
144
+ readonly input: NodeJS.ReadableStream;
145
+ /**
146
+ * The `Writable` stream to which REPL output will be written.
147
+ */
148
+ readonly output: NodeJS.WritableStream;
149
+ /**
150
+ * The commands registered via `replServer.defineCommand()`.
151
+ */
152
+ readonly commands: { readonly [name: string]: REPLCommand | undefined };
153
+ /**
154
+ * A value indicating whether the REPL is currently in "editor mode".
155
+ *
156
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
157
+ */
158
+ readonly editorMode: boolean;
159
+ /**
160
+ * A value indicating whether the `_` variable has been assigned.
161
+ *
162
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
163
+ */
164
+ readonly underscoreAssigned: boolean;
165
+ /**
166
+ * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
167
+ *
168
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
169
+ */
170
+ readonly last: any;
171
+ /**
172
+ * A value indicating whether the `_error` variable has been assigned.
173
+ *
174
+ * @since v9.8.0
175
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
176
+ */
177
+ readonly underscoreErrAssigned: boolean;
178
+ /**
179
+ * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
180
+ *
181
+ * @since v9.8.0
182
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
183
+ */
184
+ readonly lastError: any;
185
+ /**
186
+ * Specified in the REPL options, this is the function to be used when evaluating each
187
+ * given line of input. If not specified in the REPL options, this is an async wrapper
188
+ * for the JavaScript `eval()` function.
189
+ */
190
+ readonly eval: REPLEval;
191
+ /**
192
+ * Specified in the REPL options, this is a value indicating whether the default
193
+ * `writer` function should include ANSI color styling to REPL output.
194
+ */
195
+ readonly useColors: boolean;
196
+ /**
197
+ * Specified in the REPL options, this is a value indicating whether the default `eval`
198
+ * function will use the JavaScript `global` as the context as opposed to creating a new
199
+ * separate context for the REPL instance.
200
+ */
201
+ readonly useGlobal: boolean;
202
+ /**
203
+ * Specified in the REPL options, this is a value indicating whether the default `writer`
204
+ * function should output the result of a command if it evaluates to `undefined`.
205
+ */
206
+ readonly ignoreUndefined: boolean;
207
+ /**
208
+ * Specified in the REPL options, this is the function to invoke to format the output of
209
+ * each command before writing to `outputStream`. If not specified in the REPL options,
210
+ * this will be a wrapper for `util.inspect`.
211
+ */
212
+ readonly writer: REPLWriter;
213
+ /**
214
+ * Specified in the REPL options, this is the function to use for custom Tab auto-completion.
215
+ */
216
+ readonly completer: Completer | AsyncCompleter;
217
+ /**
218
+ * Specified in the REPL options, this is a flag that specifies whether the default `eval`
219
+ * function should execute all JavaScript commands in strict mode or default (sloppy) mode.
220
+ * Possible values are:
221
+ * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
222
+ * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
223
+ * prefacing every repl statement with `'use strict'`.
224
+ */
225
+ readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
226
+
227
+ /**
228
+ * NOTE: According to the documentation:
229
+ *
230
+ * > Instances of `repl.REPLServer` are created using the `repl.start()` method and
231
+ * > _should not_ be created directly using the JavaScript `new` keyword.
232
+ *
233
+ * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
234
+ *
235
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
236
+ */
237
+ private constructor();
238
+
239
+ /**
240
+ * Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked
241
+ * by typing a `.` followed by the `keyword`.
242
+ *
243
+ * @param keyword The command keyword (_without_ a leading `.` character).
244
+ * @param cmd The function to invoke when the command is processed.
245
+ *
246
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd
247
+ */
248
+ defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
249
+ /**
250
+ * Readies the REPL instance for input from the user, printing the configured `prompt` to a
251
+ * new line in the `output` and resuming the `input` to accept new input.
252
+ *
253
+ * When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'.
254
+ *
255
+ * This method is primarily intended to be called from within the action function for
256
+ * commands registered using the `replServer.defineCommand()` method.
257
+ *
258
+ * @param preserveCursor When `true`, the cursor placement will not be reset to `0`.
259
+ */
260
+ displayPrompt(preserveCursor?: boolean): void;
261
+ /**
262
+ * Clears any command that has been buffered but not yet executed.
263
+ *
264
+ * This method is primarily intended to be called from within the action function for
265
+ * commands registered using the `replServer.defineCommand()` method.
266
+ *
267
+ * @since v9.0.0
268
+ */
269
+ clearBufferedCommand(): void;
270
+
271
+ /**
272
+ * Initializes a history log file for the REPL instance. When executing the
273
+ * Node.js binary and using the command line REPL, a history file is initialized
274
+ * by default. However, this is not the case when creating a REPL
275
+ * programmatically. Use this method to initialize a history log file when working
276
+ * with REPL instances programmatically.
277
+ * @param path The path to the history file
278
+ */
279
+ setupHistory(path: string, cb: (err: Error | null, repl: this) => void): void;
280
+
281
+ /**
282
+ * events.EventEmitter
283
+ * 1. close - inherited from `readline.Interface`
284
+ * 2. line - inherited from `readline.Interface`
285
+ * 3. pause - inherited from `readline.Interface`
286
+ * 4. resume - inherited from `readline.Interface`
287
+ * 5. SIGCONT - inherited from `readline.Interface`
288
+ * 6. SIGINT - inherited from `readline.Interface`
289
+ * 7. SIGTSTP - inherited from `readline.Interface`
290
+ * 8. exit
291
+ * 9. reset
292
+ */
293
+
294
+ addListener(event: string, listener: (...args: any[]) => void): this;
295
+ addListener(event: "close", listener: () => void): this;
296
+ addListener(event: "line", listener: (input: string) => void): this;
297
+ addListener(event: "pause", listener: () => void): this;
298
+ addListener(event: "resume", listener: () => void): this;
299
+ addListener(event: "SIGCONT", listener: () => void): this;
300
+ addListener(event: "SIGINT", listener: () => void): this;
301
+ addListener(event: "SIGTSTP", listener: () => void): this;
302
+ addListener(event: "exit", listener: () => void): this;
303
+ addListener(event: "reset", listener: (context: Context) => void): this;
304
+
305
+ emit(event: string | symbol, ...args: any[]): boolean;
306
+ emit(event: "close"): boolean;
307
+ emit(event: "line", input: string): boolean;
308
+ emit(event: "pause"): boolean;
309
+ emit(event: "resume"): boolean;
310
+ emit(event: "SIGCONT"): boolean;
311
+ emit(event: "SIGINT"): boolean;
312
+ emit(event: "SIGTSTP"): boolean;
313
+ emit(event: "exit"): boolean;
314
+ emit(event: "reset", context: Context): boolean;
315
+
316
+ on(event: string, listener: (...args: any[]) => void): this;
317
+ on(event: "close", listener: () => void): this;
318
+ on(event: "line", listener: (input: string) => void): this;
319
+ on(event: "pause", listener: () => void): this;
320
+ on(event: "resume", listener: () => void): this;
321
+ on(event: "SIGCONT", listener: () => void): this;
322
+ on(event: "SIGINT", listener: () => void): this;
323
+ on(event: "SIGTSTP", listener: () => void): this;
324
+ on(event: "exit", listener: () => void): this;
325
+ on(event: "reset", listener: (context: Context) => void): this;
326
+
327
+ once(event: string, listener: (...args: any[]) => void): this;
328
+ once(event: "close", listener: () => void): this;
329
+ once(event: "line", listener: (input: string) => void): this;
330
+ once(event: "pause", listener: () => void): this;
331
+ once(event: "resume", listener: () => void): this;
332
+ once(event: "SIGCONT", listener: () => void): this;
333
+ once(event: "SIGINT", listener: () => void): this;
334
+ once(event: "SIGTSTP", listener: () => void): this;
335
+ once(event: "exit", listener: () => void): this;
336
+ once(event: "reset", listener: (context: Context) => void): this;
337
+
338
+ prependListener(event: string, listener: (...args: any[]) => void): this;
339
+ prependListener(event: "close", listener: () => void): this;
340
+ prependListener(event: "line", listener: (input: string) => void): this;
341
+ prependListener(event: "pause", listener: () => void): this;
342
+ prependListener(event: "resume", listener: () => void): this;
343
+ prependListener(event: "SIGCONT", listener: () => void): this;
344
+ prependListener(event: "SIGINT", listener: () => void): this;
345
+ prependListener(event: "SIGTSTP", listener: () => void): this;
346
+ prependListener(event: "exit", listener: () => void): this;
347
+ prependListener(event: "reset", listener: (context: Context) => void): this;
348
+
349
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
350
+ prependOnceListener(event: "close", listener: () => void): this;
351
+ prependOnceListener(event: "line", listener: (input: string) => void): this;
352
+ prependOnceListener(event: "pause", listener: () => void): this;
353
+ prependOnceListener(event: "resume", listener: () => void): this;
354
+ prependOnceListener(event: "SIGCONT", listener: () => void): this;
355
+ prependOnceListener(event: "SIGINT", listener: () => void): this;
356
+ prependOnceListener(event: "SIGTSTP", listener: () => void): this;
357
+ prependOnceListener(event: "exit", listener: () => void): this;
358
+ prependOnceListener(event: "reset", listener: (context: Context) => void): this;
359
+ }
360
+
361
+ /**
362
+ * A flag passed in the REPL options. Evaluates expressions in sloppy mode.
363
+ */
364
+ const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol
365
+
366
+ /**
367
+ * A flag passed in the REPL options. Evaluates expressions in strict mode.
368
+ * This is equivalent to prefacing every repl statement with `'use strict'`.
369
+ */
370
+ const REPL_MODE_STRICT: symbol; // TODO: unique symbol
371
+
372
+ /**
373
+ * Creates and starts a `repl.REPLServer` instance.
374
+ *
375
+ * @param options The options for the `REPLServer`. If `options` is a string, then it specifies
376
+ * the input prompt.
377
+ */
378
+ function start(options?: string | ReplOptions): REPLServer;
379
+
380
+ /**
381
+ * Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
382
+ *
383
+ * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
384
+ */
385
+ class Recoverable extends SyntaxError {
386
+ err: Error;
387
+
388
+ constructor(err: Error);
389
+ }
390
+ }