@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,1351 @@
1
+ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
2
+ interface Console {
3
+ Console: NodeJS.ConsoleConstructor;
4
+ /**
5
+ * A simple assertion test that verifies whether `value` is truthy.
6
+ * If it is not, an `AssertionError` is thrown.
7
+ * If provided, the error `message` is formatted using `util.format()` and used as the error message.
8
+ */
9
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
10
+ /**
11
+ * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
12
+ * When `stdout` is not a TTY, this method does nothing.
13
+ */
14
+ clear(): void;
15
+ /**
16
+ * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
17
+ */
18
+ count(label?: string): void;
19
+ /**
20
+ * Resets the internal counter specific to `label`.
21
+ */
22
+ countReset(label?: string): void;
23
+ /**
24
+ * The `console.debug()` function is an alias for {@link console.log}.
25
+ */
26
+ debug(message?: any, ...optionalParams: any[]): void;
27
+ /**
28
+ * Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
29
+ * This function bypasses any custom `inspect()` function defined on `obj`.
30
+ */
31
+ dir(obj: any, options?: NodeJS.InspectOptions): void;
32
+ /**
33
+ * This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
34
+ */
35
+ dirxml(...data: any[]): void;
36
+ /**
37
+ * Prints to `stderr` with newline.
38
+ */
39
+ error(message?: any, ...optionalParams: any[]): void;
40
+ /**
41
+ * Increases indentation of subsequent lines by two spaces.
42
+ * If one or more `label`s are provided, those are printed first without the additional indentation.
43
+ */
44
+ group(...label: any[]): void;
45
+ /**
46
+ * The `console.groupCollapsed()` function is an alias for {@link console.group}.
47
+ */
48
+ groupCollapsed(...label: any[]): void;
49
+ /**
50
+ * Decreases indentation of subsequent lines by two spaces.
51
+ */
52
+ groupEnd(): void;
53
+ /**
54
+ * The {@link console.info} function is an alias for {@link console.log}.
55
+ */
56
+ info(message?: any, ...optionalParams: any[]): void;
57
+ /**
58
+ * Prints to `stdout` with newline.
59
+ */
60
+ log(message?: any, ...optionalParams: any[]): void;
61
+ /**
62
+ * This method does not display anything unless used in the inspector.
63
+ * Prints to `stdout` the array `array` formatted as a table.
64
+ */
65
+ table(tabularData: any, properties?: ReadonlyArray<string>): void;
66
+ /**
67
+ * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
68
+ */
69
+ time(label?: string): void;
70
+ /**
71
+ * Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
72
+ */
73
+ timeEnd(label?: string): void;
74
+ /**
75
+ * For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
76
+ */
77
+ timeLog(label?: string, ...data: any[]): void;
78
+ /**
79
+ * Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
80
+ */
81
+ trace(message?: any, ...optionalParams: any[]): void;
82
+ /**
83
+ * The {@link console.warn} function is an alias for {@link console.error}.
84
+ */
85
+ warn(message?: any, ...optionalParams: any[]): void;
86
+
87
+ // --- Inspector mode only ---
88
+ /**
89
+ * This method does not display anything unless used in the inspector.
90
+ * The console.markTimeline() method is the deprecated form of console.timeStamp().
91
+ *
92
+ * @deprecated Use console.timeStamp() instead.
93
+ */
94
+ markTimeline(label?: string): void;
95
+ /**
96
+ * This method does not display anything unless used in the inspector.
97
+ * Starts a JavaScript CPU profile with an optional label.
98
+ */
99
+ profile(label?: string): void;
100
+ /**
101
+ * This method does not display anything unless used in the inspector.
102
+ * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
103
+ */
104
+ profileEnd(label?: string): void;
105
+ /**
106
+ * This method does not display anything unless used in the inspector.
107
+ * Adds an event with the label `label` to the Timeline panel of the inspector.
108
+ */
109
+ timeStamp(label?: string): void;
110
+ /**
111
+ * This method does not display anything unless used in the inspector.
112
+ * The console.timeline() method is the deprecated form of console.time().
113
+ *
114
+ * @deprecated Use console.time() instead.
115
+ */
116
+ timeline(label?: string): void;
117
+ /**
118
+ * This method does not display anything unless used in the inspector.
119
+ * The console.timelineEnd() method is the deprecated form of console.timeEnd().
120
+ *
121
+ * @deprecated Use console.timeEnd() instead.
122
+ */
123
+ timelineEnd(label?: string): void;
124
+ }
125
+
126
+ interface Error {
127
+ stack?: string | undefined;
128
+ }
129
+
130
+ // Declare "static" methods in Error
131
+ interface ErrorConstructor {
132
+ /** Create .stack property on a target object */
133
+ captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
134
+
135
+ /**
136
+ * Optional override for formatting stack traces
137
+ *
138
+ * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
139
+ */
140
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
141
+
142
+ stackTraceLimit: number;
143
+ }
144
+
145
+ interface SymbolConstructor {
146
+ readonly observable: symbol;
147
+ }
148
+
149
+ // Node.js ESNEXT support
150
+ interface String {
151
+ /** Removes whitespace from the left end of a string. */
152
+ trimLeft(): string;
153
+ /** Removes whitespace from the right end of a string. */
154
+ trimRight(): string;
155
+
156
+ /** Returns a copy with leading whitespace removed. */
157
+ trimStart(): string;
158
+ /** Returns a copy with trailing whitespace removed. */
159
+ trimEnd(): string;
160
+ }
161
+
162
+ interface ImportMeta {
163
+ url: string;
164
+ }
165
+
166
+ /*-----------------------------------------------*
167
+ * *
168
+ * GLOBAL *
169
+ * *
170
+ ------------------------------------------------*/
171
+ declare var process: NodeJS.Process;
172
+ declare var console: Console;
173
+
174
+ declare var __filename: string;
175
+ declare var __dirname: string;
176
+
177
+ declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
178
+ declare namespace setTimeout {
179
+ function __promisify__(ms: number): Promise<void>;
180
+ function __promisify__<T>(ms: number, value: T): Promise<T>;
181
+ }
182
+ declare function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
183
+ declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
184
+ declare function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
185
+ declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
186
+ declare namespace setImmediate {
187
+ function __promisify__(): Promise<void>;
188
+ function __promisify__<T>(value: T): Promise<T>;
189
+ }
190
+ declare function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
191
+
192
+ declare function queueMicrotask(callback: () => void): void;
193
+
194
+ // TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
195
+ interface NodeRequireFunction {
196
+ (id: string): any;
197
+ }
198
+
199
+ interface NodeRequireCache {
200
+ [path: string]: NodeModule;
201
+ }
202
+
203
+ interface NodeRequire extends NodeRequireFunction {
204
+ resolve: RequireResolve;
205
+ cache: NodeRequireCache;
206
+ /**
207
+ * @deprecated
208
+ */
209
+ extensions: NodeExtensions;
210
+ main: NodeModule | undefined;
211
+ }
212
+
213
+ interface RequireResolve {
214
+ (id: string, options?: { paths?: string[] | undefined; }): string;
215
+ paths(request: string): string[] | null;
216
+ }
217
+
218
+ interface NodeExtensions {
219
+ '.js': (m: NodeModule, filename: string) => any;
220
+ '.json': (m: NodeModule, filename: string) => any;
221
+ '.node': (m: NodeModule, filename: string) => any;
222
+ [ext: string]: (m: NodeModule, filename: string) => any;
223
+ }
224
+
225
+ declare var require: NodeRequire;
226
+
227
+ interface NodeModule {
228
+ exports: any;
229
+ require: NodeRequireFunction;
230
+ id: string;
231
+ filename: string;
232
+ loaded: boolean;
233
+ /** @deprecated since v12.19.0 Please use `require.main` and `module.children` instead. */
234
+ parent: NodeModule | null | undefined;
235
+ children: NodeModule[];
236
+ /**
237
+ * @since v11.14.0
238
+ *
239
+ * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
240
+ */
241
+ path: string;
242
+ paths: string[];
243
+ }
244
+
245
+ declare var module: NodeModule;
246
+
247
+ // Same as module.exports
248
+ declare var exports: any;
249
+
250
+ // Buffer class
251
+ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
252
+
253
+ interface Buffer {
254
+ constructor: typeof Buffer;
255
+ readBigUInt64BE(offset?: number): bigint;
256
+ /**
257
+ * @alias Buffer.readBigUInt64BE
258
+ * @since v12.19.0
259
+ */
260
+ readBigUint64BE(offset?: number): bigint;
261
+ readBigUInt64LE(offset?: number): bigint;
262
+ /**
263
+ * @alias Buffer.readBigUInt64LE
264
+ * @since v12.19.0
265
+ */
266
+ readBigUint64LE(offset?: number): bigint;
267
+ readBigInt64BE(offset?: number): bigint;
268
+ readBigInt64LE(offset?: number): bigint;
269
+ writeBigInt64BE(value: bigint, offset?: number): number;
270
+ writeBigInt64LE(value: bigint, offset?: number): number;
271
+ writeBigUInt64BE(value: bigint, offset?: number): number;
272
+ /**
273
+ * @alias Buffer.writeBigUInt64BE
274
+ * @since v12.19.0
275
+ */
276
+ writeBigUint64BE(value: bigint, offset?: number): number;
277
+ writeBigUInt64LE(value: bigint, offset?: number): number;
278
+ /**
279
+ * @alias Buffer.writeBigUInt64LE
280
+ * @since v12.19.0
281
+ */
282
+ writeBigUint64LE(value: bigint, offset?: number): number;
283
+ }
284
+
285
+ /**
286
+ * Raw data is stored in instances of the Buffer class.
287
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
288
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
289
+ */
290
+ declare class Buffer extends Uint8Array {
291
+ /**
292
+ * Allocates a new buffer containing the given {str}.
293
+ *
294
+ * @param str String to store in buffer.
295
+ * @param encoding encoding to use, optional. Default is 'utf8'
296
+ * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
297
+ */
298
+ constructor(str: string, encoding?: BufferEncoding);
299
+ /**
300
+ * Allocates a new buffer of {size} octets.
301
+ *
302
+ * @param size count of octets to allocate.
303
+ * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
304
+ */
305
+ constructor(size: number);
306
+ /**
307
+ * Allocates a new buffer containing the given {array} of octets.
308
+ *
309
+ * @param array The octets to store.
310
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
311
+ */
312
+ constructor(array: Uint8Array);
313
+ /**
314
+ * Produces a Buffer backed by the same allocated memory as
315
+ * the given {ArrayBuffer}/{SharedArrayBuffer}.
316
+ *
317
+ *
318
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
319
+ * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
320
+ */
321
+ constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer);
322
+ /**
323
+ * Allocates a new buffer containing the given {array} of octets.
324
+ *
325
+ * @param array The octets to store.
326
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
327
+ */
328
+ constructor(array: ReadonlyArray<any>);
329
+ /**
330
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
331
+ *
332
+ * @param buffer The buffer to copy.
333
+ * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
334
+ */
335
+ constructor(buffer: Buffer);
336
+ /**
337
+ * When passed a reference to the .buffer property of a TypedArray instance,
338
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
339
+ * The optional {byteOffset} and {length} arguments specify a memory range
340
+ * within the {arrayBuffer} that will be shared by the Buffer.
341
+ *
342
+ * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
343
+ */
344
+ static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
345
+ /**
346
+ * Creates a new Buffer using the passed {data}
347
+ * @param data data to create a new Buffer
348
+ */
349
+ static from(data: ReadonlyArray<number>): Buffer;
350
+ static from(data: Uint8Array): Buffer;
351
+ /**
352
+ * Creates a new buffer containing the coerced value of an object
353
+ * A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
354
+ * @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
355
+ */
356
+ static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
357
+ /**
358
+ * Creates a new Buffer containing the given JavaScript string {str}.
359
+ * If provided, the {encoding} parameter identifies the character encoding.
360
+ * If not provided, {encoding} defaults to 'utf8'.
361
+ */
362
+ static from(str: string, encoding?: BufferEncoding): Buffer;
363
+ /**
364
+ * Creates a new Buffer using the passed {data}
365
+ * @param values to create a new Buffer
366
+ */
367
+ static of(...items: number[]): Buffer;
368
+ /**
369
+ * Returns true if {obj} is a Buffer
370
+ *
371
+ * @param obj object to test.
372
+ */
373
+ static isBuffer(obj: any): obj is Buffer;
374
+ /**
375
+ * Returns true if {encoding} is a valid encoding argument.
376
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
377
+ *
378
+ * @param encoding string to test.
379
+ */
380
+ static isEncoding(encoding: string): encoding is BufferEncoding;
381
+ /**
382
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
383
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
384
+ *
385
+ * @param string string to test.
386
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
387
+ */
388
+ static byteLength(
389
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
390
+ encoding?: BufferEncoding
391
+ ): number;
392
+ /**
393
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
394
+ *
395
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
396
+ * If the list has exactly one item, then the first item of the list is returned.
397
+ * If the list has more than one item, then a new Buffer is created.
398
+ *
399
+ * @param list An array of Buffer objects to concatenate
400
+ * @param totalLength Total length of the buffers when concatenated.
401
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
402
+ */
403
+ static concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
404
+ /**
405
+ * The same as buf1.compare(buf2).
406
+ */
407
+ static compare(buf1: Uint8Array, buf2: Uint8Array): number;
408
+ /**
409
+ * Allocates a new buffer of {size} octets.
410
+ *
411
+ * @param size count of octets to allocate.
412
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
413
+ * If parameter is omitted, buffer will be filled with zeros.
414
+ * @param encoding encoding used for call to buf.fill while initalizing
415
+ */
416
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
417
+ /**
418
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
419
+ * of the newly created Buffer are unknown and may contain sensitive data.
420
+ *
421
+ * @param size count of octets to allocate
422
+ */
423
+ static allocUnsafe(size: number): Buffer;
424
+ /**
425
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
426
+ * of the newly created Buffer are unknown and may contain sensitive data.
427
+ *
428
+ * @param size count of octets to allocate
429
+ */
430
+ static allocUnsafeSlow(size: number): Buffer;
431
+ /**
432
+ * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.
433
+ */
434
+ static poolSize: number;
435
+
436
+ write(string: string, encoding?: BufferEncoding): number;
437
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
438
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
439
+ toString(encoding?: string, start?: number, end?: number): string;
440
+ toJSON(): { type: 'Buffer'; data: number[] };
441
+ equals(otherBuffer: Uint8Array): boolean;
442
+ compare(
443
+ otherBuffer: Uint8Array,
444
+ targetStart?: number,
445
+ targetEnd?: number,
446
+ sourceStart?: number,
447
+ sourceEnd?: number
448
+ ): number;
449
+ copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
450
+ /**
451
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
452
+ *
453
+ * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
454
+ *
455
+ * @param begin Where the new `Buffer` will start. Default: `0`.
456
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
457
+ */
458
+ slice(begin?: number, end?: number): Buffer;
459
+ /**
460
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
461
+ *
462
+ * This method is compatible with `Uint8Array#subarray()`.
463
+ *
464
+ * @param begin Where the new `Buffer` will start. Default: `0`.
465
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
466
+ */
467
+ subarray(begin?: number, end?: number): Buffer;
468
+ writeUIntLE(value: number, offset: number, byteLength: number): number;
469
+ /**
470
+ * @alias Buffer.writeUIntLE
471
+ * @since v12.19.0
472
+ */
473
+ writeUintLE(value: number, offset: number, byteLength: number): number;
474
+ writeUIntBE(value: number, offset: number, byteLength: number): number;
475
+ /**
476
+ * @alias Buffer.writeUIntBE
477
+ * @since v12.19.0
478
+ */
479
+ writeUintBE(value: number, offset: number, byteLength: number): number;
480
+ writeIntLE(value: number, offset: number, byteLength: number): number;
481
+ writeIntBE(value: number, offset: number, byteLength: number): number;
482
+ readUIntLE(offset: number, byteLength: number): number;
483
+ /**
484
+ * @alias Buffer.readUIntLE
485
+ * @since v12.19.0
486
+ */
487
+ readUintLE(offset: number, byteLength: number): number;
488
+ readUIntBE(offset: number, byteLength: number): number;
489
+ /**
490
+ * @alias Buffer.readUIntBE
491
+ * @since v12.19.0
492
+ */
493
+ readUintBE(offset: number, byteLength: number): number;
494
+ readIntLE(offset: number, byteLength: number): number;
495
+ readIntBE(offset: number, byteLength: number): number;
496
+ readUInt8(offset?: number): number;
497
+ /**
498
+ * @alias Buffer.readUInt8
499
+ * @since v12.19.0
500
+ */
501
+ readUint8(offset?: number): number;
502
+ readUInt16LE(offset?: number): number;
503
+ /**
504
+ * @alias Buffer.readUInt16LE
505
+ * @since v12.19.0
506
+ */
507
+ readUint16LE(offset?: number): number;
508
+ readUInt16BE(offset?: number): number;
509
+ /**
510
+ * @alias Buffer.readUInt16BE
511
+ * @since v12.19.0
512
+ */
513
+ readUint16BE(offset?: number): number;
514
+ readUInt32LE(offset?: number): number;
515
+ /**
516
+ * @alias Buffer.readUInt32LE
517
+ * @since v12.19.0
518
+ */
519
+ readUint32LE(offset?: number): number;
520
+ readUInt32BE(offset?: number): number;
521
+ /**
522
+ * @alias Buffer.readUInt32BE
523
+ * @since v12.19.0
524
+ */
525
+ readUint32BE(offset?: number): number;
526
+ readInt8(offset?: number): number;
527
+ readInt16LE(offset?: number): number;
528
+ readInt16BE(offset?: number): number;
529
+ readInt32LE(offset?: number): number;
530
+ readInt32BE(offset?: number): number;
531
+ readFloatLE(offset?: number): number;
532
+ readFloatBE(offset?: number): number;
533
+ readDoubleLE(offset?: number): number;
534
+ readDoubleBE(offset?: number): number;
535
+ reverse(): this;
536
+ swap16(): Buffer;
537
+ swap32(): Buffer;
538
+ swap64(): Buffer;
539
+ writeUInt8(value: number, offset?: number): number;
540
+ /**
541
+ * @alias Buffer.writeUInt8
542
+ * @since v12.19.0
543
+ */
544
+ writeUint8(value: number, offset?: number): number;
545
+ writeUInt16LE(value: number, offset?: number): number;
546
+ /**
547
+ * @alias Buffer.writeUInt16LE
548
+ * @since v12.19.0
549
+ */
550
+ writeUint16LE(value: number, offset?: number): number;
551
+ writeUInt16BE(value: number, offset?: number): number;
552
+ /**
553
+ * @alias Buffer.writeUInt16BE
554
+ * @since v12.19.0
555
+ */
556
+ writeUint16BE(value: number, offset?: number): number;
557
+ writeUInt32LE(value: number, offset?: number): number;
558
+ /**
559
+ * @alias Buffer.writeUInt32LE
560
+ * @since v12.19.0
561
+ */
562
+ writeUint32LE(value: number, offset?: number): number;
563
+ writeUInt32BE(value: number, offset?: number): number;
564
+ /**
565
+ * @alias Buffer.writeUInt32BE
566
+ * @since v12.19.0
567
+ */
568
+ writeUint32BE(value: number, offset?: number): number;
569
+ writeInt8(value: number, offset?: number): number;
570
+ writeInt16LE(value: number, offset?: number): number;
571
+ writeInt16BE(value: number, offset?: number): number;
572
+ writeInt32LE(value: number, offset?: number): number;
573
+ writeInt32BE(value: number, offset?: number): number;
574
+ writeFloatLE(value: number, offset?: number): number;
575
+ writeFloatBE(value: number, offset?: number): number;
576
+ writeDoubleLE(value: number, offset?: number): number;
577
+ writeDoubleBE(value: number, offset?: number): number;
578
+
579
+ fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
580
+
581
+ indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
582
+ lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
583
+ entries(): IterableIterator<[number, number]>;
584
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
585
+ keys(): IterableIterator<number>;
586
+ values(): IterableIterator<number>;
587
+ }
588
+
589
+ /*----------------------------------------------*
590
+ * *
591
+ * GLOBAL INTERFACES *
592
+ * *
593
+ *-----------------------------------------------*/
594
+ declare namespace NodeJS {
595
+ interface InspectOptions {
596
+ /**
597
+ * If set to `true`, getters are going to be
598
+ * inspected as well. If set to `'get'` only getters without setter are going
599
+ * to be inspected. If set to `'set'` only getters having a corresponding
600
+ * setter are going to be inspected. This might cause side effects depending on
601
+ * the getter function.
602
+ * @default `false`
603
+ */
604
+ getters?: 'get' | 'set' | boolean | undefined;
605
+ showHidden?: boolean | undefined;
606
+ /**
607
+ * @default 2
608
+ */
609
+ depth?: number | null | undefined;
610
+ colors?: boolean | undefined;
611
+ customInspect?: boolean | undefined;
612
+ showProxy?: boolean | undefined;
613
+ maxArrayLength?: number | null | undefined;
614
+ breakLength?: number | undefined;
615
+ /**
616
+ * Setting this to `false` causes each object key
617
+ * to be displayed on a new line. It will also add new lines to text that is
618
+ * longer than `breakLength`. If set to a number, the most `n` inner elements
619
+ * are united on a single line as long as all properties fit into
620
+ * `breakLength`. Short array elements are also grouped together. Note that no
621
+ * text will be reduced below 16 characters, no matter the `breakLength` size.
622
+ * For more information, see the example below.
623
+ * @default `true`
624
+ */
625
+ compact?: boolean | number | undefined;
626
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
627
+ }
628
+
629
+ interface ConsoleConstructorOptions {
630
+ stdout: WritableStream;
631
+ stderr?: WritableStream | undefined;
632
+ ignoreErrors?: boolean | undefined;
633
+ colorMode?: boolean | 'auto' | undefined;
634
+ inspectOptions?: InspectOptions | undefined;
635
+ /**
636
+ * Set group indentation
637
+ * @default 2
638
+ */
639
+ groupIndentation?: number | undefined;
640
+ }
641
+
642
+ interface ConsoleConstructor {
643
+ prototype: Console;
644
+ new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
645
+ new(options: ConsoleConstructorOptions): Console;
646
+ }
647
+
648
+ interface CallSite {
649
+ /**
650
+ * Value of "this"
651
+ */
652
+ getThis(): any;
653
+
654
+ /**
655
+ * Type of "this" as a string.
656
+ * This is the name of the function stored in the constructor field of
657
+ * "this", if available. Otherwise the object's [[Class]] internal
658
+ * property.
659
+ */
660
+ getTypeName(): string | null;
661
+
662
+ /**
663
+ * Current function
664
+ */
665
+ getFunction(): Function | undefined;
666
+
667
+ /**
668
+ * Name of the current function, typically its name property.
669
+ * If a name property is not available an attempt will be made to try
670
+ * to infer a name from the function's context.
671
+ */
672
+ getFunctionName(): string | null;
673
+
674
+ /**
675
+ * Name of the property [of "this" or one of its prototypes] that holds
676
+ * the current function
677
+ */
678
+ getMethodName(): string | null;
679
+
680
+ /**
681
+ * Name of the script [if this function was defined in a script]
682
+ */
683
+ getFileName(): string | null;
684
+
685
+ /**
686
+ * Current line number [if this function was defined in a script]
687
+ */
688
+ getLineNumber(): number | null;
689
+
690
+ /**
691
+ * Current column number [if this function was defined in a script]
692
+ */
693
+ getColumnNumber(): number | null;
694
+
695
+ /**
696
+ * A call site object representing the location where eval was called
697
+ * [if this function was created using a call to eval]
698
+ */
699
+ getEvalOrigin(): string | undefined;
700
+
701
+ /**
702
+ * Is this a toplevel invocation, that is, is "this" the global object?
703
+ */
704
+ isToplevel(): boolean;
705
+
706
+ /**
707
+ * Does this call take place in code defined by a call to eval?
708
+ */
709
+ isEval(): boolean;
710
+
711
+ /**
712
+ * Is this call in native V8 code?
713
+ */
714
+ isNative(): boolean;
715
+
716
+ /**
717
+ * Is this a constructor call?
718
+ */
719
+ isConstructor(): boolean;
720
+ }
721
+
722
+ interface ErrnoException extends Error {
723
+ errno?: number | undefined;
724
+ code?: string | undefined;
725
+ path?: string | undefined;
726
+ syscall?: string | undefined;
727
+ }
728
+
729
+ class EventEmitter {
730
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
731
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
732
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
733
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
734
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
735
+ removeAllListeners(event?: string | symbol): this;
736
+ setMaxListeners(n: number): this;
737
+ getMaxListeners(): number;
738
+ listeners(event: string | symbol): Function[];
739
+ rawListeners(event: string | symbol): Function[];
740
+ emit(event: string | symbol, ...args: any[]): boolean;
741
+ listenerCount(type: string | symbol): number;
742
+ // Added in Node 6...
743
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
744
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
745
+ eventNames(): Array<string | symbol>;
746
+ }
747
+
748
+ interface ReadableStream extends EventEmitter {
749
+ readable: boolean;
750
+ read(size?: number): string | Buffer;
751
+ setEncoding(encoding: string): this;
752
+ pause(): this;
753
+ resume(): this;
754
+ isPaused(): boolean;
755
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
756
+ unpipe(destination?: WritableStream): this;
757
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
758
+ wrap(oldStream: ReadableStream): this;
759
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
760
+ }
761
+
762
+ interface WritableStream extends EventEmitter {
763
+ writable: boolean;
764
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
765
+ write(str: string, encoding?: string, cb?: (err?: Error | null) => void): boolean;
766
+ end(cb?: () => void): this;
767
+ end(data: string | Uint8Array, cb?: () => void): this;
768
+ end(str: string, encoding?: string, cb?: () => void): this;
769
+ }
770
+
771
+ interface ReadWriteStream extends ReadableStream, WritableStream { }
772
+
773
+ interface Domain extends EventEmitter {
774
+ run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
775
+ add(emitter: EventEmitter | Timer): void;
776
+ remove(emitter: EventEmitter | Timer): void;
777
+ bind<T extends Function>(cb: T): T;
778
+ intercept<T extends Function>(cb: T): T;
779
+
780
+ addListener(event: string, listener: (...args: any[]) => void): this;
781
+ on(event: string, listener: (...args: any[]) => void): this;
782
+ once(event: string, listener: (...args: any[]) => void): this;
783
+ removeListener(event: string, listener: (...args: any[]) => void): this;
784
+ removeAllListeners(event?: string): this;
785
+ }
786
+
787
+ interface MemoryUsage {
788
+ rss: number;
789
+ heapTotal: number;
790
+ heapUsed: number;
791
+ external: number;
792
+ }
793
+
794
+ interface CpuUsage {
795
+ user: number;
796
+ system: number;
797
+ }
798
+
799
+ interface ProcessRelease {
800
+ name: string;
801
+ sourceUrl?: string | undefined;
802
+ headersUrl?: string | undefined;
803
+ libUrl?: string | undefined;
804
+ lts?: string | undefined;
805
+ }
806
+
807
+ interface ProcessVersions {
808
+ http_parser: string;
809
+ node: string;
810
+ v8: string;
811
+ ares: string;
812
+ uv: string;
813
+ zlib: string;
814
+ modules: string;
815
+ openssl: string;
816
+ }
817
+
818
+ type Platform = 'aix'
819
+ | 'android'
820
+ | 'darwin'
821
+ | 'freebsd'
822
+ | 'linux'
823
+ | 'openbsd'
824
+ | 'sunos'
825
+ | 'win32'
826
+ | 'cygwin'
827
+ | 'netbsd';
828
+
829
+ type Signals =
830
+ "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
831
+ "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" |
832
+ "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
833
+ "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
834
+
835
+ type MultipleResolveType = 'resolve' | 'reject';
836
+
837
+ type BeforeExitListener = (code: number) => void;
838
+ type DisconnectListener = () => void;
839
+ type ExitListener = (code: number) => void;
840
+ type RejectionHandledListener = (promise: Promise<any>) => void;
841
+ type UncaughtExceptionListener = (error: Error) => void;
842
+ type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
843
+ type WarningListener = (warning: Error) => void;
844
+ type MessageListener = (message: any, sendHandle: any) => void;
845
+ type SignalsListener = (signal: Signals) => void;
846
+ type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
847
+ type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
848
+ type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
849
+
850
+ interface Socket extends ReadWriteStream {
851
+ isTTY?: true | undefined;
852
+ }
853
+
854
+ interface ProcessEnv {
855
+ [key: string]: string | undefined;
856
+ }
857
+
858
+ interface HRTime {
859
+ (time?: [number, number]): [number, number];
860
+ bigint(): bigint;
861
+ }
862
+
863
+ interface ProcessReport {
864
+ /**
865
+ * Directory where the report is written.
866
+ * working directory of the Node.js process.
867
+ * @default '' indicating that reports are written to the current
868
+ */
869
+ directory: string;
870
+
871
+ /**
872
+ * Filename where the report is written.
873
+ * The default value is the empty string.
874
+ * @default '' the output filename will be comprised of a timestamp,
875
+ * PID, and sequence number.
876
+ */
877
+ filename: string;
878
+
879
+ /**
880
+ * Returns a JSON-formatted diagnostic report for the running process.
881
+ * The report's JavaScript stack trace is taken from err, if present.
882
+ */
883
+ getReport(err?: Error): string;
884
+
885
+ /**
886
+ * If true, a diagnostic report is generated on fatal errors,
887
+ * such as out of memory errors or failed C++ assertions.
888
+ * @default false
889
+ */
890
+ reportOnFatalError: boolean;
891
+
892
+ /**
893
+ * If true, a diagnostic report is generated when the process
894
+ * receives the signal specified by process.report.signal.
895
+ * @default false
896
+ */
897
+ reportOnSignal: boolean;
898
+
899
+ /**
900
+ * If true, a diagnostic report is generated on uncaught exception.
901
+ * @default false
902
+ */
903
+ reportOnUncaughtException: boolean;
904
+
905
+ /**
906
+ * The signal used to trigger the creation of a diagnostic report.
907
+ * @default 'SIGUSR2'
908
+ */
909
+ signal: Signals;
910
+
911
+ /**
912
+ * Writes a diagnostic report to a file. If filename is not provided, the default filename
913
+ * includes the date, time, PID, and a sequence number.
914
+ * The report's JavaScript stack trace is taken from err, if present.
915
+ *
916
+ * @param fileName Name of the file where the report is written.
917
+ * This should be a relative path, that will be appended to the directory specified in
918
+ * `process.report.directory`, or the current working directory of the Node.js process,
919
+ * if unspecified.
920
+ * @param error A custom error used for reporting the JavaScript stack.
921
+ * @return Filename of the generated report.
922
+ */
923
+ writeReport(fileName?: string): string;
924
+ writeReport(error?: Error): string;
925
+ writeReport(fileName?: string, err?: Error): string;
926
+ }
927
+
928
+ interface ResourceUsage {
929
+ fsRead: number;
930
+ fsWrite: number;
931
+ involuntaryContextSwitches: number;
932
+ ipcReceived: number;
933
+ ipcSent: number;
934
+ majorPageFault: number;
935
+ maxRSS: number;
936
+ minorPageFault: number;
937
+ sharedMemorySize: number;
938
+ signalsCount: number;
939
+ swappedOut: number;
940
+ systemCPUTime: number;
941
+ unsharedDataSize: number;
942
+ unsharedStackSize: number;
943
+ userCPUTime: number;
944
+ voluntaryContextSwitches: number;
945
+ }
946
+
947
+ interface EmitWarningOptions {
948
+ /**
949
+ * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
950
+ *
951
+ * @default 'Warning'
952
+ */
953
+ type?: string | undefined;
954
+
955
+ /**
956
+ * A unique identifier for the warning instance being emitted.
957
+ */
958
+ code?: string | undefined;
959
+
960
+ /**
961
+ * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
962
+ *
963
+ * @default process.emitWarning
964
+ */
965
+ ctor?: Function | undefined;
966
+
967
+ /**
968
+ * Additional text to include with the error.
969
+ */
970
+ detail?: string | undefined;
971
+ }
972
+
973
+ interface Process extends EventEmitter {
974
+ /**
975
+ * Can also be a tty.WriteStream, not typed due to limitation.s
976
+ */
977
+ stdout: WriteStream;
978
+ /**
979
+ * Can also be a tty.WriteStream, not typed due to limitation.s
980
+ */
981
+ stderr: WriteStream;
982
+ stdin: ReadStream;
983
+ openStdin(): Socket;
984
+ argv: string[];
985
+ argv0: string;
986
+ execArgv: string[];
987
+ execPath: string;
988
+ abort(): never;
989
+ chdir(directory: string): void;
990
+ cwd(): string;
991
+ debugPort: number;
992
+
993
+ /**
994
+ * The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
995
+ *
996
+ * These can be listened for by adding a handler to the `'warning'` event.
997
+ *
998
+ * @param warning The warning to emit.
999
+ * @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
1000
+ * @param code A unique identifier for the warning instance being emitted.
1001
+ * @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
1002
+ */
1003
+ emitWarning(warning: string | Error, ctor?: Function): void;
1004
+ emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
1005
+ emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
1006
+ emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
1007
+
1008
+ env: ProcessEnv;
1009
+ exit(code?: number): never;
1010
+ exitCode?: number | undefined;
1011
+ getgid(): number;
1012
+ setgid(id: number | string): void;
1013
+ getuid(): number;
1014
+ setuid(id: number | string): void;
1015
+ geteuid(): number;
1016
+ seteuid(id: number | string): void;
1017
+ getegid(): number;
1018
+ setegid(id: number | string): void;
1019
+ getgroups(): number[];
1020
+ setgroups(groups: ReadonlyArray<string | number>): void;
1021
+ setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
1022
+ hasUncaughtExceptionCaptureCallback(): boolean;
1023
+ version: string;
1024
+ versions: ProcessVersions;
1025
+ config: {
1026
+ target_defaults: {
1027
+ cflags: any[];
1028
+ default_configuration: string;
1029
+ defines: string[];
1030
+ include_dirs: string[];
1031
+ libraries: string[];
1032
+ };
1033
+ variables: {
1034
+ clang: number;
1035
+ host_arch: string;
1036
+ node_install_npm: boolean;
1037
+ node_install_waf: boolean;
1038
+ node_prefix: string;
1039
+ node_shared_openssl: boolean;
1040
+ node_shared_v8: boolean;
1041
+ node_shared_zlib: boolean;
1042
+ node_use_dtrace: boolean;
1043
+ node_use_etw: boolean;
1044
+ node_use_openssl: boolean;
1045
+ target_arch: string;
1046
+ v8_no_strict_aliasing: number;
1047
+ v8_use_snapshot: boolean;
1048
+ visibility: string;
1049
+ };
1050
+ };
1051
+ kill(pid: number, signal?: string | number): true;
1052
+ pid: number;
1053
+ ppid: number;
1054
+ title: string;
1055
+ arch: string;
1056
+ platform: Platform;
1057
+ mainModule?: NodeModule | undefined;
1058
+ memoryUsage(): MemoryUsage;
1059
+ cpuUsage(previousValue?: CpuUsage): CpuUsage;
1060
+ nextTick(callback: Function, ...args: any[]): void;
1061
+ release: ProcessRelease;
1062
+ features: {
1063
+ inspector: boolean;
1064
+ debug: boolean;
1065
+ uv: boolean;
1066
+ ipv6: boolean;
1067
+ tls_alpn: boolean;
1068
+ tls_sni: boolean;
1069
+ tls_ocsp: boolean;
1070
+ tls: boolean;
1071
+ };
1072
+ /**
1073
+ * @deprecated since v12.19.0 - Calling process.umask() with no argument causes
1074
+ * the process-wide umask to be written twice. This introduces a race condition between threads,
1075
+ * and is a potential security vulnerability. There is no safe, cross-platform alternative API.
1076
+ */
1077
+ umask(): number;
1078
+ /**
1079
+ * Can only be set if not in worker thread.
1080
+ */
1081
+ umask(mask: string | number): number;
1082
+ uptime(): number;
1083
+ hrtime: HRTime;
1084
+ domain: Domain;
1085
+
1086
+ // Worker
1087
+ send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean | undefined}, callback?: (error: Error | null) => void): boolean;
1088
+ disconnect(): void;
1089
+ connected: boolean;
1090
+
1091
+ /**
1092
+ * The `process.allowedNodeEnvironmentFlags` property is a special,
1093
+ * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][]
1094
+ * environment variable.
1095
+ */
1096
+ allowedNodeEnvironmentFlags: ReadonlySet<string>;
1097
+
1098
+ /**
1099
+ * Only available with `--experimental-report`
1100
+ */
1101
+ report?: ProcessReport | undefined;
1102
+
1103
+ resourceUsage(): ResourceUsage;
1104
+
1105
+ /**
1106
+ * EventEmitter
1107
+ * 1. beforeExit
1108
+ * 2. disconnect
1109
+ * 3. exit
1110
+ * 4. message
1111
+ * 5. rejectionHandled
1112
+ * 6. uncaughtException
1113
+ * 7. unhandledRejection
1114
+ * 8. warning
1115
+ * 9. message
1116
+ * 10. <All OS Signals>
1117
+ * 11. newListener/removeListener inherited from EventEmitter
1118
+ */
1119
+ addListener(event: "beforeExit", listener: BeforeExitListener): this;
1120
+ addListener(event: "disconnect", listener: DisconnectListener): this;
1121
+ addListener(event: "exit", listener: ExitListener): this;
1122
+ addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
1123
+ addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1124
+ addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1125
+ addListener(event: "warning", listener: WarningListener): this;
1126
+ addListener(event: "message", listener: MessageListener): this;
1127
+ addListener(event: Signals, listener: SignalsListener): this;
1128
+ addListener(event: "newListener", listener: NewListenerListener): this;
1129
+ addListener(event: "removeListener", listener: RemoveListenerListener): this;
1130
+ addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1131
+
1132
+ emit(event: "beforeExit", code: number): boolean;
1133
+ emit(event: "disconnect"): boolean;
1134
+ emit(event: "exit", code: number): boolean;
1135
+ emit(event: "rejectionHandled", promise: Promise<any>): boolean;
1136
+ emit(event: "uncaughtException", error: Error): boolean;
1137
+ emit(event: "unhandledRejection", reason: any, promise: Promise<any>): boolean;
1138
+ emit(event: "warning", warning: Error): boolean;
1139
+ emit(event: "message", message: any, sendHandle: any): this;
1140
+ emit(event: Signals, signal: Signals): boolean;
1141
+ emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
1142
+ emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
1143
+ emit(event: "multipleResolves", listener: MultipleResolveListener): this;
1144
+
1145
+ on(event: "beforeExit", listener: BeforeExitListener): this;
1146
+ on(event: "disconnect", listener: DisconnectListener): this;
1147
+ on(event: "exit", listener: ExitListener): this;
1148
+ on(event: "rejectionHandled", listener: RejectionHandledListener): this;
1149
+ on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1150
+ on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1151
+ on(event: "warning", listener: WarningListener): this;
1152
+ on(event: "message", listener: MessageListener): this;
1153
+ on(event: Signals, listener: SignalsListener): this;
1154
+ on(event: "newListener", listener: NewListenerListener): this;
1155
+ on(event: "removeListener", listener: RemoveListenerListener): this;
1156
+ on(event: "multipleResolves", listener: MultipleResolveListener): this;
1157
+
1158
+ once(event: "beforeExit", listener: BeforeExitListener): this;
1159
+ once(event: "disconnect", listener: DisconnectListener): this;
1160
+ once(event: "exit", listener: ExitListener): this;
1161
+ once(event: "rejectionHandled", listener: RejectionHandledListener): this;
1162
+ once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1163
+ once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1164
+ once(event: "warning", listener: WarningListener): this;
1165
+ once(event: "message", listener: MessageListener): this;
1166
+ once(event: Signals, listener: SignalsListener): this;
1167
+ once(event: "newListener", listener: NewListenerListener): this;
1168
+ once(event: "removeListener", listener: RemoveListenerListener): this;
1169
+ once(event: "multipleResolves", listener: MultipleResolveListener): this;
1170
+
1171
+ prependListener(event: "beforeExit", listener: BeforeExitListener): this;
1172
+ prependListener(event: "disconnect", listener: DisconnectListener): this;
1173
+ prependListener(event: "exit", listener: ExitListener): this;
1174
+ prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
1175
+ prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1176
+ prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1177
+ prependListener(event: "warning", listener: WarningListener): this;
1178
+ prependListener(event: "message", listener: MessageListener): this;
1179
+ prependListener(event: Signals, listener: SignalsListener): this;
1180
+ prependListener(event: "newListener", listener: NewListenerListener): this;
1181
+ prependListener(event: "removeListener", listener: RemoveListenerListener): this;
1182
+ prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1183
+
1184
+ prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
1185
+ prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
1186
+ prependOnceListener(event: "exit", listener: ExitListener): this;
1187
+ prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
1188
+ prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1189
+ prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1190
+ prependOnceListener(event: "warning", listener: WarningListener): this;
1191
+ prependOnceListener(event: "message", listener: MessageListener): this;
1192
+ prependOnceListener(event: Signals, listener: SignalsListener): this;
1193
+ prependOnceListener(event: "newListener", listener: NewListenerListener): this;
1194
+ prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
1195
+ prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1196
+
1197
+ listeners(event: "beforeExit"): BeforeExitListener[];
1198
+ listeners(event: "disconnect"): DisconnectListener[];
1199
+ listeners(event: "exit"): ExitListener[];
1200
+ listeners(event: "rejectionHandled"): RejectionHandledListener[];
1201
+ listeners(event: "uncaughtException"): UncaughtExceptionListener[];
1202
+ listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
1203
+ listeners(event: "warning"): WarningListener[];
1204
+ listeners(event: "message"): MessageListener[];
1205
+ listeners(event: Signals): SignalsListener[];
1206
+ listeners(event: "newListener"): NewListenerListener[];
1207
+ listeners(event: "removeListener"): RemoveListenerListener[];
1208
+ listeners(event: "multipleResolves"): MultipleResolveListener[];
1209
+ }
1210
+
1211
+ interface Global {
1212
+ Array: typeof Array;
1213
+ ArrayBuffer: typeof ArrayBuffer;
1214
+ Boolean: typeof Boolean;
1215
+ Buffer: typeof Buffer;
1216
+ DataView: typeof DataView;
1217
+ Date: typeof Date;
1218
+ Error: typeof Error;
1219
+ EvalError: typeof EvalError;
1220
+ Float32Array: typeof Float32Array;
1221
+ Float64Array: typeof Float64Array;
1222
+ Function: typeof Function;
1223
+ GLOBAL: Global;
1224
+ Infinity: typeof Infinity;
1225
+ Int16Array: typeof Int16Array;
1226
+ Int32Array: typeof Int32Array;
1227
+ Int8Array: typeof Int8Array;
1228
+ Intl: typeof Intl;
1229
+ JSON: typeof JSON;
1230
+ Map: MapConstructor;
1231
+ Math: typeof Math;
1232
+ NaN: typeof NaN;
1233
+ Number: typeof Number;
1234
+ Object: typeof Object;
1235
+ Promise: Function;
1236
+ RangeError: typeof RangeError;
1237
+ ReferenceError: typeof ReferenceError;
1238
+ RegExp: typeof RegExp;
1239
+ Set: SetConstructor;
1240
+ String: typeof String;
1241
+ Symbol: Function;
1242
+ SyntaxError: typeof SyntaxError;
1243
+ TypeError: typeof TypeError;
1244
+ URIError: typeof URIError;
1245
+ Uint16Array: typeof Uint16Array;
1246
+ Uint32Array: typeof Uint32Array;
1247
+ Uint8Array: typeof Uint8Array;
1248
+ Uint8ClampedArray: Function;
1249
+ WeakMap: WeakMapConstructor;
1250
+ WeakSet: WeakSetConstructor;
1251
+ clearImmediate: (immediateId: Immediate) => void;
1252
+ clearInterval: (intervalId: Timeout | string | number) => void;
1253
+ clearTimeout: (timeoutId: Timeout | string | number) => void;
1254
+ console: typeof console;
1255
+ decodeURI: typeof decodeURI;
1256
+ decodeURIComponent: typeof decodeURIComponent;
1257
+ encodeURI: typeof encodeURI;
1258
+ encodeURIComponent: typeof encodeURIComponent;
1259
+ escape: (str: string) => string;
1260
+ eval: typeof eval;
1261
+ global: Global;
1262
+ isFinite: typeof isFinite;
1263
+ isNaN: typeof isNaN;
1264
+ parseFloat: typeof parseFloat;
1265
+ parseInt: typeof parseInt;
1266
+ process: Process;
1267
+ root: Global;
1268
+ setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
1269
+ setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
1270
+ setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
1271
+ queueMicrotask: typeof queueMicrotask;
1272
+ undefined: typeof undefined;
1273
+ unescape: (str: string) => string;
1274
+ gc: () => void;
1275
+ v8debug?: any;
1276
+ }
1277
+
1278
+ // compatibility with older typings
1279
+ interface Timer {
1280
+ hasRef(): boolean;
1281
+ ref(): this;
1282
+ refresh(): this;
1283
+ unref(): this;
1284
+ [Symbol.toPrimitive](): number;
1285
+ }
1286
+
1287
+ class Immediate {
1288
+ hasRef(): boolean;
1289
+ ref(): this;
1290
+ unref(): this;
1291
+ _onImmediate: Function; // to distinguish it from the Timeout class
1292
+ }
1293
+
1294
+ class Timeout implements Timer {
1295
+ hasRef(): boolean;
1296
+ ref(): this;
1297
+ refresh(): this;
1298
+ unref(): this;
1299
+ [Symbol.toPrimitive](): number;
1300
+ }
1301
+
1302
+ class Module {
1303
+ static runMain(): void;
1304
+ static wrap(code: string): string;
1305
+
1306
+ /**
1307
+ * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
1308
+ */
1309
+ static createRequireFromPath(path: string): NodeRequire;
1310
+ static createRequire(path: string): NodeRequire;
1311
+ static builtinModules: string[];
1312
+
1313
+ static Module: typeof Module;
1314
+
1315
+ exports: any;
1316
+ require: NodeRequireFunction;
1317
+ id: string;
1318
+ filename: string;
1319
+ loaded: boolean;
1320
+ /** @deprecated since v12.19.0 Please use `require.main` and `module.children` instead. */
1321
+ parent: Module | null | undefined;
1322
+ children: Module[];
1323
+ /**
1324
+ * @since v11.14.0
1325
+ *
1326
+ * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
1327
+ */
1328
+ path: string;
1329
+ paths: string[];
1330
+
1331
+ constructor(id: string, parent?: Module);
1332
+ }
1333
+
1334
+ interface Dict<T> {
1335
+ [key: string]: T | undefined;
1336
+ }
1337
+
1338
+ type TypedArray =
1339
+ | Uint8Array
1340
+ | Uint8ClampedArray
1341
+ | Uint16Array
1342
+ | Uint32Array
1343
+ | Int8Array
1344
+ | Int16Array
1345
+ | Int32Array
1346
+ | BigUint64Array
1347
+ | BigInt64Array
1348
+ | Float32Array
1349
+ | Float64Array;
1350
+ type ArrayBufferView = TypedArray | DataView;
1351
+ }