@aligent/cdk-prerender-proxy 0.2.4-beta1 → 0.2.5-beta

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 (155) hide show
  1. package/index.d.ts +1 -2
  2. package/index.js +2 -4
  3. package/lib/handlers/cache-control.ts +7 -20
  4. package/lib/handlers/error-response.ts +8 -51
  5. package/lib/handlers/node_modules/.package-lock.json +32 -3
  6. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/index.d.ts +6 -0
  7. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/index.js +14 -0
  8. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/cache-control.d.ts +3 -0
  9. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/cache-control.js +24 -0
  10. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/error-response.d.ts +3 -0
  11. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/error-response.js +50 -0
  12. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/prerender-check.d.ts +3 -0
  13. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/prerender-check.js +28 -0
  14. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/prerender.d.ts +3 -0
  15. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/prerender.js +49 -0
  16. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/redirect.d.ts +3 -0
  17. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/redirect.js +33 -0
  18. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/package.json +27 -0
  19. package/lib/handlers/node_modules/@aligent/cdk-lambda-at-edge-handlers/tsconfig.json +3 -0
  20. package/lib/handlers/node_modules/@middy/core/LICENSE +21 -0
  21. package/lib/handlers/node_modules/@middy/core/README.md +65 -0
  22. package/lib/handlers/node_modules/@middy/core/index.cjs +207 -0
  23. package/lib/handlers/node_modules/@middy/core/index.d.ts +91 -0
  24. package/lib/handlers/node_modules/@middy/core/index.js +199 -0
  25. package/lib/handlers/node_modules/@middy/core/package.json +65 -0
  26. package/lib/handlers/node_modules/@types/node/README.md +4 -4
  27. package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +5 -1
  28. package/lib/handlers/node_modules/@types/node/assert.d.ts +904 -67
  29. package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +371 -96
  30. package/lib/handlers/node_modules/@types/node/buffer.d.ts +2199 -25
  31. package/lib/handlers/node_modules/@types/node/child_process.d.ts +1151 -308
  32. package/lib/handlers/node_modules/@types/node/cluster.d.ts +356 -208
  33. package/lib/handlers/node_modules/@types/node/console.d.ts +324 -45
  34. package/lib/handlers/node_modules/@types/node/constants.d.ts +8 -3
  35. package/lib/handlers/node_modules/@types/node/crypto.d.ts +3230 -846
  36. package/lib/handlers/node_modules/@types/node/dgram.d.ts +478 -74
  37. package/lib/handlers/node_modules/@types/node/diagnostics_channel.d.ts +153 -0
  38. package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +308 -35
  39. package/lib/handlers/node_modules/@types/node/dns.d.ts +444 -107
  40. package/lib/handlers/node_modules/@types/node/dom-events.d.ts +126 -0
  41. package/lib/handlers/node_modules/@types/node/domain.d.ts +162 -16
  42. package/lib/handlers/node_modules/@types/node/events.d.ts +624 -39
  43. package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +911 -365
  44. package/lib/handlers/node_modules/@types/node/fs.d.ts +2611 -978
  45. package/lib/handlers/node_modules/@types/node/globals.d.ts +66 -421
  46. package/lib/handlers/node_modules/@types/node/globals.global.d.ts +1 -1
  47. package/lib/handlers/node_modules/@types/node/http.d.ts +1416 -199
  48. package/lib/handlers/node_modules/@types/node/http2.d.ts +1688 -530
  49. package/lib/handlers/node_modules/@types/node/https.d.ts +532 -26
  50. package/lib/handlers/node_modules/@types/node/index.d.ts +92 -16
  51. package/lib/handlers/node_modules/@types/node/inspector.d.ts +511 -811
  52. package/lib/handlers/node_modules/@types/node/module.d.ts +75 -13
  53. package/lib/handlers/node_modules/@types/node/net.d.ts +710 -167
  54. package/lib/handlers/node_modules/@types/node/os.d.ts +252 -25
  55. package/lib/handlers/node_modules/@types/node/package.json +30 -25
  56. package/lib/handlers/node_modules/@types/node/path.d.ts +59 -31
  57. package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +420 -105
  58. package/lib/handlers/node_modules/@types/node/process.d.ts +1249 -228
  59. package/lib/handlers/node_modules/@types/node/punycode.d.ts +67 -25
  60. package/lib/handlers/node_modules/@types/node/querystring.d.ts +113 -10
  61. package/lib/handlers/node_modules/@types/node/readline/promises.d.ts +143 -0
  62. package/lib/handlers/node_modules/@types/node/readline.d.ts +570 -109
  63. package/lib/handlers/node_modules/@types/node/repl.d.ts +154 -125
  64. package/lib/handlers/node_modules/@types/node/stream/consumers.d.ts +12 -0
  65. package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +18 -43
  66. package/lib/handlers/node_modules/@types/node/stream/web.d.ts +330 -0
  67. package/lib/handlers/node_modules/@types/node/stream.d.ts +1117 -248
  68. package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +60 -0
  69. package/lib/handlers/node_modules/@types/node/test.d.ts +446 -0
  70. package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +81 -9
  71. package/lib/handlers/node_modules/@types/node/timers.d.ts +84 -17
  72. package/lib/handlers/node_modules/@types/node/tls.d.ts +510 -275
  73. package/lib/handlers/node_modules/@types/node/trace_events.d.ts +120 -10
  74. package/lib/handlers/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  75. package/lib/handlers/node_modules/@types/node/ts4.8/assert.d.ts +961 -0
  76. package/lib/handlers/node_modules/@types/node/ts4.8/async_hooks.d.ts +501 -0
  77. package/lib/handlers/node_modules/@types/node/ts4.8/buffer.d.ts +2259 -0
  78. package/lib/handlers/node_modules/@types/node/ts4.8/child_process.d.ts +1369 -0
  79. package/lib/handlers/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
  80. package/lib/handlers/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  81. package/lib/handlers/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  82. package/lib/handlers/node_modules/@types/node/ts4.8/crypto.d.ts +3964 -0
  83. package/lib/handlers/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  84. package/lib/handlers/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +153 -0
  85. package/lib/handlers/node_modules/@types/node/ts4.8/dns/promises.d.ts +370 -0
  86. package/lib/handlers/node_modules/@types/node/ts4.8/dns.d.ts +659 -0
  87. package/lib/handlers/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  88. package/lib/handlers/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  89. package/lib/handlers/node_modules/@types/node/ts4.8/events.d.ts +678 -0
  90. package/lib/handlers/node_modules/@types/node/ts4.8/fs/promises.d.ts +1138 -0
  91. package/lib/handlers/node_modules/@types/node/ts4.8/fs.d.ts +3872 -0
  92. package/lib/handlers/node_modules/@types/node/ts4.8/globals.d.ts +294 -0
  93. package/lib/handlers/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  94. package/lib/handlers/node_modules/@types/node/ts4.8/http.d.ts +1651 -0
  95. package/lib/handlers/node_modules/@types/node/ts4.8/http2.d.ts +2134 -0
  96. package/lib/handlers/node_modules/@types/node/ts4.8/https.d.ts +542 -0
  97. package/lib/handlers/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  98. package/lib/handlers/node_modules/@types/node/ts4.8/inspector.d.ts +2741 -0
  99. package/lib/handlers/node_modules/@types/node/ts4.8/module.d.ts +114 -0
  100. package/lib/handlers/node_modules/@types/node/ts4.8/net.d.ts +869 -0
  101. package/lib/handlers/node_modules/@types/node/ts4.8/os.d.ts +466 -0
  102. package/lib/handlers/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  103. package/lib/handlers/node_modules/@types/node/ts4.8/perf_hooks.d.ts +625 -0
  104. package/lib/handlers/node_modules/@types/node/ts4.8/process.d.ts +1482 -0
  105. package/lib/handlers/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  106. package/lib/handlers/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  107. package/lib/handlers/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
  108. package/lib/handlers/node_modules/@types/node/ts4.8/readline.d.ts +653 -0
  109. package/lib/handlers/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  110. package/lib/handlers/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  111. package/lib/handlers/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  112. package/lib/handlers/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  113. package/lib/handlers/node_modules/@types/node/ts4.8/stream.d.ts +1340 -0
  114. package/lib/handlers/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  115. package/lib/handlers/node_modules/@types/node/ts4.8/test.d.ts +446 -0
  116. package/lib/handlers/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  117. package/lib/handlers/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
  118. package/lib/handlers/node_modules/@types/node/ts4.8/tls.d.ts +1028 -0
  119. package/lib/handlers/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
  120. package/lib/handlers/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
  121. package/lib/handlers/node_modules/@types/node/ts4.8/url.d.ts +897 -0
  122. package/lib/handlers/node_modules/@types/node/ts4.8/util.d.ts +1926 -0
  123. package/lib/handlers/node_modules/@types/node/ts4.8/v8.d.ts +396 -0
  124. package/lib/handlers/node_modules/@types/node/ts4.8/vm.d.ts +509 -0
  125. package/lib/handlers/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  126. package/lib/handlers/node_modules/@types/node/ts4.8/worker_threads.d.ts +689 -0
  127. package/lib/handlers/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  128. package/lib/handlers/node_modules/@types/node/tty.d.ts +163 -23
  129. package/lib/handlers/node_modules/@types/node/url.d.ts +825 -44
  130. package/lib/handlers/node_modules/@types/node/util.d.ts +1842 -72
  131. package/lib/handlers/node_modules/@types/node/v8.d.ts +276 -78
  132. package/lib/handlers/node_modules/@types/node/vm.d.ts +410 -53
  133. package/lib/handlers/node_modules/@types/node/wasi.d.ts +102 -30
  134. package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +559 -152
  135. package/lib/handlers/node_modules/@types/node/zlib.d.ts +234 -78
  136. package/lib/handlers/node_modules/esbuild/README.md +3 -0
  137. package/lib/handlers/node_modules/esbuild/bin/esbuild +0 -0
  138. package/lib/handlers/node_modules/esbuild/install.js +256 -0
  139. package/lib/handlers/node_modules/esbuild/lib/main.d.ts +397 -0
  140. package/lib/handlers/node_modules/esbuild/lib/main.js +1939 -0
  141. package/lib/handlers/node_modules/esbuild/package.json +15 -0
  142. package/lib/handlers/package-lock.json +62 -6
  143. package/lib/handlers/package.json +6 -1
  144. package/lib/handlers/prerender-check.ts +8 -27
  145. package/lib/handlers/prerender.ts +8 -43
  146. package/package.json +1 -1
  147. package/lib/handlers/node_modules/@types/node/base.d.ts +0 -19
  148. package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +0 -34
  149. package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  150. package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +0 -68
  151. package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  152. package/lib/handlers/node_modules/@types/node/util/types.d.ts +0 -53
  153. package/lib/handlers/prerender-handler.ts +0 -13
  154. package/lib/sendToPrerender.d.ts +0 -2
  155. package/lib/sendToPrerender.js +0 -42
