@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,507 @@
1
+ declare module 'child_process' {
2
+ import * as events from 'events';
3
+ import * as net from 'net';
4
+ import { Writable, Readable, Stream, Pipe } from 'stream';
5
+
6
+ interface ChildProcess extends events.EventEmitter {
7
+ stdin: Writable | null;
8
+ stdout: Readable | null;
9
+ stderr: Readable | null;
10
+ readonly channel?: Pipe | null | undefined;
11
+ readonly stdio: [
12
+ Writable | null, // stdin
13
+ Readable | null, // stdout
14
+ Readable | null, // stderr
15
+ Readable | Writable | null | undefined, // extra
16
+ Readable | Writable | null | undefined // extra
17
+ ];
18
+ readonly killed: boolean;
19
+ readonly pid: number;
20
+ readonly connected: boolean;
21
+ readonly exitCode: number | null;
22
+ readonly signalCode: number | null;
23
+ readonly spawnargs: string[];
24
+ readonly spawnfile: string;
25
+ kill(signal?: NodeJS.Signals | number): boolean;
26
+ send(message: any, callback?: (error: Error | null) => void): boolean;
27
+ send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error | null) => void): boolean;
28
+ send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
29
+ disconnect(): void;
30
+ unref(): void;
31
+ ref(): void;
32
+
33
+ /**
34
+ * events.EventEmitter
35
+ * 1. close
36
+ * 2. disconnect
37
+ * 3. error
38
+ * 4. exit
39
+ * 5. message
40
+ */
41
+
42
+ addListener(event: string, listener: (...args: any[]) => void): this;
43
+ addListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
44
+ addListener(event: "disconnect", listener: () => void): this;
45
+ addListener(event: "error", listener: (err: Error) => void): this;
46
+ addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
47
+ addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
48
+
49
+ emit(event: string | symbol, ...args: any[]): boolean;
50
+ emit(event: "close", code: number, signal: NodeJS.Signals): boolean;
51
+ emit(event: "disconnect"): boolean;
52
+ emit(event: "error", err: Error): boolean;
53
+ emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
54
+ emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean;
55
+
56
+ on(event: string, listener: (...args: any[]) => void): this;
57
+ on(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
58
+ on(event: "disconnect", listener: () => void): this;
59
+ on(event: "error", listener: (err: Error) => void): this;
60
+ on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
61
+ on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
62
+
63
+ once(event: string, listener: (...args: any[]) => void): this;
64
+ once(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
65
+ once(event: "disconnect", listener: () => void): this;
66
+ once(event: "error", listener: (err: Error) => void): this;
67
+ once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
68
+ once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
69
+
70
+ prependListener(event: string, listener: (...args: any[]) => void): this;
71
+ prependListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
72
+ prependListener(event: "disconnect", listener: () => void): this;
73
+ prependListener(event: "error", listener: (err: Error) => void): this;
74
+ prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
75
+ prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
76
+
77
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
78
+ prependOnceListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
79
+ prependOnceListener(event: "disconnect", listener: () => void): this;
80
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
81
+ prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
82
+ prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
83
+ }
84
+
85
+ // return this object when stdio option is undefined or not specified
86
+ interface ChildProcessWithoutNullStreams extends ChildProcess {
87
+ stdin: Writable;
88
+ stdout: Readable;
89
+ stderr: Readable;
90
+ readonly stdio: [
91
+ Writable, // stdin
92
+ Readable, // stdout
93
+ Readable, // stderr
94
+ Readable | Writable | null | undefined, // extra, no modification
95
+ Readable | Writable | null | undefined // extra, no modification
96
+ ];
97
+ }
98
+
99
+ // return this object when stdio option is a tuple of 3
100
+ interface ChildProcessByStdio<
101
+ I extends null | Writable,
102
+ O extends null | Readable,
103
+ E extends null | Readable,
104
+ > extends ChildProcess {
105
+ stdin: I;
106
+ stdout: O;
107
+ stderr: E;
108
+ readonly stdio: [
109
+ I,
110
+ O,
111
+ E,
112
+ Readable | Writable | null | undefined, // extra, no modification
113
+ Readable | Writable | null | undefined // extra, no modification
114
+ ];
115
+ }
116
+
117
+ interface MessageOptions {
118
+ keepOpen?: boolean | undefined;
119
+ }
120
+
121
+ type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>;
122
+
123
+ type SerializationType = 'json' | 'advanced';
124
+
125
+ interface MessagingOptions {
126
+ /**
127
+ * Specify the kind of serialization used for sending messages between processes.
128
+ * @default 'json'
129
+ */
130
+ serialization?: SerializationType | undefined;
131
+ }
132
+
133
+ interface ProcessEnvOptions {
134
+ uid?: number | undefined;
135
+ gid?: number | undefined;
136
+ cwd?: string | undefined;
137
+ env?: NodeJS.ProcessEnv | undefined;
138
+ }
139
+
140
+ interface CommonOptions extends ProcessEnvOptions {
141
+ /**
142
+ * @default true
143
+ */
144
+ windowsHide?: boolean | undefined;
145
+ /**
146
+ * @default 0
147
+ */
148
+ timeout?: number | undefined;
149
+ }
150
+
151
+ interface SpawnOptions extends CommonOptions, MessagingOptions {
152
+ argv0?: string | undefined;
153
+ stdio?: StdioOptions | undefined;
154
+ detached?: boolean | undefined;
155
+ shell?: boolean | string | undefined;
156
+ windowsVerbatimArguments?: boolean | undefined;
157
+ }
158
+
159
+ interface SpawnOptionsWithoutStdio extends SpawnOptions {
160
+ stdio?: 'pipe' | Array<null | undefined | 'pipe'> | undefined;
161
+ }
162
+
163
+ type StdioNull = 'inherit' | 'ignore' | Stream;
164
+ type StdioPipe = undefined | null | 'pipe';
165
+
166
+ interface SpawnOptionsWithStdioTuple<
167
+ Stdin extends StdioNull | StdioPipe,
168
+ Stdout extends StdioNull | StdioPipe,
169
+ Stderr extends StdioNull | StdioPipe,
170
+ > extends SpawnOptions {
171
+ stdio: [Stdin, Stdout, Stderr];
172
+ }
173
+
174
+ // overloads of spawn without 'args'
175
+ function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
176
+
177
+ function spawn(
178
+ command: string,
179
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
180
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
181
+ function spawn(
182
+ command: string,
183
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
184
+ ): ChildProcessByStdio<Writable, Readable, null>;
185
+ function spawn(
186
+ command: string,
187
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
188
+ ): ChildProcessByStdio<Writable, null, Readable>;
189
+ function spawn(
190
+ command: string,
191
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
192
+ ): ChildProcessByStdio<null, Readable, Readable>;
193
+ function spawn(
194
+ command: string,
195
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
196
+ ): ChildProcessByStdio<Writable, null, null>;
197
+ function spawn(
198
+ command: string,
199
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
200
+ ): ChildProcessByStdio<null, Readable, null>;
201
+ function spawn(
202
+ command: string,
203
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
204
+ ): ChildProcessByStdio<null, null, Readable>;
205
+ function spawn(
206
+ command: string,
207
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
208
+ ): ChildProcessByStdio<null, null, null>;
209
+
210
+ function spawn(command: string, options: SpawnOptions): ChildProcess;
211
+
212
+ // overloads of spawn with 'args'
213
+ function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
214
+
215
+ function spawn(
216
+ command: string,
217
+ args: ReadonlyArray<string>,
218
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
219
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
220
+ function spawn(
221
+ command: string,
222
+ args: ReadonlyArray<string>,
223
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
224
+ ): ChildProcessByStdio<Writable, Readable, null>;
225
+ function spawn(
226
+ command: string,
227
+ args: ReadonlyArray<string>,
228
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
229
+ ): ChildProcessByStdio<Writable, null, Readable>;
230
+ function spawn(
231
+ command: string,
232
+ args: ReadonlyArray<string>,
233
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
234
+ ): ChildProcessByStdio<null, Readable, Readable>;
235
+ function spawn(
236
+ command: string,
237
+ args: ReadonlyArray<string>,
238
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
239
+ ): ChildProcessByStdio<Writable, null, null>;
240
+ function spawn(
241
+ command: string,
242
+ args: ReadonlyArray<string>,
243
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
244
+ ): ChildProcessByStdio<null, Readable, null>;
245
+ function spawn(
246
+ command: string,
247
+ args: ReadonlyArray<string>,
248
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
249
+ ): ChildProcessByStdio<null, null, Readable>;
250
+ function spawn(
251
+ command: string,
252
+ args: ReadonlyArray<string>,
253
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
254
+ ): ChildProcessByStdio<null, null, null>;
255
+
256
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
257
+
258
+ interface ExecOptions extends CommonOptions {
259
+ shell?: string | undefined;
260
+ maxBuffer?: number | undefined;
261
+ killSignal?: NodeJS.Signals | number | undefined;
262
+ }
263
+
264
+ interface ExecOptionsWithStringEncoding extends ExecOptions {
265
+ encoding: BufferEncoding;
266
+ }
267
+
268
+ interface ExecOptionsWithBufferEncoding extends ExecOptions {
269
+ encoding: string | null; // specify `null`.
270
+ }
271
+
272
+ interface ExecException extends Error {
273
+ cmd?: string | undefined;
274
+ killed?: boolean | undefined;
275
+ code?: number | undefined;
276
+ signal?: NodeJS.Signals | undefined;
277
+ }
278
+
279
+ // no `options` definitely means stdout/stderr are `string`.
280
+ function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
281
+
282
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
283
+ function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
284
+
285
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
286
+ function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
287
+
288
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
289
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
290
+ function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
291
+
292
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
293
+ function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
294
+
295
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
296
+ function exec(
297
+ command: string,
298
+ options: ({ encoding?: string | null | undefined } & ExecOptions) | undefined | null,
299
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
300
+ ): ChildProcess;
301
+
302
+ interface PromiseWithChild<T> extends Promise<T> {
303
+ child: ChildProcess;
304
+ }
305
+
306
+ // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
307
+ namespace exec {
308
+ function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>;
309
+ function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
310
+ function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
311
+ function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
312
+ function __promisify__(command: string, options?: ({ encoding?: string | null | undefined } & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
313
+ }
314
+
315
+ interface ExecFileOptions extends CommonOptions {
316
+ maxBuffer?: number | undefined;
317
+ killSignal?: NodeJS.Signals | number | undefined;
318
+ windowsVerbatimArguments?: boolean | undefined;
319
+ shell?: boolean | string | undefined;
320
+ }
321
+ interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
322
+ encoding: BufferEncoding;
323
+ }
324
+ interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
325
+ encoding: 'buffer' | null;
326
+ }
327
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
328
+ encoding: string;
329
+ }
330
+
331
+ function execFile(file: string): ChildProcess;
332
+ function execFile(file: string, options: ({ encoding?: string | null | undefined } & ExecFileOptions) | undefined | null): ChildProcess;
333
+ function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
334
+ function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null | undefined } & ExecFileOptions) | undefined | null): ChildProcess;
335
+
336
+ // no `options` definitely means stdout/stderr are `string`.
337
+ function execFile(file: string, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
338
+ function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
339
+
340
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
341
+ function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
342
+ function execFile(
343
+ file: string,
344
+ args: ReadonlyArray<string> | undefined | null,
345
+ options: ExecFileOptionsWithBufferEncoding,
346
+ callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
347
+ ): ChildProcess;
348
+
349
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
350
+ function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
351
+ function execFile(
352
+ file: string,
353
+ args: ReadonlyArray<string> | undefined | null,
354
+ options: ExecFileOptionsWithStringEncoding,
355
+ callback: (error: ExecException | null, stdout: string, stderr: string) => void,
356
+ ): ChildProcess;
357
+
358
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
359
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
360
+ function execFile(
361
+ file: string,
362
+ options: ExecFileOptionsWithOtherEncoding,
363
+ callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
364
+ ): ChildProcess;
365
+ function execFile(
366
+ file: string,
367
+ args: ReadonlyArray<string> | undefined | null,
368
+ options: ExecFileOptionsWithOtherEncoding,
369
+ callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
370
+ ): ChildProcess;
371
+
372
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
373
+ function execFile(file: string, options: ExecFileOptions, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
374
+ function execFile(
375
+ file: string,
376
+ args: ReadonlyArray<string> | undefined | null,
377
+ options: ExecFileOptions,
378
+ callback: (error: ExecException | null, stdout: string, stderr: string) => void
379
+ ): ChildProcess;
380
+
381
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
382
+ function execFile(
383
+ file: string,
384
+ options: ({ encoding?: string | null | undefined } & ExecFileOptions) | undefined | null,
385
+ callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
386
+ ): ChildProcess;
387
+ function execFile(
388
+ file: string,
389
+ args: ReadonlyArray<string> | undefined | null,
390
+ options: ({ encoding?: string | null | undefined } & ExecFileOptions) | undefined | null,
391
+ callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
392
+ ): ChildProcess;
393
+
394
+ // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
395
+ namespace execFile {
396
+ function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>;
397
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
398
+ function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
399
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
400
+ function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
401
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
402
+ function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
403
+ function __promisify__(
404
+ file: string,
405
+ args: ReadonlyArray<string> | undefined | null,
406
+ options: ExecFileOptionsWithOtherEncoding,
407
+ ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
408
+ function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
409
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
410
+ function __promisify__(
411
+ file: string,
412
+ options: ({ encoding?: string | null | undefined } & ExecFileOptions) | undefined | null
413
+ ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
414
+ function __promisify__(
415
+ file: string,
416
+ args: ReadonlyArray<string> | undefined | null,
417
+ options: ({ encoding?: string | null | undefined } & ExecFileOptions) | undefined | null,
418
+ ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
419
+ }
420
+
421
+ interface ForkOptions extends ProcessEnvOptions, MessagingOptions {
422
+ execPath?: string | undefined;
423
+ execArgv?: string[] | undefined;
424
+ silent?: boolean | undefined;
425
+ stdio?: StdioOptions | undefined;
426
+ detached?: boolean | undefined;
427
+ windowsVerbatimArguments?: boolean | undefined;
428
+ }
429
+ function fork(modulePath: string, options?: ForkOptions): ChildProcess;
430
+ function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
431
+
432
+ interface SpawnSyncOptions extends CommonOptions {
433
+ argv0?: string | undefined; // Not specified in the docs
434
+ input?: string | NodeJS.ArrayBufferView | undefined;
435
+ stdio?: StdioOptions | undefined;
436
+ killSignal?: NodeJS.Signals | number | undefined;
437
+ maxBuffer?: number | undefined;
438
+ encoding?: string | undefined;
439
+ shell?: boolean | string | undefined;
440
+ windowsVerbatimArguments?: boolean | undefined;
441
+ }
442
+ interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
443
+ encoding: BufferEncoding;
444
+ }
445
+ interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
446
+ encoding: string; // specify `null`.
447
+ }
448
+ interface SpawnSyncReturns<T> {
449
+ pid: number;
450
+ output: Array<T | null>;
451
+ stdout: T;
452
+ stderr: T;
453
+ status: number | null;
454
+ signal: NodeJS.Signals | null;
455
+ error?: Error | undefined;
456
+ }
457
+ function spawnSync(command: string): SpawnSyncReturns<Buffer>;
458
+ function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
459
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
460
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
461
+ function spawnSync(command: string, args: ReadonlyArray<string>): SpawnSyncReturns<Buffer>;
462
+ function spawnSync(command: string, args: ReadonlyArray<string>, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
463
+ function spawnSync(command: string, args: ReadonlyArray<string>, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
464
+ function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
465
+
466
+ interface ExecSyncOptions extends CommonOptions {
467
+ input?: string | Uint8Array | undefined;
468
+ stdio?: StdioOptions | undefined;
469
+ shell?: string | undefined;
470
+ killSignal?: NodeJS.Signals | number | undefined;
471
+ maxBuffer?: number | undefined;
472
+ encoding?: string | undefined;
473
+ }
474
+ interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
475
+ encoding: BufferEncoding;
476
+ }
477
+ interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
478
+ encoding: string; // specify `null`.
479
+ }
480
+ function execSync(command: string): Buffer;
481
+ function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
482
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
483
+ function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
484
+
485
+ interface ExecFileSyncOptions extends CommonOptions {
486
+ input?: string | NodeJS.ArrayBufferView | undefined;
487
+ stdio?: StdioOptions | undefined;
488
+ killSignal?: NodeJS.Signals | number | undefined;
489
+ maxBuffer?: number | undefined;
490
+ encoding?: string | undefined;
491
+ shell?: boolean | string | undefined;
492
+ }
493
+ interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
494
+ encoding: BufferEncoding;
495
+ }
496
+ interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
497
+ encoding: string; // specify `null`.
498
+ }
499
+ function execFileSync(command: string): Buffer;
500
+ function execFileSync(command: string, options: ExecFileSyncOptionsWithStringEncoding): string;
501
+ function execFileSync(command: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
502
+ function execFileSync(command: string, options?: ExecFileSyncOptions): string | Buffer;
503
+ function execFileSync(command: string, args: ReadonlyArray<string>): Buffer;
504
+ function execFileSync(command: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithStringEncoding): string;
505
+ function execFileSync(command: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
506
+ function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): string | Buffer;
507
+ }