@node-red/editor-client 3.0.2 → 3.1.0-beta.2

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 (127) hide show
  1. package/locales/de/editor.json +2 -0
  2. package/locales/de/infotips.json +0 -0
  3. package/locales/de/jsonata.json +0 -0
  4. package/locales/en-US/editor.json +37 -6
  5. package/locales/en-US/infotips.json +0 -0
  6. package/locales/en-US/jsonata.json +0 -0
  7. package/locales/fr/editor.json +1238 -0
  8. package/locales/fr/infotips.json +23 -0
  9. package/locales/fr/jsonata.json +274 -0
  10. package/locales/ja/editor.json +48 -9
  11. package/locales/ko/editor.json +233 -31
  12. package/locales/ko/infotips.json +0 -0
  13. package/locales/ko/jsonata.json +0 -0
  14. package/locales/pt-BR/editor.json +1208 -0
  15. package/locales/pt-BR/infotips.json +23 -0
  16. package/locales/pt-BR/jsonata.json +274 -0
  17. package/locales/ru/editor.json +2 -0
  18. package/locales/ru/infotips.json +0 -0
  19. package/locales/ru/jsonata.json +0 -0
  20. package/locales/zh-CN/editor.json +1175 -1049
  21. package/locales/zh-TW/editor.json +3 -0
  22. package/package.json +1 -1
  23. package/public/red/about +140 -0
  24. package/public/red/red.js +2699 -1397
  25. package/public/red/red.min.js +4 -3
  26. package/public/red/style.min.css +1 -1
  27. package/public/red/tours/3.0/images/context-menu.png +0 -0
  28. package/public/red/tours/3.0/welcome.js +155 -0
  29. package/public/red/tours/images/context-menu.png +0 -0
  30. package/public/red/tours/images/global-env-vars.png +0 -0
  31. package/public/red/tours/images/hiding-flows.png +0 -0
  32. package/public/red/tours/images/locking-flows.png +0 -0
  33. package/public/red/tours/images/mermaid.png +0 -0
  34. package/public/red/tours/images/node-help.png +0 -0
  35. package/public/red/tours/images/tab-changes.png +0 -0
  36. package/public/red/tours/welcome.js +111 -94
  37. package/public/types/node/assert/strict.d.ts +11 -0
  38. package/public/types/node/assert.d.ts +898 -64
  39. package/public/types/node/async_hooks.d.ts +362 -94
  40. package/public/types/node/buffer.d.ts +2158 -14
  41. package/public/types/node/child_process.d.ts +1109 -257
  42. package/public/types/node/cluster.d.ts +349 -200
  43. package/public/types/node/console.d.ts +313 -43
  44. package/public/types/node/crypto.d.ts +3329 -656
  45. package/public/types/node/dgram.d.ts +459 -58
  46. package/public/types/node/diagnostics_channel.d.ts +155 -0
  47. package/public/types/node/dns/promises.d.ts +371 -0
  48. package/public/types/node/dns.d.ts +532 -265
  49. package/public/types/node/domain.d.ts +159 -16
  50. package/public/types/node/events.d.ts +589 -30
  51. package/public/types/node/fs/promises.d.ts +1097 -0
  52. package/public/types/node/fs.d.ts +2484 -958
  53. package/public/types/node/globals.d.ts +43 -503
  54. package/public/types/node/http.d.ts +1156 -145
  55. package/public/types/node/http2.d.ts +1610 -470
  56. package/public/types/node/https.d.ts +462 -72
  57. package/public/types/node/module.d.ts +72 -13
  58. package/public/types/node/net.d.ts +663 -131
  59. package/public/types/node/os.d.ts +238 -25
  60. package/public/types/node/path.d.ts +57 -23
  61. package/public/types/node/perf_hooks.d.ts +424 -112
  62. package/public/types/node/process.d.ts +1261 -193
  63. package/public/types/node/querystring.d.ts +107 -7
  64. package/public/types/node/readline.d.ts +443 -74
  65. package/public/types/node/stream/consumers.d.ts +15 -0
  66. package/public/types/node/stream/promises.d.ts +45 -0
  67. package/public/types/node/stream/web.d.ts +395 -0
  68. package/public/types/node/stream.d.ts +1081 -177
  69. package/public/types/node/string_decoder.d.ts +57 -0
  70. package/public/types/node/test.d.ts +193 -0
  71. package/public/types/node/timers/promises.d.ts +96 -0
  72. package/public/types/node/timers.d.ts +87 -12
  73. package/public/types/node/tls.d.ts +457 -222
  74. package/public/types/node/trace_events.d.ts +107 -10
  75. package/public/types/node/tty.d.ts +158 -23
  76. package/public/types/node/url.d.ts +734 -28
  77. package/public/types/node/util.d.ts +1542 -164
  78. package/public/types/node/v8.d.ts +261 -73
  79. package/public/types/node/vm.d.ts +384 -32
  80. package/public/types/node/wasi.d.ts +92 -23
  81. package/public/types/node/worker_threads.d.ts +531 -123
  82. package/public/types/node/zlib.d.ts +216 -63
  83. package/public/types/node-red/func.d.ts +3 -0
  84. package/public/vendor/jquery/css/base/images/ui-icons_444444_256x240.png +0 -0
  85. package/public/vendor/jquery/css/base/images/ui-icons_555555_256x240.png +0 -0
  86. package/public/vendor/jquery/css/base/images/ui-icons_777620_256x240.png +0 -0
  87. package/public/vendor/jquery/css/base/images/ui-icons_777777_256x240.png +0 -0
  88. package/public/vendor/jquery/css/base/images/ui-icons_cc0000_256x240.png +0 -0
  89. package/public/vendor/jquery/css/base/images/ui-icons_ffffff_256x240.png +0 -0
  90. package/public/vendor/jquery/css/base/jquery-ui.min.css +4 -4
  91. package/public/vendor/mermaid/mermaid.min.js +1284 -0
  92. package/public/vendor/monaco/dist/{ade705761eb7e702770d.ttf → 7064e66c3890a12c47b4.ttf} +0 -0
  93. package/public/vendor/monaco/dist/css.worker.js +1 -1
  94. package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
  95. package/public/vendor/monaco/dist/editor.js +1 -1
  96. package/public/vendor/monaco/dist/editor.js.LICENSE.txt +5 -1
  97. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  98. package/public/vendor/monaco/dist/html.worker.js +1 -1
  99. package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
  100. package/public/vendor/monaco/dist/json.worker.js +1 -1
  101. package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
  102. package/public/vendor/monaco/dist/locale/cs.js +319 -71
  103. package/public/vendor/monaco/dist/locale/de.js +323 -75
  104. package/public/vendor/monaco/dist/locale/es.js +318 -70
  105. package/public/vendor/monaco/dist/locale/fr.js +327 -79
  106. package/public/vendor/monaco/dist/locale/it.js +325 -77
  107. package/public/vendor/monaco/dist/locale/ja.js +337 -89
  108. package/public/vendor/monaco/dist/locale/ko.js +324 -76
  109. package/public/vendor/monaco/dist/locale/pl.js +322 -74
  110. package/public/vendor/monaco/dist/locale/pt-br.js +321 -73
  111. package/public/vendor/monaco/dist/locale/qps-ploc.js +1580 -1332
  112. package/public/vendor/monaco/dist/locale/ru.js +324 -76
  113. package/public/vendor/monaco/dist/locale/tr.js +326 -78
  114. package/public/vendor/monaco/dist/locale/zh-hans.js +328 -80
  115. package/public/vendor/monaco/dist/locale/zh-hant.js +321 -73
  116. package/public/vendor/monaco/dist/theme/forge.json +236 -0
  117. package/public/vendor/monaco/dist/theme/github-dark.json +348 -0
  118. package/public/vendor/monaco/dist/theme/github-light.json +348 -0
  119. package/public/vendor/monaco/dist/theme/nord.json +93 -0
  120. package/public/vendor/monaco/dist/ts.worker.js +1 -1
  121. package/public/vendor/monaco/dist/ts.worker.js.LICENSE.txt +14 -6
  122. package/public/vendor/vendor.js +9 -15
  123. /package/public/red/tours/{images → 3.0/images}/continuous-search.png +0 -0
  124. /package/public/red/tours/{images → 3.0/images}/debug-path-tooltip.png +0 -0
  125. /package/public/red/tours/{images → 3.0/images}/junction-quick-add.png +0 -0
  126. /package/public/red/tours/{images → 3.0/images}/junction-slice.gif +0 -0
  127. /package/public/red/tours/{images → 3.0/images}/split-wire-with-links.gif +0 -0
