@types/node 18.17.18 → 18.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. {node v18.17 → node v18.18}/README.md +1 -1
  2. node v18.18/assert/strict.d.ts +8 -0
  3. {node v18.17/ts4.8 → node v18.18}/assert.d.ts +48 -24
  4. {node v18.17 → node v18.18}/async_hooks.d.ts +10 -7
  5. {node v18.17 → node v18.18}/buffer.d.ts +32 -34
  6. {node v18.17 → node v18.18}/child_process.d.ts +267 -122
  7. {node v18.17/ts4.8 → node v18.18}/cluster.d.ts +107 -89
  8. {node v18.17/ts4.8 → node v18.18}/console.d.ts +7 -7
  9. node v18.18/constants.d.ts +19 -0
  10. {node v18.17 → node v18.18}/crypto.d.ts +746 -268
  11. {node v18.17/ts4.8 → node v18.18}/dgram.d.ts +86 -45
  12. {node v18.17 → node v18.18}/diagnostics_channel.d.ts +3 -3
  13. {node v18.17 → node v18.18}/dns/promises.d.ts +28 -25
  14. {node v18.17/ts4.8 → node v18.18}/dns.d.ts +203 -62
  15. node v18.18/dom-events.d.ts +122 -0
  16. {node v18.17/ts4.8 → node v18.18}/domain.d.ts +4 -4
  17. {node v18.17 → node v18.18}/events.d.ts +50 -7
  18. {node v18.17 → node v18.18}/fs/promises.d.ts +107 -73
  19. {node v18.17 → node v18.18}/fs.d.ts +513 -311
  20. {node v18.17 → node v18.18}/globals.d.ts +38 -18
  21. {node v18.17 → node v18.18}/http.d.ts +185 -185
  22. {node v18.17 → node v18.18}/http2.d.ts +628 -376
  23. {node v18.17/ts4.8 → node v18.18}/https.d.ts +107 -105
  24. {node v18.17 → node v18.18}/index.d.ts +1 -1
  25. {node v18.17/ts4.8 → node v18.18}/module.d.ts +56 -12
  26. {node v18.17/ts4.8 → node v18.18}/net.d.ts +123 -99
  27. {node v18.17/ts4.8 → node v18.18}/os.d.ts +7 -7
  28. {node v18.17 → node v18.18}/package.json +2 -2
  29. {node v18.17/ts4.8 → node v18.18}/path.d.ts +13 -13
  30. {node v18.17/ts4.8 → node v18.18}/perf_hooks.d.ts +20 -19
  31. {node v18.17/ts4.8 → node v18.18}/process.d.ts +155 -125
  32. {node v18.17 → node v18.18}/punycode.d.ts +3 -3
  33. {node v18.17/ts4.8 → node v18.18}/querystring.d.ts +14 -4
  34. {node v18.17 → node v18.18}/readline/promises.d.ts +5 -5
  35. {node v18.17/ts4.8 → node v18.18}/readline.d.ts +69 -56
  36. {node v18.17/ts4.8 → node v18.18}/repl.d.ts +67 -61
  37. {node v18.17 → node v18.18}/stream/consumers.d.ts +4 -4
  38. node v18.18/stream/promises.d.ts +83 -0
  39. {node v18.17 → node v18.18}/stream/web.d.ts +26 -20
  40. {node v18.17 → node v18.18}/stream.d.ts +361 -226
  41. {node v18.17/ts4.8 → node v18.18}/string_decoder.d.ts +3 -3
  42. {node v18.17 → node v18.18}/test.d.ts +131 -131
  43. {node v18.17 → node v18.18}/timers/promises.d.ts +4 -4
  44. {node v18.17 → node v18.18}/timers.d.ts +34 -9
  45. {node v18.17 → node v18.18}/tls.d.ts +151 -71
  46. {node v18.17/ts4.8 → node v18.18}/trace_events.d.ts +3 -3
  47. node v18.18/ts4.8/assert/strict.d.ts +8 -0
  48. {node v18.17 → node v18.18/ts4.8}/assert.d.ts +48 -24
  49. {node v18.17 → node v18.18}/ts4.8/async_hooks.d.ts +10 -7
  50. {node v18.17 → node v18.18}/ts4.8/buffer.d.ts +32 -34
  51. {node v18.17 → node v18.18}/ts4.8/child_process.d.ts +267 -122
  52. {node v18.17 → node v18.18/ts4.8}/cluster.d.ts +107 -89
  53. {node v18.17 → node v18.18/ts4.8}/console.d.ts +7 -7
  54. node v18.18/ts4.8/constants.d.ts +19 -0
  55. {node v18.17 → node v18.18}/ts4.8/crypto.d.ts +746 -268
  56. {node v18.17 → node v18.18/ts4.8}/dgram.d.ts +86 -45
  57. {node v18.17 → node v18.18}/ts4.8/diagnostics_channel.d.ts +3 -3
  58. {node v18.17 → node v18.18}/ts4.8/dns/promises.d.ts +28 -25
  59. {node v18.17 → node v18.18/ts4.8}/dns.d.ts +203 -62
  60. node v18.18/ts4.8/dom-events.d.ts +122 -0
  61. {node v18.17 → node v18.18/ts4.8}/domain.d.ts +4 -4
  62. {node v18.17 → node v18.18}/ts4.8/events.d.ts +50 -7
  63. {node v18.17 → node v18.18}/ts4.8/fs/promises.d.ts +107 -73
  64. {node v18.17 → node v18.18}/ts4.8/fs.d.ts +514 -312
  65. {node v18.17 → node v18.18}/ts4.8/globals.d.ts +68 -47
  66. {node v18.17 → node v18.18}/ts4.8/http.d.ts +185 -185
  67. {node v18.17 → node v18.18}/ts4.8/http2.d.ts +628 -376
  68. {node v18.17 → node v18.18/ts4.8}/https.d.ts +107 -105
  69. {node v18.17 → node v18.18/ts4.8}/module.d.ts +56 -12
  70. {node v18.17 → node v18.18/ts4.8}/net.d.ts +117 -93
  71. {node v18.17 → node v18.18/ts4.8}/os.d.ts +7 -7
  72. {node v18.17 → node v18.18/ts4.8}/path.d.ts +13 -13
  73. {node v18.17 → node v18.18/ts4.8}/perf_hooks.d.ts +20 -19
  74. {node v18.17 → node v18.18/ts4.8}/process.d.ts +155 -125
  75. {node v18.17 → node v18.18}/ts4.8/punycode.d.ts +3 -3
  76. {node v18.17 → node v18.18/ts4.8}/querystring.d.ts +14 -4
  77. {node v18.17 → node v18.18}/ts4.8/readline/promises.d.ts +5 -5
  78. {node v18.17 → node v18.18/ts4.8}/readline.d.ts +69 -56
  79. {node v18.17 → node v18.18/ts4.8}/repl.d.ts +67 -61
  80. {node v18.17 → node v18.18}/ts4.8/stream/consumers.d.ts +4 -4
  81. node v18.18/ts4.8/stream/promises.d.ts +83 -0
  82. {node v18.17 → node v18.18}/ts4.8/stream/web.d.ts +26 -20
  83. {node v18.17 → node v18.18}/ts4.8/stream.d.ts +490 -217
  84. {node v18.17 → node v18.18/ts4.8}/string_decoder.d.ts +3 -3
  85. {node v18.17 → node v18.18}/ts4.8/test.d.ts +144 -130
  86. {node v18.17 → node v18.18}/ts4.8/timers/promises.d.ts +4 -4
  87. {node v18.17 → node v18.18}/ts4.8/timers.d.ts +41 -9
  88. {node v18.17 → node v18.18}/ts4.8/tls.d.ts +151 -71
  89. {node v18.17 → node v18.18/ts4.8}/trace_events.d.ts +3 -3
  90. {node v18.17 → node v18.18}/ts4.8/tty.d.ts +10 -10
  91. {node v18.17 → node v18.18}/ts4.8/url.d.ts +39 -18
  92. {node v18.17 → node v18.18}/ts4.8/util.d.ts +178 -117
  93. {node v18.17 → node v18.18}/ts4.8/v8.d.ts +4 -4
  94. {node v18.17 → node v18.18}/ts4.8/vm.d.ts +60 -42
  95. {node v18.17 → node v18.18}/ts4.8/wasi.d.ts +3 -3
  96. {node v18.17 → node v18.18/ts4.8}/worker_threads.d.ts +82 -85
  97. {node v18.17 → node v18.18/ts4.8}/zlib.d.ts +9 -9
  98. {node v18.17 → node v18.18}/tty.d.ts +10 -10
  99. {node v18.17 → node v18.18}/url.d.ts +39 -18
  100. {node v18.17 → node v18.18}/util.d.ts +178 -117
  101. {node v18.17 → node v18.18}/v8.d.ts +4 -4
  102. {node v18.17 → node v18.18}/vm.d.ts +60 -42
  103. {node v18.17 → node v18.18}/wasi.d.ts +3 -3
  104. {node v18.17/ts4.8 → node v18.18}/worker_threads.d.ts +82 -85
  105. {node v18.17/ts4.8 → node v18.18}/zlib.d.ts +9 -9
  106. node v18.17/assert/strict.d.ts +0 -8
  107. node v18.17/constants.d.ts +0 -18
  108. node v18.17/dom-events.d.ts +0 -126
  109. node v18.17/stream/promises.d.ts +0 -42
  110. node v18.17/ts4.8/assert/strict.d.ts +0 -8
  111. node v18.17/ts4.8/constants.d.ts +0 -18
  112. node v18.17/ts4.8/dom-events.d.ts +0 -126
  113. node v18.17/ts4.8/stream/promises.d.ts +0 -42
  114. {node v18.17 → node v18.18}/LICENSE +0 -0
  115. {node v18.17 → node v18.18}/globals.global.d.ts +0 -0
  116. {node v18.17 → node v18.18}/inspector.d.ts +0 -0
  117. {node v18.17 → node v18.18}/ts4.8/globals.global.d.ts +0 -0
  118. {node v18.17 → node v18.18}/ts4.8/index.d.ts +0 -0
  119. {node v18.17 → node v18.18}/ts4.8/inspector.d.ts +0 -0