@@ -1,3 +1,12 @@
1
+ /**
2
+ * The `os` module provides operating system-related utility methods and
3
+ * properties. It can be accessed using:
4
+ *
5
+ * ```js
6
+ * const os = require('os');
7
+ * ```
8
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js)
9
+ */
1
10
  declare module 'os' {
2
11
  interface CpuInfo {
3
12
  model: string;
@@ -10,7 +19,6 @@ declare module 'os' {
10
19
  irq: number;
11
20
  };
12
21
  }
13
-
14
22
  interface NetworkInterfaceBase {
15
23
  address: string;
16
24
  netmask: string;
@@ -18,16 +26,14 @@ declare module 'os' {
18
26
  internal: boolean;
19
27
  cidr: string | null;
20
28
  }
21
-
22
29
  interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
23
- family: "IPv4";
30
+ family: 'IPv4';
31
+ scopeid?: undefined;
24
32
  }
25
-
26
33
  interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
27
- family: "IPv6";
34
+ family: 'IPv6';
28
35
  scopeid: number;
29
36
  }
30
-
31
37
  interface UserInfo<T> {
32
38
  username: T;
33
39
  uid: number;
@@ -35,26 +41,197 @@ declare module 'os' {
35
41
  shell: T;
36
42
  homedir: T;
37
43
  }
38
-
39
44
  type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
40
-
45
+ /**
46
+ * Returns the host name of the operating system as a string.
47
+ * @since v0.3.3
48
+ */
41
49
  function hostname(): string;
50
+ /**
51
+ * Returns an array containing the 1, 5, and 15 minute load averages.
52
+ *
53
+ * The load average is a measure of system activity calculated by the operating
54
+ * system and expressed as a fractional number.
55
+ *
56
+ * The load average is a Unix-specific concept. On Windows, the return value is
57
+ * always `[0, 0, 0]`.
58
+ * @since v0.3.3
59
+ */
42
60
  function loadavg(): number[];
61
+ /**
62
+ * Returns the system uptime in number of seconds.
63
+ * @since v0.3.3
64
+ */
43
65
  function uptime(): number;
66
+ /**
67
+ * Returns the amount of free system memory in bytes as an integer.
68
+ * @since v0.3.3
69
+ */
44
70
  function freemem(): number;
71
+ /**
72
+ * Returns the total amount of system memory in bytes as an integer.
73
+ * @since v0.3.3
74
+ */
45
75
  function totalmem(): number;
76
+ /**
77
+ * Returns an array of objects containing information about each logical CPU core.
78
+ *
79
+ * The properties included on each object include:
80
+ *
81
+ * ```js
82
+ * [
83
+ * {
84
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
85
+ * speed: 2926,
86
+ * times: {
87
+ * user: 252020,
88
+ * nice: 0,
89
+ * sys: 30340,
90
+ * idle: 1070356870,
91
+ * irq: 0
92
+ * }
93
+ * },
94
+ * {
95
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
96
+ * speed: 2926,
97
+ * times: {
98
+ * user: 306960,
99
+ * nice: 0,
100
+ * sys: 26980,
101
+ * idle: 1071569080,
102
+ * irq: 0
103
+ * }
104
+ * },
105
+ * {
106
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
107
+ * speed: 2926,
108
+ * times: {
109
+ * user: 248450,
110
+ * nice: 0,
111
+ * sys: 21750,
112
+ * idle: 1070919370,
113
+ * irq: 0
114
+ * }
115
+ * },
116
+ * {
117
+ * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
118
+ * speed: 2926,
119
+ * times: {
120
+ * user: 256880,
121
+ * nice: 0,
122
+ * sys: 19430,
123
+ * idle: 1070905480,
124
+ * irq: 20
125
+ * }
126
+ * },
127
+ * ]
128
+ * ```
129
+ *
130
+ * `nice` values are POSIX-only. On Windows, the `nice` values of all processors
131
+ * are always 0.
132
+ * @since v0.3.3
133
+ */
46
134
  function cpus(): CpuInfo[];
135
+ /**
136
+ * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
137
+ * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
138
+ *
139
+ * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information
140
+ * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems.
141
+ * @since v0.3.3
142
+ */
47
143
  function type(): string;
144
+ /**
145
+ * Returns the operating system as a string.
146
+ *
147
+ * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
148
+ * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
149
+ * @since v0.3.3
150
+ */
48
151
  function release(): string;
152
+ /**
153
+ * Returns an object containing network interfaces that have been assigned a
154
+ * network address.
155
+ *
156
+ * Each key on the returned object identifies a network interface. The associated
157
+ * value is an array of objects that each describe an assigned network address.
158
+ *
159
+ * The properties available on the assigned network address object include:
160
+ *
161
+ * ```js
162
+ * {
163
+ * lo: [
164
+ * {
165
+ * address: '127.0.0.1',
166
+ * netmask: '255.0.0.0',
167
+ * family: 'IPv4',
168
+ * mac: '00:00:00:00:00:00',
169
+ * internal: true,
170
+ * cidr: '127.0.0.1/8'
171
+ * },
172
+ * {
173
+ * address: '::1',
174
+ * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
175
+ * family: 'IPv6',
176
+ * mac: '00:00:00:00:00:00',
177
+ * scopeid: 0,
178
+ * internal: true,
179
+ * cidr: '::1/128'
180
+ * }
181
+ * ],
182
+ * eth0: [
183
+ * {
184
+ * address: '192.168.1.108',
185
+ * netmask: '255.255.255.0',
186
+ * family: 'IPv4',
187
+ * mac: '01:02:03:0a:0b:0c',
188
+ * internal: false,
189
+ * cidr: '192.168.1.108/24'
190
+ * },
191
+ * {
192
+ * address: 'fe80::a00:27ff:fe4e:66a1',
193
+ * netmask: 'ffff:ffff:ffff:ffff::',
194
+ * family: 'IPv6',
195
+ * mac: '01:02:03:0a:0b:0c',
196
+ * scopeid: 1,
197
+ * internal: false,
198
+ * cidr: 'fe80::a00:27ff:fe4e:66a1/64'
199
+ * }
200
+ * ]
201
+ * }
202
+ * ```
203
+ * @since v0.6.0
204
+ */
49
205
  function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
206
+ /**
207
+ * Returns the string path of the current user's home directory.
208
+ *
209
+ * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it
210
+ * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory.
211
+ *
212
+ * On Windows, it uses the `USERPROFILE` environment variable if defined.
213
+ * Otherwise it uses the path to the profile directory of the current user.
214
+ * @since v2.3.0
215
+ */
50
216
  function homedir(): string;
217
+ /**
218
+ * Returns information about the currently effective user. On POSIX platforms,
219
+ * this is typically a subset of the password file. The returned object includes
220
+ * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`.
221
+ *
222
+ * The value of `homedir` returned by `os.userInfo()` is provided by the operating
223
+ * system. This differs from the result of `os.homedir()`, which queries
224
+ * environment variables for the home directory before falling back to the
225
+ * operating system response.
226
+ *
227
+ * Throws a `SystemError` if a user has no `username` or `homedir`.
228
+ * @since v6.0.0
229
+ */
51
230
  function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52
231
  function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
53
-
54
232
  type SignalConstants = {
55
233
  [key in NodeJS.Signals]: number;
56
234
  };
57
-
58
235
  namespace constants {
59
236
  const UV_UDP_REUSEADDR: number;
60
237
  namespace signals {}
@@ -207,33 +384,83 @@ declare module 'os' {
207
384
  const PRIORITY_HIGHEST: number;
208
385
  }
209
386
  }
210
-
387
+ const devNull: string;
388
+ const EOL: string;
389
+ /**
390
+ * Returns the operating system CPU architecture for which the Node.js binary was
391
+ * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
392
+ *
393
+ * The return value is equivalent to `process.arch`.
394
+ * @since v0.5.0
395
+ */
211
396
  function arch(): string;
212
397
  /**
213
398
  * Returns a string identifying the kernel version.
214
- * On POSIX systems, the operating system release is determined by calling
215
- * uname(3). On Windows, `pRtlGetVersion` is used, and if it is not available,
216
- * `GetVersionExW()` will be used. See
217
- * https://en.wikipedia.org/wiki/Uname#Examples for more information.
399
+ *
400
+ * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
401
+ * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
402
+ * @since v13.11.0, v12.17.0
218
403
  */
219
404
  function version(): string;
405
+ /**
406
+ * Returns a string identifying the operating system platform for which
407
+ * the Node.js binary was compiled. The value is set at compile time.
408
+ * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
409
+ *
410
+ * The return value is equivalent to `process.platform`.
411
+ *
412
+ * The value `'android'` may also be returned if Node.js is built on the Android
413
+ * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
414
+ * @since v0.5.0
415
+ */
220
416
  function platform(): NodeJS.Platform;
417
+ /**
418
+ * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
419
+ *
420
+ * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname).
421
+ * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used.
422
+ * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
423
+ * @since v18.9.0
424
+ */
425
+ function machine(): string;
426
+ /**
427
+ * Returns the operating system's default directory for temporary files as a
428
+ * string.
429
+ * @since v0.9.9
430
+ */
221
431
  function tmpdir(): string;
222
- const EOL: string;
223
- function endianness(): "BE" | "LE";
224
432
  /**
225
- * Gets the priority of a process.
226
- * Defaults to current process.
433
+ * Returns a string identifying the endianness of the CPU for which the Node.js
434
+ * binary was compiled.
435
+ *
436
+ * Possible values are `'BE'` for big endian and `'LE'` for little endian.
437
+ * @since v0.9.4
227
438
  */
228
- function getPriority(pid?: number): number;
439
+ function endianness(): 'BE' | 'LE';
229
440
  /**
230
- * Sets the priority of the current process.
231
- * @param priority Must be in range of -20 to 19
441
+ * Returns the scheduling priority for the process specified by `pid`. If `pid` is
442
+ * not provided or is `0`, the priority of the current process is returned.
443
+ * @since v10.10.0
444
+ * @param [pid=0] The process ID to retrieve scheduling priority for.
232
445
  */
233
- function setPriority(priority: number): void;
446
+ function getPriority(pid?: number): number;
234
447
  /**
235
- * Sets the priority of the process specified process.
236
- * @param priority Must be in range of -20 to 19
448
+ * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used.
449
+ *
450
+ * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows
451
+ * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range
452
+ * mapping may cause the return value to be slightly different on Windows. To avoid
453
+ * confusion, set `priority` to one of the priority constants.
454
+ *
455
+ * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
456
+ * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
457
+ * @since v10.10.0
458
+ * @param [pid=0] The process ID to set scheduling priority for.
459
+ * @param priority The scheduling priority to assign to the process.
237
460
  */
461
+ function setPriority(priority: number): void;
238
462
  function setPriority(pid: number, priority: number): void;
239
463
  }