@@ -1,9 +1,19 @@
1
1
 
2
2
  /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
3
3
 
4
+ /**
5
+ * The `url` module provides utilities for URL resolution and parsing. It can be
6
+ * accessed using:
7
+ *
8
+ * ```js
9
+ * import url from 'url';
10
+ * ```
11
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/url.js)
12
+ */
4
13
  declare module 'url' {
5
- import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
6
-
14
+ import { Blob } from 'node:buffer';
15
+ import { ClientRequestArgs } from 'node:http';
16
+ import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring';
7
17
  // Input to `url.format`
8
18
  interface UrlObject {
9
19
  auth?: string | null | undefined;
@@ -18,7 +28,6 @@ declare module 'url' {
18
28
  port?: string | number | null | undefined;
19
29
  query?: string | null | ParsedUrlQueryInput | undefined;
20
30
  }
21
-
22
31
  // Output of `url.parse`
23
32
  interface Url {
24
33
  auth: string | null;
@@ -34,85 +43,782 @@ declare module 'url' {
34
43
  port: string | null;
35
44
  query: string | null | ParsedUrlQuery;
36
45
  }
37
-
38
46
  interface UrlWithParsedQuery extends Url {
39
47
  query: ParsedUrlQuery;
40
48
  }
41
-
42
49
  interface UrlWithStringQuery extends Url {
43
50
  query: string | null;
44
51
  }
45
-
46
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
47
- function parse(urlStr: string): UrlWithStringQuery;
48
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
49
- function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
50
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
51
- function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
52
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
53
- function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
54
-
55
- function format(URL: URL, options?: URLFormatOptions): string;
56
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
52
+ /**
53
+ * The `url.parse()` method takes a URL string, parses it, and returns a URL
54
+ * object.
55
+ *
56
+ * A `TypeError` is thrown if `urlString` is not a string.
57
+ *
58
+ * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
59
+ *
60
+ * Use of the legacy `url.parse()` method is discouraged. Users should
61
+ * use the WHATWG `URL` API. Because the `url.parse()` method uses a
62
+ * lenient, non-standard algorithm for parsing URL strings, security
63
+ * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and
64
+ * incorrect handling of usernames and passwords have been identified.
65
+ *
66
+ * Deprecation of this API has been shelved for now primarily due to the the
67
+ * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373).
68
+ * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this.
69
+ *
70
+ * @since v0.1.25
71
+ * @param urlString The URL string to parse.
72
+ * @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
73
+ * on the returned URL object will be an unparsed, undecoded string.
74
+ * @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
75
+ * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
76
+ */
77
+ function parse(urlString: string): UrlWithStringQuery;
78
+ function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
79
+ function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
80
+ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
81
+ /**
82
+ * The URL object has both a `toString()` method and `href` property that return string serializations of the URL.
83
+ * These are not, however, customizable in any way. The `url.format(URL[, options])` method allows for basic
84
+ * customization of the output.
85
+ * Returns a customizable serialization of a URL `String` representation of a `WHATWG URL` object.
86
+ *
87
+ * ```js
88
+ * import url from 'url';
89
+ * const myURL = new URL('https://a:b@測試?abc#foo');
90
+ *
91
+ * console.log(myURL.href);
92
+ * // Prints https://a:b@xn--g6w251d/?abc#foo
93
+ *
94
+ * console.log(myURL.toString());
95
+ * // Prints https://a:b@xn--g6w251d/?abc#foo
96
+ *
97
+ * console.log(url.format(myURL, { fragment: false, unicode: true, auth: false }));
98
+ * // Prints 'https://測試/?abc'
99
+ * ```
100
+ * @since v7.6.0
101
+ * @param urlObject A `WHATWG URL` object
102
+ * @param options
103
+ */
104
+ function format(urlObject: URL, options?: URLFormatOptions): string;
105
+ /**
106
+ * The `url.format()` method returns a formatted URL string derived from`urlObject`.
107
+ *
108
+ * ```js
109
+ * const url = require('url');
110
+ * url.format({
111
+ * protocol: 'https',
112
+ * hostname: 'example.com',
113
+ * pathname: '/some/path',
114
+ * query: {
115
+ * page: 1,
116
+ * format: 'json'
117
+ * }
118
+ * });
119
+ *
120
+ * // => 'https://example.com/some/path?page=1&format=json'
121
+ * ```
122
+ *
123
+ * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
124
+ *
125
+ * The formatting process operates as follows:
126
+ *
127
+ * * A new empty string `result` is created.
128
+ * * If `urlObject.protocol` is a string, it is appended as-is to `result`.
129
+ * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
130
+ * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
131
+ * colon (`:`) character, the literal string `:` will be appended to `result`.
132
+ * * If either of the following conditions is true, then the literal string `//`will be appended to `result`:
133
+ * * `urlObject.slashes` property is true;
134
+ * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`;
135
+ * * 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
136
+ * and appended to `result`followed by the literal string `@`.
137
+ * * If the `urlObject.host` property is `undefined` then:
138
+ * * If the `urlObject.hostname` is a string, it is appended to `result`.
139
+ * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
140
+ * an `Error` is thrown.
141
+ * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`:
142
+ * * The literal string `:` is appended to `result`, and
143
+ * * The value of `urlObject.port` is coerced to a string and appended to`result`.
144
+ * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`.
145
+ * * If the `urlObject.pathname` property is a string that is not an empty string:
146
+ * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash
147
+ * (`/`), then the literal string `'/'` is appended to `result`.
148
+ * * The value of `urlObject.pathname` is appended to `result`.
149
+ * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
150
+ * * 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
151
+ * `querystring` module's `stringify()`method passing the value of `urlObject.query`.
152
+ * * Otherwise, if `urlObject.search` is a string:
153
+ * * If the value of `urlObject.search`_does not start_ with the ASCII question
154
+ * mark (`?`) character, the literal string `?` is appended to `result`.
155
+ * * The value of `urlObject.search` is appended to `result`.
156
+ * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
157
+ * * If the `urlObject.hash` property is a string:
158
+ * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`)
159
+ * character, the literal string `#` is appended to `result`.
160
+ * * The value of `urlObject.hash` is appended to `result`.
161
+ * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
162
+ * string, an `Error` is thrown.
163
+ * * `result` is returned.
164
+ * @since v0.1.25
165
+ * @deprecated Legacy: Use the WHATWG URL API instead.
166
+ * @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()`.
167
+ */
57
168
  function format(urlObject: UrlObject | string): string;
58
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
169
+ /**
170
+ * The `url.resolve()` method resolves a target URL relative to a base URL in a
171
+ * manner similar to that of a Web browser resolving an anchor tag HREF.
172
+ *
173
+ * ```js
174
+ * const url = require('url');
175
+ * url.resolve('/one/two/three', 'four'); // '/one/two/four'
176
+ * url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
177
+ * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
178
+ * ```
179
+ *
180
+ * You can achieve the same result using the WHATWG URL API:
181
+ *
182
+ * ```js
183
+ * function resolve(from, to) {
184
+ * const resolvedUrl = new URL(to, new URL(from, 'resolve://'));
185
+ * if (resolvedUrl.protocol === 'resolve:') {
186
+ * // `from` is a relative URL.
187
+ * const { pathname, search, hash } = resolvedUrl;
188
+ * return pathname + search + hash;
189
+ * }
190
+ * return resolvedUrl.toString();
191
+ * }
192
+ *
193
+ * resolve('/one/two/three', 'four'); // '/one/two/four'
194
+ * resolve('http://example.com/', '/one'); // 'http://example.com/one'
195
+ * resolve('http://example.com/one', '/two'); // 'http://example.com/two'
196
+ * ```
197
+ * @since v0.1.25
198
+ * @deprecated Legacy: Use the WHATWG URL API instead.
199
+ * @param from The Base URL being resolved against.
200
+ * @param to The HREF URL being resolved.
201
+ */
59
202
  function resolve(from: string, to: string): string;
60
-
203
+ /**
204
+ * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an
205
+ * invalid domain, the empty string is returned.
206
+ *
207
+ * It performs the inverse operation to {@link domainToUnicode}.
208
+ *
209
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
210
+ *
211
+ * ```js
212
+ * import url from 'url';
213
+ *
214
+ * console.log(url.domainToASCII('español.com'));
215
+ * // Prints xn--espaol-zwa.com
216
+ * console.log(url.domainToASCII('中文.com'));
217
+ * // Prints xn--fiq228c.com
218
+ * console.log(url.domainToASCII('xn--iñvalid.com'));
219
+ * // Prints an empty string
220
+ * ```
221
+ * @since v7.4.0, v6.13.0
222
+ */
61
223
  function domainToASCII(domain: string): string;
224
+ /**
225
+ * Returns the Unicode serialization of the `domain`. If `domain` is an invalid
226
+ * domain, the empty string is returned.
227
+ *
228
+ * It performs the inverse operation to {@link domainToASCII}.
229
+ *
230
+ * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
231
+ *
232
+ * ```js
233
+ * import url from 'url';
234
+ *
235
+ * console.log(url.domainToUnicode('xn--espaol-zwa.com'));
236
+ * // Prints español.com
237
+ * console.log(url.domainToUnicode('xn--fiq228c.com'));
238
+ * // Prints 中文.com
239
+ * console.log(url.domainToUnicode('xn--iñvalid.com'));
240
+ * // Prints an empty string
241
+ * ```
242
+ * @since v7.4.0, v6.13.0
243
+ */
62
244
  function domainToUnicode(domain: string): string;
63
-
64
245
  /**
65
246
  * This function ensures the correct decodings of percent-encoded characters as
66
247
  * well as ensuring a cross-platform valid absolute path string.
248
+ *
249
+ * ```js
250
+ * import { fileURLToPath } from 'url';
251
+ *
252
+ * const __filename = fileURLToPath(import.meta.url);
253
+ *
254
+ * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/
255
+ * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows)
256
+ *
257
+ * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt
258
+ * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows)
259
+ *
260
+ * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt
261
+ * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX)
262
+ *
263
+ * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
264
+ * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
265
+ * ```
266
+ * @since v10.12.0
67
267
  * @param url The file URL string or URL object to convert to a path.
268
+ * @return The fully-resolved platform-specific Node.js file path.
68
269
  */
69
270
  function fileURLToPath(url: string | URL): string;
70
-
71
271
  /**
72
- * This function ensures that path is resolved absolutely, and that the URL
272
+ * This function ensures that `path` is resolved absolutely, and that the URL
73
273
  * control characters are correctly encoded when converting into a File URL.
74
- * @param url The path to convert to a File URL.
274
+ *
275
+ * ```js
276
+ * import { pathToFileURL } from 'url';
277
+ *
278
+ * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
279
+ * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
280
+ *
281
+ * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
282
+ * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
283
+ * ```
284
+ * @since v10.12.0
285
+ * @param path The path to convert to a File URL.
286
+ * @return The file URL object.
75
287
  */
76
- function pathToFileURL(url: string): URL;
77
-
288
+ function pathToFileURL(path: string): URL;
289
+ /**
290
+ * This utility function converts a URL object into an ordinary options object as
291
+ * expected by the `http.request()` and `https.request()` APIs.
292
+ *
293
+ * ```js
294
+ * import { urlToHttpOptions } from 'url';
295
+ * const myURL = new URL('https://a:b@測試?abc#foo');
296
+ *
297
+ * console.log(urlToHttpOptions(myURL));
298
+ *
299
+ * {
300
+ * protocol: 'https:',
301
+ * hostname: 'xn--g6w251d',
302
+ * hash: '#foo',
303
+ * search: '?abc',
304
+ * pathname: '/',
305
+ * path: '/?abc',
306
+ * href: 'https://a:b@xn--g6w251d/?abc#foo',
307
+ * auth: 'a:b'
308
+ * }
309
+ *
310
+ * ```
311
+ * @since v15.7.0
312
+ * @param url The `WHATWG URL` object to convert to an options object.
313
+ * @return Options object
314
+ */
315
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
78
316
  interface URLFormatOptions {
79
317
  auth?: boolean | undefined;
80
318
  fragment?: boolean | undefined;
81
319
  search?: boolean | undefined;
82
320
  unicode?: boolean | undefined;
83
321
  }
84
-
322
+ /**
323
+ * Browser-compatible `URL` class, implemented by following the WHATWG URL
324
+ * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself.
325
+ * The `URL` class is also available on the global object.
326
+ *
327
+ * In accordance with browser conventions, all properties of `URL` objects
328
+ * are implemented as getters and setters on the class prototype, rather than as
329
+ * data properties on the object itself. Thus, unlike `legacy urlObject` s,
330
+ * 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
331
+ * return `true`.
332
+ * @since v7.0.0, v6.13.0
333
+ */
85
334
  class URL {
335
+ /**
336
+ * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
337
+ *
338
+ * ```js
339
+ * const {
340
+ * Blob,
341
+ * resolveObjectURL,
342
+ * } = require('buffer');
343
+ *
344
+ * const blob = new Blob(['hello']);
345
+ * const id = URL.createObjectURL(blob);
346
+ *
347
+ * // later...
348
+ *
349
+ * const otherBlob = resolveObjectURL(id);
350
+ * console.log(otherBlob.size);
351
+ * ```
352
+ *
353
+ * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it.
354
+ *
355
+ * `Blob` objects are registered within the current thread. If using Worker
356
+ * Threads, `Blob` objects registered within one Worker will not be available
357
+ * to other workers or the main thread.
358
+ * @since v16.7.0
359
+ * @experimental
360
+ */
361
+ static createObjectURL(blob: Blob): string;
362
+ /**
363
+ * Removes the stored `Blob` identified by the given ID.
364
+ * @since v16.7.0
365
+ * @experimental
366
+ * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
367
+ */
368
+ static revokeObjectURL(objectUrl: string): void;
86
369
  constructor(input: string, base?: string | URL);
370
+ /**
371
+ * Gets and sets the fragment portion of the URL.
372
+ *
373
+ * ```js
374
+ * const myURL = new URL('https://example.org/foo#bar');
375
+ * console.log(myURL.hash);
376
+ * // Prints #bar
377
+ *
378
+ * myURL.hash = 'baz';
379
+ * console.log(myURL.href);
380
+ * // Prints https://example.org/foo#baz
381
+ * ```
382
+ *
383
+ * Invalid URL characters included in the value assigned to the `hash` property
384
+ * are `percent-encoded`. The selection of which characters to
385
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
386
+ */
87
387
  hash: string;
388
+ /**
389
+ * Gets and sets the host portion of the URL.
390
+ *
391
+ * ```js
392
+ * const myURL = new URL('https://example.org:81/foo');
393
+ * console.log(myURL.host);
394
+ * // Prints example.org:81
395
+ *
396
+ * myURL.host = 'example.com:82';
397
+ * console.log(myURL.href);
398
+ * // Prints https://example.com:82/foo
399
+ * ```
400
+ *
401
+ * Invalid host values assigned to the `host` property are ignored.
402
+ */
88
403
  host: string;
404
+ /**
405
+ * 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
406
+ * port.
407
+ *
408
+ * ```js
409
+ * const myURL = new URL('https://example.org:81/foo');
410
+ * console.log(myURL.hostname);
411
+ * // Prints example.org
412
+ *
413
+ * // Setting the hostname does not change the port
414
+ * myURL.hostname = 'example.com:82';
415
+ * console.log(myURL.href);
416
+ * // Prints https://example.com:81/foo
417
+ *
418
+ * // Use myURL.host to change the hostname and port
419
+ * myURL.host = 'example.org:82';
420
+ * console.log(myURL.href);
421
+ * // Prints https://example.org:82/foo
422
+ * ```
423
+ *
424
+ * Invalid host name values assigned to the `hostname` property are ignored.
425
+ */
89
426
  hostname: string;
427
+ /**
428
+ * Gets and sets the serialized URL.
429
+ *
430
+ * ```js
431
+ * const myURL = new URL('https://example.org/foo');
432
+ * console.log(myURL.href);
433
+ * // Prints https://example.org/foo
434
+ *
435
+ * myURL.href = 'https://example.com/bar';
436
+ * console.log(myURL.href);
437
+ * // Prints https://example.com/bar
438
+ * ```
439
+ *
440
+ * Getting the value of the `href` property is equivalent to calling {@link toString}.
441
+ *
442
+ * Setting the value of this property to a new value is equivalent to creating a
443
+ * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified.
444
+ *
445
+ * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown.
446
+ */
90
447
  href: string;
448
+ /**
449
+ * Gets the read-only serialization of the URL's origin.
450
+ *
451
+ * ```js
452
+ * const myURL = new URL('https://example.org/foo/bar?baz');
453
+ * console.log(myURL.origin);
454
+ * // Prints https://example.org
455
+ * ```
456
+ *
457
+ * ```js
458
+ * const idnURL = new URL('https://測試');
459
+ * console.log(idnURL.origin);
460
+ * // Prints https://xn--g6w251d
461
+ *
462
+ * console.log(idnURL.hostname);
463
+ * // Prints xn--g6w251d
464
+ * ```
465
+ */
91
466
  readonly origin: string;
467
+ /**
468
+ * Gets and sets the password portion of the URL.
469
+ *
470
+ * ```js
471
+ * const myURL = new URL('https://abc:xyz@example.com');
472
+ * console.log(myURL.password);
473
+ * // Prints xyz
474
+ *
475
+ * myURL.password = '123';
476
+ * console.log(myURL.href);
477
+ * // Prints https://abc:123@example.com
478
+ * ```
479
+ *
480
+ * Invalid URL characters included in the value assigned to the `password` property
481
+ * are `percent-encoded`. The selection of which characters to
482
+ * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
483
+ */
92
484
  password: string;
485
+ /**
486
+ * Gets and sets the path portion of the URL.
487
+ *
488
+ * ```js
489
+ * const myURL = new URL('https://example.org/abc/xyz?123');
490
+ * console.log(myURL.pathname);
491
+ * // Prints /abc/xyz
492
+ *
493
+ * myURL.pathname = '/abcdef';
494
+ * console.log(myURL.href);
495
+ * // Prints https://example.org/abcdef?123
496
+ * ```
497
+ *
498
+ * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters
499
+ * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
500
+ */
93
501
  pathname: string;
502
+ /**
503
+ * Gets and sets the port portion of the URL.
504
+ *
505
+ * 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
506
+ * result in the `port` value becoming
507
+ * the empty string (`''`).
508
+ *
509
+ * The port value can be an empty string in which case the port depends on
510
+ * the protocol/scheme:
511
+ *
512
+ * <omitted>
513
+ *
514
+ * Upon assigning a value to the port, the value will first be converted to a
515
+ * string using `.toString()`.
516
+ *
517
+ * If that string is invalid but it begins with a number, the leading number is
518
+ * assigned to `port`.
519
+ * If the number lies outside the range denoted above, it is ignored.
520
+ *
521
+ * ```js
522
+ * const myURL = new URL('https://example.org:8888');
523
+ * console.log(myURL.port);
524
+ * // Prints 8888
525
+ *
526
+ * // Default ports are automatically transformed to the empty string
527
+ * // (HTTPS protocol's default port is 443)
528
+ * myURL.port = '443';
529
+ * console.log(myURL.port);
530
+ * // Prints the empty string
531
+ * console.log(myURL.href);
532
+ * // Prints https://example.org/
533
+ *
534
+ * myURL.port = 1234;
535
+ * console.log(myURL.port);
536
+ * // Prints 1234
537
+ * console.log(myURL.href);
538
+ * // Prints https://example.org:1234/
539
+ *
540
+ * // Completely invalid port strings are ignored
541
+ * myURL.port = 'abcd';
542
+ * console.log(myURL.port);
543
+ * // Prints 1234
544
+ *
545
+ * // Leading numbers are treated as a port number
546
+ * myURL.port = '5678abcd';
547
+ * console.log(myURL.port);
548
+ * // Prints 5678
549
+ *
550
+ * // Non-integers are truncated
551
+ * myURL.port = 1234.5678;
552
+ * console.log(myURL.port);
553
+ * // Prints 1234
554
+ *
555
+ * // Out-of-range numbers which are not represented in scientific notation
556
+ * // will be ignored.
557
+ * myURL.port = 1e10; // 10000000000, will be range-checked as described below
558
+ * console.log(myURL.port);
559
+ * // Prints 1234
560
+ * ```
561
+ *
562
+ * Numbers which contain a decimal point,
563
+ * such as floating-point numbers or numbers in scientific notation,
564
+ * are not an exception to this rule.
565
+ * Leading numbers up to the decimal point will be set as the URL's port,
566
+ * assuming they are valid:
567
+ *
568
+ * ```js
569
+ * myURL.port = 4.567e21;
570
+ * console.log(myURL.port);
571
+ * // Prints 4 (because it is the leading number in the string '4.567e21')
572
+ * ```
573
+ */
94
574
  port: string;
575
+ /**
576
+ * Gets and sets the protocol portion of the URL.
577
+ *
578
+ * ```js
579
+ * const myURL = new URL('https://example.org');
580
+ * console.log(myURL.protocol);
581
+ * // Prints https:
582
+ *
583
+ * myURL.protocol = 'ftp';
584
+ * console.log(myURL.href);
585
+ * // Prints ftp://example.org/
586
+ * ```
587
+ *
588
+ * Invalid URL protocol values assigned to the `protocol` property are ignored.
589
+ */
95
590
  protocol: string;
591
+ /**
592
+ * Gets and sets the serialized query portion of the URL.
593
+ *
594
+ * ```js
595
+ * const myURL = new URL('https://example.org/abc?123');
596
+ * console.log(myURL.search);
597
+ * // Prints ?123
598
+ *
599
+ * myURL.search = 'abc=xyz';
600
+ * console.log(myURL.href);
601
+ * // Prints https://example.org/abc?abc=xyz
602
+ * ```
603
+ *
604
+ * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which
605
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
606
+ */
96
607
  search: string;
608
+ /**
609
+ * Gets the `URLSearchParams` object representing the query parameters of the
610
+ * URL. This property is read-only but the `URLSearchParams` object it provides
611
+ * can be used to mutate the URL instance; to replace the entirety of query
612
+ * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details.
613
+ *
614
+ * Use care when using `.searchParams` to modify the `URL` because,
615
+ * per the WHATWG specification, the `URLSearchParams` object uses
616
+ * different rules to determine which characters to percent-encode. For
617
+ * instance, the `URL` object will not percent encode the ASCII tilde (`~`)
618
+ * character, while `URLSearchParams` will always encode it:
619
+ *
620
+ * ```js
621
+ * const myUrl = new URL('https://example.org/abc?foo=~bar');
622
+ *
623
+ * console.log(myUrl.search); // prints ?foo=~bar
624
+ *
625
+ * // Modify the URL via searchParams...
626
+ * myUrl.searchParams.sort();
627
+ *
628
+ * console.log(myUrl.search); // prints ?foo=%7Ebar
629
+ * ```
630
+ */
97
631
  readonly searchParams: URLSearchParams;
632
+ /**
633
+ * Gets and sets the username portion of the URL.
634
+ *
635
+ * ```js
636
+ * const myURL = new URL('https://abc:xyz@example.com');
637
+ * console.log(myURL.username);
638
+ * // Prints abc
639
+ *
640
+ * myURL.username = '123';
641
+ * console.log(myURL.href);
642
+ * // Prints https://123:xyz@example.com/
643
+ * ```
644
+ *
645
+ * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which
646
+ * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce.
647
+ */
98
648
  username: string;
649
+ /**
650
+ * The `toString()` method on the `URL` object returns the serialized URL. The
651
+ * value returned is equivalent to that of {@link href} and {@link toJSON}.
652
+ */
99
653
  toString(): string;
654
+ /**
655
+ * The `toJSON()` method on the `URL` object returns the serialized URL. The
656
+ * value returned is equivalent to that of {@link href} and {@link toString}.
657
+ *
658
+ * This method is automatically called when an `URL` object is serialized
659
+ * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).
660
+ *
661
+ * ```js
662
+ * const myURLs = [
663
+ * new URL('https://www.example.com'),
664
+ * new URL('https://test.example.org'),
665
+ * ];
666
+ * console.log(JSON.stringify(myURLs));
667
+ * // Prints ["https://www.example.com/","https://test.example.org/"]
668
+ * ```
669
+ */
100
670
  toJSON(): string;
101
671
  }
102
-
672
+ /**
673
+ * 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
674
+ * four following constructors.
675
+ * The `URLSearchParams` class is also available on the global object.
676
+ *
677
+ * The WHATWG `URLSearchParams` interface and the `querystring` module have
678
+ * similar purpose, but the purpose of the `querystring` module is more
679
+ * general, as it allows the customization of delimiter characters (`&#x26;` and `=`).
680
+ * On the other hand, this API is designed purely for URL query strings.
681
+ *
682
+ * ```js
683
+ * const myURL = new URL('https://example.org/?abc=123');
684
+ * console.log(myURL.searchParams.get('abc'));
685
+ * // Prints 123
686
+ *
687
+ * myURL.searchParams.append('abc', 'xyz');
688
+ * console.log(myURL.href);
689
+ * // Prints https://example.org/?abc=123&#x26;abc=xyz
690
+ *
691
+ * myURL.searchParams.delete('abc');
692
+ * myURL.searchParams.set('a', 'b');
693
+ * console.log(myURL.href);
694
+ * // Prints https://example.org/?a=b
695
+ *
696
+ * const newSearchParams = new URLSearchParams(myURL.searchParams);
697
+ * // The above is equivalent to
698
+ * // const newSearchParams = new URLSearchParams(myURL.search);
699
+ *
700
+ * newSearchParams.append('a', 'c');
701
+ * console.log(myURL.href);
702
+ * // Prints https://example.org/?a=b
703
+ * console.log(newSearchParams.toString());
704
+ * // Prints a=b&#x26;a=c
705
+ *
706
+ * // newSearchParams.toString() is implicitly called
707
+ * myURL.search = newSearchParams;
708
+ * console.log(myURL.href);
709
+ * // Prints https://example.org/?a=b&#x26;a=c
710
+ * newSearchParams.delete('a');
711
+ * console.log(myURL.href);
712
+ * // Prints https://example.org/?a=b&#x26;a=c
713
+ * ```
714
+ * @since v7.5.0, v6.13.0
715
+ */
103
716
  class URLSearchParams implements Iterable<[string, string]> {
104
717
  constructor(init?: URLSearchParams | string | Record<string, string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
718
+ /**
719
+ * Append a new name-value pair to the query string.
720
+ */
105
721
  append(name: string, value: string): void;
722
+ /**
723
+ * Remove all name-value pairs whose name is `name`.
724
+ */
106
725
  delete(name: string): void;
726
+ /**
727
+ * Returns an ES6 `Iterator` over each of the name-value pairs in the query.
728
+ * 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`.
729
+ *
730
+ * Alias for `urlSearchParams[@@iterator]()`.
731
+ */
107
732
  entries(): IterableIterator<[string, string]>;
108
- forEach(callback: (value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: any): void;
733
+ /**
734
+ * Iterates over each name-value pair in the query and invokes the given function.
735
+ *
736
+ * ```js
737
+ * const myURL = new URL('https://example.org/?a=b&#x26;c=d');
738
+ * myURL.searchParams.forEach((value, name, searchParams) => {
739
+ * console.log(name, value, myURL.searchParams === searchParams);
740
+ * });
741
+ * // Prints:
742
+ * // a b true
743
+ * // c d true
744
+ * ```
745
+ * @param fn Invoked for each name-value pair in the query
746
+ * @param thisArg To be used as `this` value for when `fn` is called
747
+ */
748
+ forEach<TThis = this>(callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: TThis): void;
749
+ /**
750
+ * Returns the value of the first name-value pair whose name is `name`. If there
751
+ * are no such pairs, `null` is returned.
752
+ * @return or `null` if there is no name-value pair with the given `name`.
753
+ */
109
754
  get(name: string): string | null;
755
+ /**
756
+ * Returns the values of all name-value pairs whose name is `name`. If there are
757
+ * no such pairs, an empty array is returned.
758
+ */
110
759
  getAll(name: string): string[];
760
+ /**
761
+ * Returns `true` if there is at least one name-value pair whose name is `name`.
762
+ */
111
763
  has(name: string): boolean;
764
+ /**
765
+ * Returns an ES6 `Iterator` over the names of each name-value pair.
766
+ *
767
+ * ```js
768
+ * const params = new URLSearchParams('foo=bar&#x26;foo=baz');
769
+ * for (const name of params.keys()) {
770
+ * console.log(name);
771
+ * }
772
+ * // Prints:
773
+ * // foo
774
+ * // foo
775
+ * ```
776
+ */
112
777
  keys(): IterableIterator<string>;
778
+ /**
779
+ * 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`,
780
+ * set the first such pair's value to `value` and remove all others. If not,
781
+ * append the name-value pair to the query string.
782
+ *
783
+ * ```js
784
+ * const params = new URLSearchParams();
785
+ * params.append('foo', 'bar');
786
+ * params.append('foo', 'baz');
787
+ * params.append('abc', 'def');
788
+ * console.log(params.toString());
789
+ * // Prints foo=bar&#x26;foo=baz&#x26;abc=def
790
+ *
791
+ * params.set('foo', 'def');
792
+ * params.set('xyz', 'opq');
793
+ * console.log(params.toString());
794
+ * // Prints foo=def&#x26;abc=def&#x26;xyz=opq
795
+ * ```
796
+ */
113
797
  set(name: string, value: string): void;
798
+ /**
799
+ * Sort all existing name-value pairs in-place by their names. Sorting is done
800
+ * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs
801
+ * with the same name is preserved.
802
+ *
803
+ * This method can be used, in particular, to increase cache hits.
804
+ *
805
+ * ```js
806
+ * const params = new URLSearchParams('query[]=abc&#x26;type=search&#x26;query[]=123');
807
+ * params.sort();
808
+ * console.log(params.toString());
809
+ * // Prints query%5B%5D=abc&#x26;query%5B%5D=123&#x26;type=search
810
+ * ```
811
+ * @since v7.7.0, v6.13.0
812
+ */
114
813
  sort(): void;
814
+ /**
815
+ * Returns the search parameters serialized as a string, with characters
816
+ * percent-encoded where necessary.
817
+ */
115
818
  toString(): string;
819
+ /**
820
+ * Returns an ES6 `Iterator` over the values of each name-value pair.
821
+ */
116
822
  values(): IterableIterator<string>;
117
823
  [Symbol.iterator](): IterableIterator<[string, string]>;
118
824
  }