@@ -3,17 +3,19 @@
3
3
  * separate module.
4
4
  * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js)
5
5
  */
6
- declare module 'https' {
7
- import { Duplex } from 'node:stream';
8
- import * as tls from 'node:tls';
9
- import * as http from 'node:http';
10
- import { URL } from 'node:url';
6
+ declare module "https" {
7
+ import { Duplex } from "node:stream";
8
+ import * as tls from "node:tls";
9
+ import * as http from "node:http";
10
+ import { URL } from "node:url";
11
11
  type ServerOptions<
12
12
  Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
13
13
  Response extends typeof http.ServerResponse = typeof http.ServerResponse,
14
14
  > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
15
- type RequestOptions = http.RequestOptions &
16
- tls.SecureContextOptions & {
15
+ type RequestOptions =
16
+ & http.RequestOptions
17
+ & tls.SecureContextOptions
18
+ & {
17
19
  checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
18
20
  rejectUnauthorized?: boolean | undefined; // Defaults to true
19
21
  servername?: string | undefined; // SNI TLS Extension
@@ -58,13 +60,13 @@ declare module 'https' {
58
60
  */
59
61
  closeIdleConnections(): void;
60
62
  addListener(event: string, listener: (...args: any[]) => void): this;
61
- addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
63
+ addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
62
64
  addListener(
63
- event: 'newSession',
65
+ event: "newSession",
64
66
  listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
65
67
  ): this;
66
68
  addListener(
67
- event: 'OCSPRequest',
69
+ event: "OCSPRequest",
68
70
  listener: (
69
71
  certificate: Buffer,
70
72
  issuer: Buffer,
@@ -72,74 +74,74 @@ declare module 'https' {
72
74
  ) => void,
73
75
  ): this;
74
76
  addListener(
75
- event: 'resumeSession',
77
+ event: "resumeSession",
76
78
  listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
77
79
  ): this;
78
- addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
79
- addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
80
- addListener(event: 'close', listener: () => void): this;
81
- addListener(event: 'connection', listener: (socket: Duplex) => void): this;
82
- addListener(event: 'error', listener: (err: Error) => void): this;
83
- addListener(event: 'listening', listener: () => void): this;
84
- addListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
85
- addListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
86
- addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
80
+ addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
81
+ addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
82
+ addListener(event: "close", listener: () => void): this;
83
+ addListener(event: "connection", listener: (socket: Duplex) => void): this;
84
+ addListener(event: "error", listener: (err: Error) => void): this;
85
+ addListener(event: "listening", listener: () => void): this;
86
+ addListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
87
+ addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
88
+ addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
87
89
  addListener(
88
- event: 'connect',
90
+ event: "connect",
89
91
  listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
90
92
  ): this;
91
- addListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
93
+ addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
92
94
  addListener(
93
- event: 'upgrade',
95
+ event: "upgrade",
94
96
  listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
95
97
  ): this;
96
98
  emit(event: string, ...args: any[]): boolean;
97
- emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean;
99
+ emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
98
100
  emit(
99
- event: 'newSession',
101
+ event: "newSession",
100
102
  sessionId: Buffer,
101
103
  sessionData: Buffer,
102
104
  callback: (err: Error, resp: Buffer) => void,
103
105
  ): boolean;
104
106
  emit(
105
- event: 'OCSPRequest',
107
+ event: "OCSPRequest",
106
108
  certificate: Buffer,
107
109
  issuer: Buffer,
108
110
  callback: (err: Error | null, resp: Buffer) => void,
109
111
  ): boolean;
110
- emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
111
- emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean;
112
- emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean;
113
- emit(event: 'close'): boolean;
114
- emit(event: 'connection', socket: Duplex): boolean;
115
- emit(event: 'error', err: Error): boolean;
116
- emit(event: 'listening'): boolean;
112
+ emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
113
+ emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
114
+ emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
115
+ emit(event: "close"): boolean;
116
+ emit(event: "connection", socket: Duplex): boolean;
117
+ emit(event: "error", err: Error): boolean;
118
+ emit(event: "listening"): boolean;
117
119
  emit(
118
- event: 'checkContinue',
120
+ event: "checkContinue",
119
121
  req: InstanceType<Request>,
120
122
  res: InstanceType<Response> & { req: InstanceType<Request> },
121
123
  ): boolean;
122
124
  emit(
123
- event: 'checkExpectation',
125
+ event: "checkExpectation",
124
126
  req: InstanceType<Request>,
125
127
  res: InstanceType<Response> & { req: InstanceType<Request> },
126
128
  ): boolean;
127
- emit(event: 'clientError', err: Error, socket: Duplex): boolean;
128
- emit(event: 'connect', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
129
+ emit(event: "clientError", err: Error, socket: Duplex): boolean;
130
+ emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
129
131
  emit(
130
- event: 'request',
132
+ event: "request",
131
133
  req: InstanceType<Request>,
132
134
  res: InstanceType<Response> & { req: InstanceType<Request> },
133
135
  ): boolean;
134
- emit(event: 'upgrade', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
136
+ emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
135
137
  on(event: string, listener: (...args: any[]) => void): this;
136
- on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
138
+ on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
137
139
  on(
138
- event: 'newSession',
140
+ event: "newSession",
139
141
  listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
140
142
  ): this;
141
143
  on(
142
- event: 'OCSPRequest',
144
+ event: "OCSPRequest",
143
145
  listener: (
144
146
  certificate: Buffer,
145
147
  issuer: Buffer,
@@ -147,29 +149,29 @@ declare module 'https' {
147
149
  ) => void,
148
150
  ): this;
149
151
  on(
150
- event: 'resumeSession',
152
+ event: "resumeSession",
151
153
  listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
152
154
  ): this;
153
- on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
154
- on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
155
- on(event: 'close', listener: () => void): this;
156
- on(event: 'connection', listener: (socket: Duplex) => void): this;
157
- on(event: 'error', listener: (err: Error) => void): this;
158
- on(event: 'listening', listener: () => void): this;
159
- on(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
160
- on(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
161
- on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
162
- on(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
163
- on(event: 'request', listener: http.RequestListener<Request, Response>): this;
164
- on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
155
+ on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
156
+ on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
157
+ on(event: "close", listener: () => void): this;
158
+ on(event: "connection", listener: (socket: Duplex) => void): this;
159
+ on(event: "error", listener: (err: Error) => void): this;
160
+ on(event: "listening", listener: () => void): this;
161
+ on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
162
+ on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
163
+ on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
164
+ on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
165
+ on(event: "request", listener: http.RequestListener<Request, Response>): this;
166
+ on(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
165
167
  once(event: string, listener: (...args: any[]) => void): this;
166
- once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
168
+ once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
167
169
  once(
168
- event: 'newSession',
170
+ event: "newSession",
169
171
  listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
170
172
  ): this;
171
173
  once(
172
- event: 'OCSPRequest',
174
+ event: "OCSPRequest",
173
175
  listener: (
174
176
  certificate: Buffer,
175
177
  issuer: Buffer,
@@ -177,29 +179,29 @@ declare module 'https' {
177
179
  ) => void,
178
180
  ): this;
179
181
  once(
180
- event: 'resumeSession',
182
+ event: "resumeSession",
181
183
  listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
182
184
  ): this;
183
- once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
184
- once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
185
- once(event: 'close', listener: () => void): this;
186
- once(event: 'connection', listener: (socket: Duplex) => void): this;
187
- once(event: 'error', listener: (err: Error) => void): this;
188
- once(event: 'listening', listener: () => void): this;
189
- once(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
190
- once(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
191
- once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
192
- once(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
193
- once(event: 'request', listener: http.RequestListener<Request, Response>): this;
194
- once(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
185
+ once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
186
+ once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
187
+ once(event: "close", listener: () => void): this;
188
+ once(event: "connection", listener: (socket: Duplex) => void): this;
189
+ once(event: "error", listener: (err: Error) => void): this;
190
+ once(event: "listening", listener: () => void): this;
191
+ once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
192
+ once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
193
+ once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
194
+ once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
195
+ once(event: "request", listener: http.RequestListener<Request, Response>): this;
196
+ once(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
195
197
  prependListener(event: string, listener: (...args: any[]) => void): this;
196
- prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
198
+ prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
197
199
  prependListener(
198
- event: 'newSession',
200
+ event: "newSession",
199
201
  listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
200
202
  ): this;
201
203
  prependListener(
202
- event: 'OCSPRequest',
204
+ event: "OCSPRequest",
203
205
  listener: (
204
206
  certificate: Buffer,
205
207
  issuer: Buffer,
@@ -207,35 +209,35 @@ declare module 'https' {
207
209
  ) => void,
208
210
  ): this;
209
211
  prependListener(
210
- event: 'resumeSession',
212
+ event: "resumeSession",
211
213
  listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
212
214
  ): this;
213
- prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
214
- prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
215
- prependListener(event: 'close', listener: () => void): this;
216
- prependListener(event: 'connection', listener: (socket: Duplex) => void): this;
217
- prependListener(event: 'error', listener: (err: Error) => void): this;
218
- prependListener(event: 'listening', listener: () => void): this;
219
- prependListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
220
- prependListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
221
- prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
215
+ prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
216
+ prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
217
+ prependListener(event: "close", listener: () => void): this;
218
+ prependListener(event: "connection", listener: (socket: Duplex) => void): this;
219
+ prependListener(event: "error", listener: (err: Error) => void): this;
220
+ prependListener(event: "listening", listener: () => void): this;
221
+ prependListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
222
+ prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
223
+ prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
222
224
  prependListener(
223
- event: 'connect',
225
+ event: "connect",
224
226
  listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
225
227
  ): this;
226
- prependListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
228
+ prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
227
229
  prependListener(
228
- event: 'upgrade',
230
+ event: "upgrade",
229
231
  listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
230
232
  ): this;
231
233
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
232
- prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
234
+ prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
233
235
  prependOnceListener(
234
- event: 'newSession',
236
+ event: "newSession",
235
237
  listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
236
238
  ): this;
237
239
  prependOnceListener(
238
- event: 'OCSPRequest',
240
+ event: "OCSPRequest",
239
241
  listener: (
240
242
  certificate: Buffer,
241
243
  issuer: Buffer,
@@ -243,25 +245,25 @@ declare module 'https' {
243
245
  ) => void,
244
246
  ): this;
245
247
  prependOnceListener(
246
- event: 'resumeSession',
248
+ event: "resumeSession",
247
249
  listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
248
250
  ): this;
249
- prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
250
- prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
251
- prependOnceListener(event: 'close', listener: () => void): this;
252
- prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this;
253
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
254
- prependOnceListener(event: 'listening', listener: () => void): this;
255
- prependOnceListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
256
- prependOnceListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
257
- prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
251
+ prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
252
+ prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
253
+ prependOnceListener(event: "close", listener: () => void): this;
254
+ prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this;
255
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
256
+ prependOnceListener(event: "listening", listener: () => void): this;
257
+ prependOnceListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
258
+ prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
259
+ prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
258
260
  prependOnceListener(
259
- event: 'connect',
261
+ event: "connect",
260
262
  listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
261
263
  ): this;
262
- prependOnceListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
264
+ prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
263
265
  prependOnceListener(
264
- event: 'upgrade',
266
+ event: "upgrade",
265
267
  listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
266
268
  ): this;
267
269
  }
@@ -537,6 +539,6 @@ declare module 'https' {
537
539
  ): http.ClientRequest;
538
540
  let globalAgent: Agent;
539
541
  }
540
- declare module 'node:https' {
541
- export * from 'https';
542
+ declare module "node:https" {
543
+ export * from "https";
542
544
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @since v0.3.7
3
3
  */
4
- declare module 'module' {
5
- import { URL } from 'node:url';
6
- import { MessagePort } from 'node:worker_threads';
4
+ declare module "module" {
5
+ import { URL } from "node:url";
6
+ import { MessagePort } from "node:worker_threads";
7
7
  namespace Module {
8
8
  /**
9
9
  * The `module.syncBuiltinESMExports()` method updates all the live bindings for
@@ -63,6 +63,24 @@ declare module 'module' {
63
63
  originalLine: number;
64
64
  originalColumn: number;
65
65
  }
66
+ interface SourceOrigin {
67
+ /**
68
+ * The name of the range in the source map, if one was provided
69
+ */
70
+ name?: string;
71
+ /**
72
+ * The file name of the original source, as reported in the SourceMap
73
+ */
74
+ fileName: string;
75
+ /**
76
+ * The 1-indexed lineNumber of the corresponding call site in the original source
77
+ */
78
+ lineNumber: number;
79
+ /**
80
+ * The 1-indexed columnNumber of the corresponding call site in the original source
81
+ */
82
+ columnNumber: number;
83
+ }
66
84
  /**
67
85
  * @since v13.7.0, v12.17.0
68
86
  */
@@ -73,16 +91,39 @@ declare module 'module' {
73
91
  readonly payload: SourceMapPayload;
74
92
  constructor(payload: SourceMapPayload);
75
93
  /**
76
- * Given a line number and column number in the generated source file, returns
77
- * an object representing the position in the original file. The object returned
78
- * consists of the following keys:
94
+ * Given a line offset and column offset in the generated source
95
+ * file, returns an object representing the SourceMap range in the
96
+ * original file if found, or an empty object if not.
97
+ *
98
+ * The object returned contains the following keys:
99
+ *
100
+ * The returned value represents the raw range as it appears in the
101
+ * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
102
+ * column numbers as they appear in Error messages and CallSite
103
+ * objects.
104
+ *
105
+ * To get the corresponding 1-indexed line and column numbers from a
106
+ * lineNumber and columnNumber as they are reported by Error stacks
107
+ * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
108
+ * @param lineOffset The zero-indexed line number offset in the generated source
109
+ * @param columnOffset The zero-indexed column number offset in the generated source
110
+ */
111
+ findEntry(lineOffset: number, columnOffset: number): SourceMapping;
112
+ /**
113
+ * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source,
114
+ * find the corresponding call site location in the original source.
115
+ *
116
+ * If the `lineNumber` and `columnNumber` provided are not found in any source map,
117
+ * then an empty object is returned.
118
+ * @param lineNumber The 1-indexed line number of the call site in the generated source
119
+ * @param columnNumber The 1-indexed column number of the call site in the generated source
79
120
  */
80
- findEntry(line: number, column: number): SourceMapping;
121
+ findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {};
81
122
  }
82
123
  interface ImportAssertions extends NodeJS.Dict<string> {
83
124
  type?: string | undefined;
84
125
  }
85
- type ModuleFormat = 'builtin' | 'commonjs' | 'json' | 'module' | 'wasm';
126
+ type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm";
86
127
  type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
87
128
  interface GlobalPreloadContext {
88
129
  port: MessagePort;
@@ -140,7 +181,10 @@ declare module 'module' {
140
181
  type ResolveHook = (
141
182
  specifier: string,
142
183
  context: ResolveHookContext,
143
- nextResolve: (specifier: string, context?: ResolveHookContext) => ResolveFnOutput | Promise<ResolveFnOutput>
184
+ nextResolve: (
185
+ specifier: string,
186
+ context?: ResolveHookContext,
187
+ ) => ResolveFnOutput | Promise<ResolveFnOutput>,
144
188
  ) => ResolveFnOutput | Promise<ResolveFnOutput>;
145
189
  interface LoadHookContext {
146
190
  /**
@@ -179,7 +223,7 @@ declare module 'module' {
179
223
  type LoadHook = (
180
224
  url: string,
181
225
  context: LoadHookContext,
182
- nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>
226
+ nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>,
183
227
  ) => LoadFnOutput | Promise<LoadFnOutput>;
184
228
  }
185
229
  interface Module extends NodeModule {}
@@ -212,7 +256,7 @@ declare module 'module' {
212
256
  }
213
257
  export = Module;
214
258
  }
215
- declare module 'node:module' {
216
- import module = require('module');
259
+ declare module "node:module" {
260
+ import module = require("module");
217
261
  export = module;
218
262
  }