464
+ declare module 'node:os' {
465
+ export * from 'os';
466
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "15.12.4",
3
+ "version": "18.11.18",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -60,11 +60,6 @@
60
60
  "url": "https://github.com/Hannes-Magnusson-CK",
61
61
  "githubUsername": "Hannes-Magnusson-CK"
62
62
  },
63
- {
64
- "name": "Hoàng Văn Khải",
65
- "url": "https://github.com/KSXGitHub",
66
- "githubUsername": "KSXGitHub"
67
- },
68
63
  {
69
64
  "name": "Huw",
70
65
  "url": "https://github.com/hoo29",
@@ -160,11 +155,6 @@
160
155
  "url": "https://github.com/trivikr",
161
156
  "githubUsername": "trivikr"
162
157
  },
163
- {
164
- "name": "Minh Son Nguyen",
165
- "url": "https://github.com/nguymin4",
166
- "githubUsername": "nguymin4"
167
- },
168
158
  {
169
159
  "name": "Junxiao Shi",
170
160
  "url": "https://github.com/yoursunny",
@@ -180,11 +170,6 @@
180
170
  "url": "https://github.com/ExE-Boss",
181
171
  "githubUsername": "ExE-Boss"
182
172
  },
183
- {
184
- "name": "Surasak Chaisurin",
185
- "url": "https://github.com/Ryan-Willpower",
186
- "githubUsername": "Ryan-Willpower"
187
- },
188
173
  {
189
174
  "name": "Piotr Błażejewicz",
190
175
  "url": "https://github.com/peterblazejewicz",
@@ -195,11 +180,6 @@
195
180
  "url": "https://github.com/addaleax",
196
181
  "githubUsername": "addaleax"
197
182
  },
