ADAPT-Chase commited on
Commit
de47658
·
verified ·
1 Parent(s): b7e82f0

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.d.ts +5 -0
  2. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.d.ts.map +1 -0
  3. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.js +21 -0
  4. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.js.map +1 -0
  5. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.mjs +2 -0
  6. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.mjs.map +1 -0
  7. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.d.ts +5 -0
  8. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.d.ts.map +1 -0
  9. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.js +21 -0
  10. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.js.map +1 -0
  11. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.mjs +2 -0
  12. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.mjs.map +1 -0
  13. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.d.ts +5 -0
  14. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.d.ts.map +1 -0
  15. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.js +21 -0
  16. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.js.map +1 -0
  17. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.mjs +2 -0
  18. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.mjs.map +1 -0
  19. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.d.ts +5 -0
  20. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.d.ts.map +1 -0
  21. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.js +21 -0
  22. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.js.map +1 -0
  23. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.mjs +2 -0
  24. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.mjs.map +1 -0
  25. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types.d.ts +101 -0
  26. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types.js +3 -0
  27. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types.mjs +3 -0
  28. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/assert/strict.d.ts +8 -0
  29. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  30. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/index.d.ts +9 -0
  31. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  32. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  33. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/dns/promises.d.ts +477 -0
  34. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/fs/promises.d.ts +1208 -0
  35. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/readline/promises.d.ts +154 -0
  36. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/stream/consumers.d.ts +38 -0
  37. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/stream/promises.d.ts +90 -0
  38. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/stream/web.d.ts +523 -0
  39. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/string_decoder.d.ts +67 -0
  40. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/test.d.ts +1208 -0
  41. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/timers.d.ts +286 -0
  42. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/timers/promises.d.ts +108 -0
  43. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/tls.d.ts +1204 -0
  44. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/trace_events.d.ts +171 -0
  45. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +455 -0
  46. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  47. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/ts5.6/index.d.ts +90 -0
  48. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/tty.d.ts +206 -0
  49. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/url.d.ts +957 -0
  50. novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/util.d.ts +2083 -0
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../bun-runtime.js";
5
+ //# sourceMappingURL=runtime-bun.d.ts.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../bun-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-bun.js.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.mjs ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ export * from "../bun-runtime.mjs";
2
+ //# sourceMappingURL=runtime-bun.mjs.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-bun.mjs.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-runtime.js";
5
+ //# sourceMappingURL=runtime-node.d.ts.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-node.js.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.mjs ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ export * from "../node-runtime.mjs";
2
+ //# sourceMappingURL=runtime-node.mjs.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime-node.mjs.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../web-runtime.js";
5
+ //# sourceMappingURL=runtime.d.ts.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../web-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime.js.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.mjs ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ export * from "../web-runtime.mjs";
2
+ //# sourceMappingURL=runtime.mjs.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/runtime.mjs.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"runtime.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":""}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-types.js";
5
+ //# sourceMappingURL=types-node.d.ts.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"types-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,eAAe,CAAC"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-types.js"), exports);
21
+ //# sourceMappingURL=types-node.js.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"types-node.js","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,mDAA8B"}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.mjs ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ export * from "../node-types.mjs";
2
+ //# sourceMappingURL=types-node.mjs.map
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types-node.mjs.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"types-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":""}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types.d.ts ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export type Agent = any;
5
+
6
+ // @ts-ignore
7
+ declare const _fetch: unknown extends typeof fetch ? never : typeof fetch;
8
+ export { _fetch as fetch };
9
+
10
+ // @ts-ignore
11
+ type _Request = unknown extends Request ? never : Request;
12
+ export { _Request as Request };
13
+
14
+ // @ts-ignore
15
+ type _RequestInfo = unknown extends RequestInfo ? never : RequestInfo;
16
+ export { type _RequestInfo as RequestInfo };
17
+
18
+ // @ts-ignore
19
+ type _RequestInit = unknown extends RequestInit ? never : RequestInit;
20
+ export { type _RequestInit as RequestInit };
21
+
22
+ // @ts-ignore
23
+ type _Response = unknown extends Response ? never : Response;
24
+ export { _Response as Response };
25
+
26
+ // @ts-ignore
27
+ type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
28
+ export { type _ResponseInit as ResponseInit };
29
+
30
+ // @ts-ignore
31
+ type _ResponseType = unknown extends ResponseType ? never : ResponseType;
32
+ export { type _ResponseType as ResponseType };
33
+
34
+ // @ts-ignore
35
+ type _BodyInit = unknown extends BodyInit ? never : BodyInit;
36
+ export { type _BodyInit as BodyInit };
37
+
38
+ // @ts-ignore
39
+ type _Headers = unknown extends Headers ? never : Headers;
40
+ export { _Headers as Headers };
41
+
42
+ // @ts-ignore
43
+ type _HeadersInit = unknown extends HeadersInit ? never : HeadersInit;
44
+ export { type _HeadersInit as HeadersInit };
45
+
46
+ type EndingType = 'native' | 'transparent';
47
+
48
+ export interface BlobPropertyBag {
49
+ endings?: EndingType;
50
+ type?: string;
51
+ }
52
+
53
+ export interface FilePropertyBag extends BlobPropertyBag {
54
+ lastModified?: number;
55
+ }
56
+
57
+ export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
58
+
59
+ // @ts-ignore
60
+ type _FormData = unknown extends FormData ? never : FormData;
61
+ // @ts-ignore
62
+ declare const _FormData: unknown extends typeof FormData ? never : typeof FormData;
63
+ export { _FormData as FormData };
64
+
65
+ // @ts-ignore
66
+ type _File = unknown extends File ? never : File;
67
+ // @ts-ignore
68
+ declare const _File: unknown extends typeof File ? never : typeof File;
69
+ export { _File as File };
70
+
71
+ // @ts-ignore
72
+ type _Blob = unknown extends Blob ? never : Blob;
73
+ // @ts-ignore
74
+ declare const _Blob: unknown extends typeof Blob ? never : typeof Blob;
75
+ export { _Blob as Blob };
76
+
77
+ export declare class Readable {
78
+ readable: boolean;
79
+ readonly readableEnded: boolean;
80
+ readonly readableFlowing: boolean | null;
81
+ readonly readableHighWaterMark: number;
82
+ readonly readableLength: number;
83
+ readonly readableObjectMode: boolean;
84
+ destroyed: boolean;
85
+ read(size?: number): any;
86
+ pause(): this;
87
+ resume(): this;
88
+ isPaused(): boolean;
89
+ destroy(error?: Error): this;
90
+ [Symbol.asyncIterator](): AsyncIterableIterator<any>;
91
+ }
92
+
93
+ export declare class FsReadStream extends Readable {
94
+ path: {}; // node type is string | Buffer
95
+ }
96
+
97
+ // @ts-ignore
98
+ type _ReadableStream<R = any> = unknown extends ReadableStream<R> ? never : ReadableStream<R>;
99
+ // @ts-ignore
100
+ declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream;
101
+ export { _ReadableStream as ReadableStream };
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/_shims/auto/types.mjs ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/assert/strict.d.ts ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ declare module "assert/strict" {
2
+ import { strict } from "node:assert";
3
+ export = strict;
4
+ }
5
+ declare module "node:assert/strict" {
6
+ import { strict } from "node:assert";
7
+ export = strict;
8
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/disposable.d.ts ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Polyfills for the explicit resource management types added in TypeScript 5.2.
2
+
3
+ interface SymbolConstructor {
4
+ readonly dispose: unique symbol;
5
+ readonly asyncDispose: unique symbol;
6
+ }
7
+
8
+ interface Disposable {
9
+ [Symbol.dispose](): void;
10
+ }
11
+
12
+ interface AsyncDisposable {
13
+ [Symbol.asyncDispose](): PromiseLike<void>;
14
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/index.d.ts ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Declaration files in this directory contain types relating to TypeScript library features
2
+ // that are not included in all TypeScript versions supported by DefinitelyTyped, but
3
+ // which can be made backwards-compatible without needing `typesVersions`.
4
+ // If adding declarations to this directory, please specify which versions of TypeScript require them,
5
+ // so that they can be removed when no longer needed.
6
+
7
+ /// <reference path="disposable.d.ts" />
8
+ /// <reference path="indexable.d.ts" />
9
+ /// <reference path="iterators.d.ts" />
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/indexable.d.ts ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6.
2
+
3
+ interface RelativeIndexable<T> {
4
+ at(index: number): T | undefined;
5
+ }
6
+
7
+ interface String extends RelativeIndexable<string> {}
8
+ interface Array<T> extends RelativeIndexable<T> {}
9
+ interface ReadonlyArray<T> extends RelativeIndexable<T> {}
10
+ interface Int8Array extends RelativeIndexable<number> {}
11
+ interface Uint8Array extends RelativeIndexable<number> {}
12
+ interface Uint8ClampedArray extends RelativeIndexable<number> {}
13
+ interface Int16Array extends RelativeIndexable<number> {}
14
+ interface Uint16Array extends RelativeIndexable<number> {}
15
+ interface Int32Array extends RelativeIndexable<number> {}
16
+ interface Uint32Array extends RelativeIndexable<number> {}
17
+ interface Float32Array extends RelativeIndexable<number> {}
18
+ interface Float64Array extends RelativeIndexable<number> {}
19
+ interface BigInt64Array extends RelativeIndexable<bigint> {}
20
+ interface BigUint64Array extends RelativeIndexable<bigint> {}
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/compatibility/iterators.d.ts ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
2
+ // The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
3
+ // are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
4
+ // Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
5
+ // if lib.esnext.iterator is loaded.
6
+
7
+ // Placeholders for TS <5.6
8
+ interface IteratorObject<T, TReturn, TNext> {}
9
+ interface AsyncIteratorObject<T, TReturn, TNext> {}
10
+
11
+ declare namespace NodeJS {
12
+ // Populate iterator methods for TS <5.6
13
+ interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
14
+ interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
15
+
16
+ // Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
17
+ type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
18
+ globalThis.Iterator<any, infer TReturn> ? TReturn
19
+ : any;
20
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/dns/promises.d.ts ADDED
@@ -0,0 +1,477 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `dns.promises` API provides an alternative set of asynchronous DNS methods
3
+ * that return `Promise` objects rather than using callbacks. The API is accessible
4
+ * via `import { promises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`.
5
+ * @since v10.6.0
6
+ */
7
+ declare module "dns/promises" {
8
+ import {
9
+ AnyRecord,
10
+ CaaRecord,
11
+ LookupAddress,
12
+ LookupAllOptions,
13
+ LookupOneOptions,
14
+ LookupOptions,
15
+ MxRecord,
16
+ NaptrRecord,
17
+ RecordWithTtl,
18
+ ResolveOptions,
19
+ ResolverOptions,
20
+ ResolveWithTtlOptions,
21
+ SoaRecord,
22
+ SrvRecord,
23
+ } from "node:dns";
24
+ /**
25
+ * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
26
+ * that are currently configured for DNS resolution. A string will include a port
27
+ * section if a custom port is used.
28
+ *
29
+ * ```js
30
+ * [
31
+ * '4.4.4.4',
32
+ * '2001:4860:4860::8888',
33
+ * '4.4.4.4:1053',
34
+ * '[2001:4860:4860::8888]:1053',
35
+ * ]
36
+ * ```
37
+ * @since v10.6.0
38
+ */
39
+ function getServers(): string[];
40
+ /**
41
+ * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
42
+ * AAAA (IPv6) record. All `option` properties are optional. If `options` is an
43
+ * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
44
+ * and IPv6 addresses are both returned if found.
45
+ *
46
+ * With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`.
47
+ *
48
+ * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v18.x/api/errors.html#class-error) object, where `err.code` is the error code.
49
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
50
+ * the host name does not exist but also when the lookup fails in other ways
51
+ * such as no available file descriptors.
52
+ *
53
+ * [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v18.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS
54
+ * protocol. The implementation uses an operating system facility that can
55
+ * associate names with addresses and vice versa. This implementation can have
56
+ * subtle but important consequences on the behavior of any Node.js program. Please
57
+ * take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v18.x/api/dns.html#implementation-considerations) before
58
+ * using `dnsPromises.lookup()`.
59
+ *
60
+ * Example usage:
61
+ *
62
+ * ```js
63
+ * import dns from 'node:dns';
64
+ * const dnsPromises = dns.promises;
65
+ * const options = {
66
+ * family: 6,
67
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
68
+ * };
69
+ *
70
+ * dnsPromises.lookup('example.com', options).then((result) => {
71
+ * console.log('address: %j family: IPv%s', result.address, result.family);
72
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
73
+ * });
74
+ *
75
+ * // When options.all is true, the result will be an Array.
76
+ * options.all = true;
77
+ * dnsPromises.lookup('example.com', options).then((result) => {
78
+ * console.log('addresses: %j', result);
79
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
80
+ * });
81
+ * ```
82
+ * @since v10.6.0
83
+ */
84
+ function lookup(hostname: string, family: number): Promise<LookupAddress>;
85
+ function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
86
+ function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
87
+ function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
88
+ function lookup(hostname: string): Promise<LookupAddress>;
89
+ /**
90
+ * Resolves the given `address` and `port` into a host name and service using
91
+ * the operating system's underlying `getnameinfo` implementation.
92
+ *
93
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
94
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
95
+ *
96
+ * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v18.x/api/errors.html#class-error) object, where `err.code` is the error code.
97
+ *
98
+ * ```js
99
+ * import dns from 'node:dns';
100
+ * dns.promises.lookupService('127.0.0.1', 22).then((result) => {
101
+ * console.log(result.hostname, result.service);
102
+ * // Prints: localhost ssh
103
+ * });
104
+ * ```
105
+ * @since v10.6.0
106
+ */
107
+ function lookupService(
108
+ address: string,
109
+ port: number,
110
+ ): Promise<{
111
+ hostname: string;
112
+ service: string;
113
+ }>;
114
+ /**
115
+ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
116
+ * of the resource records. When successful, the `Promise` is resolved with an
117
+ * array of resource records. The type and structure of individual results vary
118
+ * based on `rrtype`:
119
+ *
120
+ * <omitted>
121
+ *
122
+ * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v18.x/api/errors.html#class-error) object, where `err.code`
123
+ * is one of the [DNS error codes](https://nodejs.org/docs/latest-v18.x/api/dns.html#error-codes).
124
+ * @since v10.6.0
125
+ * @param hostname Host name to resolve.
126
+ * @param [rrtype='A'] Resource record type.
127
+ */
128
+ function resolve(hostname: string): Promise<string[]>;
129
+ function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
130
+ function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
131
+ function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
132
+ function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
133
+ function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
134
+ function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
135
+ function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
136
+ function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
137
+ function resolve(hostname: string, rrtype: string): Promise<
138
+ | string[]
139
+ | CaaRecord[]
140
+ | MxRecord[]
141
+ | NaptrRecord[]
142
+ | SoaRecord
143
+ | SrvRecord[]
144
+ | string[][]
145
+ | AnyRecord[]
146
+ >;
147
+ /**
148
+ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
149
+ * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
150
+ * @since v10.6.0
151
+ * @param hostname Host name to resolve.
152
+ */
153
+ function resolve4(hostname: string): Promise<string[]>;
154
+ function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
155
+ function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
156
+ /**
157
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6
158
+ * addresses.
159
+ * @since v10.6.0
160
+ * @param hostname Host name to resolve.
161
+ */
162
+ function resolve6(hostname: string): Promise<string[]>;
163
+ function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
164
+ function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
165
+ /**
166
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
167
+ * On success, the `Promise` is resolved with an array containing various types of
168
+ * records. Each object has a property `type` that indicates the type of the
169
+ * current record. And depending on the `type`, additional properties will be
170
+ * present on the object:
171
+ *
172
+ * <omitted>
173
+ *
174
+ * Here is an example of the result object:
175
+ *
176
+ * ```js
177
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
178
+ * { type: 'CNAME', value: 'example.com' },
179
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
180
+ * { type: 'NS', value: 'ns1.example.com' },
181
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
182
+ * { type: 'SOA',
183
+ * nsname: 'ns1.example.com',
184
+ * hostmaster: 'admin.example.com',
185
+ * serial: 156696742,
186
+ * refresh: 900,
187
+ * retry: 900,
188
+ * expire: 1800,
189
+ * minttl: 60 } ]
190
+ * ```
191
+ * @since v10.6.0
192
+ */
193
+ function resolveAny(hostname: string): Promise<AnyRecord[]>;
194
+ /**
195
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
196
+ * the `Promise` is resolved with an array of objects containing available
197
+ * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
198
+ * @since v15.0.0, v14.17.0
199
+ */
200
+ function resolveCaa(hostname: string): Promise<CaaRecord[]>;
201
+ /**
202
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
203
+ * the `Promise` is resolved with an array of canonical name records available for
204
+ * the `hostname` (e.g. `['bar.example.com']`).
205
+ * @since v10.6.0
206
+ */
207
+ function resolveCname(hostname: string): Promise<string[]>;
208
+ /**
209
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects
210
+ * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
211
+ * @since v10.6.0
212
+ */
213
+ function resolveMx(hostname: string): Promise<MxRecord[]>;
214
+ /**
215
+ * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array
216
+ * of objects with the following properties:
217
+ *
218
+ * * `flags`
219
+ * * `service`
220
+ * * `regexp`
221
+ * * `replacement`
222
+ * * `order`
223
+ * * `preference`
224
+ *
225
+ * ```js
226
+ * {
227
+ * flags: 's',
228
+ * service: 'SIP+D2U',
229
+ * regexp: '',
230
+ * replacement: '_sip._udp.example.com',
231
+ * order: 30,
232
+ * preference: 100
233
+ * }
234
+ * ```
235
+ * @since v10.6.0
236
+ */
237
+ function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
238
+ /**
239
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server
240
+ * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`).
241
+ * @since v10.6.0
242
+ */
243
+ function resolveNs(hostname: string): Promise<string[]>;
244
+ /**
245
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings
246
+ * containing the reply records.
247
+ * @since v10.6.0
248
+ */
249
+ function resolvePtr(hostname: string): Promise<string[]>;
250
+ /**
251
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
252
+ * the `hostname`. On success, the `Promise` is resolved with an object with the
253
+ * following properties:
254
+ *
255
+ * * `nsname`
256
+ * * `hostmaster`
257
+ * * `serial`
258
+ * * `refresh`
259
+ * * `retry`
260
+ * * `expire`
261
+ * * `minttl`
262
+ *
263
+ * ```js
264
+ * {
265
+ * nsname: 'ns.example.com',
266
+ * hostmaster: 'root.example.com',
267
+ * serial: 2013101809,
268
+ * refresh: 10000,
269
+ * retry: 2400,
270
+ * expire: 604800,
271
+ * minttl: 3600
272
+ * }
273
+ * ```
274
+ * @since v10.6.0
275
+ */
276
+ function resolveSoa(hostname: string): Promise<SoaRecord>;
277
+ /**
278
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with
279
+ * the following properties:
280
+ *
281
+ * * `priority`
282
+ * * `weight`
283
+ * * `port`
284
+ * * `name`
285
+ *
286
+ * ```js
287
+ * {
288
+ * priority: 10,
289
+ * weight: 5,
290
+ * port: 21223,
291
+ * name: 'service.example.com'
292
+ * }
293
+ * ```
294
+ * @since v10.6.0
295
+ */
296
+ function resolveSrv(hostname: string): Promise<SrvRecord[]>;
297
+ /**
298
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
299
+ * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
300
+ * one record. Depending on the use case, these could be either joined together or
301
+ * treated separately.
302
+ * @since v10.6.0
303
+ */
304
+ function resolveTxt(hostname: string): Promise<string[][]>;
305
+ /**
306
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
307
+ * array of host names.
308
+ *
309
+ * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v18.x/api/errors.html#class-error) object, where `err.code`
310
+ * is one of the [DNS error codes](https://nodejs.org/docs/latest-v18.x/api/dns.html#error-codes).
311
+ * @since v10.6.0
312
+ */
313
+ function reverse(ip: string): Promise<string[]>;
314
+ /**
315
+ * Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v18.x/api/dns.html#dnspromiseslookuphostname-options).
316
+ * The value could be:
317
+ *
318
+ * * `ipv4first`: for `verbatim` defaulting to `false`.
319
+ * * `verbatim`: for `verbatim` defaulting to `true`.
320
+ * @since v18.17.0
321
+ */
322
+ function getDefaultResultOrder(): "ipv4first" | "verbatim";
323
+ /**
324
+ * Sets the IP address and port of servers to be used when performing DNS
325
+ * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
326
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
327
+ *
328
+ * ```js
329
+ * dnsPromises.setServers([
330
+ * '4.4.4.4',
331
+ * '[2001:4860:4860::8888]',
332
+ * '4.4.4.4:1053',
333
+ * '[2001:4860:4860::8888]:1053',
334
+ * ]);
335
+ * ```
336
+ *
337
+ * An error will be thrown if an invalid address is provided.
338
+ *
339
+ * The `dnsPromises.setServers()` method must not be called while a DNS query is in
340
+ * progress.
341
+ *
342
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
343
+ * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
344
+ * subsequent servers provided. Fallback DNS servers will only be used if the
345
+ * earlier ones time out or result in some other error.
346
+ * @since v10.6.0
347
+ * @param servers array of `RFC 5952` formatted addresses
348
+ */
349
+ function setServers(servers: readonly string[]): void;
350
+ /**
351
+ * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
352
+ *
353
+ * * `ipv4first`: sets default `verbatim` `false`.
354
+ * * `verbatim`: sets default `verbatim` `true`.
355
+ *
356
+ * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v18.x/api/dns.html#dnspromisessetdefaultresultorderorder)
357
+ * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v18.x/api/cli.html#--dns-result-orderorder).
358
+ * When using [worker threads](https://nodejs.org/docs/latest-v18.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v18.x/api/dns.html#dnspromisessetdefaultresultorderorder)
359
+ * from the main thread won't affect the default dns orders in workers.
360
+ * @since v16.4.0, v14.18.0
361
+ * @param order must be `'ipv4first'` or `'verbatim'`.
362
+ */
363
+ function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
364
+ // Error codes
365
+ const NODATA: "ENODATA";
366
+ const FORMERR: "EFORMERR";
367
+ const SERVFAIL: "ESERVFAIL";
368
+ const NOTFOUND: "ENOTFOUND";
369
+ const NOTIMP: "ENOTIMP";
370
+ const REFUSED: "EREFUSED";
371
+ const BADQUERY: "EBADQUERY";
372
+ const BADNAME: "EBADNAME";
373
+ const BADFAMILY: "EBADFAMILY";
374
+ const BADRESP: "EBADRESP";
375
+ const CONNREFUSED: "ECONNREFUSED";
376
+ const TIMEOUT: "ETIMEOUT";
377
+ const EOF: "EOF";
378
+ const FILE: "EFILE";
379
+ const NOMEM: "ENOMEM";
380
+ const DESTRUCTION: "EDESTRUCTION";
381
+ const BADSTR: "EBADSTR";
382
+ const BADFLAGS: "EBADFLAGS";
383
+ const NONAME: "ENONAME";
384
+ const BADHINTS: "EBADHINTS";
385
+ const NOTINITIALIZED: "ENOTINITIALIZED";
386
+ const LOADIPHLPAPI: "ELOADIPHLPAPI";
387
+ const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS";
388
+ const CANCELLED: "ECANCELLED";
389
+ /**
390
+ * An independent resolver for DNS requests.
391
+ *
392
+ * Creating a new resolver uses the default server settings. Setting
393
+ * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v18.x/api/dns.html#dnspromisessetserversservers) does not affect
394
+ * other resolvers:
395
+ *
396
+ * ```js
397
+ * import dns from 'node:dns';
398
+ * const { Resolver } = dns.promises;
399
+ * const resolver = new Resolver();
400
+ * resolver.setServers(['4.4.4.4']);
401
+ *
402
+ * // This request will use the server at 4.4.4.4, independent of global settings.
403
+ * resolver.resolve4('example.org').then((addresses) => {
404
+ * // ...
405
+ * });
406
+ *
407
+ * // Alternatively, the same code can be written using async-await style.
408
+ * (async function() {
409
+ * const addresses = await resolver.resolve4('example.org');
410
+ * })();
411
+ * ```
412
+ *
413
+ * The following methods from the `dnsPromises` API are available:
414
+ *
415
+ * * `resolver.getServers()`
416
+ * * `resolver.resolve()`
417
+ * * `resolver.resolve4()`
418
+ * * `resolver.resolve6()`
419
+ * * `resolver.resolveAny()`
420
+ * * `resolver.resolveCaa()`
421
+ * * `resolver.resolveCname()`
422
+ * * `resolver.resolveMx()`
423
+ * * `resolver.resolveNaptr()`
424
+ * * `resolver.resolveNs()`
425
+ * * `resolver.resolvePtr()`
426
+ * * `resolver.resolveSoa()`
427
+ * * `resolver.resolveSrv()`
428
+ * * `resolver.resolveTxt()`
429
+ * * `resolver.reverse()`
430
+ * * `resolver.setServers()`
431
+ * @since v10.6.0
432
+ */
433
+ class Resolver {
434
+ constructor(options?: ResolverOptions);
435
+ /**
436
+ * Cancel all outstanding DNS queries made by this resolver. The corresponding
437
+ * callbacks will be called with an error with code `ECANCELLED`.
438
+ * @since v8.3.0
439
+ */
440
+ cancel(): void;
441
+ getServers: typeof getServers;
442
+ resolve: typeof resolve;
443
+ resolve4: typeof resolve4;
444
+ resolve6: typeof resolve6;
445
+ resolveAny: typeof resolveAny;
446
+ resolveCaa: typeof resolveCaa;
447
+ resolveCname: typeof resolveCname;
448
+ resolveMx: typeof resolveMx;
449
+ resolveNaptr: typeof resolveNaptr;
450
+ resolveNs: typeof resolveNs;
451
+ resolvePtr: typeof resolvePtr;
452
+ resolveSoa: typeof resolveSoa;
453
+ resolveSrv: typeof resolveSrv;
454
+ resolveTxt: typeof resolveTxt;
455
+ reverse: typeof reverse;
456
+ /**
457
+ * The resolver instance will send its requests from the specified IP address.
458
+ * This allows programs to specify outbound interfaces when used on multi-homed
459
+ * systems.
460
+ *
461
+ * If a v4 or v6 address is not specified, it is set to the default and the
462
+ * operating system will choose a local address automatically.
463
+ *
464
+ * The resolver will use the v4 local address when making requests to IPv4 DNS
465
+ * servers, and the v6 local address when making requests to IPv6 DNS servers.
466
+ * The `rrtype` of resolution requests has no impact on the local address used.
467
+ * @since v15.1.0, v14.17.0
468
+ * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
469
+ * @param [ipv6='::0'] A string representation of an IPv6 address.
470
+ */
471
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
472
+ setServers: typeof setServers;
473
+ }
474
+ }
475
+ declare module "node:dns/promises" {
476
+ export * from "dns/promises";
477
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/fs/promises.d.ts ADDED
@@ -0,0 +1,1208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `fs/promises` API provides asynchronous file system methods that return
3
+ * promises.
4
+ *
5
+ * The promise APIs use the underlying Node.js threadpool to perform file
6
+ * system operations off the event loop thread. These operations are not
7
+ * synchronized or threadsafe. Care must be taken when performing multiple
8
+ * concurrent modifications on the same file or data corruption may occur.
9
+ * @since v10.0.0
10
+ */
11
+ declare module "fs/promises" {
12
+ import { Abortable } from "node:events";
13
+ import { Stream } from "node:stream";
14
+ import { ReadableStream } from "node:stream/web";
15
+ import {
16
+ BigIntStats,
17
+ BigIntStatsFs,
18
+ BufferEncodingOption,
19
+ constants as fsConstants,
20
+ CopyOptions,
21
+ Dir,
22
+ Dirent,
23
+ MakeDirectoryOptions,
24
+ Mode,
25
+ ObjectEncodingOptions,
26
+ OpenDirOptions,
27
+ OpenMode,
28
+ PathLike,
29
+ ReadStream,
30
+ ReadVResult,
31
+ RmDirOptions,
32
+ RmOptions,
33
+ StatFsOptions,
34
+ StatOptions,
35
+ Stats,
36
+ StatsFs,
37
+ TimeLike,
38
+ WatchEventType,
39
+ WatchOptions,
40
+ WriteStream,
41
+ WriteVResult,
42
+ } from "node:fs";
43
+ import { Interface as ReadlineInterface } from "node:readline";
44
+
45
+ interface FileChangeInfo<T extends string | Buffer> {
46
+ eventType: WatchEventType;
47
+ filename: T | null;
48
+ }
49
+ interface FlagAndOpenMode {
50
+ mode?: Mode | undefined;
51
+ flag?: OpenMode | undefined;
52
+ }
53
+ interface FileReadResult<T extends NodeJS.ArrayBufferView> {
54
+ bytesRead: number;
55
+ buffer: T;
56
+ }
57
+ interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
58
+ /**
59
+ * @default `Buffer.alloc(0xffff)`
60
+ */
61
+ buffer?: T;
62
+ /**
63
+ * @default 0
64
+ */
65
+ offset?: number | null;
66
+ /**
67
+ * @default `buffer.byteLength`
68
+ */
69
+ length?: number | null;
70
+ position?: number | null;
71
+ }
72
+ interface CreateReadStreamOptions {
73
+ encoding?: BufferEncoding | null | undefined;
74
+ autoClose?: boolean | undefined;
75
+ emitClose?: boolean | undefined;
76
+ start?: number | undefined;
77
+ end?: number | undefined;
78
+ highWaterMark?: number | undefined;
79
+ }
80
+ interface CreateWriteStreamOptions {
81
+ encoding?: BufferEncoding | null | undefined;
82
+ autoClose?: boolean | undefined;
83
+ emitClose?: boolean | undefined;
84
+ start?: number | undefined;
85
+ highWaterMark?: number | undefined;
86
+ }
87
+ interface ReadableWebStreamOptions {
88
+ /**
89
+ * Whether to open a normal or a `'bytes'` stream.
90
+ * @since v18.17.0
91
+ */
92
+ type?: "bytes" | undefined;
93
+ }
94
+ // TODO: Add `EventEmitter` close
95
+ interface FileHandle {
96
+ /**
97
+ * The numeric file descriptor managed by the {FileHandle} object.
98
+ * @since v10.0.0
99
+ */
100
+ readonly fd: number;
101
+ /**
102
+ * Alias of `filehandle.writeFile()`.
103
+ *
104
+ * When operating on file handles, the mode cannot be changed from what it was set
105
+ * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
106
+ * @since v10.0.0
107
+ * @return Fulfills with `undefined` upon success.
108
+ */
109
+ appendFile(
110
+ data: string | Uint8Array,
111
+ options?: (ObjectEncodingOptions & Abortable) | BufferEncoding | null,
112
+ ): Promise<void>;
113
+ /**
114
+ * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
115
+ * @since v10.0.0
116
+ * @param uid The file's new owner's user id.
117
+ * @param gid The file's new group's group id.
118
+ * @return Fulfills with `undefined` upon success.
119
+ */
120
+ chown(uid: number, gid: number): Promise<void>;
121
+ /**
122
+ * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
123
+ * @since v10.0.0
124
+ * @param mode the file mode bit mask.
125
+ * @return Fulfills with `undefined` upon success.
126
+ */
127
+ chmod(mode: Mode): Promise<void>;
128
+ /**
129
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
130
+ * returned by this method has a default `highWaterMark` of 64 kb.
131
+ *
132
+ * `options` can include `start` and `end` values to read a range of bytes from
133
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
134
+ * start counting at 0, allowed values are in the
135
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is
136
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
137
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
138
+ *
139
+ * If the `FileHandle` points to a character device that only supports blocking
140
+ * reads (such as keyboard or sound card), read operations do not finish until data
141
+ * is available. This can prevent the process from exiting and the stream from
142
+ * closing naturally.
143
+ *
144
+ * By default, the stream will emit a `'close'` event after it has been
145
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
146
+ *
147
+ * ```js
148
+ * import { open } from 'fs/promises';
149
+ *
150
+ * const fd = await open('/dev/input/event0');
151
+ * // Create a stream from some character device.
152
+ * const stream = fd.createReadStream();
153
+ * setTimeout(() => {
154
+ * stream.close(); // This may not close the stream.
155
+ * // Artificially marking end-of-stream, as if the underlying resource had
156
+ * // indicated end-of-file by itself, allows the stream to close.
157
+ * // This does not cancel pending read operations, and if there is such an
158
+ * // operation, the process may still not be able to exit successfully
159
+ * // until it finishes.
160
+ * stream.push(null);
161
+ * stream.read(0);
162
+ * }, 100);
163
+ * ```
164
+ *
165
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
166
+ * there's an error. It is the application's responsibility to close it and make
167
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
168
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
169
+ * automatically.
170
+ *
171
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
172
+ *
173
+ * ```js
174
+ * import { open } from 'fs/promises';
175
+ *
176
+ * const fd = await open('sample.txt');
177
+ * fd.createReadStream({ start: 90, end: 99 });
178
+ * ```
179
+ * @since v16.11.0
180
+ */
181
+ createReadStream(options?: CreateReadStreamOptions): ReadStream;
182
+ /**
183
+ * `options` may also include a `start` option to allow writing data at some
184
+ * position past the beginning of the file, allowed values are in the
185
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
186
+ * replacing it may require the `flags` `open` option to be set to `r+` rather than
187
+ * the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
188
+ *
189
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
190
+ * then the file descriptor won't be closed, even if there's an error.
191
+ * It is the application's responsibility to close it and make sure there's no
192
+ * file descriptor leak.
193
+ *
194
+ * By default, the stream will emit a `'close'` event after it has been
195
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
196
+ * @since v16.11.0
197
+ */
198
+ createWriteStream(options?: CreateWriteStreamOptions): WriteStream;
199
+ /**
200
+ * Forces all currently queued I/O operations associated with the file to the
201
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
202
+ *
203
+ * Unlike `filehandle.sync` this method does not flush modified metadata.
204
+ * @since v10.0.0
205
+ * @return Fulfills with `undefined` upon success.
206
+ */
207
+ datasync(): Promise<void>;
208
+ /**
209
+ * Request that all data for the open file descriptor is flushed to the storage
210
+ * device. The specific implementation is operating system and device specific.
211
+ * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
212
+ * @since v10.0.0
213
+ * @return Fufills with `undefined` upon success.
214
+ */
215
+ sync(): Promise<void>;
216
+ /**
217
+ * Reads data from the file and stores that in the given buffer.
218
+ *
219
+ * If the file is not modified concurrently, the end-of-file is reached when the
220
+ * number of bytes read is zero.
221
+ * @since v10.0.0
222
+ * @param buffer A buffer that will be filled with the file data read.
223
+ * @param offset The location in the buffer at which to start filling.
224
+ * @param length The number of bytes to read.
225
+ * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
226
+ * integer, the current file position will remain unchanged.
227
+ * @return Fulfills upon success with an object with two properties:
228
+ */
229
+ read<T extends NodeJS.ArrayBufferView>(
230
+ buffer: T,
231
+ offset?: number | null,
232
+ length?: number | null,
233
+ position?: number | null,
234
+ ): Promise<FileReadResult<T>>;
235
+ read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
236
+ /**
237
+ * Returns a `ReadableStream` that may be used to read the files data.
238
+ *
239
+ * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
240
+ * or closing.
241
+ *
242
+ * ```js
243
+ * import { open } from 'node:fs/promises';
244
+ *
245
+ * const file = await open('./some/file/to/read');
246
+ *
247
+ * for await (const chunk of file.readableWebStream())
248
+ * console.log(chunk);
249
+ *
250
+ * await file.close();
251
+ * ```
252
+ *
253
+ * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
254
+ *
255
+ * @since v17.0.0
256
+ * @experimental
257
+ */
258
+ readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
259
+ /**
260
+ * Asynchronously reads the entire contents of a file.
261
+ *
262
+ * If `options` is a string, then it specifies the `encoding`.
263
+ *
264
+ * The `FileHandle` has to support reading.
265
+ *
266
+ * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
267
+ * position till the end of the file. It doesn't always read from the beginning
268
+ * of the file.
269
+ * @since v10.0.0
270
+ * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
271
+ * data will be a string.
272
+ */
273
+ readFile(
274
+ options?:
275
+ | ({ encoding?: null | undefined } & Abortable)
276
+ | null,
277
+ ): Promise<Buffer>;
278
+ /**
279
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
280
+ * The `FileHandle` must have been opened for reading.
281
+ */
282
+ readFile(
283
+ options:
284
+ | ({ encoding: BufferEncoding } & Abortable)
285
+ | BufferEncoding,
286
+ ): Promise<string>;
287
+ /**
288
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
289
+ * The `FileHandle` must have been opened for reading.
290
+ */
291
+ readFile(
292
+ options?:
293
+ | (ObjectEncodingOptions & Abortable)
294
+ | BufferEncoding
295
+ | null,
296
+ ): Promise<string | Buffer>;
297
+ /**
298
+ * Convenience method to create a `readline` interface and stream over the file. For example:
299
+ *
300
+ * ```js
301
+ * import { open } from 'node:fs/promises';
302
+ *
303
+ * const file = await open('./some/file/to/read');
304
+ *
305
+ * for await (const line of file.readLines()) {
306
+ * console.log(line);
307
+ * }
308
+ * ```
309
+ *
310
+ * @since v18.11.0
311
+ * @param options See `filehandle.createReadStream()` for the options.
312
+ */
313
+ readLines(options?: CreateReadStreamOptions): ReadlineInterface;
314
+ /**
315
+ * @since v10.0.0
316
+ * @return Fulfills with an {fs.Stats} for the file.
317
+ */
318
+ stat(
319
+ opts?: StatOptions & {
320
+ bigint?: false | undefined;
321
+ },
322
+ ): Promise<Stats>;
323
+ stat(
324
+ opts: StatOptions & {
325
+ bigint: true;
326
+ },
327
+ ): Promise<BigIntStats>;
328
+ stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
329
+ /**
330
+ * Truncates the file.
331
+ *
332
+ * If the file was larger than `len` bytes, only the first `len` bytes will be
333
+ * retained in the file.
334
+ *
335
+ * The following example retains only the first four bytes of the file:
336
+ *
337
+ * ```js
338
+ * import { open } from 'fs/promises';
339
+ *
340
+ * let filehandle = null;
341
+ * try {
342
+ * filehandle = await open('temp.txt', 'r+');
343
+ * await filehandle.truncate(4);
344
+ * } finally {
345
+ * await filehandle?.close();
346
+ * }
347
+ * ```
348
+ *
349
+ * If the file previously was shorter than `len` bytes, it is extended, and the
350
+ * extended part is filled with null bytes (`'\0'`):
351
+ *
352
+ * If `len` is negative then `0` will be used.
353
+ * @since v10.0.0
354
+ * @param [len=0]
355
+ * @return Fulfills with `undefined` upon success.
356
+ */
357
+ truncate(len?: number): Promise<void>;
358
+ /**
359
+ * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
360
+ * @since v10.0.0
361
+ */
362
+ utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
363
+ /**
364
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
365
+ * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
366
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
367
+ * The promise is resolved with no arguments upon success.
368
+ *
369
+ * If `options` is a string, then it specifies the `encoding`.
370
+ *
371
+ * The `FileHandle` has to support writing.
372
+ *
373
+ * It is unsafe to use `filehandle.writeFile()` multiple times on the same file
374
+ * without waiting for the promise to be resolved (or rejected).
375
+ *
376
+ * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
377
+ * current position till the end of the file. It doesn't always write from the
378
+ * beginning of the file.
379
+ * @since v10.0.0
380
+ */
381
+ writeFile(
382
+ data: string | Uint8Array,
383
+ options?: (ObjectEncodingOptions & Abortable) | BufferEncoding | null,
384
+ ): Promise<void>;
385
+ /**
386
+ * Write `buffer` to the file.
387
+ *
388
+ * The promise is resolved with an object containing two properties:
389
+ *
390
+ * It is unsafe to use `filehandle.write()` multiple times on the same file
391
+ * without waiting for the promise to be resolved (or rejected). For this
392
+ * scenario, use `filehandle.createWriteStream()`.
393
+ *
394
+ * On Linux, positional writes do not work when the file is opened in append mode.
395
+ * The kernel ignores the position argument and always appends the data to
396
+ * the end of the file.
397
+ * @since v10.0.0
398
+ * @param [offset=0] The start position from within `buffer` where the data to write begins.
399
+ * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write.
400
+ * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
401
+ * See the POSIX pwrite(2) documentation for more detail.
402
+ */
403
+ write<TBuffer extends Uint8Array>(
404
+ buffer: TBuffer,
405
+ offset?: number | null,
406
+ length?: number | null,
407
+ position?: number | null,
408
+ ): Promise<{
409
+ bytesWritten: number;
410
+ buffer: TBuffer;
411
+ }>;
412
+ write(
413
+ data: string,
414
+ position?: number | null,
415
+ encoding?: BufferEncoding | null,
416
+ ): Promise<{
417
+ bytesWritten: number;
418
+ buffer: string;
419
+ }>;
420
+ /**
421
+ * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
422
+ *
423
+ * The promise is resolved with an object containing a two properties:
424
+ *
425
+ * It is unsafe to call `writev()` multiple times on the same file without waiting
426
+ * for the promise to be resolved (or rejected).
427
+ *
428
+ * On Linux, positional writes don't work when the file is opened in append mode.
429
+ * The kernel ignores the position argument and always appends the data to
430
+ * the end of the file.
431
+ * @since v12.9.0
432
+ * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
433
+ * position.
434
+ */
435
+ writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
436
+ /**
437
+ * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
438
+ * @since v13.13.0, v12.17.0
439
+ * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
440
+ * @return Fulfills upon success an object containing two properties:
441
+ */
442
+ readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
443
+ /**
444
+ * Closes the file handle after waiting for any pending operation on the handle to
445
+ * complete.
446
+ *
447
+ * ```js
448
+ * import { open } from 'fs/promises';
449
+ *
450
+ * let filehandle;
451
+ * try {
452
+ * filehandle = await open('thefile.txt', 'r');
453
+ * } finally {
454
+ * await filehandle?.close();
455
+ * }
456
+ * ```
457
+ * @since v10.0.0
458
+ * @return Fulfills with `undefined` upon success.
459
+ */
460
+ close(): Promise<void>;
461
+ /**
462
+ * An alias for {@link FileHandle.close()}.
463
+ * @since v18.18.0
464
+ */
465
+ [Symbol.asyncDispose](): Promise<void>;
466
+ }
467
+
468
+ const constants: typeof fsConstants;
469
+
470
+ /**
471
+ * Tests a user's permissions for the file or directory specified by `path`.
472
+ * The `mode` argument is an optional integer that specifies the accessibility
473
+ * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK`
474
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
475
+ * possible values of `mode`.
476
+ *
477
+ * If the accessibility check is successful, the promise is resolved with no
478
+ * value. If any of the accessibility checks fail, the promise is rejected
479
+ * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
480
+ * written by the current process.
481
+ *
482
+ * ```js
483
+ * import { access } from 'fs/promises';
484
+ * import { constants } from 'fs';
485
+ *
486
+ * try {
487
+ * await access('/etc/passwd', constants.R_OK | constants.W_OK);
488
+ * console.log('can access');
489
+ * } catch {
490
+ * console.error('cannot access');
491
+ * }
492
+ * ```
493
+ *
494
+ * Using `fsPromises.access()` to check for the accessibility of a file before
495
+ * calling `fsPromises.open()` is not recommended. Doing so introduces a race
496
+ * condition, since other processes may change the file's state between the two
497
+ * calls. Instead, user code should open/read/write the file directly and handle
498
+ * the error raised if the file is not accessible.
499
+ * @since v10.0.0
500
+ * @param [mode=fs.constants.F_OK]
501
+ * @return Fulfills with `undefined` upon success.
502
+ */
503
+ function access(path: PathLike, mode?: number): Promise<void>;
504
+ /**
505
+ * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
506
+ * already exists.
507
+ *
508
+ * No guarantees are made about the atomicity of the copy operation. If an
509
+ * error occurs after the destination file has been opened for writing, an attempt
510
+ * will be made to remove the destination.
511
+ *
512
+ * ```js
513
+ * import { constants } from 'fs';
514
+ * import { copyFile } from 'fs/promises';
515
+ *
516
+ * try {
517
+ * await copyFile('source.txt', 'destination.txt');
518
+ * console.log('source.txt was copied to destination.txt');
519
+ * } catch {
520
+ * console.log('The file could not be copied');
521
+ * }
522
+ *
523
+ * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
524
+ * try {
525
+ * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
526
+ * console.log('source.txt was copied to destination.txt');
527
+ * } catch {
528
+ * console.log('The file could not be copied');
529
+ * }
530
+ * ```
531
+ * @since v10.0.0
532
+ * @param src source filename to copy
533
+ * @param dest destination filename of the copy operation
534
+ * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
535
+ * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
536
+ * @return Fulfills with `undefined` upon success.
537
+ */
538
+ function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise<void>;
539
+ /**
540
+ * Opens a `FileHandle`.
541
+ *
542
+ * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail.
543
+ *
544
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
545
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
546
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
547
+ * @since v10.0.0
548
+ * @param [flags='r'] See `support of file system `flags``.
549
+ * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
550
+ * @return Fulfills with a {FileHandle} object.
551
+ */
552
+ function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
553
+ /**
554
+ * Renames `oldPath` to `newPath`.
555
+ * @since v10.0.0
556
+ * @return Fulfills with `undefined` upon success.
557
+ */
558
+ function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
559
+ /**
560
+ * Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
561
+ * @since v10.0.0
562
+ * @param [len=0]
563
+ * @return Fulfills with `undefined` upon success.
564
+ */
565
+ function truncate(path: PathLike, len?: number): Promise<void>;
566
+ /**
567
+ * Removes the directory identified by `path`.
568
+ *
569
+ * Using `fsPromises.rmdir()` on a file (not a directory) results in the
570
+ * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX.
571
+ *
572
+ * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.
573
+ * @since v10.0.0
574
+ * @return Fulfills with `undefined` upon success.
575
+ */
576
+ function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
577
+ /**
578
+ * Removes files and directories (modeled on the standard POSIX `rm` utility).
579
+ * @since v14.14.0
580
+ * @return Fulfills with `undefined` upon success.
581
+ */
582
+ function rm(path: PathLike, options?: RmOptions): Promise<void>;
583
+ /**
584
+ * Asynchronously creates a directory.
585
+ *
586
+ * The optional `options` argument can be an integer specifying `mode` (permission
587
+ * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory
588
+ * that exists results in a
589
+ * rejection only when `recursive` is false.
590
+ * @since v10.0.0
591
+ * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
592
+ */
593
+ function mkdir(
594
+ path: PathLike,
595
+ options: MakeDirectoryOptions & {
596
+ recursive: true;
597
+ },
598
+ ): Promise<string | undefined>;
599
+ /**
600
+ * Asynchronous mkdir(2) - create a directory.
601
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
602
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
603
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
604
+ */
605
+ function mkdir(
606
+ path: PathLike,
607
+ options?:
608
+ | Mode
609
+ | (MakeDirectoryOptions & {
610
+ recursive?: false | undefined;
611
+ })
612
+ | null,
613
+ ): Promise<void>;
614
+ /**
615
+ * Asynchronous mkdir(2) - create a directory.
616
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
617
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
618
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
619
+ */
620
+ function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
621
+ /**
622
+ * Reads the contents of a directory.
623
+ *
624
+ * The optional `options` argument can be a string specifying an encoding, or an
625
+ * object with an `encoding` property specifying the character encoding to use for
626
+ * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
627
+ * will be passed as `Buffer` objects.
628
+ *
629
+ * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
630
+ *
631
+ * ```js
632
+ * import { readdir } from 'fs/promises';
633
+ *
634
+ * try {
635
+ * const files = await readdir(path);
636
+ * for (const file of files)
637
+ * console.log(file);
638
+ * } catch (err) {
639
+ * console.error(err);
640
+ * }
641
+ * ```
642
+ * @since v10.0.0
643
+ * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.
644
+ */
645
+ function readdir(
646
+ path: PathLike,
647
+ options?:
648
+ | (ObjectEncodingOptions & {
649
+ withFileTypes?: false | undefined;
650
+ recursive?: boolean | undefined;
651
+ })
652
+ | BufferEncoding
653
+ | null,
654
+ ): Promise<string[]>;
655
+ /**
656
+ * Asynchronous readdir(3) - read a directory.
657
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
658
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
659
+ */
660
+ function readdir(
661
+ path: PathLike,
662
+ options:
663
+ | {
664
+ encoding: "buffer";
665
+ withFileTypes?: false | undefined;
666
+ recursive?: boolean | undefined;
667
+ }
668
+ | "buffer",
669
+ ): Promise<Buffer[]>;
670
+ /**
671
+ * Asynchronous readdir(3) - read a directory.
672
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
673
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
674
+ */
675
+ function readdir(
676
+ path: PathLike,
677
+ options?:
678
+ | (ObjectEncodingOptions & {
679
+ withFileTypes?: false | undefined;
680
+ recursive?: boolean | undefined;
681
+ })
682
+ | BufferEncoding
683
+ | null,
684
+ ): Promise<string[] | Buffer[]>;
685
+ /**
686
+ * Asynchronous readdir(3) - read a directory.
687
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
688
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
689
+ */
690
+ function readdir(
691
+ path: PathLike,
692
+ options: ObjectEncodingOptions & {
693
+ withFileTypes: true;
694
+ recursive?: boolean | undefined;
695
+ },
696
+ ): Promise<Dirent[]>;
697
+ /**
698
+ * Asynchronous readdir(3) - read a directory.
699
+ * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
700
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
701
+ */
702
+ function readdir(
703
+ path: PathLike,
704
+ options: {
705
+ encoding: "buffer";
706
+ withFileTypes: true;
707
+ recursive?: boolean | undefined;
708
+ },
709
+ ): Promise<Dirent<Buffer>[]>;
710
+ /**
711
+ * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
712
+ * resolved with the`linkString` upon success.
713
+ *
714
+ * The optional `options` argument can be a string specifying an encoding, or an
715
+ * object with an `encoding` property specifying the character encoding to use for
716
+ * the link path returned. If the `encoding` is set to `'buffer'`, the link path
717
+ * returned will be passed as a `Buffer` object.
718
+ * @since v10.0.0
719
+ * @return Fulfills with the `linkString` upon success.
720
+ */
721
+ function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
722
+ /**
723
+ * Asynchronous readlink(2) - read value of a symbolic link.
724
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
725
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
726
+ */
727
+ function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
728
+ /**
729
+ * Asynchronous readlink(2) - read value of a symbolic link.
730
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
731
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
732
+ */
733
+ function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
734
+ /**
735
+ * Creates a symbolic link.
736
+ *
737
+ * The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. Windows junction points require the destination path
738
+ * to be absolute. When using `'junction'`, the `target` argument will
739
+ * automatically be normalized to absolute path.
740
+ * @since v10.0.0
741
+ * @param [type='file']
742
+ * @return Fulfills with `undefined` upon success.
743
+ */
744
+ function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
745
+ /**
746
+ * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link,
747
+ * in which case the link itself is stat-ed, not the file that it refers to.
748
+ * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail.
749
+ * @since v10.0.0
750
+ * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`.
751
+ */
752
+ function lstat(
753
+ path: PathLike,
754
+ opts?: StatOptions & {
755
+ bigint?: false | undefined;
756
+ },
757
+ ): Promise<Stats>;
758
+ function lstat(
759
+ path: PathLike,
760
+ opts: StatOptions & {
761
+ bigint: true;
762
+ },
763
+ ): Promise<BigIntStats>;
764
+ function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
765
+ /**
766
+ * @since v10.0.0
767
+ * @return Fulfills with the {fs.Stats} object for the given `path`.
768
+ */
769
+ function stat(
770
+ path: PathLike,
771
+ opts?: StatOptions & {
772
+ bigint?: false | undefined;
773
+ },
774
+ ): Promise<Stats>;
775
+ function stat(
776
+ path: PathLike,
777
+ opts: StatOptions & {
778
+ bigint: true;
779
+ },
780
+ ): Promise<BigIntStats>;
781
+ function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
782
+ /**
783
+ * @since v18.15.0
784
+ * @return Fulfills with an {fs.StatFs} for the file system.
785
+ */
786
+ function statfs(
787
+ path: PathLike,
788
+ opts?: StatFsOptions & {
789
+ bigint?: false | undefined;
790
+ },
791
+ ): Promise<StatsFs>;
792
+ function statfs(
793
+ path: PathLike,
794
+ opts: StatFsOptions & {
795
+ bigint: true;
796
+ },
797
+ ): Promise<BigIntStatsFs>;
798
+ function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
799
+
800
+ /**
801
+ * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
802
+ * @since v10.0.0
803
+ * @return Fulfills with `undefined` upon success.
804
+ */
805
+ function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
806
+ /**
807
+ * If `path` refers to a symbolic link, then the link is removed without affecting
808
+ * the file or directory to which that link refers. If the `path` refers to a file
809
+ * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
810
+ * @since v10.0.0
811
+ * @return Fulfills with `undefined` upon success.
812
+ */
813
+ function unlink(path: PathLike): Promise<void>;
814
+ /**
815
+ * Changes the permissions of a file.
816
+ * @since v10.0.0
817
+ * @return Fulfills with `undefined` upon success.
818
+ */
819
+ function chmod(path: PathLike, mode: Mode): Promise<void>;
820
+ /**
821
+ * Changes the permissions on a symbolic link.
822
+ *
823
+ * This method is only implemented on macOS.
824
+ * @deprecated Since v10.0.0
825
+ * @return Fulfills with `undefined` upon success.
826
+ */
827
+ function lchmod(path: PathLike, mode: Mode): Promise<void>;
828
+ /**
829
+ * Changes the ownership on a symbolic link.
830
+ * @since v10.0.0
831
+ * @return Fulfills with `undefined` upon success.
832
+ */
833
+ function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
834
+ /**
835
+ * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a
836
+ * symbolic link, then the link is not dereferenced: instead, the timestamps of
837
+ * the symbolic link itself are changed.
838
+ * @since v14.5.0, v12.19.0
839
+ * @return Fulfills with `undefined` upon success.
840
+ */
841
+ function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
842
+ /**
843
+ * Changes the ownership of a file.
844
+ * @since v10.0.0
845
+ * @return Fulfills with `undefined` upon success.
846
+ */
847
+ function chown(path: PathLike, uid: number, gid: number): Promise<void>;
848
+ /**
849
+ * Change the file system timestamps of the object referenced by `path`.
850
+ *
851
+ * The `atime` and `mtime` arguments follow these rules:
852
+ *
853
+ * * Values can be either numbers representing Unix epoch time, `Date`s, or a
854
+ * numeric string like `'123456789.0'`.
855
+ * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown.
856
+ * @since v10.0.0
857
+ * @return Fulfills with `undefined` upon success.
858
+ */
859
+ function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
860
+ /**
861
+ * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
862
+ *
863
+ * Only paths that can be converted to UTF8 strings are supported.
864
+ *
865
+ * The optional `options` argument can be a string specifying an encoding, or an
866
+ * object with an `encoding` property specifying the character encoding to use for
867
+ * the path. If the `encoding` is set to `'buffer'`, the path returned will be
868
+ * passed as a `Buffer` object.
869
+ *
870
+ * On Linux, when Node.js is linked against musl libc, the procfs file system must
871
+ * be mounted on `/proc` in order for this function to work. Glibc does not have
872
+ * this restriction.
873
+ * @since v10.0.0
874
+ * @return Fulfills with the resolved path upon success.
875
+ */
876
+ function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
877
+ /**
878
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
879
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
880
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
881
+ */
882
+ function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
883
+ /**
884
+ * Asynchronous realpath(3) - return the canonicalized absolute pathname.
885
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
886
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
887
+ */
888
+ function realpath(
889
+ path: PathLike,
890
+ options?: ObjectEncodingOptions | BufferEncoding | null,
891
+ ): Promise<string | Buffer>;
892
+ /**
893
+ * Creates a unique temporary directory. A unique directory name is generated by
894
+ * appending six random characters to the end of the provided `prefix`. Due to
895
+ * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some
896
+ * platforms, notably the BSDs, can return more than six random characters, and
897
+ * replace trailing `X` characters in `prefix` with random characters.
898
+ *
899
+ * The optional `options` argument can be a string specifying an encoding, or an
900
+ * object with an `encoding` property specifying the character encoding to use.
901
+ *
902
+ * ```js
903
+ * import { mkdtemp } from 'fs/promises';
904
+ *
905
+ * try {
906
+ * await mkdtemp(path.join(os.tmpdir(), 'foo-'));
907
+ * } catch (err) {
908
+ * console.error(err);
909
+ * }
910
+ * ```
911
+ *
912
+ * The `fsPromises.mkdtemp()` method will append the six randomly selected
913
+ * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
914
+ * platform-specific path separator
915
+ * (`import { sep } from 'node:path'`).
916
+ * @since v10.0.0
917
+ * @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
918
+ */
919
+ function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
920
+ /**
921
+ * Asynchronously creates a unique temporary directory.
922
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
923
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
924
+ */
925
+ function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
926
+ /**
927
+ * Asynchronously creates a unique temporary directory.
928
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
929
+ * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
930
+ */
931
+ function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
932
+ /**
933
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
934
+ * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
935
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
936
+ *
937
+ * The `encoding` option is ignored if `data` is a buffer.
938
+ *
939
+ * If `options` is a string, then it specifies the encoding.
940
+ *
941
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
942
+ *
943
+ * Any specified `FileHandle` has to support writing.
944
+ *
945
+ * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
946
+ * without waiting for the promise to be settled.
947
+ *
948
+ * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
949
+ * method that performs multiple `write` calls internally to write the buffer
950
+ * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`.
951
+ *
952
+ * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
953
+ * Cancelation is "best effort", and some amount of data is likely still
954
+ * to be written.
955
+ *
956
+ * ```js
957
+ * import { writeFile } from 'fs/promises';
958
+ * import { Buffer } from 'buffer';
959
+ *
960
+ * try {
961
+ * const controller = new AbortController();
962
+ * const { signal } = controller;
963
+ * const data = new Uint8Array(Buffer.from('Hello Node.js'));
964
+ * const promise = writeFile('message.txt', data, { signal });
965
+ *
966
+ * // Abort the request before the promise settles.
967
+ * controller.abort();
968
+ *
969
+ * await promise;
970
+ * } catch (err) {
971
+ * // When a request is aborted - err is an AbortError
972
+ * console.error(err);
973
+ * }
974
+ * ```
975
+ *
976
+ * Aborting an ongoing request does not abort individual operating
977
+ * system requests but rather the internal buffering `fs.writeFile` performs.
978
+ * @since v10.0.0
979
+ * @param file filename or `FileHandle`
980
+ * @return Fulfills with `undefined` upon success.
981
+ */
982
+ function writeFile(
983
+ file: PathLike | FileHandle,
984
+ data:
985
+ | string
986
+ | NodeJS.ArrayBufferView
987
+ | Iterable<string | NodeJS.ArrayBufferView>
988
+ | AsyncIterable<string | NodeJS.ArrayBufferView>
989
+ | Stream,
990
+ options?:
991
+ | (ObjectEncodingOptions & {
992
+ mode?: Mode | undefined;
993
+ flag?: OpenMode | undefined;
994
+ } & Abortable)
995
+ | BufferEncoding
996
+ | null,
997
+ ): Promise<void>;
998
+ /**
999
+ * Asynchronously append data to a file, creating the file if it does not yet
1000
+ * exist. `data` can be a string or a `Buffer`.
1001
+ *
1002
+ * If `options` is a string, then it specifies the `encoding`.
1003
+ *
1004
+ * The `mode` option only affects the newly created file. See `fs.open()` for more details.
1005
+ *
1006
+ * The `path` may be specified as a `FileHandle` that has been opened
1007
+ * for appending (using `fsPromises.open()`).
1008
+ * @since v10.0.0
1009
+ * @param path filename or {FileHandle}
1010
+ * @return Fulfills with `undefined` upon success.
1011
+ */
1012
+ function appendFile(
1013
+ path: PathLike | FileHandle,
1014
+ data: string | Uint8Array,
1015
+ options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
1016
+ ): Promise<void>;
1017
+ /**
1018
+ * Asynchronously reads the entire contents of a file.
1019
+ *
1020
+ * If no encoding is specified (using `options.encoding`), the data is returned
1021
+ * as a `Buffer` object. Otherwise, the data will be a string.
1022
+ *
1023
+ * If `options` is a string, then it specifies the encoding.
1024
+ *
1025
+ * When the `path` is a directory, the behavior of `fsPromises.readFile()` is
1026
+ * platform-specific. On macOS, Linux, and Windows, the promise will be rejected
1027
+ * with an error. On FreeBSD, a representation of the directory's contents will be
1028
+ * returned.
1029
+ *
1030
+ * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
1031
+ * request is aborted the promise returned is rejected with an `AbortError`:
1032
+ *
1033
+ * ```js
1034
+ * import { readFile } from 'fs/promises';
1035
+ *
1036
+ * try {
1037
+ * const controller = new AbortController();
1038
+ * const { signal } = controller;
1039
+ * const promise = readFile(fileName, { signal });
1040
+ *
1041
+ * // Abort the request before the promise settles.
1042
+ * controller.abort();
1043
+ *
1044
+ * await promise;
1045
+ * } catch (err) {
1046
+ * // When a request is aborted - err is an AbortError
1047
+ * console.error(err);
1048
+ * }
1049
+ * ```
1050
+ *
1051
+ * Aborting an ongoing request does not abort individual operating
1052
+ * system requests but rather the internal buffering `fs.readFile` performs.
1053
+ *
1054
+ * Any specified `FileHandle` has to support reading.
1055
+ * @since v10.0.0
1056
+ * @param path filename or `FileHandle`
1057
+ * @return Fulfills with the contents of the file.
1058
+ */
1059
+ function readFile(
1060
+ path: PathLike | FileHandle,
1061
+ options?:
1062
+ | ({
1063
+ encoding?: null | undefined;
1064
+ flag?: OpenMode | undefined;
1065
+ } & Abortable)
1066
+ | null,
1067
+ ): Promise<Buffer>;
1068
+ /**
1069
+ * Asynchronously reads the entire contents of a file.
1070
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1071
+ * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
1072
+ * @param options An object that may contain an optional flag.
1073
+ * If a flag is not provided, it defaults to `'r'`.
1074
+ */
1075
+ function readFile(
1076
+ path: PathLike | FileHandle,
1077
+ options:
1078
+ | ({
1079
+ encoding: BufferEncoding;
1080
+ flag?: OpenMode | undefined;
1081
+ } & Abortable)
1082
+ | BufferEncoding,
1083
+ ): Promise<string>;
1084
+ /**
1085
+ * Asynchronously reads the entire contents of a file.
1086
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1087
+ * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
1088
+ * @param options An object that may contain an optional flag.
1089
+ * If a flag is not provided, it defaults to `'r'`.
1090
+ */
1091
+ function readFile(
1092
+ path: PathLike | FileHandle,
1093
+ options?:
1094
+ | (
1095
+ & ObjectEncodingOptions
1096
+ & Abortable
1097
+ & {
1098
+ flag?: OpenMode | undefined;
1099
+ }
1100
+ )
1101
+ | BufferEncoding
1102
+ | null,
1103
+ ): Promise<string | Buffer>;
1104
+ /**
1105
+ * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
1106
+ *
1107
+ * Creates an `fs.Dir`, which contains all further functions for reading from
1108
+ * and cleaning up the directory.
1109
+ *
1110
+ * The `encoding` option sets the encoding for the `path` while opening the
1111
+ * directory and subsequent read operations.
1112
+ *
1113
+ * Example using async iteration:
1114
+ *
1115
+ * ```js
1116
+ * import { opendir } from 'fs/promises';
1117
+ *
1118
+ * try {
1119
+ * const dir = await opendir('./');
1120
+ * for await (const dirent of dir)
1121
+ * console.log(dirent.name);
1122
+ * } catch (err) {
1123
+ * console.error(err);
1124
+ * }
1125
+ * ```
1126
+ *
1127
+ * When using the async iterator, the `fs.Dir` object will be automatically
1128
+ * closed after the iterator exits.
1129
+ * @since v12.12.0
1130
+ * @return Fulfills with an {fs.Dir}.
1131
+ */
1132
+ function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
1133
+ /**
1134
+ * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
1135
+ *
1136
+ * ```js
1137
+ * import { watch } from 'node:fs/promises';
1138
+ *
1139
+ * const ac = new AbortController();
1140
+ * const { signal } = ac;
1141
+ * setTimeout(() => ac.abort(), 10000);
1142
+ *
1143
+ * (async () => {
1144
+ * try {
1145
+ * const watcher = watch(__filename, { signal });
1146
+ * for await (const event of watcher)
1147
+ * console.log(event);
1148
+ * } catch (err) {
1149
+ * if (err.name === 'AbortError')
1150
+ * return;
1151
+ * throw err;
1152
+ * }
1153
+ * })();
1154
+ * ```
1155
+ *
1156
+ * On most platforms, `'rename'` is emitted whenever a filename appears or
1157
+ * disappears in the directory.
1158
+ *
1159
+ * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
1160
+ * @since v15.9.0, v14.18.0
1161
+ * @return of objects with the properties:
1162
+ */
1163
+ function watch(
1164
+ filename: PathLike,
1165
+ options:
1166
+ | (WatchOptions & {
1167
+ encoding: "buffer";
1168
+ })
1169
+ | "buffer",
1170
+ ): AsyncIterable<FileChangeInfo<Buffer>>;
1171
+ /**
1172
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1173
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1174
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1175
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
1176
+ * If `persistent` is not supplied, the default of `true` is used.
1177
+ * If `recursive` is not supplied, the default of `false` is used.
1178
+ */
1179
+ function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
1180
+ /**
1181
+ * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1182
+ * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1183
+ * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1184
+ * If `encoding` is not supplied, the default of `'utf8'` is used.
1185
+ * If `persistent` is not supplied, the default of `true` is used.
1186
+ * If `recursive` is not supplied, the default of `false` is used.
1187
+ */
1188
+ function watch(
1189
+ filename: PathLike,
1190
+ options: WatchOptions | string,
1191
+ ): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
1192
+ /**
1193
+ * Asynchronously copies the entire directory structure from `src` to `dest`,
1194
+ * including subdirectories and files.
1195
+ *
1196
+ * When copying a directory to another directory, globs are not supported and
1197
+ * behavior is similar to `cp dir1/ dir2/`.
1198
+ * @since v16.7.0
1199
+ * @experimental
1200
+ * @param src source path to copy.
1201
+ * @param dest destination path to copy to.
1202
+ * @return Fulfills with `undefined` upon success.
1203
+ */
1204
+ function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
1205
+ }
1206
+ declare module "node:fs/promises" {
1207
+ export * from "fs/promises";
1208
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/readline/promises.d.ts ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time.
3
+ *
4
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js)
5
+ * @since v17.0.0
6
+ */
7
+ declare module "readline/promises" {
8
+ import { Abortable } from "node:events";
9
+ import {
10
+ CompleterResult,
11
+ Direction,
12
+ Interface as _Interface,
13
+ ReadLineOptions as _ReadLineOptions,
14
+ } from "node:readline";
15
+
16
+ class Interface extends _Interface {
17
+ /**
18
+ * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input,
19
+ * then invokes the callback function passing the provided input as the first argument.
20
+ *
21
+ * When called, rl.question() will resume the input stream if it has been paused.
22
+ *
23
+ * If the readlinePromises.Interface was created with output set to null or undefined the query is not written.
24
+ *
25
+ * If the question is called after rl.close(), it returns a rejected promise.
26
+ *
27
+ * Example usage:
28
+ *
29
+ * ```js
30
+ * const answer = await rl.question('What is your favorite food? ');
31
+ * console.log(`Oh, so your favorite food is ${answer}`);
32
+ * ```
33
+ *
34
+ * Using an AbortSignal to cancel a question.
35
+ *
36
+ * ```js
37
+ * const signal = AbortSignal.timeout(10_000);
38
+ *
39
+ * signal.addEventListener('abort', () => {
40
+ * console.log('The food question timed out');
41
+ * }, { once: true });
42
+ *
43
+ * const answer = await rl.question('What is your favorite food? ', { signal });
44
+ * console.log(`Oh, so your favorite food is ${answer}`);
45
+ * ```
46
+ *
47
+ * @since v17.0.0
48
+ * @param query A statement or query to write to output, prepended to the prompt.
49
+ */
50
+ question(query: string): Promise<string>;
51
+ question(query: string, options: Abortable): Promise<string>;
52
+ }
53
+
54
+ class Readline {
55
+ /**
56
+ * @param stream A TTY stream.
57
+ */
58
+ constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean });
59
+ /**
60
+ * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`.
61
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
62
+ */
63
+ clearLine(dir: Direction): this;
64
+ /**
65
+ * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down.
66
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
67
+ */
68
+ clearScreenDown(): this;
69
+ /**
70
+ * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
71
+ */
72
+ commit(): Promise<void>;
73
+ /**
74
+ * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`.
75
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
76
+ */
77
+ cursorTo(x: number, y?: number): this;
78
+ /**
79
+ * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`.
80
+ * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor.
81
+ */
82
+ moveCursor(dx: number, dy: number): this;
83
+ /**
84
+ * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`.
85
+ */
86
+ rollback(): this;
87
+ }
88
+ type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
89
+ interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
90
+ /**
91
+ * An optional function used for Tab autocompletion.
92
+ */
93
+ completer?: Completer | undefined;
94
+ }
95
+ /**
96
+ * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
97
+ *
98
+ * ```js
99
+ * import readlinePromises from 'node:readline/promises';
100
+ * const rl = readlinePromises.createInterface({
101
+ * input: process.stdin,
102
+ * output: process.stdout
103
+ * });
104
+ * ```
105
+ *
106
+ * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event:
107
+ *
108
+ * ```js
109
+ * rl.on('line', (line) => {
110
+ * console.log(`Received: ${line}`);
111
+ * });
112
+ * ```
113
+ *
114
+ * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property,
115
+ * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY).
116
+ *
117
+ * ## Use of the `completer` function
118
+ *
119
+ * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries:
120
+ *
121
+ * - An Array with matching entries for the completion.
122
+ * - The substring that was used for the matching.
123
+ *
124
+ * For instance: `[[substr1, substr2, ...], originalsubstring]`.
125
+ *
126
+ * ```js
127
+ * function completer(line) {
128
+ * const completions = '.help .error .exit .quit .q'.split(' ');
129
+ * const hits = completions.filter((c) => c.startsWith(line));
130
+ * // Show all completions if none found
131
+ * return [hits.length ? hits : completions, line];
132
+ * }
133
+ * ```
134
+ *
135
+ * The `completer` function can also returns a `Promise`, or be asynchronous:
136
+ *
137
+ * ```js
138
+ * async function completer(linePartial) {
139
+ * await someAsyncWork();
140
+ * return [['123'], linePartial];
141
+ * }
142
+ * ```
143
+ */
144
+ function createInterface(
145
+ input: NodeJS.ReadableStream,
146
+ output?: NodeJS.WritableStream,
147
+ completer?: Completer,
148
+ terminal?: boolean,
149
+ ): Interface;
150
+ function createInterface(options: ReadLineOptions): Interface;
151
+ }
152
+ declare module "node:readline/promises" {
153
+ export * from "readline/promises";
154
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/stream/consumers.d.ts ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The utility consumer functions provide common options for consuming
3
+ * streams.
4
+ * @since v16.7.0
5
+ */
6
+ declare module "stream/consumers" {
7
+ import { Blob as NodeBlob } from "node:buffer";
8
+ import { ReadableStream as WebReadableStream } from "node:stream/web";
9
+ /**
10
+ * @since v16.7.0
11
+ * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream.
12
+ */
13
+ function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<ArrayBuffer>;
14
+ /**
15
+ * @since v16.7.0
16
+ * @returns Fulfills with a `Blob` containing the full contents of the stream.
17
+ */
18
+ function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NodeBlob>;
19
+ /**
20
+ * @since v16.7.0
21
+ * @returns Fulfills with a `Buffer` containing the full contents of the stream.
22
+ */
23
+ function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<Buffer>;
24
+ /**
25
+ * @since v16.7.0
26
+ * @returns Fulfills with the contents of the stream parsed as a
27
+ * UTF-8 encoded string that is then passed through `JSON.parse()`.
28
+ */
29
+ function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<unknown>;
30
+ /**
31
+ * @since v16.7.0
32
+ * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string.
33
+ */
34
+ function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<string>;
35
+ }
36
+ declare module "node:stream/consumers" {
37
+ export * from "stream/consumers";
38
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/stream/promises.d.ts ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ declare module "stream/promises" {
2
+ import {
3
+ FinishedOptions as _FinishedOptions,
4
+ PipelineDestination,
5
+ PipelineOptions,
6
+ PipelinePromise,
7
+ PipelineSource,
8
+ PipelineTransform,
9
+ } from "node:stream";
10
+ interface FinishedOptions extends _FinishedOptions {
11
+ /**
12
+ * If true, removes the listeners registered by this function before the promise is fulfilled.
13
+ * @default false
14
+ */
15
+ cleanup?: boolean | undefined;
16
+ }
17
+ function finished(
18
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
19
+ options?: FinishedOptions,
20
+ ): Promise<void>;
21
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
22
+ source: A,
23
+ destination: B,
24
+ options?: PipelineOptions,
25
+ ): PipelinePromise<B>;
26
+ function pipeline<
27
+ A extends PipelineSource<any>,
28
+ T1 extends PipelineTransform<A, any>,
29
+ B extends PipelineDestination<T1, any>,
30
+ >(
31
+ source: A,
32
+ transform1: T1,
33
+ destination: B,
34
+ options?: PipelineOptions,
35
+ ): PipelinePromise<B>;
36
+ function pipeline<
37
+ A extends PipelineSource<any>,
38
+ T1 extends PipelineTransform<A, any>,
39
+ T2 extends PipelineTransform<T1, any>,
40
+ B extends PipelineDestination<T2, any>,
41
+ >(
42
+ source: A,
43
+ transform1: T1,
44
+ transform2: T2,
45
+ destination: B,
46
+ options?: PipelineOptions,
47
+ ): PipelinePromise<B>;
48
+ function pipeline<
49
+ A extends PipelineSource<any>,
50
+ T1 extends PipelineTransform<A, any>,
51
+ T2 extends PipelineTransform<T1, any>,
52
+ T3 extends PipelineTransform<T2, any>,
53
+ B extends PipelineDestination<T3, any>,
54
+ >(
55
+ source: A,
56
+ transform1: T1,
57
+ transform2: T2,
58
+ transform3: T3,
59
+ destination: B,
60
+ options?: PipelineOptions,
61
+ ): PipelinePromise<B>;
62
+ function pipeline<
63
+ A extends PipelineSource<any>,
64
+ T1 extends PipelineTransform<A, any>,
65
+ T2 extends PipelineTransform<T1, any>,
66
+ T3 extends PipelineTransform<T2, any>,
67
+ T4 extends PipelineTransform<T3, any>,
68
+ B extends PipelineDestination<T4, any>,
69
+ >(
70
+ source: A,
71
+ transform1: T1,
72
+ transform2: T2,
73
+ transform3: T3,
74
+ transform4: T4,
75
+ destination: B,
76
+ options?: PipelineOptions,
77
+ ): PipelinePromise<B>;
78
+ function pipeline(
79
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
80
+ options?: PipelineOptions,
81
+ ): Promise<void>;
82
+ function pipeline(
83
+ stream1: NodeJS.ReadableStream,
84
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
85
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
86
+ ): Promise<void>;
87
+ }
88
+ declare module "node:stream/promises" {
89
+ export * from "stream/promises";
90
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/stream/web.d.ts ADDED
@@ -0,0 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
2
+ : import("stream/web").ByteLengthQueuingStrategy;
3
+ type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
4
+ : import("stream/web").CompressionStream;
5
+ type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
6
+ : import("stream/web").CountQueuingStrategy;
7
+ type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
8
+ : import("stream/web").DecompressionStream;
9
+ type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
10
+ : import("stream/web").ReadableByteStreamController;
11
+ type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
12
+ : import("stream/web").ReadableStream<R>;
13
+ type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
14
+ : import("stream/web").ReadableStreamBYOBReader;
15
+ type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
16
+ : import("stream/web").ReadableStreamBYOBRequest;
17
+ type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
18
+ : import("stream/web").ReadableStreamDefaultController<R>;
19
+ type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
20
+ : import("stream/web").ReadableStreamDefaultReader<R>;
21
+ type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {}
22
+ : import("stream/web").TextDecoderStream;
23
+ type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {}
24
+ : import("stream/web").TextEncoderStream;
25
+ type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
26
+ : import("stream/web").TransformStream<I, O>;
27
+ type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
28
+ : import("stream/web").TransformStreamDefaultController<O>;
29
+ type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {}
30
+ : import("stream/web").WritableStream<W>;
31
+ type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
32
+ : import("stream/web").WritableStreamDefaultController;
33
+ type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
34
+ : import("stream/web").WritableStreamDefaultWriter<W>;
35
+
36
+ declare module "stream/web" {
37
+ // stub module, pending copy&paste from .d.ts or manual impl
38
+ // copy from lib.dom.d.ts
39
+ interface ReadableWritablePair<R = any, W = any> {
40
+ readable: ReadableStream<R>;
41
+ /**
42
+ * Provides a convenient, chainable way of piping this readable stream
43
+ * through a transform stream (or any other { writable, readable }
44
+ * pair). It simply pipes the stream into the writable side of the
45
+ * supplied pair, and returns the readable side for further use.
46
+ *
47
+ * Piping a stream will lock it for the duration of the pipe, preventing
48
+ * any other consumer from acquiring a reader.
49
+ */
50
+ writable: WritableStream<W>;
51
+ }
52
+ interface StreamPipeOptions {
53
+ preventAbort?: boolean;
54
+ preventCancel?: boolean;
55
+ /**
56
+ * Pipes this readable stream to a given writable stream destination.
57
+ * The way in which the piping process behaves under various error
58
+ * conditions can be customized with a number of passed options. It
59
+ * returns a promise that fulfills when the piping process completes
60
+ * successfully, or rejects if any errors were encountered.
61
+ *
62
+ * Piping a stream will lock it for the duration of the pipe, preventing
63
+ * any other consumer from acquiring a reader.
64
+ *
65
+ * Errors and closures of the source and destination streams propagate
66
+ * as follows:
67
+ *
68
+ * An error in this source readable stream will abort destination,
69
+ * unless preventAbort is truthy. The returned promise will be rejected
70
+ * with the source's error, or with any error that occurs during
71
+ * aborting the destination.
72
+ *
73
+ * An error in destination will cancel this source readable stream,
74
+ * unless preventCancel is truthy. The returned promise will be rejected
75
+ * with the destination's error, or with any error that occurs during
76
+ * canceling the source.
77
+ *
78
+ * When this source readable stream closes, destination will be closed,
79
+ * unless preventClose is truthy. The returned promise will be fulfilled
80
+ * once this process completes, unless an error is encountered while
81
+ * closing the destination, in which case it will be rejected with that
82
+ * error.
83
+ *
84
+ * If destination starts out closed or closing, this source readable
85
+ * stream will be canceled, unless preventCancel is true. The returned
86
+ * promise will be rejected with an error indicating piping to a closed
87
+ * stream failed, or with any error that occurs during canceling the
88
+ * source.
89
+ *
90
+ * The signal option can be set to an AbortSignal to allow aborting an
91
+ * ongoing pipe operation via the corresponding AbortController. In this
92
+ * case, this source readable stream will be canceled, and destination
93
+ * aborted, unless the respective options preventCancel or preventAbort
94
+ * are set.
95
+ */
96
+ preventClose?: boolean;
97
+ signal?: AbortSignal;
98
+ }
99
+ interface ReadableStreamGenericReader {
100
+ readonly closed: Promise<void>;
101
+ cancel(reason?: any): Promise<void>;
102
+ }
103
+ type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
104
+ interface ReadableStreamReadValueResult<T> {
105
+ done: false;
106
+ value: T;
107
+ }
108
+ interface ReadableStreamReadDoneResult<T> {
109
+ done: true;
110
+ value?: T;
111
+ }
112
+ type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
113
+ interface ReadableByteStreamControllerCallback {
114
+ (controller: ReadableByteStreamController): void | PromiseLike<void>;
115
+ }
116
+ interface UnderlyingSinkAbortCallback {
117
+ (reason?: any): void | PromiseLike<void>;
118
+ }
119
+ interface UnderlyingSinkCloseCallback {
120
+ (): void | PromiseLike<void>;
121
+ }
122
+ interface UnderlyingSinkStartCallback {
123
+ (controller: WritableStreamDefaultController): any;
124
+ }
125
+ interface UnderlyingSinkWriteCallback<W> {
126
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
127
+ }
128
+ interface UnderlyingSourceCancelCallback {
129
+ (reason?: any): void | PromiseLike<void>;
130
+ }
131
+ interface UnderlyingSourcePullCallback<R> {
132
+ (controller: ReadableStreamController<R>): void | PromiseLike<void>;
133
+ }
134
+ interface UnderlyingSourceStartCallback<R> {
135
+ (controller: ReadableStreamController<R>): any;
136
+ }
137
+ interface TransformerFlushCallback<O> {
138
+ (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
139
+ }
140
+ interface TransformerStartCallback<O> {
141
+ (controller: TransformStreamDefaultController<O>): any;
142
+ }
143
+ interface TransformerTransformCallback<I, O> {
144
+ (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
145
+ }
146
+ interface UnderlyingByteSource {
147
+ autoAllocateChunkSize?: number;
148
+ cancel?: ReadableStreamErrorCallback;
149
+ pull?: ReadableByteStreamControllerCallback;
150
+ start?: ReadableByteStreamControllerCallback;
151
+ type: "bytes";
152
+ }
153
+ interface UnderlyingSource<R = any> {
154
+ cancel?: UnderlyingSourceCancelCallback;
155
+ pull?: UnderlyingSourcePullCallback<R>;
156
+ start?: UnderlyingSourceStartCallback<R>;
157
+ type?: undefined;
158
+ }
159
+ interface UnderlyingSink<W = any> {
160
+ abort?: UnderlyingSinkAbortCallback;
161
+ close?: UnderlyingSinkCloseCallback;
162
+ start?: UnderlyingSinkStartCallback;
163
+ type?: undefined;
164
+ write?: UnderlyingSinkWriteCallback<W>;
165
+ }
166
+ interface ReadableStreamErrorCallback {
167
+ (reason: any): void | PromiseLike<void>;
168
+ }
169
+ interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
170
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
171
+ }
172
+ /** This Streams API interface represents a readable stream of byte data. */
173
+ interface ReadableStream<R = any> {
174
+ readonly locked: boolean;
175
+ cancel(reason?: any): Promise<void>;
176
+ getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
177
+ getReader(): ReadableStreamDefaultReader<R>;
178
+ getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
179
+ pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
180
+ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
181
+ tee(): [ReadableStream<R>, ReadableStream<R>];
182
+ values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
183
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
184
+ }
185
+ const ReadableStream: {
186
+ prototype: ReadableStream;
187
+ new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
188
+ new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
189
+ };
190
+ type ReadableStreamReaderMode = "byob";
191
+ interface ReadableStreamGetReaderOptions {
192
+ /**
193
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
194
+ *
195
+ * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
196
+ */
197
+ mode?: ReadableStreamReaderMode;
198
+ }
199
+ type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
200
+ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
201
+ read(): Promise<ReadableStreamReadResult<R>>;
202
+ releaseLock(): void;
203
+ }
204
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
205
+ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
206
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
207
+ read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
208
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
209
+ releaseLock(): void;
210
+ }
211
+ const ReadableStreamDefaultReader: {
212
+ prototype: ReadableStreamDefaultReader;
213
+ new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
214
+ };
215
+ const ReadableStreamBYOBReader: {
216
+ prototype: ReadableStreamBYOBReader;
217
+ new(stream: ReadableStream): ReadableStreamBYOBReader;
218
+ };
219
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
220
+ interface ReadableStreamBYOBRequest {
221
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
222
+ readonly view: ArrayBufferView | null;
223
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
224
+ respond(bytesWritten: number): void;
225
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
226
+ respondWithNewView(view: ArrayBufferView): void;
227
+ }
228
+ const ReadableStreamBYOBRequest: {
229
+ prototype: ReadableStreamBYOBRequest;
230
+ new(): ReadableStreamBYOBRequest;
231
+ };
232
+ interface ReadableByteStreamController {
233
+ readonly byobRequest: undefined;
234
+ readonly desiredSize: number | null;
235
+ close(): void;
236
+ enqueue(chunk: ArrayBufferView): void;
237
+ error(error?: any): void;
238
+ }
239
+ const ReadableByteStreamController: {
240
+ prototype: ReadableByteStreamController;
241
+ new(): ReadableByteStreamController;
242
+ };
243
+ interface ReadableStreamDefaultController<R = any> {
244
+ readonly desiredSize: number | null;
245
+ close(): void;
246
+ enqueue(chunk?: R): void;
247
+ error(e?: any): void;
248
+ }
249
+ const ReadableStreamDefaultController: {
250
+ prototype: ReadableStreamDefaultController;
251
+ new(): ReadableStreamDefaultController;
252
+ };
253
+ interface Transformer<I = any, O = any> {
254
+ flush?: TransformerFlushCallback<O>;
255
+ readableType?: undefined;
256
+ start?: TransformerStartCallback<O>;
257
+ transform?: TransformerTransformCallback<I, O>;
258
+ writableType?: undefined;
259
+ }
260
+ interface TransformStream<I = any, O = any> {
261
+ readonly readable: ReadableStream<O>;
262
+ readonly writable: WritableStream<I>;
263
+ }
264
+ const TransformStream: {
265
+ prototype: TransformStream;
266
+ new<I = any, O = any>(
267
+ transformer?: Transformer<I, O>,
268
+ writableStrategy?: QueuingStrategy<I>,
269
+ readableStrategy?: QueuingStrategy<O>,
270
+ ): TransformStream<I, O>;
271
+ };
272
+ interface TransformStreamDefaultController<O = any> {
273
+ readonly desiredSize: number | null;
274
+ enqueue(chunk?: O): void;
275
+ error(reason?: any): void;
276
+ terminate(): void;
277
+ }
278
+ const TransformStreamDefaultController: {
279
+ prototype: TransformStreamDefaultController;
280
+ new(): TransformStreamDefaultController;
281
+ };
282
+ /**
283
+ * This Streams API interface provides a standard abstraction for writing
284
+ * streaming data to a destination, known as a sink. This object comes with
285
+ * built-in back pressure and queuing.
286
+ */
287
+ interface WritableStream<W = any> {
288
+ readonly locked: boolean;
289
+ abort(reason?: any): Promise<void>;
290
+ close(): Promise<void>;
291
+ getWriter(): WritableStreamDefaultWriter<W>;
292
+ }
293
+ const WritableStream: {
294
+ prototype: WritableStream;
295
+ new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
296
+ };
297
+ /**
298
+ * This Streams API interface is the object returned by
299
+ * WritableStream.getWriter() and once created locks the < writer to the
300
+ * WritableStream ensuring that no other streams can write to the underlying
301
+ * sink.
302
+ */
303
+ interface WritableStreamDefaultWriter<W = any> {
304
+ readonly closed: Promise<void>;
305
+ readonly desiredSize: number | null;
306
+ readonly ready: Promise<void>;
307
+ abort(reason?: any): Promise<void>;
308
+ close(): Promise<void>;
309
+ releaseLock(): void;
310
+ write(chunk?: W): Promise<void>;
311
+ }
312
+ const WritableStreamDefaultWriter: {
313
+ prototype: WritableStreamDefaultWriter;
314
+ new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
315
+ };
316
+ /**
317
+ * This Streams API interface represents a controller allowing control of a
318
+ * WritableStream's state. When constructing a WritableStream, the
319
+ * underlying sink is given a corresponding WritableStreamDefaultController
320
+ * instance to manipulate.
321
+ */
322
+ interface WritableStreamDefaultController {
323
+ error(e?: any): void;
324
+ }
325
+ const WritableStreamDefaultController: {
326
+ prototype: WritableStreamDefaultController;
327
+ new(): WritableStreamDefaultController;
328
+ };
329
+ interface QueuingStrategy<T = any> {
330
+ highWaterMark?: number;
331
+ size?: QueuingStrategySize<T>;
332
+ }
333
+ interface QueuingStrategySize<T = any> {
334
+ (chunk?: T): number;
335
+ }
336
+ interface QueuingStrategyInit {
337
+ /**
338
+ * Creates a new ByteLengthQueuingStrategy with the provided high water
339
+ * mark.
340
+ *
341
+ * Note that the provided high water mark will not be validated ahead of
342
+ * time. Instead, if it is negative, NaN, or not a number, the resulting
343
+ * ByteLengthQueuingStrategy will cause the corresponding stream
344
+ * constructor to throw.
345
+ */
346
+ highWaterMark: number;
347
+ }
348
+ /**
349
+ * This Streams API interface provides a built-in byte length queuing
350
+ * strategy that can be used when constructing streams.
351
+ */
352
+ interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
353
+ readonly highWaterMark: number;
354
+ readonly size: QueuingStrategySize<ArrayBufferView>;
355
+ }
356
+ const ByteLengthQueuingStrategy: {
357
+ prototype: ByteLengthQueuingStrategy;
358
+ new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
359
+ };
360
+ /**
361
+ * This Streams API interface provides a built-in byte length queuing
362
+ * strategy that can be used when constructing streams.
363
+ */
364
+ interface CountQueuingStrategy extends QueuingStrategy {
365
+ readonly highWaterMark: number;
366
+ readonly size: QueuingStrategySize;
367
+ }
368
+ const CountQueuingStrategy: {
369
+ prototype: CountQueuingStrategy;
370
+ new(init: QueuingStrategyInit): CountQueuingStrategy;
371
+ };
372
+ interface TextEncoderStream {
373
+ /** Returns "utf-8". */
374
+ readonly encoding: "utf-8";
375
+ readonly readable: ReadableStream<Uint8Array>;
376
+ readonly writable: WritableStream<string>;
377
+ readonly [Symbol.toStringTag]: string;
378
+ }
379
+ const TextEncoderStream: {
380
+ prototype: TextEncoderStream;
381
+ new(): TextEncoderStream;
382
+ };
383
+ interface TextDecoderOptions {
384
+ fatal?: boolean;
385
+ ignoreBOM?: boolean;
386
+ }
387
+ type BufferSource = ArrayBufferView | ArrayBuffer;
388
+ interface TextDecoderStream {
389
+ /** Returns encoding's name, lower cased. */
390
+ readonly encoding: string;
391
+ /** Returns `true` if error mode is "fatal", and `false` otherwise. */
392
+ readonly fatal: boolean;
393
+ /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
394
+ readonly ignoreBOM: boolean;
395
+ readonly readable: ReadableStream<string>;
396
+ readonly writable: WritableStream<BufferSource>;
397
+ readonly [Symbol.toStringTag]: string;
398
+ }
399
+ const TextDecoderStream: {
400
+ prototype: TextDecoderStream;
401
+ new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
402
+ };
403
+ interface CompressionStream {
404
+ readonly readable: ReadableStream;
405
+ readonly writable: WritableStream;
406
+ }
407
+ const CompressionStream: {
408
+ prototype: CompressionStream;
409
+ new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream;
410
+ };
411
+ interface DecompressionStream {
412
+ readonly writable: WritableStream;
413
+ readonly readable: ReadableStream;
414
+ }
415
+ const DecompressionStream: {
416
+ prototype: DecompressionStream;
417
+ new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream;
418
+ };
419
+
420
+ global {
421
+ interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
422
+ var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T }
423
+ ? T
424
+ : typeof import("stream/web").ByteLengthQueuingStrategy;
425
+
426
+ interface CompressionStream extends _CompressionStream {}
427
+ var CompressionStream: typeof globalThis extends {
428
+ onmessage: any;
429
+ // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
430
+ // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
431
+ ReportingObserver: any;
432
+ CompressionStream: infer T;
433
+ } ? T
434
+ // TS 4.8, 4.9, 5.0
435
+ : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
436
+ prototype: T;
437
+ new(format: "deflate" | "deflate-raw" | "gzip"): T;
438
+ }
439
+ : typeof import("stream/web").CompressionStream;
440
+
441
+ interface CountQueuingStrategy extends _CountQueuingStrategy {}
442
+ var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
443
+ : typeof import("stream/web").CountQueuingStrategy;
444
+
445
+ interface DecompressionStream extends _DecompressionStream {}
446
+ var DecompressionStream: typeof globalThis extends {
447
+ onmessage: any;
448
+ // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
449
+ // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
450
+ ReportingObserver: any;
451
+ DecompressionStream: infer T;
452
+ } ? T
453
+ // TS 4.8, 4.9, 5.0
454
+ : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
455
+ prototype: T;
456
+ new(format: "deflate" | "deflate-raw" | "gzip"): T;
457
+ }
458
+ : typeof import("stream/web").DecompressionStream;
459
+
460
+ interface ReadableByteStreamController extends _ReadableByteStreamController {}
461
+ var ReadableByteStreamController: typeof globalThis extends
462
+ { onmessage: any; ReadableByteStreamController: infer T } ? T
463
+ : typeof import("stream/web").ReadableByteStreamController;
464
+
465
+ interface ReadableStream<R = any> extends _ReadableStream<R> {}
466
+ var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
467
+ : typeof import("stream/web").ReadableStream;
468
+
469
+ interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
470
+ var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
471
+ ? T
472
+ : typeof import("stream/web").ReadableStreamBYOBReader;
473
+
474
+ interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
475
+ var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
476
+ ? T
477
+ : typeof import("stream/web").ReadableStreamBYOBRequest;
478
+
479
+ interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
480
+ var ReadableStreamDefaultController: typeof globalThis extends
481
+ { onmessage: any; ReadableStreamDefaultController: infer T } ? T
482
+ : typeof import("stream/web").ReadableStreamDefaultController;
483
+
484
+ interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
485
+ var ReadableStreamDefaultReader: typeof globalThis extends
486
+ { onmessage: any; ReadableStreamDefaultReader: infer T } ? T
487
+ : typeof import("stream/web").ReadableStreamDefaultReader;
488
+
489
+ interface TextDecoderStream extends _TextDecoderStream {}
490
+ var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
491
+ : typeof import("stream/web").TextDecoderStream;
492
+
493
+ interface TextEncoderStream extends _TextEncoderStream {}
494
+ var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
495
+ : typeof import("stream/web").TextEncoderStream;
496
+
497
+ interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
498
+ var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
499
+ : typeof import("stream/web").TransformStream;
500
+
501
+ interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
502
+ var TransformStreamDefaultController: typeof globalThis extends
503
+ { onmessage: any; TransformStreamDefaultController: infer T } ? T
504
+ : typeof import("stream/web").TransformStreamDefaultController;
505
+
506
+ interface WritableStream<W = any> extends _WritableStream<W> {}
507
+ var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
508
+ : typeof import("stream/web").WritableStream;
509
+
510
+ interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
511
+ var WritableStreamDefaultController: typeof globalThis extends
512
+ { onmessage: any; WritableStreamDefaultController: infer T } ? T
513
+ : typeof import("stream/web").WritableStreamDefaultController;
514
+
515
+ interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
516
+ var WritableStreamDefaultWriter: typeof globalThis extends
517
+ { onmessage: any; WritableStreamDefaultWriter: infer T } ? T
518
+ : typeof import("stream/web").WritableStreamDefaultWriter;
519
+ }
520
+ }
521
+ declare module "node:stream/web" {
522
+ export * from "stream/web";
523
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/string_decoder.d.ts ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `node:string_decoder` module provides an API for decoding `Buffer` objects
3
+ * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
4
+ * characters. It can be accessed using:
5
+ *
6
+ * ```js
7
+ * import { StringDecoder } from 'node:string_decoder';
8
+ * ```
9
+ *
10
+ * The following example shows the basic use of the `StringDecoder` class.
11
+ *
12
+ * ```js
13
+ * import { StringDecoder } from 'node:string_decoder';
14
+ * const decoder = new StringDecoder('utf8');
15
+ *
16
+ * const cent = Buffer.from([0xC2, 0xA2]);
17
+ * console.log(decoder.write(cent)); // Prints: ¢
18
+ *
19
+ * const euro = Buffer.from([0xE2, 0x82, 0xAC]);
20
+ * console.log(decoder.write(euro)); // Prints: €
21
+ * ```
22
+ *
23
+ * When a `Buffer` instance is written to the `StringDecoder` instance, an
24
+ * internal buffer is used to ensure that the decoded string does not contain
25
+ * any incomplete multibyte characters. These are held in the buffer until the
26
+ * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
27
+ *
28
+ * In the following example, the three UTF-8 encoded bytes of the European Euro
29
+ * symbol (`€`) are written over three separate operations:
30
+ *
31
+ * ```js
32
+ * import { StringDecoder } from 'node:string_decoder';
33
+ * const decoder = new StringDecoder('utf8');
34
+ *
35
+ * decoder.write(Buffer.from([0xE2]));
36
+ * decoder.write(Buffer.from([0x82]));
37
+ * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
38
+ * ```
39
+ * @see [source](https://github.com/nodejs/node/blob/v18.19.0/lib/string_decoder.js)
40
+ */
41
+ declare module "string_decoder" {
42
+ class StringDecoder {
43
+ constructor(encoding?: BufferEncoding);
44
+ /**
45
+ * Returns a decoded string, ensuring that any incomplete multibyte characters at
46
+ * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
47
+ * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`.
48
+ * @since v0.1.99
49
+ * @param buffer The bytes to decode.
50
+ */
51
+ write(buffer: string | Buffer | NodeJS.ArrayBufferView): string;
52
+ /**
53
+ * Returns any remaining input stored in the internal buffer as a string. Bytes
54
+ * representing incomplete UTF-8 and UTF-16 characters will be replaced with
55
+ * substitution characters appropriate for the character encoding.
56
+ *
57
+ * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input.
58
+ * After `end()` is called, the `stringDecoder` object can be reused for new input.
59
+ * @since v0.9.3
60
+ * @param buffer The bytes to decode.
61
+ */
62
+ end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string;
63
+ }
64
+ }
65
+ declare module "node:string_decoder" {
66
+ export * from "string_decoder";
67
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/test.d.ts ADDED
@@ -0,0 +1,1208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `node:test` module provides a standalone testing module.
3
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js)
4
+ */
5
+ declare module "node:test" {
6
+ import TestFn = test.TestFn;
7
+ import TestOptions = test.TestOptions;
8
+ /**
9
+ * The `test()` function is the value imported from the test module. Each invocation of this
10
+ * function results in reporting the test to the {@link TestsStream}.
11
+ *
12
+ * The {@link TestContext} object passed to the fn argument can be used to perform actions
13
+ * related to the current test. Examples include skipping the test, adding additional
14
+ * diagnostic information, or creating subtests.
15
+ *
16
+ * `test()` returns a {@link Promise} that resolves once the test completes. The return value
17
+ * can usually be discarded for top level tests. However, the return value from subtests should
18
+ * be used to prevent the parent test from finishing first and cancelling the subtest as shown
19
+ * in the following example.
20
+ *
21
+ * ```js
22
+ * test('top level test', async (t) => {
23
+ * // The setTimeout() in the following subtest would cause it to outlive its
24
+ * // parent test if 'await' is removed on the next line. Once the parent test
25
+ * // completes, it will cancel any outstanding subtests.
26
+ * await t.test('longer running subtest', async (t) => {
27
+ * return new Promise((resolve, reject) => {
28
+ * setTimeout(resolve, 1000);
29
+ * });
30
+ * });
31
+ * });
32
+ * ```
33
+ * @since v18.0.0
34
+ * @param name The name of the test, which is displayed when reporting test results.
35
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
36
+ * @param options Configuration options for the test
37
+ * @param fn The function under test. The first argument to this function is a
38
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
39
+ * passed as the second argument. Default: A no-op function.
40
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
41
+ */
42
+ function test(name?: string, fn?: TestFn): Promise<void>;
43
+ function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
44
+ function test(options?: TestOptions, fn?: TestFn): Promise<void>;
45
+ function test(fn?: TestFn): Promise<void>;
46
+ namespace test {
47
+ export { test };
48
+ }
49
+ namespace test {
50
+ /**
51
+ * Programmatically start the test runner.
52
+ * @since v18.9.0
53
+ * @param options Configuration options for running tests.
54
+ * @returns A {@link TestsStream} that emits events about the test execution.
55
+ */
56
+ function run(options?: RunOptions): TestsStream;
57
+ /**
58
+ * @since v18.6.0
59
+ * @param name The name of the suite, which is displayed when reporting suite results.
60
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
61
+ * @param options Configuration options for the suite
62
+ * @param fn The function under suite. Default: A no-op function.
63
+ */
64
+ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
65
+ function describe(name?: string, fn?: SuiteFn): Promise<void>;
66
+ function describe(options?: TestOptions, fn?: SuiteFn): Promise<void>;
67
+ function describe(fn?: SuiteFn): Promise<void>;
68
+ namespace describe {
69
+ /**
70
+ * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
71
+ */
72
+ function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
73
+ function skip(name?: string, fn?: SuiteFn): Promise<void>;
74
+ function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
75
+ function skip(fn?: SuiteFn): Promise<void>;
76
+ /**
77
+ * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`.
78
+ */
79
+ function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
80
+ function todo(name?: string, fn?: SuiteFn): Promise<void>;
81
+ function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
82
+ function todo(fn?: SuiteFn): Promise<void>;
83
+ /**
84
+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
85
+ * @since v18.15.0
86
+ */
87
+ function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
88
+ function only(name?: string, fn?: SuiteFn): Promise<void>;
89
+ function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
90
+ function only(fn?: SuiteFn): Promise<void>;
91
+ }
92
+ /**
93
+ * @since v18.6.0
94
+ * @param name The name of the test, which is displayed when reporting test results.
95
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
96
+ * @param options Configuration options for the test
97
+ * @param fn The function under test. If the test uses callbacks, the callback function is
98
+ * passed as the second argument. Default: A no-op function.
99
+ */
100
+ function it(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
101
+ function it(name?: string, fn?: TestFn): Promise<void>;
102
+ function it(options?: TestOptions, fn?: TestFn): Promise<void>;
103
+ function it(fn?: TestFn): Promise<void>;
104
+ namespace it {
105
+ /**
106
+ * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
107
+ */
108
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
109
+ function skip(name?: string, fn?: TestFn): Promise<void>;
110
+ function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
111
+ function skip(fn?: TestFn): Promise<void>;
112
+ /**
113
+ * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
114
+ */
115
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
116
+ function todo(name?: string, fn?: TestFn): Promise<void>;
117
+ function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
118
+ function todo(fn?: TestFn): Promise<void>;
119
+ /**
120
+ * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.
121
+ * @since v18.15.0
122
+ */
123
+ function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
124
+ function only(name?: string, fn?: TestFn): Promise<void>;
125
+ function only(options?: TestOptions, fn?: TestFn): Promise<void>;
126
+ function only(fn?: TestFn): Promise<void>;
127
+ }
128
+ /**
129
+ * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
130
+ * @since v18.17.0
131
+ */
132
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
133
+ function skip(name?: string, fn?: TestFn): Promise<void>;
134
+ function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
135
+ function skip(fn?: TestFn): Promise<void>;
136
+ /**
137
+ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
138
+ * @since v18.17.0
139
+ */
140
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
141
+ function todo(name?: string, fn?: TestFn): Promise<void>;
142
+ function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
143
+ function todo(fn?: TestFn): Promise<void>;
144
+ /**
145
+ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
146
+ * @since v18.17.0
147
+ */
148
+ function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
149
+ function only(name?: string, fn?: TestFn): Promise<void>;
150
+ function only(options?: TestOptions, fn?: TestFn): Promise<void>;
151
+ function only(fn?: TestFn): Promise<void>;
152
+ /**
153
+ * The type of a function under test. The first argument to this function is a
154
+ * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
155
+ * the second argument.
156
+ */
157
+ type TestFn = (t: TestContext, done: (result?: any) => void) => any;
158
+ /**
159
+ * The type of a function under Suite.
160
+ */
161
+ type SuiteFn = (s: SuiteContext) => void | Promise<void>;
162
+ interface TestShard {
163
+ /**
164
+ * A positive integer between 1 and `<total>` that specifies the index of the shard to run.
165
+ */
166
+ index: number;
167
+ /**
168
+ * A positive integer that specifies the total number of shards to split the test files to.
169
+ */
170
+ total: number;
171
+ }
172
+ interface RunOptions {
173
+ /**
174
+ * If a number is provided, then that many files would run in parallel.
175
+ * If truthy, it would run (number of cpu cores - 1) files in parallel.
176
+ * If falsy, it would only run one file at a time.
177
+ * If unspecified, subtests inherit this value from their parent.
178
+ * @default true
179
+ */
180
+ concurrency?: number | boolean | undefined;
181
+ /**
182
+ * An array containing the list of files to run.
183
+ * If unspecified, the test runner execution model will be used.
184
+ */
185
+ files?: readonly string[] | undefined;
186
+ /**
187
+ * Allows aborting an in-progress test execution.
188
+ * @default undefined
189
+ */
190
+ signal?: AbortSignal | undefined;
191
+ /**
192
+ * A number of milliseconds the test will fail after.
193
+ * If unspecified, subtests inherit this value from their parent.
194
+ * @default Infinity
195
+ */
196
+ timeout?: number | undefined;
197
+ /**
198
+ * Sets inspector port of test child process.
199
+ * If a nullish value is provided, each process gets its own port,
200
+ * incremented from the primary's `process.debugPort`.
201
+ */
202
+ inspectPort?: number | (() => number) | undefined;
203
+ /**
204
+ * That can be used to only run tests whose name matches the provided pattern.
205
+ * Test name patterns are interpreted as JavaScript regular expressions.
206
+ * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run.
207
+ */
208
+ testNamePatterns?: string | RegExp | ReadonlyArray<string | RegExp> | undefined;
209
+ /**
210
+ * If truthy, the test context will only run tests that have the `only` option set
211
+ * @since v18.19.0
212
+ */
213
+ only?: boolean | undefined;
214
+ /**
215
+ * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
216
+ */
217
+ setup?: ((reporter: TestsStream) => void | Promise<void>) | undefined;
218
+ /**
219
+ * Whether to run in watch mode or not.
220
+ * @default false
221
+ */
222
+ watch?: boolean | undefined;
223
+ /**
224
+ * Running tests in a specific shard.
225
+ * @since v18.19.0
226
+ * @default undefined
227
+ */
228
+ shard?: TestShard | undefined;
229
+ }
230
+ /**
231
+ * A successful call of the `run()` method will return a new `TestsStream` object,
232
+ * streaming a series of events representing the execution of the tests.
233
+ * `TestsStream` will emit events in the order of the tests' definitions.
234
+ * @since v18.9.0
235
+ */
236
+ interface TestsStream extends NodeJS.ReadableStream {
237
+ addListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
238
+ addListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
239
+ addListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
240
+ addListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
241
+ addListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
242
+ addListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
243
+ addListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
244
+ addListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
245
+ addListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
246
+ addListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
247
+ addListener(event: "test:watch:drained", listener: () => void): this;
248
+ addListener(event: string, listener: (...args: any[]) => void): this;
249
+ emit(event: "test:coverage", data: EventData.TestCoverage): boolean;
250
+ emit(event: "test:dequeue", data: EventData.TestDequeue): boolean;
251
+ emit(event: "test:diagnostic", data: EventData.TestDiagnostic): boolean;
252
+ emit(event: "test:enqueue", data: EventData.TestEnqueue): boolean;
253
+ emit(event: "test:fail", data: EventData.TestFail): boolean;
254
+ emit(event: "test:pass", data: EventData.TestPass): boolean;
255
+ emit(event: "test:plan", data: EventData.TestPlan): boolean;
256
+ emit(event: "test:start", data: EventData.TestStart): boolean;
257
+ emit(event: "test:stderr", data: EventData.TestStderr): boolean;
258
+ emit(event: "test:stdout", data: EventData.TestStdout): boolean;
259
+ emit(event: "test:watch:drained"): boolean;
260
+ emit(event: string | symbol, ...args: any[]): boolean;
261
+ on(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
262
+ on(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
263
+ on(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
264
+ on(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
265
+ on(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
266
+ on(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
267
+ on(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
268
+ on(event: "test:start", listener: (data: EventData.TestStart) => void): this;
269
+ on(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
270
+ on(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
271
+ on(event: "test:watch:drained", listener: () => void): this;
272
+ on(event: string, listener: (...args: any[]) => void): this;
273
+ once(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
274
+ once(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
275
+ once(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
276
+ once(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
277
+ once(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
278
+ once(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
279
+ once(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
280
+ once(event: "test:start", listener: (data: EventData.TestStart) => void): this;
281
+ once(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
282
+ once(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
283
+ once(event: "test:watch:drained", listener: () => void): this;
284
+ once(event: string, listener: (...args: any[]) => void): this;
285
+ prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
286
+ prependListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
287
+ prependListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
288
+ prependListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
289
+ prependListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
290
+ prependListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
291
+ prependListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
292
+ prependListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
293
+ prependListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
294
+ prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
295
+ prependListener(event: "test:watch:drained", listener: () => void): this;
296
+ prependListener(event: string, listener: (...args: any[]) => void): this;
297
+ prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
298
+ prependOnceListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
299
+ prependOnceListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
300
+ prependOnceListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
301
+ prependOnceListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
302
+ prependOnceListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
303
+ prependOnceListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
304
+ prependOnceListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
305
+ prependOnceListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
306
+ prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
307
+ prependOnceListener(event: "test:watch:drained", listener: () => void): this;
308
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
309
+ }
310
+ namespace EventData {
311
+ interface Error extends globalThis.Error {
312
+ cause: globalThis.Error;
313
+ }
314
+ interface LocationInfo {
315
+ /**
316
+ * The column number where the test is defined, or
317
+ * `undefined` if the test was run through the REPL.
318
+ */
319
+ column?: number;
320
+ /**
321
+ * The path of the test file, `undefined` if test is not ran through a file.
322
+ */
323
+ file?: string;
324
+ /**
325
+ * The line number where the test is defined, or
326
+ * `undefined` if the test was run through the REPL.
327
+ */
328
+ line?: number;
329
+ }
330
+ interface TestDiagnostic extends LocationInfo {
331
+ /**
332
+ * The diagnostic message.
333
+ */
334
+ message: string;
335
+ /**
336
+ * The nesting level of the test.
337
+ */
338
+ nesting: number;
339
+ }
340
+ interface TestCoverage {
341
+ /**
342
+ * An object containing the coverage report.
343
+ */
344
+ summary: {
345
+ /**
346
+ * An array of coverage reports for individual files.
347
+ */
348
+ files: Array<{
349
+ /**
350
+ * The absolute path of the file.
351
+ */
352
+ path: string;
353
+ /**
354
+ * The total number of lines.
355
+ */
356
+ totalLineCount: number;
357
+ /**
358
+ * The total number of branches.
359
+ */
360
+ totalBranchCount: number;
361
+ /**
362
+ * The total number of functions.
363
+ */
364
+ totalFunctionCount: number;
365
+ /**
366
+ * The number of covered lines.
367
+ */
368
+ coveredLineCount: number;
369
+ /**
370
+ * The number of covered branches.
371
+ */
372
+ coveredBranchCount: number;
373
+ /**
374
+ * The number of covered functions.
375
+ */
376
+ coveredFunctionCount: number;
377
+ /**
378
+ * The percentage of lines covered.
379
+ */
380
+ coveredLinePercent: number;
381
+ /**
382
+ * The percentage of branches covered.
383
+ */
384
+ coveredBranchPercent: number;
385
+ /**
386
+ * The percentage of functions covered.
387
+ */
388
+ coveredFunctionPercent: number;
389
+ /**
390
+ * An array of integers representing line numbers that are uncovered.
391
+ */
392
+ uncoveredLineNumbers: number[];
393
+ }>;
394
+ /**
395
+ * An object containing a summary of coverage for all files.
396
+ */
397
+ totals: {
398
+ /**
399
+ * The total number of lines.
400
+ */
401
+ totalLineCount: number;
402
+ /**
403
+ * The total number of branches.
404
+ */
405
+ totalBranchCount: number;
406
+ /**
407
+ * The total number of functions.
408
+ */
409
+ totalFunctionCount: number;
410
+ /**
411
+ * The number of covered lines.
412
+ */
413
+ coveredLineCount: number;
414
+ /**
415
+ * The number of covered branches.
416
+ */
417
+ coveredBranchCount: number;
418
+ /**
419
+ * The number of covered functions.
420
+ */
421
+ coveredFunctionCount: number;
422
+ /**
423
+ * The percentage of lines covered.
424
+ */
425
+ coveredLinePercent: number;
426
+ /**
427
+ * The percentage of branches covered.
428
+ */
429
+ coveredBranchPercent: number;
430
+ /**
431
+ * The percentage of functions covered.
432
+ */
433
+ coveredFunctionPercent: number;
434
+ };
435
+ /**
436
+ * The working directory when code coverage began. This
437
+ * is useful for displaying relative path names in case
438
+ * the tests changed the working directory of the Node.js process.
439
+ */
440
+ workingDirectory: string;
441
+ };
442
+ /**
443
+ * The nesting level of the test.
444
+ */
445
+ nesting: number;
446
+ }
447
+ interface TestDequeue extends LocationInfo {
448
+ /**
449
+ * The test name
450
+ */
451
+ name: string;
452
+ /**
453
+ * The nesting level of the test.
454
+ */
455
+ nesting: number;
456
+ }
457
+ interface TestEnqueue extends LocationInfo {
458
+ /**
459
+ * The test name
460
+ */
461
+ name: string;
462
+ /**
463
+ * The nesting level of the test.
464
+ */
465
+ nesting: number;
466
+ }
467
+ interface TestFail extends LocationInfo {
468
+ /**
469
+ * Additional execution metadata.
470
+ */
471
+ details: {
472
+ /**
473
+ * The duration of the test in milliseconds.
474
+ */
475
+ duration_ms: number;
476
+ /**
477
+ * The error thrown by the test.
478
+ */
479
+ error: Error;
480
+ /**
481
+ * The type of the test, used to denote whether this is a suite.
482
+ * @since 18.17.0
483
+ */
484
+ type?: "suite";
485
+ };
486
+ /**
487
+ * The test name.
488
+ */
489
+ name: string;
490
+ /**
491
+ * The nesting level of the test.
492
+ */
493
+ nesting: number;
494
+ /**
495
+ * The ordinal number of the test.
496
+ */
497
+ testNumber: number;
498
+ /**
499
+ * Present if `context.todo` is called.
500
+ */
501
+ todo?: string | boolean;
502
+ /**
503
+ * Present if `context.skip` is called.
504
+ */
505
+ skip?: string | boolean;
506
+ }
507
+ interface TestPass extends LocationInfo {
508
+ /**
509
+ * Additional execution metadata.
510
+ */
511
+ details: {
512
+ /**
513
+ * The duration of the test in milliseconds.
514
+ */
515
+ duration_ms: number;
516
+ /**
517
+ * The type of the test, used to denote whether this is a suite.
518
+ * @since 18.17.0
519
+ */
520
+ type?: "suite";
521
+ };
522
+ /**
523
+ * The test name.
524
+ */
525
+ name: string;
526
+ /**
527
+ * The nesting level of the test.
528
+ */
529
+ nesting: number;
530
+ /**
531
+ * The ordinal number of the test.
532
+ */
533
+ testNumber: number;
534
+ /**
535
+ * Present if `context.todo` is called.
536
+ */
537
+ todo?: string | boolean;
538
+ /**
539
+ * Present if `context.skip` is called.
540
+ */
541
+ skip?: string | boolean;
542
+ }
543
+ interface TestPlan extends LocationInfo {
544
+ /**
545
+ * The nesting level of the test.
546
+ */
547
+ nesting: number;
548
+ /**
549
+ * The number of subtests that have ran.
550
+ */
551
+ count: number;
552
+ }
553
+ interface TestStart extends LocationInfo {
554
+ /**
555
+ * The test name.
556
+ */
557
+ name: string;
558
+ /**
559
+ * The nesting level of the test.
560
+ */
561
+ nesting: number;
562
+ }
563
+ interface TestStderr extends LocationInfo {
564
+ /**
565
+ * The message written to `stderr`
566
+ */
567
+ message: string;
568
+ }
569
+ interface TestStdout extends LocationInfo {
570
+ /**
571
+ * The message written to `stdout`
572
+ */
573
+ message: string;
574
+ }
575
+ }
576
+ /**
577
+ * An instance of `TestContext` is passed to each test function in order to interact with the
578
+ * test runner. However, the `TestContext` constructor is not exposed as part of the API.
579
+ * @since v18.0.0
580
+ */
581
+ interface TestContext {
582
+ /**
583
+ * This function is used to create a hook running before subtest of the current test.
584
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
585
+ * If the hook uses callbacks, the callback function is passed as the second argument.
586
+ * @param options Configuration options for the hook.
587
+ * @since v18.17.0
588
+ */
589
+ before(fn?: TestContextHookFn, options?: HookOptions): void;
590
+ /**
591
+ * This function is used to create a hook running before each subtest of the current test.
592
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
593
+ * If the hook uses callbacks, the callback function is passed as the second argument.
594
+ * @param options Configuration options for the hook.
595
+ * @since v18.8.0
596
+ */
597
+ beforeEach(fn?: TestContextHookFn, options?: HookOptions): void;
598
+ /**
599
+ * This function is used to create a hook that runs after the current test finishes.
600
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
601
+ * If the hook uses callbacks, the callback function is passed as the second argument.
602
+ * @param options Configuration options for the hook.
603
+ * @since v18.13.0
604
+ */
605
+ after(fn?: TestContextHookFn, options?: HookOptions): void;
606
+ /**
607
+ * This function is used to create a hook running after each subtest of the current test.
608
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
609
+ * If the hook uses callbacks, the callback function is passed as the second argument.
610
+ * @param options Configuration options for the hook.
611
+ * @since v18.8.0
612
+ */
613
+ afterEach(fn?: TestContextHookFn, options?: HookOptions): void;
614
+ /**
615
+ * This function is used to write diagnostics to the output. Any diagnostic information is
616
+ * included at the end of the test's results. This function does not return a value.
617
+ * @param message Message to be reported.
618
+ * @since v18.0.0
619
+ */
620
+ diagnostic(message: string): void;
621
+ /**
622
+ * The name of the test.
623
+ * @since v18.8.0
624
+ */
625
+ readonly name: string;
626
+ /**
627
+ * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
628
+ * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
629
+ * command-line option, this function is a no-op.
630
+ * @param shouldRunOnlyTests Whether or not to run `only` tests.
631
+ * @since v18.0.0
632
+ */
633
+ runOnly(shouldRunOnlyTests: boolean): void;
634
+ /**
635
+ * Can be used to abort test subtasks when the test has been aborted.
636
+ * @since v18.7.0
637
+ */
638
+ readonly signal: AbortSignal;
639
+ /**
640
+ * This function causes the test's output to indicate the test as skipped. If `message` is
641
+ * provided, it is included in the output. Calling `skip()` does not terminate execution of
642
+ * the test function. This function does not return a value.
643
+ * @param message Optional skip message.
644
+ * @since v18.0.0
645
+ */
646
+ skip(message?: string): void;
647
+ /**
648
+ * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
649
+ * included in the output. Calling `todo()` does not terminate execution of the test
650
+ * function. This function does not return a value.
651
+ * @param message Optional `TODO` message.
652
+ * @since v18.0.0
653
+ */
654
+ todo(message?: string): void;
655
+ /**
656
+ * This function is used to create subtests under the current test. This function behaves in
657
+ * the same fashion as the top level {@link test} function.
658
+ * @since v18.0.0
659
+ * @param name The name of the test, which is displayed when reporting test results.
660
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
661
+ * @param options Configuration options for the test
662
+ * @param fn The function under test. This first argument to this function is a
663
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
664
+ * passed as the second argument. Default: A no-op function.
665
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
666
+ */
667
+ test: typeof test;
668
+ /**
669
+ * Each test provides its own MockTracker instance.
670
+ */
671
+ readonly mock: MockTracker;
672
+ }
673
+ /**
674
+ * An instance of `SuiteContext` is passed to each suite function in order to
675
+ * interact with the test runner. However, the `SuiteContext` constructor is not
676
+ * exposed as part of the API.
677
+ * @since v18.7.0, v16.17.0
678
+ */
679
+ interface SuiteContext {
680
+ /**
681
+ * The name of the suite.
682
+ * @since v18.8.0, v16.18.0
683
+ */
684
+ readonly name: string;
685
+ /**
686
+ * Can be used to abort test subtasks when the test has been aborted.
687
+ * @since v18.7.0, v16.17.0
688
+ */
689
+ readonly signal: AbortSignal;
690
+ }
691
+ interface TestOptions {
692
+ /**
693
+ * If a number is provided, then that many tests would run in parallel.
694
+ * If truthy, it would run (number of cpu cores - 1) tests in parallel.
695
+ * For subtests, it will be `Infinity` tests in parallel.
696
+ * If falsy, it would only run one test at a time.
697
+ * If unspecified, subtests inherit this value from their parent.
698
+ * @default false
699
+ */
700
+ concurrency?: number | boolean | undefined;
701
+ /**
702
+ * If truthy, and the test context is configured to run `only` tests, then this test will be
703
+ * run. Otherwise, the test is skipped.
704
+ * @default false
705
+ */
706
+ only?: boolean | undefined;
707
+ /**
708
+ * Allows aborting an in-progress test.
709
+ * @since v18.8.0
710
+ */
711
+ signal?: AbortSignal | undefined;
712
+ /**
713
+ * If truthy, the test is skipped. If a string is provided, that string is displayed in the
714
+ * test results as the reason for skipping the test.
715
+ * @default false
716
+ */
717
+ skip?: boolean | string | undefined;
718
+ /**
719
+ * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
720
+ * value from their parent.
721
+ * @default Infinity
722
+ * @since v18.7.0
723
+ */
724
+ timeout?: number | undefined;
725
+ /**
726
+ * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
727
+ * the test results as the reason why the test is `TODO`.
728
+ * @default false
729
+ */
730
+ todo?: boolean | string | undefined;
731
+ }
732
+ /**
733
+ * This function is used to create a hook running before running a suite.
734
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
735
+ * the second argument. Default: A no-op function.
736
+ * @param options Configuration options for the hook.
737
+ * @since v18.8.0
738
+ */
739
+ function before(fn?: HookFn, options?: HookOptions): void;
740
+ /**
741
+ * This function is used to create a hook running after running a suite.
742
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
743
+ * the second argument. Default: A no-op function.
744
+ * @param options Configuration options for the hook.
745
+ * @since v18.8.0
746
+ */
747
+ function after(fn?: HookFn, options?: HookOptions): void;
748
+ /**
749
+ * This function is used to create a hook running before each subtest of the current suite.
750
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
751
+ * the second argument. Default: A no-op function.
752
+ * @param options Configuration options for the hook.
753
+ * @since v18.8.0
754
+ */
755
+ function beforeEach(fn?: HookFn, options?: HookOptions): void;
756
+ /**
757
+ * This function is used to create a hook running after each subtest of the current test.
758
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
759
+ * the second argument. Default: A no-op function.
760
+ * @param options Configuration options for the hook.
761
+ * @since v18.8.0
762
+ */
763
+ function afterEach(fn?: HookFn, options?: HookOptions): void;
764
+ /**
765
+ * The hook function. The first argument is the context in which the hook is called.
766
+ * If the hook uses callbacks, the callback function is passed as the second argument.
767
+ */
768
+ type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any;
769
+ /**
770
+ * The hook function. The first argument is a `TestContext` object.
771
+ * If the hook uses callbacks, the callback function is passed as the second argument.
772
+ */
773
+ type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any;
774
+ /**
775
+ * Configuration options for hooks.
776
+ * @since v18.8.0
777
+ */
778
+ interface HookOptions {
779
+ /**
780
+ * Allows aborting an in-progress hook.
781
+ */
782
+ signal?: AbortSignal | undefined;
783
+ /**
784
+ * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
785
+ * value from their parent.
786
+ * @default Infinity
787
+ */
788
+ timeout?: number | undefined;
789
+ }
790
+ interface MockFunctionOptions {
791
+ /**
792
+ * The number of times that the mock will use the behavior of `implementation`.
793
+ * Once the mock function has been called `times` times,
794
+ * it will automatically restore the behavior of `original`.
795
+ * This value must be an integer greater than zero.
796
+ * @default Infinity
797
+ */
798
+ times?: number | undefined;
799
+ }
800
+ interface MockMethodOptions extends MockFunctionOptions {
801
+ /**
802
+ * If `true`, `object[methodName]` is treated as a getter.
803
+ * This option cannot be used with the `setter` option.
804
+ */
805
+ getter?: boolean | undefined;
806
+ /**
807
+ * If `true`, `object[methodName]` is treated as a setter.
808
+ * This option cannot be used with the `getter` option.
809
+ */
810
+ setter?: boolean | undefined;
811
+ }
812
+ type Mock<F extends Function> = F & {
813
+ mock: MockFunctionContext<F>;
814
+ };
815
+ interface MockTracker {
816
+ /**
817
+ * This function is used to create a mock function.
818
+ * @param original An optional function to create a mock on.
819
+ * @param implementation An optional function used as the mock implementation for `original`.
820
+ * This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.
821
+ * @param options Optional configuration options for the mock function.
822
+ */
823
+ fn<F extends Function = (...args: any[]) => undefined>(
824
+ original?: F,
825
+ options?: MockFunctionOptions,
826
+ ): Mock<F>;
827
+ fn<F extends Function = (...args: any[]) => undefined, Implementation extends Function = F>(
828
+ original?: F,
829
+ implementation?: Implementation,
830
+ options?: MockFunctionOptions,
831
+ ): Mock<F | Implementation>;
832
+ /**
833
+ * This function is used to create a mock on an existing object method.
834
+ * @param object The object whose method is being mocked.
835
+ * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
836
+ * @param implementation An optional function used as the mock implementation for `object[methodName]`.
837
+ * @param options Optional configuration options for the mock method.
838
+ */
839
+ method<
840
+ MockedObject extends object,
841
+ MethodName extends FunctionPropertyNames<MockedObject>,
842
+ >(
843
+ object: MockedObject,
844
+ methodName: MethodName,
845
+ options?: MockFunctionOptions,
846
+ ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
847
+ : never;
848
+ method<
849
+ MockedObject extends object,
850
+ MethodName extends FunctionPropertyNames<MockedObject>,
851
+ Implementation extends Function,
852
+ >(
853
+ object: MockedObject,
854
+ methodName: MethodName,
855
+ implementation: Implementation,
856
+ options?: MockFunctionOptions,
857
+ ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
858
+ : never;
859
+ method<MockedObject extends object>(
860
+ object: MockedObject,
861
+ methodName: keyof MockedObject,
862
+ options: MockMethodOptions,
863
+ ): Mock<Function>;
864
+ method<MockedObject extends object>(
865
+ object: MockedObject,
866
+ methodName: keyof MockedObject,
867
+ implementation: Function,
868
+ options: MockMethodOptions,
869
+ ): Mock<Function>;
870
+ /**
871
+ * This function is syntax sugar for {@link MockTracker.method} with `options.getter` set to `true`.
872
+ */
873
+ getter<
874
+ MockedObject extends object,
875
+ MethodName extends keyof MockedObject,
876
+ >(
877
+ object: MockedObject,
878
+ methodName: MethodName,
879
+ options?: MockFunctionOptions,
880
+ ): Mock<() => MockedObject[MethodName]>;
881
+ getter<
882
+ MockedObject extends object,
883
+ MethodName extends keyof MockedObject,
884
+ Implementation extends Function,
885
+ >(
886
+ object: MockedObject,
887
+ methodName: MethodName,
888
+ implementation?: Implementation,
889
+ options?: MockFunctionOptions,
890
+ ): Mock<(() => MockedObject[MethodName]) | Implementation>;
891
+ /**
892
+ * This function is syntax sugar for {@link MockTracker.method} with `options.setter` set to `true`.
893
+ */
894
+ setter<
895
+ MockedObject extends object,
896
+ MethodName extends keyof MockedObject,
897
+ >(
898
+ object: MockedObject,
899
+ methodName: MethodName,
900
+ options?: MockFunctionOptions,
901
+ ): Mock<(value: MockedObject[MethodName]) => void>;
902
+ setter<
903
+ MockedObject extends object,
904
+ MethodName extends keyof MockedObject,
905
+ Implementation extends Function,
906
+ >(
907
+ object: MockedObject,
908
+ methodName: MethodName,
909
+ implementation?: Implementation,
910
+ options?: MockFunctionOptions,
911
+ ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
912
+ /**
913
+ * This function restores the default behavior of all mocks that were previously created by this `MockTracker`
914
+ * and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used,
915
+ * but the `MockTracker` instance can no longer be used to reset their behavior or otherwise interact with them.
916
+ *
917
+ * After each test completes, this function is called on the test context's `MockTracker`.
918
+ * If the global `MockTracker` is used extensively, calling this function manually is recommended.
919
+ */
920
+ reset(): void;
921
+ /**
922
+ * This function restores the default behavior of all mocks that were previously created by this `MockTracker`.
923
+ * Unlike `mock.reset()`, `mock.restoreAll()` does not disassociate the mocks from the `MockTracker` instance.
924
+ */
925
+ restoreAll(): void;
926
+ readonly timers: MockTimers;
927
+ }
928
+ const mock: MockTracker;
929
+ interface MockFunctionCall<
930
+ F extends Function,
931
+ ReturnType = F extends (...args: any) => infer T ? T
932
+ : F extends abstract new(...args: any) => infer T ? T
933
+ : unknown,
934
+ Args = F extends (...args: infer Y) => any ? Y
935
+ : F extends abstract new(...args: infer Y) => any ? Y
936
+ : unknown[],
937
+ > {
938
+ /**
939
+ * An array of the arguments passed to the mock function.
940
+ */
941
+ arguments: Args;
942
+ /**
943
+ * If the mocked function threw then this property contains the thrown value.
944
+ */
945
+ error: unknown | undefined;
946
+ /**
947
+ * The value returned by the mocked function.
948
+ *
949
+ * If the mocked function threw, it will be `undefined`.
950
+ */
951
+ result: ReturnType | undefined;
952
+ /**
953
+ * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
954
+ */
955
+ stack: Error;
956
+ /**
957
+ * If the mocked function is a constructor, this field contains the class being constructed.
958
+ * Otherwise this will be `undefined`.
959
+ */
960
+ target: F extends abstract new(...args: any) => any ? F : undefined;
961
+ /**
962
+ * The mocked function's `this` value.
963
+ */
964
+ this: unknown;
965
+ }
966
+ interface MockFunctionContext<F extends Function> {
967
+ /**
968
+ * A getter that returns a copy of the internal array used to track calls to the mock.
969
+ */
970
+ readonly calls: MockFunctionCall<F>[];
971
+ /**
972
+ * This function returns the number of times that this mock has been invoked.
973
+ * This function is more efficient than checking `ctx.calls.length`
974
+ * because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
975
+ */
976
+ callCount(): number;
977
+ /**
978
+ * This function is used to change the behavior of an existing mock.
979
+ * @param implementation The function to be used as the mock's new implementation.
980
+ */
981
+ mockImplementation(implementation: F): void;
982
+ /**
983
+ * This function is used to change the behavior of an existing mock for a single invocation.
984
+ * Once invocation `onCall` has occurred, the mock will revert to whatever behavior
985
+ * it would have used had `mockImplementationOnce()` not been called.
986
+ * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
987
+ * @param onCall The invocation number that will use `implementation`.
988
+ * If the specified invocation has already occurred then an exception is thrown.
989
+ */
990
+ mockImplementationOnce(implementation: F, onCall?: number): void;
991
+ /**
992
+ * Resets the call history of the mock function.
993
+ */
994
+ resetCalls(): void;
995
+ /**
996
+ * Resets the implementation of the mock function to its original behavior.
997
+ * The mock can still be used after calling this function.
998
+ */
999
+ restore(): void;
1000
+ }
1001
+ /**
1002
+ * Mocking timers is a technique commonly used in software testing to simulate and
1003
+ * control the behavior of timers, such as `setInterval` and `setTimeout`,
1004
+ * without actually waiting for the specified time intervals.
1005
+ *
1006
+ * The `MockTracker` provides a top-level `timers` export
1007
+ * which is a `MockTimers` instance.
1008
+ * @since v18.19.0
1009
+ * @experimental
1010
+ */
1011
+ interface MockTimers {
1012
+ /**
1013
+ * Enables timer mocking for the specified timers.
1014
+ *
1015
+ * **Note:** When you enable mocking for a specific timer, its associated
1016
+ * clear function will also be implicitly mocked.
1017
+ *
1018
+ * Example usage:
1019
+ *
1020
+ * ```js
1021
+ * import { mock } from 'node:test';
1022
+ * mock.timers.enable(['setInterval']);
1023
+ * ```
1024
+ *
1025
+ * The above example enables mocking for the `setInterval` timer and
1026
+ * implicitly mocks the `clearInterval` function. Only the `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and`globalThis` will be mocked.
1027
+ *
1028
+ * Alternatively, if you call `mock.timers.enable()` without any parameters:
1029
+ *
1030
+ * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`)
1031
+ * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`,
1032
+ * and `globalThis` will be mocked.
1033
+ * @since v18.19.0
1034
+ */
1035
+ enable(timers?: ReadonlyArray<"setInterval" | "clearInterval" | "setTimeout" | "clearTimeout">): void;
1036
+ /**
1037
+ * This function restores the default behavior of all mocks that were previously
1038
+ * created by this `MockTimers` instance and disassociates the mocks
1039
+ * from the `MockTracker` instance.
1040
+ *
1041
+ * **Note:** After each test completes, this function is called on
1042
+ * the test context's `MockTracker`.
1043
+ *
1044
+ * ```js
1045
+ * import { mock } from 'node:test';
1046
+ * mock.timers.reset();
1047
+ * ```
1048
+ * @since v18.19.0
1049
+ */
1050
+ reset(): void;
1051
+ /**
1052
+ * Advances time for all mocked timers.
1053
+ *
1054
+ * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts
1055
+ * only positive numbers. In Node.js, `setTimeout` with negative numbers is
1056
+ * only supported for web compatibility reasons.
1057
+ *
1058
+ * The following example mocks a `setTimeout` function and
1059
+ * by using `.tick` advances in
1060
+ * time triggering all pending timers.
1061
+ *
1062
+ * ```js
1063
+ * import assert from 'node:assert';
1064
+ * import { test } from 'node:test';
1065
+ *
1066
+ * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
1067
+ * const fn = context.mock.fn();
1068
+ *
1069
+ * context.mock.timers.enable(['setTimeout']);
1070
+ *
1071
+ * setTimeout(fn, 9999);
1072
+ *
1073
+ * assert.strictEqual(fn.mock.callCount(), 0);
1074
+ *
1075
+ * // Advance in time
1076
+ * context.mock.timers.tick(9999);
1077
+ *
1078
+ * assert.strictEqual(fn.mock.callCount(), 1);
1079
+ * });
1080
+ * ```
1081
+ *
1082
+ * Alternativelly, the `.tick` function can be called many times
1083
+ *
1084
+ * ```js
1085
+ * import assert from 'node:assert';
1086
+ * import { test } from 'node:test';
1087
+ *
1088
+ * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
1089
+ * const fn = context.mock.fn();
1090
+ * context.mock.timers.enable(['setTimeout']);
1091
+ * const nineSecs = 9000;
1092
+ * setTimeout(fn, nineSecs);
1093
+ *
1094
+ * const twoSeconds = 3000;
1095
+ * context.mock.timers.tick(twoSeconds);
1096
+ * context.mock.timers.tick(twoSeconds);
1097
+ * context.mock.timers.tick(twoSeconds);
1098
+ *
1099
+ * assert.strictEqual(fn.mock.callCount(), 1);
1100
+ * });
1101
+ * ```
1102
+ * @since v18.19.0
1103
+ */
1104
+ tick(milliseconds: number): void;
1105
+ /**
1106
+ * Triggers all pending mocked timers immediately.
1107
+ *
1108
+ * The example below triggers all pending timers immediately,
1109
+ * causing them to execute without any delay.
1110
+ *
1111
+ * ```js
1112
+ * import assert from 'node:assert';
1113
+ * import { test } from 'node:test';
1114
+ *
1115
+ * test('runAll functions following the given order', (context) => {
1116
+ * context.mock.timers.enable(['setTimeout']);
1117
+ * const results = [];
1118
+ * setTimeout(() => results.push(1), 9999);
1119
+ *
1120
+ * // Notice that if both timers have the same timeout,
1121
+ * // the order of execution is guaranteed
1122
+ * setTimeout(() => results.push(3), 8888);
1123
+ * setTimeout(() => results.push(2), 8888);
1124
+ *
1125
+ * assert.deepStrictEqual(results, []);
1126
+ *
1127
+ * context.mock.timers.runAll();
1128
+ *
1129
+ * assert.deepStrictEqual(results, [3, 2, 1]);
1130
+ * });
1131
+ * ```
1132
+ *
1133
+ * **Note:** The `runAll()` function is specifically designed for
1134
+ * triggering timers in the context of timer mocking.
1135
+ * It does not have any effect on real-time system
1136
+ * clocks or actual timers outside of the mocking environment.
1137
+ * @since v18.19.0
1138
+ */
1139
+ runAll(): void;
1140
+ /**
1141
+ * Calls {@link MockTimers.reset()}.
1142
+ */
1143
+ [Symbol.dispose](): void;
1144
+ }
1145
+ }
1146
+ type FunctionPropertyNames<T> = {
1147
+ [K in keyof T]: T[K] extends Function ? K : never;
1148
+ }[keyof T];
1149
+ export = test;
1150
+ }
1151
+
1152
+ /**
1153
+ * The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
1154
+ * To access it:
1155
+ *
1156
+ * ```js
1157
+ * import test from 'node:test/reporters';
1158
+ * ```
1159
+ *
1160
+ * This module is only available under the `node:` scheme. The following will not
1161
+ * work:
1162
+ *
1163
+ * ```js
1164
+ * import test from 'test/reporters';
1165
+ * ```
1166
+ * @since v18.17.0
1167
+ * @see [source](https://github.com/nodejs/node/blob/v18.17.0/lib/test/reporters.js)
1168
+ */
1169
+ declare module "node:test/reporters" {
1170
+ import { Transform } from "node:stream";
1171
+ import { EventData } from "node:test";
1172
+
1173
+ type TestEvent =
1174
+ | { type: "test:coverage"; data: EventData.TestCoverage }
1175
+ | { type: "test:dequeue"; data: EventData.TestDequeue }
1176
+ | { type: "test:diagnostic"; data: EventData.TestDiagnostic }
1177
+ | { type: "test:enqueue"; data: EventData.TestEnqueue }
1178
+ | { type: "test:fail"; data: EventData.TestFail }
1179
+ | { type: "test:pass"; data: EventData.TestPass }
1180
+ | { type: "test:plan"; data: EventData.TestPlan }
1181
+ | { type: "test:start"; data: EventData.TestStart }
1182
+ | { type: "test:stderr"; data: EventData.TestStderr }
1183
+ | { type: "test:stdout"; data: EventData.TestStdout }
1184
+ | { type: "test:watch:drained"; data: undefined };
1185
+ type TestEventGenerator = AsyncGenerator<TestEvent, void>;
1186
+
1187
+ /**
1188
+ * The `dot` reporter outputs the test results in a compact format,
1189
+ * where each passing test is represented by a `.`,
1190
+ * and each failing test is represented by a `X`.
1191
+ */
1192
+ function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
1193
+ /**
1194
+ * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
1195
+ */
1196
+ function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
1197
+ /**
1198
+ * The `spec` reporter outputs the test results in a human-readable format.
1199
+ */
1200
+ class Spec extends Transform {
1201
+ constructor();
1202
+ }
1203
+ /**
1204
+ * The `junit` reporter outputs test results in a jUnit XML format
1205
+ */
1206
+ function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
1207
+ export { dot, junit, Spec as spec, tap, TestEvent };
1208
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/timers.d.ts ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `timer` module exposes a global API for scheduling functions to
3
+ * be called at some future period of time. Because the timer functions are
4
+ * globals, there is no need to import `node:timers` to use the API.
5
+ *
6
+ * The timer functions within Node.js implement a similar API as the timers API
7
+ * provided by Web Browsers but use a different internal implementation that is
8
+ * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/timers.js)
10
+ */
11
+ declare module "timers" {
12
+ import { Abortable } from "node:events";
13
+ import * as promises from "node:timers/promises";
14
+ export interface TimerOptions extends Abortable {
15
+ /**
16
+ * Set to `false` to indicate that the scheduled `Timeout`
17
+ * should not require the Node.js event loop to remain active.
18
+ * @default true
19
+ */
20
+ ref?: boolean | undefined;
21
+ }
22
+ global {
23
+ namespace NodeJS {
24
+ /**
25
+ * This object is created internally and is returned from `setImmediate()`. It
26
+ * can be passed to `clearImmediate()` in order to cancel the scheduled
27
+ * actions.
28
+ *
29
+ * By default, when an immediate is scheduled, the Node.js event loop will continue
30
+ * running as long as the immediate is active. The `Immediate` object returned by
31
+ * `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`
32
+ * functions that can be used to control this default behavior.
33
+ */
34
+ interface Immediate extends RefCounted, Disposable {
35
+ /**
36
+ * If true, the `Immediate` object will keep the Node.js event loop active.
37
+ * @since v11.0.0
38
+ */
39
+ hasRef(): boolean;
40
+ /**
41
+ * When called, requests that the Node.js event loop _not_ exit so long as the
42
+ * `Immediate` is active. Calling `immediate.ref()` multiple times will have no
43
+ * effect.
44
+ *
45
+ * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
46
+ * to call `immediate.ref()` unless `immediate.unref()` had been called previously.
47
+ * @since v9.7.0
48
+ * @returns a reference to `immediate`
49
+ */
50
+ ref(): this;
51
+ /**
52
+ * When called, the active `Immediate` object will not require the Node.js event
53
+ * loop to remain active. If there is no other activity keeping the event loop
54
+ * running, the process may exit before the `Immediate` object's callback is
55
+ * invoked. Calling `immediate.unref()` multiple times will have no effect.
56
+ * @since v9.7.0
57
+ * @returns a reference to `immediate`
58
+ */
59
+ unref(): this;
60
+ /**
61
+ * Cancels the immediate. This is similar to calling `clearImmediate()`.
62
+ * @since v18.18.0
63
+ * @experimental
64
+ */
65
+ [Symbol.dispose](): void;
66
+ _onImmediate(...args: any[]): void;
67
+ }
68
+ // Legacy interface used in Node.js v9 and prior
69
+ /** @deprecated Use `NodeJS.Timeout` instead. */
70
+ interface Timer extends RefCounted {
71
+ hasRef(): boolean;
72
+ refresh(): this;
73
+ [Symbol.toPrimitive](): number;
74
+ }
75
+ /**
76
+ * This object is created internally and is returned from `setTimeout()` and
77
+ * `setInterval()`. It can be passed to either `clearTimeout()` or
78
+ * `clearInterval()` in order to cancel the scheduled actions.
79
+ *
80
+ * By default, when a timer is scheduled using either `setTimeout()` or
81
+ * `setInterval()`, the Node.js event loop will continue running as long as the
82
+ * timer is active. Each of the `Timeout` objects returned by these functions
83
+ * export both `timeout.ref()` and `timeout.unref()` functions that can be used to
84
+ * control this default behavior.
85
+ */
86
+ interface Timeout extends RefCounted, Disposable, Timer {
87
+ /**
88
+ * Cancels the timeout.
89
+ * @since v0.9.1
90
+ * @legacy Use `clearTimeout()` instead.
91
+ * @returns a reference to `timeout`
92
+ */
93
+ close(): this;
94
+ /**
95
+ * If true, the `Timeout` object will keep the Node.js event loop active.
96
+ * @since v11.0.0
97
+ */
98
+ hasRef(): boolean;
99
+ /**
100
+ * When called, requests that the Node.js event loop _not_ exit so long as the
101
+ * `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
102
+ *
103
+ * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
104
+ * to call `timeout.ref()` unless `timeout.unref()` had been called previously.
105
+ * @since v0.9.1
106
+ * @returns a reference to `timeout`
107
+ */
108
+ ref(): this;
109
+ /**
110
+ * Sets the timer's start time to the current time, and reschedules the timer to
111
+ * call its callback at the previously specified duration adjusted to the current
112
+ * time. This is useful for refreshing a timer without allocating a new
113
+ * JavaScript object.
114
+ *
115
+ * Using this on a timer that has already called its callback will reactivate the
116
+ * timer.
117
+ * @since v10.2.0
118
+ * @returns a reference to `timeout`
119
+ */
120
+ refresh(): this;
121
+ /**
122
+ * When called, the active `Timeout` object will not require the Node.js event loop
123
+ * to remain active. If there is no other activity keeping the event loop running,
124
+ * the process may exit before the `Timeout` object's callback is invoked. Calling
125
+ * `timeout.unref()` multiple times will have no effect.
126
+ * @since v0.9.1
127
+ * @returns a reference to `timeout`
128
+ */
129
+ unref(): this;
130
+ /**
131
+ * Coerce a `Timeout` to a primitive. The primitive can be used to
132
+ * clear the `Timeout`. The primitive can only be used in the
133
+ * same thread where the timeout was created. Therefore, to use it
134
+ * across `worker_threads` it must first be passed to the correct
135
+ * thread. This allows enhanced compatibility with browser
136
+ * `setTimeout()` and `setInterval()` implementations.
137
+ * @since v14.9.0, v12.19.0
138
+ */
139
+ [Symbol.toPrimitive](): number;
140
+ /**
141
+ * Cancels the timeout.
142
+ * @since v18.18.0
143
+ * @experimental
144
+ */
145
+ [Symbol.dispose](): void;
146
+ _onTimeout(...args: any[]): void;
147
+ }
148
+ }
149
+ /**
150
+ * Schedules the "immediate" execution of the `callback` after I/O events'
151
+ * callbacks.
152
+ *
153
+ * When multiple calls to `setImmediate()` are made, the `callback` functions are
154
+ * queued for execution in the order in which they are created. The entire callback
155
+ * queue is processed every event loop iteration. If an immediate timer is queued
156
+ * from inside an executing callback, that timer will not be triggered until the
157
+ * next event loop iteration.
158
+ *
159
+ * If `callback` is not a function, a `TypeError` will be thrown.
160
+ *
161
+ * This method has a custom variant for promises that is available using
162
+ * `timersPromises.setImmediate()`.
163
+ * @since v0.9.1
164
+ * @param callback The function to call at the end of this turn of
165
+ * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
166
+ * @param args Optional arguments to pass when the `callback` is called.
167
+ * @returns for use with `clearImmediate()`
168
+ */
169
+ function setImmediate<TArgs extends any[]>(
170
+ callback: (...args: TArgs) => void,
171
+ ...args: TArgs
172
+ ): NodeJS.Immediate;
173
+ // Allow a single void-accepting argument to be optional in arguments lists.
174
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
175
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
176
+ function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
177
+ namespace setImmediate {
178
+ import __promisify__ = promises.setImmediate;
179
+ export { __promisify__ };
180
+ }
181
+ /**
182
+ * Schedules repeated execution of `callback` every `delay` milliseconds.
183
+ *
184
+ * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be
185
+ * set to `1`. Non-integer delays are truncated to an integer.
186
+ *
187
+ * If `callback` is not a function, a `TypeError` will be thrown.
188
+ *
189
+ * This method has a custom variant for promises that is available using
190
+ * `timersPromises.setInterval()`.
191
+ * @since v0.0.1
192
+ * @param callback The function to call when the timer elapses.
193
+ * @param delay The number of milliseconds to wait before calling the
194
+ * `callback`. **Default:** `1`.
195
+ * @param args Optional arguments to pass when the `callback` is called.
196
+ * @returns for use with `clearInterval()`
197
+ */
198
+ function setInterval<TArgs extends any[]>(
199
+ callback: (...args: TArgs) => void,
200
+ delay?: number,
201
+ ...args: TArgs
202
+ ): NodeJS.Timeout;
203
+ // Allow a single void-accepting argument to be optional in arguments lists.
204
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
205
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
206
+ function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
207
+ /**
208
+ * Schedules execution of a one-time `callback` after `delay` milliseconds.
209
+ *
210
+ * The `callback` will likely not be invoked in precisely `delay` milliseconds.
211
+ * Node.js makes no guarantees about the exact timing of when callbacks will fire,
212
+ * nor of their ordering. The callback will be called as close as possible to the
213
+ * time specified.
214
+ *
215
+ * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
216
+ * will be set to `1`. Non-integer delays are truncated to an integer.
217
+ *
218
+ * If `callback` is not a function, a `TypeError` will be thrown.
219
+ *
220
+ * This method has a custom variant for promises that is available using
221
+ * `timersPromises.setTimeout()`.
222
+ * @since v0.0.1
223
+ * @param callback The function to call when the timer elapses.
224
+ * @param delay The number of milliseconds to wait before calling the
225
+ * `callback`. **Default:** `1`.
226
+ * @param args Optional arguments to pass when the `callback` is called.
227
+ * @returns for use with `clearTimeout()`
228
+ */
229
+ function setTimeout<TArgs extends any[]>(
230
+ callback: (...args: TArgs) => void,
231
+ delay?: number,
232
+ ...args: TArgs
233
+ ): NodeJS.Timeout;
234
+ // Allow a single void-accepting argument to be optional in arguments lists.
235
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
236
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
237
+ function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
238
+ namespace setTimeout {
239
+ import __promisify__ = promises.setTimeout;
240
+ export { __promisify__ };
241
+ }
242
+ /**
243
+ * Cancels an `Immediate` object created by `setImmediate()`.
244
+ * @since v0.9.1
245
+ * @param immediate An `Immediate` object as returned by `setImmediate()`.
246
+ */
247
+ function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
248
+ /**
249
+ * Cancels a `Timeout` object created by `setInterval()`.
250
+ * @since v0.0.1
251
+ * @param timeout A `Timeout` object as returned by `setInterval()`
252
+ * or the primitive of the `Timeout` object as a string or a number.
253
+ */
254
+ function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
255
+ /**
256
+ * Cancels a `Timeout` object created by `setTimeout()`.
257
+ * @since v0.0.1
258
+ * @param timeout A `Timeout` object as returned by `setTimeout()`
259
+ * or the primitive of the `Timeout` object as a string or a number.
260
+ */
261
+ function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
262
+ /**
263
+ * The `queueMicrotask()` method queues a microtask to invoke `callback`. If
264
+ * `callback` throws an exception, the `process` object `'uncaughtException'`
265
+ * event will be emitted.
266
+ *
267
+ * The microtask queue is managed by V8 and may be used in a similar manner to
268
+ * the `process.nextTick()` queue, which is managed by Node.js. The
269
+ * `process.nextTick()` queue is always processed before the microtask queue
270
+ * within each turn of the Node.js event loop.
271
+ * @since v11.0.0
272
+ * @param callback Function to be queued.
273
+ */
274
+ function queueMicrotask(callback: () => void): void;
275
+ }
276
+ import clearImmediate = globalThis.clearImmediate;
277
+ import clearInterval = globalThis.clearInterval;
278
+ import clearTimeout = globalThis.clearTimeout;
279
+ import setImmediate = globalThis.setImmediate;
280
+ import setInterval = globalThis.setInterval;
281
+ import setTimeout = globalThis.setTimeout;
282
+ export { clearImmediate, clearInterval, clearTimeout, setImmediate, setInterval, setTimeout };
283
+ }
284
+ declare module "node:timers" {
285
+ export * from "timers";
286
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/timers/promises.d.ts ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `timers/promises` API provides an alternative set of timer functions
3
+ * that return `Promise` objects. The API is accessible via
4
+ * `require('node:timers/promises')`.
5
+ *
6
+ * ```js
7
+ * import {
8
+ * setTimeout,
9
+ * setImmediate,
10
+ * setInterval,
11
+ * } from 'timers/promises';
12
+ * ```
13
+ * @since v15.0.0
14
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/timers/promises.js)
15
+ */
16
+ declare module "timers/promises" {
17
+ import { TimerOptions } from "node:timers";
18
+ /**
19
+ * ```js
20
+ * import {
21
+ * setTimeout,
22
+ * } from 'node:timers/promises';
23
+ *
24
+ * const res = await setTimeout(100, 'result');
25
+ *
26
+ * console.log(res); // Prints 'result'
27
+ * ```
28
+ * @since v15.0.0
29
+ * @param delay The number of milliseconds to wait before fulfilling the
30
+ * promise. **Default:** `1`.
31
+ * @param value A value with which the promise is fulfilled.
32
+ */
33
+ function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
34
+ /**
35
+ * ```js
36
+ * import {
37
+ * setImmediate,
38
+ * } from 'node:timers/promises';
39
+ *
40
+ * const res = await setImmediate('result');
41
+ *
42
+ * console.log(res); // Prints 'result'
43
+ * ```
44
+ * @since v15.0.0
45
+ * @param value A value with which the promise is fulfilled.
46
+ */
47
+ function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
48
+ /**
49
+ * Returns an async iterator that generates values in an interval of `delay` ms.
50
+ * If `ref` is `true`, you need to call `next()` of async iterator explicitly
51
+ * or implicitly to keep the event loop alive.
52
+ *
53
+ * ```js
54
+ * import {
55
+ * setInterval,
56
+ * } from 'node:timers/promises';
57
+ *
58
+ * const interval = 100;
59
+ * for await (const startTime of setInterval(interval, Date.now())) {
60
+ * const now = Date.now();
61
+ * console.log(now);
62
+ * if ((now - startTime) > 1000)
63
+ * break;
64
+ * }
65
+ * console.log(Date.now());
66
+ * ```
67
+ * @since v15.9.0
68
+ * @param delay The number of milliseconds to wait between iterations.
69
+ * **Default:** `1`.
70
+ * @param value A value with which the iterator returns.
71
+ */
72
+ function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): NodeJS.AsyncIterator<T>;
73
+ interface Scheduler {
74
+ /**
75
+ * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
76
+ * being developed as a standard Web Platform API.
77
+ *
78
+ * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent
79
+ * to calling `timersPromises.setTimeout(delay, undefined, options)` except that
80
+ * the `ref` option is not supported.
81
+ *
82
+ * ```js
83
+ * import { scheduler } from 'node:timers/promises';
84
+ *
85
+ * await scheduler.wait(1000); // Wait one second before continuing
86
+ * ```
87
+ * @since v17.3.0, v16.14.0
88
+ * @experimental
89
+ * @param delay The number of milliseconds to wait before resolving the
90
+ * promise.
91
+ */
92
+ wait(delay: number, options?: { signal?: AbortSignal }): Promise<void>;
93
+ /**
94
+ * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
95
+ * being developed as a standard Web Platform API.
96
+ *
97
+ * Calling `timersPromises.scheduler.yield()` is equivalent to calling
98
+ * `timersPromises.setImmediate()` with no arguments.
99
+ * @since v17.3.0, v16.14.0
100
+ * @experimental
101
+ */
102
+ yield(): Promise<void>;
103
+ }
104
+ const scheduler: Scheduler;
105
+ }
106
+ declare module "node:timers/promises" {
107
+ export * from "timers/promises";
108
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/tls.d.ts ADDED
@@ -0,0 +1,1204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `tls` module provides an implementation of the Transport Layer Security
3
+ * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
4
+ * The module can be accessed using:
5
+ *
6
+ * ```js
7
+ * import tls from 'node:tls';
8
+ * ```
9
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js)
10
+ */
11
+ declare module "tls" {
12
+ import { X509Certificate } from "node:crypto";
13
+ import * as net from "node:net";
14
+ import * as stream from "stream";
15
+ const CLIENT_RENEG_LIMIT: number;
16
+ const CLIENT_RENEG_WINDOW: number;
17
+ interface Certificate {
18
+ /**
19
+ * Country code.
20
+ */
21
+ C: string;
22
+ /**
23
+ * Street.
24
+ */
25
+ ST: string;
26
+ /**
27
+ * Locality.
28
+ */
29
+ L: string;
30
+ /**
31
+ * Organization.
32
+ */
33
+ O: string;
34
+ /**
35
+ * Organizational unit.
36
+ */
37
+ OU: string;
38
+ /**
39
+ * Common name.
40
+ */
41
+ CN: string;
42
+ }
43
+ interface PeerCertificate {
44
+ /**
45
+ * `true` if a Certificate Authority (CA), `false` otherwise.
46
+ * @since v18.13.0
47
+ */
48
+ ca: boolean;
49
+ /**
50
+ * The DER encoded X.509 certificate data.
51
+ */
52
+ raw: Buffer;
53
+ /**
54
+ * The certificate subject.
55
+ */
56
+ subject: Certificate;
57
+ /**
58
+ * The certificate issuer, described in the same terms as the `subject`.
59
+ */
60
+ issuer: Certificate;
61
+ /**
62
+ * The date-time the certificate is valid from.
63
+ */
64
+ valid_from: string;
65
+ /**
66
+ * The date-time the certificate is valid to.
67
+ */
68
+ valid_to: string;
69
+ /**
70
+ * The certificate serial number, as a hex string.
71
+ */
72
+ serialNumber: string;
73
+ /**
74
+ * The SHA-1 digest of the DER encoded certificate.
75
+ * It is returned as a `:` separated hexadecimal string.
76
+ */
77
+ fingerprint: string;
78
+ /**
79
+ * The SHA-256 digest of the DER encoded certificate.
80
+ * It is returned as a `:` separated hexadecimal string.
81
+ */
82
+ fingerprint256: string;
83
+ /**
84
+ * The SHA-512 digest of the DER encoded certificate.
85
+ * It is returned as a `:` separated hexadecimal string.
86
+ */
87
+ fingerprint512: string;
88
+ /**
89
+ * The extended key usage, a set of OIDs.
90
+ */
91
+ ext_key_usage?: string[];
92
+ /**
93
+ * A string containing concatenated names for the subject,
94
+ * an alternative to the `subject` names.
95
+ */
96
+ subjectaltname?: string;
97
+ /**
98
+ * An array describing the AuthorityInfoAccess, used with OCSP.
99
+ */
100
+ infoAccess?: NodeJS.Dict<string[]>;
101
+ /**
102
+ * For RSA keys: The RSA bit size.
103
+ *
104
+ * For EC keys: The key size in bits.
105
+ */
106
+ bits?: number;
107
+ /**
108
+ * The RSA exponent, as a string in hexadecimal number notation.
109
+ */
110
+ exponent?: string;
111
+ /**
112
+ * The RSA modulus, as a hexadecimal string.
113
+ */
114
+ modulus?: string;
115
+ /**
116
+ * The public key.
117
+ */
118
+ pubkey?: Buffer;
119
+ /**
120
+ * The ASN.1 name of the OID of the elliptic curve.
121
+ * Well-known curves are identified by an OID.
122
+ * While it is unusual, it is possible that the curve
123
+ * is identified by its mathematical properties,
124
+ * in which case it will not have an OID.
125
+ */
126
+ asn1Curve?: string;
127
+ /**
128
+ * The NIST name for the elliptic curve,if it has one
129
+ * (not all well-known curves have been assigned names by NIST).
130
+ */
131
+ nistCurve?: string;
132
+ }
133
+ interface DetailedPeerCertificate extends PeerCertificate {
134
+ /**
135
+ * The issuer certificate object.
136
+ * For self-signed certificates, this may be a circular reference.
137
+ */
138
+ issuerCertificate: DetailedPeerCertificate;
139
+ }
140
+ interface CipherNameAndProtocol {
141
+ /**
142
+ * The cipher name.
143
+ */
144
+ name: string;
145
+ /**
146
+ * SSL/TLS protocol version.
147
+ */
148
+ version: string;
149
+ /**
150
+ * IETF name for the cipher suite.
151
+ */
152
+ standardName: string;
153
+ }
154
+ interface EphemeralKeyInfo {
155
+ /**
156
+ * The supported types are 'DH' and 'ECDH'.
157
+ */
158
+ type: string;
159
+ /**
160
+ * The name property is available only when type is 'ECDH'.
161
+ */
162
+ name?: string | undefined;
163
+ /**
164
+ * The size of parameter of an ephemeral key exchange.
165
+ */
166
+ size: number;
167
+ }
168
+ interface KeyObject {
169
+ /**
170
+ * Private keys in PEM format.
171
+ */
172
+ pem: string | Buffer;
173
+ /**
174
+ * Optional passphrase.
175
+ */
176
+ passphrase?: string | undefined;
177
+ }
178
+ interface PxfObject {
179
+ /**
180
+ * PFX or PKCS12 encoded private key and certificate chain.
181
+ */
182
+ buf: string | Buffer;
183
+ /**
184
+ * Optional passphrase.
185
+ */
186
+ passphrase?: string | undefined;
187
+ }
188
+ interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
189
+ /**
190
+ * If true the TLS socket will be instantiated in server-mode.
191
+ * Defaults to false.
192
+ */
193
+ isServer?: boolean | undefined;
194
+ /**
195
+ * An optional net.Server instance.
196
+ */
197
+ server?: net.Server | undefined;
198
+ /**
199
+ * An optional Buffer instance containing a TLS session.
200
+ */
201
+ session?: Buffer | undefined;
202
+ /**
203
+ * If true, specifies that the OCSP status request extension will be
204
+ * added to the client hello and an 'OCSPResponse' event will be
205
+ * emitted on the socket before establishing a secure communication
206
+ */
207
+ requestOCSP?: boolean | undefined;
208
+ }
209
+ /**
210
+ * Performs transparent encryption of written data and all required TLS
211
+ * negotiation.
212
+ *
213
+ * Instances of `tls.TLSSocket` implement the duplex `Stream` interface.
214
+ *
215
+ * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the
216
+ * connection is open.
217
+ * @since v0.11.4
218
+ */
219
+ class TLSSocket extends net.Socket {
220
+ /**
221
+ * Construct a new tls.TLSSocket object from an existing TCP socket.
222
+ */
223
+ constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions);
224
+ /**
225
+ * This property is `true` if the peer certificate was signed by one of the CAs
226
+ * specified when creating the `tls.TLSSocket` instance, otherwise `false`.
227
+ * @since v0.11.4
228
+ */
229
+ authorized: boolean;
230
+ /**
231
+ * Returns the reason why the peer's certificate was not been verified. This
232
+ * property is set only when `tlsSocket.authorized === false`.
233
+ * @since v0.11.4
234
+ */
235
+ authorizationError: Error;
236
+ /**
237
+ * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
238
+ * @since v0.11.4
239
+ */
240
+ encrypted: true;
241
+ /**
242
+ * String containing the selected ALPN protocol.
243
+ * Before a handshake has completed, this value is always null.
244
+ * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
245
+ */
246
+ alpnProtocol: string | false | null;
247
+ /**
248
+ * Returns an object representing the local certificate. The returned object has
249
+ * some properties corresponding to the fields of the certificate.
250
+ *
251
+ * See {@link TLSSocket.getPeerCertificate} for an example of the certificate
252
+ * structure.
253
+ *
254
+ * If there is no local certificate, an empty object will be returned. If the
255
+ * socket has been destroyed, `null` will be returned.
256
+ * @since v11.2.0
257
+ */
258
+ getCertificate(): PeerCertificate | object | null;
259
+ /**
260
+ * Returns an object containing information on the negotiated cipher suite.
261
+ *
262
+ * For example:
263
+ *
264
+ * ```json
265
+ * {
266
+ * "name": "AES128-SHA256",
267
+ * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256",
268
+ * "version": "TLSv1.2"
269
+ * }
270
+ * ```
271
+ *
272
+ * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information.
273
+ * @since v0.11.4
274
+ */
275
+ getCipher(): CipherNameAndProtocol;
276
+ /**
277
+ * Returns an object representing the type, name, and size of parameter of
278
+ * an ephemeral key exchange in `perfect forward secrecy` on a client
279
+ * connection. It returns an empty object when the key exchange is not
280
+ * ephemeral. As this is only supported on a client socket; `null` is returned
281
+ * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`.
282
+ *
283
+ * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`.
284
+ * @since v5.0.0
285
+ */
286
+ getEphemeralKeyInfo(): EphemeralKeyInfo | object | null;
287
+ /**
288
+ * As the `Finished` messages are message digests of the complete handshake
289
+ * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
290
+ * be used for external authentication procedures when the authentication
291
+ * provided by SSL/TLS is not desired or is not enough.
292
+ *
293
+ * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used
294
+ * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
295
+ * @since v9.9.0
296
+ * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
297
+ */
298
+ getFinished(): Buffer | undefined;
299
+ /**
300
+ * Returns an object representing the peer's certificate. If the peer does not
301
+ * provide a certificate, an empty object will be returned. If the socket has been
302
+ * destroyed, `null` will be returned.
303
+ *
304
+ * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's
305
+ * certificate.
306
+ * @since v0.11.4
307
+ * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate.
308
+ * @return A certificate object.
309
+ */
310
+ getPeerCertificate(detailed: true): DetailedPeerCertificate;
311
+ getPeerCertificate(detailed?: false): PeerCertificate;
312
+ getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
313
+ /**
314
+ * As the `Finished` messages are message digests of the complete handshake
315
+ * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
316
+ * be used for external authentication procedures when the authentication
317
+ * provided by SSL/TLS is not desired or is not enough.
318
+ *
319
+ * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used
320
+ * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
321
+ * @since v9.9.0
322
+ * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
323
+ * far.
324
+ */
325
+ getPeerFinished(): Buffer | undefined;
326
+ /**
327
+ * Returns a string containing the negotiated SSL/TLS protocol version of the
328
+ * current connection. The value `'unknown'` will be returned for connected
329
+ * sockets that have not completed the handshaking process. The value `null` will
330
+ * be returned for server sockets or disconnected client sockets.
331
+ *
332
+ * Protocol versions are:
333
+ *
334
+ * * `'SSLv3'`
335
+ * * `'TLSv1'`
336
+ * * `'TLSv1.1'`
337
+ * * `'TLSv1.2'`
338
+ * * `'TLSv1.3'`
339
+ *
340
+ * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information.
341
+ * @since v5.7.0
342
+ */
343
+ getProtocol(): string | null;
344
+ /**
345
+ * Returns the TLS session data or `undefined` if no session was
346
+ * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful
347
+ * for debugging.
348
+ *
349
+ * See `Session Resumption` for more information.
350
+ *
351
+ * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications
352
+ * must use the `'session'` event (it also works for TLSv1.2 and below).
353
+ * @since v0.11.4
354
+ */
355
+ getSession(): Buffer | undefined;
356
+ /**
357
+ * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
358
+ * @since v12.11.0
359
+ * @return List of signature algorithms shared between the server and the client in the order of decreasing preference.
360
+ */
361
+ getSharedSigalgs(): string[];
362
+ /**
363
+ * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`.
364
+ *
365
+ * It may be useful for debugging.
366
+ *
367
+ * See `Session Resumption` for more information.
368
+ * @since v0.11.4
369
+ */
370
+ getTLSTicket(): Buffer | undefined;
371
+ /**
372
+ * See `Session Resumption` for more information.
373
+ * @since v0.5.6
374
+ * @return `true` if the session was reused, `false` otherwise.
375
+ */
376
+ isSessionReused(): boolean;
377
+ /**
378
+ * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process.
379
+ * Upon completion, the `callback` function will be passed a single argument
380
+ * that is either an `Error` (if the request failed) or `null`.
381
+ *
382
+ * This method can be used to request a peer's certificate after the secure
383
+ * connection has been established.
384
+ *
385
+ * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout.
386
+ *
387
+ * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the
388
+ * protocol.
389
+ * @since v0.11.8
390
+ * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with
391
+ * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all.
392
+ * @return `true` if renegotiation was initiated, `false` otherwise.
393
+ */
394
+ renegotiate(
395
+ options: {
396
+ rejectUnauthorized?: boolean | undefined;
397
+ requestCert?: boolean | undefined;
398
+ },
399
+ callback: (err: Error | null) => void,
400
+ ): undefined | boolean;
401
+ /**
402
+ * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
403
+ * Returns `true` if setting the limit succeeded; `false` otherwise.
404
+ *
405
+ * Smaller fragment sizes decrease the buffering latency on the client: larger
406
+ * fragments are buffered by the TLS layer until the entire fragment is received
407
+ * and its integrity is verified; large fragments can span multiple roundtrips
408
+ * and their processing can be delayed due to packet loss or reordering. However,
409
+ * smaller fragments add extra TLS framing bytes and CPU overhead, which may
410
+ * decrease overall server throughput.
411
+ * @since v0.11.11
412
+ * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`.
413
+ */
414
+ setMaxSendFragment(size: number): boolean;
415
+ /**
416
+ * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts
417
+ * to renegotiate will trigger an `'error'` event on the `TLSSocket`.
418
+ * @since v8.4.0
419
+ */
420
+ disableRenegotiation(): void;
421
+ /**
422
+ * When enabled, TLS packet trace information is written to `stderr`. This can be
423
+ * used to debug TLS connection problems.
424
+ *
425
+ * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by
426
+ * OpenSSL's `SSL_trace()` function, the format is undocumented, can change
427
+ * without notice, and should not be relied on.
428
+ * @since v12.2.0
429
+ */
430
+ enableTrace(): void;
431
+ /**
432
+ * Returns the peer certificate as an `X509Certificate` object.
433
+ *
434
+ * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned.
435
+ * @since v15.9.0
436
+ */
437
+ getPeerX509Certificate(): X509Certificate | undefined;
438
+ /**
439
+ * Returns the local certificate as an `X509Certificate` object.
440
+ *
441
+ * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned.
442
+ * @since v15.9.0
443
+ */
444
+ getX509Certificate(): X509Certificate | undefined;
445
+ /**
446
+ * Keying material is used for validations to prevent different kind of attacks in
447
+ * network protocols, for example in the specifications of IEEE 802.1X.
448
+ *
449
+ * Example
450
+ *
451
+ * ```js
452
+ * const keyingMaterial = tlsSocket.exportKeyingMaterial(
453
+ * 128,
454
+ * 'client finished');
455
+ *
456
+ * /*
457
+ * Example return value of keyingMaterial:
458
+ * <Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
459
+ * 12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
460
+ * 74 ef 2c ... 78 more bytes>
461
+ *
462
+ * ```
463
+ *
464
+ * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more
465
+ * information.
466
+ * @since v13.10.0, v12.17.0
467
+ * @param length number of bytes to retrieve from keying material
468
+ * @param label an application specific label, typically this will be a value from the [IANA Exporter Label
469
+ * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
470
+ * @param context Optionally provide a context.
471
+ * @return requested bytes of the keying material
472
+ */
473
+ exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
474
+ addListener(event: string, listener: (...args: any[]) => void): this;
475
+ addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
476
+ addListener(event: "secureConnect", listener: () => void): this;
477
+ addListener(event: "session", listener: (session: Buffer) => void): this;
478
+ addListener(event: "keylog", listener: (line: Buffer) => void): this;
479
+ emit(event: string | symbol, ...args: any[]): boolean;
480
+ emit(event: "OCSPResponse", response: Buffer): boolean;
481
+ emit(event: "secureConnect"): boolean;
482
+ emit(event: "session", session: Buffer): boolean;
483
+ emit(event: "keylog", line: Buffer): boolean;
484
+ on(event: string, listener: (...args: any[]) => void): this;
485
+ on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
486
+ on(event: "secureConnect", listener: () => void): this;
487
+ on(event: "session", listener: (session: Buffer) => void): this;
488
+ on(event: "keylog", listener: (line: Buffer) => void): this;
489
+ once(event: string, listener: (...args: any[]) => void): this;
490
+ once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
491
+ once(event: "secureConnect", listener: () => void): this;
492
+ once(event: "session", listener: (session: Buffer) => void): this;
493
+ once(event: "keylog", listener: (line: Buffer) => void): this;
494
+ prependListener(event: string, listener: (...args: any[]) => void): this;
495
+ prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
496
+ prependListener(event: "secureConnect", listener: () => void): this;
497
+ prependListener(event: "session", listener: (session: Buffer) => void): this;
498
+ prependListener(event: "keylog", listener: (line: Buffer) => void): this;
499
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
500
+ prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
501
+ prependOnceListener(event: "secureConnect", listener: () => void): this;
502
+ prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
503
+ prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
504
+ }
505
+ interface CommonConnectionOptions {
506
+ /**
507
+ * An optional TLS context object from tls.createSecureContext()
508
+ */
509
+ secureContext?: SecureContext | undefined;
510
+ /**
511
+ * When enabled, TLS packet trace information is written to `stderr`. This can be
512
+ * used to debug TLS connection problems.
513
+ * @default false
514
+ */
515
+ enableTrace?: boolean | undefined;
516
+ /**
517
+ * If true the server will request a certificate from clients that
518
+ * connect and attempt to verify that certificate. Defaults to
519
+ * false.
520
+ */
521
+ requestCert?: boolean | undefined;
522
+ /**
523
+ * An array of strings or a Buffer naming possible ALPN protocols.
524
+ * (Protocols should be ordered by their priority.)
525
+ */
526
+ ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
527
+ /**
528
+ * SNICallback(servername, cb) <Function> A function that will be
529
+ * called if the client supports SNI TLS extension. Two arguments
530
+ * will be passed when called: servername and cb. SNICallback should
531
+ * invoke cb(null, ctx), where ctx is a SecureContext instance.
532
+ * (tls.createSecureContext(...) can be used to get a proper
533
+ * SecureContext.) If SNICallback wasn't provided the default callback
534
+ * with high-level API will be used (see below).
535
+ */
536
+ SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined;
537
+ /**
538
+ * If true the server will reject any connection which is not
539
+ * authorized with the list of supplied CAs. This option only has an
540
+ * effect if requestCert is true.
541
+ * @default true
542
+ */
543
+ rejectUnauthorized?: boolean | undefined;
544
+ }
545
+ interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
546
+ /**
547
+ * Abort the connection if the SSL/TLS handshake does not finish in the
548
+ * specified number of milliseconds. A 'tlsClientError' is emitted on
549
+ * the tls.Server object whenever a handshake times out. Default:
550
+ * 120000 (120 seconds).
551
+ */
552
+ handshakeTimeout?: number | undefined;
553
+ /**
554
+ * The number of seconds after which a TLS session created by the
555
+ * server will no longer be resumable. See Session Resumption for more
556
+ * information. Default: 300.
557
+ */
558
+ sessionTimeout?: number | undefined;
559
+ /**
560
+ * 48-bytes of cryptographically strong pseudo-random data.
561
+ */
562
+ ticketKeys?: Buffer | undefined;
563
+ /**
564
+ * @param socket
565
+ * @param identity identity parameter sent from the client.
566
+ * @return pre-shared key that must either be
567
+ * a buffer or `null` to stop the negotiation process. Returned PSK must be
568
+ * compatible with the selected cipher's digest.
569
+ *
570
+ * When negotiating TLS-PSK (pre-shared keys), this function is called
571
+ * with the identity provided by the client.
572
+ * If the return value is `null` the negotiation process will stop and an
573
+ * "unknown_psk_identity" alert message will be sent to the other party.
574
+ * If the server wishes to hide the fact that the PSK identity was not known,
575
+ * the callback must provide some random data as `psk` to make the connection
576
+ * fail with "decrypt_error" before negotiation is finished.
577
+ * PSK ciphers are disabled by default, and using TLS-PSK thus
578
+ * requires explicitly specifying a cipher suite with the `ciphers` option.
579
+ * More information can be found in the RFC 4279.
580
+ */
581
+ pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
582
+ /**
583
+ * hint to send to a client to help
584
+ * with selecting the identity during TLS-PSK negotiation. Will be ignored
585
+ * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
586
+ * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
587
+ */
588
+ pskIdentityHint?: string | undefined;
589
+ }
590
+ interface PSKCallbackNegotation {
591
+ psk: DataView | NodeJS.TypedArray;
592
+ identity: string;
593
+ }
594
+ interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
595
+ host?: string | undefined;
596
+ port?: number | undefined;
597
+ path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
598
+ socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket
599
+ checkServerIdentity?: typeof checkServerIdentity | undefined;
600
+ servername?: string | undefined; // SNI TLS Extension
601
+ session?: Buffer | undefined;
602
+ minDHSize?: number | undefined;
603
+ lookup?: net.LookupFunction | undefined;
604
+ timeout?: number | undefined;
605
+ /**
606
+ * When negotiating TLS-PSK (pre-shared keys), this function is called
607
+ * with optional identity `hint` provided by the server or `null`
608
+ * in case of TLS 1.3 where `hint` was removed.
609
+ * It will be necessary to provide a custom `tls.checkServerIdentity()`
610
+ * for the connection as the default one will try to check hostname/IP
611
+ * of the server against the certificate but that's not applicable for PSK
612
+ * because there won't be a certificate present.
613
+ * More information can be found in the RFC 4279.
614
+ *
615
+ * @param hint message sent from the server to help client
616
+ * decide which identity to use during negotiation.
617
+ * Always `null` if TLS 1.3 is used.
618
+ * @returns Return `null` to stop the negotiation process. `psk` must be
619
+ * compatible with the selected cipher's digest.
620
+ * `identity` must use UTF-8 encoding.
621
+ */
622
+ pskCallback?(hint: string | null): PSKCallbackNegotation | null;
623
+ }
624
+ /**
625
+ * Accepts encrypted connections using TLS or SSL.
626
+ * @since v0.3.2
627
+ */
628
+ class Server extends net.Server {
629
+ constructor(secureConnectionListener?: (socket: TLSSocket) => void);
630
+ constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void);
631
+ /**
632
+ * The `server.addContext()` method adds a secure context that will be used if
633
+ * the client request's SNI name matches the supplied `hostname` (or wildcard).
634
+ *
635
+ * When there are multiple matching contexts, the most recently added one is
636
+ * used.
637
+ * @since v0.5.3
638
+ * @param hostname A SNI host name or wildcard (e.g. `'*'`)
639
+ * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created
640
+ * with {@link createSecureContext} itself.
641
+ */
642
+ addContext(hostname: string, context: SecureContextOptions | SecureContext): void;
643
+ /**
644
+ * Returns the session ticket keys.
645
+ *
646
+ * See `Session Resumption` for more information.
647
+ * @since v3.0.0
648
+ * @return A 48-byte buffer containing the session ticket keys.
649
+ */
650
+ getTicketKeys(): Buffer;
651
+ /**
652
+ * The `server.setSecureContext()` method replaces the secure context of an
653
+ * existing server. Existing connections to the server are not interrupted.
654
+ * @since v11.0.0
655
+ * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
656
+ */
657
+ setSecureContext(options: SecureContextOptions): void;
658
+ /**
659
+ * Sets the session ticket keys.
660
+ *
661
+ * Changes to the ticket keys are effective only for future server connections.
662
+ * Existing or currently pending server connections will use the previous keys.
663
+ *
664
+ * See `Session Resumption` for more information.
665
+ * @since v3.0.0
666
+ * @param keys A 48-byte buffer containing the session ticket keys.
667
+ */
668
+ setTicketKeys(keys: Buffer): void;
669
+ /**
670
+ * events.EventEmitter
671
+ * 1. tlsClientError
672
+ * 2. newSession
673
+ * 3. OCSPRequest
674
+ * 4. resumeSession
675
+ * 5. secureConnection
676
+ * 6. keylog
677
+ */
678
+ addListener(event: string, listener: (...args: any[]) => void): this;
679
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
680
+ addListener(
681
+ event: "newSession",
682
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
683
+ ): this;
684
+ addListener(
685
+ event: "OCSPRequest",
686
+ listener: (
687
+ certificate: Buffer,
688
+ issuer: Buffer,
689
+ callback: (err: Error | null, resp: Buffer) => void,
690
+ ) => void,
691
+ ): this;
692
+ addListener(
693
+ event: "resumeSession",
694
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
695
+ ): this;
696
+ addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
697
+ addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
698
+ emit(event: string | symbol, ...args: any[]): boolean;
699
+ emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
700
+ emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
701
+ emit(
702
+ event: "OCSPRequest",
703
+ certificate: Buffer,
704
+ issuer: Buffer,
705
+ callback: (err: Error | null, resp: Buffer) => void,
706
+ ): boolean;
707
+ emit(
708
+ event: "resumeSession",
709
+ sessionId: Buffer,
710
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
711
+ ): boolean;
712
+ emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
713
+ emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
714
+ on(event: string, listener: (...args: any[]) => void): this;
715
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
716
+ on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
717
+ on(
718
+ event: "OCSPRequest",
719
+ listener: (
720
+ certificate: Buffer,
721
+ issuer: Buffer,
722
+ callback: (err: Error | null, resp: Buffer) => void,
723
+ ) => void,
724
+ ): this;
725
+ on(
726
+ event: "resumeSession",
727
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
728
+ ): this;
729
+ on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
730
+ on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
731
+ once(event: string, listener: (...args: any[]) => void): this;
732
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
733
+ once(
734
+ event: "newSession",
735
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
736
+ ): this;
737
+ once(
738
+ event: "OCSPRequest",
739
+ listener: (
740
+ certificate: Buffer,
741
+ issuer: Buffer,
742
+ callback: (err: Error | null, resp: Buffer) => void,
743
+ ) => void,
744
+ ): this;
745
+ once(
746
+ event: "resumeSession",
747
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
748
+ ): this;
749
+ once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
750
+ once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
751
+ prependListener(event: string, listener: (...args: any[]) => void): this;
752
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
753
+ prependListener(
754
+ event: "newSession",
755
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
756
+ ): this;
757
+ prependListener(
758
+ event: "OCSPRequest",
759
+ listener: (
760
+ certificate: Buffer,
761
+ issuer: Buffer,
762
+ callback: (err: Error | null, resp: Buffer) => void,
763
+ ) => void,
764
+ ): this;
765
+ prependListener(
766
+ event: "resumeSession",
767
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
768
+ ): this;
769
+ prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
770
+ prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
771
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
772
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
773
+ prependOnceListener(
774
+ event: "newSession",
775
+ listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
776
+ ): this;
777
+ prependOnceListener(
778
+ event: "OCSPRequest",
779
+ listener: (
780
+ certificate: Buffer,
781
+ issuer: Buffer,
782
+ callback: (err: Error | null, resp: Buffer) => void,
783
+ ) => void,
784
+ ): this;
785
+ prependOnceListener(
786
+ event: "resumeSession",
787
+ listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
788
+ ): this;
789
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
790
+ prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
791
+ }
792
+ /**
793
+ * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
794
+ */
795
+ interface SecurePair {
796
+ encrypted: TLSSocket;
797
+ cleartext: TLSSocket;
798
+ }
799
+ type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
800
+ interface SecureContextOptions {
801
+ /**
802
+ * If set, this will be called when a client opens a connection using the ALPN extension.
803
+ * One argument will be passed to the callback: an object containing `servername` and `protocols` fields,
804
+ * respectively containing the server name from the SNI extension (if any) and an array of
805
+ * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`,
806
+ * which will be returned to the client as the selected ALPN protocol, or `undefined`,
807
+ * to reject the connection with a fatal alert. If a string is returned that does not match one of
808
+ * the client's ALPN protocols, an error will be thrown.
809
+ * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error.
810
+ * @since v18.19.0
811
+ */
812
+ ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined;
813
+ /**
814
+ * Optionally override the trusted CA certificates. Default is to trust
815
+ * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
816
+ * replaced when CAs are explicitly specified using this option.
817
+ */
818
+ ca?: string | Buffer | Array<string | Buffer> | undefined;
819
+ /**
820
+ * Cert chains in PEM format. One cert chain should be provided per
821
+ * private key. Each cert chain should consist of the PEM formatted
822
+ * certificate for a provided private key, followed by the PEM
823
+ * formatted intermediate certificates (if any), in order, and not
824
+ * including the root CA (the root CA must be pre-known to the peer,
825
+ * see ca). When providing multiple cert chains, they do not have to
826
+ * be in the same order as their private keys in key. If the
827
+ * intermediate certificates are not provided, the peer will not be
828
+ * able to validate the certificate, and the handshake will fail.
829
+ */
830
+ cert?: string | Buffer | Array<string | Buffer> | undefined;
831
+ /**
832
+ * Colon-separated list of supported signature algorithms. The list
833
+ * can contain digest algorithms (SHA256, MD5 etc.), public key
834
+ * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
835
+ * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
836
+ */
837
+ sigalgs?: string | undefined;
838
+ /**
839
+ * Cipher suite specification, replacing the default. For more
840
+ * information, see modifying the default cipher suite. Permitted
841
+ * ciphers can be obtained via tls.getCiphers(). Cipher names must be
842
+ * uppercased in order for OpenSSL to accept them.
843
+ */
844
+ ciphers?: string | undefined;
845
+ /**
846
+ * Name of an OpenSSL engine which can provide the client certificate.
847
+ */
848
+ clientCertEngine?: string | undefined;
849
+ /**
850
+ * PEM formatted CRLs (Certificate Revocation Lists).
851
+ */
852
+ crl?: string | Buffer | Array<string | Buffer> | undefined;
853
+ /**
854
+ * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
855
+ * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
856
+ * ECDHE-based perfect forward secrecy will still be available.
857
+ */
858
+ dhparam?: string | Buffer | undefined;
859
+ /**
860
+ * A string describing a named curve or a colon separated list of curve
861
+ * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
862
+ * agreement. Set to auto to select the curve automatically. Use
863
+ * crypto.getCurves() to obtain a list of available curve names. On
864
+ * recent releases, openssl ecparam -list_curves will also display the
865
+ * name and description of each available elliptic curve. Default:
866
+ * tls.DEFAULT_ECDH_CURVE.
867
+ */
868
+ ecdhCurve?: string | undefined;
869
+ /**
870
+ * Attempt to use the server's cipher suite preferences instead of the
871
+ * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
872
+ * set in secureOptions
873
+ */
874
+ honorCipherOrder?: boolean | undefined;
875
+ /**
876
+ * Private keys in PEM format. PEM allows the option of private keys
877
+ * being encrypted. Encrypted keys will be decrypted with
878
+ * options.passphrase. Multiple keys using different algorithms can be
879
+ * provided either as an array of unencrypted key strings or buffers,
880
+ * or an array of objects in the form {pem: <string|buffer>[,
881
+ * passphrase: <string>]}. The object form can only occur in an array.
882
+ * object.passphrase is optional. Encrypted keys will be decrypted with
883
+ * object.passphrase if provided, or options.passphrase if it is not.
884
+ */
885
+ key?: string | Buffer | Array<string | Buffer | KeyObject> | undefined;
886
+ /**
887
+ * Name of an OpenSSL engine to get private key from. Should be used
888
+ * together with privateKeyIdentifier.
889
+ */
890
+ privateKeyEngine?: string | undefined;
891
+ /**
892
+ * Identifier of a private key managed by an OpenSSL engine. Should be
893
+ * used together with privateKeyEngine. Should not be set together with
894
+ * key, because both options define a private key in different ways.
895
+ */
896
+ privateKeyIdentifier?: string | undefined;
897
+ /**
898
+ * Optionally set the maximum TLS version to allow. One
899
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
900
+ * `secureProtocol` option, use one or the other.
901
+ * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using
902
+ * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
903
+ * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
904
+ */
905
+ maxVersion?: SecureVersion | undefined;
906
+ /**
907
+ * Optionally set the minimum TLS version to allow. One
908
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
909
+ * `secureProtocol` option, use one or the other. It is not recommended to use
910
+ * less than TLSv1.2, but it may be required for interoperability.
911
+ * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using
912
+ * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to
913
+ * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
914
+ * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
915
+ */
916
+ minVersion?: SecureVersion | undefined;
917
+ /**
918
+ * Shared passphrase used for a single private key and/or a PFX.
919
+ */
920
+ passphrase?: string | undefined;
921
+ /**
922
+ * PFX or PKCS12 encoded private key and certificate chain. pfx is an
923
+ * alternative to providing key and cert individually. PFX is usually
924
+ * encrypted, if it is, passphrase will be used to decrypt it. Multiple
925
+ * PFX can be provided either as an array of unencrypted PFX buffers,
926
+ * or an array of objects in the form {buf: <string|buffer>[,
927
+ * passphrase: <string>]}. The object form can only occur in an array.
928
+ * object.passphrase is optional. Encrypted PFX will be decrypted with
929
+ * object.passphrase if provided, or options.passphrase if it is not.
930
+ */
931
+ pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
932
+ /**
933
+ * Optionally affect the OpenSSL protocol behavior, which is not
934
+ * usually necessary. This should be used carefully if at all! Value is
935
+ * a numeric bitmask of the SSL_OP_* options from OpenSSL Options
936
+ */
937
+ secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
938
+ /**
939
+ * Legacy mechanism to select the TLS protocol version to use, it does
940
+ * not support independent control of the minimum and maximum version,
941
+ * and does not support limiting the protocol to TLSv1.3. Use
942
+ * minVersion and maxVersion instead. The possible values are listed as
943
+ * SSL_METHODS, use the function names as strings. For example, use
944
+ * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow
945
+ * any TLS protocol version up to TLSv1.3. It is not recommended to use
946
+ * TLS versions less than 1.2, but it may be required for
947
+ * interoperability. Default: none, see minVersion.
948
+ */
949
+ secureProtocol?: string | undefined;
950
+ /**
951
+ * Opaque identifier used by servers to ensure session state is not
952
+ * shared between applications. Unused by clients.
953
+ */
954
+ sessionIdContext?: string | undefined;
955
+ /**
956
+ * 48-bytes of cryptographically strong pseudo-random data.
957
+ * See Session Resumption for more information.
958
+ */
959
+ ticketKeys?: Buffer | undefined;
960
+ /**
961
+ * The number of seconds after which a TLS session created by the
962
+ * server will no longer be resumable. See Session Resumption for more
963
+ * information. Default: 300.
964
+ */
965
+ sessionTimeout?: number | undefined;
966
+ }
967
+ interface SecureContext {
968
+ context: any;
969
+ }
970
+ /**
971
+ * Verifies the certificate `cert` is issued to `hostname`.
972
+ *
973
+ * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on
974
+ * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type).
975
+ *
976
+ * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as
977
+ * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead.
978
+ *
979
+ * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The
980
+ * overwriting function can call `tls.checkServerIdentity()` of course, to augment
981
+ * the checks done with additional verification.
982
+ *
983
+ * This function is only called if the certificate passed all other checks, such as
984
+ * being issued by trusted CA (`options.ca`).
985
+ *
986
+ * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name
987
+ * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use
988
+ * a custom`options.checkServerIdentity` function that implements the desired behavior.
989
+ * @since v0.8.4
990
+ * @param hostname The host name or IP address to verify the certificate against.
991
+ * @param cert A `certificate object` representing the peer's certificate.
992
+ */
993
+ function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined;
994
+ /**
995
+ * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is
996
+ * automatically set as a listener for the `'secureConnection'` event.
997
+ *
998
+ * The `ticketKeys` options is automatically shared between `cluster` module
999
+ * workers.
1000
+ *
1001
+ * The following illustrates a simple echo server:
1002
+ *
1003
+ * ```js
1004
+ * import tls from 'node:tls';
1005
+ * import fs from 'node:fs';
1006
+ *
1007
+ * const options = {
1008
+ * key: fs.readFileSync('server-key.pem'),
1009
+ * cert: fs.readFileSync('server-cert.pem'),
1010
+ *
1011
+ * // This is necessary only if using client certificate authentication.
1012
+ * requestCert: true,
1013
+ *
1014
+ * // This is necessary only if the client uses a self-signed certificate.
1015
+ * ca: [ fs.readFileSync('client-cert.pem') ]
1016
+ * };
1017
+ *
1018
+ * const server = tls.createServer(options, (socket) => {
1019
+ * console.log('server connected',
1020
+ * socket.authorized ? 'authorized' : 'unauthorized');
1021
+ * socket.write('welcome!\n');
1022
+ * socket.setEncoding('utf8');
1023
+ * socket.pipe(socket);
1024
+ * });
1025
+ * server.listen(8000, () => {
1026
+ * console.log('server bound');
1027
+ * });
1028
+ * ```
1029
+ *
1030
+ * The server can be tested by connecting to it using the example client from {@link connect}.
1031
+ * @since v0.3.2
1032
+ */
1033
+ function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server;
1034
+ function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
1035
+ /**
1036
+ * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event.
1037
+ *
1038
+ * `tls.connect()` returns a {@link TLSSocket} object.
1039
+ *
1040
+ * Unlike the `https` API, `tls.connect()` does not enable the
1041
+ * SNI (Server Name Indication) extension by default, which may cause some
1042
+ * servers to return an incorrect certificate or reject the connection
1043
+ * altogether. To enable SNI, set the `servername` option in addition
1044
+ * to `host`.
1045
+ *
1046
+ * The following illustrates a client for the echo server example from {@link createServer}:
1047
+ *
1048
+ * ```js
1049
+ * // Assumes an echo server that is listening on port 8000.
1050
+ * import tls from 'node:tls';
1051
+ * import fs from 'node:fs';
1052
+ *
1053
+ * const options = {
1054
+ * // Necessary only if the server requires client certificate authentication.
1055
+ * key: fs.readFileSync('client-key.pem'),
1056
+ * cert: fs.readFileSync('client-cert.pem'),
1057
+ *
1058
+ * // Necessary only if the server uses a self-signed certificate.
1059
+ * ca: [ fs.readFileSync('server-cert.pem') ],
1060
+ *
1061
+ * // Necessary only if the server's cert isn't for "localhost".
1062
+ * checkServerIdentity: () => { return null; },
1063
+ * };
1064
+ *
1065
+ * const socket = tls.connect(8000, options, () => {
1066
+ * console.log('client connected',
1067
+ * socket.authorized ? 'authorized' : 'unauthorized');
1068
+ * process.stdin.pipe(socket);
1069
+ * process.stdin.resume();
1070
+ * });
1071
+ * socket.setEncoding('utf8');
1072
+ * socket.on('data', (data) => {
1073
+ * console.log(data);
1074
+ * });
1075
+ * socket.on('end', () => {
1076
+ * console.log('server ends connection');
1077
+ * });
1078
+ * ```
1079
+ * @since v0.11.3
1080
+ */
1081
+ function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
1082
+ function connect(
1083
+ port: number,
1084
+ host?: string,
1085
+ options?: ConnectionOptions,
1086
+ secureConnectListener?: () => void,
1087
+ ): TLSSocket;
1088
+ function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
1089
+ /**
1090
+ * Creates a new secure pair object with two streams, one of which reads and writes
1091
+ * the encrypted data and the other of which reads and writes the cleartext data.
1092
+ * Generally, the encrypted stream is piped to/from an incoming encrypted data
1093
+ * stream and the cleartext one is used as a replacement for the initial encrypted
1094
+ * stream.
1095
+ *
1096
+ * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties.
1097
+ *
1098
+ * Using `cleartext` has the same API as {@link TLSSocket}.
1099
+ *
1100
+ * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
1101
+ *
1102
+ * ```js
1103
+ * pair = tls.createSecurePair(// ... );
1104
+ * pair.encrypted.pipe(socket);
1105
+ * socket.pipe(pair.encrypted);
1106
+ * ```
1107
+ *
1108
+ * can be replaced by:
1109
+ *
1110
+ * ```js
1111
+ * secureSocket = tls.TLSSocket(socket, options);
1112
+ * ```
1113
+ *
1114
+ * where `secureSocket` has the same API as `pair.cleartext`.
1115
+ * @since v0.3.2
1116
+ * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
1117
+ * @param context A secure context object as returned by `tls.createSecureContext()`
1118
+ * @param isServer `true` to specify that this TLS connection should be opened as a server.
1119
+ * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
1120
+ * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
1121
+ */
1122
+ function createSecurePair(
1123
+ context?: SecureContext,
1124
+ isServer?: boolean,
1125
+ requestCert?: boolean,
1126
+ rejectUnauthorized?: boolean,
1127
+ ): SecurePair;
1128
+ /**
1129
+ * {@link createServer} sets the default value of the `honorCipherOrder` option
1130
+ * to `true`, other APIs that create secure contexts leave it unset.
1131
+ *
1132
+ * {@link createServer} uses a 128 bit truncated SHA1 hash value generated
1133
+ * from `process.argv` as the default value of the `sessionIdContext` option, other
1134
+ * APIs that create secure contexts have no default value.
1135
+ *
1136
+ * The `tls.createSecureContext()` method creates a `SecureContext` object. It is
1137
+ * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods.
1138
+ *
1139
+ * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it.
1140
+ *
1141
+ * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of
1142
+ * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt).
1143
+ * @since v0.11.13
1144
+ */
1145
+ function createSecureContext(options?: SecureContextOptions): SecureContext;
1146
+ /**
1147
+ * Returns an array with the names of the supported TLS ciphers. The names are
1148
+ * lower-case for historical reasons, but must be uppercased to be used in
1149
+ * the `ciphers` option of {@link createSecureContext}.
1150
+ *
1151
+ * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`.
1152
+ *
1153
+ * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
1154
+ * TLSv1.2 and below.
1155
+ *
1156
+ * ```js
1157
+ * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...]
1158
+ * ```
1159
+ * @since v0.10.2
1160
+ */
1161
+ function getCiphers(): string[];
1162
+ /**
1163
+ * The default curve name to use for ECDH key agreement in a tls server.
1164
+ * The default value is 'auto'. See tls.createSecureContext() for further
1165
+ * information.
1166
+ */
1167
+ let DEFAULT_ECDH_CURVE: string;
1168
+ /**
1169
+ * The default value of the maxVersion option of
1170
+ * tls.createSecureContext(). It can be assigned any of the supported TLS
1171
+ * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default:
1172
+ * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets
1173
+ * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to
1174
+ * 'TLSv1.3'. If multiple of the options are provided, the highest maximum
1175
+ * is used.
1176
+ */
1177
+ let DEFAULT_MAX_VERSION: SecureVersion;
1178
+ /**
1179
+ * The default value of the minVersion option of tls.createSecureContext().
1180
+ * It can be assigned any of the supported TLS protocol versions,
1181
+ * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless
1182
+ * changed using CLI options. Using --tls-min-v1.0 sets the default to
1183
+ * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using
1184
+ * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options
1185
+ * are provided, the lowest minimum is used.
1186
+ */
1187
+ let DEFAULT_MIN_VERSION: SecureVersion;
1188
+ /**
1189
+ * The default value of the ciphers option of tls.createSecureContext().
1190
+ * It can be assigned any of the supported OpenSSL ciphers.
1191
+ * Defaults to the content of crypto.constants.defaultCoreCipherList, unless
1192
+ * changed using CLI options using --tls-default-ciphers.
1193
+ */
1194
+ let DEFAULT_CIPHERS: string;
1195
+ /**
1196
+ * An immutable array of strings representing the root certificates (in PEM
1197
+ * format) used for verifying peer certificates. This is the default value
1198
+ * of the ca option to tls.createSecureContext().
1199
+ */
1200
+ const rootCertificates: readonly string[];
1201
+ }
1202
+ declare module "node:tls" {
1203
+ export * from "tls";
1204
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/trace_events.d.ts ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `trace_events` module provides a mechanism to centralize tracing information
3
+ * generated by V8, Node.js core, and userspace code.
4
+ *
5
+ * Tracing can be enabled with the `--trace-event-categories` command-line flag
6
+ * or by using the `trace_events` module. The `--trace-event-categories` flag
7
+ * accepts a list of comma-separated category names.
8
+ *
9
+ * The available categories are:
10
+ *
11
+ * * `node`: An empty placeholder.
12
+ * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data.
13
+ * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
14
+ * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
15
+ * * `node.console`: Enables capture of `console.time()` and `console.count()` output.
16
+ * * `node.dns.native`: Enables capture of trace data for DNS queries.
17
+ * * `node.environment`: Enables capture of Node.js Environment milestones.
18
+ * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
19
+ * * `node.perf`: Enables capture of `Performance API` measurements.
20
+ * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
21
+ * measures and marks.
22
+ * * `node.perf.timerify`: Enables capture of only Performance API timerify
23
+ * measurements.
24
+ * * `node.promises.rejections`: Enables capture of trace data tracking the number
25
+ * of unhandled Promise rejections and handled-after-rejections.
26
+ * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
27
+ * * `v8`: The `V8` events are GC, compiling, and execution related.
28
+ *
29
+ * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
30
+ *
31
+ * ```bash
32
+ * node --trace-event-categories v8,node,node.async_hooks server.js
33
+ * ```
34
+ *
35
+ * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be
36
+ * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default.
37
+ *
38
+ * ```bash
39
+ * node --trace-events-enabled
40
+ *
41
+ * # is equivalent to
42
+ *
43
+ * node --trace-event-categories v8,node,node.async_hooks
44
+ * ```
45
+ *
46
+ * Alternatively, trace events may be enabled using the `trace_events` module:
47
+ *
48
+ * ```js
49
+ * import trace_events from 'node:trace_events';
50
+ * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
51
+ * tracing.enable(); // Enable trace event capture for the 'node.perf' category
52
+ *
53
+ * // do work
54
+ *
55
+ * tracing.disable(); // Disable trace event capture for the 'node.perf' category
56
+ * ```
57
+ *
58
+ * Running Node.js with tracing enabled will produce log files that can be opened
59
+ * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
60
+ *
61
+ * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can
62
+ * be specified with `--trace-event-file-pattern` that accepts a template
63
+ * string that supports `${rotation}` and `${pid}`:
64
+ *
65
+ * ```bash
66
+ * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
67
+ * ```
68
+ *
69
+ * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
70
+ * in your code, such as:
71
+ *
72
+ * ```js
73
+ * process.on('SIGINT', function onSigint() {
74
+ * console.info('Received SIGINT.');
75
+ * process.exit(130); // Or applicable exit code depending on OS and signal
76
+ * });
77
+ * ```
78
+ *
79
+ * The tracing system uses the same time source
80
+ * as the one used by `process.hrtime()`.
81
+ * However the trace-event timestamps are expressed in microseconds,
82
+ * unlike `process.hrtime()` which returns nanoseconds.
83
+ *
84
+ * The features from this module are not available in `Worker` threads.
85
+ * @experimental
86
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js)
87
+ */
88
+ declare module "trace_events" {
89
+ /**
90
+ * The `Tracing` object is used to enable or disable tracing for sets of
91
+ * categories. Instances are created using the
92
+ * `trace_events.createTracing()` method.
93
+ *
94
+ * When created, the `Tracing` object is disabled. Calling the
95
+ * `tracing.enable()` method adds the categories to the set of enabled trace
96
+ * event categories. Calling `tracing.disable()` will remove the categories
97
+ * from the set of enabled trace event categories.
98
+ */
99
+ interface Tracing {
100
+ /**
101
+ * A comma-separated list of the trace event categories covered by this
102
+ * `Tracing` object.
103
+ */
104
+ readonly categories: string;
105
+ /**
106
+ * Disables this `Tracing` object.
107
+ *
108
+ * Only trace event categories _not_ covered by other enabled `Tracing`
109
+ * objects and _not_ specified by the `--trace-event-categories` flag
110
+ * will be disabled.
111
+ */
112
+ disable(): void;
113
+ /**
114
+ * Enables this `Tracing` object for the set of categories covered by
115
+ * the `Tracing` object.
116
+ */
117
+ enable(): void;
118
+ /**
119
+ * `true` only if the `Tracing` object has been enabled.
120
+ */
121
+ readonly enabled: boolean;
122
+ }
123
+ interface CreateTracingOptions {
124
+ /**
125
+ * An array of trace category names. Values included in the array are
126
+ * coerced to a string when possible. An error will be thrown if the
127
+ * value cannot be coerced.
128
+ */
129
+ categories: string[];
130
+ }
131
+ /**
132
+ * Creates and returns a `Tracing` object for the given set of `categories`.
133
+ *
134
+ * ```js
135
+ * import trace_events from 'node:trace_events';
136
+ * const categories = ['node.perf', 'node.async_hooks'];
137
+ * const tracing = trace_events.createTracing({ categories });
138
+ * tracing.enable();
139
+ * // do stuff
140
+ * tracing.disable();
141
+ * ```
142
+ * @since v10.0.0
143
+ * @return .
144
+ */
145
+ function createTracing(options: CreateTracingOptions): Tracing;
146
+ /**
147
+ * Returns a comma-separated list of all currently-enabled trace event
148
+ * categories. The current set of enabled trace event categories is determined
149
+ * by the _union_ of all currently-enabled `Tracing` objects and any categories
150
+ * enabled using the `--trace-event-categories` flag.
151
+ *
152
+ * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
153
+ *
154
+ * ```js
155
+ * import trace_events from 'node:trace_events';
156
+ * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
157
+ * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
158
+ * const t3 = trace_events.createTracing({ categories: ['v8'] });
159
+ *
160
+ * t1.enable();
161
+ * t2.enable();
162
+ *
163
+ * console.log(trace_events.getEnabledCategories());
164
+ * ```
165
+ * @since v10.0.0
166
+ */
167
+ function getEnabledCategories(): string | undefined;
168
+ }
169
+ declare module "node:trace_events" {
170
+ export * from "trace_events";
171
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/ts5.6/buffer.buffer.d.ts ADDED
@@ -0,0 +1,455 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ declare module "buffer" {
2
+ global {
3
+ interface BufferConstructor {
4
+ // see ../buffer.d.ts for implementation shared with all TypeScript versions
5
+
6
+ /**
7
+ * Allocates a new buffer containing the given {str}.
8
+ *
9
+ * @param str String to store in buffer.
10
+ * @param encoding encoding to use, optional. Default is 'utf8'
11
+ * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
12
+ */
13
+ new(str: string, encoding?: BufferEncoding): Buffer;
14
+ /**
15
+ * Allocates a new buffer of {size} octets.
16
+ *
17
+ * @param size count of octets to allocate.
18
+ * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
19
+ */
20
+ new(size: number): Buffer;
21
+ /**
22
+ * Allocates a new buffer containing the given {array} of octets.
23
+ *
24
+ * @param array The octets to store.
25
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
26
+ */
27
+ new(array: ArrayLike<number>): Buffer;
28
+ /**
29
+ * Produces a Buffer backed by the same allocated memory as
30
+ * the given {ArrayBuffer}/{SharedArrayBuffer}.
31
+ *
32
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
33
+ * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
34
+ */
35
+ new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
36
+ /**
37
+ * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
38
+ * Array entries outside that range will be truncated to fit into it.
39
+ *
40
+ * ```js
41
+ * import { Buffer } from 'node:buffer';
42
+ *
43
+ * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
44
+ * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
45
+ * ```
46
+ * If `array` is an `Array`-like object (that is, one with a `length` property of
47
+ * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
48
+ * a `Uint8Array`. This means all other `TypedArray` variants get treated as an
49
+ * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use
50
+ * `Buffer.copyBytesFrom()`.
51
+ *
52
+ * A `TypeError` will be thrown if `array` is not an `Array` or another type
53
+ * appropriate for `Buffer.from()` variants.
54
+ *
55
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal
56
+ * `Buffer` pool like `Buffer.allocUnsafe()` does.
57
+ * @since v5.10.0
58
+ */
59
+ from(array: WithImplicitCoercion<ArrayLike<number>>): Buffer;
60
+ /**
61
+ * This creates a view of the `ArrayBuffer` without copying the underlying
62
+ * memory. For example, when passed a reference to the `.buffer` property of a
63
+ * `TypedArray` instance, the newly created `Buffer` will share the same
64
+ * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`.
65
+ *
66
+ * ```js
67
+ * import { Buffer } from 'node:buffer';
68
+ *
69
+ * const arr = new Uint16Array(2);
70
+ *
71
+ * arr[0] = 5000;
72
+ * arr[1] = 4000;
73
+ *
74
+ * // Shares memory with `arr`.
75
+ * const buf = Buffer.from(arr.buffer);
76
+ *
77
+ * console.log(buf);
78
+ * // Prints: <Buffer 88 13 a0 0f>
79
+ *
80
+ * // Changing the original Uint16Array changes the Buffer also.
81
+ * arr[1] = 6000;
82
+ *
83
+ * console.log(buf);
84
+ * // Prints: <Buffer 88 13 70 17>
85
+ * ```
86
+ * The optional `byteOffset` and `length` arguments specify a memory range within
87
+ * the `arrayBuffer` that will be shared by the `Buffer`.
88
+ *
89
+ * ```js
90
+ * import { Buffer } from 'node:buffer';
91
+ *
92
+ * const ab = new ArrayBuffer(10);
93
+ * const buf = Buffer.from(ab, 0, 2);
94
+ *
95
+ * console.log(buf.length);
96
+ * // Prints: 2
97
+ * ```
98
+ *
99
+ * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a
100
+ * `SharedArrayBuffer` or another type appropriate for `Buffer.from()`
101
+ * variants.
102
+ *
103
+ * It is important to remember that a backing `ArrayBuffer` can cover a range
104
+ * of memory that extends beyond the bounds of a `TypedArray` view. A new
105
+ * `Buffer` created using the `buffer` property of a `TypedArray` may extend
106
+ * beyond the range of the `TypedArray`:
107
+ *
108
+ * ```js
109
+ * import { Buffer } from 'node:buffer';
110
+ *
111
+ * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements
112
+ * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements
113
+ * console.log(arrA.buffer === arrB.buffer); // true
114
+ *
115
+ * const buf = Buffer.from(arrB.buffer);
116
+ * console.log(buf);
117
+ * // Prints: <Buffer 63 64 65 66>
118
+ * ```
119
+ * @since v5.10.0
120
+ * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the
121
+ * `.buffer` property of a `TypedArray`.
122
+ * @param byteOffset Index of first byte to expose. **Default:** `0`.
123
+ * @param length Number of bytes to expose. **Default:**
124
+ * `arrayBuffer.byteLength - byteOffset`.
125
+ */
126
+ from(
127
+ arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
128
+ byteOffset?: number,
129
+ length?: number,
130
+ ): Buffer;
131
+ /**
132
+ * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
133
+ * the character encoding to be used when converting `string` into bytes.
134
+ *
135
+ * ```js
136
+ * import { Buffer } from 'node:buffer';
137
+ *
138
+ * const buf1 = Buffer.from('this is a tést');
139
+ * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
140
+ *
141
+ * console.log(buf1.toString());
142
+ * // Prints: this is a tést
143
+ * console.log(buf2.toString());
144
+ * // Prints: this is a tést
145
+ * console.log(buf1.toString('latin1'));
146
+ * // Prints: this is a tést
147
+ * ```
148
+ *
149
+ * A `TypeError` will be thrown if `string` is not a string or another type
150
+ * appropriate for `Buffer.from()` variants.
151
+ * @since v5.10.0
152
+ * @param string A string to encode.
153
+ * @param encoding The encoding of `string`. **Default:** `'utf8'`.
154
+ */
155
+ from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer;
156
+ from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): Buffer;
157
+ /**
158
+ * Creates a new Buffer using the passed {data}
159
+ * @param values to create a new Buffer
160
+ */
161
+ of(...items: number[]): Buffer;
162
+ /**
163
+ * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together.
164
+ *
165
+ * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned.
166
+ *
167
+ * If `totalLength` is not provided, it is calculated from the `Buffer` instances
168
+ * in `list` by adding their lengths.
169
+ *
170
+ * If `totalLength` is provided, it is coerced to an unsigned integer. If the
171
+ * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
172
+ * truncated to `totalLength`.
173
+ *
174
+ * ```js
175
+ * import { Buffer } from 'node:buffer';
176
+ *
177
+ * // Create a single `Buffer` from a list of three `Buffer` instances.
178
+ *
179
+ * const buf1 = Buffer.alloc(10);
180
+ * const buf2 = Buffer.alloc(14);
181
+ * const buf3 = Buffer.alloc(18);
182
+ * const totalLength = buf1.length + buf2.length + buf3.length;
183
+ *
184
+ * console.log(totalLength);
185
+ * // Prints: 42
186
+ *
187
+ * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
188
+ *
189
+ * console.log(bufA);
190
+ * // Prints: <Buffer 00 00 00 00 ...>
191
+ * console.log(bufA.length);
192
+ * // Prints: 42
193
+ * ```
194
+ *
195
+ * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
196
+ * @since v0.7.11
197
+ * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
198
+ * @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
199
+ */
200
+ concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
201
+ /**
202
+ * Copies the underlying memory of `view` into a new `Buffer`.
203
+ *
204
+ * ```js
205
+ * const u16 = new Uint16Array([0, 0xffff]);
206
+ * const buf = Buffer.copyBytesFrom(u16, 1, 1);
207
+ * u16[1] = 0;
208
+ * console.log(buf.length); // 2
209
+ * console.log(buf[0]); // 255
210
+ * console.log(buf[1]); // 255
211
+ * ```
212
+ * @since v18.16.0
213
+ * @param view The {TypedArray} to copy.
214
+ * @param [offset=0] The starting offset within `view`.
215
+ * @param [length=view.length - offset] The number of elements from `view` to copy.
216
+ */
217
+ copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
218
+ /**
219
+ * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
220
+ *
221
+ * ```js
222
+ * import { Buffer } from 'node:buffer';
223
+ *
224
+ * const buf = Buffer.alloc(5);
225
+ *
226
+ * console.log(buf);
227
+ * // Prints: <Buffer 00 00 00 00 00>
228
+ * ```
229
+ *
230
+ * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
231
+ *
232
+ * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
233
+ *
234
+ * ```js
235
+ * import { Buffer } from 'node:buffer';
236
+ *
237
+ * const buf = Buffer.alloc(5, 'a');
238
+ *
239
+ * console.log(buf);
240
+ * // Prints: <Buffer 61 61 61 61 61>
241
+ * ```
242
+ *
243
+ * If both `fill` and `encoding` are specified, the allocated `Buffer` will be
244
+ * initialized by calling `buf.fill(fill, encoding)`.
245
+ *
246
+ * ```js
247
+ * import { Buffer } from 'node:buffer';
248
+ *
249
+ * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
250
+ *
251
+ * console.log(buf);
252
+ * // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
253
+ * ```
254
+ *
255
+ * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
256
+ * contents will never contain sensitive data from previous allocations, including
257
+ * data that might not have been allocated for `Buffer`s.
258
+ *
259
+ * A `TypeError` will be thrown if `size` is not a number.
260
+ * @since v5.10.0
261
+ * @param size The desired length of the new `Buffer`.
262
+ * @param [fill=0] A value to pre-fill the new `Buffer` with.
263
+ * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
264
+ */
265
+ alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
266
+ /**
267
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
268
+ *
269
+ * The underlying memory for `Buffer` instances created in this way is _not_
270
+ * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
271
+ *
272
+ * ```js
273
+ * import { Buffer } from 'node:buffer';
274
+ *
275
+ * const buf = Buffer.allocUnsafe(10);
276
+ *
277
+ * console.log(buf);
278
+ * // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
279
+ *
280
+ * buf.fill(0);
281
+ *
282
+ * console.log(buf);
283
+ * // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
284
+ * ```
285
+ *
286
+ * A `TypeError` will be thrown if `size` is not a number.
287
+ *
288
+ * The `Buffer` module pre-allocates an internal `Buffer` instance of
289
+ * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
290
+ * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
291
+ *
292
+ * Use of this pre-allocated internal memory pool is a key difference between
293
+ * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
294
+ * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
295
+ * than or equal to half `Buffer.poolSize`. The
296
+ * difference is subtle but can be important when an application requires the
297
+ * additional performance that `Buffer.allocUnsafe()` provides.
298
+ * @since v5.10.0
299
+ * @param size The desired length of the new `Buffer`.
300
+ */
301
+ allocUnsafe(size: number): Buffer;
302
+ /**
303
+ * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
304
+ * `size` is 0.
305
+ *
306
+ * The underlying memory for `Buffer` instances created in this way is _not_
307
+ * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
308
+ * such `Buffer` instances with zeroes.
309
+ *
310
+ * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
311
+ * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
312
+ * allows applications to avoid the garbage collection overhead of creating many
313
+ * individually allocated `Buffer` instances. This approach improves both
314
+ * performance and memory usage by eliminating the need to track and clean up as
315
+ * many individual `ArrayBuffer` objects.
316
+ *
317
+ * However, in the case where a developer may need to retain a small chunk of
318
+ * memory from a pool for an indeterminate amount of time, it may be appropriate
319
+ * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
320
+ * then copying out the relevant bits.
321
+ *
322
+ * ```js
323
+ * import { Buffer } from 'node:buffer';
324
+ *
325
+ * // Need to keep around a few small chunks of memory.
326
+ * const store = [];
327
+ *
328
+ * socket.on('readable', () => {
329
+ * let data;
330
+ * while (null !== (data = readable.read())) {
331
+ * // Allocate for retained data.
332
+ * const sb = Buffer.allocUnsafeSlow(10);
333
+ *
334
+ * // Copy the data into the new allocation.
335
+ * data.copy(sb, 0, 0, 10);
336
+ *
337
+ * store.push(sb);
338
+ * }
339
+ * });
340
+ * ```
341
+ *
342
+ * A `TypeError` will be thrown if `size` is not a number.
343
+ * @since v5.12.0
344
+ * @param size The desired length of the new `Buffer`.
345
+ */
346
+ allocUnsafeSlow(size: number): Buffer;
347
+ }
348
+ interface Buffer extends Uint8Array {
349
+ // see ../buffer.d.ts for implementation shared with all TypeScript versions
350
+
351
+ /**
352
+ * Returns a new `Buffer` that references the same memory as the original, but
353
+ * offset and cropped by the `start` and `end` indices.
354
+ *
355
+ * This method is not compatible with the `Uint8Array.prototype.slice()`,
356
+ * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
357
+ *
358
+ * ```js
359
+ * import { Buffer } from 'node:buffer';
360
+ *
361
+ * const buf = Buffer.from('buffer');
362
+ *
363
+ * const copiedBuf = Uint8Array.prototype.slice.call(buf);
364
+ * copiedBuf[0]++;
365
+ * console.log(copiedBuf.toString());
366
+ * // Prints: cuffer
367
+ *
368
+ * console.log(buf.toString());
369
+ * // Prints: buffer
370
+ *
371
+ * // With buf.slice(), the original buffer is modified.
372
+ * const notReallyCopiedBuf = buf.slice();
373
+ * notReallyCopiedBuf[0]++;
374
+ * console.log(notReallyCopiedBuf.toString());
375
+ * // Prints: cuffer
376
+ * console.log(buf.toString());
377
+ * // Also prints: cuffer (!)
378
+ * ```
379
+ * @since v0.3.0
380
+ * @deprecated Use `subarray` instead.
381
+ * @param [start=0] Where the new `Buffer` will start.
382
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
383
+ */
384
+ slice(start?: number, end?: number): Buffer;
385
+ /**
386
+ * Returns a new `Buffer` that references the same memory as the original, but
387
+ * offset and cropped by the `start` and `end` indices.
388
+ *
389
+ * Specifying `end` greater than `buf.length` will return the same result as
390
+ * that of `end` equal to `buf.length`.
391
+ *
392
+ * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
393
+ *
394
+ * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
395
+ *
396
+ * ```js
397
+ * import { Buffer } from 'node:buffer';
398
+ *
399
+ * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
400
+ * // from the original `Buffer`.
401
+ *
402
+ * const buf1 = Buffer.allocUnsafe(26);
403
+ *
404
+ * for (let i = 0; i < 26; i++) {
405
+ * // 97 is the decimal ASCII value for 'a'.
406
+ * buf1[i] = i + 97;
407
+ * }
408
+ *
409
+ * const buf2 = buf1.subarray(0, 3);
410
+ *
411
+ * console.log(buf2.toString('ascii', 0, buf2.length));
412
+ * // Prints: abc
413
+ *
414
+ * buf1[0] = 33;
415
+ *
416
+ * console.log(buf2.toString('ascii', 0, buf2.length));
417
+ * // Prints: !bc
418
+ * ```
419
+ *
420
+ * Specifying negative indexes causes the slice to be generated relative to the
421
+ * end of `buf` rather than the beginning.
422
+ *
423
+ * ```js
424
+ * import { Buffer } from 'node:buffer';
425
+ *
426
+ * const buf = Buffer.from('buffer');
427
+ *
428
+ * console.log(buf.subarray(-6, -1).toString());
429
+ * // Prints: buffe
430
+ * // (Equivalent to buf.subarray(0, 5).)
431
+ *
432
+ * console.log(buf.subarray(-6, -2).toString());
433
+ * // Prints: buff
434
+ * // (Equivalent to buf.subarray(0, 4).)
435
+ *
436
+ * console.log(buf.subarray(-5, -2).toString());
437
+ * // Prints: uff
438
+ * // (Equivalent to buf.subarray(1, 4).)
439
+ * ```
440
+ * @since v3.0.0
441
+ * @param [start=0] Where the new `Buffer` will start.
442
+ * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
443
+ */
444
+ subarray(start?: number, end?: number): Buffer;
445
+ }
446
+ type NonSharedBuffer = Buffer;
447
+ type AllowSharedBuffer = Buffer;
448
+ }
449
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
450
+ var SlowBuffer: {
451
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
452
+ new(size: number): Buffer;
453
+ prototype: Buffer;
454
+ };
455
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/ts5.6/globals.typedarray.d.ts ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export {}; // Make this a module
2
+
3
+ declare global {
4
+ namespace NodeJS {
5
+ type TypedArray =
6
+ | Uint8Array
7
+ | Uint8ClampedArray
8
+ | Uint16Array
9
+ | Uint32Array
10
+ | Int8Array
11
+ | Int16Array
12
+ | Int32Array
13
+ | BigUint64Array
14
+ | BigInt64Array
15
+ | Float32Array
16
+ | Float64Array;
17
+ type ArrayBufferView = TypedArray | DataView;
18
+ }
19
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/ts5.6/index.d.ts ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * License for programmatically and manually incorporated
3
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
4
+ *
5
+ * Copyright Node.js contributors. All rights reserved.
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to
8
+ * deal in the Software without restriction, including without limitation the
9
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
+ * sell copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ * IN THE SOFTWARE.
23
+ */
24
+
25
+ // NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
26
+
27
+ // Reference required TypeScript libs:
28
+ /// <reference lib="es2020" />
29
+
30
+ // TypeScript backwards-compatibility definitions:
31
+ /// <reference path="../compatibility/index.d.ts" />
32
+
33
+ // Definitions specific to TypeScript 4.9 through 5.6:
34
+ /// <reference path="./globals.typedarray.d.ts" />
35
+ /// <reference path="./buffer.buffer.d.ts" />
36
+
37
+ // Definitions for Node.js modules that are not specific to any version of TypeScript:
38
+ /// <reference path="../globals.d.ts" />
39
+ /// <reference path="../assert.d.ts" />
40
+ /// <reference path="../assert/strict.d.ts" />
41
+ /// <reference path="../async_hooks.d.ts" />
42
+ /// <reference path="../buffer.d.ts" />
43
+ /// <reference path="../child_process.d.ts" />
44
+ /// <reference path="../cluster.d.ts" />
45
+ /// <reference path="../console.d.ts" />
46
+ /// <reference path="../constants.d.ts" />
47
+ /// <reference path="../crypto.d.ts" />
48
+ /// <reference path="../dgram.d.ts" />
49
+ /// <reference path="../diagnostics_channel.d.ts" />
50
+ /// <reference path="../dns.d.ts" />
51
+ /// <reference path="../dns/promises.d.ts" />
52
+ /// <reference path="../dns/promises.d.ts" />
53
+ /// <reference path="../domain.d.ts" />
54
+ /// <reference path="../dom-events.d.ts" />
55
+ /// <reference path="../events.d.ts" />
56
+ /// <reference path="../fs.d.ts" />
57
+ /// <reference path="../fs/promises.d.ts" />
58
+ /// <reference path="../http.d.ts" />
59
+ /// <reference path="../http2.d.ts" />
60
+ /// <reference path="../https.d.ts" />
61
+ /// <reference path="../inspector.d.ts" />
62
+ /// <reference path="../module.d.ts" />
63
+ /// <reference path="../net.d.ts" />
64
+ /// <reference path="../os.d.ts" />
65
+ /// <reference path="../path.d.ts" />
66
+ /// <reference path="../perf_hooks.d.ts" />
67
+ /// <reference path="../process.d.ts" />
68
+ /// <reference path="../punycode.d.ts" />
69
+ /// <reference path="../querystring.d.ts" />
70
+ /// <reference path="../readline.d.ts" />
71
+ /// <reference path="../readline/promises.d.ts" />
72
+ /// <reference path="../repl.d.ts" />
73
+ /// <reference path="../stream.d.ts" />
74
+ /// <reference path="../stream/promises.d.ts" />
75
+ /// <reference path="../stream/consumers.d.ts" />
76
+ /// <reference path="../stream/web.d.ts" />
77
+ /// <reference path="../string_decoder.d.ts" />
78
+ /// <reference path="../test.d.ts" />
79
+ /// <reference path="../timers.d.ts" />
80
+ /// <reference path="../timers/promises.d.ts" />
81
+ /// <reference path="../tls.d.ts" />
82
+ /// <reference path="../trace_events.d.ts" />
83
+ /// <reference path="../tty.d.ts" />
84
+ /// <reference path="../url.d.ts" />
85
+ /// <reference path="../util.d.ts" />
86
+ /// <reference path="../v8.d.ts" />
87
+ /// <reference path="../vm.d.ts" />
88
+ /// <reference path="../wasi.d.ts" />
89
+ /// <reference path="../worker_threads.d.ts" />
90
+ /// <reference path="../zlib.d.ts" />
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/tty.d.ts ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes.
3
+ * In most cases, it will not be necessary or possible to use this module directly.
4
+ * However, it can be accessed using:
5
+ *
6
+ * ```js
7
+ * import tty from 'node:tty';
8
+ * ```
9
+ *
10
+ * When Node.js detects that it is being run with a text terminal ("TTY")
11
+ * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
12
+ * default, be instances of `tty.WriteStream`. The preferred method of determining
13
+ * whether Node.js is being run within a TTY context is to check that the value of
14
+ * the `process.stdout.isTTY` property is `true`:
15
+ *
16
+ * ```console
17
+ * $ node -p -e "Boolean(process.stdout.isTTY)"
18
+ * true
19
+ * $ node -p -e "Boolean(process.stdout.isTTY)" | cat
20
+ * false
21
+ * ```
22
+ *
23
+ * In most cases, there should be little to no reason for an application to
24
+ * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
25
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tty.js)
26
+ */
27
+ declare module "tty" {
28
+ import * as net from "node:net";
29
+ /**
30
+ * The `tty.isatty()` method returns `true` if the given `fd` is associated with
31
+ * a TTY and `false` if it is not, including whenever `fd` is not a non-negative
32
+ * integer.
33
+ * @since v0.5.8
34
+ * @param fd A numeric file descriptor
35
+ */
36
+ function isatty(fd: number): boolean;
37
+ /**
38
+ * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
39
+ * process and there should be no reason to create additional instances.
40
+ * @since v0.5.8
41
+ */
42
+ class ReadStream extends net.Socket {
43
+ constructor(fd: number, options?: net.SocketConstructorOpts);
44
+ /**
45
+ * A `boolean` that is `true` if the TTY is currently configured to operate as a
46
+ * raw device. Defaults to `false`.
47
+ * @since v0.7.7
48
+ */
49
+ isRaw: boolean;
50
+ /**
51
+ * Allows configuration of `tty.ReadStream` so that it operates as a raw device.
52
+ *
53
+ * When in raw mode, input is always available character-by-character, not
54
+ * including modifiers. Additionally, all special processing of characters by the
55
+ * terminal is disabled, including echoing input
56
+ * characters. Ctrl+C will no longer cause a `SIGINT` when
57
+ * in this mode.
58
+ * @since v0.7.7
59
+ * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw`
60
+ * property will be set to the resulting mode.
61
+ * @return The read stream instance.
62
+ */
63
+ setRawMode(mode: boolean): this;
64
+ /**
65
+ * A `boolean` that is always `true` for `tty.ReadStream` instances.
66
+ * @since v0.5.8
67
+ */
68
+ isTTY: boolean;
69
+ }
70
+ /**
71
+ * -1 - to the left from cursor
72
+ * 0 - the entire line
73
+ * 1 - to the right from cursor
74
+ */
75
+ type Direction = -1 | 0 | 1;
76
+ /**
77
+ * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
78
+ * should be no reason to create additional instances.
79
+ * @since v0.5.8
80
+ */
81
+ class WriteStream extends net.Socket {
82
+ constructor(fd: number);
83
+ addListener(event: string, listener: (...args: any[]) => void): this;
84
+ addListener(event: "resize", listener: () => void): this;
85
+ emit(event: string | symbol, ...args: any[]): boolean;
86
+ emit(event: "resize"): boolean;
87
+ on(event: string, listener: (...args: any[]) => void): this;
88
+ on(event: "resize", listener: () => void): this;
89
+ once(event: string, listener: (...args: any[]) => void): this;
90
+ once(event: "resize", listener: () => void): this;
91
+ prependListener(event: string, listener: (...args: any[]) => void): this;
92
+ prependListener(event: "resize", listener: () => void): this;
93
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
94
+ prependOnceListener(event: "resize", listener: () => void): this;
95
+ /**
96
+ * `writeStream.clearLine()` clears the current line of this `WriteStream` in a
97
+ * direction identified by `dir`.
98
+ * @since v0.7.7
99
+ * @param callback Invoked once the operation completes.
100
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
101
+ */
102
+ clearLine(dir: Direction, callback?: () => void): boolean;
103
+ /**
104
+ * `writeStream.clearScreenDown()` clears this `WriteStream` from the current
105
+ * cursor down.
106
+ * @since v0.7.7
107
+ * @param callback Invoked once the operation completes.
108
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
109
+ */
110
+ clearScreenDown(callback?: () => void): boolean;
111
+ /**
112
+ * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
113
+ * position.
114
+ * @since v0.7.7
115
+ * @param callback Invoked once the operation completes.
116
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
117
+ */
118
+ cursorTo(x: number, y?: number, callback?: () => void): boolean;
119
+ cursorTo(x: number, callback: () => void): boolean;
120
+ /**
121
+ * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its
122
+ * current position.
123
+ * @since v0.7.7
124
+ * @param callback Invoked once the operation completes.
125
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
126
+ */
127
+ moveCursor(dx: number, dy: number, callback?: () => void): boolean;
128
+ /**
129
+ * Returns:
130
+ *
131
+ * * `1` for 2,
132
+ * * `4` for 16,
133
+ * * `8` for 256,
134
+ * * `24` for 16,777,216 colors supported.
135
+ *
136
+ * Use this to determine what colors the terminal supports. Due to the nature of
137
+ * colors in terminals it is possible to either have false positives or false
138
+ * negatives. It depends on process information and the environment variables that
139
+ * may lie about what terminal is used.
140
+ * It is possible to pass in an `env` object to simulate the usage of a specific
141
+ * terminal. This can be useful to check how specific environment settings behave.
142
+ *
143
+ * To enforce a specific color support, use one of the below environment settings.
144
+ *
145
+ * * 2 colors: `FORCE_COLOR = 0` (Disables colors)
146
+ * * 16 colors: `FORCE_COLOR = 1`
147
+ * * 256 colors: `FORCE_COLOR = 2`
148
+ * * 16,777,216 colors: `FORCE_COLOR = 3`
149
+ *
150
+ * Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables.
151
+ * @since v9.9.0
152
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
153
+ */
154
+ getColorDepth(env?: object): number;
155
+ /**
156
+ * Returns `true` if the `writeStream` supports at least as many colors as provided
157
+ * in `count`. Minimum support is 2 (black and white).
158
+ *
159
+ * This has the same false positives and negatives as described in `writeStream.getColorDepth()`.
160
+ *
161
+ * ```js
162
+ * process.stdout.hasColors();
163
+ * // Returns true or false depending on if `stdout` supports at least 16 colors.
164
+ * process.stdout.hasColors(256);
165
+ * // Returns true or false depending on if `stdout` supports at least 256 colors.
166
+ * process.stdout.hasColors({ TMUX: '1' });
167
+ * // Returns true.
168
+ * process.stdout.hasColors(2 ** 24, { TMUX: '1' });
169
+ * // Returns false (the environment setting pretends to support 2 ** 8 colors).
170
+ * ```
171
+ * @since v11.13.0, v10.16.0
172
+ * @param [count=16] The number of colors that are requested (minimum 2).
173
+ * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
174
+ */
175
+ hasColors(count?: number): boolean;
176
+ hasColors(env?: object): boolean;
177
+ hasColors(count: number, env?: object): boolean;
178
+ /**
179
+ * `writeStream.getWindowSize()` returns the size of the TTY
180
+ * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number
181
+ * of columns and rows in the corresponding TTY.
182
+ * @since v0.7.7
183
+ */
184
+ getWindowSize(): [number, number];
185
+ /**
186
+ * A `number` specifying the number of columns the TTY currently has. This property
187
+ * is updated whenever the `'resize'` event is emitted.
188
+ * @since v0.7.7
189
+ */
190
+ columns: number;
191
+ /**
192
+ * A `number` specifying the number of rows the TTY currently has. This property
193
+ * is updated whenever the `'resize'` event is emitted.
194
+ * @since v0.7.7
195
+ */
196
+ rows: number;
197
+ /**
198
+ * A `boolean` that is always `true`.
199
+ * @since v0.5.8
200
+ */
201
+ isTTY: boolean;
202
+ }
203
+ }
204
+ declare module "node:tty" {
205
+ export * from "tty";
206
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/url.d.ts ADDED
@@ -0,0 +1,957 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `url` module provides utilities for URL resolution and parsing. It can be
3
+ * accessed using:
4
+ *
5
+ * ```js
6
+ * import url from 'url';
7
+ * ```
8
+ * @see [source](https://github.com/nodejs/node/blob/v18.19.0/lib/url.js)
9
+ */
10
+ declare module "url" {
11
+ import { Blob as NodeBlob } from "node:buffer";
12
+ import { ClientRequestArgs } from "node:http";
13
+ import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
14
+ // Input to `url.format`
15
+ interface UrlObject {
16
+ auth?: string | null | undefined;
17
+ hash?: string | null | undefined;
18
+ host?: string | null | undefined;
19
+ hostname?: string | null | undefined;
20
+ href?: string | null | undefined;
21
+ pathname?: string | null | undefined;
22
+ protocol?: string | null | undefined;
23
+ search?: string | null | undefined;
24
+ slashes?: boolean | null | undefined;
25
+ port?: string | number | null | undefined;
26
+ query?: string | null | ParsedUrlQueryInput | undefined;
27
+ }
28
+ // Output of `url.parse`
29
+ interface Url {
30
+ auth: string | null;
31
+ hash: string | null;
32
+ host: string | null;
33
+ hostname: string | null;
34
+ href: string;
35
+ path: string | null;
36
+ pathname: string | null;
37
+ protocol: string | null;
38
+ search: string | null;
39
+ slashes: boolean | null;
40
+ port: string | null;
41
+ query: string | null | ParsedUrlQuery;
42
+ }
43
+ interface UrlWithParsedQuery extends Url {
44
+ query: ParsedUrlQuery;
45
+ }
46
+ interface UrlWithStringQuery extends Url {
47
+ query: string | null;
48
+ }
49
+ /**
50
+ * The `url.parse()` method takes a URL string, parses it, and returns a URL
51
+ * object.
52
+ *
53
+ * A `TypeError` is thrown if `urlString` is not a string.
54
+ *
55
+ * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
56
+ *
57
+ * Use of the legacy `url.parse()` method is discouraged. Users should
58
+ * use the WHATWG `URL` API. Because the `url.parse()` method uses a
59
+ * lenient, non-standard algorithm for parsing URL strings, security
60
+ * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and
61
+ * incorrect handling of usernames and passwords have been identified.
62
+ *
63
+ * Deprecation of this API has been shelved for now primarily due to the the
64
+ * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373).
65
+ * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this.
66
+ *
67
+ * @since v0.1.25
68
+ * @param urlString The URL string to parse.
69
+ * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
70
+ * on the returned URL object will be an unparsed, undecoded string.
71
+ * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
72
+ * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
73
+ */
74
+ function parse(urlString: string): UrlWithStringQuery;
75
+ function parse(
76
+ urlString: string,
77
+ parseQueryString: false | undefined,
78
+ slashesDenoteHost?: boolean,
79
+ ): UrlWithStringQuery;
80
+ function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
81
+ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
82
+ /**
83
+ * The `url.format()` method returns a formatted URL string derived from `urlObject`.
84
+ *
85
+ * ```js
86
+ * import url from 'node:url';
87
+ * url.format({
88
+ * protocol: 'https',
89
+ * hostname: 'example.com',
90
+ * pathname: '/some/path',
91
+ * query: {
92
+ * page: 1,
93
+ * format: 'json',
94
+ * },
95
+ * });
96
+ *
97
+ * // => 'https://example.com/some/path?page=1&#x26;format=json'
98
+ * ```
99
+ *
100
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
101
+ *
102
+ * The formatting process operates as follows:
103
+ *
104
+ * * A new empty string `result` is created.
105
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
106
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
107
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
108
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
109
+ * * If either of the following conditions is true, then the literal string `//` will be appended to `result`:
110
+ * * `urlObject.slashes` property is true;
111
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`;
112
+ * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string
113
+ * and appended to `result` followed by the literal string `@`.
114
+ * * If the `urlObject.host` property is `undefined` then:
115
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
116
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
117
+ * an `Error` is thrown.
118
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`:
119
+ * * The literal string `:` is appended to `result`, and
120
+ * * The value of `urlObject.port` is coerced to a string and appended to `result`.
121
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`.
122
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
123
+ * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash
124
+ * (`/`), then the literal string `'/'` is appended to `result`.
125
+ * * The value of `urlObject.pathname` is appended to `result`.
126
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
127
+ * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the
128
+ * `querystring` module's `stringify()` method passing the value of `urlObject.query`.
129
+ * * Otherwise, if `urlObject.search` is a string:
130
+ * * If the value of `urlObject.search` _does not start_ with the ASCII question
131
+ * mark (`?`) character, the literal string `?` is appended to `result`.
132
+ * * The value of `urlObject.search` is appended to `result`.
133
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
134
+ * * If the `urlObject.hash` property is a string:
135
+ * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`)
136
+ * character, the literal string `#` is appended to `result`.
137
+ * * The value of `urlObject.hash` is appended to `result`.
138
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
139
+ * string, an `Error` is thrown.
140
+ * * `result` is returned.
141
+ * @since v0.1.25
142
+ * @legacy Use the WHATWG URL API instead.
143
+ * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
144
+ */
145
+ function format(urlObject: URL, options?: URLFormatOptions): string;
146
+ /**
147
+ * The `url.format()` method returns a formatted URL string derived from `urlObject`.
148
+ *
149
+ * ```js
150
+ * import url from 'node:url';
151
+ * url.format({
152
+ * protocol: 'https',
153
+ * hostname: 'example.com',
154
+ * pathname: '/some/path',
155
+ * query: {
156
+ * page: 1,
157
+ * format: 'json',
158
+ * },
159
+ * });
160
+ *
161
+ * // => 'https://example.com/some/path?page=1&#x26;format=json'
162
+ * ```
163
+ *
164
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
165
+ *
166
+ * The formatting process operates as follows:
167
+ *
168
+ * * A new empty string `result` is created.
169
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
170
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
171
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
172
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
173
+ * * If either of the following conditions is true, then the literal string `//` will be appended to `result`:
174
+ * * `urlObject.slashes` property is true;
175
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`;
176
+ * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string
177
+ * and appended to `result` followed by the literal string `@`.
178
+ * * If the `urlObject.host` property is `undefined` then:
179
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
180
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
181
+ * an `Error` is thrown.
182
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`:
183
+ * * The literal string `:` is appended to `result`, and
184
+ * * The value of `urlObject.port` is coerced to a string and appended to `result`.
185
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`.
186
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
187
+ * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash
188
+ * (`/`), then the literal string `'/'` is appended to `result`.
189
+ * * The value of `urlObject.pathname` is appended to `result`.
190
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
191
+ * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the
192
+ * `querystring` module's `stringify()` method passing the value of `urlObject.query`.
193
+ * * Otherwise, if `urlObject.search` is a string:
194
+ * * If the value of `urlObject.search` _does not start_ with the ASCII question
195
+ * mark (`?`) character, the literal string `?` is appended to `result`.
196
+ * * The value of `urlObject.search` is appended to `result`.
197
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
198
+ * * If the `urlObject.hash` property is a string:
199
+ * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`)
200
+ * character, the literal string `#` is appended to `result`.
201
+ * * The value of `urlObject.hash` is appended to `result`.
202
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
203
+ * string, an `Error` is thrown.
204
+ * * `result` is returned.
205
+ * @since v0.1.25
206
+ * @legacy Use the WHATWG URL API instead.
207
+ * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
208
+ */
209
+ function format(urlObject: UrlObject | string): string;
210
+ /**
211
+ * The `url.resolve()` method resolves a target URL relative to a base URL in a
212
+ * manner similar to that of a web browser resolving an anchor tag.
213
+ *
214
+ * ```js
215
+ * import url from 'node:url';
216
+ * url.resolve('/one/two/three', 'four'); // '/one/two/four'
217
+ * url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
218
+ * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
219
+ * ```
220
+ *
221
+ * To achieve the same result using the WHATWG URL API:
222
+ *
223
+ * ```js
224
+ * function resolve(from, to) {
225
+ * const resolvedUrl = new URL(to, new URL(from, 'resolve://'));
226
+ * if (resolvedUrl.protocol === 'resolve:') {
227
+ * // `from` is a relative URL.
228
+ * const { pathname, search, hash } = resolvedUrl;
229
+ * return pathname + search + hash;
230
+ * }
231
+ * return resolvedUrl.toString();
232
+ * }
233
+ *
234
+ * resolve('/one/two/three', 'four'); // '/one/two/four'
235
+ * resolve('http://example.com/', '/one'); // 'http://example.com/one'
236
+ * resolve('http://example.com/one', '/two'); // 'http://example.com/two'
237
+ * ```
238
+ * @since v0.1.25
239
+ * @legacy Use the WHATWG URL API instead.
240
+ * @param from The base URL to use if `to` is a relative URL.
241
+ * @param to The target URL to resolve.
242
+ */
243
+ function resolve(from: string, to: string): string;
244
+ /**
245
+ * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an
246
+ * invalid domain, the empty string is returned.
247
+ *
248
+ * It performs the inverse operation to {@link domainToUnicode}.
249
+ *
250
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
251
+ *
252
+ * ```js
253
+ * import url from 'url';
254
+ *
255
+ * console.log(url.domainToASCII('español.com'));
256
+ * // Prints xn--espaol-zwa.com
257
+ * console.log(url.domainToASCII('中文.com'));
258
+ * // Prints xn--fiq228c.com
259
+ * console.log(url.domainToASCII('xn--iñvalid.com'));
260
+ * // Prints an empty string
261
+ * ```
262
+ * @since v7.4.0, v6.13.0
263
+ */
264
+ function domainToASCII(domain: string): string;
265
+ /**
266
+ * Returns the Unicode serialization of the `domain`. If `domain` is an invalid
267
+ * domain, the empty string is returned.
268
+ *
269
+ * It performs the inverse operation to {@link domainToASCII}.
270
+ *
271
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
272
+ *
273
+ * ```js
274
+ * import url from 'url';
275
+ *
276
+ * console.log(url.domainToUnicode('xn--espaol-zwa.com'));
277
+ * // Prints español.com
278
+ * console.log(url.domainToUnicode('xn--fiq228c.com'));
279
+ * // Prints 中文.com
280
+ * console.log(url.domainToUnicode('xn--iñvalid.com'));
281
+ * // Prints an empty string
282
+ * ```
283
+ * @since v7.4.0, v6.13.0
284
+ */
285
+ function domainToUnicode(domain: string): string;
286
+ /**
287
+ * This function ensures the correct decodings of percent-encoded characters as
288
+ * well as ensuring a cross-platform valid absolute path string.
289
+ *
290
+ * ```js
291
+ * import { fileURLToPath } from 'url';
292
+ *
293
+ * const __filename = fileURLToPath(import.meta.url);
294
+ *
295
+ * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/
296
+ * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows)
297
+ *
298
+ * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt
299
+ * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows)
300
+ *
301
+ * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt
302
+ * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX)
303
+ *
304
+ * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
305
+ * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
306
+ * ```
307
+ * @since v10.12.0
308
+ * @param url The file URL string or URL object to convert to a path.
309
+ * @return The fully-resolved platform-specific Node.js file path.
310
+ */
311
+ function fileURLToPath(url: string | URL): string;
312
+ /**
313
+ * This function ensures that `path` is resolved absolutely, and that the URL
314
+ * control characters are correctly encoded when converting into a File URL.
315
+ *
316
+ * ```js
317
+ * import { pathToFileURL } from 'url';
318
+ *
319
+ * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
320
+ * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
321
+ *
322
+ * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
323
+ * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
324
+ * ```
325
+ * @since v10.12.0
326
+ * @param path The path to convert to a File URL.
327
+ * @return The file URL object.
328
+ */
329
+ function pathToFileURL(path: string): URL;
330
+ /**
331
+ * This utility function converts a URL object into an ordinary options object as
332
+ * expected by the `http.request()` and `https.request()` APIs.
333
+ *
334
+ * ```js
335
+ * import { urlToHttpOptions } from 'url';
336
+ * const myURL = new URL('https://a:b@測試?abc#foo');
337
+ *
338
+ * console.log(urlToHttpOptions(myURL));
339
+ * /*
340
+ * {
341
+ * protocol: 'https:',
342
+ * hostname: 'xn--g6w251d',
343
+ * hash: '#foo',
344
+ * search: '?abc',
345
+ * pathname: '/',
346
+ * path: '/?abc',
347
+ * href: 'https://a:b@xn--g6w251d/?abc#foo',
348
+ * auth: 'a:b'
349
+ * }
350
+ *
351
+ * ```
352
+ * @since v15.7.0, v14.18.0
353
+ * @param url The `WHATWG URL` object to convert to an options object.
354
+ * @return Options object
355
+ */
356
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
357
+ interface URLFormatOptions {
358
+ /**
359
+ * `true` if the serialized URL string should include the username and password, `false` otherwise.
360
+ * @default true
361
+ */
362
+ auth?: boolean | undefined;
363
+ /**
364
+ * `true` if the serialized URL string should include the fragment, `false` otherwise.
365
+ * @default true
366
+ */
367
+ fragment?: boolean | undefined;
368
+ /**
369
+ * `true` if the serialized URL string should include the search query, `false` otherwise.
370
+ * @default true
371
+ */
372
+ search?: boolean | undefined;
373
+ /**
374
+ * `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to
375
+ * being Punycode encoded.
376
+ * @default false
377
+ */
378
+ unicode?: boolean | undefined;
379
+ }
380
+ /**
381
+ * Browser-compatible `URL` class, implemented by following the WHATWG URL
382
+ * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself.
383
+ * The `URL` class is also available on the global object.
384
+ *
385
+ * In accordance with browser conventions, all properties of `URL` objects
386
+ * are implemented as getters and setters on the class prototype, rather than as
387
+ * data properties on the object itself. Thus, unlike `legacy urlObject`s,
388
+ * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still
389
+ * return `true`.
390
+ * @since v7.0.0, v6.13.0
391
+ */
392
+ class URL {
393
+ /**
394
+ * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
395
+ *
396
+ * ```js
397
+ * import {
398
+ * Blob,
399
+ * resolveObjectURL,
400
+ * } from 'node:buffer';
401
+ *
402
+ * const blob = new Blob(['hello']);
403
+ * const id = URL.createObjectURL(blob);
404
+ *
405
+ * // later...
406
+ *
407
+ * const otherBlob = resolveObjectURL(id);
408
+ * console.log(otherBlob.size);
409
+ * ```
410
+ *
411
+ * The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it.
412
+ *
413
+ * `Blob` objects are registered within the current thread. If using Worker
414
+ * Threads, `Blob` objects registered within one Worker will not be available
415
+ * to other workers or the main thread.
416
+ * @since v16.7.0
417
+ * @experimental
418
+ */
419
+ static createObjectURL(blob: NodeBlob): string;
420
+ /**
421
+ * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
422
+ * ID that isn’t registered will silently fail.
423
+ * @since v16.7.0
424
+ * @experimental
425
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
426
+ */
427
+ static revokeObjectURL(id: string): void;
428
+ /**
429
+ * Checks if an `input` relative to the `base` can be parsed to a `URL`.
430
+ *
431
+ * ```js
432
+ * const isValid = URL.canParse('/foo', 'https://example.org/'); // true
433
+ *
434
+ * const isNotValid = URL.canParse('/foo'); // false
435
+ * ```
436
+ * @since v18.17.0
437
+ * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
438
+ * `converted to a string` first.
439
+ * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
440
+ */
441
+ static canParse(input: string, base?: string): boolean;
442
+ constructor(input: string | { toString: () => string }, base?: string | URL);
443
+ /**
444
+ * Gets and sets the fragment portion of the URL.
445
+ *
446
+ * ```js
447
+ * const myURL = new URL('https://example.org/foo#bar');
448
+ * console.log(myURL.hash);
449
+ * // Prints #bar
450
+ *
451
+ * myURL.hash = 'baz';
452
+ * console.log(myURL.href);
453
+ * // Prints https://example.org/foo#baz
454
+ * ```
455
+ *
456
+ * Invalid URL characters included in the value assigned to the `hash` property
457
+ * are `percent-encoded`. The selection of which characters to
458
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
459
+ */
460
+ hash: string;
461
+ /**
462
+ * Gets and sets the host portion of the URL.
463
+ *
464
+ * ```js
465
+ * const myURL = new URL('https://example.org:81/foo');
466
+ * console.log(myURL.host);
467
+ * // Prints example.org:81
468
+ *
469
+ * myURL.host = 'example.com:82';
470
+ * console.log(myURL.href);
471
+ * // Prints https://example.com:82/foo
472
+ * ```
473
+ *
474
+ * Invalid host values assigned to the `host` property are ignored.
475
+ */
476
+ host: string;
477
+ /**
478
+ * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the
479
+ * port.
480
+ *
481
+ * ```js
482
+ * const myURL = new URL('https://example.org:81/foo');
483
+ * console.log(myURL.hostname);
484
+ * // Prints example.org
485
+ *
486
+ * // Setting the hostname does not change the port
487
+ * myURL.hostname = 'example.com:82';
488
+ * console.log(myURL.href);
489
+ * // Prints https://example.com:81/foo
490
+ *
491
+ * // Use myURL.host to change the hostname and port
492
+ * myURL.host = 'example.org:82';
493
+ * console.log(myURL.href);
494
+ * // Prints https://example.org:82/foo
495
+ * ```
496
+ *
497
+ * Invalid host name values assigned to the `hostname` property are ignored.
498
+ */
499
+ hostname: string;
500
+ /**
501
+ * Gets and sets the serialized URL.
502
+ *
503
+ * ```js
504
+ * const myURL = new URL('https://example.org/foo');
505
+ * console.log(myURL.href);
506
+ * // Prints https://example.org/foo
507
+ *
508
+ * myURL.href = 'https://example.com/bar';
509
+ * console.log(myURL.href);
510
+ * // Prints https://example.com/bar
511
+ * ```
512
+ *
513
+ * Getting the value of the `href` property is equivalent to calling {@link toString}.
514
+ *
515
+ * Setting the value of this property to a new value is equivalent to creating a
516
+ * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified.
517
+ *
518
+ * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown.
519
+ */
520
+ href: string;
521
+ /**
522
+ * Gets the read-only serialization of the URL's origin.
523
+ *
524
+ * ```js
525
+ * const myURL = new URL('https://example.org/foo/bar?baz');
526
+ * console.log(myURL.origin);
527
+ * // Prints https://example.org
528
+ * ```
529
+ *
530
+ * ```js
531
+ * const idnURL = new URL('https://測試');
532
+ * console.log(idnURL.origin);
533
+ * // Prints https://xn--g6w251d
534
+ *
535
+ * console.log(idnURL.hostname);
536
+ * // Prints xn--g6w251d
537
+ * ```
538
+ */
539
+ readonly origin: string;
540
+ /**
541
+ * Gets and sets the password portion of the URL.
542
+ *
543
+ * ```js
544
+ * const myURL = new URL('https://abc:xyz@example.com');
545
+ * console.log(myURL.password);
546
+ * // Prints xyz
547
+ *
548
+ * myURL.password = '123';
549
+ * console.log(myURL.href);
550
+ * // Prints https://abc:123@example.com
551
+ * ```
552
+ *
553
+ * Invalid URL characters included in the value assigned to the `password` property
554
+ * are `percent-encoded`. The selection of which characters to
555
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
556
+ */
557
+ password: string;
558
+ /**
559
+ * Gets and sets the path portion of the URL.
560
+ *
561
+ * ```js
562
+ * const myURL = new URL('https://example.org/abc/xyz?123');
563
+ * console.log(myURL.pathname);
564
+ * // Prints /abc/xyz
565
+ *
566
+ * myURL.pathname = '/abcdef';
567
+ * console.log(myURL.href);
568
+ * // Prints https://example.org/abcdef?123
569
+ * ```
570
+ *
571
+ * Invalid URL characters included in the value assigned to the `pathname` property are `percent-encoded`. The selection of which characters
572
+ * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
573
+ */
574
+ pathname: string;
575
+ /**
576
+ * Gets and sets the port portion of the URL.
577
+ *
578
+ * The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will
579
+ * result in the `port` value becoming
580
+ * the empty string (`''`).
581
+ *
582
+ * The port value can be an empty string in which case the port depends on
583
+ * the protocol/scheme:
584
+ *
585
+ * <omitted>
586
+ *
587
+ * Upon assigning a value to the port, the value will first be converted to a
588
+ * string using `.toString()`.
589
+ *
590
+ * If that string is invalid but it begins with a number, the leading number is
591
+ * assigned to `port`.
592
+ * If the number lies outside the range denoted above, it is ignored.
593
+ *
594
+ * ```js
595
+ * const myURL = new URL('https://example.org:8888');
596
+ * console.log(myURL.port);
597
+ * // Prints 8888
598
+ *
599
+ * // Default ports are automatically transformed to the empty string
600
+ * // (HTTPS protocol's default port is 443)
601
+ * myURL.port = '443';
602
+ * console.log(myURL.port);
603
+ * // Prints the empty string
604
+ * console.log(myURL.href);
605
+ * // Prints https://example.org/
606
+ *
607
+ * myURL.port = 1234;
608
+ * console.log(myURL.port);
609
+ * // Prints 1234
610
+ * console.log(myURL.href);
611
+ * // Prints https://example.org:1234/
612
+ *
613
+ * // Completely invalid port strings are ignored
614
+ * myURL.port = 'abcd';
615
+ * console.log(myURL.port);
616
+ * // Prints 1234
617
+ *
618
+ * // Leading numbers are treated as a port number
619
+ * myURL.port = '5678abcd';
620
+ * console.log(myURL.port);
621
+ * // Prints 5678
622
+ *
623
+ * // Non-integers are truncated
624
+ * myURL.port = 1234.5678;
625
+ * console.log(myURL.port);
626
+ * // Prints 1234
627
+ *
628
+ * // Out-of-range numbers which are not represented in scientific notation
629
+ * // will be ignored.
630
+ * myURL.port = 1e10; // 10000000000, will be range-checked as described below
631
+ * console.log(myURL.port);
632
+ * // Prints 1234
633
+ * ```
634
+ *
635
+ * Numbers which contain a decimal point,
636
+ * such as floating-point numbers or numbers in scientific notation,
637
+ * are not an exception to this rule.
638
+ * Leading numbers up to the decimal point will be set as the URL's port,
639
+ * assuming they are valid:
640
+ *
641
+ * ```js
642
+ * myURL.port = 4.567e21;
643
+ * console.log(myURL.port);
644
+ * // Prints 4 (because it is the leading number in the string '4.567e21')
645
+ * ```
646
+ */
647
+ port: string;
648
+ /**
649
+ * Gets and sets the protocol portion of the URL.
650
+ *
651
+ * ```js
652
+ * const myURL = new URL('https://example.org');
653
+ * console.log(myURL.protocol);
654
+ * // Prints https:
655
+ *
656
+ * myURL.protocol = 'ftp';
657
+ * console.log(myURL.href);
658
+ * // Prints ftp://example.org/
659
+ * ```
660
+ *
661
+ * Invalid URL protocol values assigned to the `protocol` property are ignored.
662
+ */
663
+ protocol: string;
664
+ /**
665
+ * Gets and sets the serialized query portion of the URL.
666
+ *
667
+ * ```js
668
+ * const myURL = new URL('https://example.org/abc?123');
669
+ * console.log(myURL.search);
670
+ * // Prints ?123
671
+ *
672
+ * myURL.search = 'abc=xyz';
673
+ * console.log(myURL.href);
674
+ * // Prints https://example.org/abc?abc=xyz
675
+ * ```
676
+ *
677
+ * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which
678
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
679
+ */
680
+ search: string;
681
+ /**
682
+ * Gets the `URLSearchParams` object representing the query parameters of the
683
+ * URL. This property is read-only but the `URLSearchParams` object it provides
684
+ * can be used to mutate the URL instance; to replace the entirety of query
685
+ * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details.
686
+ *
687
+ * Use care when using `.searchParams` to modify the `URL` because,
688
+ * per the WHATWG specification, the `URLSearchParams` object uses
689
+ * different rules to determine which characters to percent-encode. For
690
+ * instance, the `URL` object will not percent encode the ASCII tilde (`~`)
691
+ * character, while `URLSearchParams` will always encode it:
692
+ *
693
+ * ```js
694
+ * const myUrl = new URL('https://example.org/abc?foo=~bar');
695
+ *
696
+ * console.log(myUrl.search); // prints ?foo=~bar
697
+ *
698
+ * // Modify the URL via searchParams...
699
+ * myUrl.searchParams.sort();
700
+ *
701
+ * console.log(myUrl.search); // prints ?foo=%7Ebar
702
+ * ```
703
+ */
704
+ readonly searchParams: URLSearchParams;
705
+ /**
706
+ * Gets and sets the username portion of the URL.
707
+ *
708
+ * ```js
709
+ * const myURL = new URL('https://abc:xyz@example.com');
710
+ * console.log(myURL.username);
711
+ * // Prints abc
712
+ *
713
+ * myURL.username = '123';
714
+ * console.log(myURL.href);
715
+ * // Prints https://123:xyz@example.com/
716
+ * ```
717
+ *
718
+ * Any invalid URL characters appearing in the value assigned the `username` property will be `percent-encoded`. The selection of which
719
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
720
+ */
721
+ username: string;
722
+ /**
723
+ * The `toString()` method on the `URL` object returns the serialized URL. The
724
+ * value returned is equivalent to that of {@link href} and {@link toJSON}.
725
+ */
726
+ toString(): string;
727
+ /**
728
+ * The `toJSON()` method on the `URL` object returns the serialized URL. The
729
+ * value returned is equivalent to that of {@link href} and {@link toString}.
730
+ *
731
+ * This method is automatically called when an `URL` object is serialized
732
+ * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).
733
+ *
734
+ * ```js
735
+ * const myURLs = [
736
+ * new URL('https://www.example.com'),
737
+ * new URL('https://test.example.org'),
738
+ * ];
739
+ * console.log(JSON.stringify(myURLs));
740
+ * // Prints ["https://www.example.com/","https://test.example.org/"]
741
+ * ```
742
+ */
743
+ toJSON(): string;
744
+ }
745
+ interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
746
+ [Symbol.iterator](): URLSearchParamsIterator<T>;
747
+ }
748
+ /**
749
+ * The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the
750
+ * four following constructors.
751
+ * The `URLSearchParams` class is also available on the global object.
752
+ *
753
+ * The WHATWG `URLSearchParams` interface and the `querystring` module have
754
+ * similar purpose, but the purpose of the `querystring` module is more
755
+ * general, as it allows the customization of delimiter characters (`&#x26;` and `=`).
756
+ * On the other hand, this API is designed purely for URL query strings.
757
+ *
758
+ * ```js
759
+ * const myURL = new URL('https://example.org/?abc=123');
760
+ * console.log(myURL.searchParams.get('abc'));
761
+ * // Prints 123
762
+ *
763
+ * myURL.searchParams.append('abc', 'xyz');
764
+ * console.log(myURL.href);
765
+ * // Prints https://example.org/?abc=123&#x26;abc=xyz
766
+ *
767
+ * myURL.searchParams.delete('abc');
768
+ * myURL.searchParams.set('a', 'b');
769
+ * console.log(myURL.href);
770
+ * // Prints https://example.org/?a=b
771
+ *
772
+ * const newSearchParams = new URLSearchParams(myURL.searchParams);
773
+ * // The above is equivalent to
774
+ * // const newSearchParams = new URLSearchParams(myURL.search);
775
+ *
776
+ * newSearchParams.append('a', 'c');
777
+ * console.log(myURL.href);
778
+ * // Prints https://example.org/?a=b
779
+ * console.log(newSearchParams.toString());
780
+ * // Prints a=b&#x26;a=c
781
+ *
782
+ * // newSearchParams.toString() is implicitly called
783
+ * myURL.search = newSearchParams;
784
+ * console.log(myURL.href);
785
+ * // Prints https://example.org/?a=b&#x26;a=c
786
+ * newSearchParams.delete('a');
787
+ * console.log(myURL.href);
788
+ * // Prints https://example.org/?a=b&#x26;a=c
789
+ * ```
790
+ * @since v7.5.0, v6.13.0
791
+ */
792
+ class URLSearchParams implements Iterable<[string, string]> {
793
+ constructor(
794
+ init?:
795
+ | URLSearchParams
796
+ | string
797
+ | Record<string, string | readonly string[]>
798
+ | Iterable<[string, string]>
799
+ | ReadonlyArray<[string, string]>,
800
+ );
801
+ /**
802
+ * Append a new name-value pair to the query string.
803
+ */
804
+ append(name: string, value: string): void;
805
+ /**
806
+ * If `value` is provided, removes all name-value pairs
807
+ * where name is `name` and value is `value`.
808
+ *
809
+ * If `value` is not provided, removes all name-value pairs whose name is `name`.
810
+ */
811
+ delete(name: string, value?: string): void;
812
+ /**
813
+ * Returns an ES6 `Iterator` over each of the name-value pairs in the query.
814
+ * Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`.
815
+ *
816
+ * Alias for `urlSearchParams[@@iterator]()`.
817
+ */
818
+ entries(): URLSearchParamsIterator<[string, string]>;
819
+ /**
820
+ * Iterates over each name-value pair in the query and invokes the given function.
821
+ *
822
+ * ```js
823
+ * const myURL = new URL('https://example.org/?a=b&#x26;c=d');
824
+ * myURL.searchParams.forEach((value, name, searchParams) => {
825
+ * console.log(name, value, myURL.searchParams === searchParams);
826
+ * });
827
+ * // Prints:
828
+ * // a b true
829
+ * // c d true
830
+ * ```
831
+ * @param fn Invoked for each name-value pair in the query
832
+ * @param thisArg To be used as `this` value for when `fn` is called
833
+ */
834
+ forEach<TThis = this>(
835
+ fn: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void,
836
+ thisArg?: TThis,
837
+ ): void;
838
+ /**
839
+ * Returns the value of the first name-value pair whose name is `name`. If there
840
+ * are no such pairs, `null` is returned.
841
+ * @return or `null` if there is no name-value pair with the given `name`.
842
+ */
843
+ get(name: string): string | null;
844
+ /**
845
+ * Returns the values of all name-value pairs whose name is `name`. If there are
846
+ * no such pairs, an empty array is returned.
847
+ */
848
+ getAll(name: string): string[];
849
+ /**
850
+ * Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument.
851
+ *
852
+ * If `value` is provided, returns `true` when name-value pair with
853
+ * same `name` and `value` exists.
854
+ *
855
+ * If `value` is not provided, returns `true` if there is at least one name-value
856
+ * pair whose name is `name`.
857
+ */
858
+ has(name: string, value?: string): boolean;
859
+ /**
860
+ * Returns an ES6 `Iterator` over the names of each name-value pair.
861
+ *
862
+ * ```js
863
+ * const params = new URLSearchParams('foo=bar&#x26;foo=baz');
864
+ * for (const name of params.keys()) {
865
+ * console.log(name);
866
+ * }
867
+ * // Prints:
868
+ * // foo
869
+ * // foo
870
+ * ```
871
+ */
872
+ keys(): URLSearchParamsIterator<string>;
873
+ /**
874
+ * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`,
875
+ * set the first such pair's value to `value` and remove all others. If not,
876
+ * append the name-value pair to the query string.
877
+ *
878
+ * ```js
879
+ * const params = new URLSearchParams();
880
+ * params.append('foo', 'bar');
881
+ * params.append('foo', 'baz');
882
+ * params.append('abc', 'def');
883
+ * console.log(params.toString());
884
+ * // Prints foo=bar&#x26;foo=baz&#x26;abc=def
885
+ *
886
+ * params.set('foo', 'def');
887
+ * params.set('xyz', 'opq');
888
+ * console.log(params.toString());
889
+ * // Prints foo=def&#x26;abc=def&#x26;xyz=opq
890
+ * ```
891
+ */
892
+ set(name: string, value: string): void;
893
+ /**
894
+ * The total number of parameter entries.
895
+ * @since v18.16.0
896
+ */
897
+ readonly size: number;
898
+ /**
899
+ * Sort all existing name-value pairs in-place by their names. Sorting is done
900
+ * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs
901
+ * with the same name is preserved.
902
+ *
903
+ * This method can be used, in particular, to increase cache hits.
904
+ *
905
+ * ```js
906
+ * const params = new URLSearchParams('query[]=abc&#x26;type=search&#x26;query[]=123');
907
+ * params.sort();
908
+ * console.log(params.toString());
909
+ * // Prints query%5B%5D=abc&#x26;query%5B%5D=123&#x26;type=search
910
+ * ```
911
+ * @since v7.7.0, v6.13.0
912
+ */
913
+ sort(): void;
914
+ /**
915
+ * Returns the search parameters serialized as a string, with characters
916
+ * percent-encoded where necessary.
917
+ */
918
+ toString(): string;
919
+ /**
920
+ * Returns an ES6 `Iterator` over the values of each name-value pair.
921
+ */
922
+ values(): URLSearchParamsIterator<string>;
923
+ [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
924
+ }
925
+ import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
926
+ global {
927
+ interface URLSearchParams extends _URLSearchParams {}
928
+ interface URL extends _URL {}
929
+ interface Global {
930
+ URL: typeof _URL;
931
+ URLSearchParams: typeof _URLSearchParams;
932
+ }
933
+ /**
934
+ * `URL` class is a global reference for `import { URL } from 'node:url'`
935
+ * https://nodejs.org/api/url.html#the-whatwg-url-api
936
+ * @since v10.0.0
937
+ */
938
+ var URL: typeof globalThis extends {
939
+ onmessage: any;
940
+ URL: infer T;
941
+ } ? T
942
+ : typeof _URL;
943
+ /**
944
+ * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'`
945
+ * https://nodejs.org/api/url.html#class-urlsearchparams
946
+ * @since v10.0.0
947
+ */
948
+ var URLSearchParams: typeof globalThis extends {
949
+ onmessage: any;
950
+ URLSearchParams: infer T;
951
+ } ? T
952
+ : typeof _URLSearchParams;
953
+ }
954
+ }
955
+ declare module "node:url" {
956
+ export * from "url";
957
+ }
novas/novacore-zephyr/groq-code-cli/node_modules/groq-sdk/node_modules/@types/node/util.d.ts ADDED
@@ -0,0 +1,2083 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * The `util` module supports the needs of Node.js internal APIs. Many of the
3
+ * utilities are useful for application and module developers as well. To access
4
+ * it:
5
+ *
6
+ * ```js
7
+ * import util from 'node:util';
8
+ * ```
9
+ * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/util.js)
10
+ */
11
+ declare module "util" {
12
+ import * as types from "node:util/types";
13
+ export interface InspectOptions {
14
+ /**
15
+ * If `true`, object's non-enumerable symbols and properties are included in the formatted result.
16
+ * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties).
17
+ * @default false
18
+ */
19
+ showHidden?: boolean | undefined;
20
+ /**
21
+ * Specifies the number of times to recurse while formatting object.
22
+ * This is useful for inspecting large objects.
23
+ * To recurse up to the maximum call stack size pass `Infinity` or `null`.
24
+ * @default 2
25
+ */
26
+ depth?: number | null | undefined;
27
+ /**
28
+ * If `true`, the output is styled with ANSI color codes. Colors are customizable.
29
+ */
30
+ colors?: boolean | undefined;
31
+ /**
32
+ * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked.
33
+ * @default true
34
+ */
35
+ customInspect?: boolean | undefined;
36
+ /**
37
+ * If `true`, `Proxy` inspection includes the target and handler objects.
38
+ * @default false
39
+ */
40
+ showProxy?: boolean | undefined;
41
+ /**
42
+ * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements
43
+ * to include when formatting. Set to `null` or `Infinity` to show all elements.
44
+ * Set to `0` or negative to show no elements.
45
+ * @default 100
46
+ */
47
+ maxArrayLength?: number | null | undefined;
48
+ /**
49
+ * Specifies the maximum number of characters to
50
+ * include when formatting. Set to `null` or `Infinity` to show all elements.
51
+ * Set to `0` or negative to show no characters.
52
+ * @default 10000
53
+ */
54
+ maxStringLength?: number | null | undefined;
55
+ /**
56
+ * The length at which input values are split across multiple lines.
57
+ * Set to `Infinity` to format the input as a single line
58
+ * (in combination with `compact` set to `true` or any number >= `1`).
59
+ * @default 80
60
+ */
61
+ breakLength?: number | undefined;
62
+ /**
63
+ * Setting this to `false` causes each object key
64
+ * to be displayed on a new line. It will also add new lines to text that is
65
+ * longer than `breakLength`. If set to a number, the most `n` inner elements
66
+ * are united on a single line as long as all properties fit into
67
+ * `breakLength`. Short array elements are also grouped together. Note that no
68
+ * text will be reduced below 16 characters, no matter the `breakLength` size.
69
+ * For more information, see the example below.
70
+ * @default true
71
+ */
72
+ compact?: boolean | number | undefined;
73
+ /**
74
+ * If set to `true` or a function, all properties of an object, and `Set` and `Map`
75
+ * entries are sorted in the resulting string.
76
+ * If set to `true` the default sort is used.
77
+ * If set to a function, it is used as a compare function.
78
+ */
79
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
80
+ /**
81
+ * If set to `true`, getters are going to be
82
+ * inspected as well. If set to `'get'` only getters without setter are going
83
+ * to be inspected. If set to `'set'` only getters having a corresponding
84
+ * setter are going to be inspected. This might cause side effects depending on
85
+ * the getter function.
86
+ * @default false
87
+ */
88
+ getters?: "get" | "set" | boolean | undefined;
89
+ /**
90
+ * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers.
91
+ * @default false
92
+ */
93
+ numericSeparator?: boolean | undefined;
94
+ }
95
+ export type Style =
96
+ | "special"
97
+ | "number"
98
+ | "bigint"
99
+ | "boolean"
100
+ | "undefined"
101
+ | "null"
102
+ | "string"
103
+ | "symbol"
104
+ | "date"
105
+ | "regexp"
106
+ | "module";
107
+ export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
108
+ export interface InspectOptionsStylized extends InspectOptions {
109
+ stylize(text: string, styleType: Style): string;
110
+ }
111
+ /**
112
+ * The `util.format()` method returns a formatted string using the first argument
113
+ * as a `printf`\-like format string which can contain zero or more format
114
+ * specifiers. Each specifier is replaced with the converted value from the
115
+ * corresponding argument. Supported specifiers are:
116
+ *
117
+ * If a specifier does not have a corresponding argument, it is not replaced:
118
+ *
119
+ * ```js
120
+ * util.format('%s:%s', 'foo');
121
+ * // Returns: 'foo:%s'
122
+ * ```
123
+ *
124
+ * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`.
125
+ *
126
+ * If there are more arguments passed to the `util.format()` method than the
127
+ * number of specifiers, the extra arguments are concatenated to the returned
128
+ * string, separated by spaces:
129
+ *
130
+ * ```js
131
+ * util.format('%s:%s', 'foo', 'bar', 'baz');
132
+ * // Returns: 'foo:bar baz'
133
+ * ```
134
+ *
135
+ * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces:
136
+ *
137
+ * ```js
138
+ * util.format(1, 2, 3);
139
+ * // Returns: '1 2 3'
140
+ * ```
141
+ *
142
+ * If only one argument is passed to `util.format()`, it is returned as it is
143
+ * without any formatting:
144
+ *
145
+ * ```js
146
+ * util.format('%% %s');
147
+ * // Returns: '%% %s'
148
+ * ```
149
+ *
150
+ * `util.format()` is a synchronous method that is intended as a debugging tool.
151
+ * Some input values can have a significant performance overhead that can block the
152
+ * event loop. Use this function with care and never in a hot code path.
153
+ * @since v0.5.3
154
+ * @param format A `printf`-like format string.
155
+ */
156
+ export function format(format?: any, ...param: any[]): string;
157
+ /**
158
+ * This function is identical to {@link format}, except in that it takes
159
+ * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}.
160
+ *
161
+ * ```js
162
+ * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
163
+ * // Returns 'See object { foo: 42 }', where `42` is colored as a number
164
+ * // when printed to a terminal.
165
+ * ```
166
+ * @since v10.0.0
167
+ */
168
+ export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
169
+ /**
170
+ * Returns the string name for a numeric error code that comes from a Node.js API.
171
+ * The mapping between error codes and error names is platform-dependent.
172
+ * See `Common System Errors` for the names of common errors.
173
+ *
174
+ * ```js
175
+ * fs.access('file/that/does/not/exist', (err) => {
176
+ * const name = util.getSystemErrorName(err.errno);
177
+ * console.error(name); // ENOENT
178
+ * });
179
+ * ```
180
+ * @since v9.7.0
181
+ */
182
+ export function getSystemErrorName(err: number): string;
183
+ /**
184
+ * Returns a Map of all system error codes available from the Node.js API.
185
+ * The mapping between error codes and error names is platform-dependent.
186
+ * See `Common System Errors` for the names of common errors.
187
+ *
188
+ * ```js
189
+ * fs.access('file/that/does/not/exist', (err) => {
190
+ * const errorMap = util.getSystemErrorMap();
191
+ * const name = errorMap.get(err.errno);
192
+ * console.error(name); // ENOENT
193
+ * });
194
+ * ```
195
+ * @since v16.0.0, v14.17.0
196
+ */
197
+ export function getSystemErrorMap(): Map<number, [string, string]>;
198
+ /**
199
+ * The `util.log()` method prints the given `string` to `stdout` with an included
200
+ * timestamp.
201
+ *
202
+ * ```js
203
+ * import util from 'node:util';
204
+ *
205
+ * util.log('Timestamped message.');
206
+ * ```
207
+ * @since v0.3.0
208
+ * @deprecated Since v6.0.0 - Use a third party module instead.
209
+ */
210
+ export function log(string: string): void;
211
+ /**
212
+ * Returns the `string` after replacing any surrogate code points
213
+ * (or equivalently, any unpaired surrogate code units) with the
214
+ * Unicode "replacement character" U+FFFD.
215
+ * @since v16.8.0, v14.18.0
216
+ */
217
+ export function toUSVString(string: string): string;
218
+ /**
219
+ * Creates and returns an `AbortController` instance whose `AbortSignal` is marked
220
+ * as transferable and can be used with `structuredClone()` or `postMessage()`.
221
+ * @since v18.11.0
222
+ * @returns A transferable AbortController
223
+ */
224
+ export function transferableAbortController(): AbortController;
225
+ /**
226
+ * Marks the given {AbortSignal} as transferable so that it can be used with
227
+ * `structuredClone()` and `postMessage()`.
228
+ *
229
+ * ```js
230
+ * const signal = transferableAbortSignal(AbortSignal.timeout(100));
231
+ * const channel = new MessageChannel();
232
+ * channel.port2.postMessage(signal, [signal]);
233
+ * ```
234
+ * @since v18.11.0
235
+ * @param signal The AbortSignal
236
+ * @returns The same AbortSignal
237
+ */
238
+ export function transferableAbortSignal(signal: AbortSignal): AbortSignal;
239
+ /**
240
+ * Listens to abort event on the provided `signal` and returns a promise that is fulfilled when the `signal` is aborted.
241
+ * If the passed `resource` is garbage collected before the `signal` is aborted, the returned promise shall remain pending indefinitely.
242
+ * @param resource Any non-null entity, reference to which is held weakly.
243
+ */
244
+ export function aborted(signal: AbortSignal, resource: any): Promise<void>;
245
+ /**
246
+ * The `util.inspect()` method returns a string representation of `object` that is
247
+ * intended for debugging. The output of `util.inspect` may change at any time
248
+ * and should not be depended upon programmatically. Additional `options` may be
249
+ * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
250
+ * an identifiable tag for an inspected value.
251
+ *
252
+ * ```js
253
+ * class Foo {
254
+ * get [Symbol.toStringTag]() {
255
+ * return 'bar';
256
+ * }
257
+ * }
258
+ *
259
+ * class Bar {}
260
+ *
261
+ * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });
262
+ *
263
+ * util.inspect(new Foo()); // 'Foo [bar] {}'
264
+ * util.inspect(new Bar()); // 'Bar {}'
265
+ * util.inspect(baz); // '[foo] {}'
266
+ * ```
267
+ *
268
+ * Circular references point to their anchor by using a reference index:
269
+ *
270
+ * ```js
271
+ * import { inspect } from 'node:util';
272
+ *
273
+ * const obj = {};
274
+ * obj.a = [obj];
275
+ * obj.b = {};
276
+ * obj.b.inner = obj.b;
277
+ * obj.b.obj = obj;
278
+ *
279
+ * console.log(inspect(obj));
280
+ * // <ref *1> {
281
+ * // a: [ [Circular *1] ],
282
+ * // b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }
283
+ * // }
284
+ * ```
285
+ *
286
+ * The following example inspects all properties of the `util` object:
287
+ *
288
+ * ```js
289
+ * import util from 'node:util';
290
+ *
291
+ * console.log(util.inspect(util, { showHidden: true, depth: null }));
292
+ * ```
293
+ *
294
+ * The following example highlights the effect of the `compact` option:
295
+ *
296
+ * ```js
297
+ * import util from 'node:util';
298
+ *
299
+ * const o = {
300
+ * a: [1, 2, [[
301
+ * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' +
302
+ * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.',
303
+ * 'test',
304
+ * 'foo']], 4],
305
+ * b: new Map([['za', 1], ['zb', 'test']])
306
+ * };
307
+ * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
308
+ *
309
+ * // { a:
310
+ * // [ 1,
311
+ * // 2,
312
+ * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line
313
+ * // 'test',
314
+ * // 'foo' ] ],
315
+ * // 4 ],
316
+ * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
317
+ *
318
+ * // Setting `compact` to false or an integer creates more reader friendly output.
319
+ * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
320
+ *
321
+ * // {
322
+ * // a: [
323
+ * // 1,
324
+ * // 2,
325
+ * // [
326
+ * // [
327
+ * // 'Lorem ipsum dolor sit amet,\n' +
328
+ * // 'consectetur adipiscing elit, sed do eiusmod \n' +
329
+ * // 'tempor incididunt ut labore et dolore magna aliqua.',
330
+ * // 'test',
331
+ * // 'foo'
332
+ * // ]
333
+ * // ],
334
+ * // 4
335
+ * // ],
336
+ * // b: Map(2) {
337
+ * // 'za' => 1,
338
+ * // 'zb' => 'test'
339
+ * // }
340
+ * // }
341
+ *
342
+ * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a
343
+ * // single line.
344
+ * ```
345
+ *
346
+ * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
347
+ * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
348
+ * inspected. If there are more entries than `maxArrayLength`, there is no
349
+ * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
350
+ * result in different output. Furthermore, entries
351
+ * with no remaining strong references may be garbage collected at any time.
352
+ *
353
+ * ```js
354
+ * import { inspect } from 'node:util';
355
+ *
356
+ * const obj = { a: 1 };
357
+ * const obj2 = { b: 2 };
358
+ * const weakSet = new WeakSet([obj, obj2]);
359
+ *
360
+ * console.log(inspect(weakSet, { showHidden: true }));
361
+ * // WeakSet { { a: 1 }, { b: 2 } }
362
+ * ```
363
+ *
364
+ * The `sorted` option ensures that an object's property insertion order does not
365
+ * impact the result of `util.inspect()`.
366
+ *
367
+ * ```js
368
+ * import { inspect } from 'node:util';
369
+ * import assert from 'node:assert';
370
+ *
371
+ * const o1 = {
372
+ * b: [2, 3, 1],
373
+ * a: '`a` comes before `b`',
374
+ * c: new Set([2, 3, 1])
375
+ * };
376
+ * console.log(inspect(o1, { sorted: true }));
377
+ * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
378
+ * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
379
+ * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
380
+ *
381
+ * const o2 = {
382
+ * c: new Set([2, 1, 3]),
383
+ * a: '`a` comes before `b`',
384
+ * b: [2, 3, 1]
385
+ * };
386
+ * assert.strict.equal(
387
+ * inspect(o1, { sorted: true }),
388
+ * inspect(o2, { sorted: true })
389
+ * );
390
+ * ```
391
+ *
392
+ * The `numericSeparator` option adds an underscore every three digits to all
393
+ * numbers.
394
+ *
395
+ * ```js
396
+ * import { inspect } from 'node:util';
397
+ *
398
+ * const thousand = 1_000;
399
+ * const million = 1_000_000;
400
+ * const bigNumber = 123_456_789n;
401
+ * const bigDecimal = 1_234.123_45;
402
+ *
403
+ * console.log(thousand, million, bigNumber, bigDecimal);
404
+ * // 1_000 1_000_000 123_456_789n 1_234.123_45
405
+ * ```
406
+ *
407
+ * `util.inspect()` is a synchronous method intended for debugging. Its maximum
408
+ * output length is approximately 128 MB. Inputs that result in longer output will
409
+ * be truncated.
410
+ * @since v0.3.0
411
+ * @param object Any JavaScript primitive or `Object`.
412
+ * @return The representation of `object`.
413
+ */
414
+ export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
415
+ export function inspect(object: any, options?: InspectOptions): string;
416
+ export namespace inspect {
417
+ let colors: NodeJS.Dict<[number, number]>;
418
+ let styles: {
419
+ [K in Style]: string;
420
+ };
421
+ let defaultOptions: InspectOptions;
422
+ /**
423
+ * Allows changing inspect settings from the repl.
424
+ */
425
+ let replDefaults: InspectOptions;
426
+ /**
427
+ * That can be used to declare custom inspect functions.
428
+ */
429
+ const custom: unique symbol;
430
+ }
431
+ /**
432
+ * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray).
433
+ *
434
+ * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`.
435
+ *
436
+ * ```js
437
+ * import util from 'node:util';
438
+ *
439
+ * util.isArray([]);
440
+ * // Returns: true
441
+ * util.isArray(new Array());
442
+ * // Returns: true
443
+ * util.isArray({});
444
+ * // Returns: false
445
+ * ```
446
+ * @since v0.6.0
447
+ * @deprecated Since v4.0.0 - Use `isArray` instead.
448
+ */
449
+ export function isArray(object: unknown): object is unknown[];
450
+ /**
451
+ * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
452
+ *
453
+ * ```js
454
+ * import util from 'node:util';
455
+ *
456
+ * util.isRegExp(/some regexp/);
457
+ * // Returns: true
458
+ * util.isRegExp(new RegExp('another regexp'));
459
+ * // Returns: true
460
+ * util.isRegExp({});
461
+ * // Returns: false
462
+ * ```
463
+ * @since v0.6.0
464
+ * @deprecated Since v4.0.0 - Deprecated
465
+ */
466
+ export function isRegExp(object: unknown): object is RegExp;
467
+ /**
468
+ * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
469
+ *
470
+ * ```js
471
+ * import util from 'node:util';
472
+ *
473
+ * util.isDate(new Date());
474
+ * // Returns: true
475
+ * util.isDate(Date());
476
+ * // false (without 'new' returns a String)
477
+ * util.isDate({});
478
+ * // Returns: false
479
+ * ```
480
+ * @since v0.6.0
481
+ * @deprecated Since v4.0.0 - Use {@link types.isDate} instead.
482
+ */
483
+ export function isDate(object: unknown): object is Date;
484
+ /**
485
+ * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`.
486
+ *
487
+ * ```js
488
+ * import util from 'node:util';
489
+ *
490
+ * util.isError(new Error());
491
+ * // Returns: true
492
+ * util.isError(new TypeError());
493
+ * // Returns: true
494
+ * util.isError({ name: 'Error', message: 'an error occurred' });
495
+ * // Returns: false
496
+ * ```
497
+ *
498
+ * This method relies on `Object.prototype.toString()` behavior. It is
499
+ * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`.
500
+ *
501
+ * ```js
502
+ * import util from 'node:util';
503
+ * const obj = { name: 'Error', message: 'an error occurred' };
504
+ *
505
+ * util.isError(obj);
506
+ * // Returns: false
507
+ * obj[Symbol.toStringTag] = 'Error';
508
+ * util.isError(obj);
509
+ * // Returns: true
510
+ * ```
511
+ * @since v0.6.0
512
+ * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead.
513
+ */
514
+ export function isError(object: unknown): object is Error;
515
+ /**
516
+ * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note
517
+ * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
518
+ *
519
+ * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
520
+ * prototype of `constructor` will be set to a new object created from`superConstructor`.
521
+ *
522
+ * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
523
+ * As an additional convenience, `superConstructor` will be accessible
524
+ * through the `constructor.super_` property.
525
+ *
526
+ * ```js
527
+ * import util from 'node:util';
528
+ * import EventEmitter from 'node:events';
529
+ *
530
+ * function MyStream() {
531
+ * EventEmitter.call(this);
532
+ * }
533
+ *
534
+ * util.inherits(MyStream, EventEmitter);
535
+ *
536
+ * MyStream.prototype.write = function(data) {
537
+ * this.emit('data', data);
538
+ * };
539
+ *
540
+ * const stream = new MyStream();
541
+ *
542
+ * console.log(stream instanceof EventEmitter); // true
543
+ * console.log(MyStream.super_ === EventEmitter); // true
544
+ *
545
+ * stream.on('data', (data) => {
546
+ * console.log(`Received data: "${data}"`);
547
+ * });
548
+ * stream.write('It works!'); // Received data: "It works!"
549
+ * ```
550
+ *
551
+ * ES6 example using `class` and `extends`:
552
+ *
553
+ * ```js
554
+ * import EventEmitter from 'node:events';
555
+ *
556
+ * class MyStream extends EventEmitter {
557
+ * write(data) {
558
+ * this.emit('data', data);
559
+ * }
560
+ * }
561
+ *
562
+ * const stream = new MyStream();
563
+ *
564
+ * stream.on('data', (data) => {
565
+ * console.log(`Received data: "${data}"`);
566
+ * });
567
+ * stream.write('With ES6');
568
+ * ```
569
+ * @since v0.3.0
570
+ * @legacy Use ES2015 class syntax and `extends` keyword instead.
571
+ */
572
+ export function inherits(constructor: unknown, superConstructor: unknown): void;
573
+ export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
574
+ export interface DebugLogger extends DebugLoggerFunction {
575
+ enabled: boolean;
576
+ }
577
+ /**
578
+ * The `util.debuglog()` method is used to create a function that conditionally
579
+ * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that
580
+ * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op.
581
+ *
582
+ * ```js
583
+ * import util from 'node:util';
584
+ * const debuglog = util.debuglog('foo');
585
+ *
586
+ * debuglog('hello from foo [%d]', 123);
587
+ * ```
588
+ *
589
+ * If this program is run with `NODE_DEBUG=foo` in the environment, then
590
+ * it will output something like:
591
+ *
592
+ * ```console
593
+ * FOO 3245: hello from foo [123]
594
+ * ```
595
+ *
596
+ * where `3245` is the process id. If it is not run with that
597
+ * environment variable set, then it will not print anything.
598
+ *
599
+ * The `section` supports wildcard also:
600
+ *
601
+ * ```js
602
+ * import util from 'node:util';
603
+ * const debuglog = util.debuglog('foo-bar');
604
+ *
605
+ * debuglog('hi there, it\'s foo-bar [%d]', 2333);
606
+ * ```
607
+ *
608
+ * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
609
+ * something like:
610
+ *
611
+ * ```console
612
+ * FOO-BAR 3257: hi there, it's foo-bar [2333]
613
+ * ```
614
+ *
615
+ * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`.
616
+ *
617
+ * The optional `callback` argument can be used to replace the logging function
618
+ * with a different function that doesn't have any initialization or
619
+ * unnecessary wrapping.
620
+ *
621
+ * ```js
622
+ * import util from 'node:util';
623
+ * let debuglog = util.debuglog('internals', (debug) => {
624
+ * // Replace with a logging function that optimizes out
625
+ * // testing if the section is enabled
626
+ * debuglog = debug;
627
+ * });
628
+ * ```
629
+ * @since v0.11.3
630
+ * @param section A string identifying the portion of the application for which the `debuglog` function is being created.
631
+ * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.
632
+ * @return The logging function
633
+ */
634
+ export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
635
+ export const debug: typeof debuglog;
636
+ /**
637
+ * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
638
+ *
639
+ * ```js
640
+ * import util from 'node:util';
641
+ *
642
+ * util.isBoolean(1);
643
+ * // Returns: false
644
+ * util.isBoolean(0);
645
+ * // Returns: false
646
+ * util.isBoolean(false);
647
+ * // Returns: true
648
+ * ```
649
+ * @since v0.11.5
650
+ * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead.
651
+ */
652
+ export function isBoolean(object: unknown): object is boolean;
653
+ /**
654
+ * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
655
+ *
656
+ * ```js
657
+ * import util from 'node:util';
658
+ *
659
+ * util.isBuffer({ length: 0 });
660
+ * // Returns: false
661
+ * util.isBuffer([]);
662
+ * // Returns: false
663
+ * util.isBuffer(Buffer.from('hello world'));
664
+ * // Returns: true
665
+ * ```
666
+ * @since v0.11.5
667
+ * @deprecated Since v4.0.0 - Use `isBuffer` instead.
668
+ */
669
+ export function isBuffer(object: unknown): object is Buffer;
670
+ /**
671
+ * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`.
672
+ *
673
+ * ```js
674
+ * import util from 'node:util';
675
+ *
676
+ * function Foo() {}
677
+ * const Bar = () => {};
678
+ *
679
+ * util.isFunction({});
680
+ * // Returns: false
681
+ * util.isFunction(Foo);
682
+ * // Returns: true
683
+ * util.isFunction(Bar);
684
+ * // Returns: true
685
+ * ```
686
+ * @since v0.11.5
687
+ * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead.
688
+ */
689
+ export function isFunction(object: unknown): boolean;
690
+ /**
691
+ * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`.
692
+ *
693
+ * ```js
694
+ * import util from 'node:util';
695
+ *
696
+ * util.isNull(0);
697
+ * // Returns: false
698
+ * util.isNull(undefined);
699
+ * // Returns: false
700
+ * util.isNull(null);
701
+ * // Returns: true
702
+ * ```
703
+ * @since v0.11.5
704
+ * @deprecated Since v4.0.0 - Use `value === null` instead.
705
+ */
706
+ export function isNull(object: unknown): object is null;
707
+ /**
708
+ * Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
709
+ * returns `false`.
710
+ *
711
+ * ```js
712
+ * import util from 'node:util';
713
+ *
714
+ * util.isNullOrUndefined(0);
715
+ * // Returns: false
716
+ * util.isNullOrUndefined(undefined);
717
+ * // Returns: true
718
+ * util.isNullOrUndefined(null);
719
+ * // Returns: true
720
+ * ```
721
+ * @since v0.11.5
722
+ * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead.
723
+ */
724
+ export function isNullOrUndefined(object: unknown): object is null | undefined;
725
+ /**
726
+ * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
727
+ *
728
+ * ```js
729
+ * import util from 'node:util';
730
+ *
731
+ * util.isNumber(false);
732
+ * // Returns: false
733
+ * util.isNumber(Infinity);
734
+ * // Returns: true
735
+ * util.isNumber(0);
736
+ * // Returns: true
737
+ * util.isNumber(NaN);
738
+ * // Returns: true
739
+ * ```
740
+ * @since v0.11.5
741
+ * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead.
742
+ */
743
+ export function isNumber(object: unknown): object is number;
744
+ /**
745
+ * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript).
746
+ * Otherwise, returns `false`.
747
+ *
748
+ * ```js
749
+ * import util from 'node:util';
750
+ *
751
+ * util.isObject(5);
752
+ * // Returns: false
753
+ * util.isObject(null);
754
+ * // Returns: false
755
+ * util.isObject({});
756
+ * // Returns: true
757
+ * util.isObject(() => {});
758
+ * // Returns: false
759
+ * ```
760
+ * @since v0.11.5
761
+ * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead.
762
+ */
763
+ export function isObject(object: unknown): boolean;
764
+ /**
765
+ * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`.
766
+ *
767
+ * ```js
768
+ * import util from 'node:util';
769
+ *
770
+ * util.isPrimitive(5);
771
+ * // Returns: true
772
+ * util.isPrimitive('foo');
773
+ * // Returns: true
774
+ * util.isPrimitive(false);
775
+ * // Returns: true
776
+ * util.isPrimitive(null);
777
+ * // Returns: true
778
+ * util.isPrimitive(undefined);
779
+ * // Returns: true
780
+ * util.isPrimitive({});
781
+ * // Returns: false
782
+ * util.isPrimitive(() => {});
783
+ * // Returns: false
784
+ * util.isPrimitive(/^$/);
785
+ * // Returns: false
786
+ * util.isPrimitive(new Date());
787
+ * // Returns: false
788
+ * ```
789
+ * @since v0.11.5
790
+ * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead.
791
+ */
792
+ export function isPrimitive(object: unknown): boolean;
793
+ /**
794
+ * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
795
+ *
796
+ * ```js
797
+ * import util from 'node:util';
798
+ *
799
+ * util.isString('');
800
+ * // Returns: true
801
+ * util.isString('foo');
802
+ * // Returns: true
803
+ * util.isString(String('foo'));
804
+ * // Returns: true
805
+ * util.isString(5);
806
+ * // Returns: false
807
+ * ```
808
+ * @since v0.11.5
809
+ * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead.
810
+ */
811
+ export function isString(object: unknown): object is string;
812
+ /**
813
+ * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
814
+ *
815
+ * ```js
816
+ * import util from 'node:util';
817
+ *
818
+ * util.isSymbol(5);
819
+ * // Returns: false
820
+ * util.isSymbol('foo');
821
+ * // Returns: false
822
+ * util.isSymbol(Symbol('foo'));
823
+ * // Returns: true
824
+ * ```
825
+ * @since v0.11.5
826
+ * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead.
827
+ */
828
+ export function isSymbol(object: unknown): object is symbol;
829
+ /**
830
+ * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
831
+ *
832
+ * ```js
833
+ * import util from 'node:util';
834
+ *
835
+ * const foo = undefined;
836
+ * util.isUndefined(5);
837
+ * // Returns: false
838
+ * util.isUndefined(foo);
839
+ * // Returns: true
840
+ * util.isUndefined(null);
841
+ * // Returns: false
842
+ * ```
843
+ * @since v0.11.5
844
+ * @deprecated Since v4.0.0 - Use `value === undefined` instead.
845
+ */
846
+ export function isUndefined(object: unknown): object is undefined;
847
+ /**
848
+ * The `util.deprecate()` method wraps `fn` (which may be a function or class) in
849
+ * such a way that it is marked as deprecated.
850
+ *
851
+ * ```js
852
+ * import util from 'node:util';
853
+ *
854
+ * exports.obsoleteFunction = util.deprecate(() => {
855
+ * // Do something here.
856
+ * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
857
+ * ```
858
+ *
859
+ * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will
860
+ * be emitted and printed to `stderr` the first time the returned function is
861
+ * called. After the warning is emitted, the wrapped function is called without
862
+ * emitting a warning.
863
+ *
864
+ * If the same optional `code` is supplied in multiple calls to `util.deprecate()`,
865
+ * the warning will be emitted only once for that `code`.
866
+ *
867
+ * ```js
868
+ * import util from 'node:util';
869
+ *
870
+ * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001');
871
+ * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001');
872
+ * fn1(); // Emits a deprecation warning with code DEP0001
873
+ * fn2(); // Does not emit a deprecation warning because it has the same code
874
+ * ```
875
+ *
876
+ * If either the `--no-deprecation` or `--no-warnings` command-line flags are
877
+ * used, or if the `process.noDeprecation` property is set to `true`_prior_ to
878
+ * the first deprecation warning, the `util.deprecate()` method does nothing.
879
+ *
880
+ * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
881
+ * or the `process.traceDeprecation` property is set to `true`, a warning and a
882
+ * stack trace are printed to `stderr` the first time the deprecated function is
883
+ * called.
884
+ *
885
+ * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be
886
+ * thrown when the deprecated function is called.
887
+ *
888
+ * The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`.
889
+ * @since v0.8.0
890
+ * @param fn The function that is being deprecated.
891
+ * @param msg A warning message to display when the deprecated function is invoked.
892
+ * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
893
+ * @return The deprecated function wrapped to emit a warning.
894
+ */
895
+ export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
896
+ /**
897
+ * Returns `true` if there is deep strict equality between `val1` and `val2`.
898
+ * Otherwise, returns `false`.
899
+ *
900
+ * See `assert.deepStrictEqual()` for more information about deep strict
901
+ * equality.
902
+ * @since v9.0.0
903
+ */
904
+ export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
905
+ /**
906
+ * Returns `str` with any ANSI escape codes removed.
907
+ *
908
+ * ```js
909
+ * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m'));
910
+ * // Prints "value"
911
+ * ```
912
+ * @since v16.11.0
913
+ */
914
+ export function stripVTControlCharacters(str: string): string;
915
+ /**
916
+ * Takes an `async` function (or a function that returns a `Promise`) and returns a
917
+ * function following the error-first callback style, i.e. taking
918
+ * an `(err, value) => ...` callback as the last argument. In the callback, the
919
+ * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value.
920
+ *
921
+ * ```js
922
+ * import util from 'node:util';
923
+ *
924
+ * async function fn() {
925
+ * return 'hello world';
926
+ * }
927
+ * const callbackFunction = util.callbackify(fn);
928
+ *
929
+ * callbackFunction((err, ret) => {
930
+ * if (err) throw err;
931
+ * console.log(ret);
932
+ * });
933
+ * ```
934
+ *
935
+ * Will print:
936
+ *
937
+ * ```text
938
+ * hello world
939
+ * ```
940
+ *
941
+ * The callback is executed asynchronously, and will have a limited stack trace.
942
+ * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit.
943
+ *
944
+ * Since `null` has a special meaning as the first argument to a callback, if a
945
+ * wrapped function rejects a `Promise` with a falsy value as a reason, the value
946
+ * is wrapped in an `Error` with the original value stored in a field named`reason`.
947
+ *
948
+ * ```js
949
+ * function fn() {
950
+ * return Promise.reject(null);
951
+ * }
952
+ * const callbackFunction = util.callbackify(fn);
953
+ *
954
+ * callbackFunction((err, ret) => {
955
+ * // When the Promise was rejected with `null` it is wrapped with an Error and
956
+ * // the original value is stored in `reason`.
957
+ * err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null; // true
958
+ * });
959
+ * ```
960
+ * @since v8.2.0
961
+ * @param fn An `async` function
962
+ * @return a callback style function
963
+ */
964
+ export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
965
+ export function callbackify<TResult>(
966
+ fn: () => Promise<TResult>,
967
+ ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
968
+ export function callbackify<T1>(
969
+ fn: (arg1: T1) => Promise<void>,
970
+ ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
971
+ export function callbackify<T1, TResult>(
972
+ fn: (arg1: T1) => Promise<TResult>,
973
+ ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
974
+ export function callbackify<T1, T2>(
975
+ fn: (arg1: T1, arg2: T2) => Promise<void>,
976
+ ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
977
+ export function callbackify<T1, T2, TResult>(
978
+ fn: (arg1: T1, arg2: T2) => Promise<TResult>,
979
+ ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
980
+ export function callbackify<T1, T2, T3>(
981
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>,
982
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
983
+ export function callbackify<T1, T2, T3, TResult>(
984
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>,
985
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
986
+ export function callbackify<T1, T2, T3, T4>(
987
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>,
988
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
989
+ export function callbackify<T1, T2, T3, T4, TResult>(
990
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>,
991
+ ): (
992
+ arg1: T1,
993
+ arg2: T2,
994
+ arg3: T3,
995
+ arg4: T4,
996
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
997
+ ) => void;
998
+ export function callbackify<T1, T2, T3, T4, T5>(
999
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>,
1000
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
1001
+ export function callbackify<T1, T2, T3, T4, T5, TResult>(
1002
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
1003
+ ): (
1004
+ arg1: T1,
1005
+ arg2: T2,
1006
+ arg3: T3,
1007
+ arg4: T4,
1008
+ arg5: T5,
1009
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
1010
+ ) => void;
1011
+ export function callbackify<T1, T2, T3, T4, T5, T6>(
1012
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
1013
+ ): (
1014
+ arg1: T1,
1015
+ arg2: T2,
1016
+ arg3: T3,
1017
+ arg4: T4,
1018
+ arg5: T5,
1019
+ arg6: T6,
1020
+ callback: (err: NodeJS.ErrnoException) => void,
1021
+ ) => void;
1022
+ export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
1023
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>,
1024
+ ): (
1025
+ arg1: T1,
1026
+ arg2: T2,
1027
+ arg3: T3,
1028
+ arg4: T4,
1029
+ arg5: T5,
1030
+ arg6: T6,
1031
+ callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
1032
+ ) => void;
1033
+ export interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
1034
+ __promisify__: TCustom;
1035
+ }
1036
+ export interface CustomPromisifySymbol<TCustom extends Function> extends Function {
1037
+ [promisify.custom]: TCustom;
1038
+ }
1039
+ export type CustomPromisify<TCustom extends Function> =
1040
+ | CustomPromisifySymbol<TCustom>
1041
+ | CustomPromisifyLegacy<TCustom>;
1042
+ /**
1043
+ * Takes a function following the common error-first callback style, i.e. taking
1044
+ * an `(err, value) => ...` callback as the last argument, and returns a version
1045
+ * that returns promises.
1046
+ *
1047
+ * ```js
1048
+ * import util from 'node:util';
1049
+ * import fs from 'node:fs';
1050
+ *
1051
+ * const stat = util.promisify(fs.stat);
1052
+ * stat('.').then((stats) => {
1053
+ * // Do something with `stats`
1054
+ * }).catch((error) => {
1055
+ * // Handle the error.
1056
+ * });
1057
+ * ```
1058
+ *
1059
+ * Or, equivalently using `async function`s:
1060
+ *
1061
+ * ```js
1062
+ * import util from 'node:util';
1063
+ * import fs from 'node:fs';
1064
+ *
1065
+ * const stat = util.promisify(fs.stat);
1066
+ *
1067
+ * async function callStat() {
1068
+ * const stats = await stat('.');
1069
+ * console.log(`This directory is owned by ${stats.uid}`);
1070
+ * }
1071
+ * ```
1072
+ *
1073
+ * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`.
1074
+ *
1075
+ * `promisify()` assumes that `original` is a function taking a callback as its
1076
+ * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not
1077
+ * an error-first callback, it will still be passed an error-first
1078
+ * callback as its last argument.
1079
+ *
1080
+ * Using `promisify()` on class methods or other methods that use `this` may not
1081
+ * work as expected unless handled specially:
1082
+ *
1083
+ * ```js
1084
+ * import util from 'node:util';
1085
+ *
1086
+ * class Foo {
1087
+ * constructor() {
1088
+ * this.a = 42;
1089
+ * }
1090
+ *
1091
+ * bar(callback) {
1092
+ * callback(null, this.a);
1093
+ * }
1094
+ * }
1095
+ *
1096
+ * const foo = new Foo();
1097
+ *
1098
+ * const naiveBar = util.promisify(foo.bar);
1099
+ * // TypeError: Cannot read property 'a' of undefined
1100
+ * // naiveBar().then(a => console.log(a));
1101
+ *
1102
+ * naiveBar.call(foo).then((a) => console.log(a)); // '42'
1103
+ *
1104
+ * const bindBar = naiveBar.bind(foo);
1105
+ * bindBar().then((a) => console.log(a)); // '42'
1106
+ * ```
1107
+ * @since v8.0.0
1108
+ */
1109
+ export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
1110
+ export function promisify<TResult>(
1111
+ fn: (callback: (err: any, result: TResult) => void) => void,
1112
+ ): () => Promise<TResult>;
1113
+ export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
1114
+ export function promisify<T1, TResult>(
1115
+ fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void,
1116
+ ): (arg1: T1) => Promise<TResult>;
1117
+ export function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
1118
+ export function promisify<T1, T2, TResult>(
1119
+ fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void,
1120
+ ): (arg1: T1, arg2: T2) => Promise<TResult>;
1121
+ export function promisify<T1, T2>(
1122
+ fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void,
1123
+ ): (arg1: T1, arg2: T2) => Promise<void>;
1124
+ export function promisify<T1, T2, T3, TResult>(
1125
+ fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void,
1126
+ ): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
1127
+ export function promisify<T1, T2, T3>(
1128
+ fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void,
1129
+ ): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
1130
+ export function promisify<T1, T2, T3, T4, TResult>(
1131
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
1132
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
1133
+ export function promisify<T1, T2, T3, T4>(
1134
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void,
1135
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
1136
+ export function promisify<T1, T2, T3, T4, T5, TResult>(
1137
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
1138
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
1139
+ export function promisify<T1, T2, T3, T4, T5>(
1140
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
1141
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
1142
+ export function promisify(fn: Function): Function;
1143
+ export namespace promisify {
1144
+ /**
1145
+ * That can be used to declare custom promisified variants of functions.
1146
+ */
1147
+ const custom: unique symbol;
1148
+ }
1149
+ /**
1150
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
1151
+ *
1152
+ * ```js
1153
+ * const decoder = new TextDecoder();
1154
+ * const u8arr = new Uint8Array([72, 101, 108, 108, 111]);
1155
+ * console.log(decoder.decode(u8arr)); // Hello
1156
+ * ```
1157
+ * @since v8.3.0
1158
+ */
1159
+ export class TextDecoder {
1160
+ /**
1161
+ * The encoding supported by the `TextDecoder` instance.
1162
+ */
1163
+ readonly encoding: string;
1164
+ /**
1165
+ * The value will be `true` if decoding errors result in a `TypeError` being
1166
+ * thrown.
1167
+ */
1168
+ readonly fatal: boolean;
1169
+ /**
1170
+ * The value will be `true` if the decoding result will include the byte order
1171
+ * mark.
1172
+ */
1173
+ readonly ignoreBOM: boolean;
1174
+ constructor(
1175
+ encoding?: string,
1176
+ options?: {
1177
+ fatal?: boolean | undefined;
1178
+ ignoreBOM?: boolean | undefined;
1179
+ },
1180
+ );
1181
+ /**
1182
+ * Decodes the `input` and returns a string. If `options.stream` is `true`, any
1183
+ * incomplete byte sequences occurring at the end of the `input` are buffered
1184
+ * internally and emitted after the next call to `textDecoder.decode()`.
1185
+ *
1186
+ * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown.
1187
+ * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data.
1188
+ */
1189
+ decode(
1190
+ input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
1191
+ options?: {
1192
+ stream?: boolean | undefined;
1193
+ },
1194
+ ): string;
1195
+ }
1196
+ export interface EncodeIntoResult {
1197
+ /**
1198
+ * The read Unicode code units of input.
1199
+ */
1200
+ read: number;
1201
+ /**
1202
+ * The written UTF-8 bytes of output.
1203
+ */
1204
+ written: number;
1205
+ }
1206
+ export { types };
1207
+
1208
+ //// TextEncoder/Decoder
1209
+ /**
1210
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
1211
+ * instances of `TextEncoder` only support UTF-8 encoding.
1212
+ *
1213
+ * ```js
1214
+ * const encoder = new TextEncoder();
1215
+ * const uint8array = encoder.encode('this is some data');
1216
+ * ```
1217
+ *
1218
+ * The `TextEncoder` class is also available on the global object.
1219
+ * @since v8.3.0
1220
+ */
1221
+ export class TextEncoder {
1222
+ /**
1223
+ * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
1224
+ */
1225
+ readonly encoding: string;
1226
+ /**
1227
+ * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
1228
+ * encoded bytes.
1229
+ * @param [input='an empty string'] The text to encode.
1230
+ */
1231
+ encode(input?: string): Uint8Array;
1232
+ /**
1233
+ * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
1234
+ * containing the read Unicode code units and written UTF-8 bytes.
1235
+ *
1236
+ * ```js
1237
+ * const encoder = new TextEncoder();
1238
+ * const src = 'this is some data';
1239
+ * const dest = new Uint8Array(10);
1240
+ * const { read, written } = encoder.encodeInto(src, dest);
1241
+ * ```
1242
+ * @param src The text to encode.
1243
+ * @param dest The array to hold the encode result.
1244
+ */
1245
+ encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
1246
+ }
1247
+
1248
+ import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util";
1249
+ global {
1250
+ /**
1251
+ * `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'`
1252
+ * https://nodejs.org/api/globals.html#textdecoder
1253
+ * @since v11.0.0
1254
+ */
1255
+ var TextDecoder: typeof globalThis extends {
1256
+ onmessage: any;
1257
+ TextDecoder: infer TextDecoder;
1258
+ } ? TextDecoder
1259
+ : typeof _TextDecoder;
1260
+
1261
+ /**
1262
+ * `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'`
1263
+ * https://nodejs.org/api/globals.html#textencoder
1264
+ * @since v11.0.0
1265
+ */
1266
+ var TextEncoder: typeof globalThis extends {
1267
+ onmessage: any;
1268
+ TextEncoder: infer TextEncoder;
1269
+ } ? TextEncoder
1270
+ : typeof _TextEncoder;
1271
+ }
1272
+
1273
+ //// parseArgs
1274
+ /**
1275
+ * Provides a high-level API for command-line argument parsing. Takes a
1276
+ * specification for the expected arguments and returns a structured object
1277
+ * with the parsed values and positionals.
1278
+ *
1279
+ * `config` provides arguments for parsing and configures the parser. It
1280
+ * supports the following properties:
1281
+ *
1282
+ * - `args` The array of argument strings. **Default:** `process.argv` with
1283
+ * `execPath` and `filename` removed.
1284
+ * - `options` Arguments known to the parser. Keys of `options` are the long
1285
+ * names of options and values are objects accepting the following properties:
1286
+ *
1287
+ * - `type` Type of argument, which must be either `boolean` (for options
1288
+ * which do not take values) or `string` (for options which do).
1289
+ * - `multiple` Whether this option can be provided multiple
1290
+ * times. If `true`, all values will be collected in an array. If
1291
+ * `false`, values for the option are last-wins. **Default:** `false`.
1292
+ * - `short` A single character alias for the option.
1293
+ * - `default` The default option value when it is not set by args. It
1294
+ * must be of the same type as the `type` property. When `multiple`
1295
+ * is `true`, it must be an array.
1296
+ *
1297
+ * - `strict`: Whether an error should be thrown when unknown arguments
1298
+ * are encountered, or when arguments are passed that do not match the
1299
+ * `type` configured in `options`. **Default:** `true`.
1300
+ * - `allowPositionals`: Whether this command accepts positional arguments.
1301
+ * **Default:** `false` if `strict` is `true`, otherwise `true`.
1302
+ * - `tokens`: Whether tokens {boolean} Return the parsed tokens. This is useful
1303
+ * for extending the built-in behavior, from adding additional checks through
1304
+ * to reprocessing the tokens in different ways.
1305
+ * **Default:** `false`.
1306
+ *
1307
+ * @returns The parsed command line arguments:
1308
+ *
1309
+ * - `values` A mapping of parsed option names with their string
1310
+ * or boolean values.
1311
+ * - `positionals` Positional arguments.
1312
+ * - `tokens` Detailed parse information (only if `tokens` was specified).
1313
+ */
1314
+ export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
1315
+
1316
+ interface ParseArgsOptionConfig {
1317
+ /**
1318
+ * Type of argument.
1319
+ */
1320
+ type: "string" | "boolean";
1321
+ /**
1322
+ * Whether this option can be provided multiple times.
1323
+ * If `true`, all values will be collected in an array.
1324
+ * If `false`, values for the option are last-wins.
1325
+ * @default false.
1326
+ */
1327
+ multiple?: boolean | undefined;
1328
+ /**
1329
+ * A single character alias for the option.
1330
+ */
1331
+ short?: string | undefined;
1332
+ /**
1333
+ * The default option value when it is not set by args.
1334
+ * It must be of the same type as the the `type` property.
1335
+ * When `multiple` is `true`, it must be an array.
1336
+ * @since v18.11.0
1337
+ */
1338
+ default?: string | boolean | string[] | boolean[] | undefined;
1339
+ }
1340
+
1341
+ interface ParseArgsOptionsConfig {
1342
+ [longOption: string]: ParseArgsOptionConfig;
1343
+ }
1344
+
1345
+ export interface ParseArgsConfig {
1346
+ /**
1347
+ * Array of argument strings.
1348
+ */
1349
+ args?: string[] | undefined;
1350
+ /**
1351
+ * Used to describe arguments known to the parser.
1352
+ */
1353
+ options?: ParseArgsOptionsConfig | undefined;
1354
+ /**
1355
+ * Should an error be thrown when unknown arguments are encountered,
1356
+ * or when arguments are passed that do not match the `type` configured in `options`.
1357
+ * @default true
1358
+ */
1359
+ strict?: boolean | undefined;
1360
+ /**
1361
+ * Whether this command accepts positional arguments.
1362
+ */
1363
+ allowPositionals?: boolean | undefined;
1364
+ /**
1365
+ * Return the parsed tokens. This is useful for extending the built-in behavior,
1366
+ * from adding additional checks through to reprocessing the tokens in different ways.
1367
+ * @default false
1368
+ */
1369
+ tokens?: boolean | undefined;
1370
+ }
1371
+
1372
+ /*
1373
+ IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties.
1374
+ TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936
1375
+ This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present".
1376
+ But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present.
1377
+ So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value.
1378
+ This is technically incorrect but is a much nicer UX for the common case.
1379
+ The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false.
1380
+ */
1381
+ type IfDefaultsTrue<T, IfTrue, IfFalse> = T extends true ? IfTrue
1382
+ : T extends false ? IfFalse
1383
+ : IfTrue;
1384
+
1385
+ // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false`
1386
+ type IfDefaultsFalse<T, IfTrue, IfFalse> = T extends false ? IfFalse
1387
+ : T extends true ? IfTrue
1388
+ : IfFalse;
1389
+
1390
+ type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionConfig> = IfDefaultsTrue<
1391
+ T["strict"],
1392
+ O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
1393
+ string | boolean
1394
+ >;
1395
+
1396
+ type ApplyOptionalModifiers<O extends ParseArgsOptionsConfig, V extends Record<keyof O, unknown>> = (
1397
+ & { -readonly [LongOption in keyof O]?: V[LongOption] }
1398
+ & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] }
1399
+ ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object
1400
+
1401
+ type ParsedValues<T extends ParseArgsConfig> =
1402
+ & IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
1403
+ & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers<
1404
+ T["options"],
1405
+ {
1406
+ [LongOption in keyof T["options"]]: IfDefaultsFalse<
1407
+ T["options"][LongOption]["multiple"],
1408
+ Array<ExtractOptionValue<T, T["options"][LongOption]>>,
1409
+ ExtractOptionValue<T, T["options"][LongOption]>
1410
+ >;
1411
+ }
1412
+ >
1413
+ : {});
1414
+
1415
+ type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<
1416
+ T["strict"],
1417
+ IfDefaultsFalse<T["allowPositionals"], string[], []>,
1418
+ IfDefaultsTrue<T["allowPositionals"], string[], []>
1419
+ >;
1420
+
1421
+ type PreciseTokenForOptions<
1422
+ K extends string,
1423
+ O extends ParseArgsOptionConfig,
1424
+ > = O["type"] extends "string" ? {
1425
+ kind: "option";
1426
+ index: number;
1427
+ name: K;
1428
+ rawName: string;
1429
+ value: string;
1430
+ inlineValue: boolean;
1431
+ }
1432
+ : O["type"] extends "boolean" ? {
1433
+ kind: "option";
1434
+ index: number;
1435
+ name: K;
1436
+ rawName: string;
1437
+ value: undefined;
1438
+ inlineValue: undefined;
1439
+ }
1440
+ : OptionToken & { name: K };
1441
+
1442
+ type TokenForOptions<
1443
+ T extends ParseArgsConfig,
1444
+ K extends keyof T["options"] = keyof T["options"],
1445
+ > = K extends unknown
1446
+ ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions<K & string, T["options"][K]>
1447
+ : OptionToken
1448
+ : never;
1449
+
1450
+ type ParsedOptionToken<T extends ParseArgsConfig> = IfDefaultsTrue<T["strict"], TokenForOptions<T>, OptionToken>;
1451
+
1452
+ type ParsedPositionalToken<T extends ParseArgsConfig> = IfDefaultsTrue<
1453
+ T["strict"],
1454
+ IfDefaultsFalse<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>,
1455
+ IfDefaultsTrue<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>
1456
+ >;
1457
+
1458
+ type ParsedTokens<T extends ParseArgsConfig> = Array<
1459
+ ParsedOptionToken<T> | ParsedPositionalToken<T> | { kind: "option-terminator"; index: number }
1460
+ >;
1461
+
1462
+ type PreciseParsedResults<T extends ParseArgsConfig> = IfDefaultsFalse<
1463
+ T["tokens"],
1464
+ {
1465
+ values: ParsedValues<T>;
1466
+ positionals: ParsedPositionals<T>;
1467
+ tokens: ParsedTokens<T>;
1468
+ },
1469
+ {
1470
+ values: ParsedValues<T>;
1471
+ positionals: ParsedPositionals<T>;
1472
+ }
1473
+ >;
1474
+
1475
+ type OptionToken =
1476
+ | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean }
1477
+ | {
1478
+ kind: "option";
1479
+ index: number;
1480
+ name: string;
1481
+ rawName: string;
1482
+ value: undefined;
1483
+ inlineValue: undefined;
1484
+ };
1485
+
1486
+ type Token =
1487
+ | OptionToken
1488
+ | { kind: "positional"; index: number; value: string }
1489
+ | { kind: "option-terminator"; index: number };
1490
+
1491
+ // If ParseArgsConfig extends T, then the user passed config constructed elsewhere.
1492
+ // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above.
1493
+ type ParsedResults<T extends ParseArgsConfig> = ParseArgsConfig extends T ? {
1494
+ values: { [longOption: string]: undefined | string | boolean | Array<string | boolean> };
1495
+ positionals: string[];
1496
+ tokens?: Token[];
1497
+ }
1498
+ : PreciseParsedResults<T>;
1499
+
1500
+ /**
1501
+ * @since v18.13.0
1502
+ */
1503
+ export class MIMEType {
1504
+ /**
1505
+ * Creates a new MIMEType object by parsing the input.
1506
+ *
1507
+ * A `TypeError` will be thrown if the `input` is not a valid MIME.
1508
+ * Note that an effort will be made to coerce the given values into strings.
1509
+ * @param input The input MIME to parse.
1510
+ */
1511
+ constructor(input: string | { toString: () => string });
1512
+
1513
+ /**
1514
+ * Gets and sets the type portion of the MIME.
1515
+ */
1516
+ type: string;
1517
+
1518
+ /**
1519
+ * Gets and sets the subtype portion of the MIME.
1520
+ */
1521
+ subtype: string;
1522
+
1523
+ /**
1524
+ * Gets the essence of the MIME.
1525
+ *
1526
+ * Use `mime.type` or `mime.subtype` to alter the MIME.
1527
+ */
1528
+ readonly essence: string;
1529
+
1530
+ /**
1531
+ * Gets the `MIMEParams` object representing the parameters of the MIME.
1532
+ */
1533
+ readonly params: MIMEParams;
1534
+
1535
+ /**
1536
+ * Returns the serialized MIME.
1537
+ *
1538
+ * Because of the need for standard compliance, this method
1539
+ * does not allow users to customize the serialization process of the MIME.
1540
+ */
1541
+ toString(): string;
1542
+ }
1543
+
1544
+ /**
1545
+ * @since v18.13.0
1546
+ */
1547
+ export class MIMEParams {
1548
+ /**
1549
+ * Remove all name-value pairs whose name is `name`.
1550
+ */
1551
+ delete(name: string): void;
1552
+ /**
1553
+ * Returns an iterator over each of the name-value pairs in the parameters.
1554
+ */
1555
+ entries(): NodeJS.Iterator<[name: string, value: string]>;
1556
+ /**
1557
+ * Returns the value of the first name-value pair whose name is `name`.
1558
+ * If there are no such pairs, `null` is returned.
1559
+ */
1560
+ get(name: string): string | null;
1561
+ /**
1562
+ * Returns `true` if there is at least one name-value pair whose name is `name`.
1563
+ */
1564
+ has(name: string): boolean;
1565
+ /**
1566
+ * Returns an iterator over the names of each name-value pair.
1567
+ */
1568
+ keys(): NodeJS.Iterator<string>;
1569
+ /**
1570
+ * Sets the value in the `MIMEParams` object associated with `name` to `value`.
1571
+ * If there are any pre-existing name-value pairs whose names are `name`,
1572
+ * set the first such pair's value to `value`.
1573
+ */
1574
+ set(name: string, value: string): void;
1575
+ /**
1576
+ * Returns an iterator over the values of each name-value pair.
1577
+ */
1578
+ values(): NodeJS.Iterator<string>;
1579
+ /**
1580
+ * Returns an iterator over each of the name-value pairs in the parameters.
1581
+ */
1582
+ [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>;
1583
+ }
1584
+ }
1585
+ declare module "util/types" {
1586
+ import { KeyObject, webcrypto } from "node:crypto";
1587
+ /**
1588
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
1589
+ * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
1590
+ *
1591
+ * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
1592
+ *
1593
+ * ```js
1594
+ * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
1595
+ * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
1596
+ * ```
1597
+ * @since v10.0.0
1598
+ */
1599
+ function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
1600
+ /**
1601
+ * Returns `true` if the value is an `arguments` object.
1602
+ *
1603
+ * ```js
1604
+ * function foo() {
1605
+ * util.types.isArgumentsObject(arguments); // Returns true
1606
+ * }
1607
+ * ```
1608
+ * @since v10.0.0
1609
+ */
1610
+ function isArgumentsObject(object: unknown): object is IArguments;
1611
+ /**
1612
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
1613
+ * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is
1614
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
1615
+ *
1616
+ * ```js
1617
+ * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true
1618
+ * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
1619
+ * ```
1620
+ * @since v10.0.0
1621
+ */
1622
+ function isArrayBuffer(object: unknown): object is ArrayBuffer;
1623
+ /**
1624
+ * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
1625
+ * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
1626
+ * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
1627
+ *
1628
+ * ```js
1629
+ * util.types.isArrayBufferView(new Int8Array()); // true
1630
+ * util.types.isArrayBufferView(Buffer.from('hello world')); // true
1631
+ * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
1632
+ * util.types.isArrayBufferView(new ArrayBuffer()); // false
1633
+ * ```
1634
+ * @since v10.0.0
1635
+ */
1636
+ function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
1637
+ /**
1638
+ * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
1639
+ * This only reports back what the JavaScript engine is seeing;
1640
+ * in particular, the return value may not match the original source code if
1641
+ * a transpilation tool was used.
1642
+ *
1643
+ * ```js
1644
+ * util.types.isAsyncFunction(function foo() {}); // Returns false
1645
+ * util.types.isAsyncFunction(async function foo() {}); // Returns true
1646
+ * ```
1647
+ * @since v10.0.0
1648
+ */
1649
+ function isAsyncFunction(object: unknown): boolean;
1650
+ /**
1651
+ * Returns `true` if the value is a `BigInt64Array` instance.
1652
+ *
1653
+ * ```js
1654
+ * util.types.isBigInt64Array(new BigInt64Array()); // Returns true
1655
+ * util.types.isBigInt64Array(new BigUint64Array()); // Returns false
1656
+ * ```
1657
+ * @since v10.0.0
1658
+ */
1659
+ function isBigInt64Array(value: unknown): value is BigInt64Array;
1660
+ /**
1661
+ * Returns `true` if the value is a `BigUint64Array` instance.
1662
+ *
1663
+ * ```js
1664
+ * util.types.isBigUint64Array(new BigInt64Array()); // Returns false
1665
+ * util.types.isBigUint64Array(new BigUint64Array()); // Returns true
1666
+ * ```
1667
+ * @since v10.0.0
1668
+ */
1669
+ function isBigUint64Array(value: unknown): value is BigUint64Array;
1670
+ /**
1671
+ * Returns `true` if the value is a boolean object, e.g. created
1672
+ * by `new Boolean()`.
1673
+ *
1674
+ * ```js
1675
+ * util.types.isBooleanObject(false); // Returns false
1676
+ * util.types.isBooleanObject(true); // Returns false
1677
+ * util.types.isBooleanObject(new Boolean(false)); // Returns true
1678
+ * util.types.isBooleanObject(new Boolean(true)); // Returns true
1679
+ * util.types.isBooleanObject(Boolean(false)); // Returns false
1680
+ * util.types.isBooleanObject(Boolean(true)); // Returns false
1681
+ * ```
1682
+ * @since v10.0.0
1683
+ */
1684
+ function isBooleanObject(object: unknown): object is Boolean;
1685
+ /**
1686
+ * Returns `true` if the value is any boxed primitive object, e.g. created
1687
+ * by `new Boolean()`, `new String()` or `Object(Symbol())`.
1688
+ *
1689
+ * For example:
1690
+ *
1691
+ * ```js
1692
+ * util.types.isBoxedPrimitive(false); // Returns false
1693
+ * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true
1694
+ * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false
1695
+ * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true
1696
+ * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true
1697
+ * ```
1698
+ * @since v10.11.0
1699
+ */
1700
+ function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
1701
+ /**
1702
+ * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance.
1703
+ *
1704
+ * ```js
1705
+ * const ab = new ArrayBuffer(20);
1706
+ * util.types.isDataView(new DataView(ab)); // Returns true
1707
+ * util.types.isDataView(new Float64Array()); // Returns false
1708
+ * ```
1709
+ *
1710
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
1711
+ * @since v10.0.0
1712
+ */
1713
+ function isDataView(object: unknown): object is DataView;
1714
+ /**
1715
+ * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
1716
+ *
1717
+ * ```js
1718
+ * util.types.isDate(new Date()); // Returns true
1719
+ * ```
1720
+ * @since v10.0.0
1721
+ */
1722
+ function isDate(object: unknown): object is Date;
1723
+ /**
1724
+ * Returns `true` if the value is a native `External` value.
1725
+ *
1726
+ * A native `External` value is a special type of object that contains a
1727
+ * raw C++ pointer (`void*`) for access from native code, and has no other
1728
+ * properties. Such objects are created either by Node.js internals or native
1729
+ * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype.
1730
+ *
1731
+ * ```c
1732
+ * #include <js_native_api.h>
1733
+ * #include <stdlib.h>
1734
+ * napi_value result;
1735
+ * static napi_value MyNapi(napi_env env, napi_callback_info info) {
1736
+ * int* raw = (int*) malloc(1024);
1737
+ * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result);
1738
+ * if (status != napi_ok) {
1739
+ * napi_throw_error(env, NULL, "napi_create_external failed");
1740
+ * return NULL;
1741
+ * }
1742
+ * return result;
1743
+ * }
1744
+ * ...
1745
+ * DECLARE_NAPI_PROPERTY("myNapi", MyNapi)
1746
+ * ...
1747
+ * ```
1748
+ *
1749
+ * ```js
1750
+ * const native = require('napi_addon.node');
1751
+ * const data = native.myNapi();
1752
+ * util.types.isExternal(data); // returns true
1753
+ * util.types.isExternal(0); // returns false
1754
+ * util.types.isExternal(new String('foo')); // returns false
1755
+ * ```
1756
+ *
1757
+ * For further information on `napi_create_external`, refer to `napi_create_external()`.
1758
+ * @since v10.0.0
1759
+ */
1760
+ function isExternal(object: unknown): boolean;
1761
+ /**
1762
+ * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
1763
+ *
1764
+ * ```js
1765
+ * util.types.isFloat32Array(new ArrayBuffer()); // Returns false
1766
+ * util.types.isFloat32Array(new Float32Array()); // Returns true
1767
+ * util.types.isFloat32Array(new Float64Array()); // Returns false
1768
+ * ```
1769
+ * @since v10.0.0
1770
+ */
1771
+ function isFloat32Array(object: unknown): object is Float32Array;
1772
+ /**
1773
+ * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance.
1774
+ *
1775
+ * ```js
1776
+ * util.types.isFloat64Array(new ArrayBuffer()); // Returns false
1777
+ * util.types.isFloat64Array(new Uint8Array()); // Returns false
1778
+ * util.types.isFloat64Array(new Float64Array()); // Returns true
1779
+ * ```
1780
+ * @since v10.0.0
1781
+ */
1782
+ function isFloat64Array(object: unknown): object is Float64Array;
1783
+ /**
1784
+ * Returns `true` if the value is a generator function.
1785
+ * This only reports back what the JavaScript engine is seeing;
1786
+ * in particular, the return value may not match the original source code if
1787
+ * a transpilation tool was used.
1788
+ *
1789
+ * ```js
1790
+ * util.types.isGeneratorFunction(function foo() {}); // Returns false
1791
+ * util.types.isGeneratorFunction(function* foo() {}); // Returns true
1792
+ * ```
1793
+ * @since v10.0.0
1794
+ */
1795
+ function isGeneratorFunction(object: unknown): object is GeneratorFunction;
1796
+ /**
1797
+ * Returns `true` if the value is a generator object as returned from a
1798
+ * built-in generator function.
1799
+ * This only reports back what the JavaScript engine is seeing;
1800
+ * in particular, the return value may not match the original source code if
1801
+ * a transpilation tool was used.
1802
+ *
1803
+ * ```js
1804
+ * function* foo() {}
1805
+ * const generator = foo();
1806
+ * util.types.isGeneratorObject(generator); // Returns true
1807
+ * ```
1808
+ * @since v10.0.0
1809
+ */
1810
+ function isGeneratorObject(object: unknown): object is Generator;
1811
+ /**
1812
+ * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance.
1813
+ *
1814
+ * ```js
1815
+ * util.types.isInt8Array(new ArrayBuffer()); // Returns false
1816
+ * util.types.isInt8Array(new Int8Array()); // Returns true
1817
+ * util.types.isInt8Array(new Float64Array()); // Returns false
1818
+ * ```
1819
+ * @since v10.0.0
1820
+ */
1821
+ function isInt8Array(object: unknown): object is Int8Array;
1822
+ /**
1823
+ * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance.
1824
+ *
1825
+ * ```js
1826
+ * util.types.isInt16Array(new ArrayBuffer()); // Returns false
1827
+ * util.types.isInt16Array(new Int16Array()); // Returns true
1828
+ * util.types.isInt16Array(new Float64Array()); // Returns false
1829
+ * ```
1830
+ * @since v10.0.0
1831
+ */
1832
+ function isInt16Array(object: unknown): object is Int16Array;
1833
+ /**
1834
+ * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance.
1835
+ *
1836
+ * ```js
1837
+ * util.types.isInt32Array(new ArrayBuffer()); // Returns false
1838
+ * util.types.isInt32Array(new Int32Array()); // Returns true
1839
+ * util.types.isInt32Array(new Float64Array()); // Returns false
1840
+ * ```
1841
+ * @since v10.0.0
1842
+ */
1843
+ function isInt32Array(object: unknown): object is Int32Array;
1844
+ /**
1845
+ * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
1846
+ *
1847
+ * ```js
1848
+ * util.types.isMap(new Map()); // Returns true
1849
+ * ```
1850
+ * @since v10.0.0
1851
+ */
1852
+ function isMap<T>(
1853
+ object: T | {},
1854
+ ): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>)
1855
+ : Map<unknown, unknown>;
1856
+ /**
1857
+ * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
1858
+ *
1859
+ * ```js
1860
+ * const map = new Map();
1861
+ * util.types.isMapIterator(map.keys()); // Returns true
1862
+ * util.types.isMapIterator(map.values()); // Returns true
1863
+ * util.types.isMapIterator(map.entries()); // Returns true
1864
+ * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
1865
+ * ```
1866
+ * @since v10.0.0
1867
+ */
1868
+ function isMapIterator(object: unknown): boolean;
1869
+ /**
1870
+ * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects).
1871
+ *
1872
+ * ```js
1873
+ * import * as ns from './a.js';
1874
+ *
1875
+ * util.types.isModuleNamespaceObject(ns); // Returns true
1876
+ * ```
1877
+ * @since v10.0.0
1878
+ */
1879
+ function isModuleNamespaceObject(value: unknown): boolean;
1880
+ /**
1881
+ * Returns `true` if the value is an instance of a built-in `Error` type.
1882
+ *
1883
+ * ```js
1884
+ * util.types.isNativeError(new Error()); // Returns true
1885
+ * util.types.isNativeError(new TypeError()); // Returns true
1886
+ * util.types.isNativeError(new RangeError()); // Returns true
1887
+ * ```
1888
+ * @since v10.0.0
1889
+ */
1890
+ function isNativeError(object: unknown): object is Error;
1891
+ /**
1892
+ * Returns `true` if the value is a number object, e.g. created
1893
+ * by `new Number()`.
1894
+ *
1895
+ * ```js
1896
+ * util.types.isNumberObject(0); // Returns false
1897
+ * util.types.isNumberObject(new Number(0)); // Returns true
1898
+ * ```
1899
+ * @since v10.0.0
1900
+ */
1901
+ function isNumberObject(object: unknown): object is Number;
1902
+ /**
1903
+ * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
1904
+ *
1905
+ * ```js
1906
+ * util.types.isPromise(Promise.resolve(42)); // Returns true
1907
+ * ```
1908
+ * @since v10.0.0
1909
+ */
1910
+ function isPromise(object: unknown): object is Promise<unknown>;
1911
+ /**
1912
+ * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance.
1913
+ *
1914
+ * ```js
1915
+ * const target = {};
1916
+ * const proxy = new Proxy(target, {});
1917
+ * util.types.isProxy(target); // Returns false
1918
+ * util.types.isProxy(proxy); // Returns true
1919
+ * ```
1920
+ * @since v10.0.0
1921
+ */
1922
+ function isProxy(object: unknown): boolean;
1923
+ /**
1924
+ * Returns `true` if the value is a regular expression object.
1925
+ *
1926
+ * ```js
1927
+ * util.types.isRegExp(/abc/); // Returns true
1928
+ * util.types.isRegExp(new RegExp('abc')); // Returns true
1929
+ * ```
1930
+ * @since v10.0.0
1931
+ */
1932
+ function isRegExp(object: unknown): object is RegExp;
1933
+ /**
1934
+ * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
1935
+ *
1936
+ * ```js
1937
+ * util.types.isSet(new Set()); // Returns true
1938
+ * ```
1939
+ * @since v10.0.0
1940
+ */
1941
+ function isSet<T>(
1942
+ object: T | {},
1943
+ ): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
1944
+ /**
1945
+ * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
1946
+ *
1947
+ * ```js
1948
+ * const set = new Set();
1949
+ * util.types.isSetIterator(set.keys()); // Returns true
1950
+ * util.types.isSetIterator(set.values()); // Returns true
1951
+ * util.types.isSetIterator(set.entries()); // Returns true
1952
+ * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
1953
+ * ```
1954
+ * @since v10.0.0
1955
+ */
1956
+ function isSetIterator(object: unknown): boolean;
1957
+ /**
1958
+ * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
1959
+ * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is
1960
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
1961
+ *
1962
+ * ```js
1963
+ * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false
1964
+ * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
1965
+ * ```
1966
+ * @since v10.0.0
1967
+ */
1968
+ function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
1969
+ /**
1970
+ * Returns `true` if the value is a string object, e.g. created
1971
+ * by `new String()`.
1972
+ *
1973
+ * ```js
1974
+ * util.types.isStringObject('foo'); // Returns false
1975
+ * util.types.isStringObject(new String('foo')); // Returns true
1976
+ * ```
1977
+ * @since v10.0.0
1978
+ */
1979
+ function isStringObject(object: unknown): object is String;
1980
+ /**
1981
+ * Returns `true` if the value is a symbol object, created
1982
+ * by calling `Object()` on a `Symbol` primitive.
1983
+ *
1984
+ * ```js
1985
+ * const symbol = Symbol('foo');
1986
+ * util.types.isSymbolObject(symbol); // Returns false
1987
+ * util.types.isSymbolObject(Object(symbol)); // Returns true
1988
+ * ```
1989
+ * @since v10.0.0
1990
+ */
1991
+ function isSymbolObject(object: unknown): object is Symbol;
1992
+ /**
1993
+ * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance.
1994
+ *
1995
+ * ```js
1996
+ * util.types.isTypedArray(new ArrayBuffer()); // Returns false
1997
+ * util.types.isTypedArray(new Uint8Array()); // Returns true
1998
+ * util.types.isTypedArray(new Float64Array()); // Returns true
1999
+ * ```
2000
+ *
2001
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
2002
+ * @since v10.0.0
2003
+ */
2004
+ function isTypedArray(object: unknown): object is NodeJS.TypedArray;
2005
+ /**
2006
+ * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance.
2007
+ *
2008
+ * ```js
2009
+ * util.types.isUint8Array(new ArrayBuffer()); // Returns false
2010
+ * util.types.isUint8Array(new Uint8Array()); // Returns true
2011
+ * util.types.isUint8Array(new Float64Array()); // Returns false
2012
+ * ```
2013
+ * @since v10.0.0
2014
+ */
2015
+ function isUint8Array(object: unknown): object is Uint8Array;
2016
+ /**
2017
+ * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance.
2018
+ *
2019
+ * ```js
2020
+ * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false
2021
+ * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true
2022
+ * util.types.isUint8ClampedArray(new Float64Array()); // Returns false
2023
+ * ```
2024
+ * @since v10.0.0
2025
+ */
2026
+ function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
2027
+ /**
2028
+ * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance.
2029
+ *
2030
+ * ```js
2031
+ * util.types.isUint16Array(new ArrayBuffer()); // Returns false
2032
+ * util.types.isUint16Array(new Uint16Array()); // Returns true
2033
+ * util.types.isUint16Array(new Float64Array()); // Returns false
2034
+ * ```
2035
+ * @since v10.0.0
2036
+ */
2037
+ function isUint16Array(object: unknown): object is Uint16Array;
2038
+ /**
2039
+ * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance.
2040
+ *
2041
+ * ```js
2042
+ * util.types.isUint32Array(new ArrayBuffer()); // Returns false
2043
+ * util.types.isUint32Array(new Uint32Array()); // Returns true
2044
+ * util.types.isUint32Array(new Float64Array()); // Returns false
2045
+ * ```
2046
+ * @since v10.0.0
2047
+ */
2048
+ function isUint32Array(object: unknown): object is Uint32Array;
2049
+ /**
2050
+ * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance.
2051
+ *
2052
+ * ```js
2053
+ * util.types.isWeakMap(new WeakMap()); // Returns true
2054
+ * ```
2055
+ * @since v10.0.0
2056
+ */
2057
+ function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
2058
+ /**
2059
+ * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance.
2060
+ *
2061
+ * ```js
2062
+ * util.types.isWeakSet(new WeakSet()); // Returns true
2063
+ * ```
2064
+ * @since v10.0.0
2065
+ */
2066
+ function isWeakSet(object: unknown): object is WeakSet<object>;
2067
+ /**
2068
+ * Returns `true` if `value` is a `KeyObject`, `false` otherwise.
2069
+ * @since v16.2.0
2070
+ */
2071
+ function isKeyObject(object: unknown): object is KeyObject;
2072
+ /**
2073
+ * Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
2074
+ * @since v16.2.0
2075
+ */
2076
+ function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
2077
+ }
2078
+ declare module "node:util" {
2079
+ export * from "util";
2080
+ }
2081
+ declare module "node:util/types" {
2082
+ export * from "util/types";
2083
+ }