cloudstructs 0.9.19 → 0.9.20
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.
- package/.jsii +3 -3
- package/assets/slack-textract/detect.lambda/index.js +21 -10
- package/lib/codecommit-mirror/index.js +2 -2
- package/lib/dmarc/index.js +1 -1
- package/lib/ecs-service-roller/index.js +2 -2
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/mjml-template/index.js +1 -1
- package/lib/saml-identity-provider/index.js +2 -2
- package/lib/slack-app/manifest.js +1 -1
- package/lib/slack-app/slack-app.js +2 -2
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/ssl-server-test/index.js +1 -1
- package/lib/state-machine-cr-provider/index.js +1 -1
- package/lib/static-website/index.js +1 -1
- package/lib/toolkit-cleaner/index.js +1 -1
- package/lib/url-shortener/index.js +1 -1
- package/node_modules/@babel/runtime/helpers/esm/superPropGet.js +4 -4
- package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +2 -2
- package/node_modules/@babel/runtime/helpers/superPropGet.js +4 -4
- package/node_modules/@babel/runtime/helpers/superPropSet.js +2 -2
- package/node_modules/@babel/runtime/package.json +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@slack/logger/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@slack/logger/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/node_modules/@slack/logger/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +10 -9
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +15 -4
- package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +17 -48
- package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +37 -0
- package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +8 -10
- package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +91 -0
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +4 -3
- package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +24 -0
- package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +5 -2
- package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +17 -5
- package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +8 -10
- package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +7 -4
- package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +15 -10
- package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +81 -27
- package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +1 -1
- package/node_modules/@slack/web-api/dist/WebClient.d.ts +36 -4
- package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/WebClient.js +23 -10
- package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +10 -9
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +15 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +17 -48
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +37 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +8 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +91 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +4 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +5 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +17 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/index.d.ts +8 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +7 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +15 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +81 -27
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +1 -1
- package/node_modules/@slack/web-api/package.json +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +10 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +15 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +17 -48
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +37 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +8 -10
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +91 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +4 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +24 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +5 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +17 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +8 -10
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +7 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +15 -10
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +81 -27
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +10 -9
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +15 -4
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +17 -48
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +37 -0
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +8 -10
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +91 -0
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +4 -3
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +24 -0
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +5 -2
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +17 -5
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +8 -10
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +7 -4
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +15 -10
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +81 -27
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +10 -9
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +15 -4
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +17 -48
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +37 -0
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +8 -10
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +91 -0
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +4 -3
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +24 -0
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +5 -2
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +17 -5
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +8 -10
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +7 -4
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +15 -10
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +81 -27
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +1 -1
- package/node_modules/form-data/Readme.md +4 -4
- package/node_modules/form-data/lib/form_data.js +1 -1
- package/node_modules/form-data/package.json +9 -6
- package/node_modules/parse5/dist/cjs/common/doctype.d.ts +0 -1
- package/node_modules/parse5/dist/cjs/common/doctype.js +2 -4
- package/node_modules/parse5/dist/cjs/common/error-codes.d.ts +0 -1
- package/node_modules/parse5/dist/cjs/common/error-codes.js +1 -2
- package/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +0 -1
- package/node_modules/parse5/dist/cjs/common/foreign-content.js +7 -9
- package/node_modules/parse5/dist/cjs/common/html.d.ts +32 -31
- package/node_modules/parse5/dist/cjs/common/html.js +41 -42
- package/node_modules/parse5/dist/cjs/common/token.d.ts +0 -1
- package/node_modules/parse5/dist/cjs/common/token.js +3 -4
- package/node_modules/parse5/dist/cjs/common/unicode.d.ts +1 -8
- package/node_modules/parse5/dist/cjs/common/unicode.js +7 -14
- package/node_modules/parse5/dist/cjs/index.d.ts +15 -4
- package/node_modules/parse5/dist/cjs/index.js +3 -6
- package/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +0 -1
- package/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +1 -2
- package/node_modules/parse5/dist/cjs/parser/index.d.ts +72 -8
- package/node_modules/parse5/dist/cjs/parser/index.js +81 -9
- package/node_modules/parse5/dist/cjs/parser/open-element-stack.d.ts +2 -2
- package/node_modules/parse5/dist/cjs/parser/open-element-stack.js +95 -87
- package/node_modules/parse5/dist/cjs/serializer/index.d.ts +1 -2
- package/node_modules/parse5/dist/cjs/serializer/index.js +8 -9
- package/node_modules/parse5/dist/cjs/tokenizer/index.d.ts +130 -131
- package/node_modules/parse5/dist/cjs/tokenizer/index.js +87 -281
- package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts +3 -4
- package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +8 -7
- package/node_modules/parse5/dist/cjs/tree-adapters/default.d.ts +0 -1
- package/node_modules/parse5/dist/cjs/tree-adapters/default.js +9 -10
- package/node_modules/parse5/dist/cjs/tree-adapters/interface.d.ts +7 -2
- package/node_modules/parse5/dist/cjs/tree-adapters/interface.js +0 -1
- package/node_modules/parse5/dist/common/doctype.d.ts +0 -1
- package/node_modules/parse5/dist/common/doctype.js +0 -1
- package/node_modules/parse5/dist/common/error-codes.d.ts +0 -1
- package/node_modules/parse5/dist/common/error-codes.js +1 -2
- package/node_modules/parse5/dist/common/foreign-content.d.ts +0 -1
- package/node_modules/parse5/dist/common/foreign-content.js +0 -2
- package/node_modules/parse5/dist/common/html.d.ts +32 -31
- package/node_modules/parse5/dist/common/html.js +38 -38
- package/node_modules/parse5/dist/common/token.d.ts +0 -1
- package/node_modules/parse5/dist/common/token.js +1 -2
- package/node_modules/parse5/dist/common/unicode.d.ts +1 -8
- package/node_modules/parse5/dist/common/unicode.js +1 -8
- package/node_modules/parse5/dist/index.d.ts +15 -4
- package/node_modules/parse5/dist/index.js +0 -3
- package/node_modules/parse5/dist/parser/formatting-element-list.d.ts +0 -1
- package/node_modules/parse5/dist/parser/formatting-element-list.js +1 -2
- package/node_modules/parse5/dist/parser/index.d.ts +72 -8
- package/node_modules/parse5/dist/parser/index.js +82 -10
- package/node_modules/parse5/dist/parser/open-element-stack.d.ts +2 -2
- package/node_modules/parse5/dist/parser/open-element-stack.js +96 -88
- package/node_modules/parse5/dist/serializer/index.d.ts +1 -2
- package/node_modules/parse5/dist/serializer/index.js +6 -6
- package/node_modules/parse5/dist/tokenizer/index.d.ts +130 -131
- package/node_modules/parse5/dist/tokenizer/index.js +88 -282
- package/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +3 -4
- package/node_modules/parse5/dist/tokenizer/preprocessor.js +8 -7
- package/node_modules/parse5/dist/tree-adapters/default.d.ts +0 -1
- package/node_modules/parse5/dist/tree-adapters/default.js +9 -10
- package/node_modules/parse5/dist/tree-adapters/interface.d.ts +7 -2
- package/node_modules/parse5/dist/tree-adapters/interface.js +0 -1
- package/node_modules/parse5/package.json +4 -4
- package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts +1 -2
- package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js +11 -12
- package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts +1 -2
- package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +9 -10
- package/node_modules/parse5-htmlparser2-tree-adapter/package.json +7 -6
- package/package.json +16 -16
- package/node_modules/@slack/logger/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/form-data/README.md.bak +0 -358
|
@@ -230,16 +230,23 @@ declare module "vm" {
|
|
|
230
230
|
*/
|
|
231
231
|
runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any;
|
|
232
232
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
233
|
+
* This method is a shortcut to `script.runInContext(vm.createContext(options), options)`.
|
|
234
|
+
* It does several things at once:
|
|
235
|
+
*
|
|
236
|
+
* 1. Creates a new context.
|
|
237
|
+
* 2. If `contextObject` is an object, contextifies it with the new context.
|
|
238
|
+
* If `contextObject` is undefined, creates a new object and contextifies it.
|
|
239
|
+
* If `contextObject` is `vm.constants.DONT_CONTEXTIFY`, don't contextify anything.
|
|
240
|
+
* 3. Runs the compiled code contained by the `vm.Script` object within the created context. The code
|
|
241
|
+
* does not have access to the scope in which this method is called.
|
|
242
|
+
* 4. Returns the result.
|
|
236
243
|
*
|
|
237
244
|
* The following example compiles code that sets a global variable, then executes
|
|
238
245
|
* the code multiple times in different contexts. The globals are set on and
|
|
239
246
|
* contained within each individual `context`.
|
|
240
247
|
*
|
|
241
248
|
* ```js
|
|
242
|
-
*
|
|
249
|
+
* const vm = require('node:vm');
|
|
243
250
|
*
|
|
244
251
|
* const script = new vm.Script('globalVar = "set"');
|
|
245
252
|
*
|
|
@@ -250,12 +257,22 @@ declare module "vm" {
|
|
|
250
257
|
*
|
|
251
258
|
* console.log(contexts);
|
|
252
259
|
* // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
|
|
260
|
+
*
|
|
261
|
+
* // This would throw if the context is created from a contextified object.
|
|
262
|
+
* // vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary
|
|
263
|
+
* // global objects that can be frozen.
|
|
264
|
+
* const freezeScript = new vm.Script('Object.freeze(globalThis); globalThis;');
|
|
265
|
+
* const frozenContext = freezeScript.runInNewContext(vm.constants.DONT_CONTEXTIFY);
|
|
253
266
|
* ```
|
|
254
267
|
* @since v0.3.1
|
|
255
|
-
* @param contextObject
|
|
268
|
+
* @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
|
|
269
|
+
* If `undefined`, an empty contextified object will be created for backwards compatibility.
|
|
256
270
|
* @return the result of the very last statement executed in the script.
|
|
257
271
|
*/
|
|
258
|
-
runInNewContext(
|
|
272
|
+
runInNewContext(
|
|
273
|
+
contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
|
|
274
|
+
options?: RunningScriptInNewContextOptions,
|
|
275
|
+
): any;
|
|
259
276
|
/**
|
|
260
277
|
* Runs the compiled code contained by the `vm.Script` within the context of the
|
|
261
278
|
* current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
|
|
@@ -347,17 +364,17 @@ declare module "vm" {
|
|
|
347
364
|
sourceMapURL?: string | undefined;
|
|
348
365
|
}
|
|
349
366
|
/**
|
|
350
|
-
* If given
|
|
367
|
+
* If the given `contextObject` is an object, the `vm.createContext()` method will
|
|
351
368
|
* [prepare that object](https://nodejs.org/docs/latest-v22.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
|
|
352
|
-
* and return a reference to it so that it can be used in
|
|
353
|
-
* [`script.runInContext()`](https://nodejs.org/docs/latest-v22.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
|
|
354
|
-
* scripts, the
|
|
355
|
-
* existing properties but also having the built-in objects and functions any
|
|
356
|
-
*
|
|
369
|
+
* and return a reference to it so that it can be used in calls to {@link runInContext} or
|
|
370
|
+
* [`script.runInContext()`](https://nodejs.org/docs/latest-v22.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
|
|
371
|
+
* Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its
|
|
372
|
+
* existing properties but also having the built-in objects and functions any standard
|
|
373
|
+
* [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
|
|
357
374
|
* variables will remain unchanged.
|
|
358
375
|
*
|
|
359
376
|
* ```js
|
|
360
|
-
*
|
|
377
|
+
* const vm = require('node:vm');
|
|
361
378
|
*
|
|
362
379
|
* global.globalVar = 3;
|
|
363
380
|
*
|
|
@@ -374,7 +391,12 @@ declare module "vm" {
|
|
|
374
391
|
* ```
|
|
375
392
|
*
|
|
376
393
|
* If `contextObject` is omitted (or passed explicitly as `undefined`), a new,
|
|
377
|
-
* empty
|
|
394
|
+
* empty contextified object will be returned.
|
|
395
|
+
*
|
|
396
|
+
* When the global object in the newly created context is contextified, it has some quirks
|
|
397
|
+
* compared to ordinary global objects. For example, it cannot be frozen. To create a context
|
|
398
|
+
* without the contextifying quirks, pass `vm.constants.DONT_CONTEXTIFY` as the `contextObject`
|
|
399
|
+
* argument. See the documentation of `vm.constants.DONT_CONTEXTIFY` for details.
|
|
378
400
|
*
|
|
379
401
|
* The `vm.createContext()` method is primarily useful for creating a single
|
|
380
402
|
* context that can be used to run multiple scripts. For instance, if emulating a
|
|
@@ -385,11 +407,17 @@ declare module "vm" {
|
|
|
385
407
|
* The provided `name` and `origin` of the context are made visible through the
|
|
386
408
|
* Inspector API.
|
|
387
409
|
* @since v0.3.1
|
|
410
|
+
* @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
|
|
411
|
+
* If `undefined`, an empty contextified object will be created for backwards compatibility.
|
|
388
412
|
* @return contextified object.
|
|
389
413
|
*/
|
|
390
|
-
function createContext(
|
|
414
|
+
function createContext(
|
|
415
|
+
contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
|
|
416
|
+
options?: CreateContextOptions,
|
|
417
|
+
): Context;
|
|
391
418
|
/**
|
|
392
|
-
* Returns `true` if the given `object` object has been
|
|
419
|
+
* Returns `true` if the given `object` object has been contextified using {@link createContext},
|
|
420
|
+
* or if it's the global object of a context created using `vm.constants.DONT_CONTEXTIFY`.
|
|
393
421
|
* @since v0.11.7
|
|
394
422
|
*/
|
|
395
423
|
function isContext(sandbox: Context): boolean;
|
|
@@ -422,18 +450,26 @@ declare module "vm" {
|
|
|
422
450
|
*/
|
|
423
451
|
function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
|
|
424
452
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* runs it within the created context, then returns the result. Running code
|
|
428
|
-
* does not have access to the local scope.
|
|
429
|
-
*
|
|
453
|
+
* This method is a shortcut to
|
|
454
|
+
* `(new vm.Script(code, options)).runInContext(vm.createContext(options), options)`.
|
|
430
455
|
* If `options` is a string, then it specifies the filename.
|
|
431
456
|
*
|
|
457
|
+
* It does several things at once:
|
|
458
|
+
*
|
|
459
|
+
* 1. Creates a new context.
|
|
460
|
+
* 2. If `contextObject` is an object, contextifies it with the new context.
|
|
461
|
+
* If `contextObject` is undefined, creates a new object and contextifies it.
|
|
462
|
+
* If `contextObject` is `vm.constants.DONT_CONTEXTIFY`, don't contextify anything.
|
|
463
|
+
* 3. Compiles the code as a`vm.Script`
|
|
464
|
+
* 4. Runs the compield code within the created context. The code does not have access to the scope in
|
|
465
|
+
* which this method is called.
|
|
466
|
+
* 5. Returns the result.
|
|
467
|
+
*
|
|
432
468
|
* The following example compiles and executes code that increments a global
|
|
433
469
|
* variable and sets a new one. These globals are contained in the `contextObject`.
|
|
434
470
|
*
|
|
435
471
|
* ```js
|
|
436
|
-
*
|
|
472
|
+
* const vm = require('node:vm');
|
|
437
473
|
*
|
|
438
474
|
* const contextObject = {
|
|
439
475
|
* animal: 'cat',
|
|
@@ -443,15 +479,21 @@ declare module "vm" {
|
|
|
443
479
|
* vm.runInNewContext('count += 1; name = "kitty"', contextObject);
|
|
444
480
|
* console.log(contextObject);
|
|
445
481
|
* // Prints: { animal: 'cat', count: 3, name: 'kitty' }
|
|
482
|
+
*
|
|
483
|
+
* // This would throw if the context is created from a contextified object.
|
|
484
|
+
* // vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary global objects that
|
|
485
|
+
* // can be frozen.
|
|
486
|
+
* const frozenContext = vm.runInNewContext('Object.freeze(globalThis); globalThis;', vm.constants.DONT_CONTEXTIFY);
|
|
446
487
|
* ```
|
|
447
488
|
* @since v0.3.1
|
|
448
489
|
* @param code The JavaScript code to compile and run.
|
|
449
|
-
* @param contextObject
|
|
490
|
+
* @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
|
|
491
|
+
* If `undefined`, an empty contextified object will be created for backwards compatibility.
|
|
450
492
|
* @return the result of the very last statement executed in the script.
|
|
451
493
|
*/
|
|
452
494
|
function runInNewContext(
|
|
453
495
|
code: string,
|
|
454
|
-
contextObject?: Context,
|
|
496
|
+
contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
|
|
455
497
|
options?: RunningCodeInNewContextOptions | string,
|
|
456
498
|
): any;
|
|
457
499
|
/**
|
|
@@ -902,19 +944,31 @@ declare module "vm" {
|
|
|
902
944
|
}
|
|
903
945
|
/**
|
|
904
946
|
* Returns an object containing commonly used constants for VM operations.
|
|
905
|
-
* @since v20.12.0
|
|
947
|
+
* @since v21.7.0, v20.12.0
|
|
906
948
|
*/
|
|
907
949
|
namespace constants {
|
|
908
950
|
/**
|
|
909
|
-
* Stability: 1.1 - Active development
|
|
910
|
-
*
|
|
911
951
|
* A constant that can be used as the `importModuleDynamically` option to `vm.Script`
|
|
912
952
|
* and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main
|
|
913
953
|
* context to load the requested module.
|
|
914
954
|
*
|
|
915
955
|
* For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
956
|
+
* @since v21.7.0, v20.12.0
|
|
916
957
|
*/
|
|
917
958
|
const USE_MAIN_CONTEXT_DEFAULT_LOADER: number;
|
|
959
|
+
/**
|
|
960
|
+
* This constant, when used as the `contextObject` argument in vm APIs, instructs Node.js to create
|
|
961
|
+
* a context without wrapping its global object with another object in a Node.js-specific manner.
|
|
962
|
+
* As a result, the `globalThis` value inside the new context would behave more closely to an ordinary
|
|
963
|
+
* one.
|
|
964
|
+
*
|
|
965
|
+
* When `vm.constants.DONT_CONTEXTIFY` is used as the `contextObject` argument to {@link createContext},
|
|
966
|
+
* the returned object is a proxy-like object to the global object in the newly created context with
|
|
967
|
+
* fewer Node.js-specific quirks. It is reference equal to the `globalThis` value in the new context,
|
|
968
|
+
* can be modified from outside the context, and can be used to access built-ins in the new context directly.
|
|
969
|
+
* @since v22.8.0
|
|
970
|
+
*/
|
|
971
|
+
const DONT_CONTEXTIFY: number;
|
|
918
972
|
}
|
|
919
973
|
}
|
|
920
974
|
declare module "node:vm" {
|
|
@@ -267,7 +267,7 @@ declare module "worker_threads" {
|
|
|
267
267
|
trackUnmanagedFds?: boolean | undefined;
|
|
268
268
|
/**
|
|
269
269
|
* An optional `name` to be appended to the worker title
|
|
270
|
-
* for
|
|
270
|
+
* for debugging/identification purposes, making the final title as
|
|
271
271
|
* `[worker ${id}] ${name}`.
|
|
272
272
|
*/
|
|
273
273
|
name?: string | undefined;
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 31 Oct 2024 18:02:52 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -45,7 +45,7 @@ declare module "assert" {
|
|
|
45
45
|
/** The `operator` property on the error instance. */
|
|
46
46
|
operator?: string | undefined;
|
|
47
47
|
/** If provided, the generated stack trace omits frames before this function. */
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
49
49
|
stackStartFn?: Function | undefined;
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -226,7 +226,7 @@ declare module "assert" {
|
|
|
226
226
|
expected: unknown,
|
|
227
227
|
message?: string | Error,
|
|
228
228
|
operator?: string,
|
|
229
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
230
230
|
stackStartFn?: Function,
|
|
231
231
|
): never;
|
|
232
232
|
/**
|
package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Polyfills for the explicit resource management types added in TypeScript 5.2.
|
|
2
|
+
// TODO: remove once this package no longer supports TS 5.1, and replace with a
|
|
3
|
+
// <reference> to TypeScript's disposable library in index.d.ts.
|
|
4
|
+
|
|
5
|
+
interface SymbolConstructor {
|
|
6
|
+
readonly dispose: unique symbol;
|
|
7
|
+
readonly asyncDispose: unique symbol;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Disposable {
|
|
11
|
+
[Symbol.dispose](): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface AsyncDisposable {
|
|
15
|
+
[Symbol.asyncDispose](): PromiseLike<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Declaration files in this directory contain types relating to TypeScript library features
|
|
2
|
+
// that are not included in all TypeScript versions supported by DefinitelyTyped, but
|
|
3
|
+
// which can be made backwards-compatible without needing `typesVersions`.
|
|
4
|
+
// If adding declarations to this directory, please specify which versions of TypeScript require them,
|
|
5
|
+
// so that they can be removed when no longer needed.
|
|
6
|
+
|
|
7
|
+
/// <reference path="disposable.d.ts" />
|
|
8
|
+
/// <reference path="indexable.d.ts" />
|
|
9
|
+
/// <reference path="iterators.d.ts" />
|
package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6.
|
|
2
|
+
// TODO: these methods are not used within @types/node, and should be removed at the next
|
|
3
|
+
// major @types/node version; users should include the es2022 TypeScript libraries
|
|
4
|
+
// if they need these features.
|
|
5
|
+
|
|
6
|
+
interface RelativeIndexable<T> {
|
|
7
|
+
at(index: number): T | undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface String extends RelativeIndexable<string> {}
|
|
11
|
+
interface Array<T> extends RelativeIndexable<T> {}
|
|
12
|
+
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
13
|
+
interface Int8Array extends RelativeIndexable<number> {}
|
|
14
|
+
interface Uint8Array extends RelativeIndexable<number> {}
|
|
15
|
+
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
16
|
+
interface Int16Array extends RelativeIndexable<number> {}
|
|
17
|
+
interface Uint16Array extends RelativeIndexable<number> {}
|
|
18
|
+
interface Int32Array extends RelativeIndexable<number> {}
|
|
19
|
+
interface Uint32Array extends RelativeIndexable<number> {}
|
|
20
|
+
interface Float32Array extends RelativeIndexable<number> {}
|
|
21
|
+
interface Float64Array extends RelativeIndexable<number> {}
|
|
22
|
+
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
23
|
+
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
|
|
2
|
+
// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
|
|
3
|
+
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
|
|
4
|
+
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
|
|
5
|
+
// if lib.esnext.iterator is loaded.
|
|
6
|
+
// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn.
|
|
7
|
+
|
|
8
|
+
// Placeholders for TS <5.6
|
|
9
|
+
interface IteratorObject<T, TReturn, TNext> {}
|
|
10
|
+
interface AsyncIteratorObject<T, TReturn, TNext> {}
|
|
11
|
+
|
|
12
|
+
declare namespace NodeJS {
|
|
13
|
+
// Populate iterator methods for TS <5.6
|
|
14
|
+
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
|
|
15
|
+
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
|
|
16
|
+
|
|
17
|
+
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
|
|
18
|
+
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
|
|
19
|
+
globalThis.Iterator<any, infer TReturn> ? TReturn
|
|
20
|
+
: any;
|
|
21
|
+
}
|
|
@@ -609,11 +609,6 @@ declare module "crypto" {
|
|
|
609
609
|
* @since v11.6.0
|
|
610
610
|
*/
|
|
611
611
|
asymmetricKeyType?: KeyType | undefined;
|
|
612
|
-
/**
|
|
613
|
-
* For asymmetric keys, this property represents the size of the embedded key in
|
|
614
|
-
* bytes. This property is `undefined` for symmetric keys.
|
|
615
|
-
*/
|
|
616
|
-
asymmetricKeySize?: number | undefined;
|
|
617
612
|
/**
|
|
618
613
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
619
614
|
* this object contains information about the key. None of the information obtained
|
|
@@ -2139,7 +2134,10 @@ declare module "crypto" {
|
|
|
2139
2134
|
* be passed instead of a public key.
|
|
2140
2135
|
* @since v0.11.14
|
|
2141
2136
|
*/
|
|
2142
|
-
function publicEncrypt(
|
|
2137
|
+
function publicEncrypt(
|
|
2138
|
+
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2139
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2140
|
+
): Buffer;
|
|
2143
2141
|
/**
|
|
2144
2142
|
* Decrypts `buffer` with `key`.`buffer` was previously encrypted using
|
|
2145
2143
|
* the corresponding private key, for example using {@link privateEncrypt}.
|
|
@@ -2151,7 +2149,10 @@ declare module "crypto" {
|
|
|
2151
2149
|
* be passed instead of a public key.
|
|
2152
2150
|
* @since v1.1.0
|
|
2153
2151
|
*/
|
|
2154
|
-
function publicDecrypt(
|
|
2152
|
+
function publicDecrypt(
|
|
2153
|
+
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2154
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2155
|
+
): Buffer;
|
|
2155
2156
|
/**
|
|
2156
2157
|
* Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
|
|
2157
2158
|
* the corresponding public key, for example using {@link publicEncrypt}.
|
|
@@ -2160,7 +2161,7 @@ declare module "crypto" {
|
|
|
2160
2161
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
|
|
2161
2162
|
* @since v0.11.14
|
|
2162
2163
|
*/
|
|
2163
|
-
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
|
2164
|
+
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): Buffer;
|
|
2164
2165
|
/**
|
|
2165
2166
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
|
2166
2167
|
* the corresponding public key, for example using {@link publicDecrypt}.
|
|
@@ -2169,7 +2170,7 @@ declare module "crypto" {
|
|
|
2169
2170
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
|
|
2170
2171
|
* @since v1.1.0
|
|
2171
2172
|
*/
|
|
2172
|
-
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
|
2173
|
+
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): Buffer;
|
|
2173
2174
|
/**
|
|
2174
2175
|
* ```js
|
|
2175
2176
|
* const {
|
|
@@ -304,12 +304,12 @@ declare module "events" {
|
|
|
304
304
|
emitter: NodeJS.EventEmitter,
|
|
305
305
|
eventName: string | symbol,
|
|
306
306
|
options?: StaticEventEmitterIteratorOptions,
|
|
307
|
-
):
|
|
307
|
+
): NodeJS.AsyncIterator<any[]>;
|
|
308
308
|
static on(
|
|
309
309
|
emitter: EventTarget,
|
|
310
310
|
eventName: string,
|
|
311
311
|
options?: StaticEventEmitterIteratorOptions,
|
|
312
|
-
):
|
|
312
|
+
): NodeJS.AsyncIterator<any[]>;
|
|
313
313
|
/**
|
|
314
314
|
* A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.
|
|
315
315
|
*
|
|
@@ -238,6 +238,10 @@ declare module "fs/promises" {
|
|
|
238
238
|
length?: number | null,
|
|
239
239
|
position?: number | null,
|
|
240
240
|
): Promise<FileReadResult<T>>;
|
|
241
|
+
read<T extends NodeJS.ArrayBufferView = Buffer>(
|
|
242
|
+
buffer: T,
|
|
243
|
+
options?: FileReadOptions<T>,
|
|
244
|
+
): Promise<FileReadResult<T>>;
|
|
241
245
|
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
242
246
|
/**
|
|
243
247
|
* Returns a `ReadableStream` that may be used to read the files data.
|
|
@@ -429,6 +433,13 @@ declare module "fs/promises" {
|
|
|
429
433
|
bytesWritten: number;
|
|
430
434
|
buffer: TBuffer;
|
|
431
435
|
}>;
|
|
436
|
+
write<TBuffer extends Uint8Array>(
|
|
437
|
+
buffer: TBuffer,
|
|
438
|
+
options?: { offset?: number; length?: number; position?: number },
|
|
439
|
+
): Promise<{
|
|
440
|
+
bytesWritten: number;
|
|
441
|
+
buffer: TBuffer;
|
|
442
|
+
}>;
|
|
432
443
|
write(
|
|
433
444
|
data: string,
|
|
434
445
|
position?: number | null,
|
|
@@ -1245,19 +1256,19 @@ declare module "fs/promises" {
|
|
|
1245
1256
|
/**
|
|
1246
1257
|
* Retrieves the files matching the specified pattern.
|
|
1247
1258
|
*/
|
|
1248
|
-
function glob(pattern: string | string[]):
|
|
1259
|
+
function glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
|
|
1249
1260
|
function glob(
|
|
1250
1261
|
pattern: string | string[],
|
|
1251
1262
|
opt: GlobOptionsWithFileTypes,
|
|
1252
|
-
):
|
|
1263
|
+
): NodeJS.AsyncIterator<Dirent>;
|
|
1253
1264
|
function glob(
|
|
1254
1265
|
pattern: string | string[],
|
|
1255
1266
|
opt: GlobOptionsWithoutFileTypes,
|
|
1256
|
-
):
|
|
1267
|
+
): NodeJS.AsyncIterator<string>;
|
|
1257
1268
|
function glob(
|
|
1258
1269
|
pattern: string | string[],
|
|
1259
1270
|
opt: GlobOptions,
|
|
1260
|
-
):
|
|
1271
|
+
): NodeJS.AsyncIterator<Dirent | string>;
|
|
1261
1272
|
}
|
|
1262
1273
|
declare module "node:fs/promises" {
|
|
1263
1274
|
export * from "fs/promises";
|
|
@@ -284,7 +284,7 @@ declare module "fs" {
|
|
|
284
284
|
/**
|
|
285
285
|
* Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
|
|
286
286
|
*/
|
|
287
|
-
[Symbol.asyncIterator]():
|
|
287
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<Dirent>;
|
|
288
288
|
/**
|
|
289
289
|
* Asynchronously close the directory's underlying resource handle.
|
|
290
290
|
* Subsequent reads will result in errors.
|
|
@@ -156,6 +156,8 @@ declare global {
|
|
|
156
156
|
interface RequireResolve extends NodeJS.RequireResolve {}
|
|
157
157
|
interface NodeModule extends NodeJS.Module {}
|
|
158
158
|
|
|
159
|
+
var global: typeof globalThis;
|
|
160
|
+
|
|
159
161
|
var process: NodeJS.Process;
|
|
160
162
|
var console: Console;
|
|
161
163
|
|
|
@@ -265,53 +267,6 @@ declare global {
|
|
|
265
267
|
var sessionStorage: Storage;
|
|
266
268
|
// #endregion Storage
|
|
267
269
|
|
|
268
|
-
// #region Disposable
|
|
269
|
-
interface SymbolConstructor {
|
|
270
|
-
/**
|
|
271
|
-
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
|
272
|
-
*/
|
|
273
|
-
readonly dispose: unique symbol;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
|
277
|
-
*/
|
|
278
|
-
readonly asyncDispose: unique symbol;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
interface Disposable {
|
|
282
|
-
[Symbol.dispose](): void;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
interface AsyncDisposable {
|
|
286
|
-
[Symbol.asyncDispose](): PromiseLike<void>;
|
|
287
|
-
}
|
|
288
|
-
// #endregion Disposable
|
|
289
|
-
|
|
290
|
-
// #region ArrayLike.at()
|
|
291
|
-
interface RelativeIndexable<T> {
|
|
292
|
-
/**
|
|
293
|
-
* Takes an integer value and returns the item at that index,
|
|
294
|
-
* allowing for positive and negative integers.
|
|
295
|
-
* Negative integers count back from the last item in the array.
|
|
296
|
-
*/
|
|
297
|
-
at(index: number): T | undefined;
|
|
298
|
-
}
|
|
299
|
-
interface String extends RelativeIndexable<string> {}
|
|
300
|
-
interface Array<T> extends RelativeIndexable<T> {}
|
|
301
|
-
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
302
|
-
interface Int8Array extends RelativeIndexable<number> {}
|
|
303
|
-
interface Uint8Array extends RelativeIndexable<number> {}
|
|
304
|
-
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
305
|
-
interface Int16Array extends RelativeIndexable<number> {}
|
|
306
|
-
interface Uint16Array extends RelativeIndexable<number> {}
|
|
307
|
-
interface Int32Array extends RelativeIndexable<number> {}
|
|
308
|
-
interface Uint32Array extends RelativeIndexable<number> {}
|
|
309
|
-
interface Float32Array extends RelativeIndexable<number> {}
|
|
310
|
-
interface Float64Array extends RelativeIndexable<number> {}
|
|
311
|
-
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
312
|
-
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
313
|
-
// #endregion ArrayLike.at() end
|
|
314
|
-
|
|
315
270
|
/**
|
|
316
271
|
* @since v17.0.0
|
|
317
272
|
*
|
|
@@ -464,7 +419,7 @@ declare global {
|
|
|
464
419
|
unpipe(destination?: WritableStream): this;
|
|
465
420
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
466
421
|
wrap(oldStream: ReadableStream): this;
|
|
467
|
-
[Symbol.asyncIterator]():
|
|
422
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string | Buffer>;
|
|
468
423
|
}
|
|
469
424
|
|
|
470
425
|
interface WritableStream extends EventEmitter {
|
|
@@ -533,6 +488,20 @@ declare global {
|
|
|
533
488
|
interface ReadOnlyDict<T> {
|
|
534
489
|
readonly [key: string]: T | undefined;
|
|
535
490
|
}
|
|
491
|
+
|
|
492
|
+
/** An iterable iterator returned by the Node.js API. */
|
|
493
|
+
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator.
|
|
494
|
+
// TODO: In next major @types/node version, change default TReturn to undefined.
|
|
495
|
+
interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
|
496
|
+
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/** An async iterable iterator returned by the Node.js API. */
|
|
500
|
+
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used AsyncIterableIterator.
|
|
501
|
+
// TODO: In next major @types/node version, change default TReturn to undefined.
|
|
502
|
+
interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
|
503
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
|
504
|
+
}
|
|
536
505
|
}
|
|
537
506
|
|
|
538
507
|
interface RequestInit extends _RequestInit {}
|
|
@@ -141,6 +141,7 @@ declare module "http" {
|
|
|
141
141
|
"content-range"?: string | undefined;
|
|
142
142
|
"content-security-policy"?: string | undefined;
|
|
143
143
|
"content-security-policy-report-only"?: string | undefined;
|
|
144
|
+
"content-type"?: string | undefined;
|
|
144
145
|
cookie?: string | string[] | undefined;
|
|
145
146
|
dav?: string | string[] | undefined;
|
|
146
147
|
dnt?: string | undefined;
|
|
@@ -588,6 +589,42 @@ declare module "http" {
|
|
|
588
589
|
* @param value Header value
|
|
589
590
|
*/
|
|
590
591
|
setHeader(name: string, value: number | string | readonly string[]): this;
|
|
592
|
+
/**
|
|
593
|
+
* Sets multiple header values for implicit headers. headers must be an instance of
|
|
594
|
+
* `Headers` or `Map`, if a header already exists in the to-be-sent headers, its
|
|
595
|
+
* value will be replaced.
|
|
596
|
+
*
|
|
597
|
+
* ```js
|
|
598
|
+
* const headers = new Headers({ foo: 'bar' });
|
|
599
|
+
* outgoingMessage.setHeaders(headers);
|
|
600
|
+
* ```
|
|
601
|
+
*
|
|
602
|
+
* or
|
|
603
|
+
*
|
|
604
|
+
* ```js
|
|
605
|
+
* const headers = new Map([['foo', 'bar']]);
|
|
606
|
+
* outgoingMessage.setHeaders(headers);
|
|
607
|
+
* ```
|
|
608
|
+
*
|
|
609
|
+
* When headers have been set with `outgoingMessage.setHeaders()`, they will be
|
|
610
|
+
* merged with any headers passed to `response.writeHead()`, with the headers passed
|
|
611
|
+
* to `response.writeHead()` given precedence.
|
|
612
|
+
*
|
|
613
|
+
* ```js
|
|
614
|
+
* // Returns content-type = text/plain
|
|
615
|
+
* const server = http.createServer((req, res) => {
|
|
616
|
+
* const headers = new Headers({ 'Content-Type': 'text/html' });
|
|
617
|
+
* res.setHeaders(headers);
|
|
618
|
+
* res.writeHead(200, { 'Content-Type': 'text/plain' });
|
|
619
|
+
* res.end('ok');
|
|
620
|
+
* });
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* @since v19.6.0, v18.15.0
|
|
624
|
+
* @param name Header name
|
|
625
|
+
* @param value Header value
|
|
626
|
+
*/
|
|
627
|
+
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
|
|
591
628
|
/**
|
|
592
629
|
* Append a single header value to the header object.
|
|
593
630
|
*
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
* IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
// NOTE: These definitions support
|
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 5.7+.
|
|
26
26
|
|
|
27
|
-
// Reference required
|
|
27
|
+
// Reference required TypeScript libs:
|
|
28
28
|
/// <reference lib="es2020" />
|
|
29
|
-
/// <reference lib="esnext.asynciterable" />
|
|
30
|
-
/// <reference lib="esnext.intl" />
|
|
31
|
-
/// <reference lib="esnext.bigint" />
|
|
32
29
|
|
|
33
|
-
//
|
|
30
|
+
// TypeScript backwards-compatibility definitions:
|
|
31
|
+
/// <reference path="compatibility/index.d.ts" />
|
|
32
|
+
|
|
33
|
+
// Definitions specific to TypeScript 5.7+:
|
|
34
34
|
/// <reference path="globals.typedarray.d.ts" />
|
|
35
35
|
/// <reference path="buffer.buffer.d.ts" />
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
|
38
|
+
/// <reference path="globals.d.ts" />
|
|
38
39
|
/// <reference path="assert.d.ts" />
|
|
39
40
|
/// <reference path="assert/strict.d.ts" />
|
|
40
|
-
/// <reference path="globals.d.ts" />
|
|
41
41
|
/// <reference path="async_hooks.d.ts" />
|
|
42
42
|
/// <reference path="buffer.d.ts" />
|
|
43
43
|
/// <reference path="child_process.d.ts" />
|
|
@@ -90,5 +90,3 @@
|
|
|
90
90
|
/// <reference path="wasi.d.ts" />
|
|
91
91
|
/// <reference path="worker_threads.d.ts" />
|
|
92
92
|
/// <reference path="zlib.d.ts" />
|
|
93
|
-
|
|
94
|
-
/// <reference path="globals.global.d.ts" />
|