198
- {
199
- "name": "Jason Kwok",
200
- "url": "https://github.com/JasonHK",
201
- "githubUsername": "JasonHK"
202
- },
203
183
  {
204
184
  "name": "Victor Perin",
205
185
  "url": "https://github.com/victorperin",
@@ -209,14 +189,39 @@
209
189
  "name": "Yongsheng Zhang",
210
190
  "url": "https://github.com/ZYSzys",
211
191
  "githubUsername": "ZYSzys"
192
+ },
193
+ {
194
+ "name": "NodeJS Contributors",
195
+ "url": "https://github.com/NodeJS",
196
+ "githubUsername": "NodeJS"
197
+ },
198
+ {
199
+ "name": "Linus Unnebäck",
200
+ "url": "https://github.com/LinusU",
201
+ "githubUsername": "LinusU"
202
+ },
203
+ {
204
+ "name": "wafuwafu13",
205
+ "url": "https://github.com/wafuwafu13",
206
+ "githubUsername": "wafuwafu13"
207
+ },
208
+ {
209
+ "name": "Matteo Collina",
210
+ "url": "https://github.com/mcollina",
211
+ "githubUsername": "mcollina"
212
+ },
213
+ {
214
+ "name": "Dmitry Semigradsky",
215
+ "url": "https://github.com/Semigradsky",
216
+ "githubUsername": "Semigradsky"
212
217
  }
213
218
  ],
214
219
  "main": "",
215
220
  "types": "index.d.ts",
216
221
  "typesVersions": {
217
- "<=3.6": {
222
+ "<=4.8": {
218
223
  "*": [
219
- "ts3.6/*"
224
+ "ts4.8/*"
220
225
  ]
221
226
  }
222
227
  },
@@ -227,6 +232,6 @@
227
232
  },
228
233
  "scripts": {},
229
234
  "dependencies": {},
230
- "typesPublisherContentHash": "4015e73b317c1729ff4d886338909c254c7ee7b4dd58073d03ac030b42a807cf",
231
- "typeScriptVersion": "3.6"
235
+ "typesPublisherContentHash": "540ec74ad976942ed4b12e09fd57842adfd77a63a4ea099f15f0602ad707835c",
236
+ "typeScriptVersion": "4.2"
232
237
  }
@@ -2,12 +2,19 @@ declare module 'path/posix' {
2
2
  import path = require('path');
3
3
  export = path;
4
4
  }
5
-
6
5
  declare module 'path/win32' {
7
6
  import path = require('path');
8
7
  export = path;
9
8
  }
10
-
9
+ /**
10
+ * The `path` module provides utilities for working with file and directory paths.
11
+ * It can be accessed using:
12
+ *
13
+ * ```js
14
+ * const path = require('path');
15
+ * ```
16
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js)
17
+ */
11
18
  declare module 'path' {
12
19
  namespace path {
13
20
  /**
@@ -35,47 +42,46 @@ declare module 'path' {
35
42
  */
36
43
  name: string;
37
44
  }
38
-
39
45
  interface FormatInputPathObject {
40
46
  /**
41
47
  * The root of the path such as '/' or 'c:\'
42
48
  */
43
- root?: string;
49
+ root?: string | undefined;
44
50
  /**
45
51
  * The full directory path such as '/home/user/dir' or 'c:\path\dir'
46
52
  */
47
- dir?: string;
53
+ dir?: string | undefined;
48
54
  /**
49
55
  * The file name including extension (if any) such as 'index.html'
50
56
  */
51
- base?: string;
57
+ base?: string | undefined;
52
58
  /**
53
59
  * The file extension (if any) such as '.html'
54
60
  */
55
- ext?: string;
61
+ ext?: string | undefined;
56
62
  /**
57
63
  * The file name without extension (if any) such as 'index'
58
64
  */
59
- name?: string;
65
+ name?: string | undefined;
60
66
  }
61
-
62
67
  interface PlatformPath {
63
68
  /**
64
69
  * Normalize a string path, reducing '..' and '.' parts.
65
70
  * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
66
71
  *
67
- * @param p string path to normalize.
72
+ * @param path string path to normalize.
73
+ * @throws {TypeError} if `path` is not a string.
68
74
  */
69
- normalize(p: string): string;
75
+ normalize(path: string): string;
70
76
  /**
71
77
  * Join all arguments together and normalize the resulting path.
72
- * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
73
78
  *
74
79
  * @param paths paths to join.
80
+ * @throws {TypeError} if any of the path segments is not a string.
75
81
  */
76
82
  join(...paths: string[]): string;
77
83
  /**
78
- * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
84
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
79
85
  *
80
86
  * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
81
87
  *
@@ -84,61 +90,71 @@ declare module 'path' {
84
90
  * the current working directory is used as well. The resulting path is normalized,
85
91
  * and trailing slashes are removed unless the path gets resolved to the root directory.
86
92
  *
87
- * @param pathSegments string paths to join. Non-string arguments are ignored.
93
+ * @param paths A sequence of paths or path segments.
94
+ * @throws {TypeError} if any of the arguments is not a string.
88
95
  */
89
- resolve(...pathSegments: string[]): string;
96
+ resolve(...paths: string[]): string;
90
97
  /**
91
98
  * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
92
99
  *
100
+ * If the given {path} is a zero-length string, `false` will be returned.
101
+ *
93
102
  * @param path path to test.
103
+ * @throws {TypeError} if `path` is not a string.
94
104
  */
95
- isAbsolute(p: string): boolean;
105
+ isAbsolute(path: string): boolean;
96
106
  /**
97
- * Solve the relative path from {from} to {to}.
107
+ * Solve the relative path from {from} to {to} based on the current working directory.
98
108
  * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
109
+ *
110
+ * @throws {TypeError} if either `from` or `to` is not a string.
99
111
  */
100
112
  relative(from: string, to: string): string;
101
113
  /**
102
114
  * Return the directory name of a path. Similar to the Unix dirname command.
103
115
  *
104
- * @param p the path to evaluate.
116
+ * @param path the path to evaluate.
117
+ * @throws {TypeError} if `path` is not a string.
105
118
  */
106
- dirname(p: string): string;
119
+ dirname(path: string): string;
107
120
  /**
108
121
  * Return the last portion of a path. Similar to the Unix basename command.
109
122
  * Often used to extract the file name from a fully qualified path.
110
123
  *
111
- * @param p the path to evaluate.
112
- * @param ext optionally, an extension to remove from the result.
124
+ * @param path the path to evaluate.
125
+ * @param suffix optionally, an extension to remove from the result.
126
+ * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
113
127
  */
114
- basename(p: string, ext?: string): string;
128
+ basename(path: string, suffix?: string): string;
115
129
  /**
116
130
  * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
117
- * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
131
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
118
132
  *
119
- * @param p the path to evaluate.
133
+ * @param path the path to evaluate.
134
+ * @throws {TypeError} if `path` is not a string.
120
135
  */
121
- extname(p: string): string;
136
+ extname(path: string): string;
122
137
  /**
123
138
  * The platform-specific file separator. '\\' or '/'.
124
139
  */
125
- readonly sep: string;
140
+ readonly sep: '\\' | '/';
126
141
  /**
127
142
  * The platform-specific file delimiter. ';' or ':'.
128
143
  */
129
- readonly delimiter: string;
144
+ readonly delimiter: ';' | ':';
130
145
  /**
131
146
  * Returns an object from a path string - the opposite of format().
132
147
  *
133
- * @param pathString path to evaluate.
148
+ * @param path path to evaluate.
149
+ * @throws {TypeError} if `path` is not a string.
134
150
  */
135
- parse(p: string): ParsedPath;
151
+ parse(path: string): ParsedPath;
136
152
  /**
137
153
  * Returns a path string from an object - the opposite of parse().
138
154
  *
139
- * @param pathString path to evaluate.
155
+ * @param pathObject path to evaluate.
140
156
  */
141
- format(pP: FormatInputPathObject): string;
157
+ format(pathObject: FormatInputPathObject): string;
142
158
  /**
143
159
  * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
144
160
  * If path is not a string, path will be returned without modifications.
@@ -161,3 +177,15 @@ declare module 'path' {
161
177
  const path: path.PlatformPath;
162
178
  export = path;
163
179
  }
180
+ declare module 'node:path' {
181
+ import path = require('path');
182
+ export = path;
183
+ }
184
+ declare module 'node:path/posix' {
185
+ import path = require('path/posix');
186
+ export = path;
187
+ }
188
+ declare module 'node:path/win32' {
189
+ import path = require('path/win32');
190
+ export = path;
191
+ }