From 890e4462ee25a3d5770d2a40a14fc7b93d812611 Mon Sep 17 00:00:00 2001 From: simonegaffurini Date: Fri, 5 Jul 2024 11:04:09 +0200 Subject: [PATCH] update core --- dist/node_modules/.package-lock.json | 537 +- .../{inquirer => @inquirer/checkbox}/LICENSE | 2 +- .../node_modules/@inquirer/checkbox/README.md | 110 + .../@inquirer/checkbox/dist/cjs/index.js | 171 + .../checkbox/dist/cjs/types/index.d.ts | 35 + .../@inquirer/checkbox/dist/esm/index.mjs | 155 + .../checkbox/dist/esm/types/index.d.mts | 35 + .../@inquirer/checkbox/dist/types/index.d.ts | 35 + .../@inquirer/checkbox/package.json | 93 + .../confirm}/LICENSE | 4 +- dist/node_modules/@inquirer/confirm/README.md | 71 + .../@inquirer/confirm/dist/cjs/index.js | 35 + .../confirm/dist/cjs/types/index.d.ts | 10 + .../@inquirer/confirm/dist/esm/index.mjs | 33 + .../confirm/dist/esm/types/index.d.mts | 10 + .../@inquirer/confirm/dist/types/index.d.ts | 10 + .../@inquirer/confirm/package.json | 90 + .../README.md => @inquirer/core/LICENSE} | 33 +- dist/node_modules/@inquirer/core/README.md | 239 + .../@inquirer/core/dist/cjs/index.js | 39 + .../@inquirer/core/dist/cjs/lib/Separator.js | 35 + .../core/dist/cjs/lib/create-prompt.js | 118 + .../@inquirer/core/dist/cjs/lib/errors.js | 24 + .../core/dist/cjs/lib/hook-engine.js | 104 + .../@inquirer/core/dist/cjs/lib/key.js | 27 + .../@inquirer/core/dist/cjs/lib/make-theme.js | 33 + .../core/dist/cjs/lib/pagination/lines.js | 62 + .../core/dist/cjs/lib/pagination/position.js | 31 + .../dist/cjs/lib/pagination/use-pagination.js | 33 + .../core/dist/cjs/lib/screen-manager.js | 128 + .../@inquirer/core/dist/cjs/lib/theme.js | 24 + .../@inquirer/core/dist/cjs/lib/use-effect.js | 14 + .../core/dist/cjs/lib/use-keypress.js | 19 + .../@inquirer/core/dist/cjs/lib/use-memo.js | 17 + .../@inquirer/core/dist/cjs/lib/use-prefix.js | 37 + .../@inquirer/core/dist/cjs/lib/use-ref.js | 7 + .../@inquirer/core/dist/cjs/lib/use-state.js | 22 + .../@inquirer/core/dist/cjs/lib/utils.js | 32 + .../@inquirer/core/dist/cjs/types/index.d.ts | 13 + .../core/dist/cjs/types/lib/Separator.d.ts | 10 + .../dist/cjs/types/lib/create-prompt.d.ts | 4 + .../core/dist/cjs/types/lib/errors.d.ts | 9 + .../core/dist/cjs/types/lib/hook-engine.d.ts | 30 + .../core/dist/cjs/types/lib/key.d.ts | 10 + .../core/dist/cjs/types/lib/make-theme.d.ts | 3 + .../dist/cjs/types/lib/pagination/lines.d.ts | 26 + .../cjs/types/lib/pagination/position.d.ts | 20 + .../types/lib/pagination/use-pagination.d.ts | 15 + .../dist/cjs/types/lib/screen-manager.d.ts | 13 + .../core/dist/cjs/types/lib/theme.d.ts | 20 + .../core/dist/cjs/types/lib/use-effect.d.ts | 2 + .../core/dist/cjs/types/lib/use-keypress.d.ts | 3 + .../core/dist/cjs/types/lib/use-memo.d.ts | 1 + .../core/dist/cjs/types/lib/use-prefix.d.ts | 5 + .../core/dist/cjs/types/lib/use-ref.d.ts | 6 + .../core/dist/cjs/types/lib/use-state.d.ts | 4 + .../core/dist/cjs/types/lib/utils.d.ts | 13 + .../@inquirer/core/dist/esm/index.mjs | 12 + .../@inquirer/core/dist/esm/lib/Separator.mjs | 18 + .../core/dist/esm/lib/create-prompt.mjs | 88 + .../@inquirer/core/dist/esm/lib/errors.mjs | 9 + .../core/dist/esm/lib/hook-engine.mjs | 95 + .../@inquirer/core/dist/esm/lib/key.mjs | 18 + .../core/dist/esm/lib/make-theme.mjs | 30 + .../core/dist/esm/lib/pagination/lines.mjs | 59 + .../core/dist/esm/lib/pagination/position.mjs | 27 + .../esm/lib/pagination/use-pagination.mjs | 30 + .../core/dist/esm/lib/screen-manager.mjs | 103 + .../@inquirer/core/dist/esm/lib/theme.mjs | 18 + .../core/dist/esm/lib/use-effect.mjs | 11 + .../core/dist/esm/lib/use-keypress.mjs | 16 + .../@inquirer/core/dist/esm/lib/use-memo.mjs | 14 + .../core/dist/esm/lib/use-prefix.mjs | 34 + .../@inquirer/core/dist/esm/lib/use-ref.mjs | 4 + .../@inquirer/core/dist/esm/lib/use-state.mjs | 19 + .../@inquirer/core/dist/esm/lib/utils.mjs | 25 + .../@inquirer/core/dist/esm/types/index.d.mts | 13 + .../core/dist/esm/types/lib/Separator.d.mts | 10 + .../dist/esm/types/lib/create-prompt.d.mts | 4 + .../core/dist/esm/types/lib/errors.d.mts | 9 + .../core/dist/esm/types/lib/hook-engine.d.mts | 30 + .../core/dist/esm/types/lib/key.d.mts | 10 + .../core/dist/esm/types/lib/make-theme.d.mts | 3 + .../dist/esm/types/lib/pagination/lines.d.mts | 26 + .../esm/types/lib/pagination/position.d.mts | 20 + .../types/lib/pagination/use-pagination.d.mts | 15 + .../dist/esm/types/lib/screen-manager.d.mts | 13 + .../core/dist/esm/types/lib/theme.d.mts | 20 + .../core/dist/esm/types/lib/use-effect.d.mts | 2 + .../dist/esm/types/lib/use-keypress.d.mts | 3 + .../core/dist/esm/types/lib/use-memo.d.mts | 1 + .../core/dist/esm/types/lib/use-prefix.d.mts | 5 + .../core/dist/esm/types/lib/use-ref.d.mts | 6 + .../core/dist/esm/types/lib/use-state.d.mts | 4 + .../core/dist/esm/types/lib/utils.d.mts | 13 + .../@inquirer/core/dist/types/index.d.ts | 13 + .../core/dist/types/lib/Separator.d.ts | 10 + .../core/dist/types/lib/create-prompt.d.ts | 4 + .../@inquirer/core/dist/types/lib/errors.d.ts | 9 + .../core/dist/types/lib/hook-engine.d.ts | 30 + .../@inquirer/core/dist/types/lib/key.d.ts | 10 + .../core/dist/types/lib/make-theme.d.ts | 3 + .../core/dist/types/lib/pagination/lines.d.ts | 26 + .../dist/types/lib/pagination/lines.test.d.ts | 1 + .../dist/types/lib/pagination/position.d.ts | 20 + .../types/lib/pagination/use-pagination.d.ts | 15 + .../core/dist/types/lib/screen-manager.d.ts | 13 + .../@inquirer/core/dist/types/lib/theme.d.ts | 20 + .../core/dist/types/lib/use-effect.d.ts | 2 + .../core/dist/types/lib/use-keypress.d.ts | 3 + .../core/dist/types/lib/use-memo.d.ts | 1 + .../core/dist/types/lib/use-prefix.d.ts | 5 + .../core/dist/types/lib/use-ref.d.ts | 6 + .../core/dist/types/lib/use-state.d.ts | 4 + .../@inquirer/core/dist/types/lib/utils.d.ts | 13 + dist/node_modules/@inquirer/core/package.json | 101 + dist/node_modules/@inquirer/editor/LICENSE | 22 + dist/node_modules/@inquirer/editor/README.md | 74 + .../@inquirer/editor/dist/cjs/index.js | 78 + .../editor/dist/cjs/types/index.d.ts | 12 + .../@inquirer/editor/dist/esm/index.mjs | 67 + .../editor/dist/esm/types/index.d.mts | 12 + .../@inquirer/editor/dist/types/index.d.ts | 12 + .../@inquirer/editor/package.json | 91 + dist/node_modules/@inquirer/expand/LICENSE | 22 + dist/node_modules/@inquirer/expand/README.md | 100 + .../@inquirer/expand/dist/cjs/index.js | 101 + .../expand/dist/cjs/types/index.d.ts | 22 + .../@inquirer/expand/dist/esm/index.mjs | 96 + .../expand/dist/esm/types/index.d.mts | 22 + .../@inquirer/expand/dist/types/index.d.ts | 22 + .../@inquirer/expand/package.json | 91 + dist/node_modules/@inquirer/figures/LICENSE | 22 + .../@inquirer/figures/dist/cjs/index.js | 313 + .../figures/dist/cjs/types/index.d.ts | 465 ++ .../@inquirer/figures/dist/esm/index.mjs | 309 + .../figures/dist/esm/types/index.d.mts | 465 ++ .../@inquirer/figures/package.json | 81 + dist/node_modules/@inquirer/input/LICENSE | 22 + dist/node_modules/@inquirer/input/README.md | 74 + .../@inquirer/input/dist/cjs/index.js | 80 + .../@inquirer/input/dist/cjs/types/index.d.ts | 14 + .../@inquirer/input/dist/esm/index.mjs | 69 + .../input/dist/esm/types/index.d.mts | 14 + .../@inquirer/input/dist/types/index.d.ts | 14 + .../node_modules/@inquirer/input/package.json | 90 + dist/node_modules/@inquirer/number/LICENSE | 22 + dist/node_modules/@inquirer/number/README.md | 74 + .../@inquirer/number/dist/cjs/index.js | 101 + .../number/dist/cjs/types/index.d.ts | 14 + .../@inquirer/number/dist/esm/index.mjs | 89 + .../number/dist/esm/types/index.d.mts | 14 + .../@inquirer/number/dist/types/index.d.ts | 14 + .../@inquirer/number/package.json | 90 + dist/node_modules/@inquirer/password/LICENSE | 22 + .../node_modules/@inquirer/password/README.md | 72 + .../@inquirer/password/dist/cjs/index.js | 70 + .../password/dist/cjs/types/index.d.ts | 10 + .../@inquirer/password/dist/esm/index.mjs | 56 + .../password/dist/esm/types/index.d.mts | 10 + .../@inquirer/password/dist/types/index.d.ts | 10 + .../@inquirer/password/package.json | 91 + dist/node_modules/@inquirer/prompts/LICENSE | 22 + dist/node_modules/@inquirer/prompts/README.md | 361 + .../@inquirer/prompts/dist/cjs/index.js | 25 + .../prompts/dist/cjs/types/index.d.ts | 9 + .../@inquirer/prompts/dist/esm/index.mjs | 9 + .../prompts/dist/esm/types/index.d.mts | 9 + .../@inquirer/prompts/dist/types/index.d.ts | 9 + .../@inquirer/prompts/package.json | 96 + dist/node_modules/@inquirer/rawlist/LICENSE | 22 + dist/node_modules/@inquirer/rawlist/README.md | 78 + .../@inquirer/rawlist/dist/cjs/index.js | 76 + .../rawlist/dist/cjs/types/index.d.ts | 14 + .../@inquirer/rawlist/dist/esm/index.mjs | 69 + .../rawlist/dist/esm/types/index.d.mts | 14 + .../@inquirer/rawlist/dist/types/index.d.ts | 14 + .../@inquirer/rawlist/package.json | 91 + dist/node_modules/@inquirer/select/LICENSE | 22 + dist/node_modules/@inquirer/select/README.md | 113 + .../@inquirer/select/dist/cjs/index.js | 134 + .../select/dist/cjs/types/index.d.ts | 28 + .../@inquirer/select/dist/esm/index.mjs | 127 + .../select/dist/esm/types/index.d.mts | 28 + .../@inquirer/select/dist/types/index.d.ts | 28 + .../@inquirer/select/package.json | 93 + dist/node_modules/@inquirer/type/LICENSE | 22 + .../@inquirer/type/dist/cjs/index.js | 15 + .../@inquirer/type/dist/cjs/types/index.d.ts | 40 + .../@inquirer/type/dist/esm/index.mjs | 3 + .../@inquirer/type/dist/esm/types/index.d.mts | 40 + dist/node_modules/@inquirer/type/package.json | 84 + dist/node_modules/@types/mute-stream/LICENSE | 21 + .../node_modules/@types/mute-stream/README.md | 49 + .../@types/mute-stream/index.d.ts | 30 + .../@types/mute-stream/package.json | 27 + dist/node_modules/@types/node/README.md | 4 +- dist/node_modules/@types/node/assert.d.ts | 136 +- .../node_modules/@types/node/async_hooks.d.ts | 32 +- dist/node_modules/@types/node/buffer.d.ts | 81 +- .../@types/node/child_process.d.ts | 136 +- dist/node_modules/@types/node/cluster.d.ts | 184 +- dist/node_modules/@types/node/console.d.ts | 93 +- dist/node_modules/@types/node/crypto.d.ts | 219 +- dist/node_modules/@types/node/dgram.d.ts | 46 +- .../@types/node/diagnostics_channel.d.ts | 367 +- dist/node_modules/@types/node/dns.d.ts | 195 +- .../@types/node/dns/promises.d.ts | 115 +- dist/node_modules/@types/node/dom-events.d.ts | 2 + dist/node_modules/@types/node/domain.d.ts | 8 +- dist/node_modules/@types/node/events.d.ts | 239 +- dist/node_modules/@types/node/fs.d.ts | 136 +- .../node_modules/@types/node/fs/promises.d.ts | 67 +- dist/node_modules/@types/node/globals.d.ts | 715 +- dist/node_modules/@types/node/http.d.ts | 134 +- dist/node_modules/@types/node/http2.d.ts | 137 +- dist/node_modules/@types/node/https.d.ts | 6 +- dist/node_modules/@types/node/index.d.ts | 1 + dist/node_modules/@types/node/inspector.d.ts | 11 +- dist/node_modules/@types/node/module.d.ts | 38 +- dist/node_modules/@types/node/net.d.ts | 82 +- dist/node_modules/@types/node/os.d.ts | 42 +- dist/node_modules/@types/node/package.json | 19 +- dist/node_modules/@types/node/path.d.ts | 2 +- dist/node_modules/@types/node/perf_hooks.d.ts | 376 +- dist/node_modules/@types/node/process.d.ts | 316 +- dist/node_modules/@types/node/punycode.d.ts | 10 +- .../node_modules/@types/node/querystring.d.ts | 36 +- dist/node_modules/@types/node/readline.d.ts | 41 +- .../@types/node/readline/promises.d.ts | 18 +- dist/node_modules/@types/node/repl.d.ts | 20 +- dist/node_modules/@types/node/sea.d.ts | 153 + dist/node_modules/@types/node/stream.d.ts | 126 +- dist/node_modules/@types/node/stream/web.d.ts | 19 +- .../@types/node/string_decoder.d.ts | 10 +- dist/node_modules/@types/node/test.d.ts | 558 +- dist/node_modules/@types/node/timers.d.ts | 16 +- .../@types/node/timers/promises.d.ts | 16 +- dist/node_modules/@types/node/tls.d.ts | 75 +- .../@types/node/trace_events.d.ts | 65 +- .../@types/node/ts4.8/assert.d.ts | 996 --- .../@types/node/ts4.8/assert/strict.d.ts | 8 - .../@types/node/ts4.8/async_hooks.d.ts | 539 -- .../@types/node/ts4.8/buffer.d.ts | 2362 ------ .../@types/node/ts4.8/child_process.d.ts | 1540 ---- .../@types/node/ts4.8/cluster.d.ts | 432 -- .../@types/node/ts4.8/console.d.ts | 415 - .../@types/node/ts4.8/constants.d.ts | 19 - .../@types/node/ts4.8/crypto.d.ts | 4455 ----------- .../node_modules/@types/node/ts4.8/dgram.d.ts | 586 -- .../node/ts4.8/diagnostics_channel.d.ts | 191 - dist/node_modules/@types/node/ts4.8/dns.d.ts | 809 -- .../@types/node/ts4.8/dns/promises.d.ts | 417 - .../@types/node/ts4.8/dom-events.d.ts | 122 - .../@types/node/ts4.8/domain.d.ts | 170 - .../@types/node/ts4.8/events.d.ts | 796 -- dist/node_modules/@types/node/ts4.8/fs.d.ts | 4289 ----------- .../@types/node/ts4.8/fs/promises.d.ts | 1232 --- .../@types/node/ts4.8/globals.d.ts | 381 - .../@types/node/ts4.8/globals.global.d.ts | 1 - dist/node_modules/@types/node/ts4.8/http.d.ts | 1888 ----- .../node_modules/@types/node/ts4.8/http2.d.ts | 2381 ------ .../node_modules/@types/node/ts4.8/https.d.ts | 550 -- .../node_modules/@types/node/ts4.8/index.d.ts | 88 - .../@types/node/ts4.8/inspector.d.ts | 2747 ------- .../@types/node/ts4.8/module.d.ts | 287 - dist/node_modules/@types/node/ts4.8/net.d.ts | 949 --- dist/node_modules/@types/node/ts4.8/os.d.ts | 477 -- dist/node_modules/@types/node/ts4.8/path.d.ts | 191 - .../@types/node/ts4.8/perf_hooks.d.ts | 639 -- .../@types/node/ts4.8/process.d.ts | 1532 ---- .../@types/node/ts4.8/punycode.d.ts | 117 - .../@types/node/ts4.8/querystring.d.ts | 141 - .../@types/node/ts4.8/readline.d.ts | 539 -- .../@types/node/ts4.8/readline/promises.d.ts | 150 - dist/node_modules/@types/node/ts4.8/repl.d.ts | 430 -- .../@types/node/ts4.8/stream.d.ts | 1701 ---- .../@types/node/ts4.8/stream/consumers.d.ts | 12 - .../@types/node/ts4.8/stream/promises.d.ts | 83 - .../@types/node/ts4.8/stream/web.d.ts | 350 - .../@types/node/ts4.8/string_decoder.d.ts | 67 - dist/node_modules/@types/node/ts4.8/test.d.ts | 1382 ---- .../@types/node/ts4.8/timers.d.ts | 240 - .../@types/node/ts4.8/timers/promises.d.ts | 93 - dist/node_modules/@types/node/ts4.8/tls.d.ts | 1210 --- .../@types/node/ts4.8/trace_events.d.ts | 182 - dist/node_modules/@types/node/ts4.8/tty.d.ts | 208 - dist/node_modules/@types/node/ts4.8/url.d.ts | 927 --- dist/node_modules/@types/node/ts4.8/util.d.ts | 2186 ------ dist/node_modules/@types/node/ts4.8/v8.d.ts | 635 -- dist/node_modules/@types/node/ts4.8/vm.d.ts | 901 --- dist/node_modules/@types/node/ts4.8/wasi.d.ts | 158 - .../@types/node/ts4.8/worker_threads.d.ts | 691 -- dist/node_modules/@types/node/ts4.8/zlib.d.ts | 517 -- dist/node_modules/@types/node/tty.d.ts | 16 +- dist/node_modules/@types/node/url.d.ts | 123 +- dist/node_modules/@types/node/util.d.ts | 156 +- dist/node_modules/@types/node/v8.d.ts | 193 +- dist/node_modules/@types/node/vm.d.ts | 77 +- dist/node_modules/@types/node/wasi.d.ts | 55 +- .../@types/node/worker_threads.d.ts | 39 +- dist/node_modules/@types/node/zlib.d.ts | 19 +- dist/node_modules/@types/wrap-ansi/LICENSE | 21 + dist/node_modules/@types/wrap-ansi/README.md | 16 + dist/node_modules/@types/wrap-ansi/index.d.ts | 20 + .../@types/wrap-ansi/package.json | 22 + dist/node_modules/bl/.travis.yml | 17 - dist/node_modules/bl/BufferList.js | 396 - dist/node_modules/bl/LICENSE.md | 13 - dist/node_modules/bl/README.md | 247 - dist/node_modules/bl/bl.js | 84 - dist/node_modules/bl/package.json | 37 - dist/node_modules/bl/test/convert.js | 21 - dist/node_modules/bl/test/indexOf.js | 492 -- dist/node_modules/bl/test/isBufferList.js | 32 - dist/node_modules/bl/test/test.js | 869 --- dist/node_modules/buffer/AUTHORS.md | 70 - dist/node_modules/buffer/LICENSE | 21 - dist/node_modules/buffer/README.md | 410 - dist/node_modules/buffer/index.d.ts | 186 - dist/node_modules/buffer/index.js | 1817 ----- dist/node_modules/buffer/package.json | 96 - dist/node_modules/cli-cursor/index.d.ts | 45 - dist/node_modules/cli-cursor/index.js | 35 - dist/node_modules/cli-cursor/license | 9 - dist/node_modules/cli-cursor/package.json | 46 - dist/node_modules/cli-cursor/readme.md | 55 - dist/node_modules/cli-spinners/index.d.ts | 1 + dist/node_modules/cli-spinners/package.json | 2 +- dist/node_modules/cli-spinners/readme.md | 5 +- .../00ef1b3d-3687-482b-8d03-de2f76b58f54.json | 1 - .../00ef1b3d-3687-482b-8d03-de2f76b58f54.json | 1 - .../.nyc_output/processinfo/index.json | 1 - dist/node_modules/cli-width/.travis.yml | 7 - dist/node_modules/cli-width/CHANGELOG.md | 37 - dist/node_modules/cli-width/LICENSE | 2 +- dist/node_modules/cli-width/README.md | 15 +- dist/node_modules/cli-width/index.d.ts | 13 + dist/node_modules/cli-width/index.js | 12 +- dist/node_modules/cli-width/package.json | 22 +- dist/node_modules/clone/.npmignore | 4 - dist/node_modules/clone/LICENSE | 18 - dist/node_modules/clone/README.md | 126 - dist/node_modules/clone/clone.iml | 10 - dist/node_modules/clone/clone.js | 166 - dist/node_modules/clone/package.json | 51 - dist/node_modules/defaults/LICENSE | 22 - dist/node_modules/defaults/README.md | 39 - dist/node_modules/defaults/index.js | 13 - dist/node_modules/defaults/package.json | 33 - dist/node_modules/defaults/test.js | 34 - .../escape-string-regexp/index.js | 11 - .../node_modules/escape-string-regexp/license | 21 - .../escape-string-regexp/package.json | 41 - .../escape-string-regexp/readme.md | 27 - dist/node_modules/figures/index.d.ts | 96 - dist/node_modules/figures/index.js | 151 - dist/node_modules/figures/package.json | 45 - dist/node_modules/figures/readme.md | 139 - dist/node_modules/ieee754/LICENSE | 11 - dist/node_modules/ieee754/README.md | 51 - dist/node_modules/ieee754/index.d.ts | 10 - dist/node_modules/ieee754/index.js | 85 - dist/node_modules/ieee754/package.json | 52 - dist/node_modules/inquirer/README.md | 507 -- dist/node_modules/inquirer/lib/inquirer.js | 93 - .../inquirer/lib/objects/choice.js | 37 - .../inquirer/lib/objects/choices.js | 123 - .../inquirer/lib/objects/separator.js | 37 - .../node_modules/inquirer/lib/prompts/base.js | 180 - .../inquirer/lib/prompts/checkbox.js | 275 - .../inquirer/lib/prompts/confirm.js | 98 - .../inquirer/lib/prompts/editor.js | 100 - .../inquirer/lib/prompts/expand.js | 273 - .../inquirer/lib/prompts/input.js | 110 - .../node_modules/inquirer/lib/prompts/list.js | 208 - .../inquirer/lib/prompts/number.js | 29 - .../inquirer/lib/prompts/password.js | 127 - .../inquirer/lib/prompts/rawlist.js | 228 - dist/node_modules/inquirer/lib/ui/baseUI.js | 92 - .../inquirer/lib/ui/bottom-bar.js | 96 - dist/node_modules/inquirer/lib/ui/prompt.js | 147 - .../node_modules/inquirer/lib/utils/events.js | 54 - .../inquirer/lib/utils/incrementListIndex.js | 19 - .../inquirer/lib/utils/paginator.js | 81 - .../inquirer/lib/utils/readline.js | 51 - .../inquirer/lib/utils/screen-manager.js | 176 - dist/node_modules/inquirer/lib/utils/utils.js | 25 - dist/node_modules/inquirer/package.json | 59 - dist/node_modules/is-interactive/index.d.ts | 31 - dist/node_modules/is-interactive/index.js | 9 - dist/node_modules/is-interactive/license | 9 - dist/node_modules/is-interactive/package.json | 38 - dist/node_modules/is-interactive/readme.md | 51 - .../is-unicode-supported/index.d.ts | 14 - .../is-unicode-supported/index.js | 13 - .../node_modules/is-unicode-supported/license | 9 - .../is-unicode-supported/package.json | 41 - .../is-unicode-supported/readme.md | 35 - dist/node_modules/log-symbols/browser.js | 8 - dist/node_modules/log-symbols/index.d.ts | 25 - dist/node_modules/log-symbols/index.js | 19 - dist/node_modules/log-symbols/license | 9 - dist/node_modules/log-symbols/package.json | 52 - dist/node_modules/log-symbols/readme.md | 51 - dist/node_modules/mimic-fn/index.d.ts | 54 - dist/node_modules/mimic-fn/index.js | 13 - dist/node_modules/mimic-fn/license | 9 - dist/node_modules/mimic-fn/package.json | 42 - dist/node_modules/mimic-fn/readme.md | 69 - dist/node_modules/mute-stream/README.md | 6 +- dist/node_modules/mute-stream/lib/index.js | 142 + dist/node_modules/mute-stream/mute.js | 145 - dist/node_modules/mute-stream/package.json | 45 +- dist/node_modules/onetime/index.d.ts | 64 - dist/node_modules/onetime/index.js | 44 - dist/node_modules/onetime/license | 9 - dist/node_modules/onetime/package.json | 43 - dist/node_modules/onetime/readme.md | 94 - dist/node_modules/ora/index.d.ts | 277 - dist/node_modules/ora/index.js | 407 - dist/node_modules/ora/license | 9 - dist/node_modules/ora/package.json | 57 - dist/node_modules/ora/readme.md | 264 - .../readable-stream/CONTRIBUTING.md | 38 - .../readable-stream/GOVERNANCE.md | 136 - dist/node_modules/readable-stream/LICENSE | 47 - dist/node_modules/readable-stream/README.md | 106 - .../readable-stream/errors-browser.js | 127 - dist/node_modules/readable-stream/errors.js | 116 - .../readable-stream/experimentalWarning.js | 17 - .../readable-stream/lib/_stream_duplex.js | 126 - .../lib/_stream_passthrough.js | 37 - .../readable-stream/lib/_stream_readable.js | 1027 --- .../readable-stream/lib/_stream_transform.js | 190 - .../readable-stream/lib/_stream_writable.js | 641 -- .../lib/internal/streams/async_iterator.js | 180 - .../lib/internal/streams/buffer_list.js | 183 - .../lib/internal/streams/destroy.js | 96 - .../lib/internal/streams/end-of-stream.js | 86 - .../lib/internal/streams/from-browser.js | 3 - .../lib/internal/streams/from.js | 52 - .../lib/internal/streams/pipeline.js | 86 - .../lib/internal/streams/state.js | 22 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 68 - .../readable-stream/readable-browser.js | 9 - dist/node_modules/readable-stream/readable.js | 16 - dist/node_modules/restore-cursor/index.d.ts | 13 - dist/node_modules/restore-cursor/index.js | 9 - dist/node_modules/restore-cursor/license | 9 - dist/node_modules/restore-cursor/package.json | 52 - dist/node_modules/restore-cursor/readme.md | 26 - dist/node_modules/run-async/LICENSE | 21 - dist/node_modules/run-async/README.md | 79 - dist/node_modules/run-async/index.js | 98 - dist/node_modules/run-async/package.json | 27 - dist/node_modules/rxjs/CHANGELOG.md | 2742 ------- dist/node_modules/rxjs/CODE_OF_CONDUCT.md | 73 - dist/node_modules/rxjs/LICENSE.txt | 202 - dist/node_modules/rxjs/README.md | 107 - dist/node_modules/rxjs/ajax/package.json | 8 - .../rxjs/dist/bundles/rxjs.umd.js | 6842 ----------------- .../rxjs/dist/bundles/rxjs.umd.js.map | 1 - .../rxjs/dist/bundles/rxjs.umd.min.js | 195 - .../rxjs/dist/bundles/rxjs.umd.min.js.map | 1 - dist/node_modules/rxjs/dist/cjs/ajax/index.js | 11 - .../rxjs/dist/cjs/ajax/index.js.map | 1 - .../node_modules/rxjs/dist/cjs/fetch/index.js | 6 - .../rxjs/dist/cjs/fetch/index.js.map | 1 - dist/node_modules/rxjs/dist/cjs/index.js | 358 - dist/node_modules/rxjs/dist/cjs/index.js.map | 1 - .../rxjs/dist/cjs/internal/AnyCatcher.js | 3 - .../rxjs/dist/cjs/internal/AnyCatcher.js.map | 1 - .../rxjs/dist/cjs/internal/AsyncSubject.js | 56 - .../dist/cjs/internal/AsyncSubject.js.map | 1 - .../rxjs/dist/cjs/internal/BehaviorSubject.js | 53 - .../dist/cjs/internal/BehaviorSubject.js.map | 1 - .../rxjs/dist/cjs/internal/Notification.js | 76 - .../dist/cjs/internal/Notification.js.map | 1 - .../cjs/internal/NotificationFactories.js | 21 - .../cjs/internal/NotificationFactories.js.map | 1 - .../rxjs/dist/cjs/internal/Observable.js | 105 - .../rxjs/dist/cjs/internal/Observable.js.map | 1 - .../rxjs/dist/cjs/internal/Operator.js | 3 - .../rxjs/dist/cjs/internal/Operator.js.map | 1 - .../rxjs/dist/cjs/internal/ReplaySubject.js | 75 - .../dist/cjs/internal/ReplaySubject.js.map | 1 - .../rxjs/dist/cjs/internal/Scheduler.js | 19 - .../rxjs/dist/cjs/internal/Scheduler.js.map | 1 - .../rxjs/dist/cjs/internal/Subject.js | 190 - .../rxjs/dist/cjs/internal/Subject.js.map | 1 - .../rxjs/dist/cjs/internal/Subscriber.js | 201 - .../rxjs/dist/cjs/internal/Subscriber.js.map | 1 - .../rxjs/dist/cjs/internal/Subscription.js | 178 - .../dist/cjs/internal/Subscription.js.map | 1 - .../dist/cjs/internal/ajax/AjaxResponse.js | 32 - .../cjs/internal/ajax/AjaxResponse.js.map | 1 - .../rxjs/dist/cjs/internal/ajax/ajax.js | 253 - .../rxjs/dist/cjs/internal/ajax/ajax.js.map | 1 - .../rxjs/dist/cjs/internal/ajax/errors.js | 33 - .../rxjs/dist/cjs/internal/ajax/errors.js.map | 1 - .../dist/cjs/internal/ajax/getXHRResponse.js | 30 - .../cjs/internal/ajax/getXHRResponse.js.map | 1 - .../rxjs/dist/cjs/internal/ajax/types.js | 3 - .../rxjs/dist/cjs/internal/ajax/types.js.map | 1 - .../rxjs/dist/cjs/internal/config.js | 11 - .../rxjs/dist/cjs/internal/config.js.map | 1 - .../rxjs/dist/cjs/internal/firstValueFrom.js | 28 - .../dist/cjs/internal/firstValueFrom.js.map | 1 - .../rxjs/dist/cjs/internal/lastValueFrom.js | 31 - .../dist/cjs/internal/lastValueFrom.js.map | 1 - .../observable/ConnectableObservable.js | 80 - .../observable/ConnectableObservable.js.map | 1 - .../cjs/internal/observable/bindCallback.js | 9 - .../internal/observable/bindCallback.js.map | 1 - .../observable/bindCallbackInternals.js | 103 - .../observable/bindCallbackInternals.js.map | 1 - .../internal/observable/bindNodeCallback.js | 9 - .../observable/bindNodeCallback.js.map | 1 - .../cjs/internal/observable/combineLatest.js | 75 - .../internal/observable/combineLatest.js.map | 1 - .../dist/cjs/internal/observable/concat.js | 15 - .../cjs/internal/observable/concat.js.map | 1 - .../cjs/internal/observable/connectable.js | 31 - .../internal/observable/connectable.js.map | 1 - .../dist/cjs/internal/observable/defer.js | 12 - .../dist/cjs/internal/observable/defer.js.map | 1 - .../observable/dom/WebSocketSubject.js | 249 - .../observable/dom/WebSocketSubject.js.map | 1 - .../observable/dom/animationFrames.js | 38 - .../observable/dom/animationFrames.js.map | 1 - .../dist/cjs/internal/observable/dom/fetch.js | 79 - .../cjs/internal/observable/dom/fetch.js.map | 1 - .../cjs/internal/observable/dom/webSocket.js | 9 - .../internal/observable/dom/webSocket.js.map | 1 - .../dist/cjs/internal/observable/empty.js | 13 - .../dist/cjs/internal/observable/empty.js.map | 1 - .../dist/cjs/internal/observable/forkJoin.js | 51 - .../cjs/internal/observable/forkJoin.js.map | 1 - .../rxjs/dist/cjs/internal/observable/from.js | 10 - .../dist/cjs/internal/observable/from.js.map | 1 - .../dist/cjs/internal/observable/fromEvent.js | 78 - .../cjs/internal/observable/fromEvent.js.map | 1 - .../internal/observable/fromEventPattern.js | 24 - .../observable/fromEventPattern.js.map | 1 - .../internal/observable/fromSubscribable.js | 9 - .../observable/fromSubscribable.js.map | 1 - .../dist/cjs/internal/observable/generate.js | 79 - .../cjs/internal/observable/generate.js.map | 1 - .../rxjs/dist/cjs/internal/observable/iif.js | 9 - .../dist/cjs/internal/observable/iif.js.map | 1 - .../dist/cjs/internal/observable/innerFrom.js | 206 - .../cjs/internal/observable/innerFrom.js.map | 1 - .../dist/cjs/internal/observable/interval.js | 15 - .../cjs/internal/observable/interval.js.map | 1 - .../dist/cjs/internal/observable/merge.js | 27 - .../dist/cjs/internal/observable/merge.js.map | 1 - .../dist/cjs/internal/observable/never.js | 11 - .../dist/cjs/internal/observable/never.js.map | 1 - .../rxjs/dist/cjs/internal/observable/of.js | 15 - .../dist/cjs/internal/observable/of.js.map | 1 - .../internal/observable/onErrorResumeNext.js | 39 - .../observable/onErrorResumeNext.js.map | 1 - .../dist/cjs/internal/observable/pairs.js | 9 - .../dist/cjs/internal/observable/pairs.js.map | 1 - .../dist/cjs/internal/observable/partition.js | 11 - .../cjs/internal/observable/partition.js.map | 1 - .../rxjs/dist/cjs/internal/observable/race.js | 37 - .../dist/cjs/internal/observable/race.js.map | 1 - .../dist/cjs/internal/observable/range.js | 39 - .../dist/cjs/internal/observable/range.js.map | 1 - .../cjs/internal/observable/throwError.js | 12 - .../cjs/internal/observable/throwError.js.map | 1 - .../dist/cjs/internal/observable/timer.js | 40 - .../dist/cjs/internal/observable/timer.js.map | 1 - .../dist/cjs/internal/observable/using.js | 21 - .../dist/cjs/internal/observable/using.js.map | 1 - .../rxjs/dist/cjs/internal/observable/zip.js | 70 - .../dist/cjs/internal/observable/zip.js.map | 1 - .../internal/operators/OperatorSubscriber.js | 79 - .../operators/OperatorSubscriber.js.map | 1 - .../rxjs/dist/cjs/internal/operators/audit.js | 41 - .../dist/cjs/internal/operators/audit.js.map | 1 - .../dist/cjs/internal/operators/auditTime.js | 12 - .../cjs/internal/operators/auditTime.js.map | 1 - .../dist/cjs/internal/operators/buffer.js | 26 - .../dist/cjs/internal/operators/buffer.js.map | 1 - .../cjs/internal/operators/bufferCount.js | 85 - .../cjs/internal/operators/bufferCount.js.map | 1 - .../dist/cjs/internal/operators/bufferTime.js | 91 - .../cjs/internal/operators/bufferTime.js.map | 1 - .../cjs/internal/operators/bufferToggle.js | 59 - .../internal/operators/bufferToggle.js.map | 1 - .../dist/cjs/internal/operators/bufferWhen.js | 27 - .../cjs/internal/operators/bufferWhen.js.map | 1 - .../dist/cjs/internal/operators/catchError.js | 31 - .../cjs/internal/operators/catchError.js.map | 1 - .../dist/cjs/internal/operators/combineAll.js | 6 - .../cjs/internal/operators/combineAll.js.map | 1 - .../cjs/internal/operators/combineLatest.js | 44 - .../internal/operators/combineLatest.js.map | 1 - .../internal/operators/combineLatestAll.js | 10 - .../operators/combineLatestAll.js.map | 1 - .../internal/operators/combineLatestWith.js | 34 - .../operators/combineLatestWith.js.map | 1 - .../dist/cjs/internal/operators/concat.js | 40 - .../dist/cjs/internal/operators/concat.js.map | 1 - .../dist/cjs/internal/operators/concatAll.js | 9 - .../cjs/internal/operators/concatAll.js.map | 1 - .../dist/cjs/internal/operators/concatMap.js | 10 - .../cjs/internal/operators/concatMap.js.map | 1 - .../cjs/internal/operators/concatMapTo.js | 10 - .../cjs/internal/operators/concatMapTo.js.map | 1 - .../dist/cjs/internal/operators/concatWith.js | 34 - .../cjs/internal/operators/concatWith.js.map | 1 - .../dist/cjs/internal/operators/connect.js | 21 - .../cjs/internal/operators/connect.js.map | 1 - .../rxjs/dist/cjs/internal/operators/count.js | 9 - .../dist/cjs/internal/operators/count.js.map | 1 - .../dist/cjs/internal/operators/debounce.js | 38 - .../cjs/internal/operators/debounce.js.map | 1 - .../cjs/internal/operators/debounceTime.js | 48 - .../internal/operators/debounceTime.js.map | 1 - .../cjs/internal/operators/defaultIfEmpty.js | 21 - .../internal/operators/defaultIfEmpty.js.map | 1 - .../rxjs/dist/cjs/internal/operators/delay.js | 13 - .../dist/cjs/internal/operators/delay.js.map | 1 - .../dist/cjs/internal/operators/delayWhen.js | 19 - .../cjs/internal/operators/delayWhen.js.map | 1 - .../cjs/internal/operators/dematerialize.js | 13 - .../internal/operators/dematerialize.js.map | 1 - .../dist/cjs/internal/operators/distinct.js | 22 - .../cjs/internal/operators/distinct.js.map | 1 - .../operators/distinctUntilChanged.js | 27 - .../operators/distinctUntilChanged.js.map | 1 - .../operators/distinctUntilKeyChanged.js | 9 - .../operators/distinctUntilKeyChanged.js.map | 1 - .../dist/cjs/internal/operators/elementAt.js | 19 - .../cjs/internal/operators/elementAt.js.map | 1 - .../dist/cjs/internal/operators/endWith.js | 35 - .../cjs/internal/operators/endWith.js.map | 1 - .../rxjs/dist/cjs/internal/operators/every.js | 21 - .../dist/cjs/internal/operators/every.js.map | 1 - .../dist/cjs/internal/operators/exhaust.js | 6 - .../cjs/internal/operators/exhaust.js.map | 1 - .../dist/cjs/internal/operators/exhaustAll.js | 10 - .../cjs/internal/operators/exhaustAll.js.map | 1 - .../dist/cjs/internal/operators/exhaustMap.js | 33 - .../cjs/internal/operators/exhaustMap.js.map | 1 - .../dist/cjs/internal/operators/expand.js | 14 - .../dist/cjs/internal/operators/expand.js.map | 1 - .../dist/cjs/internal/operators/filter.js | 13 - .../dist/cjs/internal/operators/filter.js.map | 1 - .../dist/cjs/internal/operators/finalize.js | 16 - .../cjs/internal/operators/finalize.js.map | 1 - .../rxjs/dist/cjs/internal/operators/find.js | 27 - .../dist/cjs/internal/operators/find.js.map | 1 - .../dist/cjs/internal/operators/findIndex.js | 10 - .../cjs/internal/operators/findIndex.js.map | 1 - .../rxjs/dist/cjs/internal/operators/first.js | 17 - .../dist/cjs/internal/operators/first.js.map | 1 - .../dist/cjs/internal/operators/flatMap.js | 6 - .../cjs/internal/operators/flatMap.js.map | 1 - .../dist/cjs/internal/operators/groupBy.js | 67 - .../cjs/internal/operators/groupBy.js.map | 1 - .../cjs/internal/operators/ignoreElements.js | 13 - .../internal/operators/ignoreElements.js.map | 1 - .../dist/cjs/internal/operators/isEmpty.js | 18 - .../cjs/internal/operators/isEmpty.js.map | 1 - .../internal/operators/joinAllInternals.js | 13 - .../operators/joinAllInternals.js.map | 1 - .../rxjs/dist/cjs/internal/operators/last.js | 17 - .../dist/cjs/internal/operators/last.js.map | 1 - .../rxjs/dist/cjs/internal/operators/map.js | 15 - .../dist/cjs/internal/operators/map.js.map | 1 - .../rxjs/dist/cjs/internal/operators/mapTo.js | 9 - .../dist/cjs/internal/operators/mapTo.js.map | 1 - .../cjs/internal/operators/materialize.js | 21 - .../cjs/internal/operators/materialize.js.map | 1 - .../rxjs/dist/cjs/internal/operators/max.js | 10 - .../dist/cjs/internal/operators/max.js.map | 1 - .../rxjs/dist/cjs/internal/operators/merge.js | 43 - .../dist/cjs/internal/operators/merge.js.map | 1 - .../dist/cjs/internal/operators/mergeAll.js | 11 - .../cjs/internal/operators/mergeAll.js.map | 1 - .../cjs/internal/operators/mergeInternals.js | 65 - .../internal/operators/mergeInternals.js.map | 1 - .../dist/cjs/internal/operators/mergeMap.js | 20 - .../cjs/internal/operators/mergeMap.js.map | 1 - .../dist/cjs/internal/operators/mergeMapTo.js | 17 - .../cjs/internal/operators/mergeMapTo.js.map | 1 - .../dist/cjs/internal/operators/mergeScan.js | 16 - .../cjs/internal/operators/mergeScan.js.map | 1 - .../dist/cjs/internal/operators/mergeWith.js | 34 - .../cjs/internal/operators/mergeWith.js.map | 1 - .../rxjs/dist/cjs/internal/operators/min.js | 10 - .../dist/cjs/internal/operators/min.js.map | 1 - .../dist/cjs/internal/operators/multicast.js | 17 - .../cjs/internal/operators/multicast.js.map | 1 - .../dist/cjs/internal/operators/observeOn.js | 14 - .../cjs/internal/operators/observeOn.js.map | 1 - .../operators/onErrorResumeNextWith.js | 37 - .../operators/onErrorResumeNextWith.js.map | 1 - .../dist/cjs/internal/operators/pairwise.js | 19 - .../cjs/internal/operators/pairwise.js.map | 1 - .../dist/cjs/internal/operators/partition.js | 12 - .../cjs/internal/operators/partition.js.map | 1 - .../rxjs/dist/cjs/internal/operators/pluck.js | 29 - .../dist/cjs/internal/operators/pluck.js.map | 1 - .../dist/cjs/internal/operators/publish.js | 11 - .../cjs/internal/operators/publish.js.map | 1 - .../cjs/internal/operators/publishBehavior.js | 13 - .../internal/operators/publishBehavior.js.map | 1 - .../cjs/internal/operators/publishLast.js | 13 - .../cjs/internal/operators/publishLast.js.map | 1 - .../cjs/internal/operators/publishReplay.js | 15 - .../internal/operators/publishReplay.js.map | 1 - .../rxjs/dist/cjs/internal/operators/race.js | 35 - .../dist/cjs/internal/operators/race.js.map | 1 - .../dist/cjs/internal/operators/raceWith.js | 40 - .../cjs/internal/operators/raceWith.js.map | 1 - .../dist/cjs/internal/operators/reduce.js | 10 - .../dist/cjs/internal/operators/reduce.js.map | 1 - .../dist/cjs/internal/operators/refCount.js | 30 - .../cjs/internal/operators/refCount.js.map | 1 - .../dist/cjs/internal/operators/repeat.js | 64 - .../dist/cjs/internal/operators/repeat.js.map | 1 - .../dist/cjs/internal/operators/repeatWhen.js | 50 - .../cjs/internal/operators/repeatWhen.js.map | 1 - .../rxjs/dist/cjs/internal/operators/retry.js | 73 - .../dist/cjs/internal/operators/retry.js.map | 1 - .../dist/cjs/internal/operators/retryWhen.js | 36 - .../cjs/internal/operators/retryWhen.js.map | 1 - .../dist/cjs/internal/operators/sample.js | 27 - .../dist/cjs/internal/operators/sample.js.map | 1 - .../dist/cjs/internal/operators/sampleTime.js | 12 - .../cjs/internal/operators/sampleTime.js.map | 1 - .../rxjs/dist/cjs/internal/operators/scan.js | 10 - .../dist/cjs/internal/operators/scan.js.map | 1 - .../cjs/internal/operators/scanInternals.js | 26 - .../internal/operators/scanInternals.js.map | 1 - .../cjs/internal/operators/sequenceEqual.js | 44 - .../internal/operators/sequenceEqual.js.map | 1 - .../rxjs/dist/cjs/internal/operators/share.js | 109 - .../dist/cjs/internal/operators/share.js.map | 1 - .../cjs/internal/operators/shareReplay.js | 24 - .../cjs/internal/operators/shareReplay.js.map | 1 - .../dist/cjs/internal/operators/single.js | 34 - .../dist/cjs/internal/operators/single.js.map | 1 - .../rxjs/dist/cjs/internal/operators/skip.js | 9 - .../dist/cjs/internal/operators/skip.js.map | 1 - .../dist/cjs/internal/operators/skipLast.js | 32 - .../cjs/internal/operators/skipLast.js.map | 1 - .../dist/cjs/internal/operators/skipUntil.js | 20 - .../cjs/internal/operators/skipUntil.js.map | 1 - .../dist/cjs/internal/operators/skipWhile.js | 14 - .../cjs/internal/operators/skipWhile.js.map | 1 - .../dist/cjs/internal/operators/startWith.js | 18 - .../cjs/internal/operators/startWith.js.map | 1 - .../cjs/internal/operators/subscribeOn.js | 12 - .../cjs/internal/operators/subscribeOn.js.map | 1 - .../dist/cjs/internal/operators/switchAll.js | 10 - .../cjs/internal/operators/switchAll.js.map | 1 - .../dist/cjs/internal/operators/switchMap.js | 28 - .../cjs/internal/operators/switchMap.js.map | 1 - .../cjs/internal/operators/switchMapTo.js | 10 - .../cjs/internal/operators/switchMapTo.js.map | 1 - .../dist/cjs/internal/operators/switchScan.js | 16 - .../cjs/internal/operators/switchScan.js.map | 1 - .../rxjs/dist/cjs/internal/operators/take.js | 24 - .../dist/cjs/internal/operators/take.js.map | 1 - .../dist/cjs/internal/operators/takeLast.js | 48 - .../cjs/internal/operators/takeLast.js.map | 1 - .../dist/cjs/internal/operators/takeUntil.js | 15 - .../cjs/internal/operators/takeUntil.js.map | 1 - .../dist/cjs/internal/operators/takeWhile.js | 18 - .../cjs/internal/operators/takeWhile.js.map | 1 - .../rxjs/dist/cjs/internal/operators/tap.js | 44 - .../dist/cjs/internal/operators/tap.js.map | 1 - .../dist/cjs/internal/operators/throttle.js | 49 - .../cjs/internal/operators/throttle.js.map | 1 - .../cjs/internal/operators/throttleTime.js | 13 - .../internal/operators/throttleTime.js.map | 1 - .../cjs/internal/operators/throwIfEmpty.js | 21 - .../internal/operators/throwIfEmpty.js.map | 1 - .../cjs/internal/operators/timeInterval.js | 28 - .../internal/operators/timeInterval.js.map | 1 - .../dist/cjs/internal/operators/timeout.js | 63 - .../cjs/internal/operators/timeout.js.map | 1 - .../cjs/internal/operators/timeoutWith.js | 35 - .../cjs/internal/operators/timeoutWith.js.map | 1 - .../dist/cjs/internal/operators/timestamp.js | 11 - .../cjs/internal/operators/timestamp.js.map | 1 - .../dist/cjs/internal/operators/toArray.js | 13 - .../cjs/internal/operators/toArray.js.map | 1 - .../dist/cjs/internal/operators/window.js | 32 - .../dist/cjs/internal/operators/window.js.map | 1 - .../cjs/internal/operators/windowCount.js | 67 - .../cjs/internal/operators/windowCount.js.map | 1 - .../dist/cjs/internal/operators/windowTime.js | 74 - .../cjs/internal/operators/windowTime.js.map | 1 - .../cjs/internal/operators/windowToggle.js | 80 - .../internal/operators/windowToggle.js.map | 1 - .../dist/cjs/internal/operators/windowWhen.js | 42 - .../cjs/internal/operators/windowWhen.js.map | 1 - .../cjs/internal/operators/withLatestFrom.js | 63 - .../internal/operators/withLatestFrom.js.map | 1 - .../rxjs/dist/cjs/internal/operators/zip.js | 37 - .../dist/cjs/internal/operators/zip.js.map | 1 - .../dist/cjs/internal/operators/zipAll.js | 10 - .../dist/cjs/internal/operators/zipAll.js.map | 1 - .../dist/cjs/internal/operators/zipWith.js | 34 - .../cjs/internal/operators/zipWith.js.map | 1 - .../cjs/internal/scheduled/scheduleArray.js | 22 - .../internal/scheduled/scheduleArray.js.map | 1 - .../scheduled/scheduleAsyncIterable.js | 27 - .../scheduled/scheduleAsyncIterable.js.map | 1 - .../internal/scheduled/scheduleIterable.js | 36 - .../scheduled/scheduleIterable.js.map | 1 - .../internal/scheduled/scheduleObservable.js | 11 - .../scheduled/scheduleObservable.js.map | 1 - .../cjs/internal/scheduled/schedulePromise.js | 11 - .../internal/scheduled/schedulePromise.js.map | 1 - .../scheduled/scheduleReadableStreamLike.js | 10 - .../scheduleReadableStreamLike.js.map | 1 - .../dist/cjs/internal/scheduled/scheduled.js | 41 - .../cjs/internal/scheduled/scheduled.js.map | 1 - .../dist/cjs/internal/scheduler/Action.js | 32 - .../dist/cjs/internal/scheduler/Action.js.map | 1 - .../scheduler/AnimationFrameAction.js | 53 - .../scheduler/AnimationFrameAction.js.map | 1 - .../scheduler/AnimationFrameScheduler.js | 48 - .../scheduler/AnimationFrameScheduler.js.map | 1 - .../dist/cjs/internal/scheduler/AsapAction.js | 55 - .../cjs/internal/scheduler/AsapAction.js.map | 1 - .../cjs/internal/scheduler/AsapScheduler.js | 48 - .../internal/scheduler/AsapScheduler.js.map | 1 - .../cjs/internal/scheduler/AsyncAction.js | 107 - .../cjs/internal/scheduler/AsyncAction.js.map | 1 - .../cjs/internal/scheduler/AsyncScheduler.js | 53 - .../internal/scheduler/AsyncScheduler.js.map | 1 - .../cjs/internal/scheduler/QueueAction.js | 52 - .../cjs/internal/scheduler/QueueAction.js.map | 1 - .../cjs/internal/scheduler/QueueScheduler.js | 28 - .../internal/scheduler/QueueScheduler.js.map | 1 - .../scheduler/VirtualTimeScheduler.js | 121 - .../scheduler/VirtualTimeScheduler.js.map | 1 - .../cjs/internal/scheduler/animationFrame.js | 8 - .../internal/scheduler/animationFrame.js.map | 1 - .../scheduler/animationFrameProvider.js | 59 - .../scheduler/animationFrameProvider.js.map | 1 - .../rxjs/dist/cjs/internal/scheduler/asap.js | 8 - .../dist/cjs/internal/scheduler/asap.js.map | 1 - .../rxjs/dist/cjs/internal/scheduler/async.js | 8 - .../dist/cjs/internal/scheduler/async.js.map | 1 - .../scheduler/dateTimestampProvider.js | 10 - .../scheduler/dateTimestampProvider.js.map | 1 - .../internal/scheduler/immediateProvider.js | 42 - .../scheduler/immediateProvider.js.map | 1 - .../internal/scheduler/intervalProvider.js | 43 - .../scheduler/intervalProvider.js.map | 1 - .../scheduler/performanceTimestampProvider.js | 10 - .../performanceTimestampProvider.js.map | 1 - .../rxjs/dist/cjs/internal/scheduler/queue.js | 8 - .../dist/cjs/internal/scheduler/queue.js.map | 1 - .../cjs/internal/scheduler/timeoutProvider.js | 43 - .../internal/scheduler/timeoutProvider.js.map | 1 - .../cjs/internal/scheduler/timerHandle.js | 3 - .../cjs/internal/scheduler/timerHandle.js.map | 1 - .../rxjs/dist/cjs/internal/symbol/iterator.js | 12 - .../dist/cjs/internal/symbol/iterator.js.map | 1 - .../dist/cjs/internal/symbol/observable.js | 5 - .../cjs/internal/symbol/observable.js.map | 1 - .../cjs/internal/testing/ColdObservable.js | 56 - .../internal/testing/ColdObservable.js.map | 1 - .../cjs/internal/testing/HotObservable.js | 62 - .../cjs/internal/testing/HotObservable.js.map | 1 - .../cjs/internal/testing/SubscriptionLog.js | 13 - .../internal/testing/SubscriptionLog.js.map | 1 - .../internal/testing/SubscriptionLoggable.js | 21 - .../testing/SubscriptionLoggable.js.map | 1 - .../dist/cjs/internal/testing/TestMessage.js | 3 - .../cjs/internal/testing/TestMessage.js.map | 1 - .../cjs/internal/testing/TestScheduler.js | 618 -- .../cjs/internal/testing/TestScheduler.js.map | 1 - .../rxjs/dist/cjs/internal/types.js | 3 - .../rxjs/dist/cjs/internal/types.js.map | 1 - .../internal/util/ArgumentOutOfRangeError.js | 12 - .../util/ArgumentOutOfRangeError.js.map | 1 - .../rxjs/dist/cjs/internal/util/EmptyError.js | 10 - .../dist/cjs/internal/util/EmptyError.js.map | 1 - .../rxjs/dist/cjs/internal/util/Immediate.js | 33 - .../dist/cjs/internal/util/Immediate.js.map | 1 - .../dist/cjs/internal/util/NotFoundError.js | 12 - .../cjs/internal/util/NotFoundError.js.map | 1 - .../internal/util/ObjectUnsubscribedError.js | 12 - .../util/ObjectUnsubscribedError.js.map | 1 - .../dist/cjs/internal/util/SequenceError.js | 12 - .../cjs/internal/util/SequenceError.js.map | 1 - .../cjs/internal/util/UnsubscriptionError.js | 15 - .../internal/util/UnsubscriptionError.js.map | 1 - .../dist/cjs/internal/util/applyMixins.js | 15 - .../dist/cjs/internal/util/applyMixins.js.map | 1 - .../rxjs/dist/cjs/internal/util/args.js | 21 - .../rxjs/dist/cjs/internal/util/args.js.map | 1 - .../cjs/internal/util/argsArgArrayOrObject.js | 26 - .../internal/util/argsArgArrayOrObject.js.map | 1 - .../dist/cjs/internal/util/argsOrArgArray.js | 9 - .../cjs/internal/util/argsOrArgArray.js.map | 1 - .../rxjs/dist/cjs/internal/util/arrRemove.js | 11 - .../dist/cjs/internal/util/arrRemove.js.map | 1 - .../cjs/internal/util/createErrorClass.js | 15 - .../cjs/internal/util/createErrorClass.js.map | 1 - .../dist/cjs/internal/util/createObject.js | 8 - .../cjs/internal/util/createObject.js.map | 1 - .../dist/cjs/internal/util/errorContext.js | 33 - .../cjs/internal/util/errorContext.js.map | 1 - .../dist/cjs/internal/util/executeSchedule.js | 22 - .../cjs/internal/util/executeSchedule.js.map | 1 - .../rxjs/dist/cjs/internal/util/identity.js | 8 - .../dist/cjs/internal/util/identity.js.map | 1 - .../dist/cjs/internal/util/isArrayLike.js | 5 - .../dist/cjs/internal/util/isArrayLike.js.map | 1 - .../dist/cjs/internal/util/isAsyncIterable.js | 9 - .../cjs/internal/util/isAsyncIterable.js.map | 1 - .../rxjs/dist/cjs/internal/util/isDate.js | 8 - .../rxjs/dist/cjs/internal/util/isDate.js.map | 1 - .../rxjs/dist/cjs/internal/util/isFunction.js | 8 - .../dist/cjs/internal/util/isFunction.js.map | 1 - .../cjs/internal/util/isInteropObservable.js | 10 - .../internal/util/isInteropObservable.js.map | 1 - .../rxjs/dist/cjs/internal/util/isIterable.js | 10 - .../dist/cjs/internal/util/isIterable.js.map | 1 - .../dist/cjs/internal/util/isObservable.js | 10 - .../cjs/internal/util/isObservable.js.map | 1 - .../rxjs/dist/cjs/internal/util/isPromise.js | 9 - .../dist/cjs/internal/util/isPromise.js.map | 1 - .../cjs/internal/util/isReadableStreamLike.js | 82 - .../internal/util/isReadableStreamLike.js.map | 1 - .../dist/cjs/internal/util/isScheduler.js | 9 - .../dist/cjs/internal/util/isScheduler.js.map | 1 - .../rxjs/dist/cjs/internal/util/lift.js | 25 - .../rxjs/dist/cjs/internal/util/lift.js.map | 1 - .../cjs/internal/util/mapOneOrManyArgs.js | 34 - .../cjs/internal/util/mapOneOrManyArgs.js.map | 1 - .../rxjs/dist/cjs/internal/util/noop.js | 6 - .../rxjs/dist/cjs/internal/util/noop.js.map | 1 - .../rxjs/dist/cjs/internal/util/not.js | 8 - .../rxjs/dist/cjs/internal/util/not.js.map | 1 - .../rxjs/dist/cjs/internal/util/pipe.js | 25 - .../rxjs/dist/cjs/internal/util/pipe.js.map | 1 - .../cjs/internal/util/reportUnhandledError.js | 18 - .../internal/util/reportUnhandledError.js.map | 1 - .../cjs/internal/util/subscribeToArray.js | 11 - .../cjs/internal/util/subscribeToArray.js.map | 1 - .../internal/util/throwUnobservableError.js | 8 - .../util/throwUnobservableError.js.map | 1 - .../dist/cjs/internal/util/workarounds.js | 3 - .../dist/cjs/internal/util/workarounds.js.map | 1 - .../rxjs/dist/cjs/operators/index.js | 232 - .../rxjs/dist/cjs/operators/index.js.map | 1 - .../rxjs/dist/cjs/testing/index.js | 6 - .../rxjs/dist/cjs/testing/index.js.map | 1 - .../rxjs/dist/cjs/webSocket/index.js | 8 - .../rxjs/dist/cjs/webSocket/index.js.map | 1 - dist/node_modules/rxjs/dist/esm/ajax/index.js | 4 - .../rxjs/dist/esm/ajax/index.js.map | 1 - .../node_modules/rxjs/dist/esm/fetch/index.js | 2 - .../rxjs/dist/esm/fetch/index.js.map | 1 - dist/node_modules/rxjs/dist/esm/index.js | 169 - dist/node_modules/rxjs/dist/esm/index.js.map | 1 - .../rxjs/dist/esm/internal/AnyCatcher.js | 2 - .../rxjs/dist/esm/internal/AnyCatcher.js.map | 1 - .../rxjs/dist/esm/internal/AsyncSubject.js | 34 - .../dist/esm/internal/AsyncSubject.js.map | 1 - .../rxjs/dist/esm/internal/BehaviorSubject.js | 27 - .../dist/esm/internal/BehaviorSubject.js.map | 1 - .../rxjs/dist/esm/internal/Notification.js | 70 - .../dist/esm/internal/Notification.js.map | 1 - .../esm/internal/NotificationFactories.js | 15 - .../esm/internal/NotificationFactories.js.map | 1 - .../rxjs/dist/esm/internal/Observable.js | 93 - .../rxjs/dist/esm/internal/Observable.js.map | 1 - .../rxjs/dist/esm/internal/Operator.js | 2 - .../rxjs/dist/esm/internal/Operator.js.map | 1 - .../rxjs/dist/esm/internal/ReplaySubject.js | 50 - .../dist/esm/internal/ReplaySubject.js.map | 1 - .../rxjs/dist/esm/internal/Scheduler.js | 12 - .../rxjs/dist/esm/internal/Scheduler.js.map | 1 - .../rxjs/dist/esm/internal/Subject.js | 134 - .../rxjs/dist/esm/internal/Subject.js.map | 1 - .../rxjs/dist/esm/internal/Subscriber.js | 174 - .../rxjs/dist/esm/internal/Subscriber.js.map | 1 - .../rxjs/dist/esm/internal/Subscription.js | 119 - .../dist/esm/internal/Subscription.js.map | 1 - .../dist/esm/internal/ajax/AjaxResponse.js | 26 - .../esm/internal/ajax/AjaxResponse.js.map | 1 - .../rxjs/dist/esm/internal/ajax/ajax.js | 236 - .../rxjs/dist/esm/internal/ajax/ajax.js.map | 1 - .../rxjs/dist/esm/internal/ajax/errors.js | 28 - .../rxjs/dist/esm/internal/ajax/errors.js.map | 1 - .../dist/esm/internal/ajax/getXHRResponse.js | 26 - .../esm/internal/ajax/getXHRResponse.js.map | 1 - .../rxjs/dist/esm/internal/ajax/types.js | 2 - .../rxjs/dist/esm/internal/ajax/types.js.map | 1 - .../rxjs/dist/esm/internal/config.js | 8 - .../rxjs/dist/esm/internal/config.js.map | 1 - .../rxjs/dist/esm/internal/firstValueFrom.js | 24 - .../dist/esm/internal/firstValueFrom.js.map | 1 - .../rxjs/dist/esm/internal/lastValueFrom.js | 27 - .../dist/esm/internal/lastValueFrom.js.map | 1 - .../observable/ConnectableObservable.js | 57 - .../observable/ConnectableObservable.js.map | 1 - .../esm/internal/observable/bindCallback.js | 5 - .../internal/observable/bindCallback.js.map | 1 - .../observable/bindCallbackInternals.js | 62 - .../observable/bindCallbackInternals.js.map | 1 - .../internal/observable/bindNodeCallback.js | 5 - .../observable/bindNodeCallback.js.map | 1 - .../esm/internal/observable/combineLatest.js | 62 - .../internal/observable/combineLatest.js.map | 1 - .../dist/esm/internal/observable/concat.js | 7 - .../esm/internal/observable/concat.js.map | 1 - .../esm/internal/observable/connectable.js | 26 - .../internal/observable/connectable.js.map | 1 - .../dist/esm/internal/observable/defer.js | 8 - .../dist/esm/internal/observable/defer.js.map | 1 - .../observable/dom/WebSocketSubject.js | 214 - .../observable/dom/WebSocketSubject.js.map | 1 - .../observable/dom/animationFrames.js | 34 - .../observable/dom/animationFrames.js.map | 1 - .../dist/esm/internal/observable/dom/fetch.js | 53 - .../esm/internal/observable/dom/fetch.js.map | 1 - .../esm/internal/observable/dom/webSocket.js | 5 - .../internal/observable/dom/webSocket.js.map | 1 - .../dist/esm/internal/observable/empty.js | 9 - .../dist/esm/internal/observable/empty.js.map | 1 - .../dist/esm/internal/observable/forkJoin.js | 40 - .../esm/internal/observable/forkJoin.js.map | 1 - .../rxjs/dist/esm/internal/observable/from.js | 6 - .../dist/esm/internal/observable/from.js.map | 1 - .../dist/esm/internal/observable/fromEvent.js | 52 - .../esm/internal/observable/fromEvent.js.map | 1 - .../internal/observable/fromEventPattern.js | 14 - .../observable/fromEventPattern.js.map | 1 - .../internal/observable/fromSubscribable.js | 5 - .../observable/fromSubscribable.js.map | 1 - .../dist/esm/internal/observable/generate.js | 38 - .../esm/internal/observable/generate.js.map | 1 - .../rxjs/dist/esm/internal/observable/iif.js | 5 - .../dist/esm/internal/observable/iif.js.map | 1 - .../dist/esm/internal/observable/innerFrom.js | 110 - .../esm/internal/observable/innerFrom.js.map | 1 - .../dist/esm/internal/observable/interval.js | 9 - .../esm/internal/observable/interval.js.map | 1 - .../dist/esm/internal/observable/merge.js | 19 - .../dist/esm/internal/observable/merge.js.map | 1 - .../dist/esm/internal/observable/never.js | 7 - .../dist/esm/internal/observable/never.js.map | 1 - .../rxjs/dist/esm/internal/observable/of.js | 7 - .../dist/esm/internal/observable/of.js.map | 1 - .../internal/observable/onErrorResumeNext.js | 31 - .../observable/onErrorResumeNext.js.map | 1 - .../dist/esm/internal/observable/pairs.js | 5 - .../dist/esm/internal/observable/pairs.js.map | 1 - .../dist/esm/internal/observable/partition.js | 7 - .../esm/internal/observable/partition.js.map | 1 - .../rxjs/dist/esm/internal/observable/race.js | 25 - .../dist/esm/internal/observable/race.js.map | 1 - .../dist/esm/internal/observable/range.js | 35 - .../dist/esm/internal/observable/range.js.map | 1 - .../esm/internal/observable/throwError.js | 8 - .../esm/internal/observable/throwError.js.map | 1 - .../dist/esm/internal/observable/timer.js | 34 - .../dist/esm/internal/observable/timer.js.map | 1 - .../dist/esm/internal/observable/using.js | 17 - .../dist/esm/internal/observable/using.js.map | 1 - .../rxjs/dist/esm/internal/observable/zip.js | 38 - .../dist/esm/internal/observable/zip.js.map | 1 - .../internal/operators/OperatorSubscriber.js | 56 - .../operators/OperatorSubscriber.js.map | 1 - .../rxjs/dist/esm/internal/operators/audit.js | 37 - .../dist/esm/internal/operators/audit.js.map | 1 - .../dist/esm/internal/operators/auditTime.js | 7 - .../esm/internal/operators/auditTime.js.map | 1 - .../dist/esm/internal/operators/buffer.js | 22 - .../dist/esm/internal/operators/buffer.js.map | 1 - .../esm/internal/operators/bufferCount.js | 37 - .../esm/internal/operators/bufferCount.js.map | 1 - .../dist/esm/internal/operators/bufferTime.js | 61 - .../esm/internal/operators/bufferTime.js.map | 1 - .../esm/internal/operators/bufferToggle.js | 33 - .../internal/operators/bufferToggle.js.map | 1 - .../dist/esm/internal/operators/bufferWhen.js | 23 - .../esm/internal/operators/bufferWhen.js.map | 1 - .../dist/esm/internal/operators/catchError.js | 27 - .../esm/internal/operators/catchError.js.map | 1 - .../dist/esm/internal/operators/combineAll.js | 3 - .../esm/internal/operators/combineAll.js.map | 1 - .../esm/internal/operators/combineLatest.js | 15 - .../internal/operators/combineLatest.js.map | 1 - .../internal/operators/combineLatestAll.js | 6 - .../operators/combineLatestAll.js.map | 1 - .../internal/operators/combineLatestWith.js | 5 - .../operators/combineLatestWith.js.map | 1 - .../dist/esm/internal/operators/concat.js | 11 - .../dist/esm/internal/operators/concat.js.map | 1 - .../dist/esm/internal/operators/concatAll.js | 5 - .../esm/internal/operators/concatAll.js.map | 1 - .../dist/esm/internal/operators/concatMap.js | 6 - .../esm/internal/operators/concatMap.js.map | 1 - .../esm/internal/operators/concatMapTo.js | 6 - .../esm/internal/operators/concatMapTo.js.map | 1 - .../dist/esm/internal/operators/concatWith.js | 5 - .../esm/internal/operators/concatWith.js.map | 1 - .../dist/esm/internal/operators/connect.js | 16 - .../esm/internal/operators/connect.js.map | 1 - .../rxjs/dist/esm/internal/operators/count.js | 5 - .../dist/esm/internal/operators/count.js.map | 1 - .../dist/esm/internal/operators/debounce.js | 34 - .../esm/internal/operators/debounce.js.map | 1 - .../esm/internal/operators/debounceTime.js | 43 - .../internal/operators/debounceTime.js.map | 1 - .../esm/internal/operators/defaultIfEmpty.js | 17 - .../internal/operators/defaultIfEmpty.js.map | 1 - .../rxjs/dist/esm/internal/operators/delay.js | 8 - .../dist/esm/internal/operators/delay.js.map | 1 - .../dist/esm/internal/operators/delayWhen.js | 13 - .../esm/internal/operators/delayWhen.js.map | 1 - .../esm/internal/operators/dematerialize.js | 9 - .../internal/operators/dematerialize.js.map | 1 - .../dist/esm/internal/operators/distinct.js | 18 - .../esm/internal/operators/distinct.js.map | 1 - .../operators/distinctUntilChanged.js | 22 - .../operators/distinctUntilChanged.js.map | 1 - .../operators/distinctUntilKeyChanged.js | 5 - .../operators/distinctUntilKeyChanged.js.map | 1 - .../dist/esm/internal/operators/elementAt.js | 13 - .../esm/internal/operators/elementAt.js.map | 1 - .../dist/esm/internal/operators/endWith.js | 6 - .../esm/internal/operators/endWith.js.map | 1 - .../rxjs/dist/esm/internal/operators/every.js | 17 - .../dist/esm/internal/operators/every.js.map | 1 - .../dist/esm/internal/operators/exhaust.js | 3 - .../esm/internal/operators/exhaust.js.map | 1 - .../dist/esm/internal/operators/exhaustAll.js | 6 - .../esm/internal/operators/exhaustAll.js.map | 1 - .../dist/esm/internal/operators/exhaustMap.js | 27 - .../esm/internal/operators/exhaustMap.js.map | 1 - .../dist/esm/internal/operators/expand.js | 7 - .../dist/esm/internal/operators/expand.js.map | 1 - .../dist/esm/internal/operators/filter.js | 9 - .../dist/esm/internal/operators/filter.js.map | 1 - .../dist/esm/internal/operators/finalize.js | 12 - .../esm/internal/operators/finalize.js.map | 1 - .../rxjs/dist/esm/internal/operators/find.js | 22 - .../dist/esm/internal/operators/find.js.map | 1 - .../dist/esm/internal/operators/findIndex.js | 6 - .../esm/internal/operators/findIndex.js.map | 1 - .../rxjs/dist/esm/internal/operators/first.js | 11 - .../dist/esm/internal/operators/first.js.map | 1 - .../dist/esm/internal/operators/flatMap.js | 3 - .../esm/internal/operators/flatMap.js.map | 1 - .../dist/esm/internal/operators/groupBy.js | 63 - .../esm/internal/operators/groupBy.js.map | 1 - .../esm/internal/operators/ignoreElements.js | 9 - .../internal/operators/ignoreElements.js.map | 1 - .../dist/esm/internal/operators/isEmpty.js | 14 - .../esm/internal/operators/isEmpty.js.map | 1 - .../internal/operators/joinAllInternals.js | 9 - .../operators/joinAllInternals.js.map | 1 - .../rxjs/dist/esm/internal/operators/last.js | 11 - .../dist/esm/internal/operators/last.js.map | 1 - .../rxjs/dist/esm/internal/operators/map.js | 11 - .../dist/esm/internal/operators/map.js.map | 1 - .../rxjs/dist/esm/internal/operators/mapTo.js | 5 - .../dist/esm/internal/operators/mapTo.js.map | 1 - .../esm/internal/operators/materialize.js | 17 - .../esm/internal/operators/materialize.js.map | 1 - .../rxjs/dist/esm/internal/operators/max.js | 6 - .../dist/esm/internal/operators/max.js.map | 1 - .../rxjs/dist/esm/internal/operators/merge.js | 14 - .../dist/esm/internal/operators/merge.js.map | 1 - .../dist/esm/internal/operators/mergeAll.js | 6 - .../esm/internal/operators/mergeAll.js.map | 1 - .../esm/internal/operators/mergeInternals.js | 58 - .../internal/operators/mergeInternals.js.map | 1 - .../dist/esm/internal/operators/mergeMap.js | 15 - .../esm/internal/operators/mergeMap.js.map | 1 - .../dist/esm/internal/operators/mergeMapTo.js | 12 - .../esm/internal/operators/mergeMapTo.js.map | 1 - .../dist/esm/internal/operators/mergeScan.js | 11 - .../esm/internal/operators/mergeScan.js.map | 1 - .../dist/esm/internal/operators/mergeWith.js | 5 - .../esm/internal/operators/mergeWith.js.map | 1 - .../rxjs/dist/esm/internal/operators/min.js | 6 - .../dist/esm/internal/operators/min.js.map | 1 - .../dist/esm/internal/operators/multicast.js | 13 - .../esm/internal/operators/multicast.js.map | 1 - .../dist/esm/internal/operators/observeOn.js | 9 - .../esm/internal/operators/observeOn.js.map | 1 - .../operators/onErrorResumeNextWith.js | 8 - .../operators/onErrorResumeNextWith.js.map | 1 - .../dist/esm/internal/operators/pairwise.js | 15 - .../esm/internal/operators/pairwise.js.map | 1 - .../dist/esm/internal/operators/partition.js | 6 - .../esm/internal/operators/partition.js.map | 1 - .../rxjs/dist/esm/internal/operators/pluck.js | 21 - .../dist/esm/internal/operators/pluck.js.map | 1 - .../dist/esm/internal/operators/publish.js | 7 - .../esm/internal/operators/publish.js.map | 1 - .../esm/internal/operators/publishBehavior.js | 9 - .../internal/operators/publishBehavior.js.map | 1 - .../esm/internal/operators/publishLast.js | 9 - .../esm/internal/operators/publishLast.js.map | 1 - .../esm/internal/operators/publishReplay.js | 11 - .../internal/operators/publishReplay.js.map | 1 - .../rxjs/dist/esm/internal/operators/race.js | 6 - .../dist/esm/internal/operators/race.js.map | 1 - .../dist/esm/internal/operators/raceWith.js | 11 - .../esm/internal/operators/raceWith.js.map | 1 - .../dist/esm/internal/operators/reduce.js | 6 - .../dist/esm/internal/operators/reduce.js.map | 1 - .../dist/esm/internal/operators/refCount.js | 26 - .../esm/internal/operators/refCount.js.map | 1 - .../dist/esm/internal/operators/repeat.js | 59 - .../dist/esm/internal/operators/repeat.js.map | 1 - .../dist/esm/internal/operators/repeatWhen.js | 46 - .../esm/internal/operators/repeatWhen.js.map | 1 - .../rxjs/dist/esm/internal/operators/retry.js | 68 - .../dist/esm/internal/operators/retry.js.map | 1 - .../dist/esm/internal/operators/retryWhen.js | 30 - .../esm/internal/operators/retryWhen.js.map | 1 - .../dist/esm/internal/operators/sample.js | 23 - .../dist/esm/internal/operators/sample.js.map | 1 - .../dist/esm/internal/operators/sampleTime.js | 7 - .../esm/internal/operators/sampleTime.js.map | 1 - .../rxjs/dist/esm/internal/operators/scan.js | 6 - .../dist/esm/internal/operators/scan.js.map | 1 - .../esm/internal/operators/scanInternals.js | 22 - .../internal/operators/scanInternals.js.map | 1 - .../esm/internal/operators/sequenceEqual.js | 39 - .../internal/operators/sequenceEqual.js.map | 1 - .../rxjs/dist/esm/internal/operators/share.js | 79 - .../dist/esm/internal/operators/share.js.map | 1 - .../esm/internal/operators/shareReplay.js | 19 - .../esm/internal/operators/shareReplay.js.map | 1 - .../dist/esm/internal/operators/single.js | 30 - .../dist/esm/internal/operators/single.js.map | 1 - .../rxjs/dist/esm/internal/operators/skip.js | 5 - .../dist/esm/internal/operators/skip.js.map | 1 - .../dist/esm/internal/operators/skipLast.js | 28 - .../esm/internal/operators/skipLast.js.map | 1 - .../dist/esm/internal/operators/skipUntil.js | 16 - .../esm/internal/operators/skipUntil.js.map | 1 - .../dist/esm/internal/operators/skipWhile.js | 10 - .../esm/internal/operators/skipWhile.js.map | 1 - .../dist/esm/internal/operators/startWith.js | 10 - .../esm/internal/operators/startWith.js.map | 1 - .../esm/internal/operators/subscribeOn.js | 7 - .../esm/internal/operators/subscribeOn.js.map | 1 - .../dist/esm/internal/operators/switchAll.js | 6 - .../esm/internal/operators/switchAll.js.map | 1 - .../dist/esm/internal/operators/switchMap.js | 24 - .../esm/internal/operators/switchMap.js.map | 1 - .../esm/internal/operators/switchMapTo.js | 6 - .../esm/internal/operators/switchMapTo.js.map | 1 - .../dist/esm/internal/operators/switchScan.js | 12 - .../esm/internal/operators/switchScan.js.map | 1 - .../rxjs/dist/esm/internal/operators/take.js | 20 - .../dist/esm/internal/operators/take.js.map | 1 - .../dist/esm/internal/operators/takeLast.js | 22 - .../esm/internal/operators/takeLast.js.map | 1 - .../dist/esm/internal/operators/takeUntil.js | 11 - .../esm/internal/operators/takeUntil.js.map | 1 - .../dist/esm/internal/operators/takeWhile.js | 13 - .../esm/internal/operators/takeWhile.js.map | 1 - .../rxjs/dist/esm/internal/operators/tap.js | 40 - .../dist/esm/internal/operators/tap.js.map | 1 - .../dist/esm/internal/operators/throttle.js | 43 - .../esm/internal/operators/throttle.js.map | 1 - .../esm/internal/operators/throttleTime.js | 8 - .../internal/operators/throttleTime.js.map | 1 - .../esm/internal/operators/throwIfEmpty.js | 16 - .../internal/operators/throwIfEmpty.js.map | 1 - .../esm/internal/operators/timeInterval.js | 21 - .../internal/operators/timeInterval.js.map | 1 - .../dist/esm/internal/operators/timeout.js | 56 - .../esm/internal/operators/timeout.js.map | 1 - .../esm/internal/operators/timeoutWith.js | 31 - .../esm/internal/operators/timeoutWith.js.map | 1 - .../dist/esm/internal/operators/timestamp.js | 6 - .../esm/internal/operators/timestamp.js.map | 1 - .../dist/esm/internal/operators/toArray.js | 9 - .../esm/internal/operators/toArray.js.map | 1 - .../dist/esm/internal/operators/window.js | 28 - .../dist/esm/internal/operators/window.js.map | 1 - .../esm/internal/operators/windowCount.js | 40 - .../esm/internal/operators/windowCount.js.map | 1 - .../dist/esm/internal/operators/windowTime.js | 63 - .../esm/internal/operators/windowTime.js.map | 1 - .../esm/internal/operators/windowToggle.js | 54 - .../internal/operators/windowToggle.js.map | 1 - .../dist/esm/internal/operators/windowWhen.js | 38 - .../esm/internal/operators/windowWhen.js.map | 1 - .../esm/internal/operators/withLatestFrom.js | 31 - .../internal/operators/withLatestFrom.js.map | 1 - .../rxjs/dist/esm/internal/operators/zip.js | 8 - .../dist/esm/internal/operators/zip.js.map | 1 - .../dist/esm/internal/operators/zipAll.js | 6 - .../dist/esm/internal/operators/zipAll.js.map | 1 - .../dist/esm/internal/operators/zipWith.js | 5 - .../esm/internal/operators/zipWith.js.map | 1 - .../esm/internal/scheduled/scheduleArray.js | 18 - .../internal/scheduled/scheduleArray.js.map | 1 - .../scheduled/scheduleAsyncIterable.js | 23 - .../scheduled/scheduleAsyncIterable.js.map | 1 - .../internal/scheduled/scheduleIterable.js | 31 - .../scheduled/scheduleIterable.js.map | 1 - .../internal/scheduled/scheduleObservable.js | 7 - .../scheduled/scheduleObservable.js.map | 1 - .../esm/internal/scheduled/schedulePromise.js | 7 - .../internal/scheduled/schedulePromise.js.map | 1 - .../scheduled/scheduleReadableStreamLike.js | 6 - .../scheduleReadableStreamLike.js.map | 1 - .../dist/esm/internal/scheduled/scheduled.js | 37 - .../esm/internal/scheduled/scheduled.js.map | 1 - .../dist/esm/internal/scheduler/Action.js | 10 - .../dist/esm/internal/scheduler/Action.js.map | 1 - .../scheduler/AnimationFrameAction.js | 29 - .../scheduler/AnimationFrameAction.js.map | 1 - .../scheduler/AnimationFrameScheduler.js | 24 - .../scheduler/AnimationFrameScheduler.js.map | 1 - .../dist/esm/internal/scheduler/AsapAction.js | 31 - .../esm/internal/scheduler/AsapAction.js.map | 1 - .../esm/internal/scheduler/AsapScheduler.js | 24 - .../internal/scheduler/AsapScheduler.js.map | 1 - .../esm/internal/scheduler/AsyncAction.js | 82 - .../esm/internal/scheduler/AsyncAction.js.map | 1 - .../esm/internal/scheduler/AsyncScheduler.js | 30 - .../internal/scheduler/AsyncScheduler.js.map | 1 - .../esm/internal/scheduler/QueueAction.js | 28 - .../esm/internal/scheduler/QueueAction.js.map | 1 - .../esm/internal/scheduler/QueueScheduler.js | 4 - .../internal/scheduler/QueueScheduler.js.map | 1 - .../scheduler/VirtualTimeScheduler.js | 89 - .../scheduler/VirtualTimeScheduler.js.map | 1 - .../esm/internal/scheduler/animationFrame.js | 5 - .../internal/scheduler/animationFrame.js.map | 1 - .../scheduler/animationFrameProvider.js | 27 - .../scheduler/animationFrameProvider.js.map | 1 - .../rxjs/dist/esm/internal/scheduler/asap.js | 5 - .../dist/esm/internal/scheduler/asap.js.map | 1 - .../rxjs/dist/esm/internal/scheduler/async.js | 5 - .../dist/esm/internal/scheduler/async.js.map | 1 - .../scheduler/dateTimestampProvider.js | 7 - .../scheduler/dateTimestampProvider.js.map | 1 - .../internal/scheduler/immediateProvider.js | 14 - .../scheduler/immediateProvider.js.map | 1 - .../internal/scheduler/intervalProvider.js | 15 - .../scheduler/intervalProvider.js.map | 1 - .../scheduler/performanceTimestampProvider.js | 7 - .../performanceTimestampProvider.js.map | 1 - .../rxjs/dist/esm/internal/scheduler/queue.js | 5 - .../dist/esm/internal/scheduler/queue.js.map | 1 - .../esm/internal/scheduler/timeoutProvider.js | 15 - .../internal/scheduler/timeoutProvider.js.map | 1 - .../esm/internal/scheduler/timerHandle.js | 2 - .../esm/internal/scheduler/timerHandle.js.map | 1 - .../rxjs/dist/esm/internal/symbol/iterator.js | 8 - .../dist/esm/internal/symbol/iterator.js.map | 1 - .../dist/esm/internal/symbol/observable.js | 2 - .../esm/internal/symbol/observable.js.map | 1 - .../esm/internal/testing/ColdObservable.js | 34 - .../internal/testing/ColdObservable.js.map | 1 - .../esm/internal/testing/HotObservable.js | 37 - .../esm/internal/testing/HotObservable.js.map | 1 - .../esm/internal/testing/SubscriptionLog.js | 7 - .../internal/testing/SubscriptionLog.js.map | 1 - .../internal/testing/SubscriptionLoggable.js | 16 - .../testing/SubscriptionLoggable.js.map | 1 - .../dist/esm/internal/testing/TestMessage.js | 2 - .../esm/internal/testing/TestMessage.js.map | 1 - .../esm/internal/testing/TestScheduler.js | 505 -- .../esm/internal/testing/TestScheduler.js.map | 1 - .../rxjs/dist/esm/internal/types.js | 2 - .../rxjs/dist/esm/internal/types.js.map | 1 - .../rxjs/dist/esm/internal/umd.js | 12 - .../rxjs/dist/esm/internal/umd.js.map | 1 - .../internal/util/ArgumentOutOfRangeError.js | 7 - .../util/ArgumentOutOfRangeError.js.map | 1 - .../rxjs/dist/esm/internal/util/EmptyError.js | 7 - .../dist/esm/internal/util/EmptyError.js.map | 1 - .../rxjs/dist/esm/internal/util/Immediate.js | 30 - .../dist/esm/internal/util/Immediate.js.map | 1 - .../dist/esm/internal/util/NotFoundError.js | 7 - .../esm/internal/util/NotFoundError.js.map | 1 - .../internal/util/ObjectUnsubscribedError.js | 7 - .../util/ObjectUnsubscribedError.js.map | 1 - .../dist/esm/internal/util/SequenceError.js | 7 - .../esm/internal/util/SequenceError.js.map | 1 - .../esm/internal/util/UnsubscriptionError.js | 11 - .../internal/util/UnsubscriptionError.js.map | 1 - .../dist/esm/internal/util/applyMixins.js | 11 - .../dist/esm/internal/util/applyMixins.js.map | 1 - .../rxjs/dist/esm/internal/util/args.js | 15 - .../rxjs/dist/esm/internal/util/args.js.map | 1 - .../esm/internal/util/argsArgArrayOrObject.js | 22 - .../internal/util/argsArgArrayOrObject.js.map | 1 - .../dist/esm/internal/util/argsOrArgArray.js | 5 - .../esm/internal/util/argsOrArgArray.js.map | 1 - .../rxjs/dist/esm/internal/util/arrRemove.js | 7 - .../dist/esm/internal/util/arrRemove.js.map | 1 - .../esm/internal/util/createErrorClass.js | 11 - .../esm/internal/util/createErrorClass.js.map | 1 - .../dist/esm/internal/util/createObject.js | 4 - .../esm/internal/util/createObject.js.map | 1 - .../dist/esm/internal/util/errorContext.js | 28 - .../esm/internal/util/errorContext.js.map | 1 - .../dist/esm/internal/util/executeSchedule.js | 16 - .../esm/internal/util/executeSchedule.js.map | 1 - .../rxjs/dist/esm/internal/util/identity.js | 4 - .../dist/esm/internal/util/identity.js.map | 1 - .../dist/esm/internal/util/isArrayLike.js | 2 - .../dist/esm/internal/util/isArrayLike.js.map | 1 - .../dist/esm/internal/util/isAsyncIterable.js | 5 - .../esm/internal/util/isAsyncIterable.js.map | 1 - .../rxjs/dist/esm/internal/util/isDate.js | 4 - .../rxjs/dist/esm/internal/util/isDate.js.map | 1 - .../rxjs/dist/esm/internal/util/isFunction.js | 4 - .../dist/esm/internal/util/isFunction.js.map | 1 - .../esm/internal/util/isInteropObservable.js | 6 - .../internal/util/isInteropObservable.js.map | 1 - .../rxjs/dist/esm/internal/util/isIterable.js | 6 - .../dist/esm/internal/util/isIterable.js.map | 1 - .../dist/esm/internal/util/isObservable.js | 6 - .../esm/internal/util/isObservable.js.map | 1 - .../rxjs/dist/esm/internal/util/isPromise.js | 5 - .../dist/esm/internal/util/isPromise.js.map | 1 - .../esm/internal/util/isReadableStreamLike.js | 23 - .../internal/util/isReadableStreamLike.js.map | 1 - .../dist/esm/internal/util/isScheduler.js | 5 - .../dist/esm/internal/util/isScheduler.js.map | 1 - .../rxjs/dist/esm/internal/util/lift.js | 20 - .../rxjs/dist/esm/internal/util/lift.js.map | 1 - .../esm/internal/util/mapOneOrManyArgs.js | 9 - .../esm/internal/util/mapOneOrManyArgs.js.map | 1 - .../rxjs/dist/esm/internal/util/noop.js | 2 - .../rxjs/dist/esm/internal/util/noop.js.map | 1 - .../rxjs/dist/esm/internal/util/not.js | 4 - .../rxjs/dist/esm/internal/util/not.js.map | 1 - .../rxjs/dist/esm/internal/util/pipe.js | 16 - .../rxjs/dist/esm/internal/util/pipe.js.map | 1 - .../esm/internal/util/reportUnhandledError.js | 14 - .../internal/util/reportUnhandledError.js.map | 1 - .../esm/internal/util/subscribeToArray.js | 7 - .../esm/internal/util/subscribeToArray.js.map | 1 - .../internal/util/throwUnobservableError.js | 4 - .../util/throwUnobservableError.js.map | 1 - .../dist/esm/internal/util/workarounds.js | 2 - .../dist/esm/internal/util/workarounds.js.map | 1 - .../rxjs/dist/esm/operators/index.js | 114 - .../rxjs/dist/esm/operators/index.js.map | 1 - .../rxjs/dist/esm/testing/index.js | 2 - .../rxjs/dist/esm/testing/index.js.map | 1 - .../rxjs/dist/esm/webSocket/index.js | 3 - .../rxjs/dist/esm/webSocket/index.js.map | 1 - .../node_modules/rxjs/dist/esm5/ajax/index.js | 4 - .../rxjs/dist/esm5/ajax/index.js.map | 1 - .../rxjs/dist/esm5/fetch/index.js | 2 - .../rxjs/dist/esm5/fetch/index.js.map | 1 - dist/node_modules/rxjs/dist/esm5/index.js | 169 - dist/node_modules/rxjs/dist/esm5/index.js.map | 1 - .../rxjs/dist/esm5/internal/AnyCatcher.js | 2 - .../rxjs/dist/esm5/internal/AnyCatcher.js.map | 1 - .../rxjs/dist/esm5/internal/AsyncSubject.js | 39 - .../dist/esm5/internal/AsyncSubject.js.map | 1 - .../dist/esm5/internal/BehaviorSubject.js | 36 - .../dist/esm5/internal/BehaviorSubject.js.map | 1 - .../rxjs/dist/esm5/internal/Notification.js | 72 - .../dist/esm5/internal/Notification.js.map | 1 - .../esm5/internal/NotificationFactories.js | 15 - .../internal/NotificationFactories.js.map | 1 - .../rxjs/dist/esm5/internal/Observable.js | 102 - .../rxjs/dist/esm5/internal/Observable.js.map | 1 - .../rxjs/dist/esm5/internal/Operator.js | 2 - .../rxjs/dist/esm5/internal/Operator.js.map | 1 - .../rxjs/dist/esm5/internal/ReplaySubject.js | 58 - .../dist/esm5/internal/ReplaySubject.js.map | 1 - .../rxjs/dist/esm5/internal/Scheduler.js | 16 - .../rxjs/dist/esm5/internal/Scheduler.js.map | 1 - .../rxjs/dist/esm5/internal/Subject.js | 162 - .../rxjs/dist/esm5/internal/Subject.js.map | 1 - .../rxjs/dist/esm5/internal/Subscriber.js | 184 - .../rxjs/dist/esm5/internal/Subscriber.js.map | 1 - .../rxjs/dist/esm5/internal/Subscription.js | 143 - .../dist/esm5/internal/Subscription.js.map | 1 - .../dist/esm5/internal/ajax/AjaxResponse.js | 29 - .../esm5/internal/ajax/AjaxResponse.js.map | 1 - .../rxjs/dist/esm5/internal/ajax/ajax.js | 239 - .../rxjs/dist/esm5/internal/ajax/ajax.js.map | 1 - .../rxjs/dist/esm5/internal/ajax/errors.js | 30 - .../dist/esm5/internal/ajax/errors.js.map | 1 - .../dist/esm5/internal/ajax/getXHRResponse.js | 26 - .../esm5/internal/ajax/getXHRResponse.js.map | 1 - .../rxjs/dist/esm5/internal/ajax/types.js | 2 - .../rxjs/dist/esm5/internal/ajax/types.js.map | 1 - .../rxjs/dist/esm5/internal/config.js | 8 - .../rxjs/dist/esm5/internal/config.js.map | 1 - .../rxjs/dist/esm5/internal/firstValueFrom.js | 24 - .../dist/esm5/internal/firstValueFrom.js.map | 1 - .../rxjs/dist/esm5/internal/lastValueFrom.js | 27 - .../dist/esm5/internal/lastValueFrom.js.map | 1 - .../observable/ConnectableObservable.js | 63 - .../observable/ConnectableObservable.js.map | 1 - .../esm5/internal/observable/bindCallback.js | 5 - .../internal/observable/bindCallback.js.map | 1 - .../observable/bindCallbackInternals.js | 79 - .../observable/bindCallbackInternals.js.map | 1 - .../internal/observable/bindNodeCallback.js | 5 - .../observable/bindNodeCallback.js.map | 1 - .../esm5/internal/observable/combineLatest.js | 70 - .../internal/observable/combineLatest.js.map | 1 - .../dist/esm5/internal/observable/concat.js | 11 - .../esm5/internal/observable/concat.js.map | 1 - .../esm5/internal/observable/connectable.js | 27 - .../internal/observable/connectable.js.map | 1 - .../dist/esm5/internal/observable/defer.js | 8 - .../esm5/internal/observable/defer.js.map | 1 - .../observable/dom/WebSocketSubject.js | 221 - .../observable/dom/WebSocketSubject.js.map | 1 - .../observable/dom/animationFrames.js | 34 - .../observable/dom/animationFrames.js.map | 1 - .../esm5/internal/observable/dom/fetch.js | 54 - .../esm5/internal/observable/dom/fetch.js.map | 1 - .../esm5/internal/observable/dom/webSocket.js | 5 - .../internal/observable/dom/webSocket.js.map | 1 - .../dist/esm5/internal/observable/empty.js | 9 - .../esm5/internal/observable/empty.js.map | 1 - .../dist/esm5/internal/observable/forkJoin.js | 47 - .../esm5/internal/observable/forkJoin.js.map | 1 - .../dist/esm5/internal/observable/from.js | 6 - .../dist/esm5/internal/observable/from.js.map | 1 - .../esm5/internal/observable/fromEvent.js | 59 - .../esm5/internal/observable/fromEvent.js.map | 1 - .../internal/observable/fromEventPattern.js | 20 - .../observable/fromEventPattern.js.map | 1 - .../internal/observable/fromSubscribable.js | 5 - .../observable/fromSubscribable.js.map | 1 - .../dist/esm5/internal/observable/generate.js | 49 - .../esm5/internal/observable/generate.js.map | 1 - .../rxjs/dist/esm5/internal/observable/iif.js | 5 - .../dist/esm5/internal/observable/iif.js.map | 1 - .../esm5/internal/observable/innerFrom.js | 143 - .../esm5/internal/observable/innerFrom.js.map | 1 - .../dist/esm5/internal/observable/interval.js | 11 - .../esm5/internal/observable/interval.js.map | 1 - .../dist/esm5/internal/observable/merge.js | 23 - .../esm5/internal/observable/merge.js.map | 1 - .../dist/esm5/internal/observable/never.js | 7 - .../esm5/internal/observable/never.js.map | 1 - .../rxjs/dist/esm5/internal/observable/of.js | 11 - .../dist/esm5/internal/observable/of.js.map | 1 - .../internal/observable/onErrorResumeNext.js | 35 - .../observable/onErrorResumeNext.js.map | 1 - .../dist/esm5/internal/observable/pairs.js | 5 - .../esm5/internal/observable/pairs.js.map | 1 - .../esm5/internal/observable/partition.js | 7 - .../esm5/internal/observable/partition.js.map | 1 - .../dist/esm5/internal/observable/race.js | 32 - .../dist/esm5/internal/observable/race.js.map | 1 - .../dist/esm5/internal/observable/range.js | 35 - .../esm5/internal/observable/range.js.map | 1 - .../esm5/internal/observable/throwError.js | 8 - .../internal/observable/throwError.js.map | 1 - .../dist/esm5/internal/observable/timer.js | 36 - .../esm5/internal/observable/timer.js.map | 1 - .../dist/esm5/internal/observable/using.js | 17 - .../esm5/internal/observable/using.js.map | 1 - .../rxjs/dist/esm5/internal/observable/zip.js | 46 - .../dist/esm5/internal/observable/zip.js.map | 1 - .../internal/operators/OperatorSubscriber.js | 61 - .../operators/OperatorSubscriber.js.map | 1 - .../dist/esm5/internal/operators/audit.js | 37 - .../dist/esm5/internal/operators/audit.js.map | 1 - .../dist/esm5/internal/operators/auditTime.js | 8 - .../esm5/internal/operators/auditTime.js.map | 1 - .../dist/esm5/internal/operators/buffer.js | 22 - .../esm5/internal/operators/buffer.js.map | 1 - .../esm5/internal/operators/bufferCount.js | 71 - .../internal/operators/bufferCount.js.map | 1 - .../esm5/internal/operators/bufferTime.js | 77 - .../esm5/internal/operators/bufferTime.js.map | 1 - .../esm5/internal/operators/bufferToggle.js | 45 - .../internal/operators/bufferToggle.js.map | 1 - .../esm5/internal/operators/bufferWhen.js | 23 - .../esm5/internal/operators/bufferWhen.js.map | 1 - .../esm5/internal/operators/catchError.js | 27 - .../esm5/internal/operators/catchError.js.map | 1 - .../esm5/internal/operators/combineAll.js | 3 - .../esm5/internal/operators/combineAll.js.map | 1 - .../esm5/internal/operators/combineLatest.js | 20 - .../internal/operators/combineLatest.js.map | 1 - .../internal/operators/combineLatestAll.js | 6 - .../operators/combineLatestAll.js.map | 1 - .../internal/operators/combineLatestWith.js | 10 - .../operators/combineLatestWith.js.map | 1 - .../dist/esm5/internal/operators/concat.js | 16 - .../esm5/internal/operators/concat.js.map | 1 - .../dist/esm5/internal/operators/concatAll.js | 5 - .../esm5/internal/operators/concatAll.js.map | 1 - .../dist/esm5/internal/operators/concatMap.js | 6 - .../esm5/internal/operators/concatMap.js.map | 1 - .../esm5/internal/operators/concatMapTo.js | 6 - .../internal/operators/concatMapTo.js.map | 1 - .../esm5/internal/operators/concatWith.js | 10 - .../esm5/internal/operators/concatWith.js.map | 1 - .../dist/esm5/internal/operators/connect.js | 17 - .../esm5/internal/operators/connect.js.map | 1 - .../dist/esm5/internal/operators/count.js | 5 - .../dist/esm5/internal/operators/count.js.map | 1 - .../dist/esm5/internal/operators/debounce.js | 34 - .../esm5/internal/operators/debounce.js.map | 1 - .../esm5/internal/operators/debounceTime.js | 44 - .../internal/operators/debounceTime.js.map | 1 - .../esm5/internal/operators/defaultIfEmpty.js | 17 - .../internal/operators/defaultIfEmpty.js.map | 1 - .../dist/esm5/internal/operators/delay.js | 9 - .../dist/esm5/internal/operators/delay.js.map | 1 - .../dist/esm5/internal/operators/delayWhen.js | 15 - .../esm5/internal/operators/delayWhen.js.map | 1 - .../esm5/internal/operators/dematerialize.js | 9 - .../internal/operators/dematerialize.js.map | 1 - .../dist/esm5/internal/operators/distinct.js | 18 - .../esm5/internal/operators/distinct.js.map | 1 - .../operators/distinctUntilChanged.js | 23 - .../operators/distinctUntilChanged.js.map | 1 - .../operators/distinctUntilKeyChanged.js | 5 - .../operators/distinctUntilKeyChanged.js.map | 1 - .../dist/esm5/internal/operators/elementAt.js | 15 - .../esm5/internal/operators/elementAt.js.map | 1 - .../dist/esm5/internal/operators/endWith.js | 11 - .../esm5/internal/operators/endWith.js.map | 1 - .../dist/esm5/internal/operators/every.js | 17 - .../dist/esm5/internal/operators/every.js.map | 1 - .../dist/esm5/internal/operators/exhaust.js | 3 - .../esm5/internal/operators/exhaust.js.map | 1 - .../esm5/internal/operators/exhaustAll.js | 6 - .../esm5/internal/operators/exhaustAll.js.map | 1 - .../esm5/internal/operators/exhaustMap.js | 29 - .../esm5/internal/operators/exhaustMap.js.map | 1 - .../dist/esm5/internal/operators/expand.js | 10 - .../esm5/internal/operators/expand.js.map | 1 - .../dist/esm5/internal/operators/filter.js | 9 - .../esm5/internal/operators/filter.js.map | 1 - .../dist/esm5/internal/operators/finalize.js | 12 - .../esm5/internal/operators/finalize.js.map | 1 - .../rxjs/dist/esm5/internal/operators/find.js | 22 - .../dist/esm5/internal/operators/find.js.map | 1 - .../dist/esm5/internal/operators/findIndex.js | 6 - .../esm5/internal/operators/findIndex.js.map | 1 - .../dist/esm5/internal/operators/first.js | 13 - .../dist/esm5/internal/operators/first.js.map | 1 - .../dist/esm5/internal/operators/flatMap.js | 3 - .../esm5/internal/operators/flatMap.js.map | 1 - .../dist/esm5/internal/operators/groupBy.js | 63 - .../esm5/internal/operators/groupBy.js.map | 1 - .../esm5/internal/operators/ignoreElements.js | 9 - .../internal/operators/ignoreElements.js.map | 1 - .../dist/esm5/internal/operators/isEmpty.js | 14 - .../esm5/internal/operators/isEmpty.js.map | 1 - .../internal/operators/joinAllInternals.js | 9 - .../operators/joinAllInternals.js.map | 1 - .../rxjs/dist/esm5/internal/operators/last.js | 13 - .../dist/esm5/internal/operators/last.js.map | 1 - .../rxjs/dist/esm5/internal/operators/map.js | 11 - .../dist/esm5/internal/operators/map.js.map | 1 - .../dist/esm5/internal/operators/mapTo.js | 5 - .../dist/esm5/internal/operators/mapTo.js.map | 1 - .../esm5/internal/operators/materialize.js | 17 - .../internal/operators/materialize.js.map | 1 - .../rxjs/dist/esm5/internal/operators/max.js | 6 - .../dist/esm5/internal/operators/max.js.map | 1 - .../dist/esm5/internal/operators/merge.js | 19 - .../dist/esm5/internal/operators/merge.js.map | 1 - .../dist/esm5/internal/operators/mergeAll.js | 7 - .../esm5/internal/operators/mergeAll.js.map | 1 - .../esm5/internal/operators/mergeInternals.js | 61 - .../internal/operators/mergeInternals.js.map | 1 - .../dist/esm5/internal/operators/mergeMap.js | 16 - .../esm5/internal/operators/mergeMap.js.map | 1 - .../esm5/internal/operators/mergeMapTo.js | 13 - .../esm5/internal/operators/mergeMapTo.js.map | 1 - .../dist/esm5/internal/operators/mergeScan.js | 12 - .../esm5/internal/operators/mergeScan.js.map | 1 - .../dist/esm5/internal/operators/mergeWith.js | 10 - .../esm5/internal/operators/mergeWith.js.map | 1 - .../rxjs/dist/esm5/internal/operators/min.js | 6 - .../dist/esm5/internal/operators/min.js.map | 1 - .../dist/esm5/internal/operators/multicast.js | 13 - .../esm5/internal/operators/multicast.js.map | 1 - .../dist/esm5/internal/operators/observeOn.js | 10 - .../esm5/internal/operators/observeOn.js.map | 1 - .../operators/onErrorResumeNextWith.js | 13 - .../operators/onErrorResumeNextWith.js.map | 1 - .../dist/esm5/internal/operators/pairwise.js | 15 - .../esm5/internal/operators/pairwise.js.map | 1 - .../dist/esm5/internal/operators/partition.js | 8 - .../esm5/internal/operators/partition.js.map | 1 - .../dist/esm5/internal/operators/pluck.js | 25 - .../dist/esm5/internal/operators/pluck.js.map | 1 - .../dist/esm5/internal/operators/publish.js | 7 - .../esm5/internal/operators/publish.js.map | 1 - .../internal/operators/publishBehavior.js | 9 - .../internal/operators/publishBehavior.js.map | 1 - .../esm5/internal/operators/publishLast.js | 9 - .../internal/operators/publishLast.js.map | 1 - .../esm5/internal/operators/publishReplay.js | 11 - .../internal/operators/publishReplay.js.map | 1 - .../rxjs/dist/esm5/internal/operators/race.js | 11 - .../dist/esm5/internal/operators/race.js.map | 1 - .../dist/esm5/internal/operators/raceWith.js | 16 - .../esm5/internal/operators/raceWith.js.map | 1 - .../dist/esm5/internal/operators/reduce.js | 6 - .../esm5/internal/operators/reduce.js.map | 1 - .../dist/esm5/internal/operators/refCount.js | 26 - .../esm5/internal/operators/refCount.js.map | 1 - .../dist/esm5/internal/operators/repeat.js | 60 - .../esm5/internal/operators/repeat.js.map | 1 - .../esm5/internal/operators/repeatWhen.js | 46 - .../esm5/internal/operators/repeatWhen.js.map | 1 - .../dist/esm5/internal/operators/retry.js | 69 - .../dist/esm5/internal/operators/retry.js.map | 1 - .../dist/esm5/internal/operators/retryWhen.js | 32 - .../esm5/internal/operators/retryWhen.js.map | 1 - .../dist/esm5/internal/operators/sample.js | 23 - .../esm5/internal/operators/sample.js.map | 1 - .../esm5/internal/operators/sampleTime.js | 8 - .../esm5/internal/operators/sampleTime.js.map | 1 - .../rxjs/dist/esm5/internal/operators/scan.js | 6 - .../dist/esm5/internal/operators/scan.js.map | 1 - .../esm5/internal/operators/scanInternals.js | 22 - .../internal/operators/scanInternals.js.map | 1 - .../esm5/internal/operators/sequenceEqual.js | 40 - .../internal/operators/sequenceEqual.js.map | 1 - .../dist/esm5/internal/operators/share.js | 85 - .../dist/esm5/internal/operators/share.js.map | 1 - .../esm5/internal/operators/shareReplay.js | 20 - .../internal/operators/shareReplay.js.map | 1 - .../dist/esm5/internal/operators/single.js | 30 - .../esm5/internal/operators/single.js.map | 1 - .../rxjs/dist/esm5/internal/operators/skip.js | 5 - .../dist/esm5/internal/operators/skip.js.map | 1 - .../dist/esm5/internal/operators/skipLast.js | 28 - .../esm5/internal/operators/skipLast.js.map | 1 - .../dist/esm5/internal/operators/skipUntil.js | 16 - .../esm5/internal/operators/skipUntil.js.map | 1 - .../dist/esm5/internal/operators/skipWhile.js | 10 - .../esm5/internal/operators/skipWhile.js.map | 1 - .../dist/esm5/internal/operators/startWith.js | 14 - .../esm5/internal/operators/startWith.js.map | 1 - .../esm5/internal/operators/subscribeOn.js | 8 - .../internal/operators/subscribeOn.js.map | 1 - .../dist/esm5/internal/operators/switchAll.js | 6 - .../esm5/internal/operators/switchAll.js.map | 1 - .../dist/esm5/internal/operators/switchMap.js | 24 - .../esm5/internal/operators/switchMap.js.map | 1 - .../esm5/internal/operators/switchMapTo.js | 6 - .../internal/operators/switchMapTo.js.map | 1 - .../esm5/internal/operators/switchScan.js | 12 - .../esm5/internal/operators/switchScan.js.map | 1 - .../rxjs/dist/esm5/internal/operators/take.js | 20 - .../dist/esm5/internal/operators/take.js.map | 1 - .../dist/esm5/internal/operators/takeLast.js | 34 - .../esm5/internal/operators/takeLast.js.map | 1 - .../dist/esm5/internal/operators/takeUntil.js | 11 - .../esm5/internal/operators/takeUntil.js.map | 1 - .../dist/esm5/internal/operators/takeWhile.js | 14 - .../esm5/internal/operators/takeWhile.js.map | 1 - .../rxjs/dist/esm5/internal/operators/tap.js | 40 - .../dist/esm5/internal/operators/tap.js.map | 1 - .../dist/esm5/internal/operators/throttle.js | 45 - .../esm5/internal/operators/throttle.js.map | 1 - .../esm5/internal/operators/throttleTime.js | 9 - .../internal/operators/throttleTime.js.map | 1 - .../esm5/internal/operators/throwIfEmpty.js | 17 - .../internal/operators/throwIfEmpty.js.map | 1 - .../esm5/internal/operators/timeInterval.js | 24 - .../internal/operators/timeInterval.js.map | 1 - .../dist/esm5/internal/operators/timeout.js | 59 - .../esm5/internal/operators/timeout.js.map | 1 - .../esm5/internal/operators/timeoutWith.js | 31 - .../internal/operators/timeoutWith.js.map | 1 - .../dist/esm5/internal/operators/timestamp.js | 7 - .../esm5/internal/operators/timestamp.js.map | 1 - .../dist/esm5/internal/operators/toArray.js | 9 - .../esm5/internal/operators/toArray.js.map | 1 - .../dist/esm5/internal/operators/window.js | 28 - .../esm5/internal/operators/window.js.map | 1 - .../esm5/internal/operators/windowCount.js | 53 - .../internal/operators/windowCount.js.map | 1 - .../esm5/internal/operators/windowTime.js | 70 - .../esm5/internal/operators/windowTime.js.map | 1 - .../esm5/internal/operators/windowToggle.js | 66 - .../internal/operators/windowToggle.js.map | 1 - .../esm5/internal/operators/windowWhen.js | 38 - .../esm5/internal/operators/windowWhen.js.map | 1 - .../esm5/internal/operators/withLatestFrom.js | 39 - .../internal/operators/withLatestFrom.js.map | 1 - .../rxjs/dist/esm5/internal/operators/zip.js | 13 - .../dist/esm5/internal/operators/zip.js.map | 1 - .../dist/esm5/internal/operators/zipAll.js | 6 - .../esm5/internal/operators/zipAll.js.map | 1 - .../dist/esm5/internal/operators/zipWith.js | 10 - .../esm5/internal/operators/zipWith.js.map | 1 - .../esm5/internal/scheduled/scheduleArray.js | 18 - .../internal/scheduled/scheduleArray.js.map | 1 - .../scheduled/scheduleAsyncIterable.js | 23 - .../scheduled/scheduleAsyncIterable.js.map | 1 - .../internal/scheduled/scheduleIterable.js | 32 - .../scheduled/scheduleIterable.js.map | 1 - .../internal/scheduled/scheduleObservable.js | 7 - .../scheduled/scheduleObservable.js.map | 1 - .../internal/scheduled/schedulePromise.js | 7 - .../internal/scheduled/schedulePromise.js.map | 1 - .../scheduled/scheduleReadableStreamLike.js | 6 - .../scheduleReadableStreamLike.js.map | 1 - .../dist/esm5/internal/scheduled/scheduled.js | 37 - .../esm5/internal/scheduled/scheduled.js.map | 1 - .../dist/esm5/internal/scheduler/Action.js | 15 - .../esm5/internal/scheduler/Action.js.map | 1 - .../scheduler/AnimationFrameAction.js | 36 - .../scheduler/AnimationFrameAction.js.map | 1 - .../scheduler/AnimationFrameScheduler.js | 31 - .../scheduler/AnimationFrameScheduler.js.map | 1 - .../esm5/internal/scheduler/AsapAction.js | 38 - .../esm5/internal/scheduler/AsapAction.js.map | 1 - .../esm5/internal/scheduler/AsapScheduler.js | 31 - .../internal/scheduler/AsapScheduler.js.map | 1 - .../esm5/internal/scheduler/AsyncAction.js | 90 - .../internal/scheduler/AsyncAction.js.map | 1 - .../esm5/internal/scheduler/AsyncScheduler.js | 36 - .../internal/scheduler/AsyncScheduler.js.map | 1 - .../esm5/internal/scheduler/QueueAction.js | 35 - .../internal/scheduler/QueueAction.js.map | 1 - .../esm5/internal/scheduler/QueueScheduler.js | 11 - .../internal/scheduler/QueueScheduler.js.map | 1 - .../scheduler/VirtualTimeScheduler.js | 104 - .../scheduler/VirtualTimeScheduler.js.map | 1 - .../esm5/internal/scheduler/animationFrame.js | 5 - .../internal/scheduler/animationFrame.js.map | 1 - .../scheduler/animationFrameProvider.js | 36 - .../scheduler/animationFrameProvider.js.map | 1 - .../rxjs/dist/esm5/internal/scheduler/asap.js | 5 - .../dist/esm5/internal/scheduler/asap.js.map | 1 - .../dist/esm5/internal/scheduler/async.js | 5 - .../dist/esm5/internal/scheduler/async.js.map | 1 - .../scheduler/dateTimestampProvider.js | 7 - .../scheduler/dateTimestampProvider.js.map | 1 - .../internal/scheduler/immediateProvider.js | 19 - .../scheduler/immediateProvider.js.map | 1 - .../internal/scheduler/intervalProvider.js | 20 - .../scheduler/intervalProvider.js.map | 1 - .../scheduler/performanceTimestampProvider.js | 7 - .../performanceTimestampProvider.js.map | 1 - .../dist/esm5/internal/scheduler/queue.js | 5 - .../dist/esm5/internal/scheduler/queue.js.map | 1 - .../internal/scheduler/timeoutProvider.js | 20 - .../internal/scheduler/timeoutProvider.js.map | 1 - .../esm5/internal/scheduler/timerHandle.js | 2 - .../internal/scheduler/timerHandle.js.map | 1 - .../dist/esm5/internal/symbol/iterator.js | 8 - .../dist/esm5/internal/symbol/iterator.js.map | 1 - .../dist/esm5/internal/symbol/observable.js | 2 - .../esm5/internal/symbol/observable.js.map | 1 - .../esm5/internal/testing/ColdObservable.js | 39 - .../internal/testing/ColdObservable.js.map | 1 - .../esm5/internal/testing/HotObservable.js | 45 - .../internal/testing/HotObservable.js.map | 1 - .../esm5/internal/testing/SubscriptionLog.js | 10 - .../internal/testing/SubscriptionLog.js.map | 1 - .../internal/testing/SubscriptionLoggable.js | 18 - .../testing/SubscriptionLoggable.js.map | 1 - .../dist/esm5/internal/testing/TestMessage.js | 2 - .../esm5/internal/testing/TestMessage.js.map | 1 - .../esm5/internal/testing/TestScheduler.js | 569 -- .../internal/testing/TestScheduler.js.map | 1 - .../rxjs/dist/esm5/internal/types.js | 2 - .../rxjs/dist/esm5/internal/types.js.map | 1 - .../internal/util/ArgumentOutOfRangeError.js | 9 - .../util/ArgumentOutOfRangeError.js.map | 1 - .../dist/esm5/internal/util/EmptyError.js | 7 - .../dist/esm5/internal/util/EmptyError.js.map | 1 - .../rxjs/dist/esm5/internal/util/Immediate.js | 30 - .../dist/esm5/internal/util/Immediate.js.map | 1 - .../dist/esm5/internal/util/NotFoundError.js | 9 - .../esm5/internal/util/NotFoundError.js.map | 1 - .../internal/util/ObjectUnsubscribedError.js | 9 - .../util/ObjectUnsubscribedError.js.map | 1 - .../dist/esm5/internal/util/SequenceError.js | 9 - .../esm5/internal/util/SequenceError.js.map | 1 - .../esm5/internal/util/UnsubscriptionError.js | 12 - .../internal/util/UnsubscriptionError.js.map | 1 - .../dist/esm5/internal/util/applyMixins.js | 11 - .../esm5/internal/util/applyMixins.js.map | 1 - .../rxjs/dist/esm5/internal/util/args.js | 15 - .../rxjs/dist/esm5/internal/util/args.js.map | 1 - .../internal/util/argsArgArrayOrObject.js | 22 - .../internal/util/argsArgArrayOrObject.js.map | 1 - .../dist/esm5/internal/util/argsOrArgArray.js | 5 - .../esm5/internal/util/argsOrArgArray.js.map | 1 - .../rxjs/dist/esm5/internal/util/arrRemove.js | 7 - .../dist/esm5/internal/util/arrRemove.js.map | 1 - .../esm5/internal/util/createErrorClass.js | 11 - .../internal/util/createErrorClass.js.map | 1 - .../dist/esm5/internal/util/createObject.js | 4 - .../esm5/internal/util/createObject.js.map | 1 - .../dist/esm5/internal/util/errorContext.js | 28 - .../esm5/internal/util/errorContext.js.map | 1 - .../esm5/internal/util/executeSchedule.js | 18 - .../esm5/internal/util/executeSchedule.js.map | 1 - .../rxjs/dist/esm5/internal/util/identity.js | 4 - .../dist/esm5/internal/util/identity.js.map | 1 - .../dist/esm5/internal/util/isArrayLike.js | 2 - .../esm5/internal/util/isArrayLike.js.map | 1 - .../esm5/internal/util/isAsyncIterable.js | 5 - .../esm5/internal/util/isAsyncIterable.js.map | 1 - .../rxjs/dist/esm5/internal/util/isDate.js | 4 - .../dist/esm5/internal/util/isDate.js.map | 1 - .../dist/esm5/internal/util/isFunction.js | 4 - .../dist/esm5/internal/util/isFunction.js.map | 1 - .../esm5/internal/util/isInteropObservable.js | 6 - .../internal/util/isInteropObservable.js.map | 1 - .../dist/esm5/internal/util/isIterable.js | 6 - .../dist/esm5/internal/util/isIterable.js.map | 1 - .../dist/esm5/internal/util/isObservable.js | 6 - .../esm5/internal/util/isObservable.js.map | 1 - .../rxjs/dist/esm5/internal/util/isPromise.js | 5 - .../dist/esm5/internal/util/isPromise.js.map | 1 - .../internal/util/isReadableStreamLike.js | 39 - .../internal/util/isReadableStreamLike.js.map | 1 - .../dist/esm5/internal/util/isScheduler.js | 5 - .../esm5/internal/util/isScheduler.js.map | 1 - .../rxjs/dist/esm5/internal/util/lift.js | 20 - .../rxjs/dist/esm5/internal/util/lift.js.map | 1 - .../esm5/internal/util/mapOneOrManyArgs.js | 10 - .../internal/util/mapOneOrManyArgs.js.map | 1 - .../rxjs/dist/esm5/internal/util/noop.js | 2 - .../rxjs/dist/esm5/internal/util/noop.js.map | 1 - .../rxjs/dist/esm5/internal/util/not.js | 4 - .../rxjs/dist/esm5/internal/util/not.js.map | 1 - .../rxjs/dist/esm5/internal/util/pipe.js | 20 - .../rxjs/dist/esm5/internal/util/pipe.js.map | 1 - .../internal/util/reportUnhandledError.js | 14 - .../internal/util/reportUnhandledError.js.map | 1 - .../esm5/internal/util/subscribeToArray.js | 7 - .../internal/util/subscribeToArray.js.map | 1 - .../internal/util/throwUnobservableError.js | 4 - .../util/throwUnobservableError.js.map | 1 - .../dist/esm5/internal/util/workarounds.js | 2 - .../esm5/internal/util/workarounds.js.map | 1 - .../rxjs/dist/esm5/operators/index.js | 114 - .../rxjs/dist/esm5/operators/index.js.map | 1 - .../rxjs/dist/esm5/testing/index.js | 2 - .../rxjs/dist/esm5/testing/index.js.map | 1 - .../rxjs/dist/esm5/webSocket/index.js | 3 - .../rxjs/dist/esm5/webSocket/index.js.map | 1 - .../rxjs/dist/types/ajax/index.d.ts | 5 - .../rxjs/dist/types/ajax/index.d.ts.map | 1 - .../rxjs/dist/types/fetch/index.d.ts | 2 - .../rxjs/dist/types/fetch/index.d.ts.map | 1 - dist/node_modules/rxjs/dist/types/index.d.ts | 173 - .../rxjs/dist/types/index.d.ts.map | 1 - .../rxjs/dist/types/internal/AnyCatcher.d.ts | 10 - .../dist/types/internal/AnyCatcher.d.ts.map | 1 - .../dist/types/internal/AsyncSubject.d.ts | 15 - .../dist/types/internal/AsyncSubject.d.ts.map | 1 - .../dist/types/internal/BehaviorSubject.d.ts | 15 - .../types/internal/BehaviorSubject.d.ts.map | 1 - .../dist/types/internal/Notification.d.ts | 180 - .../dist/types/internal/Notification.d.ts.map | 1 - .../types/internal/NotificationFactories.d.ts | 2 - .../internal/NotificationFactories.d.ts.map | 1 - .../rxjs/dist/types/internal/Observable.d.ts | 128 - .../dist/types/internal/Observable.d.ts.map | 1 - .../rxjs/dist/types/internal/Operator.d.ts | 9 - .../dist/types/internal/Operator.d.ts.map | 1 - .../dist/types/internal/ReplaySubject.d.ts | 49 - .../types/internal/ReplaySubject.d.ts.map | 1 - .../rxjs/dist/types/internal/Scheduler.d.ts | 55 - .../dist/types/internal/Scheduler.d.ts.map | 1 - .../rxjs/dist/types/internal/Subject.d.ts | 58 - .../rxjs/dist/types/internal/Subject.d.ts.map | 1 - .../rxjs/dist/types/internal/Subscriber.d.ts | 78 - .../dist/types/internal/Subscriber.d.ts.map | 1 - .../dist/types/internal/Subscription.d.ts | 96 - .../dist/types/internal/Subscription.d.ts.map | 1 - .../types/internal/ajax/AjaxResponse.d.ts | 115 - .../types/internal/ajax/AjaxResponse.d.ts.map | 1 - .../rxjs/dist/types/internal/ajax/ajax.d.ts | 227 - .../dist/types/internal/ajax/ajax.d.ts.map | 1 - .../rxjs/dist/types/internal/ajax/errors.d.ts | 69 - .../dist/types/internal/ajax/errors.d.ts.map | 1 - .../types/internal/ajax/getXHRResponse.d.ts | 14 - .../internal/ajax/getXHRResponse.d.ts.map | 1 - .../rxjs/dist/types/internal/ajax/types.d.ts | 200 - .../dist/types/internal/ajax/types.d.ts.map | 1 - .../rxjs/dist/types/internal/config.d.ts | 73 - .../rxjs/dist/types/internal/config.d.ts.map | 1 - .../dist/types/internal/firstValueFrom.d.ts | 7 - .../types/internal/firstValueFrom.d.ts.map | 1 - .../dist/types/internal/lastValueFrom.d.ts | 7 - .../types/internal/lastValueFrom.d.ts.map | 1 - .../observable/ConnectableObservable.d.ts | 42 - .../observable/ConnectableObservable.d.ts.map | 1 - .../internal/observable/bindCallback.d.ts | 5 - .../internal/observable/bindCallback.d.ts.map | 1 - .../observable/bindCallbackInternals.d.ts | 4 - .../observable/bindCallbackInternals.d.ts.map | 1 - .../internal/observable/bindNodeCallback.d.ts | 5 - .../observable/bindNodeCallback.d.ts.map | 1 - .../internal/observable/combineLatest.d.ts | 33 - .../observable/combineLatest.d.ts.map | 1 - .../types/internal/observable/concat.d.ts | 5 - .../types/internal/observable/concat.d.ts.map | 1 - .../internal/observable/connectable.d.ts | 27 - .../internal/observable/connectable.d.ts.map | 1 - .../dist/types/internal/observable/defer.d.ts | 52 - .../types/internal/observable/defer.d.ts.map | 1 - .../observable/dom/WebSocketSubject.d.ts | 173 - .../observable/dom/WebSocketSubject.d.ts.map | 1 - .../observable/dom/animationFrames.d.ts | 76 - .../observable/dom/animationFrames.d.ts.map | 1 - .../types/internal/observable/dom/fetch.d.ts | 7 - .../internal/observable/dom/fetch.d.ts.map | 1 - .../internal/observable/dom/webSocket.d.ts | 160 - .../observable/dom/webSocket.d.ts.map | 1 - .../dist/types/internal/observable/empty.d.ts | 72 - .../types/internal/observable/empty.d.ts.map | 1 - .../types/internal/observable/forkJoin.d.ts | 24 - .../internal/observable/forkJoin.d.ts.map | 1 - .../dist/types/internal/observable/from.d.ts | 6 - .../types/internal/observable/from.d.ts.map | 1 - .../types/internal/observable/fromEvent.d.ts | 45 - .../internal/observable/fromEvent.d.ts.map | 1 - .../internal/observable/fromEventPattern.d.ts | 5 - .../observable/fromEventPattern.d.ts.map | 1 - .../internal/observable/fromSubscribable.d.ts | 14 - .../observable/fromSubscribable.d.ts.map | 1 - .../types/internal/observable/generate.d.ts | 311 - .../internal/observable/generate.d.ts.map | 1 - .../dist/types/internal/observable/iif.d.ts | 82 - .../types/internal/observable/iif.d.ts.map | 1 - .../types/internal/observable/innerFrom.d.ts | 21 - .../internal/observable/innerFrom.d.ts.map | 1 - .../types/internal/observable/interval.d.ts | 49 - .../internal/observable/interval.d.ts.map | 1 - .../dist/types/internal/observable/merge.d.ts | 9 - .../types/internal/observable/merge.d.ts.map | 1 - .../dist/types/internal/observable/never.d.ts | 40 - .../types/internal/observable/never.d.ts.map | 1 - .../dist/types/internal/observable/of.d.ts | 14 - .../types/internal/observable/of.d.ts.map | 1 - .../observable/onErrorResumeNext.d.ts | 5 - .../observable/onErrorResumeNext.d.ts.map | 1 - .../dist/types/internal/observable/pairs.d.ts | 19 - .../types/internal/observable/pairs.d.ts.map | 1 - .../types/internal/observable/partition.d.ts | 9 - .../internal/observable/partition.d.ts.map | 1 - .../dist/types/internal/observable/race.d.ts | 12 - .../types/internal/observable/race.d.ts.map | 1 - .../dist/types/internal/observable/range.d.ts | 8 - .../types/internal/observable/range.d.ts.map | 1 - .../types/internal/observable/throwError.d.ts | 115 - .../internal/observable/throwError.d.ts.map | 1 - .../dist/types/internal/observable/timer.d.ts | 126 - .../types/internal/observable/timer.d.ts.map | 1 - .../dist/types/internal/observable/using.d.ts | 32 - .../types/internal/observable/using.d.ts.map | 1 - .../dist/types/internal/observable/zip.d.ts | 7 - .../types/internal/observable/zip.d.ts.map | 1 - .../operators/OperatorSubscriber.d.ts | 41 - .../operators/OperatorSubscriber.d.ts.map | 1 - .../dist/types/internal/operators/audit.d.ts | 48 - .../types/internal/operators/audit.d.ts.map | 1 - .../types/internal/operators/auditTime.d.ts | 50 - .../internal/operators/auditTime.d.ts.map | 1 - .../dist/types/internal/operators/buffer.d.ts | 41 - .../types/internal/operators/buffer.d.ts.map | 1 - .../types/internal/operators/bufferCount.d.ts | 54 - .../internal/operators/bufferCount.d.ts.map | 1 - .../types/internal/operators/bufferTime.d.ts | 5 - .../internal/operators/bufferTime.d.ts.map | 1 - .../internal/operators/bufferToggle.d.ts | 46 - .../internal/operators/bufferToggle.d.ts.map | 1 - .../types/internal/operators/bufferWhen.d.ts | 41 - .../internal/operators/bufferWhen.d.ts.map | 1 - .../types/internal/operators/catchError.d.ts | 4 - .../internal/operators/catchError.d.ts.map | 1 - .../types/internal/operators/combineAll.d.ts | 6 - .../internal/operators/combineAll.d.ts.map | 1 - .../internal/operators/combineLatest.d.ts | 10 - .../internal/operators/combineLatest.d.ts.map | 1 - .../internal/operators/combineLatestAll.d.ts | 6 - .../operators/combineLatestAll.d.ts.map | 1 - .../internal/operators/combineLatestWith.d.ts | 43 - .../operators/combineLatestWith.d.ts.map | 1 - .../dist/types/internal/operators/concat.d.ts | 6 - .../types/internal/operators/concat.d.ts.map | 1 - .../types/internal/operators/concatAll.d.ts | 59 - .../internal/operators/concatAll.d.ts.map | 1 - .../types/internal/operators/concatMap.d.ts | 7 - .../internal/operators/concatMap.d.ts.map | 1 - .../types/internal/operators/concatMapTo.d.ts | 8 - .../internal/operators/concatMapTo.d.ts.map | 1 - .../types/internal/operators/concatWith.d.ts | 43 - .../internal/operators/concatWith.d.ts.map | 1 - .../types/internal/operators/connect.d.ts | 87 - .../types/internal/operators/connect.d.ts.map | 1 - .../dist/types/internal/operators/count.d.ts | 58 - .../types/internal/operators/count.d.ts.map | 1 - .../types/internal/operators/debounce.d.ts | 61 - .../internal/operators/debounce.d.ts.map | 1 - .../internal/operators/debounceTime.d.ts | 60 - .../internal/operators/debounceTime.d.ts.map | 1 - .../internal/operators/defaultIfEmpty.d.ts | 38 - .../operators/defaultIfEmpty.d.ts.map | 1 - .../dist/types/internal/operators/delay.d.ts | 59 - .../types/internal/operators/delay.d.ts.map | 1 - .../types/internal/operators/delayWhen.d.ts | 6 - .../internal/operators/delayWhen.d.ts.map | 1 - .../internal/operators/dematerialize.d.ts | 51 - .../internal/operators/dematerialize.d.ts.map | 1 - .../types/internal/operators/distinct.d.ts | 60 - .../internal/operators/distinct.d.ts.map | 1 - .../operators/distinctUntilChanged.d.ts | 4 - .../operators/distinctUntilChanged.d.ts.map | 1 - .../operators/distinctUntilKeyChanged.d.ts | 4 - .../distinctUntilKeyChanged.d.ts.map | 1 - .../types/internal/operators/elementAt.d.ts | 51 - .../internal/operators/elementAt.d.ts.map | 1 - .../types/internal/operators/endWith.d.ts | 7 - .../types/internal/operators/endWith.d.ts.map | 1 - .../dist/types/internal/operators/every.d.ts | 9 - .../types/internal/operators/every.d.ts.map | 1 - .../types/internal/operators/exhaust.d.ts | 6 - .../types/internal/operators/exhaust.d.ts.map | 1 - .../types/internal/operators/exhaustAll.d.ts | 47 - .../internal/operators/exhaustAll.d.ts.map | 1 - .../types/internal/operators/exhaustMap.d.ts | 7 - .../internal/operators/exhaustMap.d.ts.map | 1 - .../dist/types/internal/operators/expand.d.ts | 9 - .../types/internal/operators/expand.d.ts.map | 1 - .../dist/types/internal/operators/filter.d.ts | 9 - .../types/internal/operators/filter.d.ts.map | 1 - .../types/internal/operators/finalize.d.ts | 64 - .../internal/operators/finalize.d.ts.map | 1 - .../dist/types/internal/operators/find.d.ts | 12 - .../types/internal/operators/find.d.ts.map | 1 - .../types/internal/operators/findIndex.d.ts | 9 - .../internal/operators/findIndex.d.ts.map | 1 - .../dist/types/internal/operators/first.d.ts | 9 - .../types/internal/operators/first.d.ts.map | 1 - .../types/internal/operators/flatMap.d.ts | 6 - .../types/internal/operators/flatMap.d.ts.map | 1 - .../types/internal/operators/groupBy.d.ts | 119 - .../types/internal/operators/groupBy.d.ts.map | 1 - .../internal/operators/ignoreElements.d.ts | 38 - .../operators/ignoreElements.d.ts.map | 1 - .../types/internal/operators/isEmpty.d.ts | 64 - .../types/internal/operators/isEmpty.d.ts.map | 1 - .../internal/operators/joinAllInternals.d.ts | 14 - .../operators/joinAllInternals.d.ts.map | 1 - .../dist/types/internal/operators/last.d.ts | 8 - .../types/internal/operators/last.d.ts.map | 1 - .../dist/types/internal/operators/map.d.ts | 5 - .../types/internal/operators/map.d.ts.map | 1 - .../dist/types/internal/operators/mapTo.d.ts | 10 - .../types/internal/operators/mapTo.d.ts.map | 1 - .../types/internal/operators/materialize.d.ts | 52 - .../internal/operators/materialize.d.ts.map | 1 - .../dist/types/internal/operators/max.d.ts | 49 - .../types/internal/operators/max.d.ts.map | 1 - .../dist/types/internal/operators/merge.d.ts | 10 - .../types/internal/operators/merge.d.ts.map | 1 - .../types/internal/operators/mergeAll.d.ts | 62 - .../internal/operators/mergeAll.d.ts.map | 1 - .../internal/operators/mergeInternals.d.ts | 18 - .../operators/mergeInternals.d.ts.map | 1 - .../types/internal/operators/mergeMap.d.ts | 7 - .../internal/operators/mergeMap.d.ts.map | 1 - .../types/internal/operators/mergeMapTo.d.ts | 9 - .../internal/operators/mergeMapTo.d.ts.map | 1 - .../types/internal/operators/mergeScan.d.ts | 69 - .../internal/operators/mergeScan.d.ts.map | 1 - .../types/internal/operators/mergeWith.d.ts | 44 - .../internal/operators/mergeWith.d.ts.map | 1 - .../dist/types/internal/operators/min.d.ts | 49 - .../types/internal/operators/min.d.ts.map | 1 - .../types/internal/operators/multicast.d.ts | 63 - .../internal/operators/multicast.d.ts.map | 1 - .../types/internal/operators/observeOn.d.ts | 56 - .../internal/operators/observeOn.d.ts.map | 1 - .../operators/onErrorResumeNextWith.d.ts | 8 - .../operators/onErrorResumeNextWith.d.ts.map | 1 - .../types/internal/operators/pairwise.d.ts | 46 - .../internal/operators/pairwise.d.ts.map | 1 - .../types/internal/operators/partition.d.ts | 55 - .../internal/operators/partition.d.ts.map | 1 - .../dist/types/internal/operators/pluck.d.ts | 18 - .../types/internal/operators/pluck.d.ts.map | 1 - .../types/internal/operators/publish.d.ts | 30 - .../types/internal/operators/publish.d.ts.map | 1 - .../internal/operators/publishBehavior.d.ts | 19 - .../operators/publishBehavior.d.ts.map | 1 - .../types/internal/operators/publishLast.d.ts | 69 - .../internal/operators/publishLast.d.ts.map | 1 - .../internal/operators/publishReplay.d.ts | 56 - .../internal/operators/publishReplay.d.ts.map | 1 - .../dist/types/internal/operators/race.d.ts | 6 - .../types/internal/operators/race.d.ts.map | 1 - .../types/internal/operators/raceWith.d.ts | 29 - .../internal/operators/raceWith.d.ts.map | 1 - .../dist/types/internal/operators/reduce.d.ts | 5 - .../types/internal/operators/reduce.d.ts.map | 1 - .../types/internal/operators/refCount.d.ts | 61 - .../internal/operators/refCount.d.ts.map | 1 - .../dist/types/internal/operators/repeat.d.ts | 108 - .../types/internal/operators/repeat.d.ts.map | 1 - .../types/internal/operators/repeatWhen.d.ts | 38 - .../internal/operators/repeatWhen.d.ts.map | 1 - .../dist/types/internal/operators/retry.d.ts | 28 - .../types/internal/operators/retry.d.ts.map | 1 - .../types/internal/operators/retryWhen.d.ts | 61 - .../internal/operators/retryWhen.d.ts.map | 1 - .../dist/types/internal/operators/sample.d.ts | 43 - .../types/internal/operators/sample.d.ts.map | 1 - .../types/internal/operators/sampleTime.d.ts | 46 - .../internal/operators/sampleTime.d.ts.map | 1 - .../dist/types/internal/operators/scan.d.ts | 5 - .../types/internal/operators/scan.d.ts.map | 1 - .../internal/operators/scanInternals.d.ts | 12 - .../internal/operators/scanInternals.d.ts.map | 1 - .../internal/operators/sequenceEqual.d.ts | 60 - .../internal/operators/sequenceEqual.d.ts.map | 1 - .../dist/types/internal/operators/share.d.ts | 43 - .../types/internal/operators/share.d.ts.map | 1 - .../types/internal/operators/shareReplay.d.ts | 10 - .../internal/operators/shareReplay.d.ts.map | 1 - .../dist/types/internal/operators/single.d.ts | 5 - .../types/internal/operators/single.d.ts.map | 1 - .../dist/types/internal/operators/skip.d.ts | 36 - .../types/internal/operators/skip.d.ts.map | 1 - .../types/internal/operators/skipLast.d.ts | 45 - .../internal/operators/skipLast.d.ts.map | 1 - .../types/internal/operators/skipUntil.d.ts | 48 - .../internal/operators/skipUntil.d.ts.map | 1 - .../types/internal/operators/skipWhile.d.ts | 5 - .../internal/operators/skipWhile.d.ts.map | 1 - .../types/internal/operators/startWith.d.ts | 7 - .../internal/operators/startWith.d.ts.map | 1 - .../types/internal/operators/subscribeOn.d.ts | 62 - .../internal/operators/subscribeOn.d.ts.map | 1 - .../types/internal/operators/switchAll.d.ts | 61 - .../internal/operators/switchAll.d.ts.map | 1 - .../types/internal/operators/switchMap.d.ts | 7 - .../internal/operators/switchMap.d.ts.map | 1 - .../types/internal/operators/switchMapTo.d.ts | 8 - .../internal/operators/switchMapTo.d.ts.map | 1 - .../types/internal/operators/switchScan.d.ts | 20 - .../internal/operators/switchScan.d.ts.map | 1 - .../dist/types/internal/operators/take.d.ts | 45 - .../types/internal/operators/take.d.ts.map | 1 - .../types/internal/operators/takeLast.d.ts | 42 - .../internal/operators/takeLast.d.ts.map | 1 - .../types/internal/operators/takeUntil.d.ts | 42 - .../internal/operators/takeUntil.d.ts.map | 1 - .../types/internal/operators/takeWhile.d.ts | 8 - .../internal/operators/takeWhile.d.ts.map | 1 - .../dist/types/internal/operators/tap.d.ts | 72 - .../types/internal/operators/tap.d.ts.map | 1 - .../types/internal/operators/throttle.d.ts | 78 - .../internal/operators/throttle.d.ts.map | 1 - .../internal/operators/throttleTime.d.ts | 53 - .../internal/operators/throttleTime.d.ts.map | 1 - .../internal/operators/throwIfEmpty.d.ts | 39 - .../internal/operators/throwIfEmpty.d.ts.map | 1 - .../internal/operators/timeInterval.d.ts | 50 - .../internal/operators/timeInterval.d.ts.map | 1 - .../types/internal/operators/timeout.d.ts | 257 - .../types/internal/operators/timeout.d.ts.map | 1 - .../types/internal/operators/timeoutWith.d.ts | 8 - .../internal/operators/timeoutWith.d.ts.map | 1 - .../types/internal/operators/timestamp.d.ts | 35 - .../internal/operators/timestamp.d.ts.map | 1 - .../types/internal/operators/toArray.d.ts | 33 - .../types/internal/operators/toArray.d.ts.map | 1 - .../dist/types/internal/operators/window.d.ts | 48 - .../types/internal/operators/window.d.ts.map | 1 - .../types/internal/operators/windowCount.d.ts | 66 - .../internal/operators/windowCount.d.ts.map | 1 - .../types/internal/operators/windowTime.d.ts | 6 - .../internal/operators/windowTime.d.ts.map | 1 - .../internal/operators/windowToggle.d.ts | 51 - .../internal/operators/windowToggle.d.ts.map | 1 - .../types/internal/operators/windowWhen.d.ts | 48 - .../internal/operators/windowWhen.d.ts.map | 1 - .../internal/operators/withLatestFrom.d.ts | 4 - .../operators/withLatestFrom.d.ts.map | 1 - .../dist/types/internal/operators/zip.d.ts | 10 - .../types/internal/operators/zip.d.ts.map | 1 - .../dist/types/internal/operators/zipAll.d.ts | 14 - .../types/internal/operators/zipAll.d.ts.map | 1 - .../types/internal/operators/zipWith.d.ts | 26 - .../types/internal/operators/zipWith.d.ts.map | 1 - .../internal/scheduled/scheduleArray.d.ts | 4 - .../internal/scheduled/scheduleArray.d.ts.map | 1 - .../scheduled/scheduleAsyncIterable.d.ts | 4 - .../scheduled/scheduleAsyncIterable.d.ts.map | 1 - .../internal/scheduled/scheduleIterable.d.ts | 9 - .../scheduled/scheduleIterable.d.ts.map | 1 - .../scheduled/scheduleObservable.d.ts | 3 - .../scheduled/scheduleObservable.d.ts.map | 1 - .../internal/scheduled/schedulePromise.d.ts | 3 - .../scheduled/schedulePromise.d.ts.map | 1 - .../scheduled/scheduleReadableStreamLike.d.ts | 4 - .../scheduleReadableStreamLike.d.ts.map | 1 - .../types/internal/scheduled/scheduled.d.ts | 15 - .../internal/scheduled/scheduled.d.ts.map | 1 - .../dist/types/internal/scheduler/Action.d.ts | 32 - .../types/internal/scheduler/Action.d.ts.map | 1 - .../scheduler/AnimationFrameAction.d.ts | 12 - .../scheduler/AnimationFrameAction.d.ts.map | 1 - .../scheduler/AnimationFrameScheduler.d.ts | 6 - .../AnimationFrameScheduler.d.ts.map | 1 - .../types/internal/scheduler/AsapAction.d.ts | 12 - .../internal/scheduler/AsapAction.d.ts.map | 1 - .../internal/scheduler/AsapScheduler.d.ts | 6 - .../internal/scheduler/AsapScheduler.d.ts.map | 1 - .../types/internal/scheduler/AsyncAction.d.ts | 25 - .../internal/scheduler/AsyncAction.d.ts.map | 1 - .../internal/scheduler/AsyncScheduler.d.ts | 9 - .../scheduler/AsyncScheduler.d.ts.map | 1 - .../types/internal/scheduler/QueueAction.d.ts | 14 - .../internal/scheduler/QueueAction.d.ts.map | 1 - .../internal/scheduler/QueueScheduler.d.ts | 4 - .../scheduler/QueueScheduler.d.ts.map | 1 - .../scheduler/VirtualTimeScheduler.d.ts | 49 - .../scheduler/VirtualTimeScheduler.d.ts.map | 1 - .../internal/scheduler/animationFrame.d.ts | 38 - .../scheduler/animationFrame.d.ts.map | 1 - .../scheduler/animationFrameProvider.d.ts | 13 - .../scheduler/animationFrameProvider.d.ts.map | 1 - .../dist/types/internal/scheduler/asap.d.ts | 41 - .../types/internal/scheduler/asap.d.ts.map | 1 - .../dist/types/internal/scheduler/async.d.ts | 53 - .../types/internal/scheduler/async.d.ts.map | 1 - .../scheduler/dateTimestampProvider.d.ts | 7 - .../scheduler/dateTimestampProvider.d.ts.map | 1 - .../internal/scheduler/immediateProvider.d.ts | 14 - .../scheduler/immediateProvider.d.ts.map | 1 - .../internal/scheduler/intervalProvider.d.ts | 14 - .../scheduler/intervalProvider.d.ts.map | 1 - .../performanceTimestampProvider.d.ts | 7 - .../performanceTimestampProvider.d.ts.map | 1 - .../dist/types/internal/scheduler/queue.d.ts | 69 - .../types/internal/scheduler/queue.d.ts.map | 1 - .../internal/scheduler/timeoutProvider.d.ts | 14 - .../scheduler/timeoutProvider.d.ts.map | 1 - .../types/internal/scheduler/timerHandle.d.ts | 2 - .../internal/scheduler/timerHandle.d.ts.map | 1 - .../dist/types/internal/symbol/iterator.d.ts | 3 - .../types/internal/symbol/iterator.d.ts.map | 1 - .../types/internal/symbol/observable.d.ts | 8 - .../types/internal/symbol/observable.d.ts.map | 1 - .../internal/testing/ColdObservable.d.ts | 16 - .../internal/testing/ColdObservable.d.ts.map | 1 - .../types/internal/testing/HotObservable.d.ts | 15 - .../internal/testing/HotObservable.d.ts.map | 1 - .../internal/testing/SubscriptionLog.d.ts | 6 - .../internal/testing/SubscriptionLog.d.ts.map | 1 - .../testing/SubscriptionLoggable.d.ts | 9 - .../testing/SubscriptionLoggable.d.ts.map | 1 - .../types/internal/testing/TestMessage.d.ts | 7 - .../internal/testing/TestMessage.d.ts.map | 1 - .../types/internal/testing/TestScheduler.d.ts | 91 - .../internal/testing/TestScheduler.d.ts.map | 1 - .../rxjs/dist/types/internal/types.d.ts | 301 - .../rxjs/dist/types/internal/types.d.ts.map | 1 - .../util/ArgumentOutOfRangeError.d.ts | 21 - .../util/ArgumentOutOfRangeError.d.ts.map | 1 - .../dist/types/internal/util/EmptyError.d.ts | 23 - .../types/internal/util/EmptyError.d.ts.map | 1 - .../dist/types/internal/util/Immediate.d.ts | 14 - .../types/internal/util/Immediate.d.ts.map | 1 - .../types/internal/util/NotFoundError.d.ts | 19 - .../internal/util/NotFoundError.d.ts.map | 1 - .../util/ObjectUnsubscribedError.d.ts | 20 - .../util/ObjectUnsubscribedError.d.ts.map | 1 - .../types/internal/util/SequenceError.d.ts | 19 - .../internal/util/SequenceError.d.ts.map | 1 - .../internal/util/UnsubscriptionError.d.ts | 16 - .../util/UnsubscriptionError.d.ts.map | 1 - .../dist/types/internal/util/applyMixins.d.ts | 2 - .../types/internal/util/applyMixins.d.ts.map | 1 - .../rxjs/dist/types/internal/util/args.d.ts | 5 - .../dist/types/internal/util/args.d.ts.map | 1 - .../internal/util/argsArgArrayOrObject.d.ts | 11 - .../util/argsArgArrayOrObject.d.ts.map | 1 - .../types/internal/util/argsOrArgArray.d.ts | 6 - .../internal/util/argsOrArgArray.d.ts.map | 1 - .../dist/types/internal/util/arrRemove.d.ts | 7 - .../types/internal/util/arrRemove.d.ts.map | 1 - .../types/internal/util/createErrorClass.d.ts | 11 - .../internal/util/createErrorClass.d.ts.map | 1 - .../types/internal/util/createObject.d.ts | 2 - .../types/internal/util/createObject.d.ts.map | 1 - .../types/internal/util/errorContext.d.ts | 14 - .../types/internal/util/errorContext.d.ts.map | 1 - .../types/internal/util/executeSchedule.d.ts | 5 - .../internal/util/executeSchedule.d.ts.map | 1 - .../dist/types/internal/util/identity.d.ts | 44 - .../types/internal/util/identity.d.ts.map | 1 - .../dist/types/internal/util/isArrayLike.d.ts | 2 - .../types/internal/util/isArrayLike.d.ts.map | 1 - .../types/internal/util/isAsyncIterable.d.ts | 2 - .../internal/util/isAsyncIterable.d.ts.map | 1 - .../rxjs/dist/types/internal/util/isDate.d.ts | 9 - .../dist/types/internal/util/isDate.d.ts.map | 1 - .../dist/types/internal/util/isFunction.d.ts | 6 - .../types/internal/util/isFunction.d.ts.map | 1 - .../internal/util/isInteropObservable.d.ts | 4 - .../util/isInteropObservable.d.ts.map | 1 - .../dist/types/internal/util/isIterable.d.ts | 3 - .../types/internal/util/isIterable.d.ts.map | 1 - .../types/internal/util/isObservable.d.ts | 8 - .../types/internal/util/isObservable.d.ts.map | 1 - .../dist/types/internal/util/isPromise.d.ts | 6 - .../types/internal/util/isPromise.d.ts.map | 1 - .../internal/util/isReadableStreamLike.d.ts | 4 - .../util/isReadableStreamLike.d.ts.map | 1 - .../dist/types/internal/util/isScheduler.d.ts | 3 - .../types/internal/util/isScheduler.d.ts.map | 1 - .../rxjs/dist/types/internal/util/lift.d.ts | 15 - .../dist/types/internal/util/lift.d.ts.map | 1 - .../types/internal/util/mapOneOrManyArgs.d.ts | 7 - .../internal/util/mapOneOrManyArgs.d.ts.map | 1 - .../rxjs/dist/types/internal/util/noop.d.ts | 2 - .../dist/types/internal/util/noop.d.ts.map | 1 - .../rxjs/dist/types/internal/util/not.d.ts | 2 - .../dist/types/internal/util/not.d.ts.map | 1 - .../rxjs/dist/types/internal/util/pipe.d.ts | 14 - .../dist/types/internal/util/pipe.d.ts.map | 1 - .../internal/util/reportUnhandledError.d.ts | 11 - .../util/reportUnhandledError.d.ts.map | 1 - .../types/internal/util/subscribeToArray.d.ts | 7 - .../internal/util/subscribeToArray.d.ts.map | 1 - .../internal/util/throwUnobservableError.d.ts | 6 - .../util/throwUnobservableError.d.ts.map | 1 - .../dist/types/internal/util/workarounds.d.ts | 2 - .../types/internal/util/workarounds.d.ts.map | 1 - .../rxjs/dist/types/operators/index.d.ts | 114 - .../rxjs/dist/types/operators/index.d.ts.map | 1 - .../rxjs/dist/types/testing/index.d.ts | 2 - .../rxjs/dist/types/testing/index.d.ts.map | 1 - .../rxjs/dist/types/webSocket/index.d.ts | 3 - .../rxjs/dist/types/webSocket/index.d.ts.map | 1 - dist/node_modules/rxjs/fetch/package.json | 8 - dist/node_modules/rxjs/operators/package.json | 8 - dist/node_modules/rxjs/package.json | 245 - dist/node_modules/rxjs/src/Rx.global.js | 5 - dist/node_modules/rxjs/src/ajax/index.ts | 4 - dist/node_modules/rxjs/src/fetch/index.ts | 1 - dist/node_modules/rxjs/src/index.ts | 209 - .../rxjs/src/internal/AnyCatcher.ts | 14 - .../rxjs/src/internal/AsyncSubject.ts | 41 - .../rxjs/src/internal/BehaviorSubject.ts | 39 - .../rxjs/src/internal/Notification.ts | 243 - .../src/internal/NotificationFactories.ts | 40 - .../rxjs/src/internal/Observable.ts | 498 -- .../rxjs/src/internal/Operator.ts | 9 - .../rxjs/src/internal/ReplaySubject.ts | 110 - .../rxjs/src/internal/Scheduler.ts | 62 - .../node_modules/rxjs/src/internal/Subject.ts | 189 - .../rxjs/src/internal/Subscriber.ts | 276 - .../rxjs/src/internal/Subscription.ts | 216 - .../rxjs/src/internal/ajax/AjaxResponse.ts | 124 - .../rxjs/src/internal/ajax/ajax.ts | 622 -- .../rxjs/src/internal/ajax/errors.ts | 106 - .../rxjs/src/internal/ajax/getXHRResponse.ts | 37 - .../rxjs/src/internal/ajax/types.ts | 235 - dist/node_modules/rxjs/src/internal/config.ts | 84 - .../rxjs/src/internal/firstValueFrom.ts | 75 - .../rxjs/src/internal/lastValueFrom.ts | 76 - .../observable/ConnectableObservable.ts | 104 - .../src/internal/observable/bindCallback.ts | 145 - .../observable/bindCallbackInternals.ts | 119 - .../internal/observable/bindNodeCallback.ts | 128 - .../src/internal/observable/combineLatest.ts | 304 - .../rxjs/src/internal/observable/concat.ts | 115 - .../src/internal/observable/connectable.ts | 64 - .../rxjs/src/internal/observable/defer.ts | 57 - .../observable/dom/WebSocketSubject.ts | 397 - .../observable/dom/animationFrames.ts | 132 - .../rxjs/src/internal/observable/dom/fetch.ts | 180 - .../src/internal/observable/dom/webSocket.ts | 162 - .../rxjs/src/internal/observable/empty.ts | 79 - .../rxjs/src/internal/observable/forkJoin.ts | 186 - .../rxjs/src/internal/observable/from.ts | 104 - .../rxjs/src/internal/observable/fromEvent.ts | 336 - .../internal/observable/fromEventPattern.ts | 155 - .../internal/observable/fromSubscribable.ts | 17 - .../rxjs/src/internal/observable/generate.ts | 384 - .../rxjs/src/internal/observable/iif.ts | 85 - .../rxjs/src/internal/observable/innerFrom.ts | 132 - .../rxjs/src/internal/observable/interval.ts | 58 - .../rxjs/src/internal/observable/merge.ts | 102 - .../rxjs/src/internal/observable/never.ts | 44 - .../rxjs/src/internal/observable/of.ts | 83 - .../internal/observable/onErrorResumeNext.ts | 101 - .../rxjs/src/internal/observable/pairs.ts | 82 - .../rxjs/src/internal/observable/partition.ts | 88 - .../rxjs/src/internal/observable/race.ts | 88 - .../rxjs/src/internal/observable/range.ts | 94 - .../src/internal/observable/throwError.ts | 125 - .../rxjs/src/internal/observable/timer.ts | 186 - .../rxjs/src/internal/observable/using.ts | 51 - .../rxjs/src/internal/observable/zip.ts | 115 - .../internal/operators/OperatorSubscriber.ts | 112 - .../rxjs/src/internal/operators/audit.ts | 96 - .../rxjs/src/internal/operators/auditTime.ts | 55 - .../rxjs/src/internal/operators/buffer.ts | 81 - .../src/internal/operators/bufferCount.ts | 120 - .../rxjs/src/internal/operators/bufferTime.ts | 168 - .../src/internal/operators/bufferToggle.ts | 102 - .../rxjs/src/internal/operators/bufferWhen.ts | 94 - .../rxjs/src/internal/operators/catchError.ts | 141 - .../rxjs/src/internal/operators/combineAll.ts | 6 - .../src/internal/operators/combineLatest.ts | 34 - .../internal/operators/combineLatestAll.ts | 50 - .../internal/operators/combineLatestWith.ts | 48 - .../rxjs/src/internal/operators/concat.ts | 22 - .../rxjs/src/internal/operators/concatAll.ts | 62 - .../rxjs/src/internal/operators/concatMap.ts | 84 - .../src/internal/operators/concatMapTo.ts | 79 - .../rxjs/src/internal/operators/concatWith.ts | 48 - .../rxjs/src/internal/operators/connect.ts | 109 - .../rxjs/src/internal/operators/count.ts | 61 - .../rxjs/src/internal/operators/debounce.ts | 119 - .../src/internal/operators/debounceTime.ts | 124 - .../src/internal/operators/defaultIfEmpty.ts | 59 - .../rxjs/src/internal/operators/delay.ts | 65 - .../rxjs/src/internal/operators/delayWhen.ts | 103 - .../src/internal/operators/dematerialize.ts | 58 - .../rxjs/src/internal/operators/distinct.ts | 79 - .../operators/distinctUntilChanged.ts | 182 - .../operators/distinctUntilKeyChanged.ts | 71 - .../rxjs/src/internal/operators/elementAt.ts | 68 - .../rxjs/src/internal/operators/endWith.ts | 68 - .../rxjs/src/internal/operators/every.ts | 66 - .../rxjs/src/internal/operators/exhaust.ts | 6 - .../rxjs/src/internal/operators/exhaustAll.ts | 51 - .../rxjs/src/internal/operators/exhaustMap.ts | 101 - .../rxjs/src/internal/operators/expand.ts | 96 - .../rxjs/src/internal/operators/filter.ts | 75 - .../rxjs/src/internal/operators/finalize.ts | 75 - .../rxjs/src/internal/operators/find.ts | 97 - .../rxjs/src/internal/operators/findIndex.ts | 64 - .../rxjs/src/internal/operators/first.ts | 92 - .../rxjs/src/internal/operators/flatMap.ts | 6 - .../rxjs/src/internal/operators/groupBy.ts | 288 - .../src/internal/operators/ignoreElements.ts | 45 - .../rxjs/src/internal/operators/isEmpty.ts | 82 - .../internal/operators/joinAllInternals.ts | 29 - .../rxjs/src/internal/operators/last.ts | 90 - .../rxjs/src/internal/operators/map.ts | 62 - .../rxjs/src/internal/operators/mapTo.ts | 48 - .../src/internal/operators/materialize.ts | 73 - .../rxjs/src/internal/operators/max.ts | 53 - .../rxjs/src/internal/operators/merge.ts | 31 - .../rxjs/src/internal/operators/mergeAll.ts | 66 - .../src/internal/operators/mergeInternals.ts | 149 - .../rxjs/src/internal/operators/mergeMap.ts | 96 - .../rxjs/src/internal/operators/mergeMapTo.ts | 74 - .../rxjs/src/internal/operators/mergeScan.ts | 93 - .../rxjs/src/internal/operators/mergeWith.ts | 49 - .../rxjs/src/internal/operators/min.ts | 53 - .../rxjs/src/internal/operators/multicast.ts | 98 - .../rxjs/src/internal/operators/observeOn.ts | 70 - .../operators/onErrorResumeNextWith.ts | 99 - .../rxjs/src/internal/operators/pairwise.ts | 61 - .../rxjs/src/internal/operators/partition.ts | 63 - .../rxjs/src/internal/operators/pluck.ts | 106 - .../rxjs/src/internal/operators/publish.ts | 93 - .../src/internal/operators/publishBehavior.ts | 26 - .../src/internal/operators/publishLast.ts | 76 - .../src/internal/operators/publishReplay.ts | 96 - .../rxjs/src/internal/operators/race.ts | 20 - .../rxjs/src/internal/operators/raceWith.ts | 40 - .../rxjs/src/internal/operators/reduce.ts | 62 - .../rxjs/src/internal/operators/refCount.ts | 119 - .../rxjs/src/internal/operators/repeat.ts | 172 - .../rxjs/src/internal/operators/repeatWhen.ts | 125 - .../rxjs/src/internal/operators/retry.ts | 167 - .../rxjs/src/internal/operators/retryWhen.ts | 113 - .../rxjs/src/internal/operators/sample.ts | 72 - .../rxjs/src/internal/operators/sampleTime.ts | 51 - .../rxjs/src/internal/operators/scan.ts | 95 - .../src/internal/operators/scanInternals.ts | 62 - .../src/internal/operators/sequenceEqual.ts | 146 - .../rxjs/src/internal/operators/share.ts | 267 - .../src/internal/operators/shareReplay.ts | 173 - .../rxjs/src/internal/operators/single.ts | 117 - .../rxjs/src/internal/operators/skip.ts | 39 - .../rxjs/src/internal/operators/skipLast.ts | 95 - .../rxjs/src/internal/operators/skipUntil.ts | 69 - .../rxjs/src/internal/operators/skipWhile.ts | 60 - .../rxjs/src/internal/operators/startWith.ts | 67 - .../src/internal/operators/subscribeOn.ts | 67 - .../rxjs/src/internal/operators/switchAll.ts | 65 - .../rxjs/src/internal/operators/switchMap.ts | 133 - .../src/internal/operators/switchMapTo.ts | 64 - .../rxjs/src/internal/operators/switchScan.ts | 50 - .../rxjs/src/internal/operators/take.ts | 71 - .../rxjs/src/internal/operators/takeLast.ts | 81 - .../rxjs/src/internal/operators/takeUntil.ts | 51 - .../rxjs/src/internal/operators/takeWhile.ts | 66 - .../rxjs/src/internal/operators/tap.ts | 215 - .../rxjs/src/internal/operators/throttle.ts | 143 - .../src/internal/operators/throttleTime.ts | 62 - .../src/internal/operators/throwIfEmpty.ts | 60 - .../src/internal/operators/timeInterval.ts | 67 - .../rxjs/src/internal/operators/timeout.ts | 405 - .../src/internal/operators/timeoutWith.ts | 116 - .../rxjs/src/internal/operators/timestamp.ts | 39 - .../rxjs/src/internal/operators/toArray.ts | 44 - .../rxjs/src/internal/operators/window.ts | 98 - .../src/internal/operators/windowCount.ts | 130 - .../rxjs/src/internal/operators/windowTime.ts | 207 - .../src/internal/operators/windowToggle.ts | 134 - .../rxjs/src/internal/operators/windowWhen.ts | 124 - .../src/internal/operators/withLatestFrom.ts | 110 - .../rxjs/src/internal/operators/zip.ts | 26 - .../rxjs/src/internal/operators/zipAll.ts | 20 - .../rxjs/src/internal/operators/zipWith.ts | 29 - .../src/internal/scheduled/scheduleArray.ts | 27 - .../scheduled/scheduleAsyncIterable.ts | 31 - .../internal/scheduled/scheduleIterable.ts | 60 - .../internal/scheduled/scheduleObservable.ts | 8 - .../src/internal/scheduled/schedulePromise.ts | 8 - .../scheduled/scheduleReadableStreamLike.ts | 8 - .../rxjs/src/internal/scheduled/scheduled.ts | 50 - .../rxjs/src/internal/scheduler/Action.ts | 36 - .../scheduler/AnimationFrameAction.ts | 43 - .../scheduler/AnimationFrameScheduler.ts | 38 - .../rxjs/src/internal/scheduler/AsapAction.ts | 45 - .../src/internal/scheduler/AsapScheduler.ts | 38 - .../src/internal/scheduler/AsyncAction.ts | 151 - .../src/internal/scheduler/AsyncScheduler.ts | 54 - .../src/internal/scheduler/QueueAction.ts | 44 - .../src/internal/scheduler/QueueScheduler.ts | 4 - .../scheduler/VirtualTimeScheduler.ts | 129 - .../src/internal/scheduler/animationFrame.ts | 41 - .../scheduler/animationFrameProvider.ts | 44 - .../rxjs/src/internal/scheduler/asap.ts | 44 - .../rxjs/src/internal/scheduler/async.ts | 56 - .../scheduler/dateTimestampProvider.ts | 14 - .../internal/scheduler/immediateProvider.ts | 31 - .../internal/scheduler/intervalProvider.ts | 31 - .../scheduler/performanceTimestampProvider.ts | 14 - .../rxjs/src/internal/scheduler/queue.ts | 72 - .../src/internal/scheduler/timeoutProvider.ts | 31 - .../src/internal/scheduler/timerHandle.ts | 1 - .../rxjs/src/internal/symbol/iterator.ts | 9 - .../rxjs/src/internal/symbol/observable.ts | 7 - .../src/internal/testing/ColdObservable.ts | 52 - .../src/internal/testing/HotObservable.ts | 53 - .../src/internal/testing/SubscriptionLog.ts | 5 - .../internal/testing/SubscriptionLoggable.ts | 22 - .../rxjs/src/internal/testing/TestMessage.ts | 7 - .../src/internal/testing/TestScheduler.ts | 693 -- dist/node_modules/rxjs/src/internal/types.ts | 365 - dist/node_modules/rxjs/src/internal/umd.ts | 26 - .../internal/util/ArgumentOutOfRangeError.ts | 30 - .../rxjs/src/internal/util/EmptyError.ts | 29 - .../rxjs/src/internal/util/Immediate.ts | 45 - .../rxjs/src/internal/util/NotFoundError.ts | 28 - .../internal/util/ObjectUnsubscribedError.ts | 29 - .../rxjs/src/internal/util/SequenceError.ts | 28 - .../src/internal/util/UnsubscriptionError.ts | 30 - .../rxjs/src/internal/util/applyMixins.ts | 10 - .../rxjs/src/internal/util/args.ts | 19 - .../src/internal/util/argsArgArrayOrObject.ts | 30 - .../rxjs/src/internal/util/argsOrArgArray.ts | 9 - .../rxjs/src/internal/util/arrRemove.ts | 11 - .../src/internal/util/createErrorClass.ts | 20 - .../rxjs/src/internal/util/createObject.ts | 3 - .../rxjs/src/internal/util/errorContext.ts | 42 - .../rxjs/src/internal/util/executeSchedule.ts | 44 - .../rxjs/src/internal/util/identity.ts | 45 - .../rxjs/src/internal/util/isArrayLike.ts | 1 - .../rxjs/src/internal/util/isAsyncIterable.ts | 5 - .../rxjs/src/internal/util/isDate.ts | 10 - .../rxjs/src/internal/util/isFunction.ts | 7 - .../src/internal/util/isInteropObservable.ts | 8 - .../rxjs/src/internal/util/isIterable.ts | 7 - .../rxjs/src/internal/util/isObservable.ts | 13 - .../rxjs/src/internal/util/isPromise.ts | 9 - .../src/internal/util/isReadableStreamLike.ts | 23 - .../rxjs/src/internal/util/isScheduler.ts | 6 - .../rxjs/src/internal/util/lift.ts | 32 - .../src/internal/util/mapOneOrManyArgs.ts | 16 - .../rxjs/src/internal/util/noop.ts | 2 - .../rxjs/src/internal/util/not.ts | 3 - .../rxjs/src/internal/util/pipe.ts | 95 - .../src/internal/util/reportUnhandledError.ts | 24 - .../src/internal/util/subscribeToArray.ts | 12 - .../internal/util/throwUnobservableError.ts | 12 - .../rxjs/src/internal/util/workarounds.ts | 7 - dist/node_modules/rxjs/src/operators/index.ts | 114 - dist/node_modules/rxjs/src/testing/index.ts | 1 - dist/node_modules/rxjs/src/tsconfig.base.json | 12 - dist/node_modules/rxjs/src/tsconfig.cjs.json | 10 - .../rxjs/src/tsconfig.cjs.spec.json | 10 - dist/node_modules/rxjs/src/tsconfig.esm.json | 9 - dist/node_modules/rxjs/src/tsconfig.esm5.json | 11 - .../rxjs/src/tsconfig.esm5.rollup.json | 8 - .../node_modules/rxjs/src/tsconfig.types.json | 14 - .../rxjs/src/tsconfig.types.spec.json | 7 - dist/node_modules/rxjs/src/webSocket/index.ts | 2 - dist/node_modules/rxjs/testing/package.json | 8 - dist/node_modules/rxjs/tsconfig.json | 28 - dist/node_modules/rxjs/webSocket/package.json | 8 - dist/node_modules/signal-exit/LICENSE.txt | 2 +- dist/node_modules/signal-exit/README.md | 77 +- .../signal-exit/dist/cjs/browser.d.ts | 12 + .../signal-exit/dist/cjs/browser.d.ts.map | 1 + .../signal-exit/dist/cjs/browser.js | 10 + .../signal-exit/dist/cjs/browser.js.map | 1 + .../signal-exit/dist/cjs/index.d.ts | 48 + .../signal-exit/dist/cjs/index.d.ts.map | 1 + .../signal-exit/dist/cjs/index.js | 279 + .../signal-exit/dist/cjs/index.js.map | 1 + .../signal-exit/dist/cjs/package.json | 3 + .../signal-exit/dist/cjs/signals.d.ts | 29 + .../signal-exit/dist/cjs/signals.d.ts.map | 1 + .../signal-exit/dist/cjs/signals.js | 42 + .../signal-exit/dist/cjs/signals.js.map | 1 + .../signal-exit/dist/mjs/browser.d.ts | 12 + .../signal-exit/dist/mjs/browser.d.ts.map | 1 + .../signal-exit/dist/mjs/browser.js | 4 + .../signal-exit/dist/mjs/browser.js.map | 1 + .../signal-exit/dist/mjs/index.d.ts | 48 + .../signal-exit/dist/mjs/index.d.ts.map | 1 + .../signal-exit/dist/mjs/index.js | 275 + .../signal-exit/dist/mjs/index.js.map | 1 + .../signal-exit/dist/mjs/package.json | 3 + .../signal-exit/dist/mjs/signals.d.ts | 29 + .../signal-exit/dist/mjs/signals.d.ts.map | 1 + .../signal-exit/dist/mjs/signals.js | 39 + .../signal-exit/dist/mjs/signals.js.map | 1 + dist/node_modules/signal-exit/index.js | 202 - dist/node_modules/signal-exit/package.json | 106 +- dist/node_modules/signal-exit/signals.js | 53 - dist/node_modules/string_decoder/LICENSE | 48 - dist/node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - dist/node_modules/string_decoder/package.json | 34 - dist/node_modules/through/.travis.yml | 5 - dist/node_modules/through/LICENSE.APACHE2 | 15 - dist/node_modules/through/LICENSE.MIT | 24 - dist/node_modules/through/index.js | 108 - dist/node_modules/through/package.json | 36 - dist/node_modules/through/readme.markdown | 64 - dist/node_modules/through/test/async.js | 28 - .../node_modules/through/test/auto-destroy.js | 30 - dist/node_modules/through/test/buffering.js | 71 - dist/node_modules/through/test/end.js | 45 - dist/node_modules/through/test/index.js | 133 - .../analizeDependencies.js.map | 1 - .../buildOutput.js.map | 1 - .../actions/checkPackageDependencies/index.js | 5 +- .../checkPackageDependencies/index.js.map | 1 - .../checkPackageDependencies/init.js.map | 1 - .../setSystemPackages.js.map | 1 - .../checkSapEntries/analizeSapEntries.js.map | 1 - .../checkSapEntries/buildOutput.js.map | 1 - .../dist/actions/checkSapEntries/index.js | 5 +- .../dist/actions/checkSapEntries/index.js.map | 1 - .../dist/actions/checkSapEntries/init.js.map | 1 - .../trm-core/dist/actions/exinstall.d.ts | 21 - .../trm-core/dist/actions/exinstall.js | 474 -- .../trm-core/dist/actions/exinstall.js.map | 1 - .../acknowledgementSize.js.map | 1 - .../deepCheckDependencies.d.ts | 3 - .../findDependencies/deepCheckDependencies.js | 90 - .../deepCheckDependencies.js.map | 1 - .../dist/actions/findDependencies/index.js | 5 +- .../actions/findDependencies/index.js.map | 1 - .../dist/actions/findDependencies/init.js.map | 1 - .../findDependencies/parseSenvi.js.map | 1 - .../actions/findDependencies/print.js.map | 1 - .../findDependencies/printDependencies.d.ts | 3 - .../findDependencies/printDependencies.js | 131 - .../findDependencies/printDependencies.js.map | 1 - .../findDependencies/readPackageData.js.map | 1 - .../readPackageObjects.js.map | 1 - .../readRepositoryEnvironment.js.map | 1 - .../setCircularDependencies.d.ts | 3 - .../setCircularDependencies.js | 37 - .../setCircularDependencies.js.map | 1 - .../findDependencies/setDependencies.d.ts | 3 - .../findDependencies/setDependencies.js | 105 - .../findDependencies/setDependencies.js.map | 1 - .../findDependencies/setSystemPackages.js.map | 1 - .../setTadirDependencies.d.ts | 3 - .../findDependencies/setTadirDependencies.js | 42 - .../setTadirDependencies.js.map | 1 - .../setTrmDependencies.js.map | 1 - .../trm-core/dist/actions/index.js.map | 1 - .../install/checkAlreadyInstalled.js.map | 1 - .../dist/actions/install/checkDependencies.js | 10 +- .../actions/install/checkDependencies.js.map | 1 - .../actions/install/checkIntegrity.js.map | 1 - .../dist/actions/install/checkSapEntries.js | 5 +- .../actions/install/checkSapEntries.js.map | 1 - .../actions/install/checkTadirContent.js.map | 1 - .../install/checkTadirObjectTypes.js.map | 1 - .../actions/install/checkTransports.js.map | 1 - .../dist/actions/install/generateDevclass.js | 9 +- .../actions/install/generateDevclass.js.map | 1 - .../install/generateWbTransport.js.map | 1 - .../install/importCustTransport.js.map | 1 - .../install/importLangTransport.js.map | 1 - .../install/importTadirTransport.js.map | 1 - .../trm-core/dist/actions/install/index.js | 5 +- .../dist/actions/install/index.js.map | 1 - .../trm-core/dist/actions/install/init.js | 1 + .../trm-core/dist/actions/install/init.js.map | 1 - .../actions/install/installDependencies.js | 16 +- .../install/installDependencies.js.map | 1 - .../actions/install/readDevcTransport.js.map | 1 - .../dist/actions/install/setDevclass.js.map | 1 - .../install/setPackageIntegrity.js.map | 1 - .../dist/actions/install/setR3trans.js.map | 1 - .../actions/install/setSystemPackages.js.map | 1 - .../dist/actions/installDependency.d.ts | 9 - .../dist/actions/installDependency.js | 18 - .../dist/actions/installDependency.js.map | 1 - .../checkAlreadyInstalled.js.map | 1 - .../findInstallRelease.js.map | 1 - .../installDependency/getRangeReleases.js.map | 1 - .../dist/actions/installDependency/index.js | 5 +- .../actions/installDependency/index.js.map | 1 - .../dist/actions/installDependency/init.js | 1 + .../actions/installDependency/init.js.map | 1 - .../installDependency/installRelease.js | 5 +- .../installDependency/installRelease.js.map | 1 - .../setSystemPackages.js.map | 1 - .../publish/buildTrmPackageInstance.js.map | 1 - .../publish/checkPackageExistance.js.map | 1 - .../publish/checkPublishAllowed.js.map | 1 - .../actions/publish/editSapEntries.js.map | 1 - .../publish/editTrmDependencies.js.map | 1 - .../actions/publish/finalizePublish.js.map | 1 - .../dist/actions/publish/findDependencies.js | 2 +- .../actions/publish/findDependencies.js.map | 1 - .../actions/publish/generateCustTr.js.map | 1 - .../actions/publish/generateDevcTr.js.map | 1 - .../actions/publish/generateLangTr.js.map | 1 - .../actions/publish/generateTadirTr.js.map | 1 - .../publish/generateTrmArtifact.js.map | 1 - .../trm-core/dist/actions/publish/index.js | 5 +- .../dist/actions/publish/index.js.map | 1 - .../trm-core/dist/actions/publish/init.js.map | 1 - .../actions/publish/logDependencies.js.map | 1 - .../publish/overwriteManifestValues.js.map | 1 - .../actions/publish/publishTrmArtifact.js.map | 1 - .../dist/actions/publish/releaseCustTr.js.map | 1 - .../dist/actions/publish/releaseDevcTr.js.map | 1 - .../dist/actions/publish/releaseLangTr.js.map | 1 - .../actions/publish/releaseTadirTr.js.map | 1 - .../actions/publish/setBackwardsCompatible.js | 2 +- .../publish/setBackwardsCompatible.js.map | 1 - .../actions/publish/setCustTransports.js.map | 1 - .../dist/actions/publish/setDevclass.js.map | 1 - .../actions/publish/setDevclassObjs.js.map | 1 - .../actions/publish/setManifestValues.js.map | 1 - .../dist/actions/publish/setPrivate.js.map | 1 - .../dist/actions/publish/setReadme.js.map | 1 - .../dist/actions/publish/setSapEntries.js.map | 1 - .../actions/publish/setTransportTarget.js.map | 1 - .../actions/publish/setTrmDependencies.js.map | 1 - .../trm-core/dist/client/IClient.js.map | 1 - .../trm-core/dist/client/RFCClient.js.map | 1 - .../dist/client/components/ARBGB.js.map | 1 - .../dist/client/components/AS4DATE.js.map | 1 - .../dist/client/components/AS4TEXT.js.map | 1 - .../dist/client/components/AS4TIME.js.map | 1 - .../dist/client/components/DDOPTION.js.map | 1 - .../dist/client/components/DDPOSITION.js.map | 1 - .../dist/client/components/DDSIGN.js.map | 1 - .../dist/client/components/DDTEXT.js.map | 1 - .../dist/client/components/DEVCLASS.js.map | 1 - .../dist/client/components/DEVLAYER.js.map | 1 - .../dist/client/components/DLVUNIT.js.map | 1 - .../dist/client/components/FIELDNAME.js.map | 1 - .../dist/client/components/FILESYS_D.js.map | 1 - .../dist/client/components/MSGNR.js.map | 1 - .../dist/client/components/NATXT.js.map | 1 - .../dist/client/components/PACKAUTHOR.js.map | 1 - .../dist/client/components/PARENTCL.js.map | 1 - .../dist/client/components/PFEVALUE.js.map | 1 - .../dist/client/components/PGMID.js.map | 1 - .../dist/client/components/PNAME.js.map | 1 - .../dist/client/components/RESPONSIBL.js.map | 1 - .../dist/client/components/RS38L_FNAME.js.map | 1 - .../dist/client/components/SEU_OBJ.js.map | 1 - .../dist/client/components/SEU_OBJKEY.js.map | 1 - .../dist/client/components/SOBJ_NAME.js.map | 1 - .../dist/client/components/SO_TEXT.js.map | 1 - .../dist/client/components/SPRAS.js.map | 1 - .../dist/client/components/SRCSYSTEM.js.map | 1 - .../dist/client/components/SYCHAR512.js.map | 1 - .../dist/client/components/TABNAME.js.map | 1 - .../dist/client/components/TDFORMAT.js.map | 1 - .../dist/client/components/TDLINE.js.map | 1 - .../dist/client/components/TMSSYSNAM.js.map | 1 - .../dist/client/components/TRFUNCTION.js.map | 1 - .../dist/client/components/TRKORR.js.map | 1 - .../dist/client/components/TROBJTYPE.js.map | 1 - .../dist/client/components/TROBJ_NAME.js.map | 1 - .../dist/client/components/TRPARFLAG.js.map | 1 - .../dist/client/components/TR_TARGET.js.map | 1 - .../components/ZTRM_PACKAGE_INTEGRITY.js.map | 1 - .../components/ZTRM_PACKAGE_NAME.js.map | 1 - .../components/ZTRM_PACKAGE_REGISTRY.js.map | 1 - .../dist/client/components/index.js.map | 1 - .../trm-core/dist/client/index.js.map | 1 - .../trm-core/dist/client/struct/E070.js.map | 1 - .../trm-core/dist/client/struct/E071.js.map | 1 - .../dist/client/struct/FILESYS.js.map | 1 - .../trm-core/dist/client/struct/KO100.js.map | 1 - .../client/struct/LXE_TT_PACKG_LINE.js.map | 1 - .../dist/client/struct/RFC_DB_FLD.js.map | 1 - .../dist/client/struct/RFC_DB_OPT.js.map | 1 - .../dist/client/struct/SCOMPKDTLN.js.map | 1 - .../trm-core/dist/client/struct/SENVI.js.map | 1 - .../dist/client/struct/STMSIQREQ.js.map | 1 - .../trm-core/dist/client/struct/T100.js.map | 1 - .../trm-core/dist/client/struct/TAB512.js.map | 1 - .../trm-core/dist/client/struct/TADIR.js.map | 1 - .../trm-core/dist/client/struct/TDEVC.js.map | 1 - .../trm-core/dist/client/struct/TDEVCT.js.map | 1 - .../trm-core/dist/client/struct/TFDIR.js.map | 1 - .../trm-core/dist/client/struct/TLINE.js.map | 1 - .../dist/client/struct/TMSCSYS.js.map | 1 - .../client/struct/ZTRM_INSTALLDEVC.js.map | 1 - .../dist/client/struct/ZTRM_INTEGRITY.js.map | 1 - .../trm-core/dist/client/struct/index.js.map | 1 - .../dist/commons/LogTableStruct.js.map | 1 - .../dist/commons/PackageHierarchy.js.map | 1 - .../trm-core/dist/commons/PackageName.js.map | 1 - .../dist/commons/fromAbapToDate.js.map | 1 - .../dist/commons/getFileSysSeparator.js.map | 1 - .../dist/commons/getPackageHierarchy.js.map | 1 - .../dist/commons/getPackageNamespace.js.map | 1 - .../commons/getParentFromHierarchy.js.map | 1 - .../trm-core/dist/commons/index.js.map | 1 - .../trm-core/dist/commons/normalize.js.map | 1 - .../dist/commons/parsePackageName.js.map | 1 - .../commons/validateOrganizationName.js.map | 1 - .../trm-core/dist/dependency/IParser.js.map | 1 - .../dist/dependency/SenviParser.js.map | 1 - .../trm-core/dist/dependency/index.js.map | 1 - .../dependency/objects/ClasSenviParser.js.map | 1 - .../dependency/objects/DtelSenviParser.js.map | 1 - .../dependency/objects/FugrSenviParser.js.map | 1 - .../dependency/objects/FuncSenviParser.js.map | 1 - .../dependency/objects/OmSenviParser.js.map | 1 - .../dependency/objects/ProgSenviParser.js.map | 1 - .../dependency/objects/TablSenviParser.js.map | 1 - .../dependency/objects/ViewSenviParser.js.map | 1 - .../dist/dependency/objects/index.js.map | 1 - dist/node_modules/trm-core/dist/index.js.map | 1 - .../trm-core/dist/inquirer/CliInquirer.js | 36 +- .../trm-core/dist/inquirer/CliInquirer.js.map | 1 - .../trm-core/dist/inquirer/IInquirer.js.map | 1 - .../trm-core/dist/inquirer/Inquirer.js.map | 1 - .../trm-core/dist/inquirer/Question.js.map | 1 - .../trm-core/dist/inquirer/index.js.map | 1 - .../dist/inquirer/validators/index.js.map | 1 - .../validators/validateDevclass.js.map | 1 - .../validators/validateTransportTarget.js.map | 1 - .../dist/logger/CliLogFileLogger.js.map | 1 - .../trm-core/dist/logger/CliLogger.js.map | 1 - .../trm-core/dist/logger/ConsoleLogger.js.map | 1 - .../trm-core/dist/logger/DummyLogger.js.map | 1 - .../trm-core/dist/logger/ILogger.js.map | 1 - .../trm-core/dist/logger/JSONLog.js.map | 1 - .../trm-core/dist/logger/Logger.d.ts | 3 + .../trm-core/dist/logger/Logger.js | 10 +- .../trm-core/dist/logger/Logger.js.map | 1 - .../trm-core/dist/logger/TreeLog.js.map | 1 - .../trm-core/dist/logger/index.js.map | 1 - .../trm-core/dist/manifest/Manifest.js.map | 1 - .../trm-core/dist/manifest/TrmManifest.js.map | 1 - .../dist/manifest/TrmManifestAuthor.js.map | 1 - .../manifest/TrmManifestDependency.js.map | 1 - .../trm-core/dist/manifest/index.js.map | 1 - .../dist/protocol/CallbackType.js.map | 1 - .../trm-core/dist/protocol/Protocol.js.map | 1 - .../trm-core/dist/protocol/callback.js.map | 1 - .../trm-core/dist/protocol/index.js.map | 1 - .../trm-core/dist/registry/Registry.js | 10 +- .../trm-core/dist/registry/Registry.js.map | 1 - .../dist/registry/RegistryType.js.map | 1 - .../trm-core/dist/registry/index.js.map | 1 - .../dist/systemConnector/Connection.js.map | 1 - .../systemConnector/ISystemConnector.js.map | 1 - .../systemConnector/InstallPackage.js.map | 1 - .../dist/systemConnector/Login.js.map | 1 - .../dist/systemConnector/SapMessage.js.map | 1 - .../systemConnector/ServerSystemConnector.js | 7 +- .../ServerSystemConnector.js.map | 1 - .../systemConnector/SystemConnector.js.map | 1 - .../dist/systemConnector/index.js.map | 1 - .../dist/transport/BinaryTransport.js.map | 1 - .../dist/transport/Documentation.js.map | 1 - .../trm-core/dist/transport/FileNames.js.map | 1 - .../trm-core/dist/transport/FilePaths.js.map | 1 - .../trm-core/dist/transport/Transport.js.map | 1 - .../dist/transport/TransportContent.js.map | 1 - .../transport/TrmTransportIdentifier.js.map | 1 - .../trm-core/dist/transport/index.js.map | 1 - .../dist/trmPackage/TransportBinary.js.map | 1 - .../dist/trmPackage/TrmArtifact.js.map | 1 - .../trm-core/dist/trmPackage/TrmPackage.js | 5 +- .../dist/trmPackage/TrmPackage.js.map | 1 - .../trm-core/dist/trmPackage/index.js.map | 1 - dist/node_modules/trm-core/package.json | 4 +- dist/node_modules/tslib/CopyrightNotice.txt | 15 - dist/node_modules/tslib/LICENSE.txt | 12 - dist/node_modules/tslib/README.md | 164 - dist/node_modules/tslib/SECURITY.md | 41 - dist/node_modules/tslib/modules/index.d.ts | 37 - dist/node_modules/tslib/modules/index.js | 68 - dist/node_modules/tslib/modules/package.json | 3 - dist/node_modules/tslib/package.json | 47 - dist/node_modules/tslib/tslib.d.ts | 453 -- dist/node_modules/tslib/tslib.es6.html | 1 - dist/node_modules/tslib/tslib.es6.js | 370 - dist/node_modules/tslib/tslib.es6.mjs | 370 - dist/node_modules/tslib/tslib.html | 1 - dist/node_modules/tslib/tslib.js | 421 - dist/node_modules/util-deprecate/History.md | 16 - dist/node_modules/util-deprecate/browser.js | 67 - dist/node_modules/util-deprecate/node.js | 6 - dist/node_modules/util-deprecate/package.json | 27 - dist/node_modules/wcwidth/.npmignore | 1 - dist/node_modules/wcwidth/LICENSE | 30 - dist/node_modules/wcwidth/Readme.md | 33 - dist/node_modules/wcwidth/combining.js | 50 - dist/node_modules/wcwidth/docs/index.md | 65 - dist/node_modules/wcwidth/index.js | 99 - dist/node_modules/wcwidth/package.json | 42 - dist/node_modules/wcwidth/test/index.js | 64 - dist/node_modules/yoctocolors-cjs/index.d.ts | 94 + dist/node_modules/yoctocolors-cjs/index.js | 93 + .../{figures => yoctocolors-cjs}/license | 0 .../node_modules/yoctocolors-cjs/package.json | 67 + dist/node_modules/yoctocolors-cjs/readme.md | 130 + package-lock.json | 541 +- package.json | 4 +- 3076 files changed, 15141 insertions(+), 131275 deletions(-) rename dist/node_modules/{inquirer => @inquirer/checkbox}/LICENSE (96%) create mode 100644 dist/node_modules/@inquirer/checkbox/README.md create mode 100644 dist/node_modules/@inquirer/checkbox/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/checkbox/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/checkbox/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/checkbox/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/checkbox/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/checkbox/package.json rename dist/node_modules/{util-deprecate => @inquirer/confirm}/LICENSE (92%) create mode 100644 dist/node_modules/@inquirer/confirm/README.md create mode 100644 dist/node_modules/@inquirer/confirm/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/confirm/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/confirm/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/confirm/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/confirm/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/confirm/package.json rename dist/node_modules/{util-deprecate/README.md => @inquirer/core/LICENSE} (61%) create mode 100644 dist/node_modules/@inquirer/core/README.md create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/Separator.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/errors.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/hook-engine.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/key.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/make-theme.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/lines.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/position.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/use-pagination.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/screen-manager.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/theme.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/use-effect.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/use-keypress.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/use-memo.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/use-prefix.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/use-ref.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/use-state.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/lib/utils.js create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/Separator.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/create-prompt.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/errors.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/hook-engine.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/key.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/make-theme.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/lines.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/position.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/use-pagination.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/screen-manager.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/theme.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-effect.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-keypress.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-memo.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-prefix.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-ref.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-state.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/cjs/types/lib/utils.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/Separator.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/errors.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/key.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/make-theme.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/pagination/position.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/screen-manager.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/theme.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/use-effect.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/use-keypress.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/use-prefix.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/use-ref.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/use-state.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/lib/utils.mjs create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/Separator.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/create-prompt.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/errors.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/hook-engine.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/key.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/make-theme.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/lines.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/position.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/use-pagination.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/screen-manager.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/theme.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/use-effect.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/use-keypress.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/use-memo.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/use-prefix.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/use-ref.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/use-state.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/esm/types/lib/utils.d.mts create mode 100644 dist/node_modules/@inquirer/core/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/Separator.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/create-prompt.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/errors.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/hook-engine.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/key.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/make-theme.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.test.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/pagination/position.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/pagination/use-pagination.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/screen-manager.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/theme.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/use-effect.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/use-keypress.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/use-memo.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/use-prefix.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/use-ref.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/use-state.d.ts create mode 100644 dist/node_modules/@inquirer/core/dist/types/lib/utils.d.ts create mode 100644 dist/node_modules/@inquirer/core/package.json create mode 100644 dist/node_modules/@inquirer/editor/LICENSE create mode 100644 dist/node_modules/@inquirer/editor/README.md create mode 100644 dist/node_modules/@inquirer/editor/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/editor/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/editor/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/editor/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/editor/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/editor/package.json create mode 100644 dist/node_modules/@inquirer/expand/LICENSE create mode 100644 dist/node_modules/@inquirer/expand/README.md create mode 100644 dist/node_modules/@inquirer/expand/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/expand/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/expand/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/expand/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/expand/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/expand/package.json create mode 100644 dist/node_modules/@inquirer/figures/LICENSE create mode 100644 dist/node_modules/@inquirer/figures/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/figures/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/figures/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/figures/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/figures/package.json create mode 100644 dist/node_modules/@inquirer/input/LICENSE create mode 100644 dist/node_modules/@inquirer/input/README.md create mode 100644 dist/node_modules/@inquirer/input/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/input/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/input/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/input/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/input/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/input/package.json create mode 100644 dist/node_modules/@inquirer/number/LICENSE create mode 100644 dist/node_modules/@inquirer/number/README.md create mode 100644 dist/node_modules/@inquirer/number/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/number/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/number/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/number/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/number/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/number/package.json create mode 100644 dist/node_modules/@inquirer/password/LICENSE create mode 100644 dist/node_modules/@inquirer/password/README.md create mode 100644 dist/node_modules/@inquirer/password/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/password/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/password/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/password/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/password/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/password/package.json create mode 100644 dist/node_modules/@inquirer/prompts/LICENSE create mode 100644 dist/node_modules/@inquirer/prompts/README.md create mode 100644 dist/node_modules/@inquirer/prompts/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/prompts/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/prompts/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/prompts/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/prompts/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/prompts/package.json create mode 100644 dist/node_modules/@inquirer/rawlist/LICENSE create mode 100644 dist/node_modules/@inquirer/rawlist/README.md create mode 100644 dist/node_modules/@inquirer/rawlist/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/rawlist/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/rawlist/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/rawlist/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/rawlist/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/rawlist/package.json create mode 100644 dist/node_modules/@inquirer/select/LICENSE create mode 100644 dist/node_modules/@inquirer/select/README.md create mode 100644 dist/node_modules/@inquirer/select/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/select/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/select/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/select/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/select/dist/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/select/package.json create mode 100644 dist/node_modules/@inquirer/type/LICENSE create mode 100644 dist/node_modules/@inquirer/type/dist/cjs/index.js create mode 100644 dist/node_modules/@inquirer/type/dist/cjs/types/index.d.ts create mode 100644 dist/node_modules/@inquirer/type/dist/esm/index.mjs create mode 100644 dist/node_modules/@inquirer/type/dist/esm/types/index.d.mts create mode 100644 dist/node_modules/@inquirer/type/package.json create mode 100644 dist/node_modules/@types/mute-stream/LICENSE create mode 100644 dist/node_modules/@types/mute-stream/README.md create mode 100644 dist/node_modules/@types/mute-stream/index.d.ts create mode 100644 dist/node_modules/@types/mute-stream/package.json create mode 100644 dist/node_modules/@types/node/sea.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/assert.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/assert/strict.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/async_hooks.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/buffer.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/child_process.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/cluster.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/console.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/constants.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/crypto.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/dgram.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/dns.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/dns/promises.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/dom-events.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/domain.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/events.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/fs.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/fs/promises.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/globals.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/globals.global.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/http.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/http2.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/https.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/index.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/inspector.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/module.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/net.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/os.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/path.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/process.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/punycode.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/querystring.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/readline.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/readline/promises.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/repl.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/stream.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/stream/consumers.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/stream/promises.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/stream/web.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/string_decoder.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/test.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/timers.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/timers/promises.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/tls.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/trace_events.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/tty.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/url.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/util.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/v8.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/vm.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/wasi.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/worker_threads.d.ts delete mode 100644 dist/node_modules/@types/node/ts4.8/zlib.d.ts create mode 100644 dist/node_modules/@types/wrap-ansi/LICENSE create mode 100644 dist/node_modules/@types/wrap-ansi/README.md create mode 100644 dist/node_modules/@types/wrap-ansi/index.d.ts create mode 100644 dist/node_modules/@types/wrap-ansi/package.json delete mode 100644 dist/node_modules/bl/.travis.yml delete mode 100644 dist/node_modules/bl/BufferList.js delete mode 100644 dist/node_modules/bl/LICENSE.md delete mode 100644 dist/node_modules/bl/README.md delete mode 100644 dist/node_modules/bl/bl.js delete mode 100644 dist/node_modules/bl/package.json delete mode 100644 dist/node_modules/bl/test/convert.js delete mode 100644 dist/node_modules/bl/test/indexOf.js delete mode 100644 dist/node_modules/bl/test/isBufferList.js delete mode 100644 dist/node_modules/bl/test/test.js delete mode 100644 dist/node_modules/buffer/AUTHORS.md delete mode 100644 dist/node_modules/buffer/LICENSE delete mode 100644 dist/node_modules/buffer/README.md delete mode 100644 dist/node_modules/buffer/index.d.ts delete mode 100644 dist/node_modules/buffer/index.js delete mode 100644 dist/node_modules/buffer/package.json delete mode 100644 dist/node_modules/cli-cursor/index.d.ts delete mode 100644 dist/node_modules/cli-cursor/index.js delete mode 100644 dist/node_modules/cli-cursor/license delete mode 100644 dist/node_modules/cli-cursor/package.json delete mode 100644 dist/node_modules/cli-cursor/readme.md delete mode 100644 dist/node_modules/cli-width/.nyc_output/00ef1b3d-3687-482b-8d03-de2f76b58f54.json delete mode 100644 dist/node_modules/cli-width/.nyc_output/processinfo/00ef1b3d-3687-482b-8d03-de2f76b58f54.json delete mode 100644 dist/node_modules/cli-width/.nyc_output/processinfo/index.json delete mode 100644 dist/node_modules/cli-width/.travis.yml delete mode 100644 dist/node_modules/cli-width/CHANGELOG.md create mode 100644 dist/node_modules/cli-width/index.d.ts delete mode 100644 dist/node_modules/clone/.npmignore delete mode 100644 dist/node_modules/clone/LICENSE delete mode 100644 dist/node_modules/clone/README.md delete mode 100644 dist/node_modules/clone/clone.iml delete mode 100644 dist/node_modules/clone/clone.js delete mode 100644 dist/node_modules/clone/package.json delete mode 100644 dist/node_modules/defaults/LICENSE delete mode 100644 dist/node_modules/defaults/README.md delete mode 100644 dist/node_modules/defaults/index.js delete mode 100644 dist/node_modules/defaults/package.json delete mode 100644 dist/node_modules/defaults/test.js delete mode 100644 dist/node_modules/escape-string-regexp/index.js delete mode 100644 dist/node_modules/escape-string-regexp/license delete mode 100644 dist/node_modules/escape-string-regexp/package.json delete mode 100644 dist/node_modules/escape-string-regexp/readme.md delete mode 100644 dist/node_modules/figures/index.d.ts delete mode 100644 dist/node_modules/figures/index.js delete mode 100644 dist/node_modules/figures/package.json delete mode 100644 dist/node_modules/figures/readme.md delete mode 100644 dist/node_modules/ieee754/LICENSE delete mode 100644 dist/node_modules/ieee754/README.md delete mode 100644 dist/node_modules/ieee754/index.d.ts delete mode 100644 dist/node_modules/ieee754/index.js delete mode 100644 dist/node_modules/ieee754/package.json delete mode 100644 dist/node_modules/inquirer/README.md delete mode 100644 dist/node_modules/inquirer/lib/inquirer.js delete mode 100644 dist/node_modules/inquirer/lib/objects/choice.js delete mode 100644 dist/node_modules/inquirer/lib/objects/choices.js delete mode 100644 dist/node_modules/inquirer/lib/objects/separator.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/base.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/checkbox.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/confirm.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/editor.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/expand.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/input.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/list.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/number.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/password.js delete mode 100644 dist/node_modules/inquirer/lib/prompts/rawlist.js delete mode 100644 dist/node_modules/inquirer/lib/ui/baseUI.js delete mode 100644 dist/node_modules/inquirer/lib/ui/bottom-bar.js delete mode 100644 dist/node_modules/inquirer/lib/ui/prompt.js delete mode 100644 dist/node_modules/inquirer/lib/utils/events.js delete mode 100644 dist/node_modules/inquirer/lib/utils/incrementListIndex.js delete mode 100644 dist/node_modules/inquirer/lib/utils/paginator.js delete mode 100644 dist/node_modules/inquirer/lib/utils/readline.js delete mode 100644 dist/node_modules/inquirer/lib/utils/screen-manager.js delete mode 100644 dist/node_modules/inquirer/lib/utils/utils.js delete mode 100644 dist/node_modules/inquirer/package.json delete mode 100644 dist/node_modules/is-interactive/index.d.ts delete mode 100644 dist/node_modules/is-interactive/index.js delete mode 100644 dist/node_modules/is-interactive/license delete mode 100644 dist/node_modules/is-interactive/package.json delete mode 100644 dist/node_modules/is-interactive/readme.md delete mode 100644 dist/node_modules/is-unicode-supported/index.d.ts delete mode 100644 dist/node_modules/is-unicode-supported/index.js delete mode 100644 dist/node_modules/is-unicode-supported/license delete mode 100644 dist/node_modules/is-unicode-supported/package.json delete mode 100644 dist/node_modules/is-unicode-supported/readme.md delete mode 100644 dist/node_modules/log-symbols/browser.js delete mode 100644 dist/node_modules/log-symbols/index.d.ts delete mode 100644 dist/node_modules/log-symbols/index.js delete mode 100644 dist/node_modules/log-symbols/license delete mode 100644 dist/node_modules/log-symbols/package.json delete mode 100644 dist/node_modules/log-symbols/readme.md delete mode 100644 dist/node_modules/mimic-fn/index.d.ts delete mode 100644 dist/node_modules/mimic-fn/index.js delete mode 100644 dist/node_modules/mimic-fn/license delete mode 100644 dist/node_modules/mimic-fn/package.json delete mode 100644 dist/node_modules/mimic-fn/readme.md create mode 100644 dist/node_modules/mute-stream/lib/index.js delete mode 100644 dist/node_modules/mute-stream/mute.js delete mode 100644 dist/node_modules/onetime/index.d.ts delete mode 100644 dist/node_modules/onetime/index.js delete mode 100644 dist/node_modules/onetime/license delete mode 100644 dist/node_modules/onetime/package.json delete mode 100644 dist/node_modules/onetime/readme.md delete mode 100644 dist/node_modules/ora/index.d.ts delete mode 100644 dist/node_modules/ora/index.js delete mode 100644 dist/node_modules/ora/license delete mode 100644 dist/node_modules/ora/package.json delete mode 100644 dist/node_modules/ora/readme.md delete mode 100644 dist/node_modules/readable-stream/CONTRIBUTING.md delete mode 100644 dist/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 dist/node_modules/readable-stream/LICENSE delete mode 100644 dist/node_modules/readable-stream/README.md delete mode 100644 dist/node_modules/readable-stream/errors-browser.js delete mode 100644 dist/node_modules/readable-stream/errors.js delete mode 100644 dist/node_modules/readable-stream/experimentalWarning.js delete mode 100644 dist/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 dist/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 dist/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 dist/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 dist/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/async_iterator.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/buffer_list.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/end-of-stream.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/from-browser.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/from.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/pipeline.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/state.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 dist/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 dist/node_modules/readable-stream/package.json delete mode 100644 dist/node_modules/readable-stream/readable-browser.js delete mode 100644 dist/node_modules/readable-stream/readable.js delete mode 100644 dist/node_modules/restore-cursor/index.d.ts delete mode 100644 dist/node_modules/restore-cursor/index.js delete mode 100644 dist/node_modules/restore-cursor/license delete mode 100644 dist/node_modules/restore-cursor/package.json delete mode 100644 dist/node_modules/restore-cursor/readme.md delete mode 100644 dist/node_modules/run-async/LICENSE delete mode 100644 dist/node_modules/run-async/README.md delete mode 100644 dist/node_modules/run-async/index.js delete mode 100644 dist/node_modules/run-async/package.json delete mode 100644 dist/node_modules/rxjs/CHANGELOG.md delete mode 100644 dist/node_modules/rxjs/CODE_OF_CONDUCT.md delete mode 100644 dist/node_modules/rxjs/LICENSE.txt delete mode 100644 dist/node_modules/rxjs/README.md delete mode 100644 dist/node_modules/rxjs/ajax/package.json delete mode 100644 dist/node_modules/rxjs/dist/bundles/rxjs.umd.js delete mode 100644 dist/node_modules/rxjs/dist/bundles/rxjs.umd.js.map delete mode 100644 dist/node_modules/rxjs/dist/bundles/rxjs.umd.min.js delete mode 100644 dist/node_modules/rxjs/dist/bundles/rxjs.umd.min.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/ajax/index.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/ajax/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/fetch/index.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/fetch/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/index.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/AnyCatcher.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/AnyCatcher.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/AsyncSubject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/AsyncSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Notification.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Notification.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/NotificationFactories.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/NotificationFactories.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Observable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Observable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Operator.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Operator.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ReplaySubject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ReplaySubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Scheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Scheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Subject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Subject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Subscriber.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Subscriber.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Subscription.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/Subscription.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/AjaxResponse.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/AjaxResponse.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/ajax.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/ajax.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/errors.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/errors.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/getXHRResponse.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/getXHRResponse.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/types.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/ajax/types.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/config.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/config.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/firstValueFrom.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/firstValueFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/lastValueFrom.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/lastValueFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/ConnectableObservable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/ConnectableObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/concat.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/concat.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/connectable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/connectable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/defer.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/defer.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/WebSocketSubject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/WebSocketSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/fetch.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/fetch.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/webSocket.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/dom/webSocket.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/empty.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/empty.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/from.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/from.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/generate.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/generate.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/iif.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/iif.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/interval.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/interval.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/merge.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/merge.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/never.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/never.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/of.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/of.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/pairs.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/pairs.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/partition.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/partition.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/race.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/race.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/range.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/range.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/throwError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/throwError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/timer.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/timer.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/using.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/using.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/zip.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/observable/zip.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/audit.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/audit.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/auditTime.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/auditTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/buffer.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/buffer.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferCount.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferTime.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferToggle.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferToggle.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/catchError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/catchError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineLatest.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineLatest.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineLatestWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/combineLatestWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concat.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concat.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatMap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/concatWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/connect.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/connect.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/count.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/count.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/debounce.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/debounce.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/delay.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/delay.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/distinct.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/distinct.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/elementAt.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/elementAt.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/endWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/endWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/every.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/every.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/exhaust.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/exhaust.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/expand.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/expand.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/filter.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/filter.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/finalize.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/finalize.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/find.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/find.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/findIndex.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/findIndex.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/first.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/first.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/flatMap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/flatMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/groupBy.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/groupBy.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/last.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/last.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/map.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/map.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mapTo.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/materialize.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/materialize.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/max.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/max.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/merge.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/merge.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/min.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/min.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/multicast.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/multicast.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/observeOn.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/observeOn.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/onErrorResumeNextWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/onErrorResumeNextWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/pairwise.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/pairwise.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/partition.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/partition.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/pluck.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/pluck.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publish.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publish.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publishLast.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publishLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/race.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/race.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/raceWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/raceWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/reduce.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/reduce.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/refCount.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/refCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/repeat.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/repeat.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/retry.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/retry.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/sample.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/sample.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/scan.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/scan.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/share.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/share.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/single.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/single.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skip.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skip.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skipLast.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skipLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/startWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/startWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchScan.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/switchScan.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/take.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/take.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/takeLast.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/takeLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/tap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/tap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/throttle.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/throttle.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timeout.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timeout.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timestamp.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/timestamp.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/toArray.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/toArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/window.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/window.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowCount.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowTime.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowToggle.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowToggle.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/withLatestFrom.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/withLatestFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/zip.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/zip.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/zipAll.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/zipAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/zipWith.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/operators/zipWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/Action.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/Action.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameAction.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsapAction.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsapAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/QueueAction.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/QueueAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/QueueScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/QueueScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrameProvider.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrameProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/asap.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/asap.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/async.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/async.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/dateTimestampProvider.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/dateTimestampProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/immediateProvider.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/immediateProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/intervalProvider.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/intervalProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/performanceTimestampProvider.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/performanceTimestampProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/queue.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/queue.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/timeoutProvider.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/timeoutProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/timerHandle.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/scheduler/timerHandle.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/symbol/iterator.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/symbol/iterator.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/symbol/observable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/symbol/observable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/ColdObservable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/ColdObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/HotObservable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/HotObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/SubscriptionLog.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/SubscriptionLog.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/SubscriptionLoggable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/SubscriptionLoggable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/TestMessage.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/TestMessage.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/TestScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/testing/TestScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/types.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/types.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/EmptyError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/EmptyError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/Immediate.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/Immediate.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/SequenceError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/SequenceError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/applyMixins.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/applyMixins.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/args.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/args.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/argsArgArrayOrObject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/argsArgArrayOrObject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/argsOrArgArray.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/argsOrArgArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/arrRemove.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/arrRemove.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/createObject.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/createObject.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/errorContext.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/errorContext.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/executeSchedule.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/executeSchedule.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/identity.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/identity.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isArrayLike.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isArrayLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isDate.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isDate.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isFunction.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isFunction.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isIterable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isObservable.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isPromise.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isPromise.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isReadableStreamLike.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isReadableStreamLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/isScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/lift.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/lift.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/mapOneOrManyArgs.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/mapOneOrManyArgs.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/noop.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/noop.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/not.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/not.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/pipe.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/pipe.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/subscribeToArray.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/subscribeToArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/workarounds.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/internal/util/workarounds.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/operators/index.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/operators/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/testing/index.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/testing/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/cjs/webSocket/index.js delete mode 100644 dist/node_modules/rxjs/dist/cjs/webSocket/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/ajax/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm/ajax/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/fetch/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm/fetch/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/AnyCatcher.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/AnyCatcher.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/AsyncSubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/AsyncSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/BehaviorSubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/BehaviorSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Notification.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Notification.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/NotificationFactories.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/NotificationFactories.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Observable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Observable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Operator.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Operator.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ReplaySubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ReplaySubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Scheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Scheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Subject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Subject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Subscriber.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Subscriber.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Subscription.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/Subscription.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/AjaxResponse.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/AjaxResponse.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/ajax.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/ajax.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/errors.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/errors.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/getXHRResponse.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/getXHRResponse.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/types.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/ajax/types.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/config.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/config.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/firstValueFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/firstValueFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/lastValueFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/lastValueFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/bindCallback.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/bindCallback.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/bindCallbackInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/bindCallbackInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/bindNodeCallback.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/bindNodeCallback.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/combineLatest.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/combineLatest.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/concat.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/concat.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/connectable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/connectable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/defer.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/defer.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/WebSocketSubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/WebSocketSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/animationFrames.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/animationFrames.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/fetch.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/fetch.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/webSocket.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/dom/webSocket.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/empty.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/empty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/forkJoin.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/forkJoin.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/from.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/from.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/fromEvent.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/fromEvent.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/fromEventPattern.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/fromEventPattern.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/fromSubscribable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/fromSubscribable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/generate.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/generate.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/iif.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/iif.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/innerFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/innerFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/interval.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/interval.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/merge.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/merge.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/never.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/never.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/of.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/of.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/onErrorResumeNext.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/onErrorResumeNext.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/pairs.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/pairs.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/partition.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/partition.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/race.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/race.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/range.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/range.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/throwError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/throwError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/timer.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/timer.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/using.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/using.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/zip.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/observable/zip.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/audit.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/audit.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/auditTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/auditTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/buffer.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/buffer.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferCount.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferToggle.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferToggle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/catchError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/catchError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineLatest.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineLatest.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineLatestAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineLatestAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineLatestWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/combineLatestWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concat.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concat.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/concatWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/connect.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/connect.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/count.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/count.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/debounce.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/debounce.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/debounceTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/debounceTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/defaultIfEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/defaultIfEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/delay.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/delay.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/delayWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/delayWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/dematerialize.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/dematerialize.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/distinct.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/distinct.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/distinctUntilKeyChanged.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/distinctUntilKeyChanged.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/elementAt.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/elementAt.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/endWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/endWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/every.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/every.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/exhaust.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/exhaust.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/exhaustAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/exhaustAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/exhaustMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/exhaustMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/expand.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/expand.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/filter.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/filter.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/finalize.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/finalize.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/find.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/find.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/findIndex.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/findIndex.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/first.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/first.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/flatMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/flatMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/groupBy.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/groupBy.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/ignoreElements.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/ignoreElements.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/isEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/isEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/joinAllInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/joinAllInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/last.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/last.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/map.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/map.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/materialize.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/materialize.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/max.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/max.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/merge.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/merge.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeScan.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeScan.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/mergeWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/min.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/min.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/multicast.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/multicast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/observeOn.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/observeOn.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/onErrorResumeNextWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/onErrorResumeNextWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/pairwise.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/pairwise.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/partition.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/partition.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/pluck.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/pluck.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publish.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publish.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publishBehavior.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publishBehavior.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publishLast.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publishLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publishReplay.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/publishReplay.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/race.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/race.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/raceWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/raceWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/reduce.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/reduce.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/refCount.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/refCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/repeat.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/repeat.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/retry.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/retry.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/retryWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/retryWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/sample.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/sample.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/sampleTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/sampleTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/scan.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/scan.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/scanInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/scanInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/sequenceEqual.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/sequenceEqual.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/share.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/share.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/shareReplay.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/shareReplay.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/single.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/single.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skip.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skip.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skipLast.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skipLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skipUntil.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skipUntil.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skipWhile.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/skipWhile.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/startWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/startWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchScan.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/switchScan.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/take.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/take.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/takeLast.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/takeLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/takeUntil.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/takeUntil.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/tap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/tap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/throttle.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/throttle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/throttleTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/throttleTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/throwIfEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/throwIfEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timeInterval.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timeInterval.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timeout.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timeout.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timeoutWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timeoutWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timestamp.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/timestamp.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/toArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/toArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/window.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/window.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowCount.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowToggle.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowToggle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/windowWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/withLatestFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/withLatestFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/zip.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/zip.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/zipAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/zipAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/zipWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/operators/zipWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/Action.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/Action.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/QueueAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/QueueAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/QueueScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/QueueScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/VirtualTimeScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/VirtualTimeScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/asap.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/asap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/async.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/async.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/performanceTimestampProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/performanceTimestampProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/queue.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/queue.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/timerHandle.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/scheduler/timerHandle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/symbol/iterator.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/symbol/iterator.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/symbol/observable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/symbol/observable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/ColdObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/ColdObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/HotObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/HotObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/SubscriptionLog.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/SubscriptionLog.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/SubscriptionLoggable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/SubscriptionLoggable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/TestMessage.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/TestMessage.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/TestScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/testing/TestScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/types.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/types.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/umd.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/umd.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/ArgumentOutOfRangeError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/ArgumentOutOfRangeError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/EmptyError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/EmptyError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/Immediate.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/Immediate.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/NotFoundError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/NotFoundError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/SequenceError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/SequenceError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/applyMixins.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/applyMixins.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/args.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/args.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/argsOrArgArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/argsOrArgArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/arrRemove.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/arrRemove.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/createErrorClass.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/createErrorClass.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/createObject.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/createObject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/errorContext.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/errorContext.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/executeSchedule.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/executeSchedule.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/identity.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/identity.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isArrayLike.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isArrayLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isDate.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isDate.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isFunction.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isFunction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isPromise.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isPromise.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/isScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/lift.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/lift.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/noop.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/noop.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/not.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/not.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/pipe.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/pipe.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/subscribeToArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/subscribeToArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/workarounds.js delete mode 100644 dist/node_modules/rxjs/dist/esm/internal/util/workarounds.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/operators/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm/operators/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/testing/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm/testing/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm/webSocket/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm/webSocket/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/ajax/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/ajax/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/fetch/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/fetch/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/AnyCatcher.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/AnyCatcher.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/AsyncSubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/AsyncSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Notification.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Notification.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Observable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Operator.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Operator.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ReplaySubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ReplaySubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Scheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Scheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Subject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Subject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Subscription.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/AjaxResponse.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/AjaxResponse.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/ajax.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/ajax.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/errors.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/errors.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/getXHRResponse.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/getXHRResponse.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/types.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/ajax/types.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/config.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/config.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/lastValueFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/lastValueFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/ConnectableObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/ConnectableObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/bindCallback.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/bindCallback.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/bindCallbackInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/bindCallbackInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/bindNodeCallback.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/bindNodeCallback.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/concat.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/concat.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/connectable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/connectable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/defer.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/defer.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/WebSocketSubject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/WebSocketSubject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/animationFrames.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/animationFrames.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/fetch.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/fetch.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/webSocket.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/dom/webSocket.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/forkJoin.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/forkJoin.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/from.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/from.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/fromEventPattern.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/fromEventPattern.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/fromSubscribable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/fromSubscribable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/generate.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/generate.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/iif.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/iif.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/interval.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/interval.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/merge.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/merge.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/never.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/never.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/of.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/of.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/onErrorResumeNext.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/onErrorResumeNext.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/pairs.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/pairs.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/partition.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/partition.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/race.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/race.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/range.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/range.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/throwError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/throwError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/timer.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/timer.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/using.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/using.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/zip.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/observable/zip.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/audit.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/audit.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/auditTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/auditTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/buffer.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/buffer.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferCount.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferToggle.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferToggle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/bufferWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/catchError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/catchError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineLatest.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineLatest.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineLatestAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineLatestAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineLatestWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/combineLatestWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concat.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concat.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/concatWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/connect.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/connect.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/count.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/count.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/debounce.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/debounce.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/debounceTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/debounceTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/defaultIfEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/defaultIfEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/delay.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/delay.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/delayWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/delayWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/dematerialize.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/dematerialize.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/distinct.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/distinct.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilKeyChanged.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilKeyChanged.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/elementAt.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/elementAt.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/endWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/endWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/every.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/every.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/exhaust.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/exhaust.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/exhaustAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/exhaustAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/exhaustMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/exhaustMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/expand.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/expand.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/filter.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/filter.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/finalize.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/finalize.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/find.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/find.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/findIndex.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/findIndex.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/first.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/first.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/flatMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/flatMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/groupBy.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/groupBy.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/ignoreElements.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/ignoreElements.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/isEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/isEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/joinAllInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/joinAllInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/last.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/last.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/map.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/map.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/materialize.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/materialize.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/max.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/max.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/merge.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/merge.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeScan.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeScan.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/mergeWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/min.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/min.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/multicast.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/multicast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/onErrorResumeNextWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/onErrorResumeNextWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/pairwise.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/pairwise.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/partition.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/partition.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/pluck.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/pluck.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publish.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publish.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publishBehavior.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publishBehavior.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publishLast.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publishLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publishReplay.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/publishReplay.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/race.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/race.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/raceWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/raceWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/reduce.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/reduce.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/refCount.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/refCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/repeat.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/repeat.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/repeatWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/repeatWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/retry.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/retry.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/retryWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/retryWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/sample.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/sample.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/sampleTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/sampleTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/scan.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/scan.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/sequenceEqual.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/sequenceEqual.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/share.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/share.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/shareReplay.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/shareReplay.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/single.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/single.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skip.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skip.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skipLast.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skipLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skipUntil.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skipUntil.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skipWhile.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/skipWhile.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/startWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/startWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchMap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchMap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchMapTo.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchMapTo.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchScan.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/switchScan.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/take.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/take.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/takeLast.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/takeLast.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/takeWhile.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/takeWhile.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/tap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/tap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/throttle.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/throttle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/throttleTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/throttleTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/throwIfEmpty.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/throwIfEmpty.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timeInterval.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timeInterval.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timeout.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timeout.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timeoutWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timeoutWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timestamp.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/timestamp.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/toArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/toArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/window.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/window.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowCount.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowCount.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowTime.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowTime.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowToggle.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowToggle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowWhen.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/windowWhen.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/zip.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/zip.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/zipAll.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/zipAll.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/zipWith.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/operators/zipWith.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/QueueAction.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/QueueAction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/QueueScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/QueueScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/VirtualTimeScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/VirtualTimeScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/animationFrame.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/animationFrame.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/animationFrameProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/animationFrameProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/asap.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/asap.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/async.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/async.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/immediateProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/immediateProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/performanceTimestampProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/performanceTimestampProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/queue.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/queue.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/timerHandle.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/scheduler/timerHandle.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/ColdObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/ColdObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/HotObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/HotObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/SubscriptionLog.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/SubscriptionLog.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/SubscriptionLoggable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/SubscriptionLoggable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/TestMessage.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/TestMessage.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/TestScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/testing/TestScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/types.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/types.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/ArgumentOutOfRangeError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/ArgumentOutOfRangeError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/Immediate.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/Immediate.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/NotFoundError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/NotFoundError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/SequenceError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/SequenceError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/applyMixins.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/applyMixins.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/args.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/args.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/argsOrArgArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/argsOrArgArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/createObject.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/createObject.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/identity.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isDate.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isDate.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isIterable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isIterable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isObservable.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isObservable.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isPromise.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isPromise.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/lift.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/lift.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/noop.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/not.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/not.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/subscribeToArray.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/subscribeToArray.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/workarounds.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/internal/util/workarounds.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/operators/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/operators/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/testing/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/testing/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/esm5/webSocket/index.js delete mode 100644 dist/node_modules/rxjs/dist/esm5/webSocket/index.js.map delete mode 100644 dist/node_modules/rxjs/dist/types/ajax/index.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/ajax/index.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/fetch/index.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/fetch/index.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/index.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/index.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/AnyCatcher.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/AnyCatcher.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/AsyncSubject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/AsyncSubject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/BehaviorSubject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/BehaviorSubject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Notification.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Notification.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/NotificationFactories.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/NotificationFactories.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Observable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Observable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Operator.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Operator.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ReplaySubject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ReplaySubject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Scheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Scheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Subject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Subject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Subscriber.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Subscriber.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Subscription.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/Subscription.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/AjaxResponse.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/AjaxResponse.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/ajax.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/ajax.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/errors.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/errors.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/getXHRResponse.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/getXHRResponse.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/types.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/ajax/types.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/config.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/config.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/firstValueFrom.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/firstValueFrom.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/lastValueFrom.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/lastValueFrom.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/ConnectableObservable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/ConnectableObservable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/bindCallback.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/bindCallback.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/bindCallbackInternals.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/bindCallbackInternals.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/bindNodeCallback.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/bindNodeCallback.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/combineLatest.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/combineLatest.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/concat.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/concat.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/connectable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/connectable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/defer.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/defer.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/WebSocketSubject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/WebSocketSubject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/animationFrames.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/animationFrames.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/fetch.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/fetch.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/webSocket.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/dom/webSocket.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/empty.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/empty.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/forkJoin.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/forkJoin.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/from.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/from.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/fromEvent.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/fromEvent.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/fromEventPattern.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/fromEventPattern.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/fromSubscribable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/fromSubscribable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/generate.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/generate.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/iif.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/iif.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/innerFrom.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/innerFrom.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/interval.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/interval.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/merge.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/merge.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/never.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/never.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/of.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/of.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/onErrorResumeNext.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/onErrorResumeNext.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/pairs.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/pairs.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/partition.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/partition.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/race.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/race.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/range.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/range.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/throwError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/throwError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/timer.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/timer.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/using.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/using.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/zip.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/observable/zip.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/OperatorSubscriber.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/OperatorSubscriber.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/audit.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/audit.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/auditTime.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/auditTime.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/buffer.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/buffer.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferCount.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferCount.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferTime.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferTime.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferToggle.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferToggle.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferWhen.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/bufferWhen.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/catchError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/catchError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineLatest.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineLatest.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineLatestAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineLatestAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineLatestWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/combineLatestWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concat.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concat.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatMap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatMap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatMapTo.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatMapTo.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/concatWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/connect.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/connect.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/count.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/count.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/debounce.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/debounce.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/debounceTime.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/debounceTime.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/defaultIfEmpty.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/defaultIfEmpty.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/delay.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/delay.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/delayWhen.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/delayWhen.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/dematerialize.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/dematerialize.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/distinct.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/distinct.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/distinctUntilChanged.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/distinctUntilChanged.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/distinctUntilKeyChanged.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/distinctUntilKeyChanged.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/elementAt.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/elementAt.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/endWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/endWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/every.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/every.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/exhaust.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/exhaust.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/exhaustAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/exhaustAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/exhaustMap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/exhaustMap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/expand.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/expand.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/filter.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/filter.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/finalize.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/finalize.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/find.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/find.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/findIndex.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/findIndex.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/first.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/first.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/flatMap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/flatMap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/groupBy.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/groupBy.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/ignoreElements.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/ignoreElements.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/isEmpty.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/isEmpty.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/joinAllInternals.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/joinAllInternals.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/last.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/last.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/map.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/map.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mapTo.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mapTo.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/materialize.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/materialize.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/max.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/max.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/merge.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/merge.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeInternals.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeInternals.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeMap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeMap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeMapTo.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeMapTo.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeScan.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeScan.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/mergeWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/min.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/min.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/multicast.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/multicast.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/observeOn.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/observeOn.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/onErrorResumeNextWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/onErrorResumeNextWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/pairwise.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/pairwise.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/partition.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/partition.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/pluck.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/pluck.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publish.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publish.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publishBehavior.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publishBehavior.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publishLast.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publishLast.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publishReplay.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/publishReplay.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/race.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/race.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/raceWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/raceWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/reduce.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/reduce.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/refCount.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/refCount.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/repeat.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/repeat.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/repeatWhen.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/repeatWhen.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/retry.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/retry.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/retryWhen.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/retryWhen.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/sample.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/sample.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/sampleTime.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/sampleTime.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/scan.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/scan.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/scanInternals.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/scanInternals.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/sequenceEqual.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/sequenceEqual.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/share.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/share.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/shareReplay.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/shareReplay.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/single.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/single.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skip.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skip.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skipLast.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skipLast.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skipUntil.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skipUntil.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skipWhile.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/skipWhile.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/startWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/startWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/subscribeOn.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/subscribeOn.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchMap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchMap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchMapTo.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchMapTo.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchScan.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/switchScan.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/take.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/take.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/takeLast.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/takeLast.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/takeUntil.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/takeUntil.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/takeWhile.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/takeWhile.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/tap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/tap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/throttle.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/throttle.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/throttleTime.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/throttleTime.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/throwIfEmpty.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/throwIfEmpty.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timeInterval.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timeInterval.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timeout.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timeout.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timeoutWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timeoutWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timestamp.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/timestamp.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/toArray.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/toArray.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/window.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/window.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowCount.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowCount.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowTime.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowTime.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowToggle.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowToggle.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowWhen.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/windowWhen.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/withLatestFrom.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/withLatestFrom.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/zip.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/zip.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/zipAll.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/zipAll.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/zipWith.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/operators/zipWith.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleArray.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleArray.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleAsyncIterable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleAsyncIterable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleIterable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleIterable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleObservable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleObservable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/schedulePromise.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/schedulePromise.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleReadableStreamLike.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduleReadableStreamLike.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduled.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduled/scheduled.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/Action.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/Action.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AnimationFrameAction.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AnimationFrameAction.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AnimationFrameScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AnimationFrameScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsapAction.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsapAction.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsapScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsapScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsyncAction.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsyncAction.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsyncScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/AsyncScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/QueueAction.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/QueueAction.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/QueueScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/QueueScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/VirtualTimeScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/VirtualTimeScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/animationFrame.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/animationFrame.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/animationFrameProvider.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/animationFrameProvider.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/asap.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/asap.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/async.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/async.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/dateTimestampProvider.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/dateTimestampProvider.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/immediateProvider.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/immediateProvider.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/intervalProvider.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/intervalProvider.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/performanceTimestampProvider.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/performanceTimestampProvider.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/queue.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/queue.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/timeoutProvider.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/timeoutProvider.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/timerHandle.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/scheduler/timerHandle.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/symbol/iterator.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/symbol/iterator.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/symbol/observable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/symbol/observable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/ColdObservable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/ColdObservable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/HotObservable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/HotObservable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/SubscriptionLog.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/SubscriptionLog.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/SubscriptionLoggable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/SubscriptionLoggable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/TestMessage.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/TestMessage.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/TestScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/testing/TestScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/types.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/types.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/ArgumentOutOfRangeError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/ArgumentOutOfRangeError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/EmptyError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/EmptyError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/Immediate.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/Immediate.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/NotFoundError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/NotFoundError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/ObjectUnsubscribedError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/ObjectUnsubscribedError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/SequenceError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/SequenceError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/UnsubscriptionError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/UnsubscriptionError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/applyMixins.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/applyMixins.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/args.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/args.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/argsArgArrayOrObject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/argsArgArrayOrObject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/argsOrArgArray.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/argsOrArgArray.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/arrRemove.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/arrRemove.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/createErrorClass.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/createErrorClass.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/createObject.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/createObject.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/errorContext.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/errorContext.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/executeSchedule.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/executeSchedule.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/identity.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/identity.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isArrayLike.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isArrayLike.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isAsyncIterable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isAsyncIterable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isDate.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isDate.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isFunction.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isFunction.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isInteropObservable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isInteropObservable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isIterable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isIterable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isObservable.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isObservable.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isPromise.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isPromise.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isReadableStreamLike.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isReadableStreamLike.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isScheduler.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/isScheduler.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/lift.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/lift.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/mapOneOrManyArgs.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/mapOneOrManyArgs.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/noop.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/noop.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/not.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/not.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/pipe.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/pipe.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/reportUnhandledError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/reportUnhandledError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/subscribeToArray.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/subscribeToArray.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/throwUnobservableError.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/throwUnobservableError.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/workarounds.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/internal/util/workarounds.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/operators/index.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/operators/index.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/testing/index.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/testing/index.d.ts.map delete mode 100644 dist/node_modules/rxjs/dist/types/webSocket/index.d.ts delete mode 100644 dist/node_modules/rxjs/dist/types/webSocket/index.d.ts.map delete mode 100644 dist/node_modules/rxjs/fetch/package.json delete mode 100644 dist/node_modules/rxjs/operators/package.json delete mode 100644 dist/node_modules/rxjs/package.json delete mode 100644 dist/node_modules/rxjs/src/Rx.global.js delete mode 100644 dist/node_modules/rxjs/src/ajax/index.ts delete mode 100644 dist/node_modules/rxjs/src/fetch/index.ts delete mode 100644 dist/node_modules/rxjs/src/index.ts delete mode 100644 dist/node_modules/rxjs/src/internal/AnyCatcher.ts delete mode 100644 dist/node_modules/rxjs/src/internal/AsyncSubject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/BehaviorSubject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Notification.ts delete mode 100644 dist/node_modules/rxjs/src/internal/NotificationFactories.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Observable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Operator.ts delete mode 100644 dist/node_modules/rxjs/src/internal/ReplaySubject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Scheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Subject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Subscriber.ts delete mode 100644 dist/node_modules/rxjs/src/internal/Subscription.ts delete mode 100644 dist/node_modules/rxjs/src/internal/ajax/AjaxResponse.ts delete mode 100644 dist/node_modules/rxjs/src/internal/ajax/ajax.ts delete mode 100644 dist/node_modules/rxjs/src/internal/ajax/errors.ts delete mode 100644 dist/node_modules/rxjs/src/internal/ajax/getXHRResponse.ts delete mode 100644 dist/node_modules/rxjs/src/internal/ajax/types.ts delete mode 100644 dist/node_modules/rxjs/src/internal/config.ts delete mode 100644 dist/node_modules/rxjs/src/internal/firstValueFrom.ts delete mode 100644 dist/node_modules/rxjs/src/internal/lastValueFrom.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/ConnectableObservable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/bindCallback.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/bindCallbackInternals.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/bindNodeCallback.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/combineLatest.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/concat.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/connectable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/defer.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/dom/WebSocketSubject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/dom/animationFrames.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/dom/fetch.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/dom/webSocket.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/empty.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/forkJoin.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/from.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/fromEvent.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/fromEventPattern.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/fromSubscribable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/generate.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/iif.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/innerFrom.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/interval.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/merge.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/never.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/of.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/onErrorResumeNext.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/pairs.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/partition.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/race.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/range.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/throwError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/timer.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/using.ts delete mode 100644 dist/node_modules/rxjs/src/internal/observable/zip.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/audit.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/auditTime.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/buffer.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/bufferCount.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/bufferTime.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/bufferToggle.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/bufferWhen.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/catchError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/combineAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/combineLatest.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/combineLatestAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/combineLatestWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/concat.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/concatAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/concatMap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/concatMapTo.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/concatWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/connect.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/count.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/debounce.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/debounceTime.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/delay.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/delayWhen.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/dematerialize.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/distinct.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/elementAt.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/endWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/every.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/exhaust.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/exhaustAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/exhaustMap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/expand.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/filter.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/finalize.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/find.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/findIndex.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/first.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/flatMap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/groupBy.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/ignoreElements.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/isEmpty.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/joinAllInternals.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/last.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/map.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mapTo.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/materialize.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/max.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/merge.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mergeAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mergeInternals.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mergeMap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mergeMapTo.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mergeScan.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/mergeWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/min.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/multicast.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/observeOn.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/onErrorResumeNextWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/pairwise.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/partition.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/pluck.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/publish.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/publishBehavior.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/publishLast.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/publishReplay.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/race.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/raceWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/reduce.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/refCount.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/repeat.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/repeatWhen.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/retry.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/retryWhen.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/sample.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/sampleTime.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/scan.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/scanInternals.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/sequenceEqual.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/share.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/shareReplay.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/single.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/skip.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/skipLast.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/skipUntil.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/skipWhile.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/startWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/subscribeOn.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/switchAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/switchMap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/switchMapTo.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/switchScan.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/take.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/takeLast.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/takeUntil.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/takeWhile.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/tap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/throttle.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/throttleTime.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/throwIfEmpty.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/timeInterval.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/timeout.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/timeoutWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/timestamp.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/toArray.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/window.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/windowCount.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/windowTime.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/windowToggle.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/windowWhen.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/withLatestFrom.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/zip.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/zipAll.ts delete mode 100644 dist/node_modules/rxjs/src/internal/operators/zipWith.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/scheduleArray.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/schedulePromise.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduled/scheduled.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/Action.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/AsapAction.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/AsapScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/AsyncAction.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/QueueAction.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/animationFrame.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/asap.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/async.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/immediateProvider.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/intervalProvider.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/performanceTimestampProvider.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/queue.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts delete mode 100644 dist/node_modules/rxjs/src/internal/scheduler/timerHandle.ts delete mode 100644 dist/node_modules/rxjs/src/internal/symbol/iterator.ts delete mode 100644 dist/node_modules/rxjs/src/internal/symbol/observable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/testing/ColdObservable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/testing/HotObservable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/testing/SubscriptionLog.ts delete mode 100644 dist/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/testing/TestMessage.ts delete mode 100644 dist/node_modules/rxjs/src/internal/testing/TestScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/types.ts delete mode 100644 dist/node_modules/rxjs/src/internal/umd.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/EmptyError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/Immediate.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/NotFoundError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/SequenceError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/UnsubscriptionError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/applyMixins.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/args.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/argsOrArgArray.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/arrRemove.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/createErrorClass.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/createObject.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/errorContext.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/executeSchedule.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/identity.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isArrayLike.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isAsyncIterable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isDate.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isFunction.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isInteropObservable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isIterable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isObservable.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isPromise.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isReadableStreamLike.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/isScheduler.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/lift.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/noop.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/not.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/pipe.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/reportUnhandledError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/subscribeToArray.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/throwUnobservableError.ts delete mode 100644 dist/node_modules/rxjs/src/internal/util/workarounds.ts delete mode 100644 dist/node_modules/rxjs/src/operators/index.ts delete mode 100644 dist/node_modules/rxjs/src/testing/index.ts delete mode 100644 dist/node_modules/rxjs/src/tsconfig.base.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.cjs.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.cjs.spec.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.esm.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.esm5.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.esm5.rollup.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.types.json delete mode 100644 dist/node_modules/rxjs/src/tsconfig.types.spec.json delete mode 100644 dist/node_modules/rxjs/src/webSocket/index.ts delete mode 100644 dist/node_modules/rxjs/testing/package.json delete mode 100644 dist/node_modules/rxjs/tsconfig.json delete mode 100644 dist/node_modules/rxjs/webSocket/package.json create mode 100644 dist/node_modules/signal-exit/dist/cjs/browser.d.ts create mode 100644 dist/node_modules/signal-exit/dist/cjs/browser.d.ts.map create mode 100644 dist/node_modules/signal-exit/dist/cjs/browser.js create mode 100644 dist/node_modules/signal-exit/dist/cjs/browser.js.map create mode 100644 dist/node_modules/signal-exit/dist/cjs/index.d.ts create mode 100644 dist/node_modules/signal-exit/dist/cjs/index.d.ts.map create mode 100644 dist/node_modules/signal-exit/dist/cjs/index.js create mode 100644 dist/node_modules/signal-exit/dist/cjs/index.js.map create mode 100644 dist/node_modules/signal-exit/dist/cjs/package.json create mode 100644 dist/node_modules/signal-exit/dist/cjs/signals.d.ts create mode 100644 dist/node_modules/signal-exit/dist/cjs/signals.d.ts.map create mode 100644 dist/node_modules/signal-exit/dist/cjs/signals.js create mode 100644 dist/node_modules/signal-exit/dist/cjs/signals.js.map create mode 100644 dist/node_modules/signal-exit/dist/mjs/browser.d.ts create mode 100644 dist/node_modules/signal-exit/dist/mjs/browser.d.ts.map create mode 100644 dist/node_modules/signal-exit/dist/mjs/browser.js create mode 100644 dist/node_modules/signal-exit/dist/mjs/browser.js.map create mode 100644 dist/node_modules/signal-exit/dist/mjs/index.d.ts create mode 100644 dist/node_modules/signal-exit/dist/mjs/index.d.ts.map create mode 100644 dist/node_modules/signal-exit/dist/mjs/index.js create mode 100644 dist/node_modules/signal-exit/dist/mjs/index.js.map create mode 100644 dist/node_modules/signal-exit/dist/mjs/package.json create mode 100644 dist/node_modules/signal-exit/dist/mjs/signals.d.ts create mode 100644 dist/node_modules/signal-exit/dist/mjs/signals.d.ts.map create mode 100644 dist/node_modules/signal-exit/dist/mjs/signals.js create mode 100644 dist/node_modules/signal-exit/dist/mjs/signals.js.map delete mode 100644 dist/node_modules/signal-exit/index.js delete mode 100644 dist/node_modules/signal-exit/signals.js delete mode 100644 dist/node_modules/string_decoder/LICENSE delete mode 100644 dist/node_modules/string_decoder/README.md delete mode 100644 dist/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 dist/node_modules/string_decoder/package.json delete mode 100644 dist/node_modules/through/.travis.yml delete mode 100644 dist/node_modules/through/LICENSE.APACHE2 delete mode 100644 dist/node_modules/through/LICENSE.MIT delete mode 100644 dist/node_modules/through/index.js delete mode 100644 dist/node_modules/through/package.json delete mode 100644 dist/node_modules/through/readme.markdown delete mode 100644 dist/node_modules/through/test/async.js delete mode 100644 dist/node_modules/through/test/auto-destroy.js delete mode 100644 dist/node_modules/through/test/buffering.js delete mode 100644 dist/node_modules/through/test/end.js delete mode 100644 dist/node_modules/through/test/index.js delete mode 100644 dist/node_modules/trm-core/dist/actions/checkPackageDependencies/analizeDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkPackageDependencies/buildOutput.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkPackageDependencies/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkPackageDependencies/init.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkPackageDependencies/setSystemPackages.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkSapEntries/analizeSapEntries.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkSapEntries/buildOutput.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkSapEntries/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/checkSapEntries/init.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/exinstall.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/exinstall.js delete mode 100644 dist/node_modules/trm-core/dist/actions/exinstall.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/acknowledgementSize.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/deepCheckDependencies.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/deepCheckDependencies.js delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/deepCheckDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/init.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/parseSenvi.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/print.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/printDependencies.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/printDependencies.js delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/printDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/readPackageData.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/readPackageObjects.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/readRepositoryEnvironment.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setCircularDependencies.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setCircularDependencies.js delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setCircularDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setDependencies.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setDependencies.js delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setSystemPackages.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setTadirDependencies.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setTadirDependencies.js delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setTadirDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/findDependencies/setTrmDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkAlreadyInstalled.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkIntegrity.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkSapEntries.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkTadirContent.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkTadirObjectTypes.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/checkTransports.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/generateDevclass.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/generateWbTransport.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/importCustTransport.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/importLangTransport.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/importTadirTransport.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/init.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/installDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/readDevcTransport.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/setDevclass.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/setPackageIntegrity.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/setR3trans.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/install/setSystemPackages.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency.d.ts delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency.js delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/checkAlreadyInstalled.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/findInstallRelease.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/getRangeReleases.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/init.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/installRelease.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/installDependency/setSystemPackages.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/buildTrmPackageInstance.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/checkPackageExistance.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/checkPublishAllowed.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/editSapEntries.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/editTrmDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/finalizePublish.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/findDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/generateCustTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/generateDevcTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/generateLangTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/generateTadirTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/generateTrmArtifact.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/init.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/logDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/overwriteManifestValues.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/publishTrmArtifact.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/releaseCustTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/releaseDevcTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/releaseLangTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/releaseTadirTr.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setBackwardsCompatible.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setCustTransports.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setDevclass.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setDevclassObjs.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setManifestValues.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setPrivate.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setReadme.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setSapEntries.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setTransportTarget.js.map delete mode 100644 dist/node_modules/trm-core/dist/actions/publish/setTrmDependencies.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/IClient.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/RFCClient.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/ARBGB.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/AS4DATE.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/AS4TEXT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/AS4TIME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DDOPTION.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DDPOSITION.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DDSIGN.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DDTEXT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DEVCLASS.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DEVLAYER.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/DLVUNIT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/FIELDNAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/FILESYS_D.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/MSGNR.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/NATXT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/PACKAUTHOR.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/PARENTCL.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/PFEVALUE.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/PGMID.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/PNAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/RESPONSIBL.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/RS38L_FNAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SEU_OBJ.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SEU_OBJKEY.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SOBJ_NAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SO_TEXT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SPRAS.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SRCSYSTEM.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/SYCHAR512.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TABNAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TDFORMAT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TDLINE.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TMSSYSNAM.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TRFUNCTION.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TRKORR.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TROBJTYPE.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TROBJ_NAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TRPARFLAG.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/TR_TARGET.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/ZTRM_PACKAGE_INTEGRITY.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/ZTRM_PACKAGE_NAME.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/ZTRM_PACKAGE_REGISTRY.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/components/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/E070.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/E071.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/FILESYS.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/KO100.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/LXE_TT_PACKG_LINE.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/RFC_DB_FLD.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/RFC_DB_OPT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/SCOMPKDTLN.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/SENVI.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/STMSIQREQ.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/T100.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TAB512.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TADIR.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TDEVC.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TDEVCT.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TFDIR.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TLINE.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/TMSCSYS.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/ZTRM_INSTALLDEVC.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/ZTRM_INTEGRITY.js.map delete mode 100644 dist/node_modules/trm-core/dist/client/struct/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/LogTableStruct.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/PackageHierarchy.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/PackageName.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/fromAbapToDate.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/getFileSysSeparator.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/getPackageHierarchy.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/getPackageNamespace.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/getParentFromHierarchy.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/normalize.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/parsePackageName.js.map delete mode 100644 dist/node_modules/trm-core/dist/commons/validateOrganizationName.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/IParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/SenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/ClasSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/DtelSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/FugrSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/FuncSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/OmSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/ProgSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/TablSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/ViewSenviParser.js.map delete mode 100644 dist/node_modules/trm-core/dist/dependency/objects/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/CliInquirer.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/IInquirer.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/Inquirer.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/Question.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/validators/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/validators/validateDevclass.js.map delete mode 100644 dist/node_modules/trm-core/dist/inquirer/validators/validateTransportTarget.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/CliLogFileLogger.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/CliLogger.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/ConsoleLogger.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/DummyLogger.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/ILogger.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/JSONLog.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/Logger.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/TreeLog.js.map delete mode 100644 dist/node_modules/trm-core/dist/logger/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/manifest/Manifest.js.map delete mode 100644 dist/node_modules/trm-core/dist/manifest/TrmManifest.js.map delete mode 100644 dist/node_modules/trm-core/dist/manifest/TrmManifestAuthor.js.map delete mode 100644 dist/node_modules/trm-core/dist/manifest/TrmManifestDependency.js.map delete mode 100644 dist/node_modules/trm-core/dist/manifest/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/protocol/CallbackType.js.map delete mode 100644 dist/node_modules/trm-core/dist/protocol/Protocol.js.map delete mode 100644 dist/node_modules/trm-core/dist/protocol/callback.js.map delete mode 100644 dist/node_modules/trm-core/dist/protocol/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/registry/Registry.js.map delete mode 100644 dist/node_modules/trm-core/dist/registry/RegistryType.js.map delete mode 100644 dist/node_modules/trm-core/dist/registry/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/Connection.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/ISystemConnector.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/InstallPackage.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/Login.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/SapMessage.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/ServerSystemConnector.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/SystemConnector.js.map delete mode 100644 dist/node_modules/trm-core/dist/systemConnector/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/BinaryTransport.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/Documentation.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/FileNames.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/FilePaths.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/Transport.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/TransportContent.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/TrmTransportIdentifier.js.map delete mode 100644 dist/node_modules/trm-core/dist/transport/index.js.map delete mode 100644 dist/node_modules/trm-core/dist/trmPackage/TransportBinary.js.map delete mode 100644 dist/node_modules/trm-core/dist/trmPackage/TrmArtifact.js.map delete mode 100644 dist/node_modules/trm-core/dist/trmPackage/TrmPackage.js.map delete mode 100644 dist/node_modules/trm-core/dist/trmPackage/index.js.map delete mode 100644 dist/node_modules/tslib/CopyrightNotice.txt delete mode 100644 dist/node_modules/tslib/LICENSE.txt delete mode 100644 dist/node_modules/tslib/README.md delete mode 100644 dist/node_modules/tslib/SECURITY.md delete mode 100644 dist/node_modules/tslib/modules/index.d.ts delete mode 100644 dist/node_modules/tslib/modules/index.js delete mode 100644 dist/node_modules/tslib/modules/package.json delete mode 100644 dist/node_modules/tslib/package.json delete mode 100644 dist/node_modules/tslib/tslib.d.ts delete mode 100644 dist/node_modules/tslib/tslib.es6.html delete mode 100644 dist/node_modules/tslib/tslib.es6.js delete mode 100644 dist/node_modules/tslib/tslib.es6.mjs delete mode 100644 dist/node_modules/tslib/tslib.html delete mode 100644 dist/node_modules/tslib/tslib.js delete mode 100644 dist/node_modules/util-deprecate/History.md delete mode 100644 dist/node_modules/util-deprecate/browser.js delete mode 100644 dist/node_modules/util-deprecate/node.js delete mode 100644 dist/node_modules/util-deprecate/package.json delete mode 100644 dist/node_modules/wcwidth/.npmignore delete mode 100644 dist/node_modules/wcwidth/LICENSE delete mode 100644 dist/node_modules/wcwidth/Readme.md delete mode 100644 dist/node_modules/wcwidth/combining.js delete mode 100644 dist/node_modules/wcwidth/docs/index.md delete mode 100644 dist/node_modules/wcwidth/index.js delete mode 100644 dist/node_modules/wcwidth/package.json delete mode 100644 dist/node_modules/wcwidth/test/index.js create mode 100644 dist/node_modules/yoctocolors-cjs/index.d.ts create mode 100644 dist/node_modules/yoctocolors-cjs/index.js rename dist/node_modules/{figures => yoctocolors-cjs}/license (100%) create mode 100644 dist/node_modules/yoctocolors-cjs/package.json create mode 100644 dist/node_modules/yoctocolors-cjs/readme.md diff --git a/dist/node_modules/.package-lock.json b/dist/node_modules/.package-lock.json index b00c555..bd7493b 100644 --- a/dist/node_modules/.package-lock.json +++ b/dist/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "trm-action-publish", - "version": "2.1.3", + "version": "2.1.4", "lockfileVersion": 3, "requires": true, "packages": { @@ -150,6 +150,185 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@inquirer/checkbox": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-2.3.10.tgz", + "integrity": "sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/confirm": { + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.14.tgz", + "integrity": "sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.0.2.tgz", + "integrity": "sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==", + "dependencies": { + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "@types/mute-stream": "^0.0.4", + "@types/node": "^20.14.9", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "cli-spinners": "^2.9.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/editor": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-2.1.14.tgz", + "integrity": "sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "external-editor": "^3.1.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/expand": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-2.1.14.tgz", + "integrity": "sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.3.tgz", + "integrity": "sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/input": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-2.2.1.tgz", + "integrity": "sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/number": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-1.0.2.tgz", + "integrity": "sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/password": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-2.1.14.tgz", + "integrity": "sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/prompts": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-5.1.2.tgz", + "integrity": "sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==", + "dependencies": { + "@inquirer/checkbox": "^2.3.10", + "@inquirer/confirm": "^3.1.14", + "@inquirer/editor": "^2.1.14", + "@inquirer/expand": "^2.1.14", + "@inquirer/input": "^2.2.1", + "@inquirer/number": "^1.0.2", + "@inquirer/password": "^2.1.14", + "@inquirer/rawlist": "^2.1.14", + "@inquirer/select": "^2.3.10" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/rawlist": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-2.1.14.tgz", + "integrity": "sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/select": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-2.3.10.tgz", + "integrity": "sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.4.0.tgz", + "integrity": "sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==", + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@octokit/auth-token": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", @@ -396,15 +575,27 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/@types/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { - "version": "20.9.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.2.tgz", - "integrity": "sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==", - "dev": true, + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==" + }, "node_modules/@xmldom/xmldom": { "version": "0.8.10", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", @@ -523,16 +714,6 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -570,29 +751,6 @@ "concat-map": "0.0.1" } }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -634,17 +792,6 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/cli-progress": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", @@ -657,9 +804,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.1.tgz", - "integrity": "sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "engines": { "node": ">=6" }, @@ -682,19 +829,11 @@ } }, "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", "engines": { - "node": ">=0.8" + "node": ">= 12" } }, "node_modules/color-convert": { @@ -782,17 +921,6 @@ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, - "node_modules/defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/define-data-property": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", @@ -892,14 +1020,6 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -962,20 +1082,6 @@ "node": ">=4" } }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -1190,55 +1296,11 @@ "node": ">=0.10.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^6.0.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -1269,14 +1331,6 @@ "node": ">=8" } }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -1285,17 +1339,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -1359,21 +1402,6 @@ "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1436,14 +1464,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1461,9 +1481,12 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/ncp": { "version": "2.0.0", @@ -1587,20 +1610,6 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -1609,28 +1618,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -1739,47 +1726,6 @@ "node": ">= 0.8" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dependencies": { - "tslib": "^2.1.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1929,9 +1875,15 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/spdx-license-ids": { "version": "3.0.16", @@ -1965,14 +1917,6 @@ "node": ">= 0.8" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2008,11 +1952,6 @@ "node": ">=8" } }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" - }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -2038,11 +1977,12 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/trm-core": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/trm-core/-/trm-core-3.1.4.tgz", - "integrity": "sha512-qES0ILtDeEFIDc5CZ3oCjm3QEBeIHiMmSW1tzL9Z9yDJhASMGy33E1HDWICqq11Vojn/KLmpptyNGO1CZ+it4Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/trm-core/-/trm-core-4.0.5.tgz", + "integrity": "sha512-K0NkG9pFJWdYyFkTehKsWCY+C6VaG0LVgRKrMQiLXExg0tv8I+BHXqFPgHm1wL08SYvykYOJZrHu96SOj6tXkQ==", "dependencies": { "@esm2cjs/normalize-url": "^8.0.0", + "@inquirer/prompts": "^5.1.1", "@simonegaffurini/sammarksworkflow": "^1.3.2-fork", "adm-zip": "^0.5.10", "axios": "^1.4.0", @@ -2052,7 +1992,6 @@ "email-validator": "^2.0.4", "express": "^4.18.2", "get-stack-trace": "^3.1.1", - "inquirer": "^8.0.0", "loading-cli": "^1.1.0", "lodash": "^4.17.21", "node-r3trans": "^1.0.10", @@ -2088,11 +2027,6 @@ "resolved": "https://registry.npmjs.org/trm-registry-types/-/trm-registry-types-1.0.3.tgz", "integrity": "sha512-KVWVLC9kAcvaayzNxGuK1H52EEeokA9MkwAcmdbu6QvnJUVTb7v1NWkL4vw0EWPT2iF4w4u2TPHwG8t+SF0FPA==" }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -2138,8 +2072,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/universal-user-agent": { "version": "6.0.1", @@ -2154,11 +2087,6 @@ "node": ">= 0.8" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2183,14 +2111,6 @@ "node": ">= 0.8" } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -2264,6 +2184,17 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/dist/node_modules/inquirer/LICENSE b/dist/node_modules/@inquirer/checkbox/LICENSE similarity index 96% rename from dist/node_modules/inquirer/LICENSE rename to dist/node_modules/@inquirer/checkbox/LICENSE index bd2bfb8..6a10a8e 100644 --- a/dist/node_modules/inquirer/LICENSE +++ b/dist/node_modules/@inquirer/checkbox/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2022 Simon Boudrias +Copyright (c) 2023 Simon Boudrias Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/dist/node_modules/@inquirer/checkbox/README.md b/dist/node_modules/@inquirer/checkbox/README.md new file mode 100644 index 0000000..77fe5eb --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/README.md @@ -0,0 +1,110 @@ +# `@inquirer/checkbox` + +Simple interactive command line prompt to display a list of checkboxes (multi select). + +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/checkbox +``` + + + +```sh +yarn add @inquirer/checkbox +``` + +
+ +# Usage + +```js +import checkbox, { Separator } from '@inquirer/checkbox'; + +const answer = await checkbox({ + message: 'Select a package manager', + choices: [ + { name: 'npm', value: 'npm' }, + { name: 'yarn', value: 'yarn' }, + new Separator(), + { name: 'pnpm', value: 'pnpm', disabled: true }, + { + name: 'pnpm', + value: 'pnpm', + disabled: '(pnpm is not available)', + }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Array<{ value: string, name?: string, disabled?: boolean \| string, checked?: boolean } \| Separator>` | yes | List of the available choices. The `value` will be returned as the answer, and used as display if no `name` is defined. Choices who're `disabled` will be displayed, but not selectable. | +| pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. | +| loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. | +| required | `boolean` | no | When set to `true`, ensures at least one choice must be selected. | +| validate | `string\[\] => boolean \| string \| Promise` | no | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +The `Separator` object can be used to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options. + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + disabledChoice: (text: string) => string; + renderSelectedChoices: ( + selectedChoices: ReadonlyArray>, + allChoices: ReadonlyArray | Separator>, + ) => string; + }; + icon: { + checked: string; + unchecked: string; + cursor: string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +``` + +### `theme.helpMode` + +- `auto` (default): Hide the help tips after an interaction occurs. The scroll tip will hide after any interactions, the selection tip will hide as soon as a first selection is done. +- `always`: The help tips will always show and never hide. +- `never`: The help tips will never show. + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/checkbox/dist/cjs/index.js b/dist/node_modules/@inquirer/checkbox/dist/cjs/index.js new file mode 100644 index 0000000..0c93390 --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/dist/cjs/index.js @@ -0,0 +1,171 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Separator = void 0; +const core_1 = require("@inquirer/core"); +const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); +const figures_1 = __importDefault(require("@inquirer/figures")); +const ansi_escapes_1 = __importDefault(require("ansi-escapes")); +const checkboxTheme = { + icon: { + checked: yoctocolors_cjs_1.default.green(figures_1.default.circleFilled), + unchecked: figures_1.default.circle, + cursor: figures_1.default.pointer, + }, + style: { + disabledChoice: (text) => yoctocolors_cjs_1.default.dim(`- ${text}`), + renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.name || choice.value).join(', '), + }, + helpMode: 'auto', +}; +function isSelectable(item) { + return !core_1.Separator.isSeparator(item) && !item.disabled; +} +function isChecked(item) { + return isSelectable(item) && Boolean(item.checked); +} +function toggle(item) { + return isSelectable(item) ? Object.assign(Object.assign({}, item), { checked: !item.checked }) : item; +} +function check(checked) { + return function (item) { + return isSelectable(item) ? Object.assign(Object.assign({}, item), { checked }) : item; + }; +} +exports.default = (0, core_1.createPrompt)((config, done) => { + const { instructions, pageSize = 7, loop = true, choices, required, validate = () => true, } = config; + const theme = (0, core_1.makeTheme)(checkboxTheme, config.theme); + const prefix = (0, core_1.usePrefix)({ theme }); + const firstRender = (0, core_1.useRef)(true); + const [status, setStatus] = (0, core_1.useState)('pending'); + const [items, setItems] = (0, core_1.useState)(choices.map((choice) => (Object.assign({}, choice)))); + const bounds = (0, core_1.useMemo)(() => { + const first = items.findIndex(isSelectable); + const last = items.findLastIndex(isSelectable); + if (first < 0) { + throw new core_1.ValidationError('[checkbox prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [items]); + const [active, setActive] = (0, core_1.useState)(bounds.first); + const [showHelpTip, setShowHelpTip] = (0, core_1.useState)(true); + const [errorMsg, setError] = (0, core_1.useState)(); + (0, core_1.useKeypress)((key) => __awaiter(void 0, void 0, void 0, function* () { + if ((0, core_1.isEnterKey)(key)) { + const selection = items.filter(isChecked); + const isValid = yield validate([...selection]); + if (required && !items.some(isChecked)) { + setError('At least one choice must be selected'); + } + else if (isValid === true) { + setStatus('done'); + done(selection.map((choice) => choice.value)); + } + else { + setError(isValid || 'You must select a valid value'); + } + } + else if ((0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) { + if (loop || + ((0, core_1.isUpKey)(key) && active !== bounds.first) || + ((0, core_1.isDownKey)(key) && active !== bounds.last)) { + const offset = (0, core_1.isUpKey)(key) ? -1 : 1; + let next = active; + do { + next = (next + offset + items.length) % items.length; + } while (!isSelectable(items[next])); + setActive(next); + } + } + else if ((0, core_1.isSpaceKey)(key)) { + setError(undefined); + setShowHelpTip(false); + setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice))); + } + else if (key.name === 'a') { + const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked); + setItems(items.map(check(selectAll))); + } + else if (key.name === 'i') { + setItems(items.map(toggle)); + } + else if ((0, core_1.isNumberKey)(key)) { + // Adjust index to start at 1 + const position = Number(key.name) - 1; + const item = items[position]; + if (item != null && isSelectable(item)) { + setActive(position); + setItems(items.map((choice, i) => (i === position ? toggle(choice) : choice))); + } + } + })); + const message = theme.style.message(config.message); + const page = (0, core_1.usePagination)({ + items, + active, + renderItem({ item, isActive }) { + if (core_1.Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + const line = item.name || item.value; + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabledChoice(`${line} ${disabledLabel}`); + } + const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked; + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ' '; + return color(`${cursor}${checkbox} ${line}`); + }, + pageSize, + loop, + }); + if (status === 'done') { + const selection = items.filter(isChecked); + const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items)); + return `${prefix} ${message} ${answer}`; + } + let helpTipTop = ''; + let helpTipBottom = ''; + if (theme.helpMode === 'always' || + (theme.helpMode === 'auto' && + showHelpTip && + (instructions === undefined || instructions))) { + if (typeof instructions === 'string') { + helpTipTop = instructions; + } + else { + const keys = [ + `${theme.style.key('space')} to select`, + `${theme.style.key('a')} to toggle all`, + `${theme.style.key('i')} to invert selection`, + `and ${theme.style.key('enter')} to proceed`, + ]; + helpTipTop = ` (Press ${keys.join(', ')})`; + } + if (items.length > pageSize && + (theme.helpMode === 'always' || + (theme.helpMode === 'auto' && firstRender.current))) { + helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`; + firstRender.current = false; + } + } + let error = ''; + if (errorMsg) { + error = `\n${theme.style.error(errorMsg)}`; + } + return `${prefix} ${message}${helpTipTop}\n${page}${helpTipBottom}${error}${ansi_escapes_1.default.cursorHide}`; +}); +var core_2 = require("@inquirer/core"); +Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return core_2.Separator; } }); diff --git a/dist/node_modules/@inquirer/checkbox/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/checkbox/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..9f780c3 --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/dist/cjs/types/index.d.ts @@ -0,0 +1,35 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type CheckboxTheme = { + icon: { + checked: string; + unchecked: string; + cursor: string; + }; + style: { + disabledChoice: (text: string) => string; + renderSelectedChoices: (selectedChoices: ReadonlyArray>, allChoices: ReadonlyArray | Separator>) => string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +type Choice = { + name?: string; + value: Value; + disabled?: boolean | string; + checked?: boolean; + type?: never; +}; +type Item = Separator | Choice; +declare const _default: (config: { + message: string; + prefix?: string; + pageSize?: number; + instructions?: string | boolean; + choices: readonly (Separator | Choice)[]; + loop?: boolean; + required?: boolean; + validate?: ((items: readonly Item[]) => boolean | string | Promise) | undefined; + theme?: PartialDeep>; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/checkbox/dist/esm/index.mjs b/dist/node_modules/@inquirer/checkbox/dist/esm/index.mjs new file mode 100644 index 0000000..9ada541 --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/dist/esm/index.mjs @@ -0,0 +1,155 @@ +import { createPrompt, useState, useKeypress, usePrefix, usePagination, useRef, useMemo, makeTheme, isUpKey, isDownKey, isSpaceKey, isNumberKey, isEnterKey, ValidationError, Separator, } from '@inquirer/core'; +import colors from 'yoctocolors-cjs'; +import figures from '@inquirer/figures'; +import ansiEscapes from 'ansi-escapes'; +const checkboxTheme = { + icon: { + checked: colors.green(figures.circleFilled), + unchecked: figures.circle, + cursor: figures.pointer, + }, + style: { + disabledChoice: (text) => colors.dim(`- ${text}`), + renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.name || choice.value).join(', '), + }, + helpMode: 'auto', +}; +function isSelectable(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function isChecked(item) { + return isSelectable(item) && Boolean(item.checked); +} +function toggle(item) { + return isSelectable(item) ? { ...item, checked: !item.checked } : item; +} +function check(checked) { + return function (item) { + return isSelectable(item) ? { ...item, checked } : item; + }; +} +export default createPrompt((config, done) => { + const { instructions, pageSize = 7, loop = true, choices, required, validate = () => true, } = config; + const theme = makeTheme(checkboxTheme, config.theme); + const prefix = usePrefix({ theme }); + const firstRender = useRef(true); + const [status, setStatus] = useState('pending'); + const [items, setItems] = useState(choices.map((choice) => ({ ...choice }))); + const bounds = useMemo(() => { + const first = items.findIndex(isSelectable); + const last = items.findLastIndex(isSelectable); + if (first < 0) { + throw new ValidationError('[checkbox prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [items]); + const [active, setActive] = useState(bounds.first); + const [showHelpTip, setShowHelpTip] = useState(true); + const [errorMsg, setError] = useState(); + useKeypress(async (key) => { + if (isEnterKey(key)) { + const selection = items.filter(isChecked); + const isValid = await validate([...selection]); + if (required && !items.some(isChecked)) { + setError('At least one choice must be selected'); + } + else if (isValid === true) { + setStatus('done'); + done(selection.map((choice) => choice.value)); + } + else { + setError(isValid || 'You must select a valid value'); + } + } + else if (isUpKey(key) || isDownKey(key)) { + if (loop || + (isUpKey(key) && active !== bounds.first) || + (isDownKey(key) && active !== bounds.last)) { + const offset = isUpKey(key) ? -1 : 1; + let next = active; + do { + next = (next + offset + items.length) % items.length; + } while (!isSelectable(items[next])); + setActive(next); + } + } + else if (isSpaceKey(key)) { + setError(undefined); + setShowHelpTip(false); + setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice))); + } + else if (key.name === 'a') { + const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked); + setItems(items.map(check(selectAll))); + } + else if (key.name === 'i') { + setItems(items.map(toggle)); + } + else if (isNumberKey(key)) { + // Adjust index to start at 1 + const position = Number(key.name) - 1; + const item = items[position]; + if (item != null && isSelectable(item)) { + setActive(position); + setItems(items.map((choice, i) => (i === position ? toggle(choice) : choice))); + } + } + }); + const message = theme.style.message(config.message); + const page = usePagination({ + items, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + const line = item.name || item.value; + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabledChoice(`${line} ${disabledLabel}`); + } + const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked; + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ' '; + return color(`${cursor}${checkbox} ${line}`); + }, + pageSize, + loop, + }); + if (status === 'done') { + const selection = items.filter(isChecked); + const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items)); + return `${prefix} ${message} ${answer}`; + } + let helpTipTop = ''; + let helpTipBottom = ''; + if (theme.helpMode === 'always' || + (theme.helpMode === 'auto' && + showHelpTip && + (instructions === undefined || instructions))) { + if (typeof instructions === 'string') { + helpTipTop = instructions; + } + else { + const keys = [ + `${theme.style.key('space')} to select`, + `${theme.style.key('a')} to toggle all`, + `${theme.style.key('i')} to invert selection`, + `and ${theme.style.key('enter')} to proceed`, + ]; + helpTipTop = ` (Press ${keys.join(', ')})`; + } + if (items.length > pageSize && + (theme.helpMode === 'always' || + (theme.helpMode === 'auto' && firstRender.current))) { + helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`; + firstRender.current = false; + } + } + let error = ''; + if (errorMsg) { + error = `\n${theme.style.error(errorMsg)}`; + } + return `${prefix} ${message}${helpTipTop}\n${page}${helpTipBottom}${error}${ansiEscapes.cursorHide}`; +}); +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/checkbox/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/checkbox/dist/esm/types/index.d.mts new file mode 100644 index 0000000..9f780c3 --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/dist/esm/types/index.d.mts @@ -0,0 +1,35 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type CheckboxTheme = { + icon: { + checked: string; + unchecked: string; + cursor: string; + }; + style: { + disabledChoice: (text: string) => string; + renderSelectedChoices: (selectedChoices: ReadonlyArray>, allChoices: ReadonlyArray | Separator>) => string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +type Choice = { + name?: string; + value: Value; + disabled?: boolean | string; + checked?: boolean; + type?: never; +}; +type Item = Separator | Choice; +declare const _default: (config: { + message: string; + prefix?: string; + pageSize?: number; + instructions?: string | boolean; + choices: readonly (Separator | Choice)[]; + loop?: boolean; + required?: boolean; + validate?: ((items: readonly Item[]) => boolean | string | Promise) | undefined; + theme?: PartialDeep>; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/checkbox/dist/types/index.d.ts b/dist/node_modules/@inquirer/checkbox/dist/types/index.d.ts new file mode 100644 index 0000000..9f780c3 --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/dist/types/index.d.ts @@ -0,0 +1,35 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type CheckboxTheme = { + icon: { + checked: string; + unchecked: string; + cursor: string; + }; + style: { + disabledChoice: (text: string) => string; + renderSelectedChoices: (selectedChoices: ReadonlyArray>, allChoices: ReadonlyArray | Separator>) => string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +type Choice = { + name?: string; + value: Value; + disabled?: boolean | string; + checked?: boolean; + type?: never; +}; +type Item = Separator | Choice; +declare const _default: (config: { + message: string; + prefix?: string; + pageSize?: number; + instructions?: string | boolean; + choices: readonly (Separator | Choice)[]; + loop?: boolean; + required?: boolean; + validate?: ((items: readonly Item[]) => boolean | string | Promise) | undefined; + theme?: PartialDeep>; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/checkbox/package.json b/dist/node_modules/@inquirer/checkbox/package.json new file mode 100644 index 0000000..2f75412 --- /dev/null +++ b/dist/node_modules/@inquirer/checkbox/package.json @@ -0,0 +1,93 @@ +{ + "name": "@inquirer/checkbox", + "version": "2.3.10", + "engines": { + "node": ">=18" + }, + "description": "Inquirer checkbox prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/checkbox/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/util-deprecate/LICENSE b/dist/node_modules/@inquirer/confirm/LICENSE similarity index 92% rename from dist/node_modules/util-deprecate/LICENSE rename to dist/node_modules/@inquirer/confirm/LICENSE index 6a60e8c..6a10a8e 100644 --- a/dist/node_modules/util-deprecate/LICENSE +++ b/dist/node_modules/@inquirer/confirm/LICENSE @@ -1,6 +1,4 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich +Copyright (c) 2023 Simon Boudrias Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/dist/node_modules/@inquirer/confirm/README.md b/dist/node_modules/@inquirer/confirm/README.md new file mode 100644 index 0000000..bc589e8 --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/README.md @@ -0,0 +1,71 @@ +# `@inquirer/confirm` + +Simple interactive command line prompt to gather boolean input from users. + +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/confirm +``` + + + +```sh +yarn add @inquirer/confirm +``` + +
+ +# Usage + +```js +import confirm from '@inquirer/confirm'; + +const answer = await confirm({ message: 'Continue?' }); +``` + +## Options + +| Property | Type | Required | Description | +| ----------- | ----------------------- | -------- | ------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `boolean` | no | Default answer (true or false) | +| transformer | `(boolean) => string` | no | Transform the prompt printed message to a custom string | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + defaultAnswer: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/confirm/dist/cjs/index.js b/dist/node_modules/@inquirer/confirm/dist/cjs/index.js new file mode 100644 index 0000000..08874ff --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/dist/cjs/index.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("@inquirer/core"); +exports.default = (0, core_1.createPrompt)((config, done) => { + const { transformer = (answer) => (answer ? 'yes' : 'no') } = config; + const [status, setStatus] = (0, core_1.useState)('pending'); + const [value, setValue] = (0, core_1.useState)(''); + const theme = (0, core_1.makeTheme)(config.theme); + const prefix = (0, core_1.usePrefix)({ theme }); + (0, core_1.useKeypress)((key, rl) => { + if ((0, core_1.isEnterKey)(key)) { + let answer = config.default !== false; + if (/^(y|yes)/i.test(value)) + answer = true; + else if (/^(n|no)/i.test(value)) + answer = false; + setValue(transformer(answer)); + setStatus('done'); + done(answer); + } + else { + setValue(rl.line); + } + }); + let formattedValue = value; + let defaultValue = ''; + if (status === 'done') { + formattedValue = theme.style.answer(value); + } + else { + defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? 'y/N' : 'Y/n')}`; + } + const message = theme.style.message(config.message); + return `${prefix} ${message}${defaultValue} ${formattedValue}`; +}); diff --git a/dist/node_modules/@inquirer/confirm/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/confirm/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..d3d323a --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/dist/cjs/types/index.d.ts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ConfirmConfig = { + message: string; + default?: boolean; + transformer?: (value: boolean) => string; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/confirm/dist/esm/index.mjs b/dist/node_modules/@inquirer/confirm/dist/esm/index.mjs new file mode 100644 index 0000000..6e5058b --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/dist/esm/index.mjs @@ -0,0 +1,33 @@ +import { createPrompt, useState, useKeypress, isEnterKey, usePrefix, makeTheme, } from '@inquirer/core'; +export default createPrompt((config, done) => { + const { transformer = (answer) => (answer ? 'yes' : 'no') } = config; + const [status, setStatus] = useState('pending'); + const [value, setValue] = useState(''); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ theme }); + useKeypress((key, rl) => { + if (isEnterKey(key)) { + let answer = config.default !== false; + if (/^(y|yes)/i.test(value)) + answer = true; + else if (/^(n|no)/i.test(value)) + answer = false; + setValue(transformer(answer)); + setStatus('done'); + done(answer); + } + else { + setValue(rl.line); + } + }); + let formattedValue = value; + let defaultValue = ''; + if (status === 'done') { + formattedValue = theme.style.answer(value); + } + else { + defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? 'y/N' : 'Y/n')}`; + } + const message = theme.style.message(config.message); + return `${prefix} ${message}${defaultValue} ${formattedValue}`; +}); diff --git a/dist/node_modules/@inquirer/confirm/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/confirm/dist/esm/types/index.d.mts new file mode 100644 index 0000000..d3d323a --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/dist/esm/types/index.d.mts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ConfirmConfig = { + message: string; + default?: boolean; + transformer?: (value: boolean) => string; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/confirm/dist/types/index.d.ts b/dist/node_modules/@inquirer/confirm/dist/types/index.d.ts new file mode 100644 index 0000000..d3d323a --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/dist/types/index.d.ts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ConfirmConfig = { + message: string; + default?: boolean; + transformer?: (value: boolean) => string; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/confirm/package.json b/dist/node_modules/@inquirer/confirm/package.json new file mode 100644 index 0000000..854e13f --- /dev/null +++ b/dist/node_modules/@inquirer/confirm/package.json @@ -0,0 +1,90 @@ +{ + "name": "@inquirer/confirm", + "version": "3.1.14", + "description": "Inquirer confirm prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/confirm/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/util-deprecate/README.md b/dist/node_modules/@inquirer/core/LICENSE similarity index 61% rename from dist/node_modules/util-deprecate/README.md rename to dist/node_modules/@inquirer/core/LICENSE index 75622fa..6a10a8e 100644 --- a/dist/node_modules/util-deprecate/README.md +++ b/dist/node_modules/@inquirer/core/LICENSE @@ -1,35 +1,4 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich +Copyright (c) 2023 Simon Boudrias Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/dist/node_modules/@inquirer/core/README.md b/dist/node_modules/@inquirer/core/README.md new file mode 100644 index 0000000..ba28701 --- /dev/null +++ b/dist/node_modules/@inquirer/core/README.md @@ -0,0 +1,239 @@ +# `@inquirer/core` + +The `@inquirer/core` package is the library enabling the creation of Inquirer prompts. + +It aims to implements a lightweight API similar to React hooks - but without JSX. + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/core +``` + + + +```sh +yarn add @inquirer/core +``` + +
+ +# Usage + +```ts +import colors from 'yoctocolors'; +import { + createPrompt, + useState, + useKeypress, + isEnterKey, + usePrefix, +} from '@inquirer/core'; + +const confirm = createPrompt( + (config, done) => { + const [status, setStatus] = useState('pending'); + const [value, setValue] = useState(''); + const prefix = usePrefix({}); + + useKeypress((key, rl) => { + if (isEnterKey(key)) { + const answer = value ? /^y(es)?/i.test(value) : config.default !== false; + setValue(answer ? 'yes' : 'no'); + setStatus('done'); + done(answer); + } else { + setValue(rl.line); + } + }); + + let formattedValue = value; + let defaultValue = ''; + if (status === 'done') { + formattedValue = colors.cyan(value); + } else { + defaultValue = colors.dim(config.default === false ? ' (y/N)' : ' (Y/n)'); + } + + const message = colors.bold(config.message); + return `${prefix} ${message}${defaultValue} ${formattedValue}`; + }, +); + +/** + * Which then can be used like this: + */ +const answer = await confirm({ message: 'Do you want to continue?' }); +``` + +See more examples: + +- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/confirm/src/index.mts) +- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/input/src/index.mts) +- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/password/src/index.mts) +- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/editor/src/index.mts) +- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/select/src/index.mts) +- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/checkbox/src/index.mts) +- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/rawlist/src/index.mts) +- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/expand/src/index.mts) + +## API + +### `createPrompt(viewFn)` + +The `createPrompt` function returns an asynchronous function that returns a cancelable promise resolving to the valid answer a user submit. This prompt function takes the prompt configuration as its first argument (this is defined by each prompt), and the context options as a second argument. + +The prompt configuration is unique to each prompt. The context options are: + +| Property | Type | Required | Description | +| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ | +| input | `NodeJS.ReadableStream` | no | The stdin stream (defaults to `process.stdin`) | +| output | `NodeJS.WritableStream` | no | The stdout stream (defaults to `process.stdout`) | +| clearPromptOnDone | `boolean` | no | If true, we'll clear the screen after the prompt is answered | + +The cancelable promise exposes a `cancel` method that'll exit the prompt and reject the promise. + +#### Typescript + +If using typescript, `createPrompt` takes 2 generic arguments (ex `createPrompt()`) + +The first one is the type of the resolved value; `function createPrompt(): Promise {}` + +The second one is the type of the prompt config; in other words the interface the created prompt will provide to users. + +### Hooks + +Hooks can only be called within the prompt function and are used to handle state and events. + +Those hooks are matching the React hooks API: + +- `useState` +- `useRef` +- `useEffect` +- `useMemo` + +And those are custom utilities from Inquirer: + +- `useKeypress` +- `usePagination` +- `usePrefix` + +### Key utilities + +Listening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean: + +- `isEnterKey()` +- `isBackspaceKey()` +- `isSpaceKey()` +- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`) +- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`) +- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 + +### `usePagination` + +When looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options. + +Pagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`. + +```js +export default createPrompt((config, done) => { + const [active, setActive] = useState(0); + + const allChoices = config.choices.map((choice) => choice.name); + + const page = usePagination({ + items: allChoices, + active: active, + renderItem: ({ item, index, isActive }) => `${isActive ? ">" : " "}${index}. ${item.toString()}` + pageSize: config.pageSize, + loop: config.loop, + }); + + return `... ${page}`; +}); +``` + +### Theming + +Theming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts. + +To allow standard customization: + +```ts +import { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; + +type PromptConfig = { + theme?: PartialDeep; +}; + +export default createPrompt((config, done) => { + const theme = makeTheme(config.theme); + + const prefix = usePrefix({ isLoading, theme }); + + return `${prefix} ${theme.style.highlight('hello')}`; +}); +``` + +To setup a custom theme: + +```ts +import { createPrompt, makeTheme, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; + +type PromptTheme = {}; + +const promptTheme: PromptTheme = { + icon: '!', +}; + +type PromptConfig = { + theme?: PartialDeep>; +}; + +export default createPrompt((config, done) => { + const theme = makeTheme(promptTheme, config.theme); + + const prefix = usePrefix({ isLoading, theme }); + + return `${prefix} ${theme.icon}`; +}); +``` + +The [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/theme/packages/core/src/lib/theme.mts): + +```ts +type DefaultTheme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/core/dist/cjs/index.js b/dist/node_modules/@inquirer/core/dist/cjs/index.js new file mode 100644 index 0000000..1196a96 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/index.js @@ -0,0 +1,39 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Separator = exports.createPrompt = exports.usePagination = exports.makeTheme = exports.useKeypress = exports.useRef = exports.useMemo = exports.useEffect = exports.useState = exports.usePrefix = void 0; +__exportStar(require('./lib/key.js'), exports); +__exportStar(require('./lib/errors.js'), exports); +var use_prefix_mjs_1 = require('./lib/use-prefix.js'); +Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return use_prefix_mjs_1.usePrefix; } }); +var use_state_mjs_1 = require('./lib/use-state.js'); +Object.defineProperty(exports, "useState", { enumerable: true, get: function () { return use_state_mjs_1.useState; } }); +var use_effect_mjs_1 = require('./lib/use-effect.js'); +Object.defineProperty(exports, "useEffect", { enumerable: true, get: function () { return use_effect_mjs_1.useEffect; } }); +var use_memo_mjs_1 = require('./lib/use-memo.js'); +Object.defineProperty(exports, "useMemo", { enumerable: true, get: function () { return use_memo_mjs_1.useMemo; } }); +var use_ref_mjs_1 = require('./lib/use-ref.js'); +Object.defineProperty(exports, "useRef", { enumerable: true, get: function () { return use_ref_mjs_1.useRef; } }); +var use_keypress_mjs_1 = require('./lib/use-keypress.js'); +Object.defineProperty(exports, "useKeypress", { enumerable: true, get: function () { return use_keypress_mjs_1.useKeypress; } }); +var make_theme_mjs_1 = require('./lib/make-theme.js'); +Object.defineProperty(exports, "makeTheme", { enumerable: true, get: function () { return make_theme_mjs_1.makeTheme; } }); +var use_pagination_mjs_1 = require('./lib/pagination/use-pagination.js'); +Object.defineProperty(exports, "usePagination", { enumerable: true, get: function () { return use_pagination_mjs_1.usePagination; } }); +var create_prompt_mjs_1 = require('./lib/create-prompt.js'); +Object.defineProperty(exports, "createPrompt", { enumerable: true, get: function () { return create_prompt_mjs_1.createPrompt; } }); +var Separator_mjs_1 = require('./lib/Separator.js'); +Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return Separator_mjs_1.Separator; } }); diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/Separator.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/Separator.js new file mode 100644 index 0000000..fd578b0 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/Separator.js @@ -0,0 +1,35 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Separator = void 0; +const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); +const figures_1 = __importDefault(require("@inquirer/figures")); +/** + * Separator object + * Used to space/separate choices group + */ +class Separator { + constructor(separator) { + Object.defineProperty(this, "separator", { + enumerable: true, + configurable: true, + writable: true, + value: yoctocolors_cjs_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line)) + }); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 'separator' + }); + if (separator) { + this.separator = separator; + } + } + static isSeparator(choice) { + return Boolean(choice && choice.type === 'separator'); + } +} +exports.Separator = Separator; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js new file mode 100644 index 0000000..4e8e107 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js @@ -0,0 +1,118 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createPrompt = createPrompt; +const readline = __importStar(require("node:readline")); +const type_1 = require("@inquirer/type"); +const mute_stream_1 = __importDefault(require("mute-stream")); +const signal_exit_1 = require("signal-exit"); +const screen_manager_mjs_1 = __importDefault(require('./screen-manager.js')); +const hook_engine_mjs_1 = require('./hook-engine.js'); +const errors_mjs_1 = require('./errors.js'); +function createPrompt(view) { + const prompt = (config, context) => { + var _a, _b; + // Default `input` to stdin + const input = (_a = context === null || context === void 0 ? void 0 : context.input) !== null && _a !== void 0 ? _a : process.stdin; + // Add mute capabilities to the output + const output = new mute_stream_1.default(); + output.pipe((_b = context === null || context === void 0 ? void 0 : context.output) !== null && _b !== void 0 ? _b : process.stdout); + const rl = readline.createInterface({ + terminal: true, + input, + output, + }); + const screen = new screen_manager_mjs_1.default(rl); + let cancel = () => { }; + const answer = new type_1.CancelablePromise((resolve, reject) => { + (0, hook_engine_mjs_1.withHooks)(rl, (store) => { + function checkCursorPos() { + screen.checkCursorPos(); + } + const removeExitListener = (0, signal_exit_1.onExit)((code, signal) => { + onExit(); + reject(new errors_mjs_1.ExitPromptError(`User force closed the prompt with ${code} ${signal}`)); + }); + function onExit() { + try { + store.hooksCleanup.forEach((cleanFn) => { + cleanFn === null || cleanFn === void 0 ? void 0 : cleanFn(); + }); + } + catch (error) { + reject(error); + } + if (context === null || context === void 0 ? void 0 : context.clearPromptOnDone) { + screen.clean(); + } + else { + screen.clearContent(); + } + screen.done(); + removeExitListener(); + store.rl.input.removeListener('keypress', checkCursorPos); + } + cancel = () => { + onExit(); + reject(new errors_mjs_1.CancelPromptError()); + }; + function done(value) { + // Delay execution to let time to the hookCleanup functions to registers. + setImmediate(() => { + onExit(); + // Finally we resolve our promise + resolve(value); + }); + } + function workLoop() { + store.index = 0; + try { + const nextView = view(config, done); + const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView; + screen.render(content, bottomContent); + hook_engine_mjs_1.effectScheduler.run(); + } + catch (error) { + onExit(); + reject(error); + } + } + store.handleChange = () => workLoop(); + workLoop(); + // Re-renders only happen when the state change; but the readline cursor could change position + // and that also requires a re-render (and a manual one because we mute the streams). + // We set the listener after the initial workLoop to avoid a double render if render triggered + // by a state change sets the cursor to the right position. + store.rl.input.on('keypress', checkCursorPos); + }); + }); + answer.cancel = cancel; + return answer; + }; + return prompt; +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/errors.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/errors.js new file mode 100644 index 0000000..1df5b82 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/errors.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidationError = exports.HookError = exports.ExitPromptError = exports.CancelPromptError = void 0; +class CancelPromptError extends Error { + constructor() { + super(...arguments); + Object.defineProperty(this, "message", { + enumerable: true, + configurable: true, + writable: true, + value: 'Prompt was canceled' + }); + } +} +exports.CancelPromptError = CancelPromptError; +class ExitPromptError extends Error { +} +exports.ExitPromptError = ExitPromptError; +class HookError extends Error { +} +exports.HookError = HookError; +class ValidationError extends Error { +} +exports.ValidationError = ValidationError; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/hook-engine.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/hook-engine.js new file mode 100644 index 0000000..0e03edf --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/hook-engine.js @@ -0,0 +1,104 @@ +"use strict"; +/* eslint @typescript-eslint/no-explicit-any: ["off"] */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.effectScheduler = void 0; +exports.withHooks = withHooks; +exports.readline = readline; +exports.withUpdates = withUpdates; +exports.withPointer = withPointer; +exports.handleChange = handleChange; +const node_async_hooks_1 = require("node:async_hooks"); +const errors_mjs_1 = require('./errors.js'); +const hookStorage = new node_async_hooks_1.AsyncLocalStorage(); +function createStore(rl) { + const store = { + rl, + hooks: [], + hooksCleanup: [], + hooksEffect: [], + index: 0, + handleChange() { }, + }; + return store; +} +// Run callback in with the hook engine setup. +function withHooks(rl, cb) { + const store = createStore(rl); + return hookStorage.run(store, () => { + cb(store); + }); +} +// Safe getStore utility that'll return the store or throw if undefined. +function getStore() { + const store = hookStorage.getStore(); + if (!store) { + throw new errors_mjs_1.HookError('[Inquirer] Hook functions can only be called from within a prompt'); + } + return store; +} +function readline() { + return getStore().rl; +} +// Merge state updates happening within the callback function to avoid multiple renders. +function withUpdates(fn) { + const wrapped = (...args) => { + const store = getStore(); + let shouldUpdate = false; + const oldHandleChange = store.handleChange; + store.handleChange = () => { + shouldUpdate = true; + }; + const returnValue = fn(...args); + if (shouldUpdate) { + oldHandleChange(); + } + store.handleChange = oldHandleChange; + return returnValue; + }; + return node_async_hooks_1.AsyncResource.bind(wrapped); +} +function withPointer(cb) { + const store = getStore(); + const { index } = store; + const pointer = { + get() { + return store.hooks[index]; + }, + set(value) { + store.hooks[index] = value; + }, + initialized: index in store.hooks, + }; + const returnValue = cb(pointer); + store.index++; + return returnValue; +} +function handleChange() { + getStore().handleChange(); +} +exports.effectScheduler = { + queue(cb) { + const store = getStore(); + const { index } = store; + store.hooksEffect.push(() => { + var _a, _b; + (_b = (_a = store.hooksCleanup)[index]) === null || _b === void 0 ? void 0 : _b.call(_a); + const cleanFn = cb(readline()); + if (cleanFn != null && typeof cleanFn !== 'function') { + throw new errors_mjs_1.ValidationError('useEffect return value must be a cleanup function or nothing.'); + } + store.hooksCleanup[index] = cleanFn; + }); + }, + run() { + const store = getStore(); + withUpdates(() => { + store.hooksEffect.forEach((effect) => { + effect(); + }); + // Warning: Clean the hooks before exiting the `withUpdates` block. + // Failure to do so means an updates would hit the same effects again. + store.hooksEffect.length = 0; + })(); + }, +}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/key.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/key.js new file mode 100644 index 0000000..a6c0c20 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/key.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEnterKey = exports.isNumberKey = exports.isBackspaceKey = exports.isSpaceKey = exports.isDownKey = exports.isUpKey = void 0; +const isUpKey = (key) => +// The up key +key.name === 'up' || + // Vim keybinding + key.name === 'k' || + // Emacs keybinding + (key.ctrl && key.name === 'p'); +exports.isUpKey = isUpKey; +const isDownKey = (key) => +// The down key +key.name === 'down' || + // Vim keybinding + key.name === 'j' || + // Emacs keybinding + (key.ctrl && key.name === 'n'); +exports.isDownKey = isDownKey; +const isSpaceKey = (key) => key.name === 'space'; +exports.isSpaceKey = isSpaceKey; +const isBackspaceKey = (key) => key.name === 'backspace'; +exports.isBackspaceKey = isBackspaceKey; +const isNumberKey = (key) => '123456789'.includes(key.name); +exports.isNumberKey = isNumberKey; +const isEnterKey = (key) => key.name === 'enter' || key.name === 'return'; +exports.isEnterKey = isEnterKey; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/make-theme.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/make-theme.js new file mode 100644 index 0000000..936463d --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/make-theme.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeTheme = makeTheme; +const theme_mjs_1 = require('./theme.js'); +function isPlainObject(value) { + if (typeof value !== 'object' || value === null) + return false; + let proto = value; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + return Object.getPrototypeOf(value) === proto; +} +function deepMerge(...objects) { + const output = {}; + for (const obj of objects) { + for (const [key, value] of Object.entries(obj)) { + const prevValue = output[key]; + output[key] = + isPlainObject(prevValue) && isPlainObject(value) + ? deepMerge(prevValue, value) + : value; + } + } + return output; +} +function makeTheme(...themes) { + const themesToMerge = [ + theme_mjs_1.defaultTheme, + ...themes.filter((theme) => theme != null), + ]; + return deepMerge(...themesToMerge); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/lines.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/lines.js new file mode 100644 index 0000000..08a6137 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/lines.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lines = lines; +const utils_mjs_1 = require('../utils.js'); +function split(content, width) { + return (0, utils_mjs_1.breakLines)(content, width).split('\n'); +} +/** + * Rotates an array of items by an integer number of positions. + * @param {number} count The number of positions to rotate by + * @param {T[]} items The items to rotate + */ +function rotate(count, items) { + const max = items.length; + const offset = ((count % max) + max) % max; + return [...items.slice(offset), ...items.slice(0, offset)]; +} +/** + * Renders a page of items as lines that fit within the given width ensuring + * that the number of lines is not greater than the page size, and the active + * item renders at the provided position, while prioritizing that as many lines + * of the active item get rendered as possible. + */ +function lines({ items, width, renderItem, active, position: requested, pageSize, }) { + const layouts = items.map((item, index) => ({ + item, + index, + isActive: index === active, + })); + const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize); + const renderItemAt = (index) => split(renderItem(layoutsInPage[index]), width); + // Create a blank array of lines for the page + const pageBuffer = Array.from({ length: pageSize }); + // Render the active item to decide the position + const activeItem = renderItemAt(requested).slice(0, pageSize); + const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length; + // Add the lines of the active item into the page + pageBuffer.splice(position, activeItem.length, ...activeItem); + // Fill the page under the active item + let bufferPointer = position + activeItem.length; + let layoutPointer = requested + 1; + while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) { + for (const line of renderItemAt(layoutPointer)) { + pageBuffer[bufferPointer++] = line; + if (bufferPointer >= pageSize) + break; + } + layoutPointer++; + } + // Fill the page over the active item + bufferPointer = position - 1; + layoutPointer = requested - 1; + while (bufferPointer >= 0 && layoutPointer >= 0) { + for (const line of renderItemAt(layoutPointer).reverse()) { + pageBuffer[bufferPointer--] = line; + if (bufferPointer < 0) + break; + } + layoutPointer--; + } + return pageBuffer.filter((line) => typeof line === 'string'); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/position.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/position.js new file mode 100644 index 0000000..9fb7658 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/position.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.finite = finite; +exports.infinite = infinite; +/** + * Creates the next position for the active item considering a finite list of + * items to be rendered on a page. + */ +function finite({ active, pageSize, total, }) { + const middle = Math.floor(pageSize / 2); + if (total <= pageSize || active < middle) + return active; + if (active >= total - middle) + return active + pageSize - total; + return middle; +} +/** + * Creates the next position for the active item considering an infinitely + * looping list of items to be rendered on the page. + */ +function infinite({ active, lastActive, total, pageSize, pointer, }) { + if (total <= pageSize) + return active; + // Move the position only when the user moves down, and when the + // navigation fits within a single page + if (lastActive < active && active - lastActive < pageSize) { + // Limit it to the middle of the list + return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive); + } + return pointer; +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/use-pagination.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/use-pagination.js new file mode 100644 index 0000000..e9fe441 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/pagination/use-pagination.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.usePagination = usePagination; +const use_ref_mjs_1 = require('../use-ref.js'); +const utils_mjs_1 = require('../utils.js'); +const lines_mjs_1 = require('./lines.js'); +const position_mjs_1 = require('./position.js'); +function usePagination({ items, active, renderItem, pageSize, loop = true, }) { + const state = (0, use_ref_mjs_1.useRef)({ position: 0, lastActive: 0 }); + const position = loop + ? (0, position_mjs_1.infinite)({ + active, + lastActive: state.current.lastActive, + total: items.length, + pageSize, + pointer: state.current.position, + }) + : (0, position_mjs_1.finite)({ + active, + total: items.length, + pageSize, + }); + state.current.position = position; + state.current.lastActive = active; + return (0, lines_mjs_1.lines)({ + items, + width: (0, utils_mjs_1.readlineWidth)(), + renderItem, + active, + position, + pageSize, + }).join('\n'); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/screen-manager.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/screen-manager.js new file mode 100644 index 0000000..1e1534d --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/screen-manager.js @@ -0,0 +1,128 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const strip_ansi_1 = __importDefault(require("strip-ansi")); +const ansi_escapes_1 = __importDefault(require("ansi-escapes")); +const utils_mjs_1 = require('./utils.js'); +const height = (content) => content.split('\n').length; +const lastLine = (content) => { var _a; return (_a = content.split('\n').pop()) !== null && _a !== void 0 ? _a : ''; }; +class ScreenManager { + constructor(rl) { + Object.defineProperty(this, "rl", { + enumerable: true, + configurable: true, + writable: true, + value: rl + }); + // These variables are keeping information to allow correct prompt re-rendering + Object.defineProperty(this, "height", { + enumerable: true, + configurable: true, + writable: true, + value: 0 + }); + Object.defineProperty(this, "extraLinesUnderPrompt", { + enumerable: true, + configurable: true, + writable: true, + value: 0 + }); + Object.defineProperty(this, "cursorPos", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.rl = rl; + this.cursorPos = rl.getCursorPos(); + } + render(content, bottomContent = '') { + /** + * Write message to screen and setPrompt to control backspace + */ + const promptLine = lastLine(content); + const rawPromptLine = (0, strip_ansi_1.default)(promptLine); + // Remove the rl.line from our prompt. We can't rely on the content of + // rl.line (mainly because of the password prompt), so just rely on it's + // length. + let prompt = rawPromptLine; + if (this.rl.line.length > 0) { + prompt = prompt.slice(0, -this.rl.line.length); + } + this.rl.setPrompt(prompt); + // SetPrompt will change cursor position, now we can get correct value + this.cursorPos = this.rl.getCursorPos(); + const width = (0, utils_mjs_1.readlineWidth)(); + content = (0, utils_mjs_1.breakLines)(content, width); + bottomContent = (0, utils_mjs_1.breakLines)(bottomContent, width); + // Manually insert an extra line if we're at the end of the line. + // This prevent the cursor from appearing at the beginning of the + // current line. + if (rawPromptLine.length % width === 0) { + content += '\n'; + } + let output = content + (bottomContent ? '\n' + bottomContent : ''); + /** + * Re-adjust the cursor at the correct position. + */ + // We need to consider parts of the prompt under the cursor as part of the bottom + // content in order to correctly cleanup and re-render. + const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows; + const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); + // Return cursor to the input position (on top of the bottomContent) + if (bottomContentHeight > 0) + output += ansi_escapes_1.default.cursorUp(bottomContentHeight); + // Return cursor to the initial left offset. + output += ansi_escapes_1.default.cursorTo(this.cursorPos.cols); + this.clean(); + this.rl.output.unmute(); + /** + * Set up state for next re-rendering + */ + this.extraLinesUnderPrompt = bottomContentHeight; + this.height = height(output); + this.rl.output.write(output); + this.rl.output.mute(); + } + checkCursorPos() { + const cursorPos = this.rl.getCursorPos(); + if (cursorPos.cols !== this.cursorPos.cols) { + this.rl.output.unmute(); + this.rl.output.write(ansi_escapes_1.default.cursorTo(cursorPos.cols)); + this.rl.output.mute(); + this.cursorPos = cursorPos; + } + } + clean() { + this.rl.output.unmute(); + this.rl.output.write([ + this.extraLinesUnderPrompt > 0 + ? ansi_escapes_1.default.cursorDown(this.extraLinesUnderPrompt) + : '', + ansi_escapes_1.default.eraseLines(this.height), + ].join('')); + this.extraLinesUnderPrompt = 0; + this.rl.output.mute(); + } + clearContent() { + this.rl.output.unmute(); + // Reset the cursor at the end of the previously displayed content + this.rl.output.write([ + this.extraLinesUnderPrompt > 0 + ? ansi_escapes_1.default.cursorDown(this.extraLinesUnderPrompt) + : '', + '\n', + ].join('')); + this.rl.output.mute(); + } + done() { + this.rl.setPrompt(''); + this.rl.output.unmute(); + this.rl.output.write(ansi_escapes_1.default.cursorShow); + this.rl.output.end(); + this.rl.close(); + } +} +exports.default = ScreenManager; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/theme.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/theme.js new file mode 100644 index 0000000..93c05b8 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/theme.js @@ -0,0 +1,24 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultTheme = void 0; +const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); +const cli_spinners_1 = __importDefault(require("cli-spinners")); +exports.defaultTheme = { + prefix: yoctocolors_cjs_1.default.green('?'), + spinner: { + interval: cli_spinners_1.default.dots.interval, + frames: cli_spinners_1.default.dots.frames.map((frame) => yoctocolors_cjs_1.default.yellow(frame)), + }, + style: { + answer: yoctocolors_cjs_1.default.cyan, + message: yoctocolors_cjs_1.default.bold, + error: (text) => yoctocolors_cjs_1.default.red(`> ${text}`), + defaultAnswer: (text) => yoctocolors_cjs_1.default.dim(`(${text})`), + help: yoctocolors_cjs_1.default.dim, + highlight: yoctocolors_cjs_1.default.cyan, + key: (text) => yoctocolors_cjs_1.default.cyan(yoctocolors_cjs_1.default.bold(`<${text}>`)), + }, +}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/use-effect.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-effect.js new file mode 100644 index 0000000..d7abbb5 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-effect.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useEffect = useEffect; +const hook_engine_mjs_1 = require('./hook-engine.js'); +function useEffect(cb, depArray) { + (0, hook_engine_mjs_1.withPointer)((pointer) => { + const oldDeps = pointer.get(); + const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i])); + if (hasChanged) { + hook_engine_mjs_1.effectScheduler.queue(cb); + } + pointer.set(depArray); + }); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/use-keypress.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-keypress.js new file mode 100644 index 0000000..839c034 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-keypress.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useKeypress = useKeypress; +const use_ref_mjs_1 = require('./use-ref.js'); +const use_effect_mjs_1 = require('./use-effect.js'); +const hook_engine_mjs_1 = require('./hook-engine.js'); +function useKeypress(userHandler) { + const signal = (0, use_ref_mjs_1.useRef)(userHandler); + signal.current = userHandler; + (0, use_effect_mjs_1.useEffect)((rl) => { + const handler = (0, hook_engine_mjs_1.withUpdates)((_input, event) => { + signal.current(event, rl); + }); + rl.input.on('keypress', handler); + return () => { + rl.input.removeListener('keypress', handler); + }; + }, []); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/use-memo.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-memo.js new file mode 100644 index 0000000..8a73c9b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-memo.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useMemo = useMemo; +const hook_engine_mjs_1 = require('./hook-engine.js'); +function useMemo(fn, dependencies) { + return (0, hook_engine_mjs_1.withPointer)((pointer) => { + const prev = pointer.get(); + if (!prev || + prev.dependencies.length !== dependencies.length || + prev.dependencies.some((dep, i) => dep !== dependencies[i])) { + const value = fn(); + pointer.set({ value, dependencies }); + return value; + } + return prev.value; + }); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/use-prefix.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-prefix.js new file mode 100644 index 0000000..c202659 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-prefix.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.usePrefix = usePrefix; +const node_async_hooks_1 = require("node:async_hooks"); +const use_state_mjs_1 = require('./use-state.js'); +const use_effect_mjs_1 = require('./use-effect.js'); +const make_theme_mjs_1 = require('./make-theme.js'); +function usePrefix({ isLoading = false, theme, }) { + const [showLoader, setShowLoader] = (0, use_state_mjs_1.useState)(false); + const [tick, setTick] = (0, use_state_mjs_1.useState)(0); + const { prefix, spinner } = (0, make_theme_mjs_1.makeTheme)(theme); + (0, use_effect_mjs_1.useEffect)(() => { + if (isLoading) { + let tickInterval; + let inc = -1; + // Delay displaying spinner by 300ms, to avoid flickering + const delayTimeout = setTimeout(node_async_hooks_1.AsyncResource.bind(() => { + setShowLoader(true); + tickInterval = setInterval(node_async_hooks_1.AsyncResource.bind(() => { + inc = inc + 1; + setTick(inc % spinner.frames.length); + }), spinner.interval); + }), 300); + return () => { + clearTimeout(delayTimeout); + clearInterval(tickInterval); + }; + } + else { + setShowLoader(false); + } + }, [isLoading]); + if (showLoader) { + return spinner.frames[tick]; + } + return prefix; +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/use-ref.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-ref.js new file mode 100644 index 0000000..a1e9d5d --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-ref.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useRef = useRef; +const use_state_mjs_1 = require('./use-state.js'); +function useRef(val) { + return (0, use_state_mjs_1.useState)({ current: val })[0]; +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/use-state.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-state.js new file mode 100644 index 0000000..7053d08 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/use-state.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useState = useState; +const hook_engine_mjs_1 = require('./hook-engine.js'); +function useState(defaultValue) { + return (0, hook_engine_mjs_1.withPointer)((pointer) => { + const setFn = (newValue) => { + // Noop if the value is still the same. + if (pointer.get() !== newValue) { + pointer.set(newValue); + // Trigger re-render + (0, hook_engine_mjs_1.handleChange)(); + } + }; + if (pointer.initialized) { + return [pointer.get(), setFn]; + } + const value = typeof defaultValue === 'function' ? defaultValue() : defaultValue; + pointer.set(value); + return [value, setFn]; + }); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/lib/utils.js b/dist/node_modules/@inquirer/core/dist/cjs/lib/utils.js new file mode 100644 index 0000000..fa0b131 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/lib/utils.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.breakLines = breakLines; +exports.readlineWidth = readlineWidth; +const cli_width_1 = __importDefault(require("cli-width")); +const wrap_ansi_1 = __importDefault(require("wrap-ansi")); +const hook_engine_mjs_1 = require('./hook-engine.js'); +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +function breakLines(content, width) { + return content + .split('\n') + .flatMap((line) => (0, wrap_ansi_1.default)(line, width, { trim: false, hard: true }) + .split('\n') + .map((str) => str.trimEnd())) + .join('\n'); +} +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +function readlineWidth() { + return (0, cli_width_1.default)({ defaultWidth: 80, output: (0, hook_engine_mjs_1.readline)().output }); +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..6311bbb --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/index.d.ts @@ -0,0 +1,13 @@ +export * from './lib/key.js'; +export * from './lib/errors.js'; +export { usePrefix } from './lib/use-prefix.js'; +export { useState } from './lib/use-state.js'; +export { useEffect } from './lib/use-effect.js'; +export { useMemo } from './lib/use-memo.js'; +export { useRef } from './lib/use-ref.js'; +export { useKeypress } from './lib/use-keypress.js'; +export { makeTheme } from './lib/make-theme.js'; +export type { Theme } from './lib/theme.js'; +export { usePagination } from './lib/pagination/use-pagination.js'; +export { createPrompt } from './lib/create-prompt.js'; +export { Separator } from './lib/Separator.js'; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/Separator.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/Separator.d.ts new file mode 100644 index 0000000..59330d5 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/Separator.d.ts @@ -0,0 +1,10 @@ +/** + * Separator object + * Used to space/separate choices group + */ +export declare class Separator { + readonly separator: string; + readonly type = "separator"; + constructor(separator?: string); + static isSeparator(choice: undefined | Separator | Record): choice is Separator; +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/create-prompt.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/create-prompt.d.ts new file mode 100644 index 0000000..4414db4 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/create-prompt.d.ts @@ -0,0 +1,4 @@ +import { type Prompt, type Prettify } from '@inquirer/type'; +type ViewFunction = (config: Prettify, done: (value: Value) => void) => string | [string, string | undefined]; +export declare function createPrompt(view: ViewFunction): Prompt; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/errors.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/errors.d.ts new file mode 100644 index 0000000..dd4cebe --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/errors.d.ts @@ -0,0 +1,9 @@ +export declare class CancelPromptError extends Error { + message: string; +} +export declare class ExitPromptError extends Error { +} +export declare class HookError extends Error { +} +export declare class ValidationError extends Error { +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/hook-engine.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/hook-engine.d.ts new file mode 100644 index 0000000..6b6f71a --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/hook-engine.d.ts @@ -0,0 +1,30 @@ +import type { InquirerReadline } from '@inquirer/type'; +type HookStore = { + rl: InquirerReadline; + hooks: any[]; + hooksCleanup: Array void)>; + hooksEffect: Array<() => void>; + index: number; + handleChange: () => void; +}; +export declare function withHooks(rl: InquirerReadline, cb: (store: HookStore) => void): void; +export declare function readline(): InquirerReadline; +export declare function withUpdates any>(fn: T): (...args: Parameters) => ReturnType; +type SetPointer = { + get(): Value; + set(value: Value): void; + initialized: true; +}; +type UnsetPointer = { + get(): void; + set(value: Value): void; + initialized: false; +}; +type Pointer = SetPointer | UnsetPointer; +export declare function withPointer(cb: (pointer: Pointer) => ReturnValue): ReturnValue; +export declare function handleChange(): void; +export declare const effectScheduler: { + queue(cb: (readline: InquirerReadline) => void): void; + run(): void; +}; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/key.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/key.d.ts new file mode 100644 index 0000000..e2ad3dc --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/key.d.ts @@ -0,0 +1,10 @@ +export type KeypressEvent = { + name: string; + ctrl: boolean; +}; +export declare const isUpKey: (key: KeypressEvent) => boolean; +export declare const isDownKey: (key: KeypressEvent) => boolean; +export declare const isSpaceKey: (key: KeypressEvent) => boolean; +export declare const isBackspaceKey: (key: KeypressEvent) => boolean; +export declare const isNumberKey: (key: KeypressEvent) => boolean; +export declare const isEnterKey: (key: KeypressEvent) => boolean; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/make-theme.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/make-theme.d.ts new file mode 100644 index 0000000..af6f3d6 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/make-theme.d.ts @@ -0,0 +1,3 @@ +import type { Prettify, PartialDeep } from '@inquirer/type'; +import { type Theme } from './theme.js'; +export declare function makeTheme(...themes: ReadonlyArray>>): Prettify>; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/lines.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/lines.d.ts new file mode 100644 index 0000000..5766195 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/lines.d.ts @@ -0,0 +1,26 @@ +import { type Prettify } from '@inquirer/type'; +/** Represents an item that's part of a layout, about to be rendered */ +export type Layout = { + item: T; + index: number; + isActive: boolean; +}; +/** + * Renders a page of items as lines that fit within the given width ensuring + * that the number of lines is not greater than the page size, and the active + * item renders at the provided position, while prioritizing that as many lines + * of the active item get rendered as possible. + */ +export declare function lines({ items, width, renderItem, active, position: requested, pageSize, }: { + items: ReadonlyArray; + /** The width of a rendered line in characters. */ + width: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify>) => string; + /** The index of the active item in the list of items. */ + active: number; + /** The position on the page at which to render the active item. */ + position: number; + /** The number of lines to render per page. */ + pageSize: number; +}): string[]; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/position.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/position.d.ts new file mode 100644 index 0000000..d74870e --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/position.d.ts @@ -0,0 +1,20 @@ +/** + * Creates the next position for the active item considering a finite list of + * items to be rendered on a page. + */ +export declare function finite({ active, pageSize, total, }: { + active: number; + pageSize: number; + total: number; +}): number; +/** + * Creates the next position for the active item considering an infinitely + * looping list of items to be rendered on the page. + */ +export declare function infinite({ active, lastActive, total, pageSize, pointer, }: { + active: number; + lastActive: number; + total: number; + pageSize: number; + pointer: number; +}): number; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/use-pagination.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/use-pagination.d.ts new file mode 100644 index 0000000..5408baf --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/pagination/use-pagination.d.ts @@ -0,0 +1,15 @@ +import type { Prettify } from '@inquirer/type'; +import { type Theme } from '../theme.js'; +import { type Layout } from './lines.js'; +export declare function usePagination({ items, active, renderItem, pageSize, loop, }: { + items: ReadonlyArray; + /** The index of the active item. */ + active: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify>) => string; + /** The size of the page. */ + pageSize: number; + /** Allows creating an infinitely looping list. `true` if unspecified. */ + loop?: boolean; + theme?: Theme; +}): string; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/screen-manager.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/screen-manager.d.ts new file mode 100644 index 0000000..4dbb77b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/screen-manager.d.ts @@ -0,0 +1,13 @@ +import type { InquirerReadline } from '@inquirer/type'; +export default class ScreenManager { + private readonly rl; + private height; + private extraLinesUnderPrompt; + private cursorPos; + constructor(rl: InquirerReadline); + render(content: string, bottomContent?: string): void; + checkCursorPos(): void; + clean(): void; + clearContent(): void; + done(): void; +} diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/theme.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/theme.d.ts new file mode 100644 index 0000000..c319617 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/theme.d.ts @@ -0,0 +1,20 @@ +import type { Prettify } from '@inquirer/type'; +type DefaultTheme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + }; +}; +export type Theme = Prettify; +export declare const defaultTheme: DefaultTheme; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-effect.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-effect.d.ts new file mode 100644 index 0000000..abee906 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-effect.d.ts @@ -0,0 +1,2 @@ +import type { InquirerReadline } from '@inquirer/type'; +export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray): void; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-keypress.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-keypress.d.ts new file mode 100644 index 0000000..2995785 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-keypress.d.ts @@ -0,0 +1,3 @@ +import { type InquirerReadline } from '@inquirer/type'; +import { type KeypressEvent } from './key.js'; +export declare function useKeypress(userHandler: (event: KeypressEvent, rl: InquirerReadline) => void): void; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-memo.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-memo.d.ts new file mode 100644 index 0000000..19d1644 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-memo.d.ts @@ -0,0 +1 @@ +export declare function useMemo(fn: () => Value, dependencies: ReadonlyArray): Value; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-prefix.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-prefix.d.ts new file mode 100644 index 0000000..0a1c41f --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-prefix.d.ts @@ -0,0 +1,5 @@ +import { type Theme } from './theme.js'; +export declare function usePrefix({ isLoading, theme, }: { + isLoading?: boolean; + theme?: Theme; +}): string; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-ref.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-ref.d.ts new file mode 100644 index 0000000..be7126b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-ref.d.ts @@ -0,0 +1,6 @@ +export declare function useRef(val: Value): { + current: Value; +}; +export declare function useRef(val?: Value): { + current: Value | undefined; +}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-state.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-state.d.ts new file mode 100644 index 0000000..7730aed --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/use-state.d.ts @@ -0,0 +1,4 @@ +type NotFunction = T extends Function ? never : T; +export declare function useState(defaultValue: NotFunction | (() => Value)): [Value, (newValue: Value) => void]; +export declare function useState(defaultValue?: NotFunction | (() => Value)): [Value | undefined, (newValue?: Value | undefined) => void]; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/cjs/types/lib/utils.d.ts b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/utils.d.ts new file mode 100644 index 0000000..14f8fc4 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/cjs/types/lib/utils.d.ts @@ -0,0 +1,13 @@ +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +export declare function breakLines(content: string, width: number): string; +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +export declare function readlineWidth(): number; diff --git a/dist/node_modules/@inquirer/core/dist/esm/index.mjs b/dist/node_modules/@inquirer/core/dist/esm/index.mjs new file mode 100644 index 0000000..772ef6c --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/index.mjs @@ -0,0 +1,12 @@ +export * from './lib/key.mjs'; +export * from './lib/errors.mjs'; +export { usePrefix } from './lib/use-prefix.mjs'; +export { useState } from './lib/use-state.mjs'; +export { useEffect } from './lib/use-effect.mjs'; +export { useMemo } from './lib/use-memo.mjs'; +export { useRef } from './lib/use-ref.mjs'; +export { useKeypress } from './lib/use-keypress.mjs'; +export { makeTheme } from './lib/make-theme.mjs'; +export { usePagination } from './lib/pagination/use-pagination.mjs'; +export { createPrompt } from './lib/create-prompt.mjs'; +export { Separator } from './lib/Separator.mjs'; diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/Separator.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/Separator.mjs new file mode 100644 index 0000000..b0488ef --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/Separator.mjs @@ -0,0 +1,18 @@ +import colors from 'yoctocolors-cjs'; +import figures from '@inquirer/figures'; +/** + * Separator object + * Used to space/separate choices group + */ +export class Separator { + separator = colors.dim(Array.from({ length: 15 }).join(figures.line)); + type = 'separator'; + constructor(separator) { + if (separator) { + this.separator = separator; + } + } + static isSeparator(choice) { + return Boolean(choice && choice.type === 'separator'); + } +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs new file mode 100644 index 0000000..d3a9c22 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs @@ -0,0 +1,88 @@ +import * as readline from 'node:readline'; +import { CancelablePromise } from '@inquirer/type'; +import MuteStream from 'mute-stream'; +import { onExit as onSignalExit } from 'signal-exit'; +import ScreenManager from './screen-manager.mjs'; +import { withHooks, effectScheduler } from './hook-engine.mjs'; +import { CancelPromptError, ExitPromptError } from './errors.mjs'; +export function createPrompt(view) { + const prompt = (config, context) => { + // Default `input` to stdin + const input = context?.input ?? process.stdin; + // Add mute capabilities to the output + const output = new MuteStream(); + output.pipe(context?.output ?? process.stdout); + const rl = readline.createInterface({ + terminal: true, + input, + output, + }); + const screen = new ScreenManager(rl); + let cancel = () => { }; + const answer = new CancelablePromise((resolve, reject) => { + withHooks(rl, (store) => { + function checkCursorPos() { + screen.checkCursorPos(); + } + const removeExitListener = onSignalExit((code, signal) => { + onExit(); + reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`)); + }); + function onExit() { + try { + store.hooksCleanup.forEach((cleanFn) => { + cleanFn?.(); + }); + } + catch (error) { + reject(error); + } + if (context?.clearPromptOnDone) { + screen.clean(); + } + else { + screen.clearContent(); + } + screen.done(); + removeExitListener(); + store.rl.input.removeListener('keypress', checkCursorPos); + } + cancel = () => { + onExit(); + reject(new CancelPromptError()); + }; + function done(value) { + // Delay execution to let time to the hookCleanup functions to registers. + setImmediate(() => { + onExit(); + // Finally we resolve our promise + resolve(value); + }); + } + function workLoop() { + store.index = 0; + try { + const nextView = view(config, done); + const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView; + screen.render(content, bottomContent); + effectScheduler.run(); + } + catch (error) { + onExit(); + reject(error); + } + } + store.handleChange = () => workLoop(); + workLoop(); + // Re-renders only happen when the state change; but the readline cursor could change position + // and that also requires a re-render (and a manual one because we mute the streams). + // We set the listener after the initial workLoop to avoid a double render if render triggered + // by a state change sets the cursor to the right position. + store.rl.input.on('keypress', checkCursorPos); + }); + }); + answer.cancel = cancel; + return answer; + }; + return prompt; +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/errors.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/errors.mjs new file mode 100644 index 0000000..9d6532a --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/errors.mjs @@ -0,0 +1,9 @@ +export class CancelPromptError extends Error { + message = 'Prompt was canceled'; +} +export class ExitPromptError extends Error { +} +export class HookError extends Error { +} +export class ValidationError extends Error { +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs new file mode 100644 index 0000000..3460402 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs @@ -0,0 +1,95 @@ +/* eslint @typescript-eslint/no-explicit-any: ["off"] */ +import { AsyncLocalStorage, AsyncResource } from 'node:async_hooks'; +import { HookError, ValidationError } from './errors.mjs'; +const hookStorage = new AsyncLocalStorage(); +function createStore(rl) { + const store = { + rl, + hooks: [], + hooksCleanup: [], + hooksEffect: [], + index: 0, + handleChange() { }, + }; + return store; +} +// Run callback in with the hook engine setup. +export function withHooks(rl, cb) { + const store = createStore(rl); + return hookStorage.run(store, () => { + cb(store); + }); +} +// Safe getStore utility that'll return the store or throw if undefined. +function getStore() { + const store = hookStorage.getStore(); + if (!store) { + throw new HookError('[Inquirer] Hook functions can only be called from within a prompt'); + } + return store; +} +export function readline() { + return getStore().rl; +} +// Merge state updates happening within the callback function to avoid multiple renders. +export function withUpdates(fn) { + const wrapped = (...args) => { + const store = getStore(); + let shouldUpdate = false; + const oldHandleChange = store.handleChange; + store.handleChange = () => { + shouldUpdate = true; + }; + const returnValue = fn(...args); + if (shouldUpdate) { + oldHandleChange(); + } + store.handleChange = oldHandleChange; + return returnValue; + }; + return AsyncResource.bind(wrapped); +} +export function withPointer(cb) { + const store = getStore(); + const { index } = store; + const pointer = { + get() { + return store.hooks[index]; + }, + set(value) { + store.hooks[index] = value; + }, + initialized: index in store.hooks, + }; + const returnValue = cb(pointer); + store.index++; + return returnValue; +} +export function handleChange() { + getStore().handleChange(); +} +export const effectScheduler = { + queue(cb) { + const store = getStore(); + const { index } = store; + store.hooksEffect.push(() => { + store.hooksCleanup[index]?.(); + const cleanFn = cb(readline()); + if (cleanFn != null && typeof cleanFn !== 'function') { + throw new ValidationError('useEffect return value must be a cleanup function or nothing.'); + } + store.hooksCleanup[index] = cleanFn; + }); + }, + run() { + const store = getStore(); + withUpdates(() => { + store.hooksEffect.forEach((effect) => { + effect(); + }); + // Warning: Clean the hooks before exiting the `withUpdates` block. + // Failure to do so means an updates would hit the same effects again. + store.hooksEffect.length = 0; + })(); + }, +}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/key.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/key.mjs new file mode 100644 index 0000000..a6f2512 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/key.mjs @@ -0,0 +1,18 @@ +export const isUpKey = (key) => +// The up key +key.name === 'up' || + // Vim keybinding + key.name === 'k' || + // Emacs keybinding + (key.ctrl && key.name === 'p'); +export const isDownKey = (key) => +// The down key +key.name === 'down' || + // Vim keybinding + key.name === 'j' || + // Emacs keybinding + (key.ctrl && key.name === 'n'); +export const isSpaceKey = (key) => key.name === 'space'; +export const isBackspaceKey = (key) => key.name === 'backspace'; +export const isNumberKey = (key) => '123456789'.includes(key.name); +export const isEnterKey = (key) => key.name === 'enter' || key.name === 'return'; diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/make-theme.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/make-theme.mjs new file mode 100644 index 0000000..504da44 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/make-theme.mjs @@ -0,0 +1,30 @@ +import { defaultTheme } from './theme.mjs'; +function isPlainObject(value) { + if (typeof value !== 'object' || value === null) + return false; + let proto = value; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + return Object.getPrototypeOf(value) === proto; +} +function deepMerge(...objects) { + const output = {}; + for (const obj of objects) { + for (const [key, value] of Object.entries(obj)) { + const prevValue = output[key]; + output[key] = + isPlainObject(prevValue) && isPlainObject(value) + ? deepMerge(prevValue, value) + : value; + } + } + return output; +} +export function makeTheme(...themes) { + const themesToMerge = [ + defaultTheme, + ...themes.filter((theme) => theme != null), + ]; + return deepMerge(...themesToMerge); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.mjs new file mode 100644 index 0000000..6b9a38f --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.mjs @@ -0,0 +1,59 @@ +import { breakLines } from '../utils.mjs'; +function split(content, width) { + return breakLines(content, width).split('\n'); +} +/** + * Rotates an array of items by an integer number of positions. + * @param {number} count The number of positions to rotate by + * @param {T[]} items The items to rotate + */ +function rotate(count, items) { + const max = items.length; + const offset = ((count % max) + max) % max; + return [...items.slice(offset), ...items.slice(0, offset)]; +} +/** + * Renders a page of items as lines that fit within the given width ensuring + * that the number of lines is not greater than the page size, and the active + * item renders at the provided position, while prioritizing that as many lines + * of the active item get rendered as possible. + */ +export function lines({ items, width, renderItem, active, position: requested, pageSize, }) { + const layouts = items.map((item, index) => ({ + item, + index, + isActive: index === active, + })); + const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize); + const renderItemAt = (index) => split(renderItem(layoutsInPage[index]), width); + // Create a blank array of lines for the page + const pageBuffer = Array.from({ length: pageSize }); + // Render the active item to decide the position + const activeItem = renderItemAt(requested).slice(0, pageSize); + const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length; + // Add the lines of the active item into the page + pageBuffer.splice(position, activeItem.length, ...activeItem); + // Fill the page under the active item + let bufferPointer = position + activeItem.length; + let layoutPointer = requested + 1; + while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) { + for (const line of renderItemAt(layoutPointer)) { + pageBuffer[bufferPointer++] = line; + if (bufferPointer >= pageSize) + break; + } + layoutPointer++; + } + // Fill the page over the active item + bufferPointer = position - 1; + layoutPointer = requested - 1; + while (bufferPointer >= 0 && layoutPointer >= 0) { + for (const line of renderItemAt(layoutPointer).reverse()) { + pageBuffer[bufferPointer--] = line; + if (bufferPointer < 0) + break; + } + layoutPointer--; + } + return pageBuffer.filter((line) => typeof line === 'string'); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/position.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/position.mjs new file mode 100644 index 0000000..9e3cc2e --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/position.mjs @@ -0,0 +1,27 @@ +/** + * Creates the next position for the active item considering a finite list of + * items to be rendered on a page. + */ +export function finite({ active, pageSize, total, }) { + const middle = Math.floor(pageSize / 2); + if (total <= pageSize || active < middle) + return active; + if (active >= total - middle) + return active + pageSize - total; + return middle; +} +/** + * Creates the next position for the active item considering an infinitely + * looping list of items to be rendered on the page. + */ +export function infinite({ active, lastActive, total, pageSize, pointer, }) { + if (total <= pageSize) + return active; + // Move the position only when the user moves down, and when the + // navigation fits within a single page + if (lastActive < active && active - lastActive < pageSize) { + // Limit it to the middle of the list + return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive); + } + return pointer; +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.mjs new file mode 100644 index 0000000..b845923 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.mjs @@ -0,0 +1,30 @@ +import { useRef } from '../use-ref.mjs'; +import { readlineWidth } from '../utils.mjs'; +import { lines } from './lines.mjs'; +import { finite, infinite } from './position.mjs'; +export function usePagination({ items, active, renderItem, pageSize, loop = true, }) { + const state = useRef({ position: 0, lastActive: 0 }); + const position = loop + ? infinite({ + active, + lastActive: state.current.lastActive, + total: items.length, + pageSize, + pointer: state.current.position, + }) + : finite({ + active, + total: items.length, + pageSize, + }); + state.current.position = position; + state.current.lastActive = active; + return lines({ + items, + width: readlineWidth(), + renderItem, + active, + position, + pageSize, + }).join('\n'); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/screen-manager.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/screen-manager.mjs new file mode 100644 index 0000000..e63db9d --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/screen-manager.mjs @@ -0,0 +1,103 @@ +import stripAnsi from 'strip-ansi'; +import ansiEscapes from 'ansi-escapes'; +import { breakLines, readlineWidth } from './utils.mjs'; +const height = (content) => content.split('\n').length; +const lastLine = (content) => content.split('\n').pop() ?? ''; +export default class ScreenManager { + rl; + // These variables are keeping information to allow correct prompt re-rendering + height = 0; + extraLinesUnderPrompt = 0; + cursorPos; + constructor(rl) { + this.rl = rl; + this.rl = rl; + this.cursorPos = rl.getCursorPos(); + } + render(content, bottomContent = '') { + /** + * Write message to screen and setPrompt to control backspace + */ + const promptLine = lastLine(content); + const rawPromptLine = stripAnsi(promptLine); + // Remove the rl.line from our prompt. We can't rely on the content of + // rl.line (mainly because of the password prompt), so just rely on it's + // length. + let prompt = rawPromptLine; + if (this.rl.line.length > 0) { + prompt = prompt.slice(0, -this.rl.line.length); + } + this.rl.setPrompt(prompt); + // SetPrompt will change cursor position, now we can get correct value + this.cursorPos = this.rl.getCursorPos(); + const width = readlineWidth(); + content = breakLines(content, width); + bottomContent = breakLines(bottomContent, width); + // Manually insert an extra line if we're at the end of the line. + // This prevent the cursor from appearing at the beginning of the + // current line. + if (rawPromptLine.length % width === 0) { + content += '\n'; + } + let output = content + (bottomContent ? '\n' + bottomContent : ''); + /** + * Re-adjust the cursor at the correct position. + */ + // We need to consider parts of the prompt under the cursor as part of the bottom + // content in order to correctly cleanup and re-render. + const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows; + const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); + // Return cursor to the input position (on top of the bottomContent) + if (bottomContentHeight > 0) + output += ansiEscapes.cursorUp(bottomContentHeight); + // Return cursor to the initial left offset. + output += ansiEscapes.cursorTo(this.cursorPos.cols); + this.clean(); + this.rl.output.unmute(); + /** + * Set up state for next re-rendering + */ + this.extraLinesUnderPrompt = bottomContentHeight; + this.height = height(output); + this.rl.output.write(output); + this.rl.output.mute(); + } + checkCursorPos() { + const cursorPos = this.rl.getCursorPos(); + if (cursorPos.cols !== this.cursorPos.cols) { + this.rl.output.unmute(); + this.rl.output.write(ansiEscapes.cursorTo(cursorPos.cols)); + this.rl.output.mute(); + this.cursorPos = cursorPos; + } + } + clean() { + this.rl.output.unmute(); + this.rl.output.write([ + this.extraLinesUnderPrompt > 0 + ? ansiEscapes.cursorDown(this.extraLinesUnderPrompt) + : '', + ansiEscapes.eraseLines(this.height), + ].join('')); + this.extraLinesUnderPrompt = 0; + this.rl.output.mute(); + } + clearContent() { + this.rl.output.unmute(); + // Reset the cursor at the end of the previously displayed content + this.rl.output.write([ + this.extraLinesUnderPrompt > 0 + ? ansiEscapes.cursorDown(this.extraLinesUnderPrompt) + : '', + '\n', + ].join('')); + this.rl.output.mute(); + } + done() { + this.rl.setPrompt(''); + this.rl.output.unmute(); + this.rl.output.write(ansiEscapes.cursorShow); + this.rl.output.end(); + this.rl.close(); + } +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/theme.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/theme.mjs new file mode 100644 index 0000000..a1736f3 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/theme.mjs @@ -0,0 +1,18 @@ +import colors from 'yoctocolors-cjs'; +import spinners from 'cli-spinners'; +export const defaultTheme = { + prefix: colors.green('?'), + spinner: { + interval: spinners.dots.interval, + frames: spinners.dots.frames.map((frame) => colors.yellow(frame)), + }, + style: { + answer: colors.cyan, + message: colors.bold, + error: (text) => colors.red(`> ${text}`), + defaultAnswer: (text) => colors.dim(`(${text})`), + help: colors.dim, + highlight: colors.cyan, + key: (text) => colors.cyan(colors.bold(`<${text}>`)), + }, +}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/use-effect.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/use-effect.mjs new file mode 100644 index 0000000..8c30102 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/use-effect.mjs @@ -0,0 +1,11 @@ +import { withPointer, effectScheduler } from './hook-engine.mjs'; +export function useEffect(cb, depArray) { + withPointer((pointer) => { + const oldDeps = pointer.get(); + const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i])); + if (hasChanged) { + effectScheduler.queue(cb); + } + pointer.set(depArray); + }); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/use-keypress.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/use-keypress.mjs new file mode 100644 index 0000000..8daee85 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/use-keypress.mjs @@ -0,0 +1,16 @@ +import { useRef } from './use-ref.mjs'; +import { useEffect } from './use-effect.mjs'; +import { withUpdates } from './hook-engine.mjs'; +export function useKeypress(userHandler) { + const signal = useRef(userHandler); + signal.current = userHandler; + useEffect((rl) => { + const handler = withUpdates((_input, event) => { + signal.current(event, rl); + }); + rl.input.on('keypress', handler); + return () => { + rl.input.removeListener('keypress', handler); + }; + }, []); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs new file mode 100644 index 0000000..a6558e8 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs @@ -0,0 +1,14 @@ +import { withPointer } from './hook-engine.mjs'; +export function useMemo(fn, dependencies) { + return withPointer((pointer) => { + const prev = pointer.get(); + if (!prev || + prev.dependencies.length !== dependencies.length || + prev.dependencies.some((dep, i) => dep !== dependencies[i])) { + const value = fn(); + pointer.set({ value, dependencies }); + return value; + } + return prev.value; + }); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/use-prefix.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/use-prefix.mjs new file mode 100644 index 0000000..cae4b6d --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/use-prefix.mjs @@ -0,0 +1,34 @@ +import { AsyncResource } from 'node:async_hooks'; +import { useState } from './use-state.mjs'; +import { useEffect } from './use-effect.mjs'; +import { makeTheme } from './make-theme.mjs'; +export function usePrefix({ isLoading = false, theme, }) { + const [showLoader, setShowLoader] = useState(false); + const [tick, setTick] = useState(0); + const { prefix, spinner } = makeTheme(theme); + useEffect(() => { + if (isLoading) { + let tickInterval; + let inc = -1; + // Delay displaying spinner by 300ms, to avoid flickering + const delayTimeout = setTimeout(AsyncResource.bind(() => { + setShowLoader(true); + tickInterval = setInterval(AsyncResource.bind(() => { + inc = inc + 1; + setTick(inc % spinner.frames.length); + }), spinner.interval); + }), 300); + return () => { + clearTimeout(delayTimeout); + clearInterval(tickInterval); + }; + } + else { + setShowLoader(false); + } + }, [isLoading]); + if (showLoader) { + return spinner.frames[tick]; + } + return prefix; +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/use-ref.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/use-ref.mjs new file mode 100644 index 0000000..69ecc68 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/use-ref.mjs @@ -0,0 +1,4 @@ +import { useState } from './use-state.mjs'; +export function useRef(val) { + return useState({ current: val })[0]; +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/use-state.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/use-state.mjs new file mode 100644 index 0000000..3629bf0 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/use-state.mjs @@ -0,0 +1,19 @@ +import { withPointer, handleChange } from './hook-engine.mjs'; +export function useState(defaultValue) { + return withPointer((pointer) => { + const setFn = (newValue) => { + // Noop if the value is still the same. + if (pointer.get() !== newValue) { + pointer.set(newValue); + // Trigger re-render + handleChange(); + } + }; + if (pointer.initialized) { + return [pointer.get(), setFn]; + } + const value = typeof defaultValue === 'function' ? defaultValue() : defaultValue; + pointer.set(value); + return [value, setFn]; + }); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/lib/utils.mjs b/dist/node_modules/@inquirer/core/dist/esm/lib/utils.mjs new file mode 100644 index 0000000..1e7ae89 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/lib/utils.mjs @@ -0,0 +1,25 @@ +import cliWidth from 'cli-width'; +import wrapAnsi from 'wrap-ansi'; +import { readline } from './hook-engine.mjs'; +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +export function breakLines(content, width) { + return content + .split('\n') + .flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }) + .split('\n') + .map((str) => str.trimEnd())) + .join('\n'); +} +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +export function readlineWidth() { + return cliWidth({ defaultWidth: 80, output: readline().output }); +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/index.d.mts new file mode 100644 index 0000000..03a7e71 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/index.d.mts @@ -0,0 +1,13 @@ +export * from './lib/key.mjs'; +export * from './lib/errors.mjs'; +export { usePrefix } from './lib/use-prefix.mjs'; +export { useState } from './lib/use-state.mjs'; +export { useEffect } from './lib/use-effect.mjs'; +export { useMemo } from './lib/use-memo.mjs'; +export { useRef } from './lib/use-ref.mjs'; +export { useKeypress } from './lib/use-keypress.mjs'; +export { makeTheme } from './lib/make-theme.mjs'; +export type { Theme } from './lib/theme.mjs'; +export { usePagination } from './lib/pagination/use-pagination.mjs'; +export { createPrompt } from './lib/create-prompt.mjs'; +export { Separator } from './lib/Separator.mjs'; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/Separator.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/Separator.d.mts new file mode 100644 index 0000000..59330d5 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/Separator.d.mts @@ -0,0 +1,10 @@ +/** + * Separator object + * Used to space/separate choices group + */ +export declare class Separator { + readonly separator: string; + readonly type = "separator"; + constructor(separator?: string); + static isSeparator(choice: undefined | Separator | Record): choice is Separator; +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/create-prompt.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/create-prompt.d.mts new file mode 100644 index 0000000..4414db4 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/create-prompt.d.mts @@ -0,0 +1,4 @@ +import { type Prompt, type Prettify } from '@inquirer/type'; +type ViewFunction = (config: Prettify, done: (value: Value) => void) => string | [string, string | undefined]; +export declare function createPrompt(view: ViewFunction): Prompt; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/errors.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/errors.d.mts new file mode 100644 index 0000000..dd4cebe --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/errors.d.mts @@ -0,0 +1,9 @@ +export declare class CancelPromptError extends Error { + message: string; +} +export declare class ExitPromptError extends Error { +} +export declare class HookError extends Error { +} +export declare class ValidationError extends Error { +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/hook-engine.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/hook-engine.d.mts new file mode 100644 index 0000000..6b6f71a --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/hook-engine.d.mts @@ -0,0 +1,30 @@ +import type { InquirerReadline } from '@inquirer/type'; +type HookStore = { + rl: InquirerReadline; + hooks: any[]; + hooksCleanup: Array void)>; + hooksEffect: Array<() => void>; + index: number; + handleChange: () => void; +}; +export declare function withHooks(rl: InquirerReadline, cb: (store: HookStore) => void): void; +export declare function readline(): InquirerReadline; +export declare function withUpdates any>(fn: T): (...args: Parameters) => ReturnType; +type SetPointer = { + get(): Value; + set(value: Value): void; + initialized: true; +}; +type UnsetPointer = { + get(): void; + set(value: Value): void; + initialized: false; +}; +type Pointer = SetPointer | UnsetPointer; +export declare function withPointer(cb: (pointer: Pointer) => ReturnValue): ReturnValue; +export declare function handleChange(): void; +export declare const effectScheduler: { + queue(cb: (readline: InquirerReadline) => void): void; + run(): void; +}; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/key.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/key.d.mts new file mode 100644 index 0000000..e2ad3dc --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/key.d.mts @@ -0,0 +1,10 @@ +export type KeypressEvent = { + name: string; + ctrl: boolean; +}; +export declare const isUpKey: (key: KeypressEvent) => boolean; +export declare const isDownKey: (key: KeypressEvent) => boolean; +export declare const isSpaceKey: (key: KeypressEvent) => boolean; +export declare const isBackspaceKey: (key: KeypressEvent) => boolean; +export declare const isNumberKey: (key: KeypressEvent) => boolean; +export declare const isEnterKey: (key: KeypressEvent) => boolean; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/make-theme.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/make-theme.d.mts new file mode 100644 index 0000000..acd459c --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/make-theme.d.mts @@ -0,0 +1,3 @@ +import type { Prettify, PartialDeep } from '@inquirer/type'; +import { type Theme } from './theme.mjs'; +export declare function makeTheme(...themes: ReadonlyArray>>): Prettify>; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/lines.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/lines.d.mts new file mode 100644 index 0000000..5766195 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/lines.d.mts @@ -0,0 +1,26 @@ +import { type Prettify } from '@inquirer/type'; +/** Represents an item that's part of a layout, about to be rendered */ +export type Layout = { + item: T; + index: number; + isActive: boolean; +}; +/** + * Renders a page of items as lines that fit within the given width ensuring + * that the number of lines is not greater than the page size, and the active + * item renders at the provided position, while prioritizing that as many lines + * of the active item get rendered as possible. + */ +export declare function lines({ items, width, renderItem, active, position: requested, pageSize, }: { + items: ReadonlyArray; + /** The width of a rendered line in characters. */ + width: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify>) => string; + /** The index of the active item in the list of items. */ + active: number; + /** The position on the page at which to render the active item. */ + position: number; + /** The number of lines to render per page. */ + pageSize: number; +}): string[]; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/position.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/position.d.mts new file mode 100644 index 0000000..d74870e --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/position.d.mts @@ -0,0 +1,20 @@ +/** + * Creates the next position for the active item considering a finite list of + * items to be rendered on a page. + */ +export declare function finite({ active, pageSize, total, }: { + active: number; + pageSize: number; + total: number; +}): number; +/** + * Creates the next position for the active item considering an infinitely + * looping list of items to be rendered on the page. + */ +export declare function infinite({ active, lastActive, total, pageSize, pointer, }: { + active: number; + lastActive: number; + total: number; + pageSize: number; + pointer: number; +}): number; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/use-pagination.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/use-pagination.d.mts new file mode 100644 index 0000000..915290e --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/pagination/use-pagination.d.mts @@ -0,0 +1,15 @@ +import type { Prettify } from '@inquirer/type'; +import { type Theme } from '../theme.mjs'; +import { type Layout } from './lines.mjs'; +export declare function usePagination({ items, active, renderItem, pageSize, loop, }: { + items: ReadonlyArray; + /** The index of the active item. */ + active: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify>) => string; + /** The size of the page. */ + pageSize: number; + /** Allows creating an infinitely looping list. `true` if unspecified. */ + loop?: boolean; + theme?: Theme; +}): string; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/screen-manager.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/screen-manager.d.mts new file mode 100644 index 0000000..4dbb77b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/screen-manager.d.mts @@ -0,0 +1,13 @@ +import type { InquirerReadline } from '@inquirer/type'; +export default class ScreenManager { + private readonly rl; + private height; + private extraLinesUnderPrompt; + private cursorPos; + constructor(rl: InquirerReadline); + render(content: string, bottomContent?: string): void; + checkCursorPos(): void; + clean(): void; + clearContent(): void; + done(): void; +} diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/theme.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/theme.d.mts new file mode 100644 index 0000000..c319617 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/theme.d.mts @@ -0,0 +1,20 @@ +import type { Prettify } from '@inquirer/type'; +type DefaultTheme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + }; +}; +export type Theme = Prettify; +export declare const defaultTheme: DefaultTheme; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-effect.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-effect.d.mts new file mode 100644 index 0000000..abee906 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-effect.d.mts @@ -0,0 +1,2 @@ +import type { InquirerReadline } from '@inquirer/type'; +export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray): void; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-keypress.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-keypress.d.mts new file mode 100644 index 0000000..5a1bad1 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-keypress.d.mts @@ -0,0 +1,3 @@ +import { type InquirerReadline } from '@inquirer/type'; +import { type KeypressEvent } from './key.mjs'; +export declare function useKeypress(userHandler: (event: KeypressEvent, rl: InquirerReadline) => void): void; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-memo.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-memo.d.mts new file mode 100644 index 0000000..19d1644 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-memo.d.mts @@ -0,0 +1 @@ +export declare function useMemo(fn: () => Value, dependencies: ReadonlyArray): Value; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-prefix.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-prefix.d.mts new file mode 100644 index 0000000..4242eb3 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-prefix.d.mts @@ -0,0 +1,5 @@ +import { type Theme } from './theme.mjs'; +export declare function usePrefix({ isLoading, theme, }: { + isLoading?: boolean; + theme?: Theme; +}): string; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-ref.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-ref.d.mts new file mode 100644 index 0000000..be7126b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-ref.d.mts @@ -0,0 +1,6 @@ +export declare function useRef(val: Value): { + current: Value; +}; +export declare function useRef(val?: Value): { + current: Value | undefined; +}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-state.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-state.d.mts new file mode 100644 index 0000000..7730aed --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/use-state.d.mts @@ -0,0 +1,4 @@ +type NotFunction = T extends Function ? never : T; +export declare function useState(defaultValue: NotFunction | (() => Value)): [Value, (newValue: Value) => void]; +export declare function useState(defaultValue?: NotFunction | (() => Value)): [Value | undefined, (newValue?: Value | undefined) => void]; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/esm/types/lib/utils.d.mts b/dist/node_modules/@inquirer/core/dist/esm/types/lib/utils.d.mts new file mode 100644 index 0000000..14f8fc4 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/esm/types/lib/utils.d.mts @@ -0,0 +1,13 @@ +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +export declare function breakLines(content: string, width: number): string; +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +export declare function readlineWidth(): number; diff --git a/dist/node_modules/@inquirer/core/dist/types/index.d.ts b/dist/node_modules/@inquirer/core/dist/types/index.d.ts new file mode 100644 index 0000000..6311bbb --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/index.d.ts @@ -0,0 +1,13 @@ +export * from './lib/key.js'; +export * from './lib/errors.js'; +export { usePrefix } from './lib/use-prefix.js'; +export { useState } from './lib/use-state.js'; +export { useEffect } from './lib/use-effect.js'; +export { useMemo } from './lib/use-memo.js'; +export { useRef } from './lib/use-ref.js'; +export { useKeypress } from './lib/use-keypress.js'; +export { makeTheme } from './lib/make-theme.js'; +export type { Theme } from './lib/theme.js'; +export { usePagination } from './lib/pagination/use-pagination.js'; +export { createPrompt } from './lib/create-prompt.js'; +export { Separator } from './lib/Separator.js'; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/Separator.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/Separator.d.ts new file mode 100644 index 0000000..59330d5 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/Separator.d.ts @@ -0,0 +1,10 @@ +/** + * Separator object + * Used to space/separate choices group + */ +export declare class Separator { + readonly separator: string; + readonly type = "separator"; + constructor(separator?: string); + static isSeparator(choice: undefined | Separator | Record): choice is Separator; +} diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/create-prompt.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/create-prompt.d.ts new file mode 100644 index 0000000..4414db4 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/create-prompt.d.ts @@ -0,0 +1,4 @@ +import { type Prompt, type Prettify } from '@inquirer/type'; +type ViewFunction = (config: Prettify, done: (value: Value) => void) => string | [string, string | undefined]; +export declare function createPrompt(view: ViewFunction): Prompt; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/errors.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/errors.d.ts new file mode 100644 index 0000000..dd4cebe --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/errors.d.ts @@ -0,0 +1,9 @@ +export declare class CancelPromptError extends Error { + message: string; +} +export declare class ExitPromptError extends Error { +} +export declare class HookError extends Error { +} +export declare class ValidationError extends Error { +} diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/hook-engine.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/hook-engine.d.ts new file mode 100644 index 0000000..6b6f71a --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/hook-engine.d.ts @@ -0,0 +1,30 @@ +import type { InquirerReadline } from '@inquirer/type'; +type HookStore = { + rl: InquirerReadline; + hooks: any[]; + hooksCleanup: Array void)>; + hooksEffect: Array<() => void>; + index: number; + handleChange: () => void; +}; +export declare function withHooks(rl: InquirerReadline, cb: (store: HookStore) => void): void; +export declare function readline(): InquirerReadline; +export declare function withUpdates any>(fn: T): (...args: Parameters) => ReturnType; +type SetPointer = { + get(): Value; + set(value: Value): void; + initialized: true; +}; +type UnsetPointer = { + get(): void; + set(value: Value): void; + initialized: false; +}; +type Pointer = SetPointer | UnsetPointer; +export declare function withPointer(cb: (pointer: Pointer) => ReturnValue): ReturnValue; +export declare function handleChange(): void; +export declare const effectScheduler: { + queue(cb: (readline: InquirerReadline) => void): void; + run(): void; +}; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/key.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/key.d.ts new file mode 100644 index 0000000..e2ad3dc --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/key.d.ts @@ -0,0 +1,10 @@ +export type KeypressEvent = { + name: string; + ctrl: boolean; +}; +export declare const isUpKey: (key: KeypressEvent) => boolean; +export declare const isDownKey: (key: KeypressEvent) => boolean; +export declare const isSpaceKey: (key: KeypressEvent) => boolean; +export declare const isBackspaceKey: (key: KeypressEvent) => boolean; +export declare const isNumberKey: (key: KeypressEvent) => boolean; +export declare const isEnterKey: (key: KeypressEvent) => boolean; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/make-theme.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/make-theme.d.ts new file mode 100644 index 0000000..af6f3d6 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/make-theme.d.ts @@ -0,0 +1,3 @@ +import type { Prettify, PartialDeep } from '@inquirer/type'; +import { type Theme } from './theme.js'; +export declare function makeTheme(...themes: ReadonlyArray>>): Prettify>; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.d.ts new file mode 100644 index 0000000..5766195 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.d.ts @@ -0,0 +1,26 @@ +import { type Prettify } from '@inquirer/type'; +/** Represents an item that's part of a layout, about to be rendered */ +export type Layout = { + item: T; + index: number; + isActive: boolean; +}; +/** + * Renders a page of items as lines that fit within the given width ensuring + * that the number of lines is not greater than the page size, and the active + * item renders at the provided position, while prioritizing that as many lines + * of the active item get rendered as possible. + */ +export declare function lines({ items, width, renderItem, active, position: requested, pageSize, }: { + items: ReadonlyArray; + /** The width of a rendered line in characters. */ + width: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify>) => string; + /** The index of the active item in the list of items. */ + active: number; + /** The position on the page at which to render the active item. */ + position: number; + /** The number of lines to render per page. */ + pageSize: number; +}): string[]; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.test.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/lines.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/pagination/position.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/position.d.ts new file mode 100644 index 0000000..d74870e --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/position.d.ts @@ -0,0 +1,20 @@ +/** + * Creates the next position for the active item considering a finite list of + * items to be rendered on a page. + */ +export declare function finite({ active, pageSize, total, }: { + active: number; + pageSize: number; + total: number; +}): number; +/** + * Creates the next position for the active item considering an infinitely + * looping list of items to be rendered on the page. + */ +export declare function infinite({ active, lastActive, total, pageSize, pointer, }: { + active: number; + lastActive: number; + total: number; + pageSize: number; + pointer: number; +}): number; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/pagination/use-pagination.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/use-pagination.d.ts new file mode 100644 index 0000000..5408baf --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/pagination/use-pagination.d.ts @@ -0,0 +1,15 @@ +import type { Prettify } from '@inquirer/type'; +import { type Theme } from '../theme.js'; +import { type Layout } from './lines.js'; +export declare function usePagination({ items, active, renderItem, pageSize, loop, }: { + items: ReadonlyArray; + /** The index of the active item. */ + active: number; + /** Renders an item as part of a page. */ + renderItem: (layout: Prettify>) => string; + /** The size of the page. */ + pageSize: number; + /** Allows creating an infinitely looping list. `true` if unspecified. */ + loop?: boolean; + theme?: Theme; +}): string; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/screen-manager.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/screen-manager.d.ts new file mode 100644 index 0000000..4dbb77b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/screen-manager.d.ts @@ -0,0 +1,13 @@ +import type { InquirerReadline } from '@inquirer/type'; +export default class ScreenManager { + private readonly rl; + private height; + private extraLinesUnderPrompt; + private cursorPos; + constructor(rl: InquirerReadline); + render(content: string, bottomContent?: string): void; + checkCursorPos(): void; + clean(): void; + clearContent(): void; + done(): void; +} diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/theme.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/theme.d.ts new file mode 100644 index 0000000..c319617 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/theme.d.ts @@ -0,0 +1,20 @@ +import type { Prettify } from '@inquirer/type'; +type DefaultTheme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + key: (text: string) => string; + }; +}; +export type Theme = Prettify; +export declare const defaultTheme: DefaultTheme; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/use-effect.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/use-effect.d.ts new file mode 100644 index 0000000..abee906 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/use-effect.d.ts @@ -0,0 +1,2 @@ +import type { InquirerReadline } from '@inquirer/type'; +export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray): void; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/use-keypress.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/use-keypress.d.ts new file mode 100644 index 0000000..2995785 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/use-keypress.d.ts @@ -0,0 +1,3 @@ +import { type InquirerReadline } from '@inquirer/type'; +import { type KeypressEvent } from './key.js'; +export declare function useKeypress(userHandler: (event: KeypressEvent, rl: InquirerReadline) => void): void; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/use-memo.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/use-memo.d.ts new file mode 100644 index 0000000..19d1644 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/use-memo.d.ts @@ -0,0 +1 @@ +export declare function useMemo(fn: () => Value, dependencies: ReadonlyArray): Value; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/use-prefix.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/use-prefix.d.ts new file mode 100644 index 0000000..0a1c41f --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/use-prefix.d.ts @@ -0,0 +1,5 @@ +import { type Theme } from './theme.js'; +export declare function usePrefix({ isLoading, theme, }: { + isLoading?: boolean; + theme?: Theme; +}): string; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/use-ref.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/use-ref.d.ts new file mode 100644 index 0000000..be7126b --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/use-ref.d.ts @@ -0,0 +1,6 @@ +export declare function useRef(val: Value): { + current: Value; +}; +export declare function useRef(val?: Value): { + current: Value | undefined; +}; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/use-state.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/use-state.d.ts new file mode 100644 index 0000000..7730aed --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/use-state.d.ts @@ -0,0 +1,4 @@ +type NotFunction = T extends Function ? never : T; +export declare function useState(defaultValue: NotFunction | (() => Value)): [Value, (newValue: Value) => void]; +export declare function useState(defaultValue?: NotFunction | (() => Value)): [Value | undefined, (newValue?: Value | undefined) => void]; +export {}; diff --git a/dist/node_modules/@inquirer/core/dist/types/lib/utils.d.ts b/dist/node_modules/@inquirer/core/dist/types/lib/utils.d.ts new file mode 100644 index 0000000..14f8fc4 --- /dev/null +++ b/dist/node_modules/@inquirer/core/dist/types/lib/utils.d.ts @@ -0,0 +1,13 @@ +/** + * Force line returns at specific width. This function is ANSI code friendly and it'll + * ignore invisible codes during width calculation. + * @param {string} content + * @param {number} width + * @return {string} + */ +export declare function breakLines(content: string, width: number): string; +/** + * Returns the width of the active readline, or 80 as default value. + * @returns {number} + */ +export declare function readlineWidth(): number; diff --git a/dist/node_modules/@inquirer/core/package.json b/dist/node_modules/@inquirer/core/package.json new file mode 100644 index 0000000..6b2c8f6 --- /dev/null +++ b/dist/node_modules/@inquirer/core/package.json @@ -0,0 +1,101 @@ +{ + "name": "@inquirer/core", + "version": "9.0.2", + "engines": { + "node": ">=18" + }, + "description": "Core Inquirer prompt API", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/core/README.md", + "dependencies": { + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "@types/mute-stream": "^0.0.4", + "@types/node": "^20.14.9", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "cli-spinners": "^2.9.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/editor/LICENSE b/dist/node_modules/@inquirer/editor/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/editor/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/editor/README.md b/dist/node_modules/@inquirer/editor/README.md new file mode 100644 index 0000000..beceac7 --- /dev/null +++ b/dist/node_modules/@inquirer/editor/README.md @@ -0,0 +1,74 @@ +# `@inquirer/editor` + +Prompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line. + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/editor +``` + + + +```sh +yarn add @inquirer/editor +``` + +
+ +# Usage + +```js +import editor from '@inquirer/editor'; + +const answer = await editor({ + message: 'Enter a description', +}); +``` + +## Options + +| Property | Type | Required | Description | +| --------------- | ----------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `string` | no | Default value which will automatically be present in the editor | +| validate | `string => boolean \| string \| Promise` | no | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| postfix | `string` | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors. | +| waitForUseInput | `boolean` | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + message: (text: string) => string; + error: (text: string) => string; + help: (text: string) => string; + key: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/editor/dist/cjs/index.js b/dist/node_modules/@inquirer/editor/dist/cjs/index.js new file mode 100644 index 0000000..9e4d284 --- /dev/null +++ b/dist/node_modules/@inquirer/editor/dist/cjs/index.js @@ -0,0 +1,78 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_async_hooks_1 = require("node:async_hooks"); +const external_editor_1 = require("external-editor"); +const core_1 = require("@inquirer/core"); +exports.default = (0, core_1.createPrompt)((config, done) => { + const { waitForUseInput = true, validate = () => true } = config; + const theme = (0, core_1.makeTheme)(config.theme); + const [status, setStatus] = (0, core_1.useState)('pending'); + const [value, setValue] = (0, core_1.useState)(config.default || ''); + const [errorMsg, setError] = (0, core_1.useState)(); + const isLoading = status === 'loading'; + const prefix = (0, core_1.usePrefix)({ isLoading, theme }); + function startEditor(rl) { + rl.pause(); + (0, external_editor_1.editAsync)(value, + // Note: The bind call isn't strictly required. But we need it for our mocks to work as expected. + node_async_hooks_1.AsyncResource.bind((error, answer) => __awaiter(this, void 0, void 0, function* () { + rl.resume(); + if (error) { + setError(error.toString()); + } + else { + setStatus('loading'); + const isValid = yield validate(answer); + if (isValid === true) { + setError(undefined); + setStatus('done'); + done(answer); + } + else { + setValue(answer); + setError(isValid || 'You must provide a valid value'); + setStatus('pending'); + } + } + })), { + postfix: config.postfix || '.txt', + }); + } + (0, core_1.useEffect)((rl) => { + if (!waitForUseInput) { + startEditor(rl); + } + }, []); + (0, core_1.useKeypress)((key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if ((0, core_1.isEnterKey)(key)) { + startEditor(rl); + } + }); + const message = theme.style.message(config.message); + let helpTip = ''; + if (status === 'loading') { + helpTip = theme.style.help('Received'); + } + else if (status === 'pending') { + const enterKey = theme.style.key('enter'); + helpTip = theme.style.help(`Press ${enterKey} to launch your preferred editor.`); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, helpTip].filter(Boolean).join(' '), error]; +}); diff --git a/dist/node_modules/@inquirer/editor/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/editor/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..12b0ab3 --- /dev/null +++ b/dist/node_modules/@inquirer/editor/dist/cjs/types/index.d.ts @@ -0,0 +1,12 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type EditorConfig = { + message: string; + default?: string; + postfix?: string; + waitForUseInput?: boolean; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/editor/dist/esm/index.mjs b/dist/node_modules/@inquirer/editor/dist/esm/index.mjs new file mode 100644 index 0000000..3004dde --- /dev/null +++ b/dist/node_modules/@inquirer/editor/dist/esm/index.mjs @@ -0,0 +1,67 @@ +import { AsyncResource } from 'node:async_hooks'; +import { editAsync } from 'external-editor'; +import { createPrompt, useEffect, useState, useKeypress, usePrefix, isEnterKey, makeTheme, } from '@inquirer/core'; +export default createPrompt((config, done) => { + const { waitForUseInput = true, validate = () => true } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState('pending'); + const [value, setValue] = useState(config.default || ''); + const [errorMsg, setError] = useState(); + const isLoading = status === 'loading'; + const prefix = usePrefix({ isLoading, theme }); + function startEditor(rl) { + rl.pause(); + editAsync(value, + // Note: The bind call isn't strictly required. But we need it for our mocks to work as expected. + AsyncResource.bind(async (error, answer) => { + rl.resume(); + if (error) { + setError(error.toString()); + } + else { + setStatus('loading'); + const isValid = await validate(answer); + if (isValid === true) { + setError(undefined); + setStatus('done'); + done(answer); + } + else { + setValue(answer); + setError(isValid || 'You must provide a valid value'); + setStatus('pending'); + } + } + }), { + postfix: config.postfix || '.txt', + }); + } + useEffect((rl) => { + if (!waitForUseInput) { + startEditor(rl); + } + }, []); + useKeypress((key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if (isEnterKey(key)) { + startEditor(rl); + } + }); + const message = theme.style.message(config.message); + let helpTip = ''; + if (status === 'loading') { + helpTip = theme.style.help('Received'); + } + else if (status === 'pending') { + const enterKey = theme.style.key('enter'); + helpTip = theme.style.help(`Press ${enterKey} to launch your preferred editor.`); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, helpTip].filter(Boolean).join(' '), error]; +}); diff --git a/dist/node_modules/@inquirer/editor/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/editor/dist/esm/types/index.d.mts new file mode 100644 index 0000000..12b0ab3 --- /dev/null +++ b/dist/node_modules/@inquirer/editor/dist/esm/types/index.d.mts @@ -0,0 +1,12 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type EditorConfig = { + message: string; + default?: string; + postfix?: string; + waitForUseInput?: boolean; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/editor/dist/types/index.d.ts b/dist/node_modules/@inquirer/editor/dist/types/index.d.ts new file mode 100644 index 0000000..12b0ab3 --- /dev/null +++ b/dist/node_modules/@inquirer/editor/dist/types/index.d.ts @@ -0,0 +1,12 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type EditorConfig = { + message: string; + default?: string; + postfix?: string; + waitForUseInput?: boolean; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/editor/package.json b/dist/node_modules/@inquirer/editor/package.json new file mode 100644 index 0000000..375f48f --- /dev/null +++ b/dist/node_modules/@inquirer/editor/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/editor", + "version": "2.1.14", + "description": "Inquirer multiline editor prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/editor/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "external-editor": "^3.1.0" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/expand/LICENSE b/dist/node_modules/@inquirer/expand/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/expand/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/expand/README.md b/dist/node_modules/@inquirer/expand/README.md new file mode 100644 index 0000000..f2a1a03 --- /dev/null +++ b/dist/node_modules/@inquirer/expand/README.md @@ -0,0 +1,100 @@ +# `@inquirer/expand` + +Compact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions. + +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/expand +``` + + + +```sh +yarn add @inquirer/expand +``` + +
+ +# Usage + +```js +import expand from '@inquirer/expand'; + +const answer = await expand({ + message: 'Conflict on file.js', + default: 'y', + choices: [ + { + key: 'y', + name: 'Overwrite', + value: 'overwrite', + }, + { + key: 'a', + name: 'Overwrite this one and all next', + value: 'overwrite_all', + }, + { + key: 'd', + name: 'Show diff', + value: 'diff', + }, + { + key: 'x', + name: 'Abort', + value: 'abort', + }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Array<{ key: string, name: string, value?: string }>` | yes | Array of the different allowed choices. The `h`/help option is always provided by default | +| default | `string` | no | Default choices to be selected. (value must be one of the choices `key`) | +| expanded | `boolean` | no | Expand the choices by default | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + highlight: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/expand/dist/cjs/index.js b/dist/node_modules/@inquirer/expand/dist/cjs/index.js new file mode 100644 index 0000000..b9d667b --- /dev/null +++ b/dist/node_modules/@inquirer/expand/dist/cjs/index.js @@ -0,0 +1,101 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("@inquirer/core"); +const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); +const helpChoice = { + key: 'h', + name: 'Help, list all options', + value: undefined, +}; +function getChoiceKey(choice, key) { + if (key === 'name') { + if ('name' in choice) + return choice.name; + return choice.value; + } + if ('value' in choice) + return choice.value; + return choice.name; +} +exports.default = (0, core_1.createPrompt)((config, done) => { + const { choices, default: defaultKey = 'h', expanded: defaultExpandState = false, } = config; + const [status, setStatus] = (0, core_1.useState)('pending'); + const [value, setValue] = (0, core_1.useState)(''); + const [expanded, setExpanded] = (0, core_1.useState)(defaultExpandState); + const [errorMsg, setError] = (0, core_1.useState)(); + const theme = (0, core_1.makeTheme)(config.theme); + const prefix = (0, core_1.usePrefix)({ theme }); + (0, core_1.useKeypress)((event, rl) => { + if ((0, core_1.isEnterKey)(event)) { + const answer = (value || defaultKey).toLowerCase(); + if (answer === 'h' && !expanded) { + setExpanded(true); + } + else { + const selectedChoice = choices.find(({ key }) => key === answer); + if (selectedChoice) { + const finalValue = getChoiceKey(selectedChoice, 'value'); + setValue(finalValue); + setStatus('done'); + done(finalValue); + } + else if (value === '') { + setError('Please input a value'); + } + else { + setError(`"${yoctocolors_cjs_1.default.red(value)}" isn't an available option`); + } + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + if (status === 'done') { + // TODO: `value` should be the display name instead of the raw value. + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + const allChoices = expanded ? choices : [...choices, helpChoice]; + // Collapsed display style + let longChoices = ''; + let shortChoices = allChoices + .map((choice) => { + if (choice.key === defaultKey) { + return choice.key.toUpperCase(); + } + return choice.key; + }) + .join(''); + shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`; + // Expanded display style + if (expanded) { + shortChoices = ''; + longChoices = allChoices + .map((choice) => { + const line = ` ${choice.key}) ${getChoiceKey(choice, 'name')}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }) + .join('\n'); + } + let helpTip = ''; + const currentOption = allChoices.find(({ key }) => key === value.toLowerCase()); + if (currentOption) { + helpTip = `${yoctocolors_cjs_1.default.cyan('>>')} ${getChoiceKey(currentOption, 'name')}`; + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message}${shortChoices} ${value}`, + [longChoices, helpTip, error].filter(Boolean).join('\n'), + ]; +}); diff --git a/dist/node_modules/@inquirer/expand/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/expand/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..3043622 --- /dev/null +++ b/dist/node_modules/@inquirer/expand/dist/cjs/types/index.d.ts @@ -0,0 +1,22 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ExpandChoice = { + key: string; + name: string; +} | { + key: string; + value: string; +} | { + key: string; + name: string; + value: string; +}; +type ExpandConfig = { + message: string; + choices: ReadonlyArray; + default?: string; + expanded?: boolean; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/expand/dist/esm/index.mjs b/dist/node_modules/@inquirer/expand/dist/esm/index.mjs new file mode 100644 index 0000000..f75a545 --- /dev/null +++ b/dist/node_modules/@inquirer/expand/dist/esm/index.mjs @@ -0,0 +1,96 @@ +import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, makeTheme, } from '@inquirer/core'; +import colors from 'yoctocolors-cjs'; +const helpChoice = { + key: 'h', + name: 'Help, list all options', + value: undefined, +}; +function getChoiceKey(choice, key) { + if (key === 'name') { + if ('name' in choice) + return choice.name; + return choice.value; + } + if ('value' in choice) + return choice.value; + return choice.name; +} +export default createPrompt((config, done) => { + const { choices, default: defaultKey = 'h', expanded: defaultExpandState = false, } = config; + const [status, setStatus] = useState('pending'); + const [value, setValue] = useState(''); + const [expanded, setExpanded] = useState(defaultExpandState); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ theme }); + useKeypress((event, rl) => { + if (isEnterKey(event)) { + const answer = (value || defaultKey).toLowerCase(); + if (answer === 'h' && !expanded) { + setExpanded(true); + } + else { + const selectedChoice = choices.find(({ key }) => key === answer); + if (selectedChoice) { + const finalValue = getChoiceKey(selectedChoice, 'value'); + setValue(finalValue); + setStatus('done'); + done(finalValue); + } + else if (value === '') { + setError('Please input a value'); + } + else { + setError(`"${colors.red(value)}" isn't an available option`); + } + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + if (status === 'done') { + // TODO: `value` should be the display name instead of the raw value. + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + const allChoices = expanded ? choices : [...choices, helpChoice]; + // Collapsed display style + let longChoices = ''; + let shortChoices = allChoices + .map((choice) => { + if (choice.key === defaultKey) { + return choice.key.toUpperCase(); + } + return choice.key; + }) + .join(''); + shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`; + // Expanded display style + if (expanded) { + shortChoices = ''; + longChoices = allChoices + .map((choice) => { + const line = ` ${choice.key}) ${getChoiceKey(choice, 'name')}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }) + .join('\n'); + } + let helpTip = ''; + const currentOption = allChoices.find(({ key }) => key === value.toLowerCase()); + if (currentOption) { + helpTip = `${colors.cyan('>>')} ${getChoiceKey(currentOption, 'name')}`; + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message}${shortChoices} ${value}`, + [longChoices, helpTip, error].filter(Boolean).join('\n'), + ]; +}); diff --git a/dist/node_modules/@inquirer/expand/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/expand/dist/esm/types/index.d.mts new file mode 100644 index 0000000..3043622 --- /dev/null +++ b/dist/node_modules/@inquirer/expand/dist/esm/types/index.d.mts @@ -0,0 +1,22 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ExpandChoice = { + key: string; + name: string; +} | { + key: string; + value: string; +} | { + key: string; + name: string; + value: string; +}; +type ExpandConfig = { + message: string; + choices: ReadonlyArray; + default?: string; + expanded?: boolean; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/expand/dist/types/index.d.ts b/dist/node_modules/@inquirer/expand/dist/types/index.d.ts new file mode 100644 index 0000000..3043622 --- /dev/null +++ b/dist/node_modules/@inquirer/expand/dist/types/index.d.ts @@ -0,0 +1,22 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type ExpandChoice = { + key: string; + name: string; +} | { + key: string; + value: string; +} | { + key: string; + name: string; + value: string; +}; +type ExpandConfig = { + message: string; + choices: ReadonlyArray; + default?: string; + expanded?: boolean; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/expand/package.json b/dist/node_modules/@inquirer/expand/package.json new file mode 100644 index 0000000..efdef63 --- /dev/null +++ b/dist/node_modules/@inquirer/expand/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/expand", + "version": "2.1.14", + "description": "Inquirer checkbox prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/expand/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "yoctocolors-cjs": "^2.1.2" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/figures/LICENSE b/dist/node_modules/@inquirer/figures/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/figures/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/figures/dist/cjs/index.js b/dist/node_modules/@inquirer/figures/dist/cjs/index.js new file mode 100644 index 0000000..0e86a45 --- /dev/null +++ b/dist/node_modules/@inquirer/figures/dist/cjs/index.js @@ -0,0 +1,313 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.replaceSymbols = exports.fallbackSymbols = exports.mainSymbols = void 0; +// process.env dot-notation access prints: +// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111) +/* eslint dot-notation: ["off"] */ +const node_process_1 = __importDefault(require("node:process")); +// Ported from is-unicode-supported +function isUnicodeSupported() { + if (node_process_1.default.platform !== 'win32') { + return node_process_1.default.env['TERM'] !== 'linux'; // Linux console (kernel) + } + return (Boolean(node_process_1.default.env['WT_SESSION']) || // Windows Terminal + Boolean(node_process_1.default.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27) + node_process_1.default.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder + node_process_1.default.env['TERM_PROGRAM'] === 'Terminus-Sublime' || + node_process_1.default.env['TERM_PROGRAM'] === 'vscode' || + node_process_1.default.env['TERM'] === 'xterm-256color' || + node_process_1.default.env['TERM'] === 'alacritty' || + node_process_1.default.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm'); +} +// Ported from figures +const common = { + circleQuestionMark: '(?)', + questionMarkPrefix: '(?)', + square: '█', + squareDarkShade: '▓', + squareMediumShade: '▒', + squareLightShade: '░', + squareTop: '▀', + squareBottom: '▄', + squareLeft: '▌', + squareRight: '▐', + squareCenter: '■', + bullet: '●', + dot: '․', + ellipsis: '…', + pointerSmall: '›', + triangleUp: '▲', + triangleUpSmall: '▴', + triangleDown: '▼', + triangleDownSmall: '▾', + triangleLeftSmall: '◂', + triangleRightSmall: '▸', + home: '⌂', + heart: '♥', + musicNote: '♪', + musicNoteBeamed: '♫', + arrowUp: '↑', + arrowDown: '↓', + arrowLeft: '←', + arrowRight: '→', + arrowLeftRight: '↔', + arrowUpDown: '↕', + almostEqual: '≈', + notEqual: '≠', + lessOrEqual: '≤', + greaterOrEqual: '≥', + identical: '≡', + infinity: '∞', + subscriptZero: '₀', + subscriptOne: '₁', + subscriptTwo: '₂', + subscriptThree: '₃', + subscriptFour: '₄', + subscriptFive: '₅', + subscriptSix: '₆', + subscriptSeven: '₇', + subscriptEight: '₈', + subscriptNine: '₉', + oneHalf: '½', + oneThird: '⅓', + oneQuarter: '¼', + oneFifth: '⅕', + oneSixth: '⅙', + oneEighth: '⅛', + twoThirds: '⅔', + twoFifths: '⅖', + threeQuarters: '¾', + threeFifths: '⅗', + threeEighths: '⅜', + fourFifths: '⅘', + fiveSixths: '⅚', + fiveEighths: '⅝', + sevenEighths: '⅞', + line: '─', + lineBold: '━', + lineDouble: '═', + lineDashed0: '┄', + lineDashed1: '┅', + lineDashed2: '┈', + lineDashed3: '┉', + lineDashed4: '╌', + lineDashed5: '╍', + lineDashed6: '╴', + lineDashed7: '╶', + lineDashed8: '╸', + lineDashed9: '╺', + lineDashed10: '╼', + lineDashed11: '╾', + lineDashed12: '−', + lineDashed13: '–', + lineDashed14: '‐', + lineDashed15: '⁃', + lineVertical: '│', + lineVerticalBold: '┃', + lineVerticalDouble: '║', + lineVerticalDashed0: '┆', + lineVerticalDashed1: '┇', + lineVerticalDashed2: '┊', + lineVerticalDashed3: '┋', + lineVerticalDashed4: '╎', + lineVerticalDashed5: '╏', + lineVerticalDashed6: '╵', + lineVerticalDashed7: '╷', + lineVerticalDashed8: '╹', + lineVerticalDashed9: '╻', + lineVerticalDashed10: '╽', + lineVerticalDashed11: '╿', + lineDownLeft: '┐', + lineDownLeftArc: '╮', + lineDownBoldLeftBold: '┓', + lineDownBoldLeft: '┒', + lineDownLeftBold: '┑', + lineDownDoubleLeftDouble: '╗', + lineDownDoubleLeft: '╖', + lineDownLeftDouble: '╕', + lineDownRight: '┌', + lineDownRightArc: '╭', + lineDownBoldRightBold: '┏', + lineDownBoldRight: '┎', + lineDownRightBold: '┍', + lineDownDoubleRightDouble: '╔', + lineDownDoubleRight: '╓', + lineDownRightDouble: '╒', + lineUpLeft: '┘', + lineUpLeftArc: '╯', + lineUpBoldLeftBold: '┛', + lineUpBoldLeft: '┚', + lineUpLeftBold: '┙', + lineUpDoubleLeftDouble: '╝', + lineUpDoubleLeft: '╜', + lineUpLeftDouble: '╛', + lineUpRight: '└', + lineUpRightArc: '╰', + lineUpBoldRightBold: '┗', + lineUpBoldRight: '┖', + lineUpRightBold: '┕', + lineUpDoubleRightDouble: '╚', + lineUpDoubleRight: '╙', + lineUpRightDouble: '╘', + lineUpDownLeft: '┤', + lineUpBoldDownBoldLeftBold: '┫', + lineUpBoldDownBoldLeft: '┨', + lineUpDownLeftBold: '┥', + lineUpBoldDownLeftBold: '┩', + lineUpDownBoldLeftBold: '┪', + lineUpDownBoldLeft: '┧', + lineUpBoldDownLeft: '┦', + lineUpDoubleDownDoubleLeftDouble: '╣', + lineUpDoubleDownDoubleLeft: '╢', + lineUpDownLeftDouble: '╡', + lineUpDownRight: '├', + lineUpBoldDownBoldRightBold: '┣', + lineUpBoldDownBoldRight: '┠', + lineUpDownRightBold: '┝', + lineUpBoldDownRightBold: '┡', + lineUpDownBoldRightBold: '┢', + lineUpDownBoldRight: '┟', + lineUpBoldDownRight: '┞', + lineUpDoubleDownDoubleRightDouble: '╠', + lineUpDoubleDownDoubleRight: '╟', + lineUpDownRightDouble: '╞', + lineDownLeftRight: '┬', + lineDownBoldLeftBoldRightBold: '┳', + lineDownLeftBoldRightBold: '┯', + lineDownBoldLeftRight: '┰', + lineDownBoldLeftBoldRight: '┱', + lineDownBoldLeftRightBold: '┲', + lineDownLeftRightBold: '┮', + lineDownLeftBoldRight: '┭', + lineDownDoubleLeftDoubleRightDouble: '╦', + lineDownDoubleLeftRight: '╥', + lineDownLeftDoubleRightDouble: '╤', + lineUpLeftRight: '┴', + lineUpBoldLeftBoldRightBold: '┻', + lineUpLeftBoldRightBold: '┷', + lineUpBoldLeftRight: '┸', + lineUpBoldLeftBoldRight: '┹', + lineUpBoldLeftRightBold: '┺', + lineUpLeftRightBold: '┶', + lineUpLeftBoldRight: '┵', + lineUpDoubleLeftDoubleRightDouble: '╩', + lineUpDoubleLeftRight: '╨', + lineUpLeftDoubleRightDouble: '╧', + lineUpDownLeftRight: '┼', + lineUpBoldDownBoldLeftBoldRightBold: '╋', + lineUpDownBoldLeftBoldRightBold: '╈', + lineUpBoldDownLeftBoldRightBold: '╇', + lineUpBoldDownBoldLeftRightBold: '╊', + lineUpBoldDownBoldLeftBoldRight: '╉', + lineUpBoldDownLeftRight: '╀', + lineUpDownBoldLeftRight: '╁', + lineUpDownLeftBoldRight: '┽', + lineUpDownLeftRightBold: '┾', + lineUpBoldDownBoldLeftRight: '╂', + lineUpDownLeftBoldRightBold: '┿', + lineUpBoldDownLeftBoldRight: '╃', + lineUpBoldDownLeftRightBold: '╄', + lineUpDownBoldLeftBoldRight: '╅', + lineUpDownBoldLeftRightBold: '╆', + lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬', + lineUpDoubleDownDoubleLeftRight: '╫', + lineUpDownLeftDoubleRightDouble: '╪', + lineCross: '╳', + lineBackslash: '╲', + lineSlash: '╱', +}; +const specialMainSymbols = { + tick: '✔', + info: 'ℹ', + warning: '⚠', + cross: '✘', + squareSmall: '◻', + squareSmallFilled: '◼', + circle: '◯', + circleFilled: '◉', + circleDotted: '◌', + circleDouble: '◎', + circleCircle: 'ⓞ', + circleCross: 'ⓧ', + circlePipe: 'Ⓘ', + radioOn: '◉', + radioOff: '◯', + checkboxOn: '☒', + checkboxOff: '☐', + checkboxCircleOn: 'ⓧ', + checkboxCircleOff: 'Ⓘ', + pointer: '❯', + triangleUpOutline: '△', + triangleLeft: '◀', + triangleRight: '▶', + lozenge: '◆', + lozengeOutline: '◇', + hamburger: '☰', + smiley: '㋡', + mustache: '෴', + star: '★', + play: '▶', + nodejs: '⬢', + oneSeventh: '⅐', + oneNinth: '⅑', + oneTenth: '⅒', +}; +const specialFallbackSymbols = { + tick: '√', + info: 'i', + warning: '‼', + cross: '×', + squareSmall: '□', + squareSmallFilled: '■', + circle: '( )', + circleFilled: '(*)', + circleDotted: '( )', + circleDouble: '( )', + circleCircle: '(○)', + circleCross: '(×)', + circlePipe: '(│)', + radioOn: '(*)', + radioOff: '( )', + checkboxOn: '[×]', + checkboxOff: '[ ]', + checkboxCircleOn: '(×)', + checkboxCircleOff: '( )', + pointer: '>', + triangleUpOutline: '∆', + triangleLeft: '◄', + triangleRight: '►', + lozenge: '♦', + lozengeOutline: '◊', + hamburger: '≡', + smiley: '☺', + mustache: '┌─┐', + star: '✶', + play: '►', + nodejs: '♦', + oneSeventh: '1/7', + oneNinth: '1/9', + oneTenth: '1/10', +}; +exports.mainSymbols = Object.assign(Object.assign({}, common), specialMainSymbols); +exports.fallbackSymbols = Object.assign(Object.assign({}, common), specialFallbackSymbols); +const shouldUseMain = isUnicodeSupported(); +const figures = shouldUseMain ? exports.mainSymbols : exports.fallbackSymbols; +exports.default = figures; +const replacements = Object.entries(specialMainSymbols); +// On terminals which do not support Unicode symbols, substitute them to other symbols +const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => { + if (useFallback) { + for (const [key, mainSymbol] of replacements) { + const fallbackSymbol = exports.fallbackSymbols[key]; + if (!fallbackSymbol) { + throw new Error(`Unable to find fallback for ${key}`); + } + string = string.replaceAll(mainSymbol, fallbackSymbol); + } + } + return string; +}; +exports.replaceSymbols = replaceSymbols; diff --git a/dist/node_modules/@inquirer/figures/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/figures/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..f8202e5 --- /dev/null +++ b/dist/node_modules/@inquirer/figures/dist/cjs/types/index.d.ts @@ -0,0 +1,465 @@ +export declare const mainSymbols: { + tick: string; + info: string; + warning: string; + cross: string; + squareSmall: string; + squareSmallFilled: string; + circle: string; + circleFilled: string; + circleDotted: string; + circleDouble: string; + circleCircle: string; + circleCross: string; + circlePipe: string; + radioOn: string; + radioOff: string; + checkboxOn: string; + checkboxOff: string; + checkboxCircleOn: string; + checkboxCircleOff: string; + pointer: string; + triangleUpOutline: string; + triangleLeft: string; + triangleRight: string; + lozenge: string; + lozengeOutline: string; + hamburger: string; + smiley: string; + mustache: string; + star: string; + play: string; + nodejs: string; + oneSeventh: string; + oneNinth: string; + oneTenth: string; + circleQuestionMark: string; + questionMarkPrefix: string; + square: string; + squareDarkShade: string; + squareMediumShade: string; + squareLightShade: string; + squareTop: string; + squareBottom: string; + squareLeft: string; + squareRight: string; + squareCenter: string; + bullet: string; + dot: string; + ellipsis: string; + pointerSmall: string; + triangleUp: string; + triangleUpSmall: string; + triangleDown: string; + triangleDownSmall: string; + triangleLeftSmall: string; + triangleRightSmall: string; + home: string; + heart: string; + musicNote: string; + musicNoteBeamed: string; + arrowUp: string; + arrowDown: string; + arrowLeft: string; + arrowRight: string; + arrowLeftRight: string; + arrowUpDown: string; + almostEqual: string; + notEqual: string; + lessOrEqual: string; + greaterOrEqual: string; + identical: string; + infinity: string; + subscriptZero: string; + subscriptOne: string; + subscriptTwo: string; + subscriptThree: string; + subscriptFour: string; + subscriptFive: string; + subscriptSix: string; + subscriptSeven: string; + subscriptEight: string; + subscriptNine: string; + oneHalf: string; + oneThird: string; + oneQuarter: string; + oneFifth: string; + oneSixth: string; + oneEighth: string; + twoThirds: string; + twoFifths: string; + threeQuarters: string; + threeFifths: string; + threeEighths: string; + fourFifths: string; + fiveSixths: string; + fiveEighths: string; + sevenEighths: string; + line: string; + lineBold: string; + lineDouble: string; + lineDashed0: string; + lineDashed1: string; + lineDashed2: string; + lineDashed3: string; + lineDashed4: string; + lineDashed5: string; + lineDashed6: string; + lineDashed7: string; + lineDashed8: string; + lineDashed9: string; + lineDashed10: string; + lineDashed11: string; + lineDashed12: string; + lineDashed13: string; + lineDashed14: string; + lineDashed15: string; + lineVertical: string; + lineVerticalBold: string; + lineVerticalDouble: string; + lineVerticalDashed0: string; + lineVerticalDashed1: string; + lineVerticalDashed2: string; + lineVerticalDashed3: string; + lineVerticalDashed4: string; + lineVerticalDashed5: string; + lineVerticalDashed6: string; + lineVerticalDashed7: string; + lineVerticalDashed8: string; + lineVerticalDashed9: string; + lineVerticalDashed10: string; + lineVerticalDashed11: string; + lineDownLeft: string; + lineDownLeftArc: string; + lineDownBoldLeftBold: string; + lineDownBoldLeft: string; + lineDownLeftBold: string; + lineDownDoubleLeftDouble: string; + lineDownDoubleLeft: string; + lineDownLeftDouble: string; + lineDownRight: string; + lineDownRightArc: string; + lineDownBoldRightBold: string; + lineDownBoldRight: string; + lineDownRightBold: string; + lineDownDoubleRightDouble: string; + lineDownDoubleRight: string; + lineDownRightDouble: string; + lineUpLeft: string; + lineUpLeftArc: string; + lineUpBoldLeftBold: string; + lineUpBoldLeft: string; + lineUpLeftBold: string; + lineUpDoubleLeftDouble: string; + lineUpDoubleLeft: string; + lineUpLeftDouble: string; + lineUpRight: string; + lineUpRightArc: string; + lineUpBoldRightBold: string; + lineUpBoldRight: string; + lineUpRightBold: string; + lineUpDoubleRightDouble: string; + lineUpDoubleRight: string; + lineUpRightDouble: string; + lineUpDownLeft: string; + lineUpBoldDownBoldLeftBold: string; + lineUpBoldDownBoldLeft: string; + lineUpDownLeftBold: string; + lineUpBoldDownLeftBold: string; + lineUpDownBoldLeftBold: string; + lineUpDownBoldLeft: string; + lineUpBoldDownLeft: string; + lineUpDoubleDownDoubleLeftDouble: string; + lineUpDoubleDownDoubleLeft: string; + lineUpDownLeftDouble: string; + lineUpDownRight: string; + lineUpBoldDownBoldRightBold: string; + lineUpBoldDownBoldRight: string; + lineUpDownRightBold: string; + lineUpBoldDownRightBold: string; + lineUpDownBoldRightBold: string; + lineUpDownBoldRight: string; + lineUpBoldDownRight: string; + lineUpDoubleDownDoubleRightDouble: string; + lineUpDoubleDownDoubleRight: string; + lineUpDownRightDouble: string; + lineDownLeftRight: string; + lineDownBoldLeftBoldRightBold: string; + lineDownLeftBoldRightBold: string; + lineDownBoldLeftRight: string; + lineDownBoldLeftBoldRight: string; + lineDownBoldLeftRightBold: string; + lineDownLeftRightBold: string; + lineDownLeftBoldRight: string; + lineDownDoubleLeftDoubleRightDouble: string; + lineDownDoubleLeftRight: string; + lineDownLeftDoubleRightDouble: string; + lineUpLeftRight: string; + lineUpBoldLeftBoldRightBold: string; + lineUpLeftBoldRightBold: string; + lineUpBoldLeftRight: string; + lineUpBoldLeftBoldRight: string; + lineUpBoldLeftRightBold: string; + lineUpLeftRightBold: string; + lineUpLeftBoldRight: string; + lineUpDoubleLeftDoubleRightDouble: string; + lineUpDoubleLeftRight: string; + lineUpLeftDoubleRightDouble: string; + lineUpDownLeftRight: string; + lineUpBoldDownBoldLeftBoldRightBold: string; + lineUpDownBoldLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRightBold: string; + lineUpBoldDownBoldLeftRightBold: string; + lineUpBoldDownBoldLeftBoldRight: string; + lineUpBoldDownLeftRight: string; + lineUpDownBoldLeftRight: string; + lineUpDownLeftBoldRight: string; + lineUpDownLeftRightBold: string; + lineUpBoldDownBoldLeftRight: string; + lineUpDownLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRight: string; + lineUpBoldDownLeftRightBold: string; + lineUpDownBoldLeftBoldRight: string; + lineUpDownBoldLeftRightBold: string; + lineUpDoubleDownDoubleLeftDoubleRightDouble: string; + lineUpDoubleDownDoubleLeftRight: string; + lineUpDownLeftDoubleRightDouble: string; + lineCross: string; + lineBackslash: string; + lineSlash: string; +}; +export declare const fallbackSymbols: Record; +declare const figures: { + tick: string; + info: string; + warning: string; + cross: string; + squareSmall: string; + squareSmallFilled: string; + circle: string; + circleFilled: string; + circleDotted: string; + circleDouble: string; + circleCircle: string; + circleCross: string; + circlePipe: string; + radioOn: string; + radioOff: string; + checkboxOn: string; + checkboxOff: string; + checkboxCircleOn: string; + checkboxCircleOff: string; + pointer: string; + triangleUpOutline: string; + triangleLeft: string; + triangleRight: string; + lozenge: string; + lozengeOutline: string; + hamburger: string; + smiley: string; + mustache: string; + star: string; + play: string; + nodejs: string; + oneSeventh: string; + oneNinth: string; + oneTenth: string; + circleQuestionMark: string; + questionMarkPrefix: string; + square: string; + squareDarkShade: string; + squareMediumShade: string; + squareLightShade: string; + squareTop: string; + squareBottom: string; + squareLeft: string; + squareRight: string; + squareCenter: string; + bullet: string; + dot: string; + ellipsis: string; + pointerSmall: string; + triangleUp: string; + triangleUpSmall: string; + triangleDown: string; + triangleDownSmall: string; + triangleLeftSmall: string; + triangleRightSmall: string; + home: string; + heart: string; + musicNote: string; + musicNoteBeamed: string; + arrowUp: string; + arrowDown: string; + arrowLeft: string; + arrowRight: string; + arrowLeftRight: string; + arrowUpDown: string; + almostEqual: string; + notEqual: string; + lessOrEqual: string; + greaterOrEqual: string; + identical: string; + infinity: string; + subscriptZero: string; + subscriptOne: string; + subscriptTwo: string; + subscriptThree: string; + subscriptFour: string; + subscriptFive: string; + subscriptSix: string; + subscriptSeven: string; + subscriptEight: string; + subscriptNine: string; + oneHalf: string; + oneThird: string; + oneQuarter: string; + oneFifth: string; + oneSixth: string; + oneEighth: string; + twoThirds: string; + twoFifths: string; + threeQuarters: string; + threeFifths: string; + threeEighths: string; + fourFifths: string; + fiveSixths: string; + fiveEighths: string; + sevenEighths: string; + line: string; + lineBold: string; + lineDouble: string; + lineDashed0: string; + lineDashed1: string; + lineDashed2: string; + lineDashed3: string; + lineDashed4: string; + lineDashed5: string; + lineDashed6: string; + lineDashed7: string; + lineDashed8: string; + lineDashed9: string; + lineDashed10: string; + lineDashed11: string; + lineDashed12: string; + lineDashed13: string; + lineDashed14: string; + lineDashed15: string; + lineVertical: string; + lineVerticalBold: string; + lineVerticalDouble: string; + lineVerticalDashed0: string; + lineVerticalDashed1: string; + lineVerticalDashed2: string; + lineVerticalDashed3: string; + lineVerticalDashed4: string; + lineVerticalDashed5: string; + lineVerticalDashed6: string; + lineVerticalDashed7: string; + lineVerticalDashed8: string; + lineVerticalDashed9: string; + lineVerticalDashed10: string; + lineVerticalDashed11: string; + lineDownLeft: string; + lineDownLeftArc: string; + lineDownBoldLeftBold: string; + lineDownBoldLeft: string; + lineDownLeftBold: string; + lineDownDoubleLeftDouble: string; + lineDownDoubleLeft: string; + lineDownLeftDouble: string; + lineDownRight: string; + lineDownRightArc: string; + lineDownBoldRightBold: string; + lineDownBoldRight: string; + lineDownRightBold: string; + lineDownDoubleRightDouble: string; + lineDownDoubleRight: string; + lineDownRightDouble: string; + lineUpLeft: string; + lineUpLeftArc: string; + lineUpBoldLeftBold: string; + lineUpBoldLeft: string; + lineUpLeftBold: string; + lineUpDoubleLeftDouble: string; + lineUpDoubleLeft: string; + lineUpLeftDouble: string; + lineUpRight: string; + lineUpRightArc: string; + lineUpBoldRightBold: string; + lineUpBoldRight: string; + lineUpRightBold: string; + lineUpDoubleRightDouble: string; + lineUpDoubleRight: string; + lineUpRightDouble: string; + lineUpDownLeft: string; + lineUpBoldDownBoldLeftBold: string; + lineUpBoldDownBoldLeft: string; + lineUpDownLeftBold: string; + lineUpBoldDownLeftBold: string; + lineUpDownBoldLeftBold: string; + lineUpDownBoldLeft: string; + lineUpBoldDownLeft: string; + lineUpDoubleDownDoubleLeftDouble: string; + lineUpDoubleDownDoubleLeft: string; + lineUpDownLeftDouble: string; + lineUpDownRight: string; + lineUpBoldDownBoldRightBold: string; + lineUpBoldDownBoldRight: string; + lineUpDownRightBold: string; + lineUpBoldDownRightBold: string; + lineUpDownBoldRightBold: string; + lineUpDownBoldRight: string; + lineUpBoldDownRight: string; + lineUpDoubleDownDoubleRightDouble: string; + lineUpDoubleDownDoubleRight: string; + lineUpDownRightDouble: string; + lineDownLeftRight: string; + lineDownBoldLeftBoldRightBold: string; + lineDownLeftBoldRightBold: string; + lineDownBoldLeftRight: string; + lineDownBoldLeftBoldRight: string; + lineDownBoldLeftRightBold: string; + lineDownLeftRightBold: string; + lineDownLeftBoldRight: string; + lineDownDoubleLeftDoubleRightDouble: string; + lineDownDoubleLeftRight: string; + lineDownLeftDoubleRightDouble: string; + lineUpLeftRight: string; + lineUpBoldLeftBoldRightBold: string; + lineUpLeftBoldRightBold: string; + lineUpBoldLeftRight: string; + lineUpBoldLeftBoldRight: string; + lineUpBoldLeftRightBold: string; + lineUpLeftRightBold: string; + lineUpLeftBoldRight: string; + lineUpDoubleLeftDoubleRightDouble: string; + lineUpDoubleLeftRight: string; + lineUpLeftDoubleRightDouble: string; + lineUpDownLeftRight: string; + lineUpBoldDownBoldLeftBoldRightBold: string; + lineUpDownBoldLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRightBold: string; + lineUpBoldDownBoldLeftRightBold: string; + lineUpBoldDownBoldLeftBoldRight: string; + lineUpBoldDownLeftRight: string; + lineUpDownBoldLeftRight: string; + lineUpDownLeftBoldRight: string; + lineUpDownLeftRightBold: string; + lineUpBoldDownBoldLeftRight: string; + lineUpDownLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRight: string; + lineUpBoldDownLeftRightBold: string; + lineUpDownBoldLeftBoldRight: string; + lineUpDownBoldLeftRightBold: string; + lineUpDoubleDownDoubleLeftDoubleRightDouble: string; + lineUpDoubleDownDoubleLeftRight: string; + lineUpDownLeftDoubleRightDouble: string; + lineCross: string; + lineBackslash: string; + lineSlash: string; +} | Record; +export default figures; +export declare const replaceSymbols: (string: string, { useFallback }?: { + useFallback?: boolean | undefined; +}) => string; diff --git a/dist/node_modules/@inquirer/figures/dist/esm/index.mjs b/dist/node_modules/@inquirer/figures/dist/esm/index.mjs new file mode 100644 index 0000000..d43b15e --- /dev/null +++ b/dist/node_modules/@inquirer/figures/dist/esm/index.mjs @@ -0,0 +1,309 @@ +// process.env dot-notation access prints: +// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111) +/* eslint dot-notation: ["off"] */ +import process from 'node:process'; +// Ported from is-unicode-supported +function isUnicodeSupported() { + if (process.platform !== 'win32') { + return process.env['TERM'] !== 'linux'; // Linux console (kernel) + } + return (Boolean(process.env['WT_SESSION']) || // Windows Terminal + Boolean(process.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27) + process.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder + process.env['TERM_PROGRAM'] === 'Terminus-Sublime' || + process.env['TERM_PROGRAM'] === 'vscode' || + process.env['TERM'] === 'xterm-256color' || + process.env['TERM'] === 'alacritty' || + process.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm'); +} +// Ported from figures +const common = { + circleQuestionMark: '(?)', + questionMarkPrefix: '(?)', + square: '█', + squareDarkShade: '▓', + squareMediumShade: '▒', + squareLightShade: '░', + squareTop: '▀', + squareBottom: '▄', + squareLeft: '▌', + squareRight: '▐', + squareCenter: '■', + bullet: '●', + dot: '․', + ellipsis: '…', + pointerSmall: '›', + triangleUp: '▲', + triangleUpSmall: '▴', + triangleDown: '▼', + triangleDownSmall: '▾', + triangleLeftSmall: '◂', + triangleRightSmall: '▸', + home: '⌂', + heart: '♥', + musicNote: '♪', + musicNoteBeamed: '♫', + arrowUp: '↑', + arrowDown: '↓', + arrowLeft: '←', + arrowRight: '→', + arrowLeftRight: '↔', + arrowUpDown: '↕', + almostEqual: '≈', + notEqual: '≠', + lessOrEqual: '≤', + greaterOrEqual: '≥', + identical: '≡', + infinity: '∞', + subscriptZero: '₀', + subscriptOne: '₁', + subscriptTwo: '₂', + subscriptThree: '₃', + subscriptFour: '₄', + subscriptFive: '₅', + subscriptSix: '₆', + subscriptSeven: '₇', + subscriptEight: '₈', + subscriptNine: '₉', + oneHalf: '½', + oneThird: '⅓', + oneQuarter: '¼', + oneFifth: '⅕', + oneSixth: '⅙', + oneEighth: '⅛', + twoThirds: '⅔', + twoFifths: '⅖', + threeQuarters: '¾', + threeFifths: '⅗', + threeEighths: '⅜', + fourFifths: '⅘', + fiveSixths: '⅚', + fiveEighths: '⅝', + sevenEighths: '⅞', + line: '─', + lineBold: '━', + lineDouble: '═', + lineDashed0: '┄', + lineDashed1: '┅', + lineDashed2: '┈', + lineDashed3: '┉', + lineDashed4: '╌', + lineDashed5: '╍', + lineDashed6: '╴', + lineDashed7: '╶', + lineDashed8: '╸', + lineDashed9: '╺', + lineDashed10: '╼', + lineDashed11: '╾', + lineDashed12: '−', + lineDashed13: '–', + lineDashed14: '‐', + lineDashed15: '⁃', + lineVertical: '│', + lineVerticalBold: '┃', + lineVerticalDouble: '║', + lineVerticalDashed0: '┆', + lineVerticalDashed1: '┇', + lineVerticalDashed2: '┊', + lineVerticalDashed3: '┋', + lineVerticalDashed4: '╎', + lineVerticalDashed5: '╏', + lineVerticalDashed6: '╵', + lineVerticalDashed7: '╷', + lineVerticalDashed8: '╹', + lineVerticalDashed9: '╻', + lineVerticalDashed10: '╽', + lineVerticalDashed11: '╿', + lineDownLeft: '┐', + lineDownLeftArc: '╮', + lineDownBoldLeftBold: '┓', + lineDownBoldLeft: '┒', + lineDownLeftBold: '┑', + lineDownDoubleLeftDouble: '╗', + lineDownDoubleLeft: '╖', + lineDownLeftDouble: '╕', + lineDownRight: '┌', + lineDownRightArc: '╭', + lineDownBoldRightBold: '┏', + lineDownBoldRight: '┎', + lineDownRightBold: '┍', + lineDownDoubleRightDouble: '╔', + lineDownDoubleRight: '╓', + lineDownRightDouble: '╒', + lineUpLeft: '┘', + lineUpLeftArc: '╯', + lineUpBoldLeftBold: '┛', + lineUpBoldLeft: '┚', + lineUpLeftBold: '┙', + lineUpDoubleLeftDouble: '╝', + lineUpDoubleLeft: '╜', + lineUpLeftDouble: '╛', + lineUpRight: '└', + lineUpRightArc: '╰', + lineUpBoldRightBold: '┗', + lineUpBoldRight: '┖', + lineUpRightBold: '┕', + lineUpDoubleRightDouble: '╚', + lineUpDoubleRight: '╙', + lineUpRightDouble: '╘', + lineUpDownLeft: '┤', + lineUpBoldDownBoldLeftBold: '┫', + lineUpBoldDownBoldLeft: '┨', + lineUpDownLeftBold: '┥', + lineUpBoldDownLeftBold: '┩', + lineUpDownBoldLeftBold: '┪', + lineUpDownBoldLeft: '┧', + lineUpBoldDownLeft: '┦', + lineUpDoubleDownDoubleLeftDouble: '╣', + lineUpDoubleDownDoubleLeft: '╢', + lineUpDownLeftDouble: '╡', + lineUpDownRight: '├', + lineUpBoldDownBoldRightBold: '┣', + lineUpBoldDownBoldRight: '┠', + lineUpDownRightBold: '┝', + lineUpBoldDownRightBold: '┡', + lineUpDownBoldRightBold: '┢', + lineUpDownBoldRight: '┟', + lineUpBoldDownRight: '┞', + lineUpDoubleDownDoubleRightDouble: '╠', + lineUpDoubleDownDoubleRight: '╟', + lineUpDownRightDouble: '╞', + lineDownLeftRight: '┬', + lineDownBoldLeftBoldRightBold: '┳', + lineDownLeftBoldRightBold: '┯', + lineDownBoldLeftRight: '┰', + lineDownBoldLeftBoldRight: '┱', + lineDownBoldLeftRightBold: '┲', + lineDownLeftRightBold: '┮', + lineDownLeftBoldRight: '┭', + lineDownDoubleLeftDoubleRightDouble: '╦', + lineDownDoubleLeftRight: '╥', + lineDownLeftDoubleRightDouble: '╤', + lineUpLeftRight: '┴', + lineUpBoldLeftBoldRightBold: '┻', + lineUpLeftBoldRightBold: '┷', + lineUpBoldLeftRight: '┸', + lineUpBoldLeftBoldRight: '┹', + lineUpBoldLeftRightBold: '┺', + lineUpLeftRightBold: '┶', + lineUpLeftBoldRight: '┵', + lineUpDoubleLeftDoubleRightDouble: '╩', + lineUpDoubleLeftRight: '╨', + lineUpLeftDoubleRightDouble: '╧', + lineUpDownLeftRight: '┼', + lineUpBoldDownBoldLeftBoldRightBold: '╋', + lineUpDownBoldLeftBoldRightBold: '╈', + lineUpBoldDownLeftBoldRightBold: '╇', + lineUpBoldDownBoldLeftRightBold: '╊', + lineUpBoldDownBoldLeftBoldRight: '╉', + lineUpBoldDownLeftRight: '╀', + lineUpDownBoldLeftRight: '╁', + lineUpDownLeftBoldRight: '┽', + lineUpDownLeftRightBold: '┾', + lineUpBoldDownBoldLeftRight: '╂', + lineUpDownLeftBoldRightBold: '┿', + lineUpBoldDownLeftBoldRight: '╃', + lineUpBoldDownLeftRightBold: '╄', + lineUpDownBoldLeftBoldRight: '╅', + lineUpDownBoldLeftRightBold: '╆', + lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬', + lineUpDoubleDownDoubleLeftRight: '╫', + lineUpDownLeftDoubleRightDouble: '╪', + lineCross: '╳', + lineBackslash: '╲', + lineSlash: '╱', +}; +const specialMainSymbols = { + tick: '✔', + info: 'ℹ', + warning: '⚠', + cross: '✘', + squareSmall: '◻', + squareSmallFilled: '◼', + circle: '◯', + circleFilled: '◉', + circleDotted: '◌', + circleDouble: '◎', + circleCircle: 'ⓞ', + circleCross: 'ⓧ', + circlePipe: 'Ⓘ', + radioOn: '◉', + radioOff: '◯', + checkboxOn: '☒', + checkboxOff: '☐', + checkboxCircleOn: 'ⓧ', + checkboxCircleOff: 'Ⓘ', + pointer: '❯', + triangleUpOutline: '△', + triangleLeft: '◀', + triangleRight: '▶', + lozenge: '◆', + lozengeOutline: '◇', + hamburger: '☰', + smiley: '㋡', + mustache: '෴', + star: '★', + play: '▶', + nodejs: '⬢', + oneSeventh: '⅐', + oneNinth: '⅑', + oneTenth: '⅒', +}; +const specialFallbackSymbols = { + tick: '√', + info: 'i', + warning: '‼', + cross: '×', + squareSmall: '□', + squareSmallFilled: '■', + circle: '( )', + circleFilled: '(*)', + circleDotted: '( )', + circleDouble: '( )', + circleCircle: '(○)', + circleCross: '(×)', + circlePipe: '(│)', + radioOn: '(*)', + radioOff: '( )', + checkboxOn: '[×]', + checkboxOff: '[ ]', + checkboxCircleOn: '(×)', + checkboxCircleOff: '( )', + pointer: '>', + triangleUpOutline: '∆', + triangleLeft: '◄', + triangleRight: '►', + lozenge: '♦', + lozengeOutline: '◊', + hamburger: '≡', + smiley: '☺', + mustache: '┌─┐', + star: '✶', + play: '►', + nodejs: '♦', + oneSeventh: '1/7', + oneNinth: '1/9', + oneTenth: '1/10', +}; +export const mainSymbols = { ...common, ...specialMainSymbols }; +export const fallbackSymbols = { + ...common, + ...specialFallbackSymbols, +}; +const shouldUseMain = isUnicodeSupported(); +const figures = shouldUseMain ? mainSymbols : fallbackSymbols; +export default figures; +const replacements = Object.entries(specialMainSymbols); +// On terminals which do not support Unicode symbols, substitute them to other symbols +export const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => { + if (useFallback) { + for (const [key, mainSymbol] of replacements) { + const fallbackSymbol = fallbackSymbols[key]; + if (!fallbackSymbol) { + throw new Error(`Unable to find fallback for ${key}`); + } + string = string.replaceAll(mainSymbol, fallbackSymbol); + } + } + return string; +}; diff --git a/dist/node_modules/@inquirer/figures/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/figures/dist/esm/types/index.d.mts new file mode 100644 index 0000000..f8202e5 --- /dev/null +++ b/dist/node_modules/@inquirer/figures/dist/esm/types/index.d.mts @@ -0,0 +1,465 @@ +export declare const mainSymbols: { + tick: string; + info: string; + warning: string; + cross: string; + squareSmall: string; + squareSmallFilled: string; + circle: string; + circleFilled: string; + circleDotted: string; + circleDouble: string; + circleCircle: string; + circleCross: string; + circlePipe: string; + radioOn: string; + radioOff: string; + checkboxOn: string; + checkboxOff: string; + checkboxCircleOn: string; + checkboxCircleOff: string; + pointer: string; + triangleUpOutline: string; + triangleLeft: string; + triangleRight: string; + lozenge: string; + lozengeOutline: string; + hamburger: string; + smiley: string; + mustache: string; + star: string; + play: string; + nodejs: string; + oneSeventh: string; + oneNinth: string; + oneTenth: string; + circleQuestionMark: string; + questionMarkPrefix: string; + square: string; + squareDarkShade: string; + squareMediumShade: string; + squareLightShade: string; + squareTop: string; + squareBottom: string; + squareLeft: string; + squareRight: string; + squareCenter: string; + bullet: string; + dot: string; + ellipsis: string; + pointerSmall: string; + triangleUp: string; + triangleUpSmall: string; + triangleDown: string; + triangleDownSmall: string; + triangleLeftSmall: string; + triangleRightSmall: string; + home: string; + heart: string; + musicNote: string; + musicNoteBeamed: string; + arrowUp: string; + arrowDown: string; + arrowLeft: string; + arrowRight: string; + arrowLeftRight: string; + arrowUpDown: string; + almostEqual: string; + notEqual: string; + lessOrEqual: string; + greaterOrEqual: string; + identical: string; + infinity: string; + subscriptZero: string; + subscriptOne: string; + subscriptTwo: string; + subscriptThree: string; + subscriptFour: string; + subscriptFive: string; + subscriptSix: string; + subscriptSeven: string; + subscriptEight: string; + subscriptNine: string; + oneHalf: string; + oneThird: string; + oneQuarter: string; + oneFifth: string; + oneSixth: string; + oneEighth: string; + twoThirds: string; + twoFifths: string; + threeQuarters: string; + threeFifths: string; + threeEighths: string; + fourFifths: string; + fiveSixths: string; + fiveEighths: string; + sevenEighths: string; + line: string; + lineBold: string; + lineDouble: string; + lineDashed0: string; + lineDashed1: string; + lineDashed2: string; + lineDashed3: string; + lineDashed4: string; + lineDashed5: string; + lineDashed6: string; + lineDashed7: string; + lineDashed8: string; + lineDashed9: string; + lineDashed10: string; + lineDashed11: string; + lineDashed12: string; + lineDashed13: string; + lineDashed14: string; + lineDashed15: string; + lineVertical: string; + lineVerticalBold: string; + lineVerticalDouble: string; + lineVerticalDashed0: string; + lineVerticalDashed1: string; + lineVerticalDashed2: string; + lineVerticalDashed3: string; + lineVerticalDashed4: string; + lineVerticalDashed5: string; + lineVerticalDashed6: string; + lineVerticalDashed7: string; + lineVerticalDashed8: string; + lineVerticalDashed9: string; + lineVerticalDashed10: string; + lineVerticalDashed11: string; + lineDownLeft: string; + lineDownLeftArc: string; + lineDownBoldLeftBold: string; + lineDownBoldLeft: string; + lineDownLeftBold: string; + lineDownDoubleLeftDouble: string; + lineDownDoubleLeft: string; + lineDownLeftDouble: string; + lineDownRight: string; + lineDownRightArc: string; + lineDownBoldRightBold: string; + lineDownBoldRight: string; + lineDownRightBold: string; + lineDownDoubleRightDouble: string; + lineDownDoubleRight: string; + lineDownRightDouble: string; + lineUpLeft: string; + lineUpLeftArc: string; + lineUpBoldLeftBold: string; + lineUpBoldLeft: string; + lineUpLeftBold: string; + lineUpDoubleLeftDouble: string; + lineUpDoubleLeft: string; + lineUpLeftDouble: string; + lineUpRight: string; + lineUpRightArc: string; + lineUpBoldRightBold: string; + lineUpBoldRight: string; + lineUpRightBold: string; + lineUpDoubleRightDouble: string; + lineUpDoubleRight: string; + lineUpRightDouble: string; + lineUpDownLeft: string; + lineUpBoldDownBoldLeftBold: string; + lineUpBoldDownBoldLeft: string; + lineUpDownLeftBold: string; + lineUpBoldDownLeftBold: string; + lineUpDownBoldLeftBold: string; + lineUpDownBoldLeft: string; + lineUpBoldDownLeft: string; + lineUpDoubleDownDoubleLeftDouble: string; + lineUpDoubleDownDoubleLeft: string; + lineUpDownLeftDouble: string; + lineUpDownRight: string; + lineUpBoldDownBoldRightBold: string; + lineUpBoldDownBoldRight: string; + lineUpDownRightBold: string; + lineUpBoldDownRightBold: string; + lineUpDownBoldRightBold: string; + lineUpDownBoldRight: string; + lineUpBoldDownRight: string; + lineUpDoubleDownDoubleRightDouble: string; + lineUpDoubleDownDoubleRight: string; + lineUpDownRightDouble: string; + lineDownLeftRight: string; + lineDownBoldLeftBoldRightBold: string; + lineDownLeftBoldRightBold: string; + lineDownBoldLeftRight: string; + lineDownBoldLeftBoldRight: string; + lineDownBoldLeftRightBold: string; + lineDownLeftRightBold: string; + lineDownLeftBoldRight: string; + lineDownDoubleLeftDoubleRightDouble: string; + lineDownDoubleLeftRight: string; + lineDownLeftDoubleRightDouble: string; + lineUpLeftRight: string; + lineUpBoldLeftBoldRightBold: string; + lineUpLeftBoldRightBold: string; + lineUpBoldLeftRight: string; + lineUpBoldLeftBoldRight: string; + lineUpBoldLeftRightBold: string; + lineUpLeftRightBold: string; + lineUpLeftBoldRight: string; + lineUpDoubleLeftDoubleRightDouble: string; + lineUpDoubleLeftRight: string; + lineUpLeftDoubleRightDouble: string; + lineUpDownLeftRight: string; + lineUpBoldDownBoldLeftBoldRightBold: string; + lineUpDownBoldLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRightBold: string; + lineUpBoldDownBoldLeftRightBold: string; + lineUpBoldDownBoldLeftBoldRight: string; + lineUpBoldDownLeftRight: string; + lineUpDownBoldLeftRight: string; + lineUpDownLeftBoldRight: string; + lineUpDownLeftRightBold: string; + lineUpBoldDownBoldLeftRight: string; + lineUpDownLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRight: string; + lineUpBoldDownLeftRightBold: string; + lineUpDownBoldLeftBoldRight: string; + lineUpDownBoldLeftRightBold: string; + lineUpDoubleDownDoubleLeftDoubleRightDouble: string; + lineUpDoubleDownDoubleLeftRight: string; + lineUpDownLeftDoubleRightDouble: string; + lineCross: string; + lineBackslash: string; + lineSlash: string; +}; +export declare const fallbackSymbols: Record; +declare const figures: { + tick: string; + info: string; + warning: string; + cross: string; + squareSmall: string; + squareSmallFilled: string; + circle: string; + circleFilled: string; + circleDotted: string; + circleDouble: string; + circleCircle: string; + circleCross: string; + circlePipe: string; + radioOn: string; + radioOff: string; + checkboxOn: string; + checkboxOff: string; + checkboxCircleOn: string; + checkboxCircleOff: string; + pointer: string; + triangleUpOutline: string; + triangleLeft: string; + triangleRight: string; + lozenge: string; + lozengeOutline: string; + hamburger: string; + smiley: string; + mustache: string; + star: string; + play: string; + nodejs: string; + oneSeventh: string; + oneNinth: string; + oneTenth: string; + circleQuestionMark: string; + questionMarkPrefix: string; + square: string; + squareDarkShade: string; + squareMediumShade: string; + squareLightShade: string; + squareTop: string; + squareBottom: string; + squareLeft: string; + squareRight: string; + squareCenter: string; + bullet: string; + dot: string; + ellipsis: string; + pointerSmall: string; + triangleUp: string; + triangleUpSmall: string; + triangleDown: string; + triangleDownSmall: string; + triangleLeftSmall: string; + triangleRightSmall: string; + home: string; + heart: string; + musicNote: string; + musicNoteBeamed: string; + arrowUp: string; + arrowDown: string; + arrowLeft: string; + arrowRight: string; + arrowLeftRight: string; + arrowUpDown: string; + almostEqual: string; + notEqual: string; + lessOrEqual: string; + greaterOrEqual: string; + identical: string; + infinity: string; + subscriptZero: string; + subscriptOne: string; + subscriptTwo: string; + subscriptThree: string; + subscriptFour: string; + subscriptFive: string; + subscriptSix: string; + subscriptSeven: string; + subscriptEight: string; + subscriptNine: string; + oneHalf: string; + oneThird: string; + oneQuarter: string; + oneFifth: string; + oneSixth: string; + oneEighth: string; + twoThirds: string; + twoFifths: string; + threeQuarters: string; + threeFifths: string; + threeEighths: string; + fourFifths: string; + fiveSixths: string; + fiveEighths: string; + sevenEighths: string; + line: string; + lineBold: string; + lineDouble: string; + lineDashed0: string; + lineDashed1: string; + lineDashed2: string; + lineDashed3: string; + lineDashed4: string; + lineDashed5: string; + lineDashed6: string; + lineDashed7: string; + lineDashed8: string; + lineDashed9: string; + lineDashed10: string; + lineDashed11: string; + lineDashed12: string; + lineDashed13: string; + lineDashed14: string; + lineDashed15: string; + lineVertical: string; + lineVerticalBold: string; + lineVerticalDouble: string; + lineVerticalDashed0: string; + lineVerticalDashed1: string; + lineVerticalDashed2: string; + lineVerticalDashed3: string; + lineVerticalDashed4: string; + lineVerticalDashed5: string; + lineVerticalDashed6: string; + lineVerticalDashed7: string; + lineVerticalDashed8: string; + lineVerticalDashed9: string; + lineVerticalDashed10: string; + lineVerticalDashed11: string; + lineDownLeft: string; + lineDownLeftArc: string; + lineDownBoldLeftBold: string; + lineDownBoldLeft: string; + lineDownLeftBold: string; + lineDownDoubleLeftDouble: string; + lineDownDoubleLeft: string; + lineDownLeftDouble: string; + lineDownRight: string; + lineDownRightArc: string; + lineDownBoldRightBold: string; + lineDownBoldRight: string; + lineDownRightBold: string; + lineDownDoubleRightDouble: string; + lineDownDoubleRight: string; + lineDownRightDouble: string; + lineUpLeft: string; + lineUpLeftArc: string; + lineUpBoldLeftBold: string; + lineUpBoldLeft: string; + lineUpLeftBold: string; + lineUpDoubleLeftDouble: string; + lineUpDoubleLeft: string; + lineUpLeftDouble: string; + lineUpRight: string; + lineUpRightArc: string; + lineUpBoldRightBold: string; + lineUpBoldRight: string; + lineUpRightBold: string; + lineUpDoubleRightDouble: string; + lineUpDoubleRight: string; + lineUpRightDouble: string; + lineUpDownLeft: string; + lineUpBoldDownBoldLeftBold: string; + lineUpBoldDownBoldLeft: string; + lineUpDownLeftBold: string; + lineUpBoldDownLeftBold: string; + lineUpDownBoldLeftBold: string; + lineUpDownBoldLeft: string; + lineUpBoldDownLeft: string; + lineUpDoubleDownDoubleLeftDouble: string; + lineUpDoubleDownDoubleLeft: string; + lineUpDownLeftDouble: string; + lineUpDownRight: string; + lineUpBoldDownBoldRightBold: string; + lineUpBoldDownBoldRight: string; + lineUpDownRightBold: string; + lineUpBoldDownRightBold: string; + lineUpDownBoldRightBold: string; + lineUpDownBoldRight: string; + lineUpBoldDownRight: string; + lineUpDoubleDownDoubleRightDouble: string; + lineUpDoubleDownDoubleRight: string; + lineUpDownRightDouble: string; + lineDownLeftRight: string; + lineDownBoldLeftBoldRightBold: string; + lineDownLeftBoldRightBold: string; + lineDownBoldLeftRight: string; + lineDownBoldLeftBoldRight: string; + lineDownBoldLeftRightBold: string; + lineDownLeftRightBold: string; + lineDownLeftBoldRight: string; + lineDownDoubleLeftDoubleRightDouble: string; + lineDownDoubleLeftRight: string; + lineDownLeftDoubleRightDouble: string; + lineUpLeftRight: string; + lineUpBoldLeftBoldRightBold: string; + lineUpLeftBoldRightBold: string; + lineUpBoldLeftRight: string; + lineUpBoldLeftBoldRight: string; + lineUpBoldLeftRightBold: string; + lineUpLeftRightBold: string; + lineUpLeftBoldRight: string; + lineUpDoubleLeftDoubleRightDouble: string; + lineUpDoubleLeftRight: string; + lineUpLeftDoubleRightDouble: string; + lineUpDownLeftRight: string; + lineUpBoldDownBoldLeftBoldRightBold: string; + lineUpDownBoldLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRightBold: string; + lineUpBoldDownBoldLeftRightBold: string; + lineUpBoldDownBoldLeftBoldRight: string; + lineUpBoldDownLeftRight: string; + lineUpDownBoldLeftRight: string; + lineUpDownLeftBoldRight: string; + lineUpDownLeftRightBold: string; + lineUpBoldDownBoldLeftRight: string; + lineUpDownLeftBoldRightBold: string; + lineUpBoldDownLeftBoldRight: string; + lineUpBoldDownLeftRightBold: string; + lineUpDownBoldLeftBoldRight: string; + lineUpDownBoldLeftRightBold: string; + lineUpDoubleDownDoubleLeftDoubleRightDouble: string; + lineUpDoubleDownDoubleLeftRight: string; + lineUpDownLeftDoubleRightDouble: string; + lineCross: string; + lineBackslash: string; + lineSlash: string; +} | Record; +export default figures; +export declare const replaceSymbols: (string: string, { useFallback }?: { + useFallback?: boolean | undefined; +}) => string; diff --git a/dist/node_modules/@inquirer/figures/package.json b/dist/node_modules/@inquirer/figures/package.json new file mode 100644 index 0000000..a146327 --- /dev/null +++ b/dist/node_modules/@inquirer/figures/package.json @@ -0,0 +1,81 @@ +{ + "name": "@inquirer/figures", + "version": "1.0.3", + "description": "Vendored version of figures, for CJS compatibility", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh", + "types", + "typescript" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "209b4ce30fe71f8e2f0e066a1a98e385eecb15f4" +} diff --git a/dist/node_modules/@inquirer/input/LICENSE b/dist/node_modules/@inquirer/input/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/input/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/input/README.md b/dist/node_modules/@inquirer/input/README.md new file mode 100644 index 0000000..9d6ff1b --- /dev/null +++ b/dist/node_modules/@inquirer/input/README.md @@ -0,0 +1,74 @@ +# `@inquirer/input` + +Interactive free text input component for command line interfaces. Supports validation, filtering, transformation, etc. + +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/input +``` + + + +```sh +yarn add @inquirer/input +``` + +
+ +# Usage + +```js +import input from '@inquirer/input'; + +const answer = await input({ message: 'Enter your name' }); +``` + +## Options + +| Property | Type | Required | Description | +| ----------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `string` | no | Default value if no answer is provided (clear it by pressing backspace) | +| required | `boolean` | no | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this. | +| transformer | `(string, { isFinal: boolean }) => string` | no | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed. | +| validate | `string => boolean \| string \| Promise` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/input/dist/cjs/index.js b/dist/node_modules/@inquirer/input/dist/cjs/index.js new file mode 100644 index 0000000..e2103d9 --- /dev/null +++ b/dist/node_modules/@inquirer/input/dist/cjs/index.js @@ -0,0 +1,80 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("@inquirer/core"); +exports.default = (0, core_1.createPrompt)((config, done) => { + const { required, validate = () => true } = config; + const theme = (0, core_1.makeTheme)(config.theme); + const [status, setStatus] = (0, core_1.useState)('pending'); + const [defaultValue = '', setDefaultValue] = (0, core_1.useState)(config.default); + const [errorMsg, setError] = (0, core_1.useState)(); + const [value, setValue] = (0, core_1.useState)(''); + const isLoading = status === 'loading'; + const prefix = (0, core_1.usePrefix)({ isLoading, theme }); + (0, core_1.useKeypress)((key, rl) => __awaiter(void 0, void 0, void 0, function* () { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if ((0, core_1.isEnterKey)(key)) { + const answer = value || defaultValue; + setStatus('loading'); + const isValid = required && !answer ? 'You must provide a value' : yield validate(answer); + if (isValid === true) { + setValue(answer); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid value'); + setStatus('pending'); + } + } + else if ((0, core_1.isBackspaceKey)(key) && !value) { + setDefaultValue(undefined); + } + else if (key.name === 'tab' && !value) { + setDefaultValue(undefined); + rl.clearLine(0); // Remove the tab character. + rl.write(defaultValue); + setValue(defaultValue); + } + else { + setValue(rl.line); + setError(undefined); + } + })); + const message = theme.style.message(config.message); + let formattedValue = value; + if (typeof config.transformer === 'function') { + formattedValue = config.transformer(value, { isFinal: status === 'done' }); + } + else if (status === 'done') { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== 'done' && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue] + .filter((v) => v !== undefined) + .join(' '), + error, + ]; +}); diff --git a/dist/node_modules/@inquirer/input/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/input/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..7435454 --- /dev/null +++ b/dist/node_modules/@inquirer/input/dist/cjs/types/index.d.ts @@ -0,0 +1,14 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type InputConfig = { + message: string; + default?: string; + required?: boolean; + transformer?: (value: string, { isFinal }: { + isFinal: boolean; + }) => string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/input/dist/esm/index.mjs b/dist/node_modules/@inquirer/input/dist/esm/index.mjs new file mode 100644 index 0000000..ea7eb5b --- /dev/null +++ b/dist/node_modules/@inquirer/input/dist/esm/index.mjs @@ -0,0 +1,69 @@ +import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, isBackspaceKey, makeTheme, } from '@inquirer/core'; +export default createPrompt((config, done) => { + const { required, validate = () => true } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState('pending'); + const [defaultValue = '', setDefaultValue] = useState(config.default); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(''); + const isLoading = status === 'loading'; + const prefix = usePrefix({ isLoading, theme }); + useKeypress(async (key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if (isEnterKey(key)) { + const answer = value || defaultValue; + setStatus('loading'); + const isValid = required && !answer ? 'You must provide a value' : await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid value'); + setStatus('pending'); + } + } + else if (isBackspaceKey(key) && !value) { + setDefaultValue(undefined); + } + else if (key.name === 'tab' && !value) { + setDefaultValue(undefined); + rl.clearLine(0); // Remove the tab character. + rl.write(defaultValue); + setValue(defaultValue); + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + let formattedValue = value; + if (typeof config.transformer === 'function') { + formattedValue = config.transformer(value, { isFinal: status === 'done' }); + } + else if (status === 'done') { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== 'done' && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue] + .filter((v) => v !== undefined) + .join(' '), + error, + ]; +}); diff --git a/dist/node_modules/@inquirer/input/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/input/dist/esm/types/index.d.mts new file mode 100644 index 0000000..7435454 --- /dev/null +++ b/dist/node_modules/@inquirer/input/dist/esm/types/index.d.mts @@ -0,0 +1,14 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type InputConfig = { + message: string; + default?: string; + required?: boolean; + transformer?: (value: string, { isFinal }: { + isFinal: boolean; + }) => string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/input/dist/types/index.d.ts b/dist/node_modules/@inquirer/input/dist/types/index.d.ts new file mode 100644 index 0000000..7435454 --- /dev/null +++ b/dist/node_modules/@inquirer/input/dist/types/index.d.ts @@ -0,0 +1,14 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type InputConfig = { + message: string; + default?: string; + required?: boolean; + transformer?: (value: string, { isFinal }: { + isFinal: boolean; + }) => string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/input/package.json b/dist/node_modules/@inquirer/input/package.json new file mode 100644 index 0000000..210bc22 --- /dev/null +++ b/dist/node_modules/@inquirer/input/package.json @@ -0,0 +1,90 @@ +{ + "name": "@inquirer/input", + "version": "2.2.1", + "description": "Inquirer input text prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/input/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/number/LICENSE b/dist/node_modules/@inquirer/number/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/number/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/number/README.md b/dist/node_modules/@inquirer/number/README.md new file mode 100644 index 0000000..9aae451 --- /dev/null +++ b/dist/node_modules/@inquirer/number/README.md @@ -0,0 +1,74 @@ +# `@inquirer/number` + +Interactive free number input component for command line interfaces. Supports validation, filtering, transformation, etc. + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/number +``` + + + +```sh +yarn add @inquirer/number +``` + +
+ +# Usage + +```js +import number from '@inquirer/number'; + +const answer = await number({ message: 'Enter your age' }); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | -------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| default | `number` | no | Default value if no answer is provided (clear it by pressing backspace) | +| min | `number` | no | The minimum value to accept for this input. | +| max | `number` | no | The maximum value to accept for this input. | +| step | `number \| 'any'` | no | The step option is a number that specifies the granularity that the value must adhere to. Only values which are equal to the basis for stepping (min if specified) are valid. This value defaults to 1, meaning by default the prompt will only allow integers. | +| required | `boolean` | no | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this. | +| validate | `(number \| undefined) => boolean \| string \| Promise` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + defaultAnswer: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/number/dist/cjs/index.js b/dist/node_modules/@inquirer/number/dist/cjs/index.js new file mode 100644 index 0000000..2cdf27a --- /dev/null +++ b/dist/node_modules/@inquirer/number/dist/cjs/index.js @@ -0,0 +1,101 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("@inquirer/core"); +function validateNumber(value, { min, max, step, }) { + if (value == null || Number.isNaN(value)) { + return false; + } + else if (value < min || value > max) { + return `Value must be between ${min} and ${max}`; + } + else if (step !== 'any' && (value - (Number.isFinite(min) ? min : 0)) % step !== 0) { + return `Value must be a multiple of ${step}${Number.isFinite(min) ? ` starting from ${min}` : ''}`; + } + return true; +} +exports.default = (0, core_1.createPrompt)((config, done) => { + var _a; + const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false, } = config; + const theme = (0, core_1.makeTheme)(config.theme); + const [status, setStatus] = (0, core_1.useState)('pending'); + const [value, setValue] = (0, core_1.useState)(''); // store the input value as string and convert to number on "Enter" + // Ignore default if not valid. + const validDefault = validateNumber(config.default, { min, max, step }) === true + ? (_a = config.default) === null || _a === void 0 ? void 0 : _a.toString() + : undefined; + const [defaultValue = '', setDefaultValue] = (0, core_1.useState)(validDefault); + const [errorMsg, setError] = (0, core_1.useState)(); + const isLoading = status === 'loading'; + const prefix = (0, core_1.usePrefix)({ isLoading, theme }); + (0, core_1.useKeypress)((key, rl) => __awaiter(void 0, void 0, void 0, function* () { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if ((0, core_1.isEnterKey)(key)) { + const input = value || defaultValue; + const answer = input === '' ? undefined : Number(input); + setStatus('loading'); + let isValid = true; + if (required || answer != null) { + isValid = validateNumber(answer, { min, max, step }); + } + if (isValid === true) { + isValid = yield validate(answer); + } + if (isValid === true) { + setValue(String(answer !== null && answer !== void 0 ? answer : '')); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid numeric value'); + setStatus('pending'); + } + } + else if ((0, core_1.isBackspaceKey)(key) && !value) { + setDefaultValue(undefined); + } + else if (key.name === 'tab' && !value) { + setDefaultValue(undefined); + rl.clearLine(0); // Remove the tab character. + rl.write(defaultValue); + setValue(defaultValue); + } + else { + setValue(rl.line); + setError(undefined); + } + })); + const message = theme.style.message(config.message); + let formattedValue = value; + if (status === 'done') { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== 'done' && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue] + .filter((v) => v !== undefined) + .join(' '), + error, + ]; +}); diff --git a/dist/node_modules/@inquirer/number/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/number/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..fe5d5e8 --- /dev/null +++ b/dist/node_modules/@inquirer/number/dist/cjs/types/index.d.ts @@ -0,0 +1,14 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type NumberConfig = { + message: string; + default?: number; + min?: number; + max?: number; + step?: number | 'any'; + required?: boolean; + validate?: (value: number | undefined) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/number/dist/esm/index.mjs b/dist/node_modules/@inquirer/number/dist/esm/index.mjs new file mode 100644 index 0000000..00beba9 --- /dev/null +++ b/dist/node_modules/@inquirer/number/dist/esm/index.mjs @@ -0,0 +1,89 @@ +import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, isBackspaceKey, makeTheme, } from '@inquirer/core'; +function validateNumber(value, { min, max, step, }) { + if (value == null || Number.isNaN(value)) { + return false; + } + else if (value < min || value > max) { + return `Value must be between ${min} and ${max}`; + } + else if (step !== 'any' && (value - (Number.isFinite(min) ? min : 0)) % step !== 0) { + return `Value must be a multiple of ${step}${Number.isFinite(min) ? ` starting from ${min}` : ''}`; + } + return true; +} +export default createPrompt((config, done) => { + const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false, } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState('pending'); + const [value, setValue] = useState(''); // store the input value as string and convert to number on "Enter" + // Ignore default if not valid. + const validDefault = validateNumber(config.default, { min, max, step }) === true + ? config.default?.toString() + : undefined; + const [defaultValue = '', setDefaultValue] = useState(validDefault); + const [errorMsg, setError] = useState(); + const isLoading = status === 'loading'; + const prefix = usePrefix({ isLoading, theme }); + useKeypress(async (key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if (isEnterKey(key)) { + const input = value || defaultValue; + const answer = input === '' ? undefined : Number(input); + setStatus('loading'); + let isValid = true; + if (required || answer != null) { + isValid = validateNumber(answer, { min, max, step }); + } + if (isValid === true) { + isValid = await validate(answer); + } + if (isValid === true) { + setValue(String(answer ?? '')); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid numeric value'); + setStatus('pending'); + } + } + else if (isBackspaceKey(key) && !value) { + setDefaultValue(undefined); + } + else if (key.name === 'tab' && !value) { + setDefaultValue(undefined); + rl.clearLine(0); // Remove the tab character. + rl.write(defaultValue); + setValue(defaultValue); + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + let formattedValue = value; + if (status === 'done') { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== 'done' && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue] + .filter((v) => v !== undefined) + .join(' '), + error, + ]; +}); diff --git a/dist/node_modules/@inquirer/number/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/number/dist/esm/types/index.d.mts new file mode 100644 index 0000000..fe5d5e8 --- /dev/null +++ b/dist/node_modules/@inquirer/number/dist/esm/types/index.d.mts @@ -0,0 +1,14 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type NumberConfig = { + message: string; + default?: number; + min?: number; + max?: number; + step?: number | 'any'; + required?: boolean; + validate?: (value: number | undefined) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/number/dist/types/index.d.ts b/dist/node_modules/@inquirer/number/dist/types/index.d.ts new file mode 100644 index 0000000..fe5d5e8 --- /dev/null +++ b/dist/node_modules/@inquirer/number/dist/types/index.d.ts @@ -0,0 +1,14 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type NumberConfig = { + message: string; + default?: number; + min?: number; + max?: number; + step?: number | 'any'; + required?: boolean; + validate?: (value: number | undefined) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/number/package.json b/dist/node_modules/@inquirer/number/package.json new file mode 100644 index 0000000..32a690f --- /dev/null +++ b/dist/node_modules/@inquirer/number/package.json @@ -0,0 +1,90 @@ +{ + "name": "@inquirer/number", + "version": "1.0.2", + "description": "Inquirer number prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/number/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/password/LICENSE b/dist/node_modules/@inquirer/password/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/password/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/password/README.md b/dist/node_modules/@inquirer/password/README.md new file mode 100644 index 0000000..9b6fb1c --- /dev/null +++ b/dist/node_modules/@inquirer/password/README.md @@ -0,0 +1,72 @@ +# `@inquirer/password` + +Interactive password input component for command line interfaces. Supports input validation and masked or transparent modes. + +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/password +``` + + + +```sh +yarn add @inquirer/password +``` + +
+ +# Usage + +```js +import password from '@inquirer/password'; + +const answer = await password({ message: 'Enter your name' }); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| mask | `boolean` | no | Show a `*` mask over the input or keep it transparent | +| validate | `string => boolean \| string \| Promise` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + help: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/password/dist/cjs/index.js b/dist/node_modules/@inquirer/password/dist/cjs/index.js new file mode 100644 index 0000000..a67a235 --- /dev/null +++ b/dist/node_modules/@inquirer/password/dist/cjs/index.js @@ -0,0 +1,70 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("@inquirer/core"); +const ansi_escapes_1 = __importDefault(require("ansi-escapes")); +exports.default = (0, core_1.createPrompt)((config, done) => { + const { validate = () => true } = config; + const theme = (0, core_1.makeTheme)(config.theme); + const [status, setStatus] = (0, core_1.useState)('pending'); + const [errorMsg, setError] = (0, core_1.useState)(); + const [value, setValue] = (0, core_1.useState)(''); + const isLoading = status === 'loading'; + const prefix = (0, core_1.usePrefix)({ isLoading, theme }); + (0, core_1.useKeypress)((key, rl) => __awaiter(void 0, void 0, void 0, function* () { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if ((0, core_1.isEnterKey)(key)) { + const answer = value; + setStatus('loading'); + const isValid = yield validate(answer); + if (isValid === true) { + setValue(answer); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid value'); + setStatus('pending'); + } + } + else { + setValue(rl.line); + setError(undefined); + } + })); + const message = theme.style.message(config.message); + let formattedValue = ''; + let helpTip; + if (config.mask) { + const maskChar = typeof config.mask === 'string' ? config.mask : '*'; + formattedValue = maskChar.repeat(value.length); + } + else if (status !== 'done') { + helpTip = `${theme.style.help('[input is masked]')}${ansi_escapes_1.default.cursorHide}`; + } + if (status === 'done') { + formattedValue = theme.style.answer(formattedValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, config.mask ? formattedValue : helpTip].join(' '), error]; +}); diff --git a/dist/node_modules/@inquirer/password/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/password/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..897bcea --- /dev/null +++ b/dist/node_modules/@inquirer/password/dist/cjs/types/index.d.ts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type PasswordConfig = { + message: string; + mask?: boolean | string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/password/dist/esm/index.mjs b/dist/node_modules/@inquirer/password/dist/esm/index.mjs new file mode 100644 index 0000000..259c512 --- /dev/null +++ b/dist/node_modules/@inquirer/password/dist/esm/index.mjs @@ -0,0 +1,56 @@ +import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, makeTheme, } from '@inquirer/core'; +import ansiEscapes from 'ansi-escapes'; +export default createPrompt((config, done) => { + const { validate = () => true } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState('pending'); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(''); + const isLoading = status === 'loading'; + const prefix = usePrefix({ isLoading, theme }); + useKeypress(async (key, rl) => { + // Ignore keypress while our prompt is doing other processing. + if (status !== 'pending') { + return; + } + if (isEnterKey(key)) { + const answer = value; + setStatus('loading'); + const isValid = await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus('done'); + done(answer); + } + else { + // Reset the readline line value to the previous value. On line event, the value + // get cleared, forcing the user to re-enter the value instead of fixing it. + rl.write(value); + setError(isValid || 'You must provide a valid value'); + setStatus('pending'); + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + let formattedValue = ''; + let helpTip; + if (config.mask) { + const maskChar = typeof config.mask === 'string' ? config.mask : '*'; + formattedValue = maskChar.repeat(value.length); + } + else if (status !== 'done') { + helpTip = `${theme.style.help('[input is masked]')}${ansiEscapes.cursorHide}`; + } + if (status === 'done') { + formattedValue = theme.style.answer(formattedValue); + } + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, config.mask ? formattedValue : helpTip].join(' '), error]; +}); diff --git a/dist/node_modules/@inquirer/password/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/password/dist/esm/types/index.d.mts new file mode 100644 index 0000000..897bcea --- /dev/null +++ b/dist/node_modules/@inquirer/password/dist/esm/types/index.d.mts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type PasswordConfig = { + message: string; + mask?: boolean | string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/password/dist/types/index.d.ts b/dist/node_modules/@inquirer/password/dist/types/index.d.ts new file mode 100644 index 0000000..897bcea --- /dev/null +++ b/dist/node_modules/@inquirer/password/dist/types/index.d.ts @@ -0,0 +1,10 @@ +import { type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type PasswordConfig = { + message: string; + mask?: boolean | string; + validate?: (value: string) => boolean | string | Promise; + theme?: PartialDeep; +}; +declare const _default: import("@inquirer/type").Prompt; +export default _default; diff --git a/dist/node_modules/@inquirer/password/package.json b/dist/node_modules/@inquirer/password/package.json new file mode 100644 index 0000000..8ab0f7b --- /dev/null +++ b/dist/node_modules/@inquirer/password/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/password", + "version": "2.1.14", + "engines": { + "node": ">=18" + }, + "description": "Inquirer password prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/password/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/prompts/LICENSE b/dist/node_modules/@inquirer/prompts/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/prompts/README.md b/dist/node_modules/@inquirer/prompts/README.md new file mode 100644 index 0000000..b6e9e11 --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/README.md @@ -0,0 +1,361 @@ +Inquirer Logo + +# Inquirer + +[![npm](https://badge.fury.io/js/@inquirer%2Fprompts.svg)](https://www.npmjs.com/package/@inquirer/prompts) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield) + +A collection of common interactive command line user interfaces. + +![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +Give it a try in your own terminal! + +```sh +npx @inquirer/demo@latest +``` + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/prompts +``` + + + +```sh +yarn add @inquirer/prompts +``` + +
+ +> [!NOTE] +> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/inquirer). + +# Usage + +```js +import { input } from '@inquirer/prompts'; + +const answer = await input({ message: 'Enter your name' }); +``` + +# Prompts + +## [Input](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/input) + +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) + +```js +import { input } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/input) for usage example and options documentation. + +## [Select](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/select) + +![Select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +```js +import { select } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/select) for usage example and options documentation. + +## [Checkbox](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/checkbox) + +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) + +```js +import { checkbox } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/checkbox) for usage example and options documentation. + +## [Confirm](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/confirm) + +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) + +```js +import { confirm } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/confirm) for usage example and options documentation. + +## [Password](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/password) + +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) + +```js +import { password } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/password) for usage example and options documentation. + +## [Expand](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/expand) + +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) + +```js +import { expand } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/expand) for usage example and options documentation. + +## [Editor](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/editor) + +Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.) + +```js +import { editor } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/editor) for usage example and options documentation. + +## [Number](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/number) + +Very similar to the `input` prompt, but with built-in number validation configuration option. + +```js +import { number } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/number) for usage example and options documentation. + +## [Raw List](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/rawlist) + +![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) + +```js +import { rawlist } from '@inquirer/prompts'; +``` + +[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/rawlist) for usage example and options documentation. + +# Create your own prompts + +The [API documentation is over here](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/core), and our [testing utilities here](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/testing). + +# Advanced usage + +All inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration. + +The context options are: + +| Property | Type | Required | Description | +| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ | +| input | `NodeJS.ReadableStream` | no | The stdin stream (defaults to `process.stdin`) | +| output | `NodeJS.WritableStream` | no | The stdout stream (defaults to `process.stdout`) | +| clearPromptOnDone | `boolean` | no | If true, we'll clear the screen after the prompt is answered | + +Example: + +```js +import { confirm } from '@inquirer/prompts'; + +const allowEmail = await confirm( + { message: 'Do you allow us to send you email?' }, + { + output: new Stream.Writable({ + write(chunk, _encoding, next) { + // Do something + next(); + }, + }), + clearPromptOnDone: true, + }, +); +``` + +## Canceling prompt + +All prompt functions are returning a cancelable promise. This special promise type has a `cancel` method that'll cancel and cleanup the prompt. + +On calling `cancel`, the answer promise will become rejected. + +```js +import { confirm } from '@inquirer/prompts'; + +const answer = confirm(...); // note: for this you cannot use `await` + +answer.cancel(); +``` + +# Recipes + +## Get answers in an object + +When asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object. + +```js +import { input, confirm } from '@inquirer/prompts'; + +const answers = { + firstName: await input({ message: "What's your first name?" }), + allowEmail: await confirm({ message: 'Do you allow us to send you email?' }), +}; + +console.log(answers.firstName); +``` + +## Ask a question conditionally + +Maybe some questions depend on some other question's answer. + +```js +import { input, confirm } from '@inquirer/prompts'; + +const allowEmail = await confirm({ message: 'Do you allow us to send you email?' }); + +let email; +if (allowEmail) { + email = await input({ message: 'What is your email address' }); +} +``` + +## Get default value after timeout + +```js +import { setTimeout } from 'node:timers/promises'; +import { input } from '@inquirer/prompts'; + +const ac = new AbortController(); +const prompt = input({ + message: 'Enter a value (timing out in 5 seconds)', +}); + +prompt + .finally(() => { + ac.abort(); + }) + // Silencing the cancellation error. + .catch(() => {}); + +const defaultValue = setTimeout(5000, 'timeout', { signal: ac.signal }).then(() => { + prompt.cancel(); + return 'Timed out!'; +}); + +const answer = await Promise.race([defaultValue, prompt]); +``` + +## Using as pre-commit/git hooks, or scripts + +By default scripts ran from tools like `husky`/`lint-staged` might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process. + +For it to work, you must make sure you start a `tty` (or "interactive" input stream.) + +If those scripts are set within your `package.json`, you can define the stream like so: + +```json + "precommit": "my-script < /dev/tty" +``` + +Or if in a shell script file, you'll do it like so: (on Windows that's likely your only option) + +```sh +#!/bin/sh +exec < /dev/tty + +node my-script.js +``` + +## Wait for config + +Maybe some question configuration require to await a value. + +```js +import { confirm } from '@inquirer/prompts'; + +const answer = await confirm({ message: await getMessage() }); +``` + +# Community prompts + +If you created a cool prompt, [send us a PR adding it](https://github.com/SBoudrias/Inquirer.js/edit/master/README.md) to the list below! + +[**Interactive List Prompt**](https://github.com/pgibler/inquirer-interactive-list-prompt)
+Select a choice either with arrow keys + Enter or by pressing a key associated with a choice. + +``` +? Choose an option: +> Run command (D) + Quit (Q) +``` + +[**Action Select Prompt**](https://github.com/zenithlight/inquirer-action-select)
+Choose an item from a list and choose an action to take by pressing a key. + +``` +? Choose a file Open Edit Delete +❯ image.png + audio.mp3 + code.py +``` + +[**Table Multiple Prompt**](https://github.com/Bartheleway/inquirer-table-multiple)
+Select multiple answer from a table display. + +```sh +Choose between choices? (Press to select, to move rows, + to move columns) + +┌──────────┬───────┬───────┐ +│ 1-2 of 2 │ Yes? │ No? | +├──────────┼───────┼───────┤ +│ Choice 1 │ [ ◯ ] │ ◯ | +├──────────┼───────┼───────┤ +│ Choice 2 │ ◯ │ ◯ | +└──────────┴───────┴───────┘ + +``` + +[**Toggle Prompt**](https://github.com/skarahoda/inquirer-toggle)
+Confirm with a toggle. Select a choice with arrow keys + Enter. + +``` +? Do you want to continue? no / yes +``` + +[**Sortable Checkbox Prompt**](https://github.com/th0r/inquirer-sortable-checkbox)
+The same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down. + +``` +? Which PRs and in what order would you like to merge? (Press to select, to toggle all, to invert selection, to move item up, to move item down, and to proceed) +❯ ◯ PR 1 + ◯ PR 2 + ◯ PR 3 +``` + +[**Multi Select Prompt**](https://github.com/jeffwcx/inquirer-select-pro) + +An inquirer select that supports multiple selections and filtering/searching. + +``` +? Choose your OS, IDE, PL, etc. (Press to select/deselect, to remove selected +option, to select option) +>> vue +>[ ] vue + [ ] vuejs + [ ] fuelphp + [ ] venv + [ ] vercel + (Use arrow keys to reveal more options) +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/prompts/dist/cjs/index.js b/dist/node_modules/@inquirer/prompts/dist/cjs/index.js new file mode 100644 index 0000000..a7c5efb --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/dist/cjs/index.js @@ -0,0 +1,25 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.select = exports.password = exports.rawlist = exports.expand = exports.number = exports.input = exports.confirm = exports.editor = exports.Separator = exports.checkbox = void 0; +var checkbox_1 = require("@inquirer/checkbox"); +Object.defineProperty(exports, "checkbox", { enumerable: true, get: function () { return __importDefault(checkbox_1).default; } }); +Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return checkbox_1.Separator; } }); +var editor_1 = require("@inquirer/editor"); +Object.defineProperty(exports, "editor", { enumerable: true, get: function () { return __importDefault(editor_1).default; } }); +var confirm_1 = require("@inquirer/confirm"); +Object.defineProperty(exports, "confirm", { enumerable: true, get: function () { return __importDefault(confirm_1).default; } }); +var input_1 = require("@inquirer/input"); +Object.defineProperty(exports, "input", { enumerable: true, get: function () { return __importDefault(input_1).default; } }); +var number_1 = require("@inquirer/number"); +Object.defineProperty(exports, "number", { enumerable: true, get: function () { return __importDefault(number_1).default; } }); +var expand_1 = require("@inquirer/expand"); +Object.defineProperty(exports, "expand", { enumerable: true, get: function () { return __importDefault(expand_1).default; } }); +var rawlist_1 = require("@inquirer/rawlist"); +Object.defineProperty(exports, "rawlist", { enumerable: true, get: function () { return __importDefault(rawlist_1).default; } }); +var password_1 = require("@inquirer/password"); +Object.defineProperty(exports, "password", { enumerable: true, get: function () { return __importDefault(password_1).default; } }); +var select_1 = require("@inquirer/select"); +Object.defineProperty(exports, "select", { enumerable: true, get: function () { return __importDefault(select_1).default; } }); diff --git a/dist/node_modules/@inquirer/prompts/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/prompts/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..6a1fe9a --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/dist/cjs/types/index.d.ts @@ -0,0 +1,9 @@ +export { default as checkbox, Separator } from '@inquirer/checkbox'; +export { default as editor } from '@inquirer/editor'; +export { default as confirm } from '@inquirer/confirm'; +export { default as input } from '@inquirer/input'; +export { default as number } from '@inquirer/number'; +export { default as expand } from '@inquirer/expand'; +export { default as rawlist } from '@inquirer/rawlist'; +export { default as password } from '@inquirer/password'; +export { default as select } from '@inquirer/select'; diff --git a/dist/node_modules/@inquirer/prompts/dist/esm/index.mjs b/dist/node_modules/@inquirer/prompts/dist/esm/index.mjs new file mode 100644 index 0000000..6a1fe9a --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/dist/esm/index.mjs @@ -0,0 +1,9 @@ +export { default as checkbox, Separator } from '@inquirer/checkbox'; +export { default as editor } from '@inquirer/editor'; +export { default as confirm } from '@inquirer/confirm'; +export { default as input } from '@inquirer/input'; +export { default as number } from '@inquirer/number'; +export { default as expand } from '@inquirer/expand'; +export { default as rawlist } from '@inquirer/rawlist'; +export { default as password } from '@inquirer/password'; +export { default as select } from '@inquirer/select'; diff --git a/dist/node_modules/@inquirer/prompts/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/prompts/dist/esm/types/index.d.mts new file mode 100644 index 0000000..6a1fe9a --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/dist/esm/types/index.d.mts @@ -0,0 +1,9 @@ +export { default as checkbox, Separator } from '@inquirer/checkbox'; +export { default as editor } from '@inquirer/editor'; +export { default as confirm } from '@inquirer/confirm'; +export { default as input } from '@inquirer/input'; +export { default as number } from '@inquirer/number'; +export { default as expand } from '@inquirer/expand'; +export { default as rawlist } from '@inquirer/rawlist'; +export { default as password } from '@inquirer/password'; +export { default as select } from '@inquirer/select'; diff --git a/dist/node_modules/@inquirer/prompts/dist/types/index.d.ts b/dist/node_modules/@inquirer/prompts/dist/types/index.d.ts new file mode 100644 index 0000000..6a1fe9a --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/dist/types/index.d.ts @@ -0,0 +1,9 @@ +export { default as checkbox, Separator } from '@inquirer/checkbox'; +export { default as editor } from '@inquirer/editor'; +export { default as confirm } from '@inquirer/confirm'; +export { default as input } from '@inquirer/input'; +export { default as number } from '@inquirer/number'; +export { default as expand } from '@inquirer/expand'; +export { default as rawlist } from '@inquirer/rawlist'; +export { default as password } from '@inquirer/password'; +export { default as select } from '@inquirer/select'; diff --git a/dist/node_modules/@inquirer/prompts/package.json b/dist/node_modules/@inquirer/prompts/package.json new file mode 100644 index 0000000..d5cd194 --- /dev/null +++ b/dist/node_modules/@inquirer/prompts/package.json @@ -0,0 +1,96 @@ +{ + "name": "@inquirer/prompts", + "version": "5.1.2", + "description": "Inquirer prompts, combined in a single package", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh", + "types", + "typescript" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "dependencies": { + "@inquirer/checkbox": "^2.3.10", + "@inquirer/confirm": "^3.1.14", + "@inquirer/editor": "^2.1.14", + "@inquirer/expand": "^2.1.14", + "@inquirer/input": "^2.2.1", + "@inquirer/number": "^1.0.2", + "@inquirer/password": "^2.1.14", + "@inquirer/rawlist": "^2.1.14", + "@inquirer/select": "^2.3.10" + }, + "devDependencies": { + "@inquirer/type": "^1.4.0" + }, + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/prompts/README.md", + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/rawlist/LICENSE b/dist/node_modules/@inquirer/rawlist/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/rawlist/README.md b/dist/node_modules/@inquirer/rawlist/README.md new file mode 100644 index 0000000..65bb3ab --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/README.md @@ -0,0 +1,78 @@ +# `@inquirer/rawlist` + +Simple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction. + +![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/rawlist +``` + + + +```sh +yarn add @inquirer/rawlist +``` + +
+ +# Usage + +```js +import rawlist from '@inquirer/rawlist'; + +const answer = await rawlist({ + message: 'Select a package manager', + choices: [ + { name: 'npm', value: 'npm' }, + { name: 'yarn', value: 'yarn' }, + { name: 'pnpm', value: 'pnpm' }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| message | `string` | yes | The question to ask | +| choices | `Array<{ value: string, name?: string, key?: string }>` | yes | List of the available choices. The `value` will be returned as the answer, and used as display if no `name` is defined. By default, choices will be selected by index. This can be customized by using the `key` option. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + highlight: (text: string) => string; + }; +}; +``` + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/rawlist/dist/cjs/index.js b/dist/node_modules/@inquirer/rawlist/dist/cjs/index.js new file mode 100644 index 0000000..f866f33 --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/dist/cjs/index.js @@ -0,0 +1,76 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Separator = void 0; +const core_1 = require("@inquirer/core"); +const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); +const numberRegex = /\d+/; +function isSelectableChoice(choice) { + return choice != null && !core_1.Separator.isSeparator(choice); +} +exports.default = (0, core_1.createPrompt)((config, done) => { + const { choices } = config; + const [status, setStatus] = (0, core_1.useState)('pending'); + const [value, setValue] = (0, core_1.useState)(''); + const [errorMsg, setError] = (0, core_1.useState)(); + const theme = (0, core_1.makeTheme)(config.theme); + const prefix = (0, core_1.usePrefix)({ theme }); + (0, core_1.useKeypress)((key, rl) => { + if ((0, core_1.isEnterKey)(key)) { + let selectedChoice; + if (numberRegex.test(value)) { + const answer = Number.parseInt(value, 10) - 1; + selectedChoice = choices.filter(isSelectableChoice)[answer]; + } + else { + const answer = value.toLowerCase(); + selectedChoice = choices.find((choice) => isSelectableChoice(choice) && choice.key === answer); + } + if (isSelectableChoice(selectedChoice)) { + setValue(selectedChoice.name || String(selectedChoice.value)); + setStatus('done'); + done(selectedChoice.value); + } + else if (value === '') { + setError('Please input a value'); + } + else { + setError(`"${yoctocolors_cjs_1.default.red(value)}" isn't an available option`); + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + if (status === 'done') { + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + let index = 0; + const choicesStr = choices + .map((choice) => { + if (core_1.Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + index += 1; + const line = ` ${choice.key || index}) ${choice.name || choice.value}`; + if (choice.key === value.toLowerCase() || String(index) === value) { + return theme.style.highlight(line); + } + return line; + }) + .join('\n'); + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message} ${value}`, + [choicesStr, error].filter(Boolean).join('\n'), + ]; +}); +var core_2 = require("@inquirer/core"); +Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return core_2.Separator; } }); diff --git a/dist/node_modules/@inquirer/rawlist/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/rawlist/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..53c1814 --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/dist/cjs/types/index.d.ts @@ -0,0 +1,14 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type Choice = { + value: Value; + name?: string; + key?: string; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Choice)[]; + theme?: PartialDeep; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/rawlist/dist/esm/index.mjs b/dist/node_modules/@inquirer/rawlist/dist/esm/index.mjs new file mode 100644 index 0000000..732037c --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/dist/esm/index.mjs @@ -0,0 +1,69 @@ +import { createPrompt, useState, useKeypress, usePrefix, isEnterKey, Separator, makeTheme, } from '@inquirer/core'; +import colors from 'yoctocolors-cjs'; +const numberRegex = /\d+/; +function isSelectableChoice(choice) { + return choice != null && !Separator.isSeparator(choice); +} +export default createPrompt((config, done) => { + const { choices } = config; + const [status, setStatus] = useState('pending'); + const [value, setValue] = useState(''); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ theme }); + useKeypress((key, rl) => { + if (isEnterKey(key)) { + let selectedChoice; + if (numberRegex.test(value)) { + const answer = Number.parseInt(value, 10) - 1; + selectedChoice = choices.filter(isSelectableChoice)[answer]; + } + else { + const answer = value.toLowerCase(); + selectedChoice = choices.find((choice) => isSelectableChoice(choice) && choice.key === answer); + } + if (isSelectableChoice(selectedChoice)) { + setValue(selectedChoice.name || String(selectedChoice.value)); + setStatus('done'); + done(selectedChoice.value); + } + else if (value === '') { + setError('Please input a value'); + } + else { + setError(`"${colors.red(value)}" isn't an available option`); + } + } + else { + setValue(rl.line); + setError(undefined); + } + }); + const message = theme.style.message(config.message); + if (status === 'done') { + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + let index = 0; + const choicesStr = choices + .map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + index += 1; + const line = ` ${choice.key || index}) ${choice.name || choice.value}`; + if (choice.key === value.toLowerCase() || String(index) === value) { + return theme.style.highlight(line); + } + return line; + }) + .join('\n'); + let error = ''; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message} ${value}`, + [choicesStr, error].filter(Boolean).join('\n'), + ]; +}); +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/rawlist/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/rawlist/dist/esm/types/index.d.mts new file mode 100644 index 0000000..53c1814 --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/dist/esm/types/index.d.mts @@ -0,0 +1,14 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type Choice = { + value: Value; + name?: string; + key?: string; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Choice)[]; + theme?: PartialDeep; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/rawlist/dist/types/index.d.ts b/dist/node_modules/@inquirer/rawlist/dist/types/index.d.ts new file mode 100644 index 0000000..53c1814 --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/dist/types/index.d.ts @@ -0,0 +1,14 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type Choice = { + value: Value; + name?: string; + key?: string; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Choice)[]; + theme?: PartialDeep; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/rawlist/package.json b/dist/node_modules/@inquirer/rawlist/package.json new file mode 100644 index 0000000..9ed071d --- /dev/null +++ b/dist/node_modules/@inquirer/rawlist/package.json @@ -0,0 +1,91 @@ +{ + "name": "@inquirer/rawlist", + "version": "2.1.14", + "description": "Inquirer rawlist prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/rawlist/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "yoctocolors-cjs": "^2.1.2" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/select/LICENSE b/dist/node_modules/@inquirer/select/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/select/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/select/README.md b/dist/node_modules/@inquirer/select/README.md new file mode 100644 index 0000000..a8a41c7 --- /dev/null +++ b/dist/node_modules/@inquirer/select/README.md @@ -0,0 +1,113 @@ +# `@inquirer/select` + +Simple interactive command line prompt to display a list of choices (single select.) + +![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +# Installation + + + + + + + + + + +
npmyarn
+ +```sh +npm install @inquirer/select +``` + + + +```sh +yarn add @inquirer/select +``` + +
+ +# Usage + +```js +import select, { Separator } from '@inquirer/select'; + +const answer = await select({ + message: 'Select a package manager', + choices: [ + { + name: 'npm', + value: 'npm', + description: 'npm is the most popular package manager', + }, + { + name: 'yarn', + value: 'yarn', + description: 'yarn is an awesome package manager', + }, + new Separator(), + { + name: 'jspm', + value: 'jspm', + disabled: true, + }, + { + name: 'pnpm', + value: 'pnpm', + disabled: '(pnpm is not available)', + }, + ], +}); +``` + +## Options + +| Property | Type | Required | Description | +| -------- | ---------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| message | `string` | yes | The question to ask | +| choices | `Array<{ value: string, name?: string, description?: string, disabled?: boolean \| string } \| Separator>` | yes | List of the available choices. The `value` will be returned as the answer, and used as display if no `name` is defined. Choices who're `disabled` will be displayed, but not selectable. The `description` will be displayed under the prompt when the cursor land over the choice. | +| default | `string` | no | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item. | +| pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. | +| loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. | +| theme | [See Theming](#Theming) | no | Customize look of the prompt. | + +The `Separator` object can be used to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options. + +## Theming + +You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest. + +```ts +type Theme = { + prefix: string; + spinner: { + interval: number; + frames: string[]; + }; + style: { + answer: (text: string) => string; + message: (text: string) => string; + error: (text: string) => string; + help: (text: string) => string; + highlight: (text: string) => string; + disabled: (text: string) => string; + }; + icon: { + cursor: string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +``` + +### `theme.helpMode` + +- `auto` (default): Hide the help tips after an interaction occurs. +- `always`: The help tips will always show and never hide. +- `never`: The help tips will never show. + +# License + +Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license. diff --git a/dist/node_modules/@inquirer/select/dist/cjs/index.js b/dist/node_modules/@inquirer/select/dist/cjs/index.js new file mode 100644 index 0000000..025b4e0 --- /dev/null +++ b/dist/node_modules/@inquirer/select/dist/cjs/index.js @@ -0,0 +1,134 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Separator = void 0; +const core_1 = require("@inquirer/core"); +const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); +const figures_1 = __importDefault(require("@inquirer/figures")); +const ansi_escapes_1 = __importDefault(require("ansi-escapes")); +const selectTheme = { + icon: { cursor: figures_1.default.pointer }, + style: { disabled: (text) => yoctocolors_cjs_1.default.dim(`- ${text}`) }, + helpMode: 'auto', +}; +function isSelectable(item) { + return !core_1.Separator.isSeparator(item) && !item.disabled; +} +exports.default = (0, core_1.createPrompt)((config, done) => { + const { choices: items, loop = true, pageSize = 7 } = config; + const firstRender = (0, core_1.useRef)(true); + const theme = (0, core_1.makeTheme)(selectTheme, config.theme); + const prefix = (0, core_1.usePrefix)({ theme }); + const [status, setStatus] = (0, core_1.useState)('pending'); + const searchTimeoutRef = (0, core_1.useRef)(); + const bounds = (0, core_1.useMemo)(() => { + const first = items.findIndex(isSelectable); + const last = items.findLastIndex(isSelectable); + if (first < 0) { + throw new core_1.ValidationError('[select prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [items]); + const defaultItemIndex = (0, core_1.useMemo)(() => { + if (!('default' in config)) + return -1; + return items.findIndex((item) => isSelectable(item) && item.value === config.default); + }, [config.default, items]); + const [active, setActive] = (0, core_1.useState)(defaultItemIndex === -1 ? bounds.first : defaultItemIndex); + // Safe to assume the cursor position always point to a Choice. + const selectedChoice = items[active]; + (0, core_1.useKeypress)((key, rl) => { + clearTimeout(searchTimeoutRef.current); + if ((0, core_1.isEnterKey)(key)) { + setStatus('done'); + done(selectedChoice.value); + } + else if ((0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) { + rl.clearLine(0); + if (loop || + ((0, core_1.isUpKey)(key) && active !== bounds.first) || + ((0, core_1.isDownKey)(key) && active !== bounds.last)) { + const offset = (0, core_1.isUpKey)(key) ? -1 : 1; + let next = active; + do { + next = (next + offset + items.length) % items.length; + } while (!isSelectable(items[next])); + setActive(next); + } + } + else if ((0, core_1.isNumberKey)(key)) { + rl.clearLine(0); + const position = Number(key.name) - 1; + const item = items[position]; + if (item != null && isSelectable(item)) { + setActive(position); + } + } + else if ((0, core_1.isBackspaceKey)(key)) { + rl.clearLine(0); + } + else { + // Default to search + const searchTerm = rl.line.toLowerCase(); + const matchIndex = items.findIndex((item) => { + if (core_1.Separator.isSeparator(item) || !isSelectable(item)) + return false; + return String(item.name || item.value) + .toLowerCase() + .startsWith(searchTerm); + }); + if (matchIndex >= 0) { + setActive(matchIndex); + } + searchTimeoutRef.current = setTimeout(() => { + rl.clearLine(0); + }, 700); + } + }); + const message = theme.style.message(config.message); + let helpTipTop = ''; + let helpTipBottom = ''; + if (theme.helpMode === 'always' || + (theme.helpMode === 'auto' && firstRender.current)) { + firstRender.current = false; + if (items.length > pageSize) { + helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`; + } + else { + helpTipTop = theme.style.help('(Use arrow keys)'); + } + } + const page = (0, core_1.usePagination)({ + items, + active, + renderItem({ item, isActive }) { + if (core_1.Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + const line = item.name || item.value; + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabled(`${line} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${line}`); + }, + pageSize, + loop, + }); + if (status === 'done') { + const answer = selectedChoice.name || + // TODO: Could we enforce that at the type level? Name should be defined for non-string values. + String(selectedChoice.value); + return `${prefix} ${message} ${theme.style.answer(answer)}`; + } + const choiceDescription = selectedChoice.description + ? `\n${selectedChoice.description}` + : ``; + return `${[prefix, message, helpTipTop].filter(Boolean).join(' ')}\n${page}${choiceDescription}${helpTipBottom}${ansi_escapes_1.default.cursorHide}`; +}); +var core_2 = require("@inquirer/core"); +Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return core_2.Separator; } }); diff --git a/dist/node_modules/@inquirer/select/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/select/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..0d76c25 --- /dev/null +++ b/dist/node_modules/@inquirer/select/dist/cjs/types/index.d.ts @@ -0,0 +1,28 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type SelectTheme = { + icon: { + cursor: string; + }; + style: { + disabled: (text: string) => string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +type Choice = { + value: Value; + name?: string; + description?: string; + disabled?: boolean | string; + type?: never; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Choice)[]; + pageSize?: number; + loop?: boolean; + default?: unknown; + theme?: PartialDeep>; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/select/dist/esm/index.mjs b/dist/node_modules/@inquirer/select/dist/esm/index.mjs new file mode 100644 index 0000000..1dd686a --- /dev/null +++ b/dist/node_modules/@inquirer/select/dist/esm/index.mjs @@ -0,0 +1,127 @@ +import { createPrompt, useState, useKeypress, usePrefix, usePagination, useRef, useMemo, isBackspaceKey, isEnterKey, isUpKey, isDownKey, isNumberKey, Separator, ValidationError, makeTheme, } from '@inquirer/core'; +import colors from 'yoctocolors-cjs'; +import figures from '@inquirer/figures'; +import ansiEscapes from 'ansi-escapes'; +const selectTheme = { + icon: { cursor: figures.pointer }, + style: { disabled: (text) => colors.dim(`- ${text}`) }, + helpMode: 'auto', +}; +function isSelectable(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +export default createPrompt((config, done) => { + const { choices: items, loop = true, pageSize = 7 } = config; + const firstRender = useRef(true); + const theme = makeTheme(selectTheme, config.theme); + const prefix = usePrefix({ theme }); + const [status, setStatus] = useState('pending'); + const searchTimeoutRef = useRef(); + const bounds = useMemo(() => { + const first = items.findIndex(isSelectable); + const last = items.findLastIndex(isSelectable); + if (first < 0) { + throw new ValidationError('[select prompt] No selectable choices. All choices are disabled.'); + } + return { first, last }; + }, [items]); + const defaultItemIndex = useMemo(() => { + if (!('default' in config)) + return -1; + return items.findIndex((item) => isSelectable(item) && item.value === config.default); + }, [config.default, items]); + const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex); + // Safe to assume the cursor position always point to a Choice. + const selectedChoice = items[active]; + useKeypress((key, rl) => { + clearTimeout(searchTimeoutRef.current); + if (isEnterKey(key)) { + setStatus('done'); + done(selectedChoice.value); + } + else if (isUpKey(key) || isDownKey(key)) { + rl.clearLine(0); + if (loop || + (isUpKey(key) && active !== bounds.first) || + (isDownKey(key) && active !== bounds.last)) { + const offset = isUpKey(key) ? -1 : 1; + let next = active; + do { + next = (next + offset + items.length) % items.length; + } while (!isSelectable(items[next])); + setActive(next); + } + } + else if (isNumberKey(key)) { + rl.clearLine(0); + const position = Number(key.name) - 1; + const item = items[position]; + if (item != null && isSelectable(item)) { + setActive(position); + } + } + else if (isBackspaceKey(key)) { + rl.clearLine(0); + } + else { + // Default to search + const searchTerm = rl.line.toLowerCase(); + const matchIndex = items.findIndex((item) => { + if (Separator.isSeparator(item) || !isSelectable(item)) + return false; + return String(item.name || item.value) + .toLowerCase() + .startsWith(searchTerm); + }); + if (matchIndex >= 0) { + setActive(matchIndex); + } + searchTimeoutRef.current = setTimeout(() => { + rl.clearLine(0); + }, 700); + } + }); + const message = theme.style.message(config.message); + let helpTipTop = ''; + let helpTipBottom = ''; + if (theme.helpMode === 'always' || + (theme.helpMode === 'auto' && firstRender.current)) { + firstRender.current = false; + if (items.length > pageSize) { + helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`; + } + else { + helpTipTop = theme.style.help('(Use arrow keys)'); + } + } + const page = usePagination({ + items, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + const line = item.name || item.value; + if (item.disabled) { + const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)'; + return theme.style.disabled(`${line} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${line}`); + }, + pageSize, + loop, + }); + if (status === 'done') { + const answer = selectedChoice.name || + // TODO: Could we enforce that at the type level? Name should be defined for non-string values. + String(selectedChoice.value); + return `${prefix} ${message} ${theme.style.answer(answer)}`; + } + const choiceDescription = selectedChoice.description + ? `\n${selectedChoice.description}` + : ``; + return `${[prefix, message, helpTipTop].filter(Boolean).join(' ')}\n${page}${choiceDescription}${helpTipBottom}${ansiEscapes.cursorHide}`; +}); +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/select/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/select/dist/esm/types/index.d.mts new file mode 100644 index 0000000..0d76c25 --- /dev/null +++ b/dist/node_modules/@inquirer/select/dist/esm/types/index.d.mts @@ -0,0 +1,28 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type SelectTheme = { + icon: { + cursor: string; + }; + style: { + disabled: (text: string) => string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +type Choice = { + value: Value; + name?: string; + description?: string; + disabled?: boolean | string; + type?: never; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Choice)[]; + pageSize?: number; + loop?: boolean; + default?: unknown; + theme?: PartialDeep>; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/select/dist/types/index.d.ts b/dist/node_modules/@inquirer/select/dist/types/index.d.ts new file mode 100644 index 0000000..0d76c25 --- /dev/null +++ b/dist/node_modules/@inquirer/select/dist/types/index.d.ts @@ -0,0 +1,28 @@ +import { Separator, type Theme } from '@inquirer/core'; +import type { PartialDeep } from '@inquirer/type'; +type SelectTheme = { + icon: { + cursor: string; + }; + style: { + disabled: (text: string) => string; + }; + helpMode: 'always' | 'never' | 'auto'; +}; +type Choice = { + value: Value; + name?: string; + description?: string; + disabled?: boolean | string; + type?: never; +}; +declare const _default: (config: { + message: string; + choices: readonly (Separator | Choice)[]; + pageSize?: number; + loop?: boolean; + default?: unknown; + theme?: PartialDeep>; +}, context?: import("@inquirer/type").Context) => import("@inquirer/type").CancelablePromise; +export default _default; +export { Separator } from '@inquirer/core'; diff --git a/dist/node_modules/@inquirer/select/package.json b/dist/node_modules/@inquirer/select/package.json new file mode 100644 index 0000000..6d8df17 --- /dev/null +++ b/dist/node_modules/@inquirer/select/package.json @@ -0,0 +1,93 @@ +{ + "name": "@inquirer/select", + "version": "2.3.10", + "description": "Inquirer select/list prompt", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/select/README.md", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "devDependencies": { + "@inquirer/testing": "^2.1.25" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "95d2d65d3aca2c0fab66c7fd40b5dc413dfc894f" +} diff --git a/dist/node_modules/@inquirer/type/LICENSE b/dist/node_modules/@inquirer/type/LICENSE new file mode 100644 index 0000000..6a10a8e --- /dev/null +++ b/dist/node_modules/@inquirer/type/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2023 Simon Boudrias + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/node_modules/@inquirer/type/dist/cjs/index.js b/dist/node_modules/@inquirer/type/dist/cjs/index.js new file mode 100644 index 0000000..7fd193d --- /dev/null +++ b/dist/node_modules/@inquirer/type/dist/cjs/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CancelablePromise = void 0; +class CancelablePromise extends Promise { + constructor() { + super(...arguments); + Object.defineProperty(this, "cancel", { + enumerable: true, + configurable: true, + writable: true, + value: () => { } + }); + } +} +exports.CancelablePromise = CancelablePromise; diff --git a/dist/node_modules/@inquirer/type/dist/cjs/types/index.d.ts b/dist/node_modules/@inquirer/type/dist/cjs/types/index.d.ts new file mode 100644 index 0000000..c170eca --- /dev/null +++ b/dist/node_modules/@inquirer/type/dist/cjs/types/index.d.ts @@ -0,0 +1,40 @@ +import * as readline from 'node:readline'; +import MuteStream from 'mute-stream'; +export type InquirerReadline = readline.ReadLine & { + output: MuteStream; + input: NodeJS.ReadableStream; + clearLine: (dir: 0 | 1 | -1) => void; +}; +export declare class CancelablePromise extends Promise { + cancel: () => void; +} +export type Prettify = { + [K in keyof T]: T[K]; +} & {}; +export type PartialDeep = T extends object ? { + [P in keyof T]?: PartialDeep; +} : T; +export type Context = { + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + clearPromptOnDone?: boolean; +}; +export type Prompt = (config: Config, context?: Context) => CancelablePromise; +/** + * Utility types used for writing tests + * + * Equal checks that A and B are the same type, and returns + * either `true` or `false`. + * + * You can use it in combination with `Expect` to write type + * inference unit tests: + * + * ```ts + * type t = Expect< + * Equal, { a?: string }> + * > + * ``` + */ +export type Equal = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; +export type Expect = T; +export type Not = T extends true ? false : true; diff --git a/dist/node_modules/@inquirer/type/dist/esm/index.mjs b/dist/node_modules/@inquirer/type/dist/esm/index.mjs new file mode 100644 index 0000000..7f995d8 --- /dev/null +++ b/dist/node_modules/@inquirer/type/dist/esm/index.mjs @@ -0,0 +1,3 @@ +export class CancelablePromise extends Promise { + cancel = () => { }; +} diff --git a/dist/node_modules/@inquirer/type/dist/esm/types/index.d.mts b/dist/node_modules/@inquirer/type/dist/esm/types/index.d.mts new file mode 100644 index 0000000..c170eca --- /dev/null +++ b/dist/node_modules/@inquirer/type/dist/esm/types/index.d.mts @@ -0,0 +1,40 @@ +import * as readline from 'node:readline'; +import MuteStream from 'mute-stream'; +export type InquirerReadline = readline.ReadLine & { + output: MuteStream; + input: NodeJS.ReadableStream; + clearLine: (dir: 0 | 1 | -1) => void; +}; +export declare class CancelablePromise extends Promise { + cancel: () => void; +} +export type Prettify = { + [K in keyof T]: T[K]; +} & {}; +export type PartialDeep = T extends object ? { + [P in keyof T]?: PartialDeep; +} : T; +export type Context = { + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + clearPromptOnDone?: boolean; +}; +export type Prompt = (config: Config, context?: Context) => CancelablePromise; +/** + * Utility types used for writing tests + * + * Equal checks that A and B are the same type, and returns + * either `true` or `false`. + * + * You can use it in combination with `Expect` to write type + * inference unit tests: + * + * ```ts + * type t = Expect< + * Equal, { a?: string }> + * > + * ``` + */ +export type Equal = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; +export type Expect = T; +export type Not = T extends true ? false : true; diff --git a/dist/node_modules/@inquirer/type/package.json b/dist/node_modules/@inquirer/type/package.json new file mode 100644 index 0000000..5bbdba2 --- /dev/null +++ b/dist/node_modules/@inquirer/type/package.json @@ -0,0 +1,84 @@ +{ + "name": "@inquirer/type", + "version": "1.4.0", + "description": "Inquirer core TS types", + "main": "./dist/cjs/index.js", + "typings": "./dist/cjs/types/index.d.ts", + "files": [ + "dist/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/SBoudrias/Inquirer.js.git" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generate", + "generator", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "menu", + "node", + "nodejs", + "prompt", + "promptly", + "prompts", + "question", + "readline", + "scaffold", + "scaffolder", + "scaffolding", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh", + "types", + "typescript" + ], + "author": "Simon Boudrias ", + "license": "MIT", + "dependencies": { + "mute-stream": "^1.0.0" + }, + "scripts": { + "tsc": "yarn run tsc:esm && yarn run tsc:cjs", + "tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", + "tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", + "dev": "tsc -p ./tsconfig.json --watch", + "attw": "attw --pack" + }, + "engines": { + "node": ">=18" + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/types/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/types/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + }, + "sideEffects": false, + "gitHead": "fc27d575bceb96466cb8da8524c26d4eb2a77df0" +} diff --git a/dist/node_modules/@types/mute-stream/LICENSE b/dist/node_modules/@types/mute-stream/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/dist/node_modules/@types/mute-stream/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/dist/node_modules/@types/mute-stream/README.md b/dist/node_modules/@types/mute-stream/README.md new file mode 100644 index 0000000..de6496b --- /dev/null +++ b/dist/node_modules/@types/mute-stream/README.md @@ -0,0 +1,49 @@ +# Installation +> `npm install --save @types/mute-stream` + +# Summary +This package contains type definitions for mute-stream (https://github.com/isaacs/mute-stream#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mute-stream. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mute-stream/index.d.ts) +````ts +/// + +import { Duplex } from "stream"; + +declare namespace MuteStream { + interface Options { + /** + * Set to a string to replace each character with the specified string when muted. + * (So you can show **** instead of the password, for example.) + */ + replace?: string | undefined; + + /** + * If you are using a replacement char, and also using a prompt with a readline stream + * (as for a Password: ***** input), then specify what the prompt is so that backspace + * will work properly. Otherwise, pressing backspace will overwrite the prompt with the + * replacement character, which is weird. + */ + prompt?: string | undefined; + } +} + +declare class MuteStream extends Duplex { + constructor(options?: MuteStream.Options); + mute: () => void; + unmute: () => void; + isTTY: boolean; +} + +export = MuteStream; + +```` + +### Additional Details + * Last updated: Tue, 07 Nov 2023 09:09:39 GMT + * Dependencies: [@types/node](https://npmjs.com/package/@types/node) + +# Credits +These definitions were written by [Adam Jarret](https://github.com/adamjarret). diff --git a/dist/node_modules/@types/mute-stream/index.d.ts b/dist/node_modules/@types/mute-stream/index.d.ts new file mode 100644 index 0000000..fe0acf8 --- /dev/null +++ b/dist/node_modules/@types/mute-stream/index.d.ts @@ -0,0 +1,30 @@ +/// + +import { Duplex } from "stream"; + +declare namespace MuteStream { + interface Options { + /** + * Set to a string to replace each character with the specified string when muted. + * (So you can show **** instead of the password, for example.) + */ + replace?: string | undefined; + + /** + * If you are using a replacement char, and also using a prompt with a readline stream + * (as for a Password: ***** input), then specify what the prompt is so that backspace + * will work properly. Otherwise, pressing backspace will overwrite the prompt with the + * replacement character, which is weird. + */ + prompt?: string | undefined; + } +} + +declare class MuteStream extends Duplex { + constructor(options?: MuteStream.Options); + mute: () => void; + unmute: () => void; + isTTY: boolean; +} + +export = MuteStream; diff --git a/dist/node_modules/@types/mute-stream/package.json b/dist/node_modules/@types/mute-stream/package.json new file mode 100644 index 0000000..26988cd --- /dev/null +++ b/dist/node_modules/@types/mute-stream/package.json @@ -0,0 +1,27 @@ +{ + "name": "@types/mute-stream", + "version": "0.0.4", + "description": "TypeScript definitions for mute-stream", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mute-stream", + "license": "MIT", + "contributors": [ + { + "name": "Adam Jarret", + "githubUsername": "adamjarret", + "url": "https://github.com/adamjarret" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/mute-stream" + }, + "scripts": {}, + "dependencies": { + "@types/node": "*" + }, + "typesPublisherContentHash": "0a0047b7ac14dcaf2bf9afa6933c9ca7e51b2196a8d57e82b9f54b872acd6eb4", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/dist/node_modules/@types/node/README.md b/dist/node_modules/@types/node/README.md index 6e81e28..91eb7ed 100644 --- a/dist/node_modules/@types/node/README.md +++ b/dist/node_modules/@types/node/README.md @@ -8,8 +8,8 @@ This package contains type definitions for node (https://nodejs.org/). Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. ### Additional Details - * Last updated: Sat, 18 Nov 2023 20:07:14 GMT + * Last updated: Tue, 25 Jun 2024 22:07:01 GMT * Dependencies: [undici-types](https://npmjs.com/package/undici-types) # Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/dist/node_modules/@types/node/assert.d.ts b/dist/node_modules/@types/node/assert.d.ts index e237c56..4e465c5 100644 --- a/dist/node_modules/@types/node/assert.d.ts +++ b/dist/node_modules/@types/node/assert.d.ts @@ -1,7 +1,7 @@ /** * The `node:assert` module provides a set of assertion functions for verifying * invariants. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/assert.js) */ declare module "assert" { /** @@ -12,7 +12,7 @@ declare module "assert" { function assert(value: unknown, message?: string | Error): asserts value; namespace assert { /** - * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. + * Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class. */ class AssertionError extends Error { /** @@ -45,7 +45,7 @@ declare module "assert" { /** The `operator` property on the error instance. */ operator?: string | undefined; /** If provided, the generated stack trace omits frames before this function. */ - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types stackStartFn?: Function | undefined; }); } @@ -76,7 +76,7 @@ declare module "assert" { * @since v14.2.0, v12.19.0 * @param [fn='A no-op function'] * @param [exact=1] - * @return that wraps `fn`. + * @return A function that wraps `fn`. */ calls(exact?: number): () => void; calls any>(fn?: Func, exact?: number): Func; @@ -96,8 +96,7 @@ declare module "assert" { * [{ thisArg: undefined, arguments: [1, 2, 3] }]); * ``` * @since v18.8.0, v16.18.0 - * @param fn - * @return An Array with all the calls to a tracked function. + * @return An array with all the calls to a tracked function. */ getCalls(fn: Function): CallTrackerCall[]; /** @@ -130,12 +129,11 @@ declare module "assert" { * // ] * ``` * @since v14.2.0, v12.19.0 - * @return An Array of objects containing information about the wrapper functions returned by `calls`. + * @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}. */ report(): CallTrackerReportInformation[]; /** - * Reset calls of the call tracker. - * If a tracked function is passed as an argument, the calls will be reset for it. + * Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it. * If no arguments are passed, all tracked functions will be reset. * * ```js @@ -158,7 +156,7 @@ declare module "assert" { */ reset(fn?: Function): void; /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that + * Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that * have not been called the expected number of times. * * ```js @@ -228,14 +226,14 @@ declare module "assert" { expected: unknown, message?: string | Error, operator?: string, - // tslint:disable-next-line:ban-types + // eslint-disable-next-line @typescript-eslint/ban-types stackStartFn?: Function, ): never; /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. + * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If `value` is not truthy, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is `undefined`, a default + * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. * * Be aware that in the `repl` the error message will be different to the one @@ -317,8 +315,8 @@ declare module "assert" { * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } * ``` * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If the values are not equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default + * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. * @since v0.1.21 */ function equal(actual: unknown, expected: unknown, message?: string | Error): void; @@ -347,8 +345,8 @@ declare module "assert" { * // AssertionError: 1 != '1' * ``` * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If the values are equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error + * message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. * @since v0.1.21 */ function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; @@ -414,8 +412,8 @@ declare module "assert" { * // OK * ``` * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * If the values are deeply equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default + * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown * instead of the `AssertionError`. * @since v0.1.21 */ @@ -452,8 +450,8 @@ declare module "assert" { * // TypeError: Inputs are not identical * ``` * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * If the values are not strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a + * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown * instead of the `AssertionError`. * @since v0.1.21 */ @@ -477,8 +475,8 @@ declare module "assert" { * // OK * ``` * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * If the values are strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a + * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown * instead of the `AssertionError`. * @since v0.1.21 */ @@ -519,7 +517,7 @@ declare module "assert" { * using an object, it is also possible to use a regular expression, when * validating against a string property. See below for examples. * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation + * If specified, `message` will be appended to the message provided by the `AssertionError` if the `fn` call fails to throw or in case the error validation * fails. * * Custom validation object/error instance: @@ -649,8 +647,8 @@ declare module "assert" { * ``` * * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using + * argument, then `error` is assumed to be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Using the same + * message as the thrown error message is going to result in an `ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using * a string as the second argument gets considered: * * ```js @@ -703,9 +701,9 @@ declare module "assert" { * adding a comment next to the specific code path that should not throw and keep * error messages as expressive as possible. * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. + * When `assert.doesNotThrow()` is called, it will immediately call the `fn` function. * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a + * If an error is thrown and it is the same type as that specified by the `error` parameter, then an `AssertionError` is thrown. If the error is of a * different type, or if the `error` parameter is undefined, the error is * propagated back to the caller. * @@ -741,7 +739,7 @@ declare module "assert" { * ); * ``` * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: + * If an `AssertionError` is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the `AssertionError` message: * * ```js * import assert from 'node:assert/strict'; @@ -762,7 +760,7 @@ declare module "assert" { /** * Throws `value` if `value` is not `undefined` or `null`. This is useful when * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. + * from the error passed to `ifError()` including the potential new frames for `ifError()` itself. * * ```js * import assert from 'node:assert/strict'; @@ -797,18 +795,18 @@ declare module "assert" { * calls the function and awaits the returned promise to complete. It will then * check that the promise is rejected. * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. + * If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the + * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v20.x/api/errors.html#err_invalid_return_value) + * error. In both cases the error handler is skipped. * * Besides the async nature to await the completion behaves identically to {@link throws}. * * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. + * each property will be tested for including the non-enumerable `message` and `name` properties. * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. + * If specified, `message` will be the message provided by the `{@link AssertionError}` if the `asyncFn` fails to reject. * * ```js * import assert from 'node:assert/strict'; @@ -850,10 +848,9 @@ declare module "assert" { * }); * ``` * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. + * `error` cannot be a string. If a string is provided as the second argument, then `error` is assumed to + * be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Please read the + * example in {@link throws} carefully if using a string as the second argument gets considered. * @since v10.0.0 */ function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; @@ -867,9 +864,9 @@ declare module "assert" { * calls the function and awaits the returned promise to complete. It will then * check that the promise is not rejected. * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If + * If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases + * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v20.x/api/errors.html#err_invalid_return_value) error. In both cases * the error handler is skipped. * * Using `assert.doesNotReject()` is actually not useful because there is little @@ -929,10 +926,10 @@ declare module "assert" { * // OK * ``` * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal * to the value of the `message` parameter. If the `message` parameter is * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * instance of an [Error](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. * @since v13.6.0, v12.16.0 */ function match(value: string, regExp: RegExp, message?: string | Error): void; @@ -952,13 +949,60 @@ declare module "assert" { * // OK * ``` * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal * to the value of the `message` parameter. If the `message` parameter is * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * instance of an [Error](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. * @since v13.6.0, v12.16.0 */ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + /** + * In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, + * {@link deepEqual} will behave like {@link deepStrictEqual}. + * + * In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error + * messages for objects display the objects, often truncated. + * + * To use strict assertion mode: + * + * ```js + * import { strict as assert } from 'node:assert';COPY + * import assert from 'node:assert/strict'; + * ``` + * + * Example error diff: + * + * ```js + * import { strict as assert } from 'node:assert'; + * + * assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); + * // AssertionError: Expected inputs to be strictly deep-equal: + * // + actual - expected ... Lines skipped + * // + * // [ + * // [ + * // ... + * // 2, + * // + 3 + * // - '3' + * // ], + * // ... + * // 5 + * // ] + * ``` + * + * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also + * deactivate the colors in the REPL. For more on color support in terminal environments, read the tty + * `getColorDepth()` documentation. + * + * @since v15.0.0, v13.9.0, v12.16.2, v9.9.0 + */ + namespace strict { + type AssertionError = assert.AssertionError; + type AssertPredicate = assert.AssertPredicate; + type CallTrackerCall = assert.CallTrackerCall; + type CallTrackerReportInformation = assert.CallTrackerReportInformation; + } const strict: & Omit< typeof assert, diff --git a/dist/node_modules/@types/node/async_hooks.d.ts b/dist/node_modules/@types/node/async_hooks.d.ts index 0667a61..f5432e2 100644 --- a/dist/node_modules/@types/node/async_hooks.d.ts +++ b/dist/node_modules/@types/node/async_hooks.d.ts @@ -2,8 +2,8 @@ * We strongly discourage the use of the `async_hooks` API. * Other APIs that can cover most of its use cases include: * - * * `AsyncLocalStorage` tracks async context - * * `process.getActiveResourcesInfo()` tracks active resources + * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v20.x/api/async_context.html#class-asynclocalstorage) tracks async context + * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processgetactiveresourcesinfo) tracks active resources * * The `node:async_hooks` module provides an API to track asynchronous resources. * It can be accessed using: @@ -12,7 +12,7 @@ * import async_hooks from 'node:async_hooks'; * ``` * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/async_hooks.js) */ declare module "async_hooks" { /** @@ -44,7 +44,7 @@ declare module "async_hooks" { * ``` * * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. + * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking). * @since v8.1.0 * @return The `asyncId` of the current execution context. Useful to track when something calls. */ @@ -117,17 +117,17 @@ declare module "async_hooks" { * ``` * * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. + * the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking). * @return The ID of the resource responsible for calling the callback that is currently being executed. */ function triggerAsyncId(): number; interface HookCallbacks { /** * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy + * @param asyncId A unique ID for the async resource + * @param type The type of the async resource + * @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created + * @param resource Reference to the resource representing the async operation, needs to be released during destroy */ init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; /** @@ -137,7 +137,9 @@ declare module "async_hooks" { */ before?(asyncId: number): void; /** - * Called immediately after the callback specified in before is completed. + * Called immediately after the callback specified in `before` is completed. + * + * If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs. * @param asyncId the unique identifier assigned to the resource which has executed the callback. */ after?(asyncId: number): void; @@ -321,7 +323,7 @@ declare module "async_hooks" { /** * This class creates stores that stay coherent through asynchronous operations. * - * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory + * While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory * safe implementation that involves significant optimizations that are non-obvious * to implement. * @@ -407,12 +409,12 @@ declare module "async_hooks" { static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; /** * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. + * to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. * * When calling `asyncLocalStorage.disable()`, all current contexts linked to the * instance will be exited. * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores + * Calling `asyncLocalStorage.disable()` is required before the `asyncLocalStorage` can be garbage collected. This does not apply to stores * provided by the `asyncLocalStorage`, as those objects are garbage collected * along with the corresponding async resources. * @@ -465,7 +467,7 @@ declare module "async_hooks" { /** * Runs a function synchronously outside of a context and returns its * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. + * the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. * * The optional `args` are passed to the callback function. * @@ -511,7 +513,7 @@ declare module "async_hooks" { * This transition will continue for the _entire_ synchronous execution. * This means that if, for example, the context is entered within an event * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons + * specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons * to use the latter method. * * ```js diff --git a/dist/node_modules/@types/node/buffer.d.ts b/dist/node_modules/@types/node/buffer.d.ts index a2dbc71..abdf9a6 100644 --- a/dist/node_modules/@types/node/buffer.d.ts +++ b/dist/node_modules/@types/node/buffer.d.ts @@ -41,7 +41,7 @@ * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. * const buf7 = Buffer.from('tést', 'latin1'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/buffer.js) */ declare module "buffer" { import { BinaryLike } from "node:crypto"; @@ -88,7 +88,7 @@ declare module "buffer" { * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if * conversion from `fromEnc` to `toEnc` is not permitted. * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. * * The transcoding process will use substitution characters if a given byte * sequence cannot be adequately represented in the target encoding. For instance: @@ -128,9 +128,10 @@ declare module "buffer" { */ export interface BlobOptions { /** - * @default 'utf8' + * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts + * will be converted to the platform native line-ending as specified by `require('node:os').EOL`. */ - encoding?: BufferEncoding | undefined; + endings?: "transparent" | "native"; /** * The Blob content-type. The intent is for `type` to convey * the MIME media type of the data, however no validation of the type format @@ -162,7 +163,7 @@ declare module "buffer" { * * String sources are also copied into the `Blob`. */ - constructor(sources: Array, options?: BlobOptions); + constructor(sources: Array, options?: BlobOptions); /** * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of * the `Blob` data. @@ -289,7 +290,7 @@ declare module "buffer" { * @param array The octets to store. * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. */ - new(array: ReadonlyArray): Buffer; + new(array: readonly any[]): Buffer; /** * Copies the passed {buffer} data onto a new {Buffer} instance. * @@ -310,12 +311,12 @@ declare module "buffer" { * * If `array` is an `Array`\-like object (that is, one with a `length` property of * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. * * A `TypeError` will be thrown if `array` is not an `Array` or another type * appropriate for `Buffer.from()` variants. * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. * @since v5.10.0 */ from( @@ -327,8 +328,8 @@ declare module "buffer" { * Creates a new Buffer using the passed {data} * @param data data to create a new Buffer */ - from(data: Uint8Array | ReadonlyArray): Buffer; - from(data: WithImplicitCoercion | string>): Buffer; + from(data: Uint8Array | readonly number[]): Buffer; + from(data: WithImplicitCoercion): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -415,13 +416,13 @@ declare module "buffer" { * @return The number of bytes contained within `string`. */ byteLength( - string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, + string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding, ): number; /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. + * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. * * If `totalLength` is not provided, it is calculated from the `Buffer` instances * in `list` by adding their lengths. @@ -456,7 +457,7 @@ declare module "buffer" { * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. */ - concat(list: ReadonlyArray, totalLength?: number): Buffer; + concat(list: readonly Uint8Array[], totalLength?: number): Buffer; /** * Copies the underlying memory of `view` into a new `Buffer`. * @@ -470,12 +471,12 @@ declare module "buffer" { * ``` * @since v19.8.0 * @param view The {TypedArray} to copy. - * @param [offset=': 0'] The starting offset within `view`. + * @param [offset=0] The starting offset within `view`. * @param [length=view.length - offset] The number of elements from `view` to copy. */ copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. * * ```js * import { Buffer } from 'node:buffer'; @@ -563,8 +564,8 @@ declare module "buffer" { * A `TypeError` will be thrown if `size` is not a number. * * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). * * Use of this pre-allocated internal memory pool is a key difference between * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. @@ -780,7 +781,7 @@ declare module "buffer" { * // (This result is equal to: [buf1, buf3, buf2].) * ``` * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. + * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively. * * ```js * import { Buffer } from 'node:buffer'; @@ -796,7 +797,7 @@ declare module "buffer" { * // Prints: 1 * ``` * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. * @since v0.11.13 * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. * @param [targetStart=0] The offset within `target` at which to begin comparison. @@ -1214,7 +1215,7 @@ declare module "buffer" { */ readBigInt64LE(offset?: number): bigint; /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting * up to 48 bits of accuracy. * * This function is also available under the `readUintLE` alias. @@ -1238,7 +1239,7 @@ declare module "buffer" { */ readUintLE(offset: number, byteLength: number): number; /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting * up to 48 bits of accuracy. * * This function is also available under the `readUintBE` alias. @@ -1264,7 +1265,7 @@ declare module "buffer" { */ readUintBE(offset: number, byteLength: number): number; /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value * supporting up to 48 bits of accuracy. * * ```js @@ -1281,7 +1282,7 @@ declare module "buffer" { */ readIntLE(offset: number, byteLength: number): number; /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value + * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value * supporting up to 48 bits of accuracy. * * ```js @@ -1328,7 +1329,7 @@ declare module "buffer" { */ readUint8(offset?: number): number; /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. + * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`. * * This function is also available under the `readUint16LE` alias. * @@ -1701,7 +1702,7 @@ declare module "buffer" { */ writeUint8(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is * anything other than an unsigned 16-bit integer. * * This function is also available under the `writeUint16LE` alias. @@ -1729,7 +1730,7 @@ declare module "buffer" { */ writeUint16LE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an * unsigned 16-bit integer. * * This function is also available under the `writeUint16BE` alias. @@ -1757,7 +1758,7 @@ declare module "buffer" { */ writeUint16BE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is * anything other than an unsigned 32-bit integer. * * This function is also available under the `writeUint32LE` alias. @@ -1784,7 +1785,7 @@ declare module "buffer" { */ writeUint32LE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an * unsigned 32-bit integer. * * This function is also available under the `writeUint32BE` alias. @@ -1835,7 +1836,7 @@ declare module "buffer" { */ writeInt8(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is * anything other than a signed 16-bit integer. * * The `value` is interpreted and written as a two's complement signed integer. @@ -1857,7 +1858,7 @@ declare module "buffer" { */ writeInt16LE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is * anything other than a signed 16-bit integer. * * The `value` is interpreted and written as a two's complement signed integer. @@ -1879,7 +1880,7 @@ declare module "buffer" { */ writeInt16BE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is * anything other than a signed 32-bit integer. * * The `value` is interpreted and written as a two's complement signed integer. @@ -1901,7 +1902,7 @@ declare module "buffer" { */ writeInt32LE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is * anything other than a signed 32-bit integer. * * The `value` is interpreted and written as a two's complement signed integer. @@ -1963,7 +1964,7 @@ declare module "buffer" { */ writeFloatBE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything * other than a JavaScript number. * * ```js @@ -1983,7 +1984,7 @@ declare module "buffer" { */ writeDoubleLE(value: number, offset?: number): number; /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything * other than a JavaScript number. * * ```js @@ -2065,7 +2066,7 @@ declare module "buffer" { /** * If `value` is: * - * * a string, `value` is interpreted according to the character encoding in`encoding`. + * * a string, `value` is interpreted according to the character encoding in `encoding`. * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. * To compare a partial `Buffer`, use `buf.subarray`. * * a number, `value` will be interpreted as an unsigned 8-bit integer @@ -2097,7 +2098,7 @@ declare module "buffer" { * // Prints: 6 * ``` * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, * an integer between 0 and 255. * * If `byteOffset` is not a number, it will be coerced to a number. If the result @@ -2163,7 +2164,7 @@ declare module "buffer" { * // Prints: 4 * ``` * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, * an integer between 0 and 255. * * If `byteOffset` is not a number, it will be coerced to a number. Any arguments @@ -2322,7 +2323,7 @@ declare module "buffer" { * **and should never be used in new code, because they use strings to represent** * **binary data and predate the introduction of typed arrays in JavaScript.** * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** * @since v15.13.0, v14.17.0 * @legacy Use `Buffer.from(data, 'base64')` instead. * @param data The Base64-encoded input string. @@ -2338,7 +2339,7 @@ declare module "buffer" { * **and should never be used in new code, because they use strings to represent** * **binary data and predate the introduction of typed arrays in JavaScript.** * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** * @since v15.13.0, v14.17.0 * @legacy Use `buf.toString('base64')` instead. * @param data An ASCII (Latin1) string. diff --git a/dist/node_modules/@types/node/child_process.d.ts b/dist/node_modules/@types/node/child_process.d.ts index 9f1a38a..b642adc 100644 --- a/dist/node_modules/@types/node/child_process.d.ts +++ b/dist/node_modules/@types/node/child_process.d.ts @@ -25,7 +25,7 @@ * limited (and platform-specific) capacity. If the subprocess writes to * stdout in excess of that limit without the output being captured, the * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. + * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed. * * The command lookup is performed using the `options.env.PATH` environment * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is @@ -38,7 +38,7 @@ * lexicographically sorts the `env` keys and uses the first one that * case-insensitively matches. Only first (in lexicographic order) entry will be * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. + * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`. * * The {@link spawn} method spawns the child process asynchronously, * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks @@ -63,16 +63,17 @@ * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, * the synchronous methods can have significant impact on performance due to * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/child_process.js) */ declare module "child_process" { import { ObjectEncodingOptions } from "node:fs"; import { Abortable, EventEmitter } from "node:events"; + import * as dgram from "node:dgram"; import * as net from "node:net"; import { Pipe, Readable, Stream, Writable } from "node:stream"; import { URL } from "node:url"; type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; + type SendHandle = net.Socket | net.Server | dgram.Socket | undefined; /** * Instances of the `ChildProcess` represent spawned child processes. * @@ -94,7 +95,7 @@ declare module "child_process" { * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will * refer to the same value. * - * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned. + * The `subprocess.stdin` property can be `null` or `undefined` if the child process could not be successfully spawned. * @since v0.1.90 */ stdin: Writable | null; @@ -117,7 +118,7 @@ declare module "child_process" { * }); * ``` * - * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned. + * The `subprocess.stdout` property can be `null` or `undefined` if the child process could not be successfully spawned. * @since v0.1.90 */ stdout: Readable | null; @@ -130,7 +131,7 @@ declare module "child_process" { * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will * refer to the same value. * - * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned. + * The `subprocess.stderr` property can be `null` or `undefined` if the child process could not be successfully spawned. * @since v0.1.90 */ stderr: Readable | null; @@ -143,7 +144,7 @@ declare module "child_process" { /** * A sparse array of pipes to the child process, corresponding with positions in * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, + * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`, * respectively. * * In the following example, only the child's fd `1` (stdout) is configured as a @@ -212,7 +213,7 @@ declare module "child_process" { readonly pid?: number | undefined; /** * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. + * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages. * @since v0.7.2 */ readonly connected: boolean; @@ -272,7 +273,7 @@ declare module "child_process" { * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. * * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). + * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`). * See `Signal Events` for more details. * * On Linux, child processes of child processes will not be terminated @@ -346,20 +347,20 @@ declare module "child_process" { * * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. + * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js. + * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice. * * The optional `sendHandle` argument that may be passed to `subprocess.send()` is * for passing a TCP server or socket object to the child process. The child will * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. + * registered on the `'message'` event. Any data that is received and buffered in + * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows. * * The optional `callback` is a function that is invoked after the message is * sent but before the child may have received it. The function is called with a * single argument: `null` on success, or an `Error` object on failure. * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can + * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can * happen, for instance, when the child process has already exited. * * `subprocess.send()` will return `false` if the channel has closed or when the @@ -400,8 +401,8 @@ declare module "child_process" { * Once the server is now shared between the parent and child, some connections * can be handled by the parent and some by the child. * - * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only + * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of + * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only * supported on Unix platforms. * * #### Example: sending a socket object @@ -454,6 +455,7 @@ declare module "child_process" { * as the connection may have been closed during the time it takes to send the * connection to the child. * @since v0.5.9 + * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v20.x/api/dgram.html#class-dgramsocket) object. * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: */ send(message: Serializable, callback?: (error: Error | null) => void): boolean; @@ -482,7 +484,7 @@ declare module "child_process" { disconnect(): void; /** * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not + * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not * include the child in its reference count, allowing the parent to exit * independently of the child, unless there is an established IPC channel between * the child and the parent. @@ -678,7 +680,7 @@ declare module "child_process" { stdio: [Stdin, Stdout, Stderr]; } /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults + * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults * to an empty array. * * **If the `shell` option is enabled, do not pass unsanitized user input to this** @@ -776,10 +778,10 @@ declare module "child_process" { * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process * title while others (Windows, SunOS) will use `command`. * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve - * it with the`process.argv0` property instead. + * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve + * it with the `process.argv0` property instead. * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except * the error passed to the callback will be an `AbortError`: * * ```js @@ -833,50 +835,50 @@ declare module "child_process" { // overloads of spawn with 'args' function spawn( command: string, - args?: ReadonlyArray, + args?: readonly string[], options?: SpawnOptionsWithoutStdio, ): ChildProcessWithoutNullStreams; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; function spawn( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnOptionsWithStdioTuple, ): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; interface ExecOptions extends CommonOptions { shell?: string | undefined; signal?: AbortSignal | undefined; @@ -894,6 +896,8 @@ declare module "child_process" { killed?: boolean | undefined; code?: number | undefined; signal?: NodeJS.Signals | undefined; + stdout?: string; + stderr?: string; } /** * Spawns a shell then executes the `command` within that shell, buffering any @@ -915,9 +919,9 @@ declare module "child_process" { * **Never pass unsanitized user input to this function. Any input containing shell** * **metacharacters may be used to trigger arbitrary command execution.** * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The + * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the + * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the * process. * * The `stdout` and `stderr` arguments passed to the callback will contain the @@ -947,7 +951,7 @@ declare module "child_process" { * the existing process and uses a shell to execute the command. * * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In * case of an error (including any error resulting in an exit code other than 0), a * rejected promise is returned, with the same `error` object given in the * callback, but with two additional properties `stdout` and `stderr`. @@ -964,7 +968,7 @@ declare module "child_process" { * lsExample(); * ``` * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except * the error passed to the callback will be an `AbortError`: * * ```js @@ -1109,7 +1113,7 @@ declare module "child_process" { * encoding, `Buffer` objects will be passed to the callback instead. * * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In * case of an error (including any error resulting in an exit code other than 0), a * rejected promise is returned, with the same `error` object given in the * callback, but with two additional properties `stdout` and `stderr`. @@ -1128,7 +1132,7 @@ declare module "child_process" { * **function. Any input containing shell metacharacters may be used to trigger** * **arbitrary command execution.** * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except * the error passed to the callback will be an `AbortError`: * * ```js @@ -1150,10 +1154,10 @@ declare module "child_process" { file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, ): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args?: readonly string[] | null): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, ): ChildProcess; // no `options` definitely means stdout/stderr are `string`. @@ -1163,7 +1167,7 @@ declare module "child_process" { ): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, ): ChildProcess; // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. @@ -1174,7 +1178,7 @@ declare module "child_process" { ): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, ): ChildProcess; @@ -1186,7 +1190,7 @@ declare module "child_process" { ): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, ): ChildProcess; @@ -1199,7 +1203,7 @@ declare module "child_process" { ): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, ): ChildProcess; @@ -1211,7 +1215,7 @@ declare module "child_process" { ): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, ): ChildProcess; @@ -1226,7 +1230,7 @@ declare module "child_process" { ): ChildProcess; function execFile( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, callback: | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) @@ -1240,7 +1244,7 @@ declare module "child_process" { }>; function __promisify__( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, ): PromiseWithChild<{ stdout: string; stderr: string; @@ -1254,7 +1258,7 @@ declare module "child_process" { }>; function __promisify__( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding, ): PromiseWithChild<{ stdout: Buffer; @@ -1269,7 +1273,7 @@ declare module "child_process" { }>; function __promisify__( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptionsWithStringEncoding, ): PromiseWithChild<{ stdout: string; @@ -1284,7 +1288,7 @@ declare module "child_process" { }>; function __promisify__( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding, ): PromiseWithChild<{ stdout: string | Buffer; @@ -1299,7 +1303,7 @@ declare module "child_process" { }>; function __promisify__( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: ExecFileOptions, ): PromiseWithChild<{ stdout: string; @@ -1314,7 +1318,7 @@ declare module "child_process" { }>; function __promisify__( file: string, - args: ReadonlyArray | undefined | null, + args: readonly string[] | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, ): PromiseWithChild<{ stdout: string | Buffer; @@ -1352,7 +1356,7 @@ declare module "child_process" { * required, spawning a large number of child Node.js processes is not * recommended. * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative + * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative * execution path to be used. * * Node.js processes launched with a custom `execPath` will communicate with the @@ -1362,9 +1366,9 @@ declare module "child_process" { * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the * current process. * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. + * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set. * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except * the error passed to the callback will be an `AbortError`: * * ```js @@ -1387,8 +1391,8 @@ declare module "child_process" { * @param modulePath The module to run in the child. * @param args List of string arguments. */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess; + function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess; interface SpawnSyncOptions extends CommonSpawnOptions { input?: string | NodeJS.ArrayBufferView | undefined; maxBuffer?: number | undefined; @@ -1428,20 +1432,20 @@ declare module "child_process" { function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; + function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; function spawnSync( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnSyncOptionsWithStringEncoding, ): SpawnSyncReturns; function spawnSync( command: string, - args: ReadonlyArray, + args: readonly string[], options: SpawnSyncOptionsWithBufferEncoding, ): SpawnSyncReturns; function spawnSync( command: string, - args?: ReadonlyArray, + args?: readonly string[], options?: SpawnSyncOptions, ): SpawnSyncReturns; interface CommonExecOptions extends CommonOptions { @@ -1473,7 +1477,7 @@ declare module "child_process" { * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return * until the child process has fully closed. When a timeout has been encountered * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process + * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process * has exited. * * If the process times out or has a non-zero exit code, this method will throw. @@ -1522,18 +1526,18 @@ declare module "child_process" { function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: ReadonlyArray): Buffer; + function execFileSync(file: string, args: readonly string[]): Buffer; function execFileSync( file: string, - args: ReadonlyArray, + args: readonly string[], options: ExecFileSyncOptionsWithStringEncoding, ): string; function execFileSync( file: string, - args: ReadonlyArray, + args: readonly string[], options: ExecFileSyncOptionsWithBufferEncoding, ): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; + function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer; } declare module "node:child_process" { export * from "child_process"; diff --git a/dist/node_modules/@types/node/cluster.d.ts b/dist/node_modules/@types/node/cluster.d.ts index 39cd56a..7711927 100644 --- a/dist/node_modules/@types/node/cluster.d.ts +++ b/dist/node_modules/@types/node/cluster.d.ts @@ -1,8 +1,8 @@ /** * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process - * isolation is not needed, use the `worker_threads` module instead, which - * allows running multiple application threads within a single Node.js instance. + * that can distribute workloads among their application threads. When process isolation + * is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html) + * module instead, which allows running multiple application threads within a single Node.js instance. * * The cluster module allows easy creation of child processes that all share * server ports. @@ -50,7 +50,7 @@ * ``` * * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/cluster.js) */ declare module "cluster" { import * as child from "node:child_process"; @@ -58,22 +58,74 @@ declare module "cluster" { import * as net from "node:net"; type SerializationType = "json" | "advanced"; export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv + /** + * List of string arguments passed to the Node.js executable. + * @default process.execArgv + */ + execArgv?: string[] | undefined; + /** + * File path to worker file. + * @default process.argv[1] + */ exec?: string | undefined; + /** + * String arguments passed to worker. + * @default process.argv.slice(2) + */ args?: string[] | undefined; + /** + * Whether or not to send output to parent's stdio. + * @default false + */ silent?: boolean | undefined; + /** + * Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must + * contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processspawncommand-args-options)'s + * [`stdio`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#optionsstdio). + */ stdio?: any[] | undefined; + /** + * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) + */ uid?: number | undefined; + /** + * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) + */ gid?: number | undefined; + /** + * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. + * By default each worker gets its own port, incremented from the primary's `process.debugPort`. + */ inspectPort?: number | (() => number) | undefined; + /** + * Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. + * See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#advanced-serialization) for more details. + * @default false + */ serialization?: SerializationType | undefined; + /** + * Current working directory of the worker process. + * @default undefined (inherits from parent process) + */ cwd?: string | undefined; + /** + * Hide the forked processes console window that would normally be created on Windows systems. + * @default false + */ windowsHide?: boolean | undefined; } export interface Address { address: string; port: number; - addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + /** + * The `addressType` is one of: + * + * * `4` (TCPv4) + * * `6` (TCPv6) + * * `-1` (Unix domain socket) + * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) + */ + addressType: 4 | 6 | -1 | "udp4" | "udp6"; } /** * A `Worker` object contains all public information and method about a worker. @@ -83,17 +135,17 @@ declare module "cluster" { */ export class Worker extends EventEmitter { /** - * Each new worker is given its own unique id, this id is stored in the`id`. + * Each new worker is given its own unique id, this id is stored in the `id`. * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. + * While a worker is alive, this is the key that indexes it in `cluster.workers`. * @since v0.8.0 */ id: number; /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. + * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object + * from this function is stored as `.process`. In a worker, the global `process` is stored. * - * See: `Child Process module`. + * See: [Child Process module](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options). * * Workers will call `process.exit(0)` if the `'disconnect'` event occurs * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against @@ -104,9 +156,9 @@ declare module "cluster" { /** * Send a message to a worker or primary, optionally with a handle. * - * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. + * In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). * - * In a worker, this sends a message to the primary. It is identical to`process.send()`. + * In a worker, this sends a message to the primary. It is identical to `process.send()`. * * This example will echo back all messages from the primary: * @@ -122,7 +174,7 @@ declare module "cluster" { * } * ``` * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. */ send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; send( @@ -138,7 +190,7 @@ declare module "cluster" { ): boolean; /** * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. + * disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`. * * The `kill()` function kills the worker process without waiting for a graceful * disconnect, it has the same behavior as `worker.process.kill()`. @@ -146,7 +198,7 @@ declare module "cluster" { * This method is aliased as `worker.destroy()` for backwards compatibility. * * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. + * it is [`kill()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processkillpid-signal). * @since v0.9.12 * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. */ @@ -156,7 +208,7 @@ declare module "cluster" { * In a worker, this function will close all servers, wait for the `'close'` event * on those servers, and then disconnect the IPC channel. * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. + * In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself. * * Causes `.exitedAfterDisconnect` to be set. * @@ -336,20 +388,114 @@ declare module "cluster" { } export interface Cluster extends EventEmitter { disconnect(callback?: () => void): void; + /** + * Spawn a new worker process. + * + * This can only be called from the primary process. + * @param env Key/value pairs to add to worker process environment. + * @since v0.6.0 + */ fork(env?: any): Worker; /** @deprecated since v16.0.0 - use isPrimary. */ readonly isMaster: boolean; + /** + * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` + * is undefined, then `isPrimary` is `true`. + * @since v16.0.0 + */ readonly isPrimary: boolean; + /** + * True if the process is not a primary (it is the negation of `cluster.isPrimary`). + * @since v0.6.0 + */ readonly isWorker: boolean; + /** + * The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a + * global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) + * is called, whichever comes first. + * + * `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute + * IOCP handles without incurring a large performance hit. + * + * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. + * @since v0.11.2 + */ schedulingPolicy: number; + /** + * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) + * (or [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)) this settings object will contain + * the settings, including the default values. + * + * This object is not intended to be changed or set manually. + * @since v0.7.1 + */ readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ + /** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) instead. */ setupMaster(settings?: ClusterSettings): void; /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. + * + * Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv) + * and have no effect on workers that are already running. + * + * The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to + * [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv). + * + * The defaults above apply to the first call only; the defaults for later calls are the current values at the time of + * `cluster.setupPrimary()` is called. + * + * ```js + * import cluster from 'node:cluster'; + * + * cluster.setupPrimary({ + * exec: 'worker.js', + * args: ['--use', 'https'], + * silent: true, + * }); + * cluster.fork(); // https worker + * cluster.setupPrimary({ + * exec: 'worker.js', + * args: ['--use', 'http'], + * }); + * cluster.fork(); // http worker + * ``` + * + * This can only be called from the primary process. + * @since v16.0.0 */ setupPrimary(settings?: ClusterSettings): void; + /** + * A reference to the current worker object. Not available in the primary process. + * + * ```js + * import cluster from 'node:cluster'; + * + * if (cluster.isPrimary) { + * console.log('I am primary'); + * cluster.fork(); + * cluster.fork(); + * } else if (cluster.isWorker) { + * console.log(`I am worker #${cluster.worker.id}`); + * } + * ``` + * @since v0.7.0 + */ readonly worker?: Worker | undefined; + /** + * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process. + * + * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it + * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. + * + * ```js + * import cluster from 'node:cluster'; + * + * for (const worker of Object.values(cluster.workers)) { + * worker.send('big announcement to all workers'); + * } + * ``` + * @since v0.7.0 + */ readonly workers?: NodeJS.Dict | undefined; readonly SCHED_NONE: number; readonly SCHED_RR: number; diff --git a/dist/node_modules/@types/node/console.d.ts b/dist/node_modules/@types/node/console.d.ts index 8ea5e17..3d1a6c2 100644 --- a/dist/node_modules/@types/node/console.d.ts +++ b/dist/node_modules/@types/node/console.d.ts @@ -4,12 +4,13 @@ * * The module exports two specific components: * - * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`. + * * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and + * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('node:console')`. * * _**Warning**_: The global console object's methods are neither consistently * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for + * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for * more information. * * Example using the global `console`: @@ -53,7 +54,7 @@ * myConsole.warn(`Danger ${name}! Danger!`); * // Prints: Danger Will Robinson! Danger!, to err * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/console.js) */ declare module "console" { import console = require("node:console"); @@ -68,7 +69,8 @@ declare module "node:console" { /** * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. + * starts with `"Assertion failed"`. If provided, `message` is formatted using + * [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args). * * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. * @@ -91,7 +93,7 @@ declare module "node:console" { * TTY. When `stdout` is not a TTY, this method does nothing. * * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the + * and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the * current terminal viewport for the Node.js * binary. * @since v8.3.0 @@ -150,7 +152,7 @@ declare module "node:console" { */ debug(message?: any, ...optionalParams: any[]): void; /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. + * Uses [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`. * This function bypasses any custom `inspect()` function defined on `obj`. * @since v0.1.101 */ @@ -164,7 +166,8 @@ declare module "node:console" { /** * Prints to `stderr` with newline. Multiple arguments can be passed, with the * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) + * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)). * * ```js * const code = 5; @@ -174,13 +177,15 @@ declare module "node:console" { * // Prints: error 5, to stderr * ``` * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. + * If formatting elements (e.g. `%d`) are not found in the first string then + * [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) is called on each argument and the + * resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) + * for more information. * @since v0.1.100 */ error(message?: any, ...optionalParams: any[]): void; /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. + * Increases indentation of subsequent lines by spaces for `groupIndentation` length. * * If one or more `label`s are provided, those are printed first without the * additional indentation. @@ -193,7 +198,7 @@ declare module "node:console" { */ groupCollapsed(...label: any[]): void; /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. + * Decreases indentation of subsequent lines by spaces for `groupIndentation` length. * @since v8.5.0 */ groupEnd(): void; @@ -205,7 +210,8 @@ declare module "node:console" { /** * Prints to `stdout` with newline. Multiple arguments can be passed, with the * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) + * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)). * * ```js * const count = 5; @@ -215,12 +221,12 @@ declare module "node:console" { * // Prints: count: 5, to stdout * ``` * - * See `util.format()` for more information. + * See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) for more information. * @since v0.1.100 */ log(message?: any, ...optionalParams: any[]): void; /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just + * Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just * logging the argument if it can't be parsed as tabular. * * ```js @@ -250,7 +256,7 @@ declare module "node:console" { * @since v10.0.0 * @param properties Alternate properties for constructing the table. */ - table(tabularData: any, properties?: ReadonlyArray): void; + table(tabularData: any, properties?: readonly string[]): void; /** * Starts a timer that can be used to compute the duration of an operation. Timers * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in @@ -291,7 +297,8 @@ declare module "node:console" { */ timeLog(label?: string, ...data: any[]): void; /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. + * Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) + * formatted message and stack trace to the current position in the code. * * ```js * console.trace('Show me'); @@ -318,18 +325,32 @@ declare module "node:console" { warn(message?: any, ...optionalParams: any[]): void; // --- Inspector mode only --- /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. + * This method does not display anything unless used in the inspector. The `console.profile()` + * method starts a JavaScript CPU profile with an optional label until {@link profileEnd} + * is called. The profile is then added to the Profile panel of the inspector. + * + * ```js + * console.profile('MyLabel'); + * // Some code + * console.profileEnd('MyLabel'); + * // Adds the profile 'MyLabel' to the Profiles panel of the inspector. + * ``` + * @since v8.0.0 */ profile(label?: string): void; /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + * This method does not display anything unless used in the inspector. Stops the current + * JavaScript CPU profiling session if one has been started and prints the report to the + * Profiles panel of the inspector. See {@link profile} for an example. + * + * If this method is called without a label, the most recently started profile is stopped. + * @since v8.0.0 */ profileEnd(label?: string): void; /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. + * This method does not display anything unless used in the inspector. The `console.timeStamp()` + * method adds an event with the label `'label'` to the Timeline panel of the inspector. + * @since v8.0.0 */ timeStamp(label?: string): void; } @@ -339,12 +360,13 @@ declare module "node:console" { * * The module exports two specific components: * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and + * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('console')`. * * _**Warning**_: The global console object's methods are neither consistently * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for + * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for * more information. * * Example using the global `console`: @@ -388,17 +410,32 @@ declare module "node:console" { * myConsole.warn(`Danger ${name}! Danger!`); * // Prints: Danger Will Robinson! Danger!, to err * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) + * @see [source](https://github.com/nodejs/node/blob/v20.11.1/lib/console.js) */ namespace console { interface ConsoleConstructorOptions { stdout: NodeJS.WritableStream; stderr?: NodeJS.WritableStream | undefined; + /** + * Ignore errors when writing to the underlying streams. + * @default true + */ ignoreErrors?: boolean | undefined; + /** + * Set color support for this `Console` instance. Setting to true enables coloring while inspecting + * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color + * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the + * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. + * @default auto + */ colorMode?: boolean | "auto" | undefined; + /** + * Specifies options that are passed along to + * [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options). + */ inspectOptions?: InspectOptions | undefined; /** - * Set group indentation + * Set group indentation. * @default 2 */ groupIndentation?: number | undefined; diff --git a/dist/node_modules/@types/node/crypto.d.ts b/dist/node_modules/@types/node/crypto.d.ts index bd04bf7..5173dbf 100644 --- a/dist/node_modules/@types/node/crypto.d.ts +++ b/dist/node_modules/@types/node/crypto.d.ts @@ -14,7 +14,7 @@ * // Prints: * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/crypto.js) */ declare module "crypto" { import * as stream from "node:stream"; @@ -27,7 +27,7 @@ declare module "crypto" { * should not use this element anymore. * * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC + * data. The most common usage is handling output generated by the HTML5 `` element. Node.js uses [OpenSSL's SPKAC * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. * @since v0.11.8 */ @@ -100,11 +100,13 @@ declare module "crypto" { const OPENSSL_VERSION_NUMBER: number; /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ const SSL_OP_ALL: number; + /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ + const SSL_OP_ALLOW_NO_DHE_KEX: number; /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + /** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */ const SSL_OP_CISCO_ANYCONNECT: number; /** Instructs OpenSSL to turn on cookie exchange. */ const SSL_OP_COOKIE_EXCHANGE: number; @@ -116,15 +118,29 @@ declare module "crypto" { const SSL_OP_LEGACY_SERVER_CONNECT: number; /** Instructs OpenSSL to disable support for SSL/TLS compression. */ const SSL_OP_NO_COMPRESSION: number; + /** Instructs OpenSSL to disable encrypt-then-MAC. */ + const SSL_OP_NO_ENCRYPT_THEN_MAC: number; const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to disable renegotiation. */ + const SSL_OP_NO_RENEGOTIATION: number; /** Instructs OpenSSL to always start a new session when performing renegotiation. */ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + /** Instructs OpenSSL to turn off SSL v2 */ const SSL_OP_NO_SSLv2: number; + /** Instructs OpenSSL to turn off SSL v3 */ const SSL_OP_NO_SSLv3: number; + /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ const SSL_OP_NO_TICKET: number; + /** Instructs OpenSSL to turn off TLS v1 */ const SSL_OP_NO_TLSv1: number; + /** Instructs OpenSSL to turn off TLS v1.1 */ const SSL_OP_NO_TLSv1_1: number; + /** Instructs OpenSSL to turn off TLS v1.2 */ const SSL_OP_NO_TLSv1_2: number; + /** Instructs OpenSSL to turn off TLS v1.3 */ + const SSL_OP_NO_TLSv1_3: number; + /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ + const SSL_OP_PRIORITIZE_CHACHA: number; /** Instructs OpenSSL to disable version rollback attack detection. */ const SSL_OP_TLS_ROLLBACK_BUG: number; const ENGINE_METHOD_RSA: number; @@ -363,7 +379,7 @@ declare module "crypto" { * @since v13.1.0 * @param options `stream.transform` options */ - copy(options?: stream.TransformOptions): Hash; + copy(options?: HashOptions): Hash; /** * Updates the hash content with the given `data`, the encoding of which * is given in `inputEncoding`. @@ -454,6 +470,7 @@ declare module "crypto" { * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e * ``` * @since v0.1.94 + * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances. */ class Hmac extends stream.Transform { private constructor(); @@ -637,6 +654,13 @@ declare module "crypto" { export(options: KeyExportOptions<"pem">): string | Buffer; export(options?: KeyExportOptions<"der">): Buffer; export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * Returns `true` or `false` depending on whether the keys have exactly the same + * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). + * @since v17.7.0, v16.15.0 + * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. + */ + equals(otherKeyObject: KeyObject): boolean; /** * For secret keys, this property represents the size of the key in bytes. This * property is `undefined` for asymmetric keys. @@ -665,7 +689,7 @@ declare module "crypto" { authTagLength: number; } /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. + * Creates and returns a `Cipher` object that uses the given `algorithm` and `password`. * * The `options` argument controls stream behavior and is optional except when a * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the @@ -883,8 +907,8 @@ declare module "crypto" { private constructor(); /** * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`, + * `TypedArray`, or `DataView`, then `inputEncoding` is ignored. * * The `outputEncoding` specifies the output format of the enciphered * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. @@ -954,10 +978,10 @@ declare module "crypto" { getAuthTag(): Buffer; } /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). + * Creates and returns a `Decipher` object that uses the given `algorithm` and `password` (key). * * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the * authentication tag in bytes, see `CCM mode`. * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. * @@ -985,11 +1009,11 @@ declare module "crypto" { /** @deprecated since v10.0.0 use `createDecipheriv()` */ function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). + * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`). * * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags * to those with the specified length. * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. * @@ -1149,11 +1173,11 @@ declare module "crypto" { private constructor(); /** * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is + * the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is * ignored. * * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned. * * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error * being thrown. @@ -1176,7 +1200,7 @@ declare module "crypto" { final(): Buffer; final(outputEncoding: BufferEncoding): string; /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and + * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and * removing padding. * * Turning auto padding off will only work if the input data's length is a @@ -1230,7 +1254,7 @@ declare module "crypto" { encoding?: string | undefined; } /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. * * ```js * const { @@ -1256,7 +1280,7 @@ declare module "crypto" { callback: (err: Error | null, key: KeyObject) => void, ): void; /** - * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. * * ```js * const { @@ -1284,7 +1308,7 @@ declare module "crypto" { } /** * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. + * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above. * * If the private key is encrypted, a `passphrase` must be specified. The length * of the passphrase is limited to 1024 bytes. @@ -1293,7 +1317,7 @@ declare module "crypto" { function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; /** * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; + * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key; * otherwise, `key` must be an object with the properties described above. * * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. @@ -1301,7 +1325,7 @@ declare module "crypto" { * Because public keys can be derived from private keys, a private key may be * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned + * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned * and it will be impossible to extract the private key from the returned object. * @since v11.6.0 */ @@ -1426,7 +1450,7 @@ declare module "crypto" { /** * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an * object, the following additional properties can be passed: * * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. @@ -1444,7 +1468,7 @@ declare module "crypto" { /** * Creates and returns a `Verify` object that uses the given algorithm. * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. + * signing algorithms. Optional `options` argument controls the `stream.Writable` behavior. * * In some cases, a `Verify` instance can be created using the name of a signature * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use @@ -1464,7 +1488,7 @@ declare module "crypto" { * * Using the `verify.update()` and `verify.verify()` methods to verify * the signature. * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. + * The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword. * * See `Sign` for examples. * @since v0.1.92 @@ -1475,7 +1499,7 @@ declare module "crypto" { * Updates the `Verify` content with the given `data`, the encoding of which * is given in `inputEncoding`. * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored. * * This can be called many times with new data as it is streamed. * @since v0.1.92 @@ -1486,13 +1510,13 @@ declare module "crypto" { /** * Verifies the provided data using the given `object` and `signature`. * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an + * If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an * object, the following additional properties can be passed: * * The `signature` argument is the previously calculated signature for the data, in * the `signatureEncoding`. * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`. * * The `verify` object can not be used again after `verify.verify()` has been * called. Multiple calls to `verify.verify()` will result in an error being @@ -1516,7 +1540,7 @@ declare module "crypto" { * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an * optional specific `generator`. * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. + * The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used. * * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise * a `Buffer`, `TypedArray`, or `DataView` is expected. @@ -1602,7 +1626,7 @@ declare module "crypto" { * key is interpreted using the specified `inputEncoding`, and secret is * encoded using specified `outputEncoding`. * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. * * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. * @since v0.5.0 @@ -1658,7 +1682,7 @@ declare module "crypto" { getPrivateKey(): Buffer; getPrivateKey(encoding: BinaryToTextEncoding): string; /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected + * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected * to be a string. If no `encoding` is provided, `publicKey` is expected * to be a `Buffer`, `TypedArray`, or `DataView`. * @since v0.5.0 @@ -1761,10 +1785,10 @@ declare module "crypto" { /** * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be + * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be * thrown if any of the input arguments specify invalid values or types. * * The `iterations` argument must be a number set as high as possible. The @@ -1804,7 +1828,7 @@ declare module "crypto" { /** * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. * * If an error occurs an `Error` will be thrown, otherwise the derived key will be * returned as a `Buffer`. @@ -1843,7 +1867,7 @@ declare module "crypto" { * * If a `callback` function is provided, the bytes are generated asynchronously * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. + * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes. * * ```js * // Asynchronous @@ -1897,7 +1921,7 @@ declare module "crypto" { * Return a random integer `n` such that `min <= n < max`. This * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). * - * The range (`max - min`) must be less than 248. `min` and `max` must + * The range (`max - min`) must be less than 2**48. `min` and `max` must * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). * * If the `callback` function is not provided, the random integer is @@ -2014,7 +2038,7 @@ declare module "crypto" { * }); * ``` * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. + * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`. * * While this includes instances of `Float32Array` and `Float64Array`, this * function should not be used to generate random floating-point numbers. The @@ -2094,7 +2118,7 @@ declare module "crypto" { * * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the + * The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the * callback as a `Buffer`. * * An exception is thrown when any of the input arguments specify invalid values @@ -2180,8 +2204,8 @@ declare module "crypto" { * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using * the corresponding private key, for example using {@link privateDecrypt}. * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. * * Because RSA public keys can be derived from private keys, a private key may * be passed instead of a public key. @@ -2192,8 +2216,8 @@ declare module "crypto" { * Decrypts `buffer` with `key`.`buffer` was previously encrypted using * the corresponding private key, for example using {@link privateEncrypt}. * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. * * Because RSA public keys can be derived from private keys, a private key may * be passed instead of a public key. @@ -2204,8 +2228,8 @@ declare module "crypto" { * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using * the corresponding public key, for example using {@link publicEncrypt}. * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. * @since v0.11.14 */ function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; @@ -2213,8 +2237,8 @@ declare module "crypto" { * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using * the corresponding public key, for example using {@link publicDecrypt}. * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. * @since v1.1.0 */ function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; @@ -2309,9 +2333,9 @@ declare module "crypto" { * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display * the name and description of each available elliptic curve. * - * If `format` is not specified the point will be returned in `'uncompressed'`format. + * If `format` is not specified the point will be returned in `'uncompressed'` format. * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`. * * Example (uncompressing a key): * @@ -2352,7 +2376,7 @@ declare module "crypto" { * the public key in the specified `format` and `encoding`. This key should be * transferred to the other party. * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. + * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. * * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. * @since v0.11.14 @@ -2367,11 +2391,11 @@ declare module "crypto" { * key is interpreted using specified `inputEncoding`, and the returned secret * is encoded using the specified `outputEncoding`. * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. * * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is + * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is * usually supplied from a remote user over an insecure network, * be sure to handle this exception accordingly. * @since v0.11.14 @@ -2396,7 +2420,7 @@ declare module "crypto" { getPrivateKey(): Buffer; getPrivateKey(encoding: BinaryToTextEncoding): string; /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. + * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. * * If `encoding` is specified, a string is returned; otherwise a `Buffer` is * returned. @@ -2410,7 +2434,7 @@ declare module "crypto" { /** * Sets the EC Diffie-Hellman private key. * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. * * If `privateKey` is not valid for the curve specified when the `ECDH` object was * created, an error is thrown. Upon setting the private key, the associated @@ -2430,7 +2454,7 @@ declare module "crypto" { */ function createECDH(curveName: string): ECDH; /** - * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time + * This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time * algorithm. * * This function does not leak timing information that @@ -2445,8 +2469,8 @@ declare module "crypto" { * entry, such as `Uint16Array`, the result will be computed using the platform * byte order. * - * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point** + * **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754** + * **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point** * **numbers `x` and `y` are equal.** * * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code @@ -2475,6 +2499,10 @@ declare module "crypto" { * Name of the curve to use */ namedCurve: string; + /** + * Must be `'named'` or `'explicit'`. Default: `'named'`. + */ + paramEncoding?: "explicit" | "named" | undefined; } interface RSAKeyPairKeyObjectOptions { /** @@ -2585,11 +2613,7 @@ declare module "crypto" { type: "pkcs8"; }; } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; + interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { publicKeyEncoding: { type: "pkcs1" | "spki"; format: PubF; @@ -2823,7 +2847,7 @@ declare module "crypto" { * behaves as if `keyObject.export()` had been called on its result. Otherwise, * the respective part of the key is returned as a `KeyObject`. * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: + * It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage: * * ```js * const { @@ -2847,7 +2871,7 @@ declare module "crypto" { * }); * ``` * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. + * On completion, `callback` will be called with `err` set to `undefined` and `publicKey` / `privateKey` representing the generated key pair. * * If this method is invoked as its `util.promisify()` ed version, it returns * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. @@ -3321,7 +3345,7 @@ declare module "crypto" { callback: (error: Error | null, data: Buffer) => void, ): void; /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the + * Verifies the given signature for `data` using the given key and algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the * key type (especially Ed25519 and Ed448). * * If `key` is not a `KeyObject`, this function behaves as if `key` had been @@ -3351,10 +3375,45 @@ declare module "crypto" { ): void; /** * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). + * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). * @since v13.9.0, v12.17.0 */ function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; + /** + * A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data + * (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm` + * is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. On recent releases + * of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms. + * + * Example: + * + * ```js + * const crypto = require('node:crypto'); + * const { Buffer } = require('node:buffer'); + * + * // Hashing a string and return the result as a hex-encoded string. + * const string = 'Node.js'; + * // 10b3493287f831e81a438811a1ffba01f8cec4b7 + * console.log(crypto.hash('sha1', string)); + * + * // Encode a base64-encoded string into a Buffer, hash it and return + * // the result as a buffer. + * const base64 = 'Tm9kZS5qcw=='; + * // + * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer')); + * ``` + * @since v21.7.0, v20.12.0 + * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user + * could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead. + * @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v20.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest. + */ + function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; + function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): Buffer; + function hash( + algorithm: string, + data: BinaryLike, + outputEncoding?: BinaryToTextEncoding | "buffer", + ): string | Buffer; type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; interface CipherInfoOptions { /** @@ -3407,9 +3466,9 @@ declare module "crypto" { */ function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; + * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set; * otherwise `err` will be `null`. The successfully generated `derivedKey` will * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any * of the input arguments specify invalid values or types. @@ -3443,7 +3502,7 @@ declare module "crypto" { ): void; /** * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. + * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. * * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). * @@ -3772,7 +3831,7 @@ declare module "crypto" { /** * Generates a pseudorandom prime of `size` bits. * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. * * The `options.add` and `options.rem` parameters can be used to enforce additional * requirements, e.g., for Diffie-Hellman: @@ -3788,7 +3847,7 @@ declare module "crypto" { * * `options.rem` is ignored if `options.add` is not given. * * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. * * By default, the prime is encoded as a big-endian sequence of octets * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a @@ -3815,7 +3874,7 @@ declare module "crypto" { /** * Generates a pseudorandom prime of `size` bits. * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. * * The `options.add` and `options.rem` parameters can be used to enforce additional * requirements, e.g., for Diffie-Hellman: @@ -3831,7 +3890,7 @@ declare module "crypto" { * * `options.rem` is ignored if `options.add` is not given. * * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. * * By default, the prime is encoded as a big-endian sequence of octets * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a @@ -3877,7 +3936,7 @@ declare module "crypto" { * * `engine` could be either an id or a path to the engine's shared library. * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`): + * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): * * * `crypto.constants.ENGINE_METHOD_RSA` * * `crypto.constants.ENGINE_METHOD_DSA` @@ -4208,7 +4267,7 @@ declare module "crypto" { | HkdfParams | Pbkdf2Params, extractable: boolean, - keyUsages: ReadonlyArray, + keyUsages: readonly KeyUsage[], ): Promise; /** * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. @@ -4288,12 +4347,12 @@ declare module "crypto" { generateKey( algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, - keyUsages: ReadonlyArray, + keyUsages: readonly KeyUsage[], ): Promise; generateKey( algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, - keyUsages: ReadonlyArray, + keyUsages: readonly KeyUsage[], ): Promise; generateKey( algorithm: AlgorithmIdentifier, @@ -4320,7 +4379,7 @@ declare module "crypto" { | HmacImportParams | AesKeyAlgorithm, extractable: boolean, - keyUsages: ReadonlyArray, + keyUsages: readonly KeyUsage[], ): Promise; importKey( format: Exclude, @@ -4450,6 +4509,14 @@ declare module "crypto" { ): Promise; } } + + global { + var crypto: typeof globalThis extends { + crypto: infer T; + onmessage: any; + } ? T + : webcrypto.Crypto; + } } declare module "node:crypto" { export * from "crypto"; diff --git a/dist/node_modules/@types/node/dgram.d.ts b/dist/node_modules/@types/node/dgram.d.ts index 79cfcd4..3843f23 100644 --- a/dist/node_modules/@types/node/dgram.d.ts +++ b/dist/node_modules/@types/node/dgram.d.ts @@ -23,7 +23,7 @@ * server.bind(41234); * // Prints: server listening 0.0.0.0:41234 * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js) */ declare module "dgram" { import { AddressInfo } from "node:net"; @@ -66,7 +66,7 @@ declare module "dgram" { * (it does the right thing for both `udp4` and `udp6` sockets). The bound address * and port can be retrieved using `socket.address().address` and `socket.address().port`. * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: + * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket: * * ```js * const controller = new AbortController(); @@ -93,7 +93,7 @@ declare module "dgram" { */ class Socket extends EventEmitter { /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not + * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not * specified, the operating system will choose * one interface and will add membership to it. To add membership to every * available interface, call `addMembership` multiple times, once per interface. @@ -122,7 +122,7 @@ declare module "dgram" { addMembership(multicastAddress: string, multicastInterface?: string): void; /** * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port`properties. + * For UDP sockets, this object will contain `address`, `family`, and `port` properties. * * This method throws `EBADF` if called on an unbound socket. * @since v0.1.99 @@ -133,10 +133,10 @@ declare module "dgram" { * messages on a named `port` and optional `address`. If `port` is not * specified or is `0`, the operating system will attempt to bind to a * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is + * attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is * called. * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very + * Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very * useful. * * A bound datagram socket keeps the Node.js process running to receive @@ -206,7 +206,7 @@ declare module "dgram" { */ disconnect(): void; /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the + * Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the * kernel when the socket is closed or the process terminates, so most apps will * never have reason to call this. * @@ -227,6 +227,16 @@ declare module "dgram" { * @return the `SO_SNDBUF` socket send buffer size in bytes. */ getSendBufferSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of bytes queued for sending. + */ + getSendQueueSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of send requests currently in the queue awaiting to be processed. + */ + getSendQueueCount(): number; /** * By default, binding a socket will cause it to block the Node.js process from * exiting as long as the socket is open. The `socket.unref()` method can be used @@ -259,14 +269,14 @@ declare module "dgram" { * any `TypedArray` or a `DataView`, * the `offset` and `length` specify the offset within the `Buffer` where the * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that + * If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that * contain multi-byte characters, `offset` and `length` will be calculated with * respect to `byte length` and not the character position. * If `msg` is an array, `offset` and `length` must not be specified. * * The `address` argument is a string. If the value of `address` is a host name, * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. + * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default. * * If the socket has not been previously bound with a call to `bind`, the socket * is assigned a random port number and is bound to the "all interfaces" address @@ -277,7 +287,7 @@ declare module "dgram" { * DNS lookups delay the time to send for at least one tick of the * Node.js event loop. * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be + * The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be * passed as the first argument to the `callback`. If a `callback` is not given, * the error is emitted as an `'error'` event on the `socket` object. * @@ -319,7 +329,7 @@ declare module "dgram" { * determine the optimal strategy on a case-by-case basis. Generally speaking, * however, sending multiple buffers is faster. * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: + * Example of sending a UDP packet using a socket connected to a port on `localhost`: * * ```js * import dgram from 'node:dgram'; @@ -342,18 +352,18 @@ declare module "dgram" { * @param callback Called when the message has been sent. */ send( - msg: string | Uint8Array | ReadonlyArray, + msg: string | Uint8Array | readonly any[], port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void, ): void; send( - msg: string | Uint8Array | ReadonlyArray, + msg: string | Uint8Array | readonly any[], port?: number, callback?: (error: Error | null, bytes: number) => void, ): void; send( - msg: string | Uint8Array | ReadonlyArray, + msg: string | Uint8Array | readonly any[], callback?: (error: Error | null, bytes: number) => void, ): void; send( @@ -501,7 +511,7 @@ declare module "dgram" { * process active, allowing the process to exit even if the socket is still * listening. * - * Calling `socket.unref()` multiple times will have no addition effect. + * Calling `socket.unref()` multiple times will have no additional effect. * * The `socket.unref()` method returns a reference to the socket so calls can be * chained. @@ -509,10 +519,10 @@ declare module "dgram" { */ unref(): this; /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket + * Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket * option. If the `multicastInterface` argument * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. + * membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface. * * When called on an unbound socket, this method will implicitly bind to a random * port, listening on all interfaces. @@ -520,7 +530,7 @@ declare module "dgram" { */ addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is + * Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is * automatically called by the kernel when the * socket is closed or the process terminates, so most apps will never have * reason to call this. diff --git a/dist/node_modules/@types/node/diagnostics_channel.d.ts b/dist/node_modules/@types/node/diagnostics_channel.d.ts index b02f591..e25ca69 100644 --- a/dist/node_modules/@types/node/diagnostics_channel.d.ts +++ b/dist/node_modules/@types/node/diagnostics_channel.d.ts @@ -20,9 +20,10 @@ * should generally include the module name to avoid collisions with data from * other modules. * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/diagnostics_channel.js) */ declare module "diagnostics_channel" { + import { AsyncLocalStorage } from "node:async_hooks"; /** * Check if there are active subscribers to the named channel. This is helpful if * the message you want to send might be expensive to prepare. @@ -95,6 +96,36 @@ declare module "diagnostics_channel" { * @return `true` if the handler was found, `false` otherwise. */ function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; + /** + * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing + * channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of `TracingChannel Channels`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); + * + * // or... + * + * const channelsByCollection = diagnostics_channel.tracingChannel({ + * start: diagnostics_channel.channel('tracing:my-channel:start'), + * end: diagnostics_channel.channel('tracing:my-channel:end'), + * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), + * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), + * error: diagnostics_channel.channel('tracing:my-channel:error'), + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` + * @return Collection of channels to trace with + */ + function tracingChannel< + StoreType = unknown, + ContextType extends object = StoreType extends object ? StoreType : object, + >( + nameOrChannels: string | TracingChannelCollection, + ): TracingChannel; /** * The class `Channel` represents an individual named channel within the data * pipeline. It is used to track subscribers and to publish messages when there @@ -104,7 +135,7 @@ declare module "diagnostics_channel" { * with `new Channel(name)` is not supported. * @since v15.1.0, v14.17.0 */ - class Channel { + class Channel { readonly name: string | symbol; /** * Check if there are active subscribers to this channel. This is helpful if @@ -184,6 +215,338 @@ declare module "diagnostics_channel" { * @return `true` if the handler was found, `false` otherwise. */ unsubscribe(onMessage: ChannelListener): void; + /** + * When `channel.runStores(context, ...)` is called, the given context data + * will be applied to any store bound to the channel. If the store has already been + * bound the previous `transform` function will be replaced with the new one. + * The `transform` function may be omitted to set the given context data as the + * context directly. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (data) => { + * return { data }; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to which to bind the context data + * @param transform Transform context data before setting the store context + */ + bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; + /** + * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store); + * channel.unbindStore(store); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to unbind from the channel. + * @return `true` if the store was found, `false` otherwise. + */ + unbindStore(store: any): void; + /** + * Applies the given data to any AsyncLocalStorage instances bound to the channel + * for the duration of the given function, then publishes to the channel within + * the scope of that data is applied to the stores. + * + * If a transform function was given to `channel.bindStore(store)` it will be + * applied to transform the message data before it becomes the context value for + * the store. The prior storage context is accessible from within the transform + * function in cases where context linking is required. + * + * The context applied to the store should be accessible in any async code which + * continues from execution which began during the given function, however + * there are some situations in which `context loss` may occur. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (message) => { + * const parent = store.getStore(); + * return new Span(message, parent); + * }); + * channel.runStores({ some: 'message' }, () => { + * store.getStore(); // Span({ some: 'message' }) + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param context Message to send to subscribers and bind to stores + * @param fn Handler to run within the entered storage context + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runStores(): void; + } + interface TracingChannelSubscribers { + start: (message: ContextType) => void; + end: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncStart: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncEnd: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + error: ( + message: ContextType & { + error: unknown; + }, + ) => void; + } + interface TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + } + /** + * The class `TracingChannel` is a collection of `TracingChannel Channels` which + * together express a single traceable action. It is used to formalize and + * simplify the process of producing events for tracing application flow. {@link tracingChannel} is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a + * single `TracingChannel` at the top-level of the file rather than creating them + * dynamically. + * @since v19.9.0 + * @experimental + */ + class TracingChannel implements TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + /** + * Helper to subscribe a collection of functions to the corresponding channels. + * This is the same as calling `channel.subscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.subscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + */ + subscribe(subscribers: TracingChannelSubscribers): void; + /** + * Helper to unsubscribe a collection of functions from the corresponding channels. + * This is the same as calling `channel.unsubscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.unsubscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. + */ + unsubscribe(subscribers: TracingChannelSubscribers): void; + /** + * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. + * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions + * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceSync(() => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Function to wrap a trace around + * @param context Shared object to correlate events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceSync( + fn: (this: ThisArg, ...args: Args) => any, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): void; + /** + * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also + * produce an `error event` if the given function throws an error or the + * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions + * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.tracePromise(async () => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Promise-returning function to wrap a trace around + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return Chained from promise returned by the given function + */ + tracePromise( + fn: (this: ThisArg, ...args: Args) => Promise, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): void; + /** + * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or + * the returned + * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * The `position` will be -1 by default to indicate the final argument should + * be used as the callback. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceCallback((arg1, callback) => { + * // Do something + * callback(null, 'result'); + * }, 1, { + * some: 'thing', + * }, thisArg, arg1, callback); + * ``` + * + * The callback will also be run with `channel.runStores(context, ...)` which + * enables context loss recovery in some cases. + * + * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions + * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * const myStore = new AsyncLocalStorage(); + * + * // The start channel sets the initial store data to something + * // and stores that store data value on the trace context object + * channels.start.bindStore(myStore, (data) => { + * const span = new Span(data); + * data.span = span; + * return span; + * }); + * + * // Then asyncStart can restore from that data it stored previously + * channels.asyncStart.bindStore(myStore, (data) => { + * return data.span; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn callback using function to wrap a trace around + * @param position Zero-indexed argument position of expected callback + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceCallback any>( + fn: Fn, + position: number | undefined, + context: ContextType | undefined, + thisArg: any, + ...args: Parameters + ): void; } } declare module "node:diagnostics_channel" { diff --git a/dist/node_modules/@types/node/dns.d.ts b/dist/node_modules/@types/node/dns.d.ts index bef32b1..f5b6b74 100644 --- a/dist/node_modules/@types/node/dns.d.ts +++ b/dist/node_modules/@types/node/dns.d.ts @@ -41,13 +41,21 @@ * }); * ``` * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) + * See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information. + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dns.js) */ declare module "dns" { import * as dnsPromises from "node:dns/promises"; // Supported getaddrinfo flags. + /** + * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are + * only returned if the current system has at least one IPv4 address configured. + */ export const ADDRCONFIG: number; + /** + * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported + * on some operating systems (e.g. FreeBSD 10.1). + */ export const V4MAPPED: number; /** * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as @@ -55,11 +63,37 @@ declare module "dns" { */ export const ALL: number; export interface LookupOptions { - family?: number | undefined; + /** + * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted + * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used + * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned. + * @default 0 + */ + family?: number | "IPv4" | "IPv6" | undefined; + /** + * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v20.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be + * passed by bitwise `OR`ing their values. + */ hints?: number | undefined; + /** + * When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. + * @default false + */ all?: boolean | undefined; /** - * @default true + * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted + * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 + * addresses before IPv4 addresses. Default value is configurable using + * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). + * @default `verbatim` (addresses are not reordered) + */ + order?: "ipv4first" | "ipv6first" | "verbatim" | undefined; + /** + * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 + * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, + * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder} + * or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). + * @default true (addresses are not reordered) */ verbatim?: boolean | undefined; } @@ -70,7 +104,14 @@ declare module "dns" { all: true; } export interface LookupAddress { + /** + * A string representation of an IPv4 or IPv6 address. + */ address: string; + /** + * `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a + * bug in the name resolution service used by the operating system. + */ family: number; } /** @@ -79,7 +120,7 @@ declare module "dns" { * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then * IPv4 and IPv6 addresses are both returned if found. * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the + * With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the * properties `address` and `family`. * * On error, `err` is an `Error` object, where `err.code` is the error code. @@ -91,7 +132,8 @@ declare module "dns" { * The implementation uses an operating system facility that can associate names * with addresses and vice versa. This implementation can have subtle but * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. + * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) + * before using `dns.lookup()`. * * Example usage: * @@ -112,7 +154,8 @@ declare module "dns" { * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] * ``` * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. + * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed + * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. * @since v0.1.90 */ export function lookup( @@ -149,9 +192,10 @@ declare module "dns" { * the operating system's underlying `getnameinfo` implementation. * * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. * - * On an error, `err` is an `Error` object, where `err.code` is the error code. + * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, + * where `err.code` is the error code. * * ```js * const dns = require('node:dns'); @@ -161,7 +205,8 @@ declare module "dns" { * }); * ``` * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. + * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed + * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. * @since v0.11.14 */ export function lookupService( @@ -272,12 +317,13 @@ declare module "dns" { | AnyTxtRecord; /** * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource + * of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource * records. The type and structure of individual results varies based on `rrtype`: * * * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. + * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, + * where `err.code` is one of the `DNS error codes`. * @since v0.1.27 * @param hostname Host name to resolve. * @param [rrtype='A'] Resource record type. @@ -363,7 +409,7 @@ declare module "dns" { ): Promise; } /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). * @since v0.1.16 * @param hostname Host name to resolve. @@ -388,7 +434,7 @@ declare module "dns" { function __promisify__(hostname: string, options?: ResolveOptions): Promise; } /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function * will contain an array of IPv6 addresses. * @since v0.1.16 * @param hostname Host name to resolve. @@ -413,8 +459,8 @@ declare module "dns" { function __promisify__(hostname: string, options?: ResolveOptions): Promise; } /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). * @since v0.3.2 */ export function resolveCname( @@ -425,7 +471,7 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function * will contain an array of certification authority authorization records * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). * @since v15.0.0, v14.17.0 @@ -438,8 +484,8 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). * @since v0.1.27 */ export function resolveMx( @@ -450,7 +496,7 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of * objects with the following properties: * * * `flags` @@ -480,8 +526,8 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). + * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). * @since v0.1.90 */ export function resolveNs( @@ -492,7 +538,7 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will * be an array of strings containing the reply records. * @since v6.0.0 */ @@ -537,7 +583,7 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will * be an array of objects with the following properties: * * * `priority` @@ -563,7 +609,7 @@ declare module "dns" { function __promisify__(hostname: string): Promise; } /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a + * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of * one record. Depending on the use case, these could be either joined together or * treated separately. @@ -603,8 +649,8 @@ declare module "dns" { * minttl: 60 } ] * ``` * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). + * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see + * [RFC 8482](https://tools.ietf.org/html/rfc8482). */ export function resolveAny( hostname: string, @@ -617,8 +663,8 @@ declare module "dns" { * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an * array of host names. * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. + * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is + * one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). * @since v0.1.16 */ export function reverse( @@ -626,13 +672,15 @@ declare module "dns" { callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, ): void; /** - * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). + * The value could be: * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 + * * `ipv4first`: for `order` defaulting to `ipv4first`. + * * `ipv6first`: for `order` defaulting to `ipv6first`. + * * `verbatim`: for `order` defaulting to `verbatim`. + * @since v18.17.0 */ - export function getDefaultResultOrder(): "ipv4first" | "verbatim"; + export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; /** * Sets the IP address and port of servers to be used when performing DNS * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted @@ -652,16 +700,16 @@ declare module "dns" { * The `dns.setServers()` method must not be called while a DNS query is in * progress. * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). + * The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). * * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with * subsequent servers provided. Fallback DNS servers will only be used if the * earlier ones time out or result in some other error. * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses + * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses */ - export function setServers(servers: ReadonlyArray): void; + export function setServers(servers: readonly string[]): void; /** * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), * that are currently configured for DNS resolution. A string will include a port @@ -679,46 +727,53 @@ declare module "dns" { */ export function getServers(): string[]; /** - * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). + * The value could be: * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. + * * `ipv4first`: sets default `order` to `ipv4first`. + * * `ipv6first`: sets default `order` to `ipv6first`. + * * `verbatim`: sets default `order` to `verbatim`. * * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default - * dns orders in workers. + * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using + * [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main + * thread won't affect the default dns orders in workers. * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. + * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. */ - export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; + export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; + export const NODATA: "ENODATA"; + export const FORMERR: "EFORMERR"; + export const SERVFAIL: "ESERVFAIL"; + export const NOTFOUND: "ENOTFOUND"; + export const NOTIMP: "ENOTIMP"; + export const REFUSED: "EREFUSED"; + export const BADQUERY: "EBADQUERY"; + export const BADNAME: "EBADNAME"; + export const BADFAMILY: "EBADFAMILY"; + export const BADRESP: "EBADRESP"; + export const CONNREFUSED: "ECONNREFUSED"; + export const TIMEOUT: "ETIMEOUT"; + export const EOF: "EOF"; + export const FILE: "EFILE"; + export const NOMEM: "ENOMEM"; + export const DESTRUCTION: "EDESTRUCTION"; + export const BADSTR: "EBADSTR"; + export const BADFLAGS: "EBADFLAGS"; + export const NONAME: "ENONAME"; + export const BADHINTS: "EBADHINTS"; + export const NOTINITIALIZED: "ENOTINITIALIZED"; + export const LOADIPHLPAPI: "ELOADIPHLPAPI"; + export const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; + export const CANCELLED: "ECANCELLED"; export interface ResolverOptions { + /** + * Query timeout in milliseconds, or `-1` to use the default timeout. + */ timeout?: number | undefined; /** + * The number of tries the resolver will try contacting each name server before giving up. * @default 4 */ tries?: number; @@ -727,7 +782,7 @@ declare module "dns" { * An independent resolver for DNS requests. * * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect + * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnssetserversservers) does not affect * other resolvers: * * ```js diff --git a/dist/node_modules/@types/node/dns/promises.d.ts b/dist/node_modules/@types/node/dns/promises.d.ts index 79d8b07..cb4c03b 100644 --- a/dist/node_modules/@types/node/dns/promises.d.ts +++ b/dist/node_modules/@types/node/dns/promises.d.ts @@ -43,18 +43,18 @@ declare module "dns/promises" { * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 * and IPv6 addresses are both returned if found. * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. + * With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when * the host name does not exist but also when the lookup fails in other ways * such as no available file descriptors. * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS + * [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS * protocol. The implementation uses an operating system facility that can * associate names with addresses and vice versa. This implementation can have * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before + * take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before * using `dnsPromises.lookup()`. * * Example usage: @@ -91,9 +91,9 @@ declare module "dns/promises" { * the operating system's underlying `getnameinfo` implementation. * * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. * * ```js * const dnsPromises = require('node:dns').promises; @@ -119,7 +119,8 @@ declare module "dns/promises" { * * * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` + * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). * @since v10.6.0 * @param hostname Host name to resolve. * @param [rrtype='A'] Resource record type. @@ -142,7 +143,7 @@ declare module "dns/promises" { rrtype: string, ): Promise; /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 + * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). * @since v10.6.0 * @param hostname Host name to resolve. @@ -151,7 +152,7 @@ declare module "dns/promises" { function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; function resolve4(hostname: string, options: ResolveOptions): Promise; /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 * addresses. * @since v10.6.0 * @param hostname Host name to resolve. @@ -191,7 +192,7 @@ declare module "dns/promises" { /** * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). + * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). * @since v15.0.0, v14.17.0 */ function resolveCaa(hostname: string): Promise; @@ -203,13 +204,13 @@ declare module "dns/promises" { */ function resolveCname(hostname: string): Promise; /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). * @since v10.6.0 */ function resolveMx(hostname: string): Promise; /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array * of objects with the following properties: * * * `flags` @@ -233,13 +234,13 @@ declare module "dns/promises" { */ function resolveNaptr(hostname: string): Promise; /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server + * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). * @since v10.6.0 */ function resolveNs(hostname: string): Promise; /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings * containing the reply records. * @since v10.6.0 */ @@ -272,7 +273,7 @@ declare module "dns/promises" { */ function resolveSoa(hostname: string): Promise; /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with + * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with * the following properties: * * * `priority` @@ -292,7 +293,7 @@ declare module "dns/promises" { */ function resolveSrv(hostname: string): Promise; /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array + * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of * one record. Depending on the use case, these could be either joined together or * treated separately. @@ -303,10 +304,20 @@ declare module "dns/promises" { * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an * array of host names. * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` + * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). * @since v10.6.0 */ function reverse(ip: string): Promise; + /** + * Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). + * The value could be: + * + * * `ipv4first`: for `verbatim` defaulting to `false`. + * * `verbatim`: for `verbatim` defaulting to `true`. + * @since v20.1.0 + */ + function getDefaultResultOrder(): "ipv4first" | "verbatim"; /** * Sets the IP address and port of servers to be used when performing DNS * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted @@ -327,31 +338,59 @@ declare module "dns/promises" { * progress. * * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with * subsequent servers provided. Fallback DNS servers will only be used if the * earlier ones time out or result in some other error. * @since v10.6.0 * @param servers array of `RFC 5952` formatted addresses */ - function setServers(servers: ReadonlyArray): void; + function setServers(servers: readonly string[]): void; /** - * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: + * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be: * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. + * * `ipv4first`: sets default `order` to `ipv4first`. + * * `ipv6first`: sets default `order` to `ipv6first`. + * * `verbatim`: sets default `order` to `verbatim`. * - * The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have - * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the - * default dns orders in workers. + * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) + * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). + * When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) + * from the main thread won't affect the default dns orders in workers. * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. + * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. */ - function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; + function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; + // Error codes + const NODATA: "ENODATA"; + const FORMERR: "EFORMERR"; + const SERVFAIL: "ESERVFAIL"; + const NOTFOUND: "ENOTFOUND"; + const NOTIMP: "ENOTIMP"; + const REFUSED: "EREFUSED"; + const BADQUERY: "EBADQUERY"; + const BADNAME: "EBADNAME"; + const BADFAMILY: "EBADFAMILY"; + const BADRESP: "EBADRESP"; + const CONNREFUSED: "ECONNREFUSED"; + const TIMEOUT: "ETIMEOUT"; + const EOF: "EOF"; + const FILE: "EFILE"; + const NOMEM: "ENOMEM"; + const DESTRUCTION: "EDESTRUCTION"; + const BADSTR: "EBADSTR"; + const BADFLAGS: "EBADFLAGS"; + const NONAME: "ENONAME"; + const BADHINTS: "EBADHINTS"; + const NOTINITIALIZED: "ENOTINITIALIZED"; + const LOADIPHLPAPI: "ELOADIPHLPAPI"; + const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; + const CANCELLED: "ECANCELLED"; + /** * An independent resolver for DNS requests. * * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect + * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect * other resolvers: * * ```js @@ -392,6 +431,11 @@ declare module "dns/promises" { */ class Resolver { constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ cancel(): void; getServers: typeof getServers; resolve: typeof resolve; @@ -408,6 +452,21 @@ declare module "dns/promises" { resolveSrv: typeof resolveSrv; resolveTxt: typeof resolveTxt; reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ setLocalAddress(ipv4?: string, ipv6?: string): void; setServers: typeof setServers; } diff --git a/dist/node_modules/@types/node/dom-events.d.ts b/dist/node_modules/@types/node/dom-events.d.ts index 147a7b6..f47f71d 100644 --- a/dist/node_modules/@types/node/dom-events.d.ts +++ b/dist/node_modules/@types/node/dom-events.d.ts @@ -89,6 +89,8 @@ interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ passive?: boolean; + /** The listener will be removed when the given AbortSignal object's `abort()` method is called. */ + signal?: AbortSignal; } interface EventListener { diff --git a/dist/node_modules/@types/node/domain.d.ts b/dist/node_modules/@types/node/domain.d.ts index 72f17bd..d8bc999 100644 --- a/dist/node_modules/@types/node/domain.d.ts +++ b/dist/node_modules/@types/node/domain.d.ts @@ -9,10 +9,10 @@ * Domains provide a way to handle multiple different IO operations as a * single group. If any of the event emitters or callbacks registered to a * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to + * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to * exit immediately with an error code. * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/domain.js) */ declare module "domain" { import EventEmitter = require("node:events"); @@ -29,7 +29,7 @@ declare module "domain" { */ members: Array; /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly + * The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly * pushes the domain onto the domain * stack managed by the domain module (see {@link exit} for details on the * domain stack). The call to `enter()` delimits the beginning of a chain of @@ -47,7 +47,7 @@ declare module "domain" { * The call to `exit()` delimits either the end of or an interruption to the chain * of asynchronous calls and I/O operations bound to a domain. * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. + * If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain. * * Calling `exit()` changes only the active domain, and does not alter the domain * itself. `enter()` and `exit()` can be called an arbitrary number of times on a diff --git a/dist/node_modules/@types/node/events.d.ts b/dist/node_modules/@types/node/events.d.ts index 113410c..e7c2341 100644 --- a/dist/node_modules/@types/node/events.d.ts +++ b/dist/node_modules/@types/node/events.d.ts @@ -32,7 +32,7 @@ * }); * myEmitter.emit('event'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/events.js) */ declare module "events" { import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; @@ -75,24 +75,48 @@ declare module "events" { */ captureRejections?: boolean | undefined; } - // Any EventTarget with a Node-style `once` function - interface _NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - // Any EventTarget with a DOM-style `addEventListener` - interface _DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - }, - ): any; - } interface StaticEventEmitterOptions { + /** + * Can be used to cancel awaiting events. + */ signal?: AbortSignal | undefined; } - interface EventEmitter extends NodeJS.EventEmitter {} + interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions { + /** + * Names of events that will end the iteration. + */ + close?: string[] | undefined; + /** + * The high watermark. The emitter is paused every time the size of events being buffered is higher than it. + * Supported only on emitters implementing `pause()` and `resume()` methods. + * @default Number.MAX_SAFE_INTEGER + */ + highWaterMark?: number | undefined; + /** + * The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. + * Supported only on emitters implementing `pause()` and `resume()` methods. + * @default 1 + */ + lowWaterMark?: number | undefined; + } + interface EventEmitter = DefaultEventMap> extends NodeJS.EventEmitter {} + type EventMap = Record | DefaultEventMap; + type DefaultEventMap = [never]; + type AnyRest = [...args: any[]]; + type Args = T extends DefaultEventMap ? AnyRest : ( + K extends keyof T ? T[K] : never + ); + type Key = T extends DefaultEventMap ? string | symbol : K | keyof T; + type Key2 = T extends DefaultEventMap ? string | symbol : K & keyof T; + type Listener = T extends DefaultEventMap ? F : ( + K extends keyof T ? ( + T[K] extends unknown[] ? (...args: T[K]) => void : never + ) + : never + ); + type Listener1 = Listener void>; + type Listener2 = Listener; + /** * The `EventEmitter` class is defined and exposed by the `node:events` module: * @@ -106,10 +130,10 @@ declare module "events" { * It supports the following option: * @since v0.1.26 */ - class EventEmitter { + class EventEmitter = DefaultEventMap> { constructor(options?: EventEmitterOptions); - [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void; + [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; /** * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given @@ -145,7 +169,7 @@ declare module "events" { * } * ``` * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the + * The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the * '`error'` event itself, then it is treated as any other kind of event without * special handling: * @@ -191,11 +215,11 @@ declare module "events" { * @since v11.13.0, v10.16.0 */ static once( - emitter: _NodeEventTarget, + emitter: NodeJS.EventEmitter, eventName: string | symbol, options?: StaticEventEmitterOptions, ): Promise; - static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; + static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; /** * ```js * import { on, EventEmitter } from 'node:events'; @@ -251,17 +275,43 @@ declare module "events" { * * process.nextTick(() => ac.abort()); * ``` + * + * Use the `close` option to specify an array of event names that will end the iteration: + * + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * ee.emit('close'); + * }); + * + * for await (const event of on(ee, 'foo', { close: ['close'] })) { + * console.log(event); // prints ['bar'] [42] + * } + * // the loop will exit after 'close' is emitted + * console.log('done'); // prints 'done' + * ``` * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` + * @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` */ static on( emitter: NodeJS.EventEmitter, + eventName: string | symbol, + options?: StaticEventEmitterIteratorOptions, + ): AsyncIterableIterator; + static on( + emitter: EventTarget, eventName: string, - options?: StaticEventEmitterOptions, - ): AsyncIterableIterator; + options?: StaticEventEmitterIteratorOptions, + ): AsyncIterableIterator; /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. + * A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. * * ```js * import { EventEmitter, listenerCount } from 'node:events'; @@ -305,7 +355,7 @@ declare module "events" { * ``` * @since v15.2.0, v14.17.0 */ - static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; + static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; /** * Returns the currently set max amount of listeners. * @@ -334,7 +384,7 @@ declare module "events" { * ``` * @since v19.9.0 */ - static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number; + static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number; /** * ```js * import { setMaxListeners, EventEmitter } from 'node:events'; @@ -349,7 +399,7 @@ declare module "events" { * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} * objects. */ - static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; + static setMaxListeners(n?: number, ...eventTargets: Array): void; /** * Listens once to the `abort` event on the provided `signal`. * @@ -386,9 +436,9 @@ declare module "events" { */ static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; /** - * This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. + * This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. * - * Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no + * Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no * regular `'error'` listener is installed. * @since v13.6.0, v12.17.0 */ @@ -411,16 +461,18 @@ declare module "events" { * By default, a maximum of `10` listeners can be registered for any single * event. This limit can be changed for individual `EventEmitter` instances * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. + * for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property + * can be used. If this value is not a positive number, a `RangeError` is thrown. * * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_`EventEmitter` instances, including those created before + * change affects _all_ `EventEmitter` instances, including those created before * the change is made. However, calling `emitter.setMaxListeners(n)` still has * precedence over `events.defaultMaxListeners`. * * This is not a hard limit. The `EventEmitter` instance will allow * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to + * that a "possible EventEmitter memory leak" has been detected. For any single + * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to * temporarily avoid this warning: * * ```js @@ -470,13 +522,41 @@ declare module "events" { } /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that require - * manual async tracking. Specifically, all events emitted by instances of - * `EventEmitterAsyncResource` will run within its async context. + * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that + * require manual async tracking. Specifically, all events emitted by instances + * of `events.EventEmitterAsyncResource` will run within its `async context`. + * + * ```js + * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; + * import { notStrictEqual, strictEqual } from 'node:assert'; + * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; + * + * // Async tracking tooling will identify this as 'Q'. + * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); + * + * // 'foo' listeners will run in the EventEmitters async context. + * ee1.on('foo', () => { + * strictEqual(executionAsyncId(), ee1.asyncId); + * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); + * }); * - * The EventEmitterAsyncResource class has the same methods and takes the - * same options as EventEmitter and AsyncResource themselves. - * @throws if `options.name` is not provided when instantiated directly. + * const ee2 = new EventEmitter(); + * + * // 'foo' listeners on ordinary EventEmitters that do not track async + * // context, however, run in the same async context as the emit(). + * ee2.on('foo', () => { + * notStrictEqual(executionAsyncId(), ee2.asyncId); + * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); + * }); + * + * Promise.resolve().then(() => { + * ee1.emit('foo'); + * ee2.emit('foo'); + * }); + * ``` + * + * The `EventEmitterAsyncResource` class has the same methods and takes the + * same options as `EventEmitter` and `AsyncResource` themselves. * @since v17.4.0, v16.14.0 */ export class EventEmitterAsyncResource extends EventEmitter { @@ -485,34 +565,41 @@ declare module "events" { */ constructor(options?: EventEmitterAsyncResourceOptions); /** - * Call all destroy hooks. This should only ever be called once. An - * error will be thrown if it is called more than once. This must be - * manually called. If the resource is left to be collected by the GC then - * the destroy hooks will never be called. + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. */ emitDestroy(): void; - /** The unique asyncId assigned to the resource. */ + /** + * The unique `asyncId` assigned to the resource. + */ readonly asyncId: number; - /** The same triggerAsyncId that is passed to the AsyncResource constructor. */ + /** + * The same triggerAsyncId that is passed to the AsyncResource constructor. + */ readonly triggerAsyncId: number; - /** The underlying AsyncResource */ + /** + * The returned `AsyncResource` object has an additional `eventEmitter` property + * that provides a reference to this `EventEmitterAsyncResource`. + */ readonly asyncResource: EventEmitterReferencingAsyncResource; } } global { namespace NodeJS { - interface EventEmitter { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void; + interface EventEmitter = DefaultEventMap> { + [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; /** * Alias for `emitter.on(eventName, listener)`. * @since v0.1.26 */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + addListener(eventName: Key, listener: Listener1): this; /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. + * Adds the `listener` function to the end of the listeners array for the event + * named `eventName`. No checks are made to see if the `listener` has already + * been added. Multiple calls passing the same combination of `eventName` and + * `listener` will result in the `listener` being added, and called, multiple times. * * ```js * server.on('connection', (stream) => { @@ -522,7 +609,7 @@ declare module "events" { * * Returns a reference to the `EventEmitter`, so that calls can be chained. * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the + * By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the * event listener to the beginning of the listeners array. * * ```js @@ -539,9 +626,9 @@ declare module "events" { * @param eventName The name of the event. * @param listener The callback function */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; + on(eventName: Key, listener: Listener1): this; /** - * Adds a **one-time**`listener` function for the event named `eventName`. The + * Adds a **one-time** `listener` function for the event named `eventName`. The * next time `eventName` is triggered, this listener is removed and then invoked. * * ```js @@ -552,7 +639,7 @@ declare module "events" { * * Returns a reference to the `EventEmitter`, so that calls can be chained. * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the + * By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the * event listener to the beginning of the listeners array. * * ```js @@ -569,9 +656,9 @@ declare module "events" { * @param eventName The name of the event. * @param listener The callback function */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; + once(eventName: Key, listener: Listener1): this; /** - * Removes the specified `listener` from the listener array for the event named`eventName`. + * Removes the specified `listener` from the listener array for the event named `eventName`. * * ```js * const callback = (stream) => { @@ -588,7 +675,7 @@ declare module "events" { * called multiple times to remove each instance. * * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution + * time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution * will not remove them from`emit()` in progress. Subsequent events behave as expected. * * ```js @@ -631,7 +718,7 @@ declare module "events" { * * When a single function has been added as a handler multiple times for a single * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: + * recently added instance. In the example the `once('ping')` listener is removed: * * ```js * import { EventEmitter } from 'node:events'; @@ -652,12 +739,12 @@ declare module "events" { * Returns a reference to the `EventEmitter`, so that calls can be chained. * @since v0.1.26 */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + removeListener(eventName: Key, listener: Listener1): this; /** * Alias for `emitter.removeListener()`. * @since v10.0.0 */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; + off(eventName: Key, listener: Listener1): this; /** * Removes all listeners, or those of the specified `eventName`. * @@ -668,12 +755,12 @@ declare module "events" { * Returns a reference to the `EventEmitter`, so that calls can be chained. * @since v0.1.26 */ - removeAllListeners(event?: string | symbol): this; + removeAllListeners(eventName?: Key): this; /** * By default `EventEmitter`s will print a warning if more than `10` listeners are * added for a particular event. This is a useful default that helps finding * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. + * modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. * * Returns a reference to the `EventEmitter`, so that calls can be chained. * @since v0.3.5 @@ -697,7 +784,7 @@ declare module "events" { * ``` * @since v0.1.26 */ - listeners(eventName: string | symbol): Function[]; + listeners(eventName: Key): Array>; /** * Returns a copy of the array of listeners for the event named `eventName`, * including any wrappers (such as those created by `.once()`). @@ -728,9 +815,9 @@ declare module "events" { * ``` * @since v9.4.0 */ - rawListeners(eventName: string | symbol): Function[]; + rawListeners(eventName: Key): Array>; /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments + * Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments * to each. * * Returns `true` if the event had listeners, `false` otherwise. @@ -769,7 +856,7 @@ declare module "events" { * ``` * @since v0.1.26 */ - emit(eventName: string | symbol, ...args: any[]): boolean; + emit(eventName: Key, ...args: Args): boolean; /** * Returns the number of listeners listening for the event named `eventName`. * If `listener` is provided, it will return how many times the listener is found @@ -778,12 +865,12 @@ declare module "events" { * @param eventName The name of the event being listened for * @param listener The event handler function */ - listenerCount(eventName: string | symbol, listener?: Function): number; + listenerCount(eventName: Key, listener?: Listener2): number; /** * Adds the `listener` function to the _beginning_ of the listeners array for the * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. + * already been added. Multiple calls passing the same combination of `eventName` + * and `listener` will result in the `listener` being added, and called, multiple times. * * ```js * server.prependListener('connection', (stream) => { @@ -796,7 +883,7 @@ declare module "events" { * @param eventName The name of the event. * @param listener The callback function */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependListener(eventName: Key, listener: Listener1): this; /** * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this * listener is removed, and then invoked. @@ -812,7 +899,7 @@ declare module "events" { * @param eventName The name of the event. * @param listener The callback function */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(eventName: Key, listener: Listener1): this; /** * Returns an array listing the events for which the emitter has registered * listeners. The values in the array are strings or `Symbol`s. @@ -832,7 +919,7 @@ declare module "events" { * ``` * @since v6.0.0 */ - eventNames(): Array; + eventNames(): Array<(string | symbol) & Key2>; } } } diff --git a/dist/node_modules/@types/node/fs.d.ts b/dist/node_modules/@types/node/fs.d.ts index 3f5d9a1..dc1d5da 100644 --- a/dist/node_modules/@types/node/fs.d.ts +++ b/dist/node_modules/@types/node/fs.d.ts @@ -16,7 +16,7 @@ * * All file system operations have synchronous, callback, and promise-based * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/fs.js) */ declare module "fs" { import * as stream from "node:stream"; @@ -77,7 +77,7 @@ declare module "fs" { * their synchronous counterparts are of this type. * If `bigint` in the `options` passed to those methods is true, the numeric values * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. + * nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword. * * ```console * Stats { @@ -242,7 +242,13 @@ declare module "fs" { name: string; /** * The base path that this `fs.Dirent` object refers to. + * @since v20.12.0 + */ + parentPath: string; + /** + * Alias for `dirent.parentPath`. * @since v20.1.0 + * @deprecated Since v20.12.0 */ path: string; } @@ -281,7 +287,7 @@ declare module "fs" { * Asynchronously close the directory's underlying resource handle. * Subsequent reads will result in errors. * - * A promise is returned that will be resolved after the resource has been + * A promise is returned that will be fulfilled after the resource has been * closed. * @since v12.12.0 */ @@ -296,7 +302,7 @@ declare module "fs" { /** * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null` if there are no more directory entries to read. * * Directory entries returned by this function are in no particular order as * provided by the operating system's underlying directory mechanisms. @@ -354,31 +360,51 @@ declare module "fs" { * @since v0.5.8 */ close(): void; + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.FSWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.FSWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; /** * events.EventEmitter * 1. change - * 2. error + * 2. close + * 3. error */ addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "error", listener: (error: Error) => void): this; addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; on(event: string, listener: (...args: any[]) => void): this; on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "error", listener: (error: Error) => void): this; on(event: "close", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; once(event: string, listener: (...args: any[]) => void): this; once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "error", listener: (error: Error) => void): this; once(event: "close", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; } /** * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. @@ -1419,7 +1445,7 @@ declare module "fs" { * 2. The maximum number of symbolic links is platform-independent and generally * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. + * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths. * * Only paths that can be converted to UTF8 strings are supported. * @@ -1663,7 +1689,7 @@ declare module "fs" { retryDelay?: number | undefined; } /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). No arguments other than a possible exception are given to the * completion callback. * @since v14.14.0 */ @@ -1676,7 +1702,7 @@ declare module "fs" { function __promisify__(path: PathLike, options?: RmOptions): Promise; } /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. + * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`. * @since v14.14.0 */ export function rmSync(path: PathLike, options?: RmOptions): void; @@ -1701,7 +1727,7 @@ declare module "fs" { * created (for instance, if it was previously created). * * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that + * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fs.mkdir()` when `path` is a directory that * exists results in an error only * when `recursive` is false. If `recursive` is false and the directory exists, * an `EEXIST` error occurs. @@ -1809,7 +1835,7 @@ declare module "fs" { ): Promise; } /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. + * Synchronously creates a directory. Returns `undefined`, or if `recursive` is `true`, the first directory path created. * This is the synchronous version of {@link mkdir}. * * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. @@ -1846,7 +1872,7 @@ declare module "fs" { /** * Creates a unique temporary directory. * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. Due to platform * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, * notably the BSDs, can return more than six random characters, and replace * trailing `X` characters in `prefix` with random characters. @@ -1983,7 +2009,7 @@ declare module "fs" { */ export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. + * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`. * * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. * @@ -2277,8 +2303,8 @@ declare module "fs" { * * The `atime` and `mtime` arguments follow these rules: * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. + * * Values can be either numbers representing Unix epoch time in seconds, `Date`s, or a numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. * @since v0.4.2 */ export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; @@ -2351,7 +2377,7 @@ declare module "fs" { * should be written. If `typeof position !== 'number'`, the data will be written * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. + * The callback will be given three arguments `(err, bytesWritten, buffer)` where `bytesWritten` specifies how many _bytes_ were written from `buffer`. * * If this method is invoked as its `util.promisify()` ed version, it returns * a promise for an `Object` with `bytesWritten` and `buffer` properties. @@ -2800,7 +2826,7 @@ declare module "fs" { * If the `encoding` option is specified then this function returns a * string. Otherwise it returns a buffer. * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. + * Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific. * * ```js * import { readFileSync } from 'node:fs'; @@ -2861,6 +2887,7 @@ declare module "fs" { & { mode?: Mode | undefined; flag?: string | undefined; + flush?: boolean | undefined; } ) | BufferEncoding @@ -2869,7 +2896,7 @@ declare module "fs" { * When `file` is a filename, asynchronously writes data to the file, replacing the * file if it already exists. `data` can be a string or a buffer. * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using + * When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using * a file descriptor. * * The `encoding` option is ignored if `data` is a buffer. @@ -3118,7 +3145,7 @@ declare module "fs" { * Watch for changes on `filename`. The callback `listener` will be called each * time the file is accessed. * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates * whether the process should continue to run as long as files are being watched. * The `options` object may specify an `interval` property indicating how often the * target should be polled in milliseconds. @@ -3147,7 +3174,7 @@ declare module "fs" { * again, with the latest stat objects. This is a change in functionality since * v0.10. * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. * * When a file being watched by `fs.watchFile()` disappears and reappears, * then the contents of `previous` in the second callback event (the file's @@ -3169,7 +3196,7 @@ declare module "fs" { * Watch for changes on `filename`. The callback `listener` will be called each * time the file is accessed. * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates * whether the process should continue to run as long as files are being watched. * The `options` object may specify an `interval` property indicating how often the * target should be polled in milliseconds. @@ -3198,7 +3225,7 @@ declare module "fs" { * again, with the latest stat objects. This is a change in functionality since * v0.10. * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. * * When a file being watched by `fs.watchFile()` disappears and reappears, * then the contents of `previous` in the second callback event (the file's @@ -3242,7 +3269,7 @@ declare module "fs" { * Calling `fs.unwatchFile()` with a filename that is not being watched is a * no-op, not an error. * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. + * Using {@link watch} is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible. * @since v0.1.31 * @param listener Optional, a listener previously attached using `fs.watchFile()` */ @@ -3270,7 +3297,7 @@ declare module "fs" { * On most platforms, `'rename'` is emitted whenever a filename appears or * disappears in the directory. * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. + * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of `eventType`. * * If a `signal` is passed, aborting the corresponding AbortController will close * the returned `fs.FSWatcher`. @@ -3330,11 +3357,11 @@ declare module "fs" { * ``` * * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback + * **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback * has only one boolean parameter. This is one reason `fs.access()` is recommended * instead of `fs.exists()`. * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing + * Using `fs.exists()` to check for the existence of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing * so introduces a race condition, since other processes may change the file's * state between the two calls. Instead, user code should open/read/write the * file directly and handle the error raised if the file does not exist. @@ -3461,7 +3488,7 @@ declare module "fs" { * For detailed information, see the documentation of the asynchronous version of * this API: {@link exists}. * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other + * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other * Node.js callbacks. `fs.existsSync()` does not use a callback. * * ```js @@ -3590,13 +3617,13 @@ declare module "fs" { /** * Tests a user's permissions for the file or directory specified by `path`. * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for * possible values of `mode`. * * The final argument, `callback`, is a callback function that is invoked with * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. + * argument will be an `Error` object. The following examples check if `package.json` exists, and if it is readable or writable. * * ```js * import { access, constants } from 'node:fs'; @@ -3624,7 +3651,7 @@ declare module "fs" { * }); * ``` * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing + * Do not use `fs.access()` to check for the accessibility of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing * so introduces a race condition, since other processes may change the file's * state between the two calls. Instead, user code should open/read/write the * file directly and handle the error raised if the file is not accessible. @@ -3764,7 +3791,7 @@ declare module "fs" { /** * Synchronously tests a user's permissions for the file or directory specified * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and + * accessibility checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for * possible values of `mode`. * @@ -3813,6 +3840,7 @@ declare module "fs" { } interface WriteStreamOptions extends StreamOptions { fs?: CreateWriteStreamFSImplementation | null | undefined; + flush?: boolean | undefined; } /** * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream @@ -3837,8 +3865,8 @@ declare module "fs" { * By default, the stream will emit a `'close'` event after it has been * destroyed. Set the `emitClose` option to `false` to change this behavior. * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is + * By providing the `fs` option, it is possible to override the corresponding `fs` implementations for `open`, `read`, and `close`. When providing the `fs` option, + * an override for `read` is required. If no `fd` is provided, an override for `open` is also required. If `autoClose` is `true`, an override for `close` is * also required. * * ```js @@ -3886,7 +3914,7 @@ declare module "fs" { * replacing it may require the `flags` option to be set to `r+` rather than the * default `w`. The `encoding` can be any one of those accepted by `Buffer`. * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, * then the file descriptor won't be closed, even if there's an error. * It is the application's responsibility to close it and make sure there's no * file descriptor leak. @@ -3894,12 +3922,12 @@ declare module "fs" { * By default, the stream will emit a `'close'` event after it has been * destroyed. Set the `emitClose` option to `false` to change this behavior. * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce + * By providing the `fs` option it is possible to override the corresponding `fs` implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` without `writev()` can reduce * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. + * will be disabled. When providing the `fs` option, overrides for at least one of `write` and `writev` are required. If no `fd` option is supplied, an override + * for `open` is also required. If `autoClose` is `true`, an override for `close` is also required. * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be + * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the `path` argument and will use the specified file descriptor. This means that no `'open'` event will be * emitted. `fd` should be blocking; non-blocking `fd`s * should be passed to `net.Socket`. * @@ -4008,15 +4036,15 @@ declare module "fs" { */ export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. + * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`. * * `position` is the offset from the beginning of the file where this data * should be written. If `typeof position !== 'number'`, the data will be written * at the current position. * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. + * The callback will be given three arguments: `err`, `bytesWritten`, and `buffers`. `bytesWritten` is how many bytes were written from `buffers`. * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. + * If this method is `util.promisify()` ed, it returns a promise for an `Object` with `bytesWritten` and `buffers` properties. * * It is unsafe to use `fs.writev()` multiple times on the same file without * waiting for the callback. For this scenario, use {@link createWriteStream}. @@ -4029,12 +4057,12 @@ declare module "fs" { */ export function writev( fd: number, - buffers: ReadonlyArray, + buffers: readonly NodeJS.ArrayBufferView[], cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export function writev( fd: number, - buffers: ReadonlyArray, + buffers: readonly NodeJS.ArrayBufferView[], position: number, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; @@ -4045,7 +4073,7 @@ declare module "fs" { export namespace writev { function __promisify__( fd: number, - buffers: ReadonlyArray, + buffers: readonly NodeJS.ArrayBufferView[], position?: number, ): Promise; } @@ -4056,7 +4084,7 @@ declare module "fs" { * @param [position='null'] * @return The number of bytes written. */ - export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; + export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; /** * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s * using `readv()`. @@ -4065,7 +4093,7 @@ declare module "fs" { * should be read. If `typeof position !== 'number'`, the data will be read * from the current position. * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. + * The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file. * * If this method is invoked as its `util.promisify()` ed version, it returns * a promise for an `Object` with `bytesRead` and `buffers` properties. @@ -4074,12 +4102,12 @@ declare module "fs" { */ export function readv( fd: number, - buffers: ReadonlyArray, + buffers: readonly NodeJS.ArrayBufferView[], cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; export function readv( fd: number, - buffers: ReadonlyArray, + buffers: readonly NodeJS.ArrayBufferView[], position: number, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, ): void; @@ -4090,7 +4118,7 @@ declare module "fs" { export namespace readv { function __promisify__( fd: number, - buffers: ReadonlyArray, + buffers: readonly NodeJS.ArrayBufferView[], position?: number, ): Promise; } @@ -4101,7 +4129,7 @@ declare module "fs" { * @param [position='null'] * @return The number of bytes read. */ - export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; + export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; export interface OpenAsBlobOptions { /** diff --git a/dist/node_modules/@types/node/fs/promises.d.ts b/dist/node_modules/@types/node/fs/promises.d.ts index 084ee6e..3199063 100644 --- a/dist/node_modules/@types/node/fs/promises.d.ts +++ b/dist/node_modules/@types/node/fs/promises.d.ts @@ -82,6 +82,7 @@ declare module "fs/promises" { emitClose?: boolean | undefined; start?: number | undefined; highWaterMark?: number | undefined; + flush?: boolean | undefined; } interface ReadableWebStreamOptions { /** @@ -107,7 +108,10 @@ declare module "fs/promises" { */ appendFile( data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null, + options?: + | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) + | BufferEncoding + | null, ): Promise; /** * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). @@ -185,7 +189,7 @@ declare module "fs/promises" { * replacing it may require the `flags` `open` option to be set to `r+` rather than * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, * then the file descriptor won't be closed, even if there's an error. * It is the application's responsibility to close it and make sure there's no * file descriptor leak. @@ -264,7 +268,7 @@ declare module "fs/promises" { * * The `FileHandle` has to support reading. * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current + * If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current * position till the end of the file. It doesn't always read from the beginning * of the file. * @since v10.0.0 @@ -366,22 +370,22 @@ declare module "fs/promises" { */ truncate(len?: number): Promise; /** - * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. + * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. * @since v10.0.0 */ utimes(atime: TimeLike, mtime: TimeLike): Promise; /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is resolved with no arguments upon success. + * The promise is fulfilled with no arguments upon success. * * If `options` is a string, then it specifies the `encoding`. * * The `FileHandle` has to support writing. * * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). + * without waiting for the promise to be fulfilled (or rejected). * * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the * current position till the end of the file. It doesn't always write from the @@ -390,15 +394,18 @@ declare module "fs/promises" { */ writeFile( data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null, + options?: + | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined }) + | BufferEncoding + | null, ): Promise; /** * Write `buffer` to the file. * - * The promise is resolved with an object containing two properties: + * The promise is fulfilled with an object containing two properties: * * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). For this + * without waiting for the promise to be fulfilled (or rejected). For this * scenario, use `filehandle.createWriteStream()`. * * On Linux, positional writes do not work when the file is opened in append mode. @@ -430,10 +437,10 @@ declare module "fs/promises" { /** * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. * - * The promise is resolved with an object containing a two properties: + * The promise is fulfilled with an object containing a two properties: * * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be resolved (or rejected). + * for the promise to be fulfilled (or rejected). * * On Linux, positional writes don't work when the file is opened in append mode. * The kernel ignores the position argument and always appends the data to @@ -442,14 +449,14 @@ declare module "fs/promises" { * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current * position. */ - writev(buffers: ReadonlyArray, position?: number): Promise; + writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; /** * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s * @since v13.13.0, v12.17.0 * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. * @return Fulfills upon success an object containing two properties: */ - readv(buffers: ReadonlyArray, position?: number): Promise; + readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; /** * Closes the file handle after waiting for any pending operation on the handle to * complete. @@ -478,11 +485,11 @@ declare module "fs/promises" { /** * Tests a user's permissions for the file or directory specified by `path`. * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for * possible values of `mode`. * - * If the accessibility check is successful, the promise is resolved with no + * If the accessibility check is successful, the promise is fulfilled with no * value. If any of the accessibility checks fail, the promise is rejected * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and * written by the current process. @@ -563,7 +570,7 @@ declare module "fs/promises" { */ function rename(oldPath: PathLike, newPath: PathLike): Promise; /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. + * Truncates (shortens or extends the length) of the content at `path` to `len` bytes. * @since v10.0.0 * @param [len=0] * @return Fulfills with `undefined` upon success. @@ -573,7 +580,7 @@ declare module "fs/promises" { * Removes the directory identified by `path`. * * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. + * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. * * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. * @since v10.0.0 @@ -590,7 +597,7 @@ declare module "fs/promises" { * Asynchronously creates a directory. * * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory + * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fsPromises.mkdir()` when `path` is a directory * that exists results in a * rejection only when `recursive` is false. * @@ -645,7 +652,7 @@ declare module "fs/promises" { * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned * will be passed as `Buffer` objects. * - * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. + * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. * * ```js * import { readdir } from 'node:fs/promises'; @@ -715,7 +722,7 @@ declare module "fs/promises" { ): Promise; /** * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * resolved with the`linkString` upon success. + * fulfilled with the`linkString` upon success. * * The optional `options` argument can be a string specifying an encoding, or an * object with an `encoding` property specifying the character encoding to use for @@ -740,7 +747,7 @@ declare module "fs/promises" { /** * Creates a symbolic link. * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will + * The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not * exist, `'file'` will be used. Windows junction points require the destination * path to be absolute. When using `'junction'`, the `target` argument will @@ -860,13 +867,13 @@ declare module "fs/promises" { * * * Values can be either numbers representing Unix epoch time, `Date`s, or a * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. * @since v10.0.0 * @return Fulfills with `undefined` upon success. */ function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. + * Determines the actual location of `path` using the same semantics as the `fs.realpath.native()` function. * * Only paths that can be converted to UTF8 strings are supported. * @@ -920,7 +927,7 @@ declare module "fs/promises" { * ``` * * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing + * characters directly to the `prefix` string. For instance, given a directory `/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the `prefix` must end with a trailing * platform-specific path separator * (`require('node:path').sep`). * @since v10.0.0 @@ -940,7 +947,7 @@ declare module "fs/promises" { */ function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. * @@ -1001,6 +1008,12 @@ declare module "fs/promises" { | (ObjectEncodingOptions & { mode?: Mode | undefined; flag?: OpenMode | undefined; + /** + * If all data is successfully written to the file, and `flush` + * is `true`, `filehandle.sync()` is used to flush the data. + * @default false + */ + flush?: boolean | undefined; } & Abortable) | BufferEncoding | null, @@ -1022,7 +1035,7 @@ declare module "fs/promises" { function appendFile( path: PathLike | FileHandle, data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null, + options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, ): Promise; /** * Asynchronously reads the entire contents of a file. diff --git a/dist/node_modules/@types/node/globals.d.ts b/dist/node_modules/@types/node/globals.d.ts index 3a449e4..a425b07 100644 --- a/dist/node_modules/@types/node/globals.d.ts +++ b/dist/node_modules/@types/node/globals.d.ts @@ -1,381 +1,412 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; +export {}; // Make this a module + +// #region Fetch and friends +// Conditional type aliases, used at the end of this file. +// Will either be empty if lib-dom is included, or the undici version otherwise. +type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; +type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; +type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; +type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; +type _RequestInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").RequestInit; +type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} + : import("undici-types").ResponseInit; +type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File; +// #endregion Fetch and friends + +declare global { + // Declare "static" methods in Error + interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; -// #region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ + stackTraceLimit: number; + } - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; -} + /*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; -} + // For backwards compability + interface NodeRequire extends NodeJS.Require {} + interface RequireResolve extends NodeJS.RequireResolve {} + interface NodeModule extends NodeJS.Module {} -declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -// #endregion borrowed - -// #region Disposable -interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; + var process: NodeJS.Process; + var console: Console; - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; -} + var __filename: string; + var __dirname: string; -interface Disposable { - [Symbol.dispose](): void; -} + var require: NodeRequire; + var module: NodeModule; -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} -// #endregion Disposable + // Same as module.exports + var exports: any; -// #region ArrayLike.at() -interface RelativeIndexable { /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. + * Only available if `--expose-gc` is passed to the process. */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -// #endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; + var gc: undefined | (() => void); + // #region borrowed + // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib + /** A controller object that allows you to abort one or more DOM requests as and when desired. */ + interface AbortController { /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. + * Returns the AbortSignal object associated with this object. */ - getFunctionName(): string | null; + readonly signal: AbortSignal; /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; + abort(reason?: any): void; + } + /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ + interface AbortSignal extends EventTarget { /** - * Does this call take place in code defined by a call to eval? + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ - isEval(): boolean; + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; + } + var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T + : { + prototype: AbortController; + new(): AbortController; + }; + + var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + any(signals: AbortSignal[]): AbortSignal; + }; + // #endregion borrowed + + // #region Disposable + interface SymbolConstructor { /** - * Is this call in native V8 code? + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. */ - isNative(): boolean; + readonly dispose: unique symbol; /** - * Is this a constructor call? + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. */ - isConstructor(): boolean; + readonly asyncDispose: unique symbol; } - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; + interface Disposable { + [Symbol.dispose](): void; } - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; + interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; } + // #endregion Disposable - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; + // #region ArrayLike.at() + interface RelativeIndexable { /** - * @deprecated + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. */ - extensions: RequireExtensions; - main: Module | undefined; + at(index: number): T | undefined; } + interface String extends RelativeIndexable {} + interface Array extends RelativeIndexable {} + interface ReadonlyArray extends RelativeIndexable {} + interface Int8Array extends RelativeIndexable {} + interface Uint8Array extends RelativeIndexable {} + interface Uint8ClampedArray extends RelativeIndexable {} + interface Int16Array extends RelativeIndexable {} + interface Uint16Array extends RelativeIndexable {} + interface Int32Array extends RelativeIndexable {} + interface Uint32Array extends RelativeIndexable {} + interface Float32Array extends RelativeIndexable {} + interface Float64Array extends RelativeIndexable {} + interface BigInt64Array extends RelativeIndexable {} + interface BigUint64Array extends RelativeIndexable {} + // #endregion ArrayLike.at() end - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; + /** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ + function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, + ): T; + + /*----------------------------------------------* + * * + * GLOBAL INTERFACES * + * * + *-----------------------------------------------*/ + namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + + /** + * is this an async call (i.e. await, Promise.all(), or Promise.any())? + */ + isAsync(): boolean; + + /** + * is this an async call to Promise.all()? + */ + isPromiseAll(): boolean; + + /** + * returns the index of the promise element that was followed in + * Promise.all() or Promise.any() for async stack traces, or null + * if the CallSite is not an async + */ + getPromiseIndex(): number | null; + + getScriptNameOrSourceURL(): string; + getScriptHash(): string; + + getEnclosingColumnNumber(): number; + getEnclosingLineNumber(): number; + getPosition(): number; + + toString(): string; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream {} + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + ".js": (m: Module, filename: string) => any; + ".json": (m: Module, filename: string) => any; + ".node": (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } } - namespace fetch { - type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; - type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; - type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; - type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; - type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; - type Request = globalThis.Request; - type Response = globalThis.Response; - type Headers = globalThis.Headers; - type FormData = globalThis.FormData; - type RequestInit = globalThis.RequestInit; - type RequestInfo = import("undici-types").RequestInfo; - type HeadersInit = import("undici-types").HeadersInit; - type BodyInit = import("undici-types").BodyInit; - type RequestRedirect = import("undici-types").RequestRedirect; - type RequestCredentials = import("undici-types").RequestCredentials; - type RequestMode = import("undici-types").RequestMode; - type ReferrerPolicy = import("undici-types").ReferrerPolicy; - type Dispatcher = import("undici-types").Dispatcher; - type RequestDuplex = import("undici-types").RequestDuplex; - } + interface RequestInit extends _RequestInit {} + + function fetch( + input: string | URL | globalThis.Request, + init?: RequestInit, + ): Promise; + + interface Request extends _Request {} + var Request: typeof globalThis extends { + onmessage: any; + Request: infer T; + } ? T + : typeof import("undici-types").Request; + + interface ResponseInit extends _ResponseInit {} + + interface Response extends _Response {} + var Response: typeof globalThis extends { + onmessage: any; + Response: infer T; + } ? T + : typeof import("undici-types").Response; + + interface FormData extends _FormData {} + var FormData: typeof globalThis extends { + onmessage: any; + FormData: infer T; + } ? T + : typeof import("undici-types").FormData; + + interface Headers extends _Headers {} + var Headers: typeof globalThis extends { + onmessage: any; + Headers: infer T; + } ? T + : typeof import("undici-types").Headers; + + interface File extends _File {} + var File: typeof globalThis extends { + onmessage: any; + File: infer T; + } ? T + : typeof import("node:buffer").File; } - -interface RequestInit extends NodeJS.fetch._RequestInit {} - -declare function fetch( - input: NodeJS.fetch.RequestInfo, - init?: RequestInit, -): Promise; - -interface Request extends NodeJS.fetch._Request {} -declare var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; -} ? T - : typeof import("undici-types").Request; - -interface Response extends NodeJS.fetch._Response {} -declare var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; -} ? T - : typeof import("undici-types").Response; - -interface FormData extends NodeJS.fetch._FormData {} -declare var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; -} ? T - : typeof import("undici-types").FormData; - -interface Headers extends NodeJS.fetch._Headers {} -declare var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; -} ? T - : typeof import("undici-types").Headers; diff --git a/dist/node_modules/@types/node/http.d.ts b/dist/node_modules/@types/node/http.d.ts index b06f541..a1018ee 100644 --- a/dist/node_modules/@types/node/http.d.ts +++ b/dist/node_modules/@types/node/http.d.ts @@ -9,12 +9,12 @@ * * HTTP message headers are represented by an object like this: * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'example.com', - * 'accept': '*' } + * ```json + * { "content-length": "123", + * "content-type": "text/plain", + * "connection": "keep-alive", + * "host": "example.com", + * "accept": "*" } * ``` * * Keys are lowercased. Values are not modified. @@ -26,8 +26,8 @@ * * See `message.headers` for details on how duplicate headers are handled. * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: + * The raw headers as they were received are retained in the `rawHeaders` property, which is an array of `[key, value, key2, value2, ...]`. For + * example, the previous message header object might have a `rawHeaders` list like the following: * * ```js * [ 'ConTent-Length', '123456', @@ -37,7 +37,7 @@ * 'Host', 'example.com', * 'accepT', '*' ] * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http.js) */ declare module "http" { import * as stream from "node:stream"; @@ -198,9 +198,11 @@ declare module "http" { _defaultAgent?: Agent | undefined; agent?: Agent | boolean | undefined; auth?: string | null | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 createConnection?: - | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) + | (( + options: ClientRequestArgs, + oncreate: (err: Error | null, socket: stream.Duplex) => void, + ) => stream.Duplex | null | undefined) | undefined; defaultPort?: number | string | undefined; family?: number | undefined; @@ -280,9 +282,8 @@ declare module "http" { */ insecureHTTPParser?: boolean | undefined; /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. + * Optionally overrides the value of `--max-http-header-size` for requests received by + * this server, i.e. the maximum length of request headers in bytes. * @default 16384 * @since v13.3.0 */ @@ -386,7 +387,7 @@ declare module "http" { * The number of milliseconds of inactivity a server needs to wait for additional * incoming data, after it has finished writing the last response, before a socket * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. + * timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`. * * A value of `0` will disable the keep-alive timeout behavior on incoming * connections. @@ -573,7 +574,7 @@ declare module "http" { readonly socket: Socket | null; constructor(); /** - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. + * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter. * @since v0.9.12 * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. */ @@ -586,14 +587,14 @@ declare module "http" { * @param name Header name * @param value Header value */ - setHeader(name: string, value: number | string | ReadonlyArray): this; + setHeader(name: string, value: number | string | readonly string[]): this; /** - * Append a single header value for the header object. + * Append a single header value to the header object. * - * If the value is an array, this is equivalent of calling this method multiple + * If the value is an array, this is equivalent to calling this method multiple * times. * - * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`. + * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`. * * Depending of the value of `options.uniqueHeaders` when the client request or the * server were created, this will end up in the header being sent multiple times or @@ -602,7 +603,7 @@ declare module "http" { * @param name Header name * @param value Header value */ - appendHeader(name: string, value: string | ReadonlyArray): this; + appendHeader(name: string, value: string | readonly string[]): this; /** * Gets the value of the HTTP header with the given name. If that header is not * set, the returned value will be `undefined`. @@ -689,7 +690,7 @@ declare module "http" { * packet. * * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message. + * data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message. * @since v1.6.0 */ flushHeaders(): void; @@ -730,7 +731,7 @@ declare module "http" { */ statusMessage: string; /** - * If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal. + * If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal. * Mismatching the `Content-Length` header value will result * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. * @since v18.10.0, v16.18.0 @@ -741,7 +742,7 @@ declare module "http" { detachSocket(socket: Socket): void; /** * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. + * the request body should be sent. See the `'checkContinue'` event on `Server`. * @since v0.3.0 */ writeContinue(callback?: () => void): void; @@ -861,10 +862,10 @@ declare module "http" { /** * This object is created internally and returned from {@link request}. It * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will + * header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will * be sent along with the first data chunk or when calling `request.end()`. * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response + * To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response * headers have been received. The `'response'` event is executed with one * argument which is an instance of {@link IncomingMessage}. * @@ -880,10 +881,10 @@ declare module "http" { * the data is read it will consume memory that can eventually lead to a * 'process out of memory' error. * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. + * For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered. * * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown, + * If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown, * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. * * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. @@ -894,7 +895,7 @@ declare module "http" { * The `request.aborted` property will be `true` if the request has * been aborted. * @since v0.11.14 - * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. + * @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead. */ aborted: boolean; /** @@ -1126,7 +1127,7 @@ declare module "http" { * access response * status, headers, and data. * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to + * Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to * parse and emit the incoming HTTP headers and payload, as the underlying socket * may be reused multiple times in case of keep-alive. * @since v0.1.17 @@ -1145,7 +1146,7 @@ declare module "http" { * client response, the HTTP version of the connected-to server. * Probably either `'1.1'` or `'1.0'`. * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. * @since v0.1.1 */ httpVersion: string; @@ -1210,8 +1211,8 @@ declare module "http" { * Duplicates in raw headers are handled in the following ways, depending on the * header name: * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. + * * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`, + * `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded. * To allow duplicate values of the headers listed above to be joined, * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more * information. @@ -1305,29 +1306,32 @@ declare module "http" { * To parse the URL into its parts: * * ```js - * new URL(request.url, `http://${request.headers.host}`); + * new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); * ``` * - * When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`: + * When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined: * * ```console * $ node - * > new URL(request.url, `http://${request.headers.host}`) + * > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', + * href: 'http://localhost/status?name=ryan', + * origin: 'http://localhost', * protocol: 'http:', * username: '', * password: '', - * host: 'localhost:3000', + * host: 'localhost', * hostname: 'localhost', - * port: '3000', + * port: '', * pathname: '/status', * search: '?name=ryan', * searchParams: URLSearchParams { 'name' => 'ryan' }, * hash: '' * } * ``` + * + * Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper + * validation is used, as clients may specify a custom `Host` header. * @since v0.1.90 */ url?: string | undefined; @@ -1346,7 +1350,7 @@ declare module "http" { */ statusMessage?: string | undefined; /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed + * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error` is provided, an `'error'` event is emitted on the socket and `error` is passed * as an argument to any listeners on the event. * @since v0.3.0 */ @@ -1390,7 +1394,7 @@ declare module "http" { * for a given host and port, reusing a single socket connection for each * until the queue is empty, at which time the socket is either destroyed * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. + * same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`. * * Pooled connections have TCP Keep-Alive enabled for them, but servers may * still close idle connections, in which case they will be removed from the @@ -1421,7 +1425,7 @@ declare module "http" { * }); * ``` * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options + * An agent may also be used for an individual request. By providing `{agent: false}` as an option to the `http.get()` or `http.request()` functions, a one-time use `Agent` with default options * will be used * for the client connection. * @@ -1437,6 +1441,17 @@ declare module "http" { * // Do stuff with response * }); * ``` + * + * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v20.x/api/net.html#socketconnectoptions-connectlistener) are also supported. + * + * To configure any of them, a custom {@link Agent} instance must be created. + * + * ```js + * const http = require('node:http'); + * const keepAliveAgent = new http.Agent({ keepAlive: true }); + * options.agent = keepAliveAgent; + * http.request(options, onResponseCallback) + * ``` * @since v0.3.4 */ class Agent extends EventEmitter { @@ -1559,7 +1574,7 @@ declare module "http" { * `url` can be a string or a `URL` object. If `url` is a * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. + * If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence. * * The optional `callback` parameter will be added as a one-time listener for * the `'response'` event. @@ -1659,7 +1674,7 @@ declare module "http" { * the following events will be emitted in the following order: * * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` * * `'close'` * * In the case of a premature connection close after the response is received, @@ -1670,15 +1685,15 @@ declare module "http" { * * `'data'` any number of times, on the `res` object * * (connection closed here) * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'` * * `'close'` + * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'` * * `'close'` on the `res` object * * If `req.destroy()` is called before a socket is assigned, the following * events will be emitted in the following order: * * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called * * `'close'` * * If `req.destroy()` is called before the connection succeeds, the following @@ -1686,7 +1701,7 @@ declare module "http" { * * * `'socket'` * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called * * `'close'` * * If `req.destroy()` is called after the response is received, the following @@ -1697,8 +1712,8 @@ declare module "http" { * * `'data'` any number of times, on the `res` object * * (`req.destroy()` called here) * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called * * `'close'` + * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called * * `'close'` on the `res` object * * If `req.abort()` is called before a socket is assigned, the following @@ -1714,7 +1729,7 @@ declare module "http" { * * `'socket'` * * (`req.abort()` called here) * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` * * `'close'` * * If `req.abort()` is called after the response is received, the following @@ -1726,16 +1741,16 @@ declare module "http" { * * (`req.abort()` called here) * * `'abort'` * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`. * * `'close'` * * `'close'` on the `res` object * * Setting the `timeout` option or using the `setTimeout()` function will * not abort the request or do anything besides add a `'timeout'` event. * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the + * Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided. + * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided. * @since v0.3.6 */ function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; @@ -1746,7 +1761,7 @@ declare module "http" { ): ClientRequest; /** * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to + * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to * consume the response * data for reasons stated in {@link ClientRequest} section. * @@ -1807,14 +1822,13 @@ declare module "http" { function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; /** - * Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called. + * Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called. * * Passing illegal value as `name` will result in a `TypeError` being thrown, * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. * * It is not necessary to use this method before passing headers to an HTTP request * or response. The HTTP module will automatically validate such headers. - * Examples: * * Example: * @@ -1834,7 +1848,7 @@ declare module "http" { */ function validateHeaderName(name: string): void; /** - * Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called. + * Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called. * * Passing illegal value as `value` will result in a `TypeError` being thrown. * @@ -1876,6 +1890,12 @@ declare module "http" { * @param [max=1000] */ function setMaxIdleHTTPParsers(max: number): void; + /** + * Global instance of `Agent` which is used as the default for all HTTP client + * requests. Diverges from a default `Agent` configuration by having `keepAlive` + * enabled and a `timeout` of 5 seconds. + * @since v0.5.9 + */ let globalAgent: Agent; /** * Read-only property specifying the maximum allowed size of HTTP headers in bytes. diff --git a/dist/node_modules/@types/node/http2.d.ts b/dist/node_modules/@types/node/http2.d.ts index e223f39..5212c9b 100644 --- a/dist/node_modules/@types/node/http2.d.ts +++ b/dist/node_modules/@types/node/http2.d.ts @@ -6,7 +6,7 @@ * const http2 = require('node:http2'); * ``` * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http2.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http2.js) */ declare module "http2" { import EventEmitter = require("node:events"); @@ -55,6 +55,7 @@ declare module "http2" { length: number; } export interface ServerStreamFileResponseOptions { + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; waitForTrailers?: boolean | undefined; offset?: number | undefined; @@ -95,7 +96,7 @@ declare module "http2" { */ readonly endAfterHeaders: boolean; /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. + * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` if the stream identifier has not yet been assigned. * @since v8.4.0 */ readonly id?: number | undefined; @@ -108,7 +109,7 @@ declare module "http2" { /** * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. + * calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed. * @since v8.4.0 */ readonly rstCode: number; @@ -135,7 +136,7 @@ declare module "http2" { */ readonly session: Http2Session | undefined; /** - * Provides miscellaneous information about the current state of the`Http2Stream`. + * Provides miscellaneous information about the current state of the `Http2Stream`. * * A current state of this `Http2Stream`. * @since v8.4.0 @@ -354,7 +355,7 @@ declare module "http2" { /** * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. + * accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`. * @since v8.4.0 */ readonly pushAllowed: boolean; @@ -364,7 +365,7 @@ declare module "http2" { */ additionalHeaders(headers: OutgoingHttpHeaders): void; /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. + * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument. * * ```js * const http2 = require('node:http2'); @@ -381,7 +382,7 @@ declare module "http2" { * ``` * * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. + * a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams. * * Calling `http2stream.pushStream()` from within a pushed stream is not permitted * and will throw an error. @@ -412,7 +413,7 @@ declare module "http2" { * used to sent trailing header fields to the peer. * * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`. * * ```js * const http2 = require('node:http2'); @@ -458,7 +459,7 @@ declare module "http2" { * * The optional `options.statCheck` function may be specified to give user code * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to + * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will perform an `fs.fstat()` call to * collect details on the provided file descriptor. * * The `offset` and `length` options may be used to limit the response to a @@ -477,7 +478,7 @@ declare module "http2" { * header fields to the peer. * * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`. * * ```js * const http2 = require('node:http2'); @@ -520,7 +521,7 @@ declare module "http2" { * an opportunity to set additional content headers based on the `fs.Stat` details * of the given file: * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is + * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. If the `onError` callback is * defined, then it will be called. Otherwise * the stream will be destroyed. * @@ -558,7 +559,7 @@ declare module "http2" { * * The `options.statCheck` function may also be used to cancel the send operation * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: + * results to determine if the file has been modified to return an appropriate `304` response: * * ```js * const http2 = require('node:http2'); @@ -646,18 +647,18 @@ declare module "http2" { /** * Value will be `undefined` if the `Http2Session` is not yet connected to a * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. + * will return the value of the connected `TLSSocket`'s own `alpnProtocol` property. * @since v9.4.0 */ readonly alpnProtocol?: string | undefined; /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. + * Will be `true` if this `Http2Session` instance has been closed, otherwise `false`. * @since v9.4.0 */ readonly closed: boolean; /** * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. + * to `false` before emitting `connect` event and/or calling the `http2.connect` callback. * @since v10.0.0 */ readonly connecting: boolean; @@ -676,7 +677,7 @@ declare module "http2" { */ readonly encrypted?: boolean | undefined; /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. + * A prototype-less object describing the current local settings of this `Http2Session`. The local settings are local to _this_`Http2Session` instance. * @since v8.4.0 */ readonly localSettings: Settings; @@ -691,7 +692,7 @@ declare module "http2" { readonly originSet?: string[] | undefined; /** * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. + * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. Will be `false` once all sent `SETTINGS` frames have been acknowledged. * @since v8.4.0 */ readonly pendingSettingsAck: boolean; @@ -721,7 +722,7 @@ declare module "http2" { */ readonly state: SessionState; /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a + * The `http2session.type` will be equal to `http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a * client. * @since v8.4.0 @@ -738,11 +739,11 @@ declare module "http2" { */ close(callback?: () => void): void; /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. + * Immediately terminates the `Http2Session` and the associated `net.Socket` or `tls.TLSSocket`. * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. + * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error` is not undefined, an `'error'` event will be emitted immediately before the `'close'` event. * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. + * If there are any remaining open `Http2Streams` associated with the `Http2Session`, those will also be destroyed. * @since v8.4.0 * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. @@ -758,17 +759,17 @@ declare module "http2" { goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; /** * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. + * be provided. The method will return `true` if the `PING` was sent, `false` otherwise. * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. + * The maximum number of outstanding (unacknowledged) pings is determined by the `maxOutstandingPings` configuration option. The default maximum is 10. * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and + * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView` containing 8 bytes of data that will be transmitted with the `PING` and * returned with the ping acknowledgment. * * The callback will be invoked with three arguments: an error argument that will * be `null` if the `PING` was successfully acknowledged, a `duration` argument * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. + * acknowledgment was received, and a `Buffer` containing the 8-byte `PING` payload. * * ```js * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { @@ -790,7 +791,7 @@ declare module "http2" { callback: (err: Error | null, duration: number, payload: Buffer) => void, ): boolean; /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. + * Calls `ref()` on this `Http2Session` instance's underlying `net.Socket`. * @since v9.4.0 */ ref(): void; @@ -821,9 +822,9 @@ declare module "http2" { */ setTimeout(msecs: number, callback?: () => void): void; /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. + * Updates the current local settings for this `Http2Session` and sends a new `SETTINGS` frame to the connected HTTP/2 peer. * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new + * Once called, the `http2session.pendingSettingsAck` property will be `true` while the session is waiting for the remote peer to acknowledge the new * settings. * * The new settings will not become effective until the `SETTINGS` acknowledgment @@ -916,15 +917,15 @@ declare module "http2" { } export interface ClientHttp2Session extends Http2Session { /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an + * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an * HTTP/2 request to the connected server. * * When a `ClientHttp2Session` is first created, the socket may not yet be * connected. if `clienthttp2session.request()` is called during this time, the * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. + * If the `session` is closed before the actual request be executed, an `ERR_HTTP2_GOAWAY_SESSION` is thrown. * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. + * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`. * * ```js * const http2 = require('node:http2'); @@ -977,7 +978,7 @@ declare module "http2" { ): this; addListener(event: string | symbol, listener: (...args: any[]) => void): this; emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: ReadonlyArray): boolean; + emit(event: "origin", origins: readonly string[]): boolean; emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; emit( event: "stream", @@ -1107,7 +1108,7 @@ declare module "http2" { * ``` * * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given + * origin will be derived. For instance, the origin for the HTTP URL `'https://example.org/foo/bar'` is the ASCII string` 'https://example.org'`. An error will be thrown if either the given * string * cannot be parsed as a URL or if a valid origin cannot be derived. * @@ -1197,6 +1198,7 @@ declare module "http2" { paddingStrategy?: number | undefined; peerMaxConcurrentStreams?: number | undefined; settings?: Settings | undefined; + remoteCustomSettings?: number[] | undefined; /** * Specifies a timeout in milliseconds that * a server should wait when an [`'unknownProtocol'`][] is emitted. If the @@ -1415,7 +1417,7 @@ declare module "http2" { stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, - rawHeaders: ReadonlyArray, + rawHeaders: readonly string[], ); /** * The `request.aborted` property will be `true` if the request has @@ -1425,7 +1427,7 @@ declare module "http2" { readonly aborted: boolean; /** * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. + * to set either `:authority` or `host`, this value is derived from `req.headers[':authority']` if present. Otherwise, it is derived from `req.headers['host']`. * @since v8.4.0 */ readonly authority: string; @@ -1472,9 +1474,9 @@ declare module "http2" { readonly headers: IncomingHttpHeaders; /** * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. + * client response, the HTTP version of the connected-to server. Returns `'2.0'`. * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. * @since v8.4.0 */ readonly httpVersion: string; @@ -1529,11 +1531,11 @@ declare module "http2" { * `destroyed`, `readable`, and `writable` properties will be retrieved from and * set on `request.stream`. * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `request.stream`. * * `setTimeout` method will be called on `request.stream.session`. * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for * more information. * * All other interactions will be routed directly to the socket. With TLS support, @@ -1596,7 +1598,7 @@ declare module "http2" { * the response object. * * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a + * the server, then `Http2Stream`s are destroyed when they time out. If a * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. * @since v8.4.0 */ @@ -1658,6 +1660,28 @@ declare module "http2" { * @deprecated Since v13.0.0 - Use `socket`. */ readonly connection: net.Socket | tls.TLSSocket; + /** + * Append a single header value to the header object. + * + * If the value is an array, this is equivalent to calling this method multiple times. + * + * If there were no previous values for the header, this is equivalent to calling {@link setHeader}. + * + * Attempting to set a header field name or value that contains invalid characters will result in a + * [TypeError](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-typeerror) being thrown. + * + * ```js + * // Returns headers including "set-cookie: a" and "set-cookie: b" + * const server = http2.createServer((req, res) => { + * res.setHeader('set-cookie', 'a'); + * res.appendHeader('set-cookie', 'b'); + * res.writeHead(200); + * res.end('ok'); + * }); + * ``` + * @since v20.12.0 + */ + appendHeader(name: string, value: string | string[]): void; /** * Boolean value that indicates whether the response has completed. Starts * as `false`. After `response.end()` executes, the value will be `true`. @@ -1682,11 +1706,11 @@ declare module "http2" { * `destroyed`, `readable`, and `writable` properties will be retrieved from and * set on `response.stream`. * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `response.stream`. * * `setTimeout` method will be called on `response.stream.session`. * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for * more information. * * All other interactions will be routed directly to the socket. @@ -1790,7 +1814,7 @@ declare module "http2" { * header names and the values are the respective header values. All header names * are lowercase. * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * The object returned by the `response.getHeaders()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, * `obj.hasOwnProperty()`, and others * are not defined and _will not work_. * @@ -1856,7 +1880,7 @@ declare module "http2" { * ``` * @since v8.4.0 */ - setHeader(name: string, value: number | string | ReadonlyArray): void; + setHeader(name: string, value: number | string | readonly string[]): void; /** * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is * provided, then it is added as a listener on the `'timeout'` event on @@ -1864,7 +1888,7 @@ declare module "http2" { * * If no `'timeout'` listener is added to the request, the response, or * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly. * @since v8.4.0 */ setTimeout(msecs: number, callback?: () => void): void; @@ -1900,7 +1924,7 @@ declare module "http2" { write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; /** * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. + * should be sent. See the `'checkContinue'` event on `Http2Server` and `Http2SecureServer`. * @since v8.4.0 */ writeContinue(): void; @@ -1951,7 +1975,7 @@ declare module "http2" { * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a * given encoding. On outbound messages, Node.js does not check if Content-Length * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. + * receiving messages, Node.js will automatically reject messages when the `Content-Length` does not match the actual payload size. * * This method may be called at most one time on a message before `response.end()` is called. * @@ -2093,7 +2117,13 @@ declare module "http2" { const HTTP2_HEADER_ACCEPT_LANGUAGE: string; const HTTP2_HEADER_ACCEPT_RANGES: string; const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: string; const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: string; + const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: string; + const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: string; const HTTP2_HEADER_AGE: string; const HTTP2_HEADER_ALLOW: string; const HTTP2_HEADER_AUTHORIZATION: string; @@ -2251,7 +2281,7 @@ declare module "http2" { */ export const sensitiveHeaders: symbol; /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called + * Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called * so instances returned may be safely modified for use. * @since v8.4.0 */ @@ -2280,7 +2310,7 @@ declare module "http2" { */ export function getUnpackedSettings(buf: Uint8Array): Settings; /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. + * Returns a `net.Server` instance that creates and manages `Http2Session` instances. * * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when * communicating @@ -2316,7 +2346,7 @@ declare module "http2" { onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, ): Http2Server; /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. + * Returns a `tls.Server` instance that creates and manages `Http2Session` instances. * * ```js * const http2 = require('node:http2'); @@ -2375,6 +2405,13 @@ declare module "http2" { options?: ClientSessionOptions | SecureClientSessionOptions, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, ): ClientHttp2Session; + /** + * Create an HTTP/2 server session from an existing socket. + * @param socket A Duplex Stream + * @param options Any `{@link createServer}` options can be provided. + * @since v20.12.0 + */ + export function performServerHandshake(socket: stream.Duplex, options?: ServerOptions): ServerHttp2Session; } declare module "node:http2" { export * from "http2"; diff --git a/dist/node_modules/@types/node/https.d.ts b/dist/node_modules/@types/node/https.d.ts index 36ae5b2..76c6d73 100644 --- a/dist/node_modules/@types/node/https.d.ts +++ b/dist/node_modules/@types/node/https.d.ts @@ -1,7 +1,7 @@ /** * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a * separate module. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/https.js) */ declare module "https" { import { Duplex } from "node:stream"; @@ -324,8 +324,8 @@ declare module "https" { /** * Makes a request to a secure web server. * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. + * The following additional `options` from `tls.connect()` are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, + * `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`. * * `options` can be an object, a string, or a `URL` object. If `options` is a * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. diff --git a/dist/node_modules/@types/node/index.d.ts b/dist/node_modules/@types/node/index.d.ts index a596cad..f043abe 100644 --- a/dist/node_modules/@types/node/index.d.ts +++ b/dist/node_modules/@types/node/index.d.ts @@ -66,6 +66,7 @@ /// /// /// +/// /// /// /// diff --git a/dist/node_modules/@types/node/inspector.d.ts b/dist/node_modules/@types/node/inspector.d.ts index 3927b81..012eb74 100644 --- a/dist/node_modules/@types/node/inspector.d.ts +++ b/dist/node_modules/@types/node/inspector.d.ts @@ -20,7 +20,7 @@ * ```js * import * as inspector from 'node:inspector'; * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/inspector.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/inspector.js) */ declare module 'inspector' { import EventEmitter = require('node:events'); @@ -2694,13 +2694,13 @@ declare module 'inspector' { prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; } /** - * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has + * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has * started. * * If wait is `true`, will block until a client has connected to the inspect port * and flow control has been passed to the debugger client. * - * See the `security warning` regarding the `host`parameter usage. + * See the `security warning` regarding the `host` parameter usage. * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. * @param [wait=false] Block until a client has connected. Optional. @@ -2731,7 +2731,7 @@ declare module 'inspector' { */ function url(): string | undefined; /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. + * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command. * * An exception will be thrown if there is no active inspector. * @since v12.7.0 @@ -2742,6 +2742,5 @@ declare module 'inspector' { * The inspector module provides an API for interacting with the V8 inspector. */ declare module 'node:inspector' { - import inspector = require('inspector'); - export = inspector; + export * from 'inspector'; } diff --git a/dist/node_modules/@types/node/module.d.ts b/dist/node_modules/@types/node/module.d.ts index d8d0593..c38a9b8 100644 --- a/dist/node_modules/@types/node/module.d.ts +++ b/dist/node_modules/@types/node/module.d.ts @@ -122,7 +122,9 @@ declare module "module" { */ findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; } - interface ImportAssertions extends NodeJS.Dict { + /** @deprecated Use `ImportAttributes` instead */ + interface ImportAssertions extends ImportAttributes {} + interface ImportAttributes extends NodeJS.Dict { type?: string | undefined; } type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; @@ -154,10 +156,14 @@ declare module "module" { * Export conditions of the relevant `package.json` */ conditions: string[]; + /** + * @deprecated Use `importAttributes` instead + */ + importAssertions: ImportAttributes; /** * An object whose key-value pairs represent the assertions for the module to import */ - importAssertions: ImportAssertions; + importAttributes: ImportAttributes; /** * The module importing this one, or undefined if this is the Node.js entry point */ @@ -169,9 +175,13 @@ declare module "module" { */ format?: ModuleFormat | null | undefined; /** - * The import assertions to use when caching the module (optional; if excluded the input will be used) + * @deprecated Use `importAttributes` instead + */ + importAssertions?: ImportAttributes | undefined; + /** + * The import attributes to use when caching the module (optional; if excluded the input will be used) */ - importAssertions?: ImportAssertions | undefined; + importAttributes?: ImportAttributes | undefined; /** * A signal that this hook intends to terminate the chain of `resolve` hooks. * @default false @@ -208,10 +218,14 @@ declare module "module" { * The format optionally supplied by the `resolve` hook chain */ format: ModuleFormat; + /** + * @deprecated Use `importAttributes` instead + */ + importAssertions: ImportAttributes; /** * An object whose key-value pairs represent the assertions for the module to import */ - importAssertions: ImportAssertions; + importAttributes: ImportAttributes; } interface LoadFnOutput { format: ModuleFormat; @@ -262,6 +276,20 @@ declare module "module" { } global { interface ImportMeta { + /** + * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. + * **Caveat:** only present on `file:` modules. + */ + dirname: string; + /** + * The full absolute path and filename of the current module, with symlinks resolved. + * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. + * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. + */ + filename: string; + /** + * The absolute `file:` URL of the module. + */ url: string; /** * Provides a module-relative resolution function scoped to each module, returning diff --git a/dist/node_modules/@types/node/net.d.ts b/dist/node_modules/@types/node/net.d.ts index 70789e1..238c6a6 100644 --- a/dist/node_modules/@types/node/net.d.ts +++ b/dist/node_modules/@types/node/net.d.ts @@ -10,7 +10,7 @@ * ```js * const net = require('node:net'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/net.js) */ declare module "net" { import * as stream from "node:stream"; @@ -18,8 +18,8 @@ declare module "net" { import * as dns from "node:dns"; type LookupFunction = ( hostname: string, - options: dns.LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void, + options: dns.LookupOptions, + callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, ) => void; interface AddressInfo { address: string; @@ -278,7 +278,7 @@ declare module "net" { */ readonly bytesWritten: number; /** - * If `true`,`socket.connect(options[, connectListener])` was + * If `true`, `socket.connect(options[, connectListener])` was * called and has not yet finished. It will stay `true` until the socket becomes * connected, then it is set to `false` and the `'connect'` event is emitted. Note * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. @@ -363,17 +363,29 @@ declare module "net" { * events.EventEmitter * 1. close * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. ready - * 9. timeout + * 3. connectionAttempt + * 4. connectionAttemptFailed + * 5. connectionAttemptTimeout + * 6. data + * 7. drain + * 8. end + * 9. error + * 10. lookup + * 11. ready + * 12. timeout */ addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "close", listener: (hadError: boolean) => void): this; addListener(event: "connect", listener: () => void): this; + addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; + addListener( + event: "connectionAttemptFailed", + listener: (ip: string, port: number, family: number) => void, + ): this; + addListener( + event: "connectionAttemptTimeout", + listener: (ip: string, port: number, family: number) => void, + ): this; addListener(event: "data", listener: (data: Buffer) => void): this; addListener(event: "drain", listener: () => void): this; addListener(event: "end", listener: () => void): this; @@ -387,6 +399,9 @@ declare module "net" { emit(event: string | symbol, ...args: any[]): boolean; emit(event: "close", hadError: boolean): boolean; emit(event: "connect"): boolean; + emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean; + emit(event: "connectionAttemptFailed", ip: string, port: number, family: number): boolean; + emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean; emit(event: "data", data: Buffer): boolean; emit(event: "drain"): boolean; emit(event: "end"): boolean; @@ -397,6 +412,9 @@ declare module "net" { on(event: string, listener: (...args: any[]) => void): this; on(event: "close", listener: (hadError: boolean) => void): this; on(event: "connect", listener: () => void): this; + on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; + on(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this; + on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; on(event: "data", listener: (data: Buffer) => void): this; on(event: "drain", listener: () => void): this; on(event: "end", listener: () => void): this; @@ -409,6 +427,9 @@ declare module "net" { on(event: "timeout", listener: () => void): this; once(event: string, listener: (...args: any[]) => void): this; once(event: "close", listener: (hadError: boolean) => void): this; + once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; + once(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this; + once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; once(event: "connect", listener: () => void): this; once(event: "data", listener: (data: Buffer) => void): this; once(event: "drain", listener: () => void): this; @@ -423,6 +444,15 @@ declare module "net" { prependListener(event: string, listener: (...args: any[]) => void): this; prependListener(event: "close", listener: (hadError: boolean) => void): this; prependListener(event: "connect", listener: () => void): this; + prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; + prependListener( + event: "connectionAttemptFailed", + listener: (ip: string, port: number, family: number) => void, + ): this; + prependListener( + event: "connectionAttemptTimeout", + listener: (ip: string, port: number, family: number) => void, + ): this; prependListener(event: "data", listener: (data: Buffer) => void): this; prependListener(event: "drain", listener: () => void): this; prependListener(event: "end", listener: () => void): this; @@ -436,6 +466,18 @@ declare module "net" { prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener( + event: "connectionAttempt", + listener: (ip: string, port: number, family: number) => void, + ): this; + prependOnceListener( + event: "connectionAttemptFailed", + listener: (ip: string, port: number, family: number) => void, + ): this; + prependOnceListener( + event: "connectionAttemptTimeout", + listener: (ip: string, port: number, family: number) => void, + ): this; prependOnceListener(event: "data", listener: (data: Buffer) => void): this; prependOnceListener(event: "drain", listener: () => void): this; prependOnceListener(event: "end", listener: () => void): this; @@ -522,7 +564,7 @@ declare module "net" { * * All `listen()` methods can take a `backlog` parameter to specify the maximum * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). + * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512). * * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for * details). @@ -628,7 +670,7 @@ declare module "net" { * Indicates whether or not the server is listening for connections. * @since v5.7.0 */ - listening: boolean; + readonly listening: boolean; /** * events.EventEmitter * 1. close @@ -736,6 +778,11 @@ declare module "net" { */ check(address: SocketAddress): boolean; check(address: string, type?: IPVersion): boolean; + /** + * The list of rules added to the blocklist. + * @since v15.0.0, v14.18.0 + */ + rules: readonly string[]; } interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { timeout?: number | undefined; @@ -852,13 +899,16 @@ declare module "net" { function setDefaultAutoSelectFamily(value: boolean): void; /** * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250`. - * @since v19.8.0 + * The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. + * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option. + * @since v19.8.0, v18.8.0 */ function getDefaultAutoSelectFamilyAttemptTimeout(): number; /** * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @since v19.8.0 + * @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line + * option `--network-family-autoselection-attempt-timeout`. + * @since v19.8.0, v18.8.0 */ function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; /** diff --git a/dist/node_modules/@types/node/os.d.ts b/dist/node_modules/@types/node/os.d.ts index 4fc733b..0b9a68c 100644 --- a/dist/node_modules/@types/node/os.d.ts +++ b/dist/node_modules/@types/node/os.d.ts @@ -5,17 +5,22 @@ * ```js * const os = require('node:os'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/os.js) */ declare module "os" { interface CpuInfo { model: string; speed: number; times: { + /** The number of milliseconds the CPU has spent in user mode. */ user: number; + /** The number of milliseconds the CPU has spent in nice mode. */ nice: number; + /** The number of milliseconds the CPU has spent in sys mode. */ sys: number; + /** The number of milliseconds the CPU has spent in idle mode. */ idle: number; + /** The number of milliseconds the CPU has spent in irq mode. */ irq: number; }; } @@ -75,7 +80,7 @@ declare module "os" { function totalmem(): number; /** * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable. + * The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable. * * The properties included on each object include: * @@ -229,14 +234,14 @@ declare module "os" { /** * Returns information about the currently effective user. On POSIX platforms, * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. + * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. * * The value of `homedir` returned by `os.userInfo()` is provided by the operating * system. This differs from the result of `os.homedir()`, which queries * environment variables for the home directory before falling back to the * operating system response. * - * Throws a `SystemError` if a user has no `username` or `homedir`. + * Throws a [`SystemError`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. * @since v6.0.0 */ function userInfo(options: { encoding: "buffer" }): UserInfo; @@ -387,6 +392,13 @@ declare module "os" { const WSA_E_CANCELLED: number; const WSAEREFUSED: number; } + namespace dlopen { + const RTLD_LAZY: number; + const RTLD_NOW: number; + const RTLD_GLOBAL: number; + const RTLD_LOCAL: number; + const RTLD_DEEPBIND: number; + } namespace priority { const PRIORITY_LOW: number; const PRIORITY_BELOW_NORMAL: number; @@ -397,12 +409,18 @@ declare module "os" { } } const devNull: string; + /** + * The operating system-specific end-of-line marker. + * * `\n` on POSIX + * * `\r\n` on Windows + */ const EOL: string; /** * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. + * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, + * and `'x64'`. * - * The return value is equivalent to `process.arch`. + * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v20.x/api/process.html#processarch). * @since v0.5.0 */ function arch(): string; @@ -417,7 +435,7 @@ declare module "os" { /** * Returns a string identifying the operating system platform for which * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. + * Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. * * The return value is equivalent to `process.platform`. * @@ -427,7 +445,7 @@ declare module "os" { */ function platform(): NodeJS.Platform; /** - * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. + * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`, `mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. * * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. @@ -456,15 +474,15 @@ declare module "os" { */ function getPriority(pid?: number): number; /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. + * Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used. * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range + * The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows + * priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range * mapping may cause the return value to be slightly different on Windows. To avoid * confusion, set `priority` to one of the priority constants. * * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. + * privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`. * @since v10.10.0 * @param [pid=0] The process ID to set scheduling priority for. * @param priority The scheduling priority to assign to the process. diff --git a/dist/node_modules/@types/node/package.json b/dist/node_modules/@types/node/package.json index 4403207..c78f581 100644 --- a/dist/node_modules/@types/node/package.json +++ b/dist/node_modules/@types/node/package.json @@ -1,6 +1,6 @@ { "name": "@types/node", - "version": "20.9.2", + "version": "20.14.9", "description": "TypeScript definitions for node", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -85,11 +85,6 @@ "githubUsername": "mohsen1", "url": "https://github.com/mohsen1" }, - { - "name": "Nicolas Even", - "githubUsername": "n-e", - "url": "https://github.com/n-e" - }, { "name": "Nikita Galkin", "githubUsername": "galkin", @@ -208,13 +203,6 @@ ], "main": "", "types": "index.d.ts", - "typesVersions": { - "<=4.8": { - "*": [ - "ts4.8/*" - ] - } - }, "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", @@ -224,7 +212,6 @@ "dependencies": { "undici-types": "~5.26.4" }, - "typesPublisherContentHash": "24437ac82ce1804878c3e265b2d5ef55f5f475c0333622a181647c43bd4d835e", - "typeScriptVersion": "4.5", - "nonNpm": true + "typesPublisherContentHash": "e4d1051361599ca04bc4b8596571d29434f7b5618cadeb651672ab388dae60aa", + "typeScriptVersion": "4.8" } \ No newline at end of file diff --git a/dist/node_modules/@types/node/path.d.ts b/dist/node_modules/@types/node/path.d.ts index 6f07681..0c6b46d 100644 --- a/dist/node_modules/@types/node/path.d.ts +++ b/dist/node_modules/@types/node/path.d.ts @@ -13,7 +13,7 @@ declare module "path/win32" { * ```js * const path = require('node:path'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/path.js) */ declare module "path" { namespace path { diff --git a/dist/node_modules/@types/node/perf_hooks.d.ts b/dist/node_modules/@types/node/perf_hooks.d.ts index 7ed1592..5ce7fca 100644 --- a/dist/node_modules/@types/node/perf_hooks.d.ts +++ b/dist/node_modules/@types/node/perf_hooks.d.ts @@ -27,14 +27,14 @@ * performance.measure('A to B', 'A', 'B'); * }); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/perf_hooks.js) */ declare module "perf_hooks" { import { AsyncResource } from "node:async_hooks"; type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net"; interface NodeGCPerformanceDetail { /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies + * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies * the type of garbage collection operation that occurred. * See perf_hooks.constants for valid values. */ @@ -150,6 +150,11 @@ declare module "perf_hooks" { * @since v8.5.0 */ readonly loopStart: number; + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + * @since v8.5.0 + */ + readonly nodeStart: number; /** * The high resolution millisecond timestamp at which the V8 platform was * initialized. @@ -163,12 +168,12 @@ declare module "perf_hooks" { utilization: number; } /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 + * @param utilization1 The result of a previous call to `eventLoopUtilization()`. + * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. */ type EventLoopUtilityFunction = ( - util1?: EventLoopUtilization, - util2?: EventLoopUtilization, + utilization1?: EventLoopUtilization, + utilization2?: EventLoopUtilization, ) => EventLoopUtilization; interface MarkOptions { /** @@ -177,7 +182,7 @@ declare module "perf_hooks" { detail?: unknown | undefined; /** * An optional timestamp to be used as the mark time. - * @default `performance.now()`. + * @default `performance.now()` */ startTime?: number | undefined; } @@ -201,26 +206,36 @@ declare module "perf_hooks" { } interface TimerifyOptions { /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. + * A histogram object created using `perf_hooks.createHistogram()` that will record runtime + * durations in nanoseconds. */ histogram?: RecordableHistogram | undefined; } interface Performance { /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name + * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. + * If `name` is provided, removes only the named mark. + * @since v8.5.0 */ clearMarks(name?: string): void; /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only the named measure. - * @param name + * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. + * If `name` is provided, removes only the named measure. * @since v16.7.0 */ clearMeasures(name?: string): void; + /** + * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. + * If `name` is provided, removes only the named resource. + * @since v18.2.0, v16.17.0 + */ + clearResourceTimings(name?: string): void; + /** + * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. + * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). + * No other CPU idle time is taken into consideration. + */ + eventLoopUtilization: EventLoopUtilityFunction; /** * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. * If you are only interested in performance entries of certain types or that have certain names, see @@ -244,14 +259,17 @@ declare module "perf_hooks" { */ getEntriesByType(type: EntryType): PerformanceEntry[]; /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. + * Creates a new `PerformanceMark` entry in the Performance Timeline. + * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, + * and whose `performanceEntry.duration` is always `0`. * Performance marks are used to mark specific significant moments in the Performance Timeline. + * + * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with + * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is + * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. * @param name - * @return The PerformanceMark entry that was created */ - mark(name?: string, options?: MarkOptions): PerformanceMark; + mark(name: string, options?: MarkOptions): PerformanceMark; /** * Creates a new PerformanceMeasure entry in the Performance Timeline. * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', @@ -271,31 +289,74 @@ declare module "perf_hooks" { measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; measure(name: string, options: MeasureOptions): PerformanceMeasure; /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. + * @since v8.5.0 */ readonly nodeTiming: PerformanceNodeTiming; /** - * @return the current high resolution millisecond timestamp + * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. + * @since v8.5.0 */ now(): number; /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. + * + * By default the max buffer size is set to 250. + * @since v18.8.0 + */ + setResourceTimingBufferSize(maxSize: number): void; + /** + * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp + * at which the current `node` process began, measured in Unix time. + * @since v8.5.0 */ readonly timeOrigin: number; /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * function someFunction() { + * console.log('hello world'); + * } + * + * const wrapped = performance.timerify(someFunction); + * + * const obs = new PerformanceObserver((list) => { + * console.log(list.getEntries()[0].duration); + * + * performance.clearMarks(); + * performance.clearMeasures(); + * obs.disconnect(); + * }); + * obs.observe({ entryTypes: ['function'] }); + * + * // A performance timeline entry will be created + * wrapped(); + * ``` + * + * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported + * once the finally handler is invoked. * @param fn */ timerify any>(fn: T, options?: TimerifyOptions): T; /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. + * An object which is JSON representation of the performance object. It is similar to + * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers. + * @since v16.1.0 */ - eventLoopUtilization: EventLoopUtilityFunction; + toJSON(): any; } - interface PerformanceObserverEntryList { + class PerformanceObserverEntryList { /** * Returns a list of `PerformanceEntry` objects in chronological order * with respect to `performanceEntry.startTime`. @@ -314,13 +375,15 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 81.465639, - * * duration: 0 + * * duration: 0, + * * detail: null * * }, * * PerformanceEntry { * * name: 'meow', * * entryType: 'mark', * * startTime: 81.860064, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -355,7 +418,8 @@ declare module "perf_hooks" { * * name: 'meow', * * entryType: 'mark', * * startTime: 98.545991, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -368,7 +432,8 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 63.518931, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -388,7 +453,7 @@ declare module "perf_hooks" { getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; /** * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. + * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. * * ```js * const { @@ -404,13 +469,15 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 55.897834, - * * duration: 0 + * * duration: 0, + * * detail: null * * }, * * PerformanceEntry { * * name: 'meow', * * entryType: 'mark', * * startTime: 56.350146, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -439,7 +506,7 @@ declare module "perf_hooks" { */ disconnect(): void; /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: + * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`: * * ```js * const { @@ -460,7 +527,7 @@ declare module "perf_hooks" { observe( options: | { - entryTypes: ReadonlyArray; + entryTypes: readonly EntryType[]; buffered?: boolean | undefined; } | { @@ -469,6 +536,103 @@ declare module "perf_hooks" { }, ): void; } + /** + * Provides detailed network timing data regarding the loading of an application's resources. + * + * The constructor of this class is not exposed to users directly. + * @since v18.2.0, v16.17.0 + */ + class PerformanceResourceTiming extends PerformanceEntry { + protected constructor(); + /** + * The high resolution millisecond timestamp at immediately before dispatching the `fetch` + * request. If the resource is not intercepted by a worker the property will always return 0. + * @since v18.2.0, v16.17.0 + */ + readonly workerStart: number; + /** + * The high resolution millisecond timestamp that represents the start time of the fetch which + * initiates the redirect. + * @since v18.2.0, v16.17.0 + */ + readonly redirectStart: number; + /** + * The high resolution millisecond timestamp that will be created immediately after receiving + * the last byte of the response of the last redirect. + * @since v18.2.0, v16.17.0 + */ + readonly redirectEnd: number; + /** + * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource. + * @since v18.2.0, v16.17.0 + */ + readonly fetchStart: number; + /** + * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup + * for the resource. + * @since v18.2.0, v16.17.0 + */ + readonly domainLookupStart: number; + /** + * The high resolution millisecond timestamp representing the time immediately after the Node.js finished + * the domain name lookup for the resource. + * @since v18.2.0, v16.17.0 + */ + readonly domainLookupEnd: number; + /** + * The high resolution millisecond timestamp representing the time immediately before Node.js starts to + * establish the connection to the server to retrieve the resource. + * @since v18.2.0, v16.17.0 + */ + readonly connectStart: number; + /** + * The high resolution millisecond timestamp representing the time immediately after Node.js finishes + * establishing the connection to the server to retrieve the resource. + * @since v18.2.0, v16.17.0 + */ + readonly connectEnd: number; + /** + * The high resolution millisecond timestamp representing the time immediately before Node.js starts the + * handshake process to secure the current connection. + * @since v18.2.0, v16.17.0 + */ + readonly secureConnectionStart: number; + /** + * The high resolution millisecond timestamp representing the time immediately before Node.js receives the + * first byte of the response from the server. + * @since v18.2.0, v16.17.0 + */ + readonly requestStart: number; + /** + * The high resolution millisecond timestamp representing the time immediately after Node.js receives the + * last byte of the resource or immediately before the transport connection is closed, whichever comes first. + * @since v18.2.0, v16.17.0 + */ + readonly responseEnd: number; + /** + * A number representing the size (in octets) of the fetched resource. The size includes the response header + * fields plus the response payload body. + * @since v18.2.0, v16.17.0 + */ + readonly transferSize: number; + /** + * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before + * removing any applied content-codings. + * @since v18.2.0, v16.17.0 + */ + readonly encodedBodySize: number; + /** + * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after + * removing any applied content-codings. + * @since v18.2.0, v16.17.0 + */ + readonly decodedBodySize: number; + /** + * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object + * @since v18.2.0, v16.17.0 + */ + toJSON(): any; + } namespace constants { const NODE_PERFORMANCE_GC_MAJOR: number; const NODE_PERFORMANCE_GC_MINOR: number; @@ -493,10 +657,15 @@ declare module "perf_hooks" { } interface Histogram { /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 + * The number of samples recorded by the histogram. + * @since v17.4.0, v16.14.0 */ - readonly percentiles: Map; + readonly count: number; + /** + * The number of samples recorded by the histogram. + * v17.4.0, v16.14.0 + */ + readonly countBigInt: bigint; /** * The number of times the event loop delay exceeded the maximum 1 hour event * loop delay threshold. @@ -504,36 +673,67 @@ declare module "perf_hooks" { */ readonly exceeds: number; /** - * The minimum recorded event loop delay. - * @since v11.10.0 + * The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. + * @since v17.4.0, v16.14.0 */ - readonly min: number; + readonly exceedsBigInt: bigint; /** * The maximum recorded event loop delay. * @since v11.10.0 */ readonly max: number; + /** + * The maximum recorded event loop delay. + * v17.4.0, v16.14.0 + */ + readonly maxBigInt: number; /** * The mean of the recorded event loop delays. * @since v11.10.0 */ readonly mean: number; /** - * The standard deviation of the recorded event loop delays. + * The minimum recorded event loop delay. * @since v11.10.0 */ - readonly stddev: number; + readonly min: number; /** - * Resets the collected histogram data. - * @since v11.10.0 + * The minimum recorded event loop delay. + * v17.4.0, v16.14.0 */ - reset(): void; + readonly minBigInt: bigint; /** * Returns the value at the given percentile. * @since v11.10.0 * @param percentile A percentile value in the range (0, 100]. */ percentile(percentile: number): number; + /** + * Returns the value at the given percentile. + * @since v17.4.0, v16.14.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentileBigInt(percentile: number): bigint; + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v11.10.0 + */ + readonly percentiles: Map; + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v17.4.0, v16.14.0 + */ + readonly percentilesBigInt: Map; + /** + * Resets the collected histogram data. + * @since v11.10.0 + */ + reset(): void; + /** + * The standard deviation of the recorded event loop delays. + * @since v11.10.0 + */ + readonly stddev: number; } interface IntervalHistogram extends Histogram { /** @@ -558,8 +758,6 @@ declare module "perf_hooks" { /** * Calculates the amount of time (in nanoseconds) that has passed since the * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples * @since v15.9.0, v14.18.0 */ recordDelta(): void; @@ -620,11 +818,79 @@ declare module "perf_hooks" { * @since v15.9.0, v14.18.0 */ function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { performance as _performance } from "perf_hooks"; + import { + performance as _performance, + PerformanceEntry as _PerformanceEntry, + PerformanceMark as _PerformanceMark, + PerformanceMeasure as _PerformanceMeasure, + PerformanceObserver as _PerformanceObserver, + PerformanceObserverEntryList as _PerformanceObserverEntryList, + PerformanceResourceTiming as _PerformanceResourceTiming, + } from "perf_hooks"; global { /** - * `performance` is a global reference for `require('perf_hooks').performance` - * https://nodejs.org/api/globals.html#performance + * `PerformanceEntry` is a global reference for `require('node:perf_hooks').PerformanceEntry` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceentry + * @since v19.0.0 + */ + var PerformanceEntry: typeof globalThis extends { + onmessage: any; + PerformanceEntry: infer T; + } ? T + : typeof _PerformanceEntry; + /** + * `PerformanceMark` is a global reference for `require('node:perf_hooks').PerformanceMark` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemark + * @since v19.0.0 + */ + var PerformanceMark: typeof globalThis extends { + onmessage: any; + PerformanceMark: infer T; + } ? T + : typeof _PerformanceMark; + /** + * `PerformanceMeasure` is a global reference for `require('node:perf_hooks').PerformanceMeasure` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemeasure + * @since v19.0.0 + */ + var PerformanceMeasure: typeof globalThis extends { + onmessage: any; + PerformanceMeasure: infer T; + } ? T + : typeof _PerformanceMeasure; + /** + * `PerformanceObserver` is a global reference for `require('node:perf_hooks').PerformanceObserver` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserver + * @since v19.0.0 + */ + var PerformanceObserver: typeof globalThis extends { + onmessage: any; + PerformanceObserver: infer T; + } ? T + : typeof _PerformanceObserver; + /** + * `PerformanceObserverEntryList` is a global reference for `require('node:perf_hooks').PerformanceObserverEntryList` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserverentrylist + * @since v19.0.0 + */ + var PerformanceObserverEntryList: typeof globalThis extends { + onmessage: any; + PerformanceObserverEntryList: infer T; + } ? T + : typeof _PerformanceObserverEntryList; + /** + * `PerformanceResourceTiming` is a global reference for `require('node:perf_hooks').PerformanceResourceTiming` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceresourcetiming + * @since v19.0.0 + */ + var PerformanceResourceTiming: typeof globalThis extends { + onmessage: any; + PerformanceResourceTiming: infer T; + } ? T + : typeof _PerformanceResourceTiming; + /** + * `performance` is a global reference for `require('node:perf_hooks').performance` + * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performance * @since v16.0.0 */ var performance: typeof globalThis extends { diff --git a/dist/node_modules/@types/node/process.d.ts b/dist/node_modules/@types/node/process.d.ts index 1ec9e83..5f84863 100644 --- a/dist/node_modules/@types/node/process.d.ts +++ b/dist/node_modules/@types/node/process.d.ts @@ -1,4 +1,6 @@ declare module "process" { + import * as net from "node:net"; + import * as os from "node:os"; import * as tty from "node:tty"; import { Worker } from "node:worker_threads"; global { @@ -21,10 +23,25 @@ declare module "process" { rss(): number; } interface MemoryUsage { + /** + * Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the + * process, including all C++ and JavaScript objects and code. + */ rss: number; + /** + * Refers to V8's memory usage. + */ heapTotal: number; + /** + * Refers to V8's memory usage. + */ heapUsed: number; external: number; + /** + * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included + * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s + * may not be tracked in that case. + */ arrayBuffers: number; } interface CpuUsage { @@ -64,6 +81,7 @@ declare module "process" { | "arm" | "arm64" | "ia32" + | "loong64" | "mips" | "mipsel" | "ppc" @@ -143,8 +161,53 @@ declare module "process" { } interface HRTime { (time?: [number, number]): [number, number]; + /** + * The `bigint` version of the `{@link hrtime()}` method returning the current high-resolution real time in nanoseconds as a `bigint`. + * + * Unlike `{@link hrtime()}`, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s. + * ```js + * import { hrtime } from 'node:process'; + * + * const start = hrtime.bigint(); + * // 191051479007711n + * + * setTimeout(() => { + * const end = hrtime.bigint(); + * // 191052633396993n + * + * console.log(`Benchmark took ${end - start} nanoseconds`); + * // Benchmark took 1154389282 nanoseconds + * }, 1000); + * ``` + */ bigint(): bigint; } + interface ProcessPermission { + /** + * Verifies that the process is able to access the given scope and reference. + * If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')` + * will check if the process has ALL file system read permissions. + * + * The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders. + * + * The available scopes are: + * + * * `fs` - All File System + * * `fs.read` - File System read operations + * * `fs.write` - File System write operations + * * `child` - Child process spawning operations + * * `worker` - Worker thread spawning operation + * + * ```js + * // Check if the process has permission to read the README file + * process.permission.has('fs.read', './README.md'); + * // Check if the process has read permission operations + * process.permission.has('fs.read'); + * ``` + * @since v20.0.0 + */ + has(scope: string, reference?: string): boolean; + } interface ProcessReport { /** * Directory where the report is written. @@ -306,12 +369,11 @@ declare module "process" { * For more information see `Stream compatibility`. * * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. + * must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. */ stdin: ReadStream & { fd: 0; }; - openStdin(): Socket; /** * The `process.argv` property returns an array containing the command-line * arguments passed when the Node.js process was launched. The first element will @@ -371,13 +433,13 @@ declare module "process" { * the same execution environment as the parent. * * ```bash - * node --harmony script.js --version + * node --icu-data-dir=./foo --require ./bar.js script.js --version * ``` * * Results in `process.execArgv`: * * ```js - * ['--harmony'] + * ["--icu-data-dir=./foo", "--require", "./bar.js"] * ``` * * And `process.argv`: @@ -453,6 +515,32 @@ declare module "process" { * @since v0.7.2 */ debugPort: number; + /** + * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and + * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()` + * unless there are specific reasons such as custom dlopen flags or loading from ES modules. + * + * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v20.x/api/os.html#dlopen-constants)` + * documentation for details. + * + * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon + * are then accessible via `module.exports`. + * + * The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant. + * In this example the constant is assumed to be available. + * + * ```js + * import { dlopen } from 'node:process'; + * import { constants } from 'node:os'; + * import { fileURLToPath } from 'node:url'; + * + * const module = { exports: {} }; + * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)), + * constants.dlopen.RTLD_NOW); + * module.exports.foo(); + * ``` + */ + dlopen(module: object, filename: string, flags?: number): void; /** * The `process.emitWarning()` method can be used to emit custom or application * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. @@ -460,17 +548,27 @@ declare module "process" { * ```js * import { emitWarning } from 'node:process'; * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information', - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information + * // Emit a warning using a string. + * emitWarning('Something happened!'); + * // Emits: (node: 56338) Warning: Something happened! * ``` * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning using a string and a type. + * emitWarning('Something Happened!', 'CustomWarning'); + * // Emits: (node:56338) CustomWarning: Something Happened! + * ``` + * + * ```js + * import { emitWarning } from 'node:process'; + * + * emitWarning('Something happened!', 'CustomWarning', 'WARN001'); + * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! + * ```js + * + * In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler. * * ```js * import process from 'node:process'; @@ -484,7 +582,30 @@ declare module "process" { * }); * ``` * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. + * If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler + * unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored): + * + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning using an Error object. + * const myWarning = new Error('Something happened!'); + * // Use the Error name property to specify the type name + * myWarning.name = 'CustomWarning'; + * myWarning.code = 'WARN001'; + * + * emitWarning(myWarning); + * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! + * ``` + * + * A `TypeError` is thrown if `warning` is anything other than a string or `Error` object. + * + * While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms. + * + * The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`: + * * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event. + * * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed. + * * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace. * @since v8.0.0 * @param warning The warning to emit. */ @@ -572,7 +693,7 @@ declare module "process" { * parent thread's `process.env`, or whatever was specified as the `env` option * to the `Worker` constructor. Changes to `process.env` will not be visible * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner + * are visible to the operating system or to native add-ons. On Windows, a copy of `process.env` on a `Worker` instance operates in a case-sensitive manner * unlike the main thread. * @since v0.1.27 */ @@ -596,13 +717,13 @@ declare module "process" { * * Calling `process.exit()` will force the process to exit as quickly as possible * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. + * completed fully, including I/O operations to `process.stdout` and `process.stderr`. * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ + * In most situations, it is not actually necessary to call `process.exit()` explicitly. The Node.js process will exit on its own _if there is no additional_ * _work pending_ in the event loop. The `process.exitCode` property can be set to * tell the process which exit code to use when the process exits gracefully. * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being + * For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being * truncated and lost: * * ```js @@ -619,7 +740,7 @@ declare module "process" { * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding + * Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding * scheduling any additional work for the event loop: * * ```js @@ -642,7 +763,7 @@ declare module "process" { * @since v0.1.13 * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. */ - exit(code?: number): never; + exit(code?: number | string | null | undefined): never; /** * A number which will be the process exit code, when the process either * exits gracefully, or is exited via {@link exit} without specifying @@ -650,15 +771,34 @@ declare module "process" { * * Specifying a code to {@link exit} will override any * previous setting of `process.exitCode`. + * @default undefined * @since v0.11.8 */ - exitCode?: number | undefined; + exitCode?: number | string | number | undefined; + /** + * The `process.getActiveResourcesInfo()` method returns an array of strings containing + * the types of the active resources that are currently keeping the event loop alive. + * + * ```js + * import { getActiveResourcesInfo } from 'node:process'; + * import { setTimeout } from 'node:timers'; + + * console.log('Before:', getActiveResourcesInfo()); + * setTimeout(() => {}, 1000); + * console.log('After:', getActiveResourcesInfo()); + * // Prints: + * // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ] + * // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] + * ``` + * @since v17.3.0, v16.14.0 + */ + getActiveResourcesInfo(): string[]; /** * The `process.getgid()` method returns the numerical group identity of the * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getgid) { * console.log(`Current gid: ${process.getgid()}`); @@ -677,7 +817,7 @@ declare module "process" { * associated numeric ID. * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getgid && process.setgid) { * console.log(`Current gid: ${process.getgid()}`); @@ -702,7 +842,7 @@ declare module "process" { * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getuid) { * console.log(`Current uid: ${process.getuid()}`); @@ -721,7 +861,7 @@ declare module "process" { * numeric ID. * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getuid && process.setuid) { * console.log(`Current uid: ${process.getuid()}`); @@ -745,7 +885,7 @@ declare module "process" { * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.geteuid) { * console.log(`Current uid: ${process.geteuid()}`); @@ -764,7 +904,7 @@ declare module "process" { * associated numeric ID. * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.geteuid && process.seteuid) { * console.log(`Current uid: ${process.geteuid()}`); @@ -789,7 +929,7 @@ declare module "process" { * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getegid) { * console.log(`Current gid: ${process.getegid()}`); @@ -808,7 +948,7 @@ declare module "process" { * the associated a numeric ID. * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getegid && process.setegid) { * console.log(`Current gid: ${process.getegid()}`); @@ -834,7 +974,7 @@ declare module "process" { * Node.js ensures it always is. * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getgroups) { * console.log(process.getgroups()); // [ 16, 21, 297 ] @@ -854,7 +994,7 @@ declare module "process" { * The `groups` array can contain numeric group IDs, group names, or both. * * ```js - * import process from 'process'; + * import process from 'node:process'; * * if (process.getgroups && process.setgroups) { * try { @@ -883,7 +1023,7 @@ declare module "process" { * not abort. Actions configured to take place on exceptions such as report * generations will be affected too * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this + * To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this * method with a non-`null` argument while another capture function is set will * throw an error. * @@ -902,6 +1042,18 @@ declare module "process" { * @experimental */ readonly sourceMapsEnabled: boolean; + /** + * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for + * stack traces. + * + * It provides same features as launching Node.js process with commandline options `--enable-source-maps`. + * + * Only source maps in JavaScript files that are loaded after source maps has been + * enabled will be parsed and loaded. + * @since v16.6.0, v14.18.0 + * @experimental + */ + setSourceMapsEnabled(value: boolean): void; /** * The `process.version` property contains the Node.js version string. * @@ -1032,6 +1184,21 @@ declare module "process" { * @param [signal='SIGTERM'] The signal to send, either as a string or number. */ kill(pid: number, signal?: string | number): true; + /** + * Loads the environment configuration from a `.env` file into `process.env`. If + * the file is not found, error will be thrown. + * + * To load a specific .env file by specifying its path, use the following code: + * + * ```js + * import { loadEnvFile } from 'node:process'; + * + * loadEnvFile('./development.env') + * ``` + * @since v20.12.0 + * @param path The path to the .env file + */ + loadEnvFile(path?: string | URL | Buffer): void; /** * The `process.pid` property returns the PID of the process. * @@ -1063,8 +1230,8 @@ declare module "process" { * When a new value is assigned, different platforms will impose different maximum * length restrictions on the title. Usually such restrictions are quite limited. * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) + * binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 + * allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) * cases. * * Assigning a value to `process.title` might not result in an accurate label @@ -1075,7 +1242,7 @@ declare module "process" { title: string; /** * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. + * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. * * ```js * import { arch } from 'node:process'; @@ -1126,14 +1293,21 @@ declare module "process" { /** * Gets the amount of memory available to the process (in bytes) based on * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `undefined` is returned. + * is unknown, `0` is returned. * * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more * information. * @since v19.6.0, v18.15.0 * @experimental */ - constrainedMemory(): number | undefined; + constrainedMemory(): number; + /** + * Gets the amount of free memory that is still available to the process (in bytes). + * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v20.x/api/process.html#processavailablememory) for more information. + * @experimental + * @since v20.13.0 + */ + availableMemory(): number; /** * The `process.cpuUsage()` method returns the user and system CPU time usage of * the current process, in an object with properties `user` and `system`, whose @@ -1250,6 +1424,14 @@ declare module "process" { * @param args Additional arguments to pass when invoking the `callback` */ nextTick(callback: Function, ...args: any[]): void; + /** + * This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-permission) flag. + * + * `process.permission` is an object whose methods are used to manage permissions for the current process. + * Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model). + * @since v20.0.0 + */ + permission: ProcessPermission; /** * The `process.release` property returns an `Object` containing metadata related * to the current release, including URLs for the source tarball and headers-only @@ -1267,7 +1449,7 @@ declare module "process" { * } * ``` * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be + * In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be * relied upon to exist. * @since v3.0.0 */ @@ -1286,7 +1468,7 @@ declare module "process" { * `process.umask()` returns the Node.js process's file mode creation mask. Child * processes inherit the mask from the parent process. * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * + * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * security vulnerability. There is no safe, cross-platform alternative API. */ umask(): number; @@ -1304,6 +1486,23 @@ declare module "process" { */ uptime(): number; hrtime: HRTime; + /** + * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. + * If no IPC channel exists, this property is undefined. + * @since v7.1.0 + */ + channel?: { + /** + * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before. + * @since v7.1.0 + */ + ref(): void; + /** + * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open. + * @since v7.1.0 + */ + unref(): void; + }; /** * If Node.js is spawned with an IPC channel, the `process.send()` method can be * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. @@ -1313,13 +1512,13 @@ declare module "process" { * The message goes through serialization and parsing. The resulting message might * not be the same as what is originally sent. * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: + * @param options used to parameterize the sending of certain types of handles. `options` supports the following properties: */ send?( message: any, sendHandle?: any, options?: { - swallowErrors?: boolean | undefined; + keepOpen?: boolean | undefined; }, callback?: (error: Error | null) => void, ): boolean; @@ -1330,13 +1529,13 @@ declare module "process" { * * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. + * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. * @since v0.7.2 */ disconnect(): void; /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC + * channel is connected and will return `false` after `process.disconnect()` is called. * * Once `process.connected` is `false`, it is no longer possible to send messages * over the IPC channel using `process.send()`. @@ -1347,11 +1546,11 @@ declare module "process" { * The `process.allowedNodeEnvironmentFlags` property is a special, * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag + * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag * representations. `process.allowedNodeEnvironmentFlags.has()` will * return `true` in the following cases: * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. + * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`. * * Flags passed through to V8 (as listed in `--v8-options`) may replace * one or more _non-leading_ dashes for an underscore, or vice-versa; * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, @@ -1423,7 +1622,30 @@ declare module "process" { */ resourceUsage(): ResourceUsage; /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the + * The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation` + * is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the 'warning' event and the emitWarning() + * method for more information. + * + * ```bash + * $ node --throw-deprecation -p "process.throwDeprecation" + * true + * $ node -p "process.throwDeprecation" + * undefined + * $ node + * > process.emitWarning('test', 'DeprecationWarning'); + * undefined + * > (node:26598) DeprecationWarning: test + * > process.throwDeprecation = true; + * true + * > process.emitWarning('test', 'DeprecationWarning'); + * Thrown: + * [DeprecationWarning: test] { name: 'DeprecationWarning' } + * ``` + * @since v0.9.12 + */ + throwDeprecation: boolean; + /** + * The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the * documentation for the `'warning' event` and the `emitWarning() method` for more information about this * flag's behavior. * @since v0.8.0 diff --git a/dist/node_modules/@types/node/punycode.d.ts b/dist/node_modules/@types/node/punycode.d.ts index 64ddd3e..137441d 100644 --- a/dist/node_modules/@types/node/punycode.d.ts +++ b/dist/node_modules/@types/node/punycode.d.ts @@ -1,5 +1,5 @@ /** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users + * **The version of the punycode module bundled in Node.js is being deprecated. **In a future major version of Node.js this module will be removed. Users * currently depending on the `punycode` module should switch to using the * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. @@ -15,8 +15,8 @@ * primarily intended for use in Internationalized Domain Names. Because host * names in URLs are limited to ASCII characters only, Domain Names that contain * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. + * For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent + * to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`. * * The `punycode` module provides a simple implementation of the Punycode standard. * @@ -24,7 +24,7 @@ * made available to developers as a convenience. Fixes or other modifications to * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/punycode.js) */ declare module "punycode" { /** @@ -101,7 +101,7 @@ declare module "punycode" { * Users currently depending on the punycode module should switch to using * the userland-provided Punycode.js module instead. */ - encode(codePoints: ReadonlyArray): string; + encode(codePoints: readonly number[]): string; } /** * @deprecated since v7.0.0 diff --git a/dist/node_modules/@types/node/querystring.d.ts b/dist/node_modules/@types/node/querystring.d.ts index 388ebc3..bd494a6 100644 --- a/dist/node_modules/@types/node/querystring.d.ts +++ b/dist/node_modules/@types/node/querystring.d.ts @@ -9,14 +9,26 @@ * `querystring` is more performant than `URLSearchParams` but is not a * standardized API. Use `URLSearchParams` when performance is not critical or * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/querystring.js) */ declare module "querystring" { interface StringifyOptions { + /** + * The function to use when converting URL-unsafe characters to percent-encoding in the query string. + * @default `querystring.escape()` + */ encodeURIComponent?: ((str: string) => string) | undefined; } interface ParseOptions { + /** + * Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. + * @default 1000 + */ maxKeys?: number | undefined; + /** + * The function to use when decoding percent-encoded characters in the query string. + * @default `querystring.unescape()` + */ decodeURIComponent?: ((str: string) => string) | undefined; } interface ParsedUrlQuery extends NodeJS.Dict {} @@ -25,9 +37,9 @@ declare module "querystring" { | string | number | boolean - | ReadonlyArray - | ReadonlyArray - | ReadonlyArray + | readonly string[] + | readonly number[] + | readonly boolean[] | null > {} @@ -35,7 +47,7 @@ declare module "querystring" { * The `querystring.stringify()` method produces a URL query string from a * given `obj` by iterating through the object's "own properties". * - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * It serializes the following types of values passed in `obj`: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | @@ -54,7 +66,7 @@ declare module "querystring" { * ``` * * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: + * be encoded as UTF-8\. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified: * * ```js * // Assuming gbkEncodeURIComponent function already exists, @@ -74,14 +86,14 @@ declare module "querystring" { * * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: * - * ```js + * ```json * { - * foo: 'bar', - * abc: ['xyz', '123'] + * "foo": "bar", + * "abc": ["xyz", "123"] * } * ``` * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * The object returned by the `querystring.parse()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, * `obj.hasOwnProperty()`, and others * are not defined and _will not work_. * @@ -98,7 +110,7 @@ declare module "querystring" { * @since v0.1.25 * @param str The URL query string to parse * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. + * @param [eq='='] The substring used to delimit keys and values in the query string. */ function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; /** @@ -110,7 +122,7 @@ declare module "querystring" { */ const decode: typeof parse; /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL + * The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL * query strings. * * The `querystring.escape()` method is used by `querystring.stringify()` and is diff --git a/dist/node_modules/@types/node/readline.d.ts b/dist/node_modules/@types/node/readline.d.ts index b06d58b..06e1705 100644 --- a/dist/node_modules/@types/node/readline.d.ts +++ b/dist/node_modules/@types/node/readline.d.ts @@ -1,5 +1,6 @@ /** - * The `node:readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. + * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream + * (such as [`process.stdin`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdin)) one line at a time. * * To use the promise-based APIs: * @@ -13,7 +14,7 @@ * import * as readline from 'node:readline'; * ``` * - * The following simple example illustrates the basic use of the `node:readline`module. + * The following simple example illustrates the basic use of the `node:readline` module. * * ```js * import * as readline from 'node:readline/promises'; @@ -28,9 +29,9 @@ * rl.close(); * ``` * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be + * Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/readline.js) */ declare module "readline" { import { Abortable, EventEmitter } from "node:events"; @@ -44,8 +45,8 @@ declare module "readline" { shift?: boolean | undefined; } /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. + * Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a + * single `input` [Readable](https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v20.x/api/stream.html#writable-streams) stream. * The `output` stream is used to print prompts for user input that arrives on, * and is read from, the `input` stream. * @since v0.1.104 @@ -123,7 +124,7 @@ declare module "readline" { */ getPrompt(): string; /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. + * The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. * @since v0.1.98 */ setPrompt(prompt: string): void; @@ -134,19 +135,19 @@ declare module "readline" { * When called, `rl.prompt()` will resume the `input` stream if it has been * paused. * - * If the `Interface` was created with `output` set to `null` or`undefined` the prompt is not written. + * If the `Interface` was created with `output` set to `null` or `undefined` the prompt is not written. * @since v0.1.98 * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. */ prompt(preserveCursor?: boolean): void; /** * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. * * When called, `rl.question()` will resume the `input` stream if it has been * paused. * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. * * The `callback` function passed to `rl.question()` does not follow the typical * pattern of accepting an `Error` object or `null` as the first argument. @@ -188,7 +189,7 @@ declare module "readline" { * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed * later if necessary. * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `Interface` instance. + * Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `Interface` instance. * @since v0.3.4 */ pause(): this; @@ -218,7 +219,7 @@ declare module "readline" { * When called, `rl.write()` will resume the `input` stream if it has been * paused. * - * If the `Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. + * If the `Interface` was created with `output` set to `null` or `undefined` the `data` and `key` are not written. * * ```js * rl.write('Delete this!'); @@ -226,7 +227,7 @@ declare module "readline" { * rl.write(null, { ctrl: true, name: 'u' }); * ``` * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. + * The `rl.write()` method will write the data to the `readline` `Interface`'s `input` _as if it were provided by the user_. * @since v0.1.98 */ write(data: string | Buffer, key?: Key): void; @@ -338,7 +339,7 @@ declare module "readline" { tabSize?: number | undefined; } /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. + * The `readline.createInterface()` method creates a new `readline.Interface` instance. * * ```js * const readline = require('node:readline'); @@ -382,7 +383,7 @@ declare module "readline" { * * If the `stream` is a `TTY`, then it must be in raw mode. * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop + * This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop * the `input` from emitting `'keypress'` events. * * ```js @@ -467,7 +468,7 @@ declare module "readline" { * }); * ``` * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied: * * ```js * const { once } = require('node:events'); @@ -502,7 +503,7 @@ declare module "readline" { cols: number; } /** - * The `readline.clearLine()` method clears current line of given `TTY` stream + * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) stream * in a specified direction identified by `dir`. * @since v0.7.7 * @param callback Invoked once the operation completes. @@ -510,7 +511,7 @@ declare module "readline" { */ export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from + * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) stream from * the current position of the cursor down. * @since v0.7.7 * @param callback Invoked once the operation completes. @@ -519,7 +520,7 @@ declare module "readline" { export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; /** * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. + * given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) `stream`. * @since v0.7.7 * @param callback Invoked once the operation completes. * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. @@ -527,7 +528,7 @@ declare module "readline" { export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; /** * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. + * position in a given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) `stream`. * @since v0.7.7 * @param callback Invoked once the operation completes. * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. diff --git a/dist/node_modules/@types/node/readline/promises.d.ts b/dist/node_modules/@types/node/readline/promises.d.ts index 73fb111..f2826bb 100644 --- a/dist/node_modules/@types/node/readline/promises.d.ts +++ b/dist/node_modules/@types/node/readline/promises.d.ts @@ -6,7 +6,7 @@ declare module "readline/promises" { import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline"; import { Abortable } from "node:events"; /** - * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a + * Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a * single `input` `Readable` stream and a single `output` `Writable` stream. * The `output` stream is used to print prompts for user input that arrives on, * and is read from, the `input` stream. @@ -15,12 +15,12 @@ declare module "readline/promises" { class Interface extends _Interface { /** * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. * * When called, `rl.question()` will resume the `input` stream if it has been * paused. * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. * * If the question is called after `rl.close()`, it returns a rejected promise. * @@ -67,7 +67,7 @@ declare module "readline/promises" { * The `rl.clearLine()` method adds to the internal list of pending action an * action that clears current line of the associated `stream` in a specified * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. * @since v17.0.0 * @return this */ @@ -76,20 +76,20 @@ declare module "readline/promises" { * The `rl.clearScreenDown()` method adds to the internal list of pending action an * action that clears the associated stream from the current position of the * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. * @since v17.0.0 * @return this */ clearScreenDown(): this; /** - * The `rl.commit()` method sends all the pending actions to the associated`stream` and clears the internal list of pending actions. + * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. * @since v17.0.0 */ commit(): Promise; /** * The `rl.cursorTo()` method adds to the internal list of pending action an action * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. * @since v17.0.0 * @return this */ @@ -98,7 +98,7 @@ declare module "readline/promises" { * The `rl.moveCursor()` method adds to the internal list of pending action an * action that moves the cursor _relative_ to its current position in the * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. * @since v17.0.0 * @return this */ @@ -112,7 +112,7 @@ declare module "readline/promises" { rollback(): this; } /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface`instance. + * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. * * ```js * const readlinePromises = require('node:readline/promises'); diff --git a/dist/node_modules/@types/node/repl.d.ts b/dist/node_modules/@types/node/repl.d.ts index 6c5f81b..f55ef66 100644 --- a/dist/node_modules/@types/node/repl.d.ts +++ b/dist/node_modules/@types/node/repl.d.ts @@ -6,7 +6,7 @@ * ```js * const repl = require('node:repl'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/repl.js) */ declare module "repl" { import { AsyncCompleter, Completer, Interface } from "node:readline"; @@ -54,25 +54,25 @@ declare module "repl" { * If `true`, specifies that the default `writer` function should include ANSI color * styling to REPL output. If a custom `writer` function is provided then this has no * effect. - * Default: the REPL instance's `terminal` value. + * @default the REPL instance's `terminal` value */ useColors?: boolean | undefined; /** * If `true`, specifies that the default evaluation function will use the JavaScript * `global` as the context as opposed to creating a new separate context for the REPL * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. + * @default false */ useGlobal?: boolean | undefined; /** * If `true`, specifies that the default writer will not output the return value of a * command if it evaluates to `undefined`. - * Default: `false`. + * @default false */ ignoreUndefined?: boolean | undefined; /** * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. + * @default a wrapper for `util.inspect` * * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output */ @@ -95,7 +95,7 @@ declare module "repl" { /** * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. + * @default false */ breakEvalOnSigint?: boolean | undefined; } @@ -251,7 +251,7 @@ declare module "repl" { private constructor(); /** * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following + * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following * properties: * * The following example shows two new commands added to the REPL instance: @@ -289,7 +289,7 @@ declare module "repl" { defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; /** * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. + * from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input. * * When multi-line input is being entered, an ellipsis is printed rather than the * 'prompt'. @@ -297,14 +297,14 @@ declare module "repl" { * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. * * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. + * within the action function for commands registered using the `replServer.defineCommand()` method. * @since v0.1.91 */ displayPrompt(preserveCursor?: boolean): void; /** * The `replServer.clearBufferedCommand()` method clears any command that has been * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. + * called from within the action function for commands registered using the `replServer.defineCommand()` method. * @since v9.0.0 */ clearBufferedCommand(): void; diff --git a/dist/node_modules/@types/node/sea.d.ts b/dist/node_modules/@types/node/sea.d.ts new file mode 100644 index 0000000..6f1d1ea --- /dev/null +++ b/dist/node_modules/@types/node/sea.d.ts @@ -0,0 +1,153 @@ +/** + * This feature allows the distribution of a Node.js application conveniently to a + * system that does not have Node.js installed. + * + * Node.js supports the creation of [single executable applications](https://github.com/nodejs/single-executable) by allowing + * the injection of a blob prepared by Node.js, which can contain a bundled script, + * into the `node` binary. During start up, the program checks if anything has been + * injected. If the blob is found, it executes the script in the blob. Otherwise + * Node.js operates as it normally does. + * + * The single executable application feature currently only supports running a + * single embedded script using the `CommonJS` module system. + * + * Users can create a single executable application from their bundled script + * with the `node` binary itself and any tool which can inject resources into the + * binary. + * + * Here are the steps for creating a single executable application using one such + * tool, [postject](https://github.com/nodejs/postject): + * + * 1. Create a JavaScript file: + * ```bash + * echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js + * ``` + * 2. Create a configuration file building a blob that can be injected into the + * single executable application (see `Generating single executable preparation blobs` for details): + * ```bash + * echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json + * ``` + * 3. Generate the blob to be injected: + * ```bash + * node --experimental-sea-config sea-config.json + * ``` + * 4. Create a copy of the `node` executable and name it according to your needs: + * * On systems other than Windows: + * ```bash + * cp $(command -v node) hello + * ``` + * * On Windows: + * ```text + * node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')" + * ``` + * The `.exe` extension is necessary. + * 5. Remove the signature of the binary (macOS and Windows only): + * * On macOS: + * ```bash + * codesign --remove-signature hello + * ``` + * * On Windows (optional): + * [signtool](https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool) can be used from the installed [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). + * If this step is + * skipped, ignore any signature-related warning from postject. + * ```powershell + * signtool remove /s hello.exe + * ``` + * 6. Inject the blob into the copied binary by running `postject` with + * the following options: + * * `hello` / `hello.exe` \- The name of the copy of the `node` executable + * created in step 4. + * * `NODE_SEA_BLOB` \- The name of the resource / note / section in the binary + * where the contents of the blob will be stored. + * * `sea-prep.blob` \- The name of the blob created in step 1. + * * `--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2` \- The [fuse](https://www.electronjs.org/docs/latest/tutorial/fuses) used by the Node.js project to detect if a file has been + * injected. + * * `--macho-segment-name NODE_SEA` (only needed on macOS) - The name of the + * segment in the binary where the contents of the blob will be + * stored. + * To summarize, here is the required command for each platform: + * * On Linux: + * ```bash + * npx postject hello NODE_SEA_BLOB sea-prep.blob \ + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + * ``` + * * On Windows - PowerShell: + * ```powershell + * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ` + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + * ``` + * * On Windows - Command Prompt: + * ```text + * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^ + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + * ``` + * * On macOS: + * ```bash + * npx postject hello NODE_SEA_BLOB sea-prep.blob \ + * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \ + * --macho-segment-name NODE_SEA + * ``` + * 7. Sign the binary (macOS and Windows only): + * * On macOS: + * ```bash + * codesign --sign - hello + * ``` + * * On Windows (optional): + * A certificate needs to be present for this to work. However, the unsigned + * binary would still be runnable. + * ```powershell + * signtool sign /fd SHA256 hello.exe + * ``` + * 8. Run the binary: + * * On systems other than Windows + * ```console + * $ ./hello world + * Hello, world! + * ``` + * * On Windows + * ```console + * $ .\hello.exe world + * Hello, world! + * ``` + * @since v19.7.0, v18.16.0 + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v20.12.0/src/node_sea.cc) + */ +declare module "node:sea" { + type AssetKey = string; + /** + * @since v20.12.0 + * @return Whether this script is running inside a single-executable application. + */ + function isSea(): boolean; + /** + * This method can be used to retrieve the assets configured to be bundled into the + * single-executable application at build time. + * An error is thrown when no matching asset can be found. + * @since v20.12.0 + */ + function getAsset(key: AssetKey): ArrayBuffer; + function getAsset(key: AssetKey, encoding: string): string; + /** + * Similar to `sea.getAsset()`, but returns the result in a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). + * An error is thrown when no matching asset can be found. + * @since v20.12.0 + */ + function getAssetAsBlob(key: AssetKey, options?: { + type: string; + }): Blob; + /** + * This method can be used to retrieve the assets configured to be bundled into the + * single-executable application at build time. + * An error is thrown when no matching asset can be found. + * + * Unlike `sea.getRawAsset()` or `sea.getAssetAsBlob()`, this method does not + * return a copy. Instead, it returns the raw asset bundled inside the executable. + * + * For now, users should avoid writing to the returned array buffer. If the + * injected section is not marked as writable or not aligned properly, + * writes to the returned array buffer is likely to result in a crash. + * @since v20.12.0 + */ + function getRawAsset(key: AssetKey): string | ArrayBuffer; +} diff --git a/dist/node_modules/@types/node/stream.d.ts b/dist/node_modules/@types/node/stream.d.ts index 15c633f..fbcd37d 100644 --- a/dist/node_modules/@types/node/stream.d.ts +++ b/dist/node_modules/@types/node/stream.d.ts @@ -2,9 +2,10 @@ * A stream is an abstract interface for working with streaming data in Node.js. * The `node:stream` module provides an API for implementing the stream interface. * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. + * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v20.x/api/http.html#class-httpincomingmessage) + * and [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) are both stream instances. * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. + * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v20.x/api/events.html#class-eventemitter). * * To access the `node:stream` module: * @@ -14,7 +15,7 @@ * * The `node:stream` module is useful for creating new types of stream instances. * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/stream.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/stream.js) */ declare module "stream" { import { Abortable, EventEmitter } from "node:events"; @@ -41,14 +42,20 @@ declare module "stream" { import Readable = internal.Readable; import ReadableOptions = internal.ReadableOptions; interface ArrayOptions { - /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */ + /** + * The maximum concurrent invocations of `fn` to call on the stream at once. + * @default 1 + */ concurrency?: number; - /** allows destroying the stream if the signal is aborted. */ + /** Allows destroying the stream if the signal is aborted. */ signal?: AbortSignal; } class ReadableBase extends Stream implements NodeJS.ReadableStream { /** * A utility method for creating Readable Streams out of iterators. + * @since v12.3.0, v10.17.0 + * @param iterable Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed. + * @param options Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`. */ static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; /** @@ -63,7 +70,7 @@ declare module "stream" { */ readonly readableAborted: boolean; /** - * Is `true` if it is safe to call `readable.read()`, which means + * Is `true` if it is safe to call {@link read}, which means * the stream has not been destroyed or emitted `'error'` or `'end'`. * @since v11.4.0 */ @@ -75,18 +82,18 @@ declare module "stream" { */ readonly readableDidRead: boolean; /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. + * Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the {@link setEncoding} method. * @since v12.7.0 */ readonly readableEncoding: BufferEncoding | null; /** - * Becomes `true` when `'end'` event is emitted. + * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v20.x/api/stream.html#event-end) event is emitted. * @since v12.9.0 */ readonly readableEnded: boolean; /** * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. + * in the [Three states](https://nodejs.org/docs/latest-v20.x/api/stream.html#three-states) section. * @since v9.4.0 */ readonly readableFlowing: boolean | null; @@ -132,9 +139,10 @@ declare module "stream" { * specified using the `readable.setEncoding()` method or the stream is operating * in object mode. * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. + * The optional `size` argument specifies a specific number of bytes to read. If + * `size` bytes are not available to be read, `null` will be returned _unless_ the + * stream has ended, in which case all of the data remaining in the internal buffer + * will be returned. * * If the `size` argument is not specified, all of the data contained in the * internal buffer will be returned. @@ -191,7 +199,7 @@ declare module "stream" { * ``` * * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. + * a call to `readable.read(size)`, regardless of the value of the `size` argument. * * If the `readable.read()` method returns a chunk of data, a `'data'` event will * also be emitted. @@ -206,9 +214,9 @@ declare module "stream" { * The `readable.setEncoding()` method sets the character encoding for * data read from the `Readable` stream. * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal + * By default, no encoding is assigned and stream data will be returned as `Buffer` objects. Setting an encoding causes the stream data + * to be returned as strings of the specified encoding rather than as `Buffer` objects. For instance, calling `readable.setEncoding('utf8')` will cause the + * output data to be interpreted as UTF-8 data, and passed as strings. Calling `readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal * string format. * * The `Readable` stream will properly handle multi-byte characters delivered @@ -245,7 +253,7 @@ declare module "stream" { * }); * ``` * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. + * The `readable.pause()` method has no effect if there is a `'readable'` event listener. * @since v0.9.4 */ pause(): this; @@ -264,14 +272,14 @@ declare module "stream" { * }); * ``` * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. + * The `readable.resume()` method has no effect if there is a `'readable'` event listener. * @since v0.9.4 */ resume(): this; /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. + * The `readable.isPaused()` method returns the current operating state of the `Readable`. + * This is used primarily by the mechanism that underlies the `readable.pipe()` method. + * In most typical cases, there will be no reason to use this method directly. * * ```js * const readable = new stream.Readable(); @@ -373,16 +381,16 @@ declare module "stream" { * however it is best to simply avoid calling `readable.unshift()` while in the * process of performing a read. * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array`, or `null`. For object mode - * streams, `chunk` may be any JavaScript value. + * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must + * be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value. * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. */ unshift(chunk: any, encoding?: BufferEncoding): void; /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream`module API as it is currently defined. (See `Compatibility` for more + * Prior to Node.js 0.10, streams did not implement the entire `node:stream` module API as it is currently defined. (See `Compatibility` for more * information.) * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` + * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the `readable.wrap()` method can be used to create a `Readable` * stream that uses * the old stream as its data source. * @@ -565,8 +573,8 @@ declare module "stream" { ): Promise; _destroy(error: Error | null, callback: (error?: Error | null) => void): void; /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the readable + * stream will release any internal resources and subsequent calls to `push()` will be ignored. * * Once `destroy()` has been called any further calls will be a no-op and no * further errors except from `_destroy()` may be emitted as `'error'`. @@ -731,7 +739,7 @@ declare module "stream" { * first argument. The `callback` is called asynchronously and before `'error'` is * emitted. * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. + * The return value is `true` if the internal buffer is less than the `highWaterMark` configured when the stream was created after admitting `chunk`. * If `false` is returned, further attempts to write data to the stream should * stop until the `'drain'` event is emitted. * @@ -774,8 +782,8 @@ declare module "stream" { * * A `Writable` stream in object mode will always ignore the `encoding` argument. * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, + * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. * @param [encoding='utf8'] The encoding, if `chunk` is a string. * @param callback Callback for when this chunk of data is flushed. * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. @@ -805,8 +813,8 @@ declare module "stream" { * // Writing more now is not allowed! * ``` * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, + * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. * @param encoding The encoding if `chunk` is a string * @param callback Callback for when the stream is finished. */ @@ -819,10 +827,10 @@ declare module "stream" { * * The primary intent of `writable.cork()` is to accommodate a situation in which * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them + * immediately forwarding them to the underlying destination, `writable.cork()` buffers all the chunks until `writable.uncork()` is called, which will pass them * all to `writable._writev()`, if present. This prevents a head-of-line blocking * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. + * to be processed. However, use of `writable.cork()` without implementing `writable._writev()` may have an adverse effect on throughput. * * See also: `writable.uncork()`, `writable._writev()`. * @since v0.11.2 @@ -832,7 +840,7 @@ declare module "stream" { * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. * * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event + * of writes to a stream, defer calls to `writable.uncork()` using `process.nextTick()`. Doing so allows batching of all `writable.write()` calls that occur within a given Node.js event * loop phase. * * ```js @@ -863,10 +871,10 @@ declare module "stream" { */ uncork(): void; /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the writable * stream has ended and subsequent calls to `write()` or `end()` will result in * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. + * This is a destructive and immediate way to destroy a stream. Previous calls to `write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. * Use `end()` instead of destroy if data should flush before close, or wait for * the `'drain'` event before destroying the stream. * @@ -948,7 +956,7 @@ declare module "stream" { highWaterMark?: number | undefined; objectMode?: boolean | undefined; construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; + destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void; autoDestroy?: boolean | undefined; } interface ReadableOptions extends StreamOptions { @@ -1033,7 +1041,7 @@ declare module "stream" { callback: (error?: Error | null) => void, ): void; final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void; } /** * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. @@ -1061,8 +1069,8 @@ declare module "stream" { * readable side ends. Set initially by the `allowHalfOpen` constructor option, * which defaults to `true`. * - * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is - * emitted. + * This can be changed manually to change the half-open behavior of an existing + * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. * @since v0.9.4 */ allowHalfOpen: boolean; @@ -1108,7 +1116,7 @@ declare module "stream" { }>, callback: (error?: Error | null) => void, ): void; - _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; _final(callback: (error?: Error | null) => void): void; write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; @@ -1261,7 +1269,7 @@ declare module "stream" { callback: (error?: Error | null) => void, ): void; final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void; transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; flush?(this: Transform, callback: TransformCallback): void; } @@ -1283,7 +1291,7 @@ declare module "stream" { } /** * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. + * primarily for examples and testing, but there are some use cases where `stream.PassThrough` is useful as a building block for novel sorts of streams. */ class PassThrough extends Transform {} /** @@ -1292,8 +1300,8 @@ declare module "stream" { * Attaches an AbortSignal to a readable or writeable stream. This lets code * control stream destruction using an `AbortController`. * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new - * AbortError())` for webstreams. + * Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the + * stream, and `controller.error(new AbortError())` for webstreams. * * ```js * const fs = require('node:fs'); @@ -1363,20 +1371,18 @@ declare module "stream" { * ``` * @since v15.4.0 * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to + * @param stream A stream to attach a signal to. */ function addAbortSignal(signal: AbortSignal, stream: T): T; /** * Returns the default highWaterMark used by streams. * Defaults to `16384` (16 KiB), or `16` for `objectMode`. * @since v19.9.0 - * @param objectMode */ function getDefaultHighWaterMark(objectMode: boolean): number; /** * Sets the default highWaterMark used by streams. * @since v19.9.0 - * @param objectMode * @param value highWaterMark value */ function setDefaultHighWaterMark(objectMode: boolean, value: number): void; @@ -1409,11 +1415,11 @@ declare module "stream" { * ``` * * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. + * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`. * - * The `finished` API provides `promise version`. + * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options). * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been + * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been * invoked. The reason for this is so that unexpected `'error'` events (due to * incorrect stream implementations) do not cause unexpected crashes. * If this is unwanted behavior then the returned cleanup function needs to be @@ -1428,7 +1434,7 @@ declare module "stream" { * @since v10.0.0 * @param stream A readable and/or writable stream. * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. + * @returns A cleanup function which removes all registered listeners. */ function finished( stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, @@ -1499,7 +1505,7 @@ declare module "stream" { * ); * ``` * - * The `pipeline` API provides a `promise version`. + * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options). * * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: * @@ -1539,7 +1545,7 @@ declare module "stream" { function pipeline
, B extends PipelineDestination>( source: A, destination: B, - callback?: PipelineCallback, + callback: PipelineCallback, ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; function pipeline< A extends PipelineSource, @@ -1549,7 +1555,7 @@ declare module "stream" { source: A, transform1: T1, destination: B, - callback?: PipelineCallback, + callback: PipelineCallback, ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; function pipeline< A extends PipelineSource, @@ -1561,7 +1567,7 @@ declare module "stream" { transform1: T1, transform2: T2, destination: B, - callback?: PipelineCallback, + callback: PipelineCallback, ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; function pipeline< A extends PipelineSource, @@ -1575,7 +1581,7 @@ declare module "stream" { transform2: T2, transform3: T3, destination: B, - callback?: PipelineCallback, + callback: PipelineCallback, ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; function pipeline< A extends PipelineSource, @@ -1591,11 +1597,11 @@ declare module "stream" { transform3: T3, transform4: T4, destination: B, - callback?: PipelineCallback, + callback: PipelineCallback, ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; function pipeline( streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void, + callback: (err: NodeJS.ErrnoException | null) => void, ): NodeJS.WritableStream; function pipeline( stream1: NodeJS.ReadableStream, diff --git a/dist/node_modules/@types/node/stream/web.d.ts b/dist/node_modules/@types/node/stream/web.d.ts index 0d91613..8dd0ded 100644 --- a/dist/node_modules/@types/node/stream/web.d.ts +++ b/dist/node_modules/@types/node/stream/web.d.ts @@ -156,6 +156,7 @@ declare module "stream/web" { } const ReadableStream: { prototype: ReadableStream; + from(iterable: Iterable | AsyncIterable): ReadableStream; new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; }; @@ -342,7 +343,23 @@ declare module "stream/web" { } const TextDecoderStream: { prototype: TextDecoderStream; - new(label?: string, options?: TextDecoderOptions): TextDecoderStream; + new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; + }; + interface CompressionStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const CompressionStream: { + prototype: CompressionStream; + new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream; + }; + interface DecompressionStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const DecompressionStream: { + prototype: DecompressionStream; + new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream; }; } declare module "node:stream/web" { diff --git a/dist/node_modules/@types/node/string_decoder.d.ts b/dist/node_modules/@types/node/string_decoder.d.ts index b8691e1..9c9d827 100644 --- a/dist/node_modules/@types/node/string_decoder.d.ts +++ b/dist/node_modules/@types/node/string_decoder.d.ts @@ -36,7 +36,7 @@ * decoder.write(Buffer.from([0x82])); * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/string_decoder.js) */ declare module "string_decoder" { class StringDecoder { @@ -44,22 +44,22 @@ declare module "string_decoder" { /** * Returns a decoded string, ensuring that any incomplete multibyte characters at * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. + * returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`. * @since v0.1.99 * @param buffer The bytes to decode. */ - write(buffer: Buffer): string; + write(buffer: string | Buffer | NodeJS.ArrayBufferView): string; /** * Returns any remaining input stored in the internal buffer as a string. Bytes * representing incomplete UTF-8 and UTF-16 characters will be replaced with * substitution characters appropriate for the character encoding. * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. + * If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input. * After `end()` is called, the `stringDecoder` object can be reused for new input. * @since v0.9.3 * @param buffer The bytes to decode. */ - end(buffer?: Buffer): string; + end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string; } } declare module "node:string_decoder" { diff --git a/dist/node_modules/@types/node/test.d.ts b/dist/node_modules/@types/node/test.d.ts index 04504fd..88903de 100644 --- a/dist/node_modules/@types/node/test.d.ts +++ b/dist/node_modules/@types/node/test.d.ts @@ -18,14 +18,14 @@ * * 1. A synchronous function that is considered failing if it throws an exception, * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` resolves. + * 2. A function that returns a `Promise` that is considered failing if the `Promise` rejects, and is considered passing if the `Promise` fulfills. * 3. A function that receives a callback function. If the callback receives any * truthy value as its first argument, the test is considered failing. If a * falsy value is passed as the first argument to the callback, the test is * considered passing. If the test function receives a callback function and * also returns a `Promise`, the test will fail. * - * The following example illustrates how tests are written using the`test` module. + * The following example illustrates how tests are written using the `test` module. * * ```js * test('synchronous passing test', (t) => { @@ -40,7 +40,7 @@ * * test('asynchronous passing test', async (t) => { * // This test passes because the Promise returned by the async - * // function is not rejected. + * // function is settled and not rejected. * assert.strictEqual(1, 1); * }); * @@ -76,12 +76,17 @@ * * If any tests fail, the process exit code is set to `1`. * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.4.0/lib/test.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/test.js) */ declare module "node:test" { import { Readable } from "node:stream"; import { AsyncResource } from "node:async_hooks"; /** + * **Note:** `shard` is used to horizontally parallelize test running across + * machines or processes, ideal for large-scale executions across varied + * environments. It's incompatible with `watch` mode, tailored for rapid + * code iteration by automatically rerunning tests on file changes. + * * ```js * import { tap } from 'node:test/reporters'; * import { run } from 'node:test'; @@ -104,8 +109,8 @@ declare module "node:test" { * actions related to the current test. Examples include skipping the test, adding * additional diagnostic information, or creating subtests. * - * `test()` returns a `Promise` that resolves once the test completes. - * if `test()` is called within a `describe()` block, it resolve immediately. + * `test()` returns a `Promise` that fulfills once the test completes. + * if `test()` is called within a suite, it fulfills immediately. * The return value can usually be discarded for top level tests. * However, the return value from subtests should be used to prevent the parent * test from finishing first and cancelling the subtest @@ -124,15 +129,15 @@ declare module "node:test" { * }); * ``` * - * The `timeout` option can be used to fail the test if it takes longer than`timeout` milliseconds to complete. However, it is not a reliable mechanism for + * The `timeout` option can be used to fail the test if it takes longer than `timeout` milliseconds to complete. However, it is not a reliable mechanism for * canceling tests because a running test might block the application thread and * thus prevent the scheduled cancellation. * @since v18.0.0, v16.17.0 * @param [name='The name'] The name of the test, which is displayed when reporting test results. * @param options Configuration options for the test. The following properties are supported: - * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the callback function is passed as the - * second argument. - * @return Resolved with `undefined` once the test completes, or immediately if the test runs within {@link describe}. + * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the + * callback function is passed as the second argument. + * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite. */ function test(name?: string, fn?: TestFn): Promise; function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; @@ -142,14 +147,47 @@ declare module "node:test" { export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo }; } /** - * The `describe()` function imported from the `node:test` module. Each - * invocation of this function results in the creation of a Subtest. - * After invocation of top level `describe` functions, - * all top level tests and suites will execute. - * @param [name='The name'] The name of the suite, which is displayed when reporting test results. - * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. - * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. + * The `suite()` function is imported from the `node:test` module. + * @param name The name of the suite, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `''` if `fn` does not have a name. + * @param options Optional configuration options for the suite. This supports the same options as `test([name][, options][, fn])`. + * @param [fn='A no-op function'] The suite function declaring nested tests and suites. The first argument to this function is a `{@link SuiteContext}` object. * @return Immediately fulfilled with `undefined`. + * @since v20.13.0 + */ + function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function suite(name?: string, fn?: SuiteFn): Promise; + function suite(options?: TestOptions, fn?: SuiteFn): Promise; + function suite(fn?: SuiteFn): Promise; + namespace suite { + /** + * Shorthand for skipping a suite. This is the same as [`suite([name], { skip: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#suitename-options-fn). + * @since v20.13.0 + */ + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function skip(name?: string, fn?: SuiteFn): Promise; + function skip(options?: TestOptions, fn?: SuiteFn): Promise; + function skip(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `TODO`. This is the same as [`suite([name], { todo: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#suitename-options-fn). + * @since v20.13.0 + */ + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function todo(name?: string, fn?: SuiteFn): Promise; + function todo(options?: TestOptions, fn?: SuiteFn): Promise; + function todo(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `only`. This is the same as [`suite([name], { only: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#suitename-options-fn). + * @since v20.13.0 + */ + function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function only(name?: string, fn?: SuiteFn): Promise; + function only(options?: TestOptions, fn?: SuiteFn): Promise; + function only(fn?: SuiteFn): Promise; + } + /** + * Alias for `{@link suite}`. + * + * The `describe()` function is imported from the `node:test` module. */ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; function describe(name?: string, fn?: SuiteFn): Promise; @@ -157,21 +195,23 @@ declare module "node:test" { function describe(fn?: SuiteFn): Promise; namespace describe { /** - * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. + * Shorthand for skipping a suite. This is the same as [`describe([name], { skip: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#describename-options-fn). + * @since v18.15.0 */ function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; function skip(name?: string, fn?: SuiteFn): Promise; function skip(options?: TestOptions, fn?: SuiteFn): Promise; function skip(fn?: SuiteFn): Promise; /** - * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. + * Shorthand for marking a suite as `TODO`. This is the same as [`describe([name], { todo: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#describename-options-fn). + * @since v18.15.0 */ function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; function todo(name?: string, fn?: SuiteFn): Promise; function todo(options?: TestOptions, fn?: SuiteFn): Promise; function todo(fn?: SuiteFn): Promise; /** - * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * Shorthand for marking a suite as `only`. This is the same as [`describe([name], { only: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#describename-options-fn). * @since v18.15.0 */ function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; @@ -180,7 +220,7 @@ declare module "node:test" { function only(fn?: SuiteFn): Promise; } /** - * Shorthand for `test()`. + * Alias for `test()`. * * The `it()` function is imported from the `node:test` module. * @since v18.6.0, v16.17.0 @@ -259,49 +299,57 @@ declare module "node:test" { } interface RunOptions { /** - * If a number is provided, then that many files would run in parallel. - * If truthy, it would run (number of cpu cores - 1) files in parallel. - * If falsy, it would only run one file at a time. - * If unspecified, subtests inherit this value from their parent. - * @default true + * If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. + * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. + * @default false */ concurrency?: number | boolean | undefined; /** - * An array containing the list of files to run. - * If unspecified, the test runner execution model will be used. + * An array containing the list of files to run. **Default** matching files from + * [test runner execution model](https://nodejs.org/docs/latest-v20.x/api/test.html#test-runner-execution-model). */ files?: readonly string[] | undefined; /** - * Allows aborting an in-progress test execution. - * @default undefined - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the test will fail after. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity + * Configures the test runner to exit the process once all known + * tests have finished executing even if the event loop would + * otherwise remain active. + * @default false */ - timeout?: number | undefined; + forceExit?: boolean | undefined; /** * Sets inspector port of test child process. * If a nullish value is provided, each process gets its own port, * incremented from the primary's `process.debugPort`. + * @default undefined */ inspectPort?: number | (() => number) | undefined; - /** - * That can be used to only run tests whose name matches the provided pattern. - * Test name patterns are interpreted as JavaScript regular expressions. - * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. - */ - testNamePatterns?: string | RegExp | string[] | RegExp[]; /** * If truthy, the test context will only run tests that have the `only` option set */ only?: boolean; /** - * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run. + * A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. + * @default undefined */ setup?: (root: Test) => void | Promise; + /** + * Allows aborting an in-progress test execution. + */ + signal?: AbortSignal | undefined; + /** + * A String, RegExp or a RegExp Array, that can be used to only run tests whose + * name matches the provided pattern. Test name patterns are interpreted as JavaScript + * regular expressions. For each test that is executed, any corresponding test hooks, + * such as `beforeEach()`, are also run. + * @default undefined + */ + testNamePatterns?: string | RegExp | string[] | RegExp[]; + /** + * A number of milliseconds the test execution will fail after. + * If unspecified, subtests inherit this value from their parent. + * @default Infinity + */ + timeout?: number | undefined; /** * Whether to run in watch mode or not. * @default false @@ -323,12 +371,18 @@ declare module "node:test" { timeout: number | null; } /** - * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.`TestsStream` will emit events, in the + * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. `TestsStream` will emit events, in the * order of the tests definition + * + * Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute. * @since v18.9.0, v16.19.0 */ class TestsStream extends Readable implements NodeJS.ReadableStream { + addListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; + addListener(event: "test:complete", listener: (data: TestComplete) => void): this; + addListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; + addListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; addListener(event: "test:fail", listener: (data: TestFail) => void): this; addListener(event: "test:pass", listener: (data: TestPass) => void): this; addListener(event: "test:plan", listener: (data: TestPlan) => void): this; @@ -336,7 +390,11 @@ declare module "node:test" { addListener(event: "test:stderr", listener: (data: TestStderr) => void): this; addListener(event: "test:stdout", listener: (data: TestStdout) => void): this; addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: "test:coverage", data: TestCoverage): boolean; + emit(event: "test:complete", data: TestComplete): boolean; + emit(event: "test:dequeue", data: TestDequeue): boolean; emit(event: "test:diagnostic", data: DiagnosticData): boolean; + emit(event: "test:enqueue", data: TestEnqueue): boolean; emit(event: "test:fail", data: TestFail): boolean; emit(event: "test:pass", data: TestPass): boolean; emit(event: "test:plan", data: TestPlan): boolean; @@ -344,7 +402,11 @@ declare module "node:test" { emit(event: "test:stderr", data: TestStderr): boolean; emit(event: "test:stdout", data: TestStdout): boolean; emit(event: string | symbol, ...args: any[]): boolean; + on(event: "test:coverage", listener: (data: TestCoverage) => void): this; + on(event: "test:complete", listener: (data: TestComplete) => void): this; + on(event: "test:dequeue", listener: (data: TestDequeue) => void): this; on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; + on(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; on(event: "test:fail", listener: (data: TestFail) => void): this; on(event: "test:pass", listener: (data: TestPass) => void): this; on(event: "test:plan", listener: (data: TestPlan) => void): this; @@ -352,7 +414,11 @@ declare module "node:test" { on(event: "test:stderr", listener: (data: TestStderr) => void): this; on(event: "test:stdout", listener: (data: TestStdout) => void): this; on(event: string, listener: (...args: any[]) => void): this; + once(event: "test:coverage", listener: (data: TestCoverage) => void): this; + once(event: "test:complete", listener: (data: TestComplete) => void): this; + once(event: "test:dequeue", listener: (data: TestDequeue) => void): this; once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; + once(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; once(event: "test:fail", listener: (data: TestFail) => void): this; once(event: "test:pass", listener: (data: TestPass) => void): this; once(event: "test:plan", listener: (data: TestPlan) => void): this; @@ -360,7 +426,11 @@ declare module "node:test" { once(event: "test:stderr", listener: (data: TestStderr) => void): this; once(event: "test:stdout", listener: (data: TestStdout) => void): this; once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; + prependListener(event: "test:complete", listener: (data: TestComplete) => void): this; + prependListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; + prependListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; prependListener(event: "test:fail", listener: (data: TestFail) => void): this; prependListener(event: "test:pass", listener: (data: TestPass) => void): this; prependListener(event: "test:plan", listener: (data: TestPlan) => void): this; @@ -368,7 +438,11 @@ declare module "node:test" { prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this; prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; + prependOnceListener(event: "test:complete", listener: (data: TestComplete) => void): this; + prependOnceListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; + prependOnceListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this; prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this; prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this; @@ -387,7 +461,7 @@ declare module "node:test" { /** * This function is used to create a hook running before subtest of the current test. * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. + * the second argument. **Default:** A no-op function. * @param options Configuration options for the hook. * @since v20.1.0 */ @@ -395,14 +469,14 @@ declare module "node:test" { /** * This function is used to create a hook running before each subtest of the current test. * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. + * the second argument. **Default:** A no-op function. * @param options Configuration options for the hook. * @since v18.8.0 */ beforeEach: typeof beforeEach; /** * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as * the second argument. Default: A no-op function. * @param options Configuration options for the hook. * @since v18.13.0 @@ -411,7 +485,7 @@ declare module "node:test" { /** * This function is used to create a hook running after each subtest of the current test. * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. + * the second argument. **Default:** A no-op function. * @param options Configuration options for the hook. * @since v18.8.0 */ @@ -465,7 +539,7 @@ declare module "node:test" { */ readonly signal: AbortSignal; /** - * This function causes the test's output to indicate the test as skipped. If`message` is provided, it is included in the output. Calling `skip()` does + * This function causes the test's output to indicate the test as skipped. If `message` is provided, it is included in the output. Calling `skip()` does * not terminate execution of the test function. This function does not return a * value. * @@ -503,7 +577,7 @@ declare module "node:test" { * @param options Configuration options for the test * @param fn The function under test. This first argument to this function is a * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. + * passed as the second argument. **Default:** A no-op function. * @returns A {@link Promise} resolved with `undefined` once the test completes. */ test: typeof test; @@ -512,6 +586,7 @@ declare module "node:test" { */ readonly mock: MockTracker; } + /** * An instance of `SuiteContext` is passed to each suite function in order to * interact with the test runner. However, the `SuiteContext` constructor is not @@ -572,7 +647,7 @@ declare module "node:test" { todo?: boolean | string | undefined; } /** - * This function is used to create a hook running before running a suite. + * This function creates a hook that runs before executing a suite. * * ```js * describe('tests', async () => { @@ -588,7 +663,7 @@ declare module "node:test" { */ function before(fn?: HookFn, options?: HookOptions): void; /** - * This function is used to create a hook running after running a suite. + * This function creates a hook that runs after executing a suite. * * ```js * describe('tests', async () => { @@ -604,8 +679,7 @@ declare module "node:test" { */ function after(fn?: HookFn, options?: HookOptions): void; /** - * This function is used to create a hook running - * before each subtest of the current suite. + * This function creates a hook that runs before each test in the current suite. * * ```js * describe('tests', async () => { @@ -621,8 +695,8 @@ declare module "node:test" { */ function beforeEach(fn?: HookFn, options?: HookOptions): void; /** - * This function is used to create a hook running - * after each subtest of the current test. + * This function creates a hook that runs after each test in the current suite. + * The `afterEach()` hook is run even if the test fails. * * ```js * describe('tests', async () => { @@ -690,7 +764,7 @@ declare module "node:test" { /** * The `MockTracker` class is used to manage mocking functionality. The test runner * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's`mock` property. + * Each test also provides its own `MockTracker` instance via the test context's `mock` property. * @since v19.1.0, v18.13.0 */ class MockTracker { @@ -806,7 +880,7 @@ declare module "node:test" { ): Mock; /** - * This function is syntax sugar for `MockTracker.method` with `options.getter`set to `true`. + * This function is syntax sugar for `MockTracker.method` with `options.getter` set to `true`. * @since v19.3.0, v18.13.0 */ getter< @@ -828,7 +902,7 @@ declare module "node:test" { options?: MockFunctionOptions, ): Mock<(() => MockedObject[MethodName]) | Implementation>; /** - * This function is syntax sugar for `MockTracker.method` with `options.setter`set to `true`. + * This function is syntax sugar for `MockTracker.method` with `options.setter` set to `true`. * @since v19.3.0, v18.13.0 */ setter< @@ -851,11 +925,11 @@ declare module "node:test" { ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; /** * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the`MockTracker` instance. Once disassociated, the mocks can still be used, but the`MockTracker` instance can no longer be + * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be * used to reset their behavior or * otherwise interact with them. * - * After each test completes, this function is called on the test context's`MockTracker`. If the global `MockTracker` is used extensively, calling this + * After each test completes, this function is called on the test context's `MockTracker`. If the global `MockTracker` is used extensively, calling this * function manually is recommended. * @since v19.1.0, v18.13.0 */ @@ -921,7 +995,7 @@ declare module "node:test" { readonly calls: Array>; /** * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls`is a getter that creates a copy of the internal call tracking array. + * function is more efficient than checking `ctx.calls.length` because `ctx.calls` is a getter that creates a copy of the internal call tracking array. * @since v19.1.0, v18.13.0 * @return The number of times that this mock has been invoked. */ @@ -957,7 +1031,7 @@ declare module "node:test" { * @since v19.1.0, v18.13.0 * @param implementation The function to be used as the mock's new implementation. */ - mockImplementation(implementation: Function): void; + mockImplementation(implementation: F): void; /** * This function is used to change the behavior of an existing mock for a single * invocation. Once invocation `onCall` has occurred, the mock will revert to @@ -994,7 +1068,7 @@ declare module "node:test" { * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. */ - mockImplementationOnce(implementation: Function, onCall?: number): void; + mockImplementationOnce(implementation: F, onCall?: number): void; /** * Resets the call history of the mock function. * @since v19.3.0, v18.13.0 @@ -1007,12 +1081,20 @@ declare module "node:test" { */ restore(): void; } - type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout"; + type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; + + interface MockTimersOptions { + apis: Timer[]; + now?: number | Date; + } /** * Mocking timers is a technique commonly used in software testing to simulate and * control the behavior of timers, such as `setInterval` and `setTimeout`, * without actually waiting for the specified time intervals. * + * The MockTimers API also allows for mocking of the `Date` constructor and + * `setImmediate`/`clearImmediate` functions. + * * The `MockTracker` provides a top-level `timers` export * which is a `MockTimers` instance. * @since v20.4.0 @@ -1025,24 +1107,68 @@ declare module "node:test" { * **Note:** When you enable mocking for a specific timer, its associated * clear function will also be implicitly mocked. * - * Example usage: + * **Note:** Mocking `Date` will affect the behavior of the mocked timers + * as they use the same internal clock. + * + * Example usage without setting initial time: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); + * ``` + * + * The above example enables mocking for the `Date` constructor, `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, + * `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and `globalThis` will be mocked. + * + * Example usage with initial time set * * ```js * import { mock } from 'node:test'; - * mock.timers.enable(['setInterval']); + * mock.timers.enable({ apis: ['Date'], now: 1000 }); * ``` * - * The above example enables mocking for the `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * Example usage with initial Date object as time set + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['Date'], now: new Date() }); + * ``` * * Alternatively, if you call `mock.timers.enable()` without any parameters: * - * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. + * + * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, * and `globalThis` will be mocked. + * The `Date` constructor from `globalThis` will be mocked. + * + * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can + * set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date + * object. It can either be a positive integer, or another Date object. * @since v20.4.0 */ - enable(timers?: Timer[]): void; + enable(options?: MockTimersOptions): void; + /** + * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. + * Note: This method will execute any mocked timers that are in the past from the new time. + * In the below example we are setting a new time for the mocked date. + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * test('sets the time of a date object', (context) => { + * // Optionally choose what to mock + * context.mock.timers.enable({ apis: ['Date'], now: 100 }); + * assert.strictEqual(Date.now(), 100); + * // Advance in time will also advance the date + * context.mock.timers.setTime(1000); + * context.mock.timers.tick(200); + * assert.strictEqual(Date.now(), 1200); + * }); + * ``` + */ + setTime(time: number): void; /** * This function restores the default behavior of all mocks that were previously * created by this `MockTimers` instance and disassociates the mocks @@ -1076,7 +1202,7 @@ declare module "node:test" { * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { * const fn = context.mock.fn(); * - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout'] }); * * setTimeout(fn, 9999); * @@ -1097,7 +1223,7 @@ declare module "node:test" { * * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { * const fn = context.mock.fn(); - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout'] }); * const nineSecs = 9000; * setTimeout(fn, nineSecs); * @@ -1109,11 +1235,35 @@ declare module "node:test" { * assert.strictEqual(fn.mock.callCount(), 1); * }); * ``` + * + * Advancing time using `.tick` will also advance the time for any `Date` object + * created after the mock was enabled (if `Date` was also set to be mocked). + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * assert.strictEqual(Date.now(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * assert.strictEqual(fn.mock.callCount(), 1); + * assert.strictEqual(Date.now(), 9999); + * }); + * ``` * @since v20.4.0 */ tick(milliseconds: number): void; /** - * Triggers all pending mocked timers immediately. + * Triggers all pending mocked timers immediately. If the `Date` object is also + * mocked, it will also advance the `Date` object to the furthest timer's time. * * The example below triggers all pending timers immediately, * causing them to execute without any delay. @@ -1123,7 +1273,7 @@ declare module "node:test" { * import { test } from 'node:test'; * * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); * const results = []; * setTimeout(() => results.push(1), 9999); * @@ -1135,8 +1285,9 @@ declare module "node:test" { * assert.deepStrictEqual(results, []); * * context.mock.timers.runAll(); - * * assert.deepStrictEqual(results, [3, 2, 1]); + * // The Date object is also advanced to the furthest timer's time + * assert.strictEqual(Date.now(), 9999); * }); * ``` * @@ -1164,8 +1315,10 @@ declare module "node:test" { only, run, skip, + SuiteContext, test, test as default, + TestContext, todo, }; } @@ -1177,12 +1330,11 @@ interface TestLocationInfo { */ column?: number; /** - * The path of the test file, `undefined` if test is not ran through a file. + * The path of the test file, `undefined` if test was run through the REPL. */ file?: string; /** - * The line number where the test is defined, or - * `undefined` if the test was run through the REPL. + * The line number where the test is defined, or `undefined` if the test was run through the REPL. */ line?: number; } @@ -1196,6 +1348,202 @@ interface DiagnosticData extends TestLocationInfo { */ nesting: number; } +interface TestCoverage { + /** + * An object containing the coverage report. + */ + summary: { + /** + * An array of coverage reports for individual files. Each report is an object with the following schema: + */ + files: Array<{ + /** + * The absolute path of the file. + */ + path: string; + /** + * The total number of lines. + */ + totalLineCount: number; + /** + * The total number of branches. + */ + totalBranchCount: number; + /** + * The total number of functions. + */ + totalFunctionCount: number; + /** + * The number of covered lines. + */ + coveredLineCount: number; + /** + * The number of covered branches. + */ + coveredBranchCount: number; + /** + * The number of covered functions. + */ + coveredFunctionCount: number; + /** + * The percentage of lines covered. + */ + coveredLinePercent: number; + /** + * The percentage of branches covered. + */ + coveredBranchPercent: number; + /** + * The percentage of functions covered. + */ + coveredFunctionPercent: number; + /** + * An array of functions representing function coverage. + */ + functions: Array<{ + /** + * The name of the function. + */ + name: string; + /** + * The line number where the function is defined. + */ + line: number; + /** + * The number of times the function was called. + */ + count: number; + }>; + /** + * An array of lines representing line numbers and the number of times they were covered. + */ + lines: Array<{ + /** + * The line number. + */ + line: number; + /** + * The number of times the line was covered. + */ + count: number; + }>; + }>; + /** + * An object containing a summary of coverage for all files. + */ + totals: { + /** + * The total number of lines. + */ + totalLineCount: number; + /** + * The total number of branches. + */ + totalBranchCount: number; + /** + * The total number of functions. + */ + totalFunctionCount: number; + /** + * The number of covered lines. + */ + coveredLineCount: number; + /** + * The number of covered branches. + */ + coveredBranchCount: number; + /** + * The number of covered functions. + */ + coveredFunctionCount: number; + /** + * The percentage of lines covered. + */ + coveredLinePercent: number; + /** + * The percentage of branches covered. + */ + coveredBranchPercent: number; + /** + * The percentage of functions covered. + */ + coveredFunctionPercent: number; + }; + /** + * The working directory when code coverage began. This + * is useful for displaying relative path names in case + * the tests changed the working directory of the Node.js process. + */ + workingDirectory: string; + }; + /** + * The nesting level of the test. + */ + nesting: number; +} +interface TestComplete extends TestLocationInfo { + /** + * Additional execution metadata. + */ + details: { + /** + * Whether the test passed or not. + */ + passed: boolean; + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * An error wrapping the error thrown by the test if it did not pass. + */ + error: Error; + /** + * The type of the test, used to denote whether this is a suite. + */ + type?: "suite"; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; +} +interface TestDequeue extends TestLocationInfo { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; +} +interface TestEnqueue extends TestLocationInfo { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; +} interface TestFail extends TestLocationInfo { /** * Additional execution metadata. @@ -1206,12 +1554,12 @@ interface TestFail extends TestLocationInfo { */ duration_ms: number; /** - * The error thrown by the test. + * An error wrapping the error thrown by the test if it did not pass. */ error: Error; /** * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 + * @since v20.0.0, v19.9.0, v18.17.0 */ type?: "suite"; }; @@ -1294,36 +1642,16 @@ interface TestStart extends TestLocationInfo { } interface TestStderr extends TestLocationInfo { /** - * The message written to `stderr` + * The message written to `stderr`. */ message: string; } interface TestStdout extends TestLocationInfo { /** - * The message written to `stdout` + * The message written to `stdout`. */ message: string; } -interface TestEnqueue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestDequeue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} /** * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. @@ -1340,21 +1668,23 @@ interface TestDequeue extends TestLocationInfo { * import test from 'test/reporters'; * ``` * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/test/reporters.js) */ declare module "node:test/reporters" { - import { Transform } from "node:stream"; + import { Transform, TransformOptions } from "node:stream"; type TestEvent = + | { type: "test:coverage"; data: TestCoverage } + | { type: "test:complete"; data: TestComplete } + | { type: "test:dequeue"; data: TestDequeue } | { type: "test:diagnostic"; data: DiagnosticData } + | { type: "test:enqueue"; data: TestEnqueue } | { type: "test:fail"; data: TestFail } | { type: "test:pass"; data: TestPass } | { type: "test:plan"; data: TestPlan } | { type: "test:start"; data: TestStart } | { type: "test:stderr"; data: TestStderr } | { type: "test:stdout"; data: TestStdout } - | { type: "test:enqueue"; data: TestEnqueue } - | { type: "test:dequeue"; data: TestDequeue } | { type: "test:watch:drained" }; type TestEventGenerator = AsyncGenerator; @@ -1375,8 +1705,14 @@ declare module "node:test/reporters" { constructor(); } /** - * The `junit` reporter outputs test results in a jUnit XML format + * The `junit` reporter outputs test results in a jUnit XML format. */ function junit(source: TestEventGenerator): AsyncGenerator; - export { dot, junit, Spec as spec, tap, TestEvent }; + /** + * The `lcov` reporter outputs test coverage when used with the [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--experimental-test-coverage) flag. + */ + class Lcov extends Transform { + constructor(opts?: TransformOptions); + } + export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; } diff --git a/dist/node_modules/@types/node/timers.d.ts b/dist/node_modules/@types/node/timers.d.ts index 1434e7d..5a73ca9 100644 --- a/dist/node_modules/@types/node/timers.d.ts +++ b/dist/node_modules/@types/node/timers.d.ts @@ -6,7 +6,7 @@ * The timer functions within Node.js implement a similar API as the timers API * provided by Web Browsers but use a different internal implementation that is * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/timers.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/timers.js) */ declare module "timers" { import { Abortable } from "node:events"; @@ -43,12 +43,12 @@ declare module "timers" { * actions. * * By default, when an immediate is scheduled, the Node.js event loop will continue - * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`functions that can be used to + * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()` functions that can be used to * control this default behavior. */ class Immediate implements RefCounted { /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Immediate` is active. Calling `immediate.ref()` multiple times will have no + * When called, requests that the Node.js event loop _not_ exit so long as the `Immediate` is active. Calling `immediate.ref()` multiple times will have no * effect. * * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary @@ -100,7 +100,7 @@ declare module "timers" { /** * When called, the active `Timeout` object will not require the Node.js event loop * to remain active. If there is no other activity keeping the event loop running, - * the process may exit before the `Timeout` object's callback is invoked. Calling`timeout.unref()` multiple times will have no effect. + * the process may exit before the `Timeout` object's callback is invoked. Calling `timeout.unref()` multiple times will have no effect. * @since v0.9.1 * @return a reference to `timeout` */ @@ -138,7 +138,7 @@ declare module "timers" { * nor of their ordering. The callback will be called as close as possible to the * time specified. * - * When `delay` is larger than `2147483647` or less than `1`, the `delay`will be set to `1`. Non-integer delays are truncated to an integer. + * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer. * * If `callback` is not a function, a `TypeError` will be thrown. * @@ -155,7 +155,7 @@ declare module "timers" { ...args: TArgs ): NodeJS.Timeout; // util.promisify no rest args compability - // tslint:disable-next-line void-return + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; namespace setTimeout { const __promisify__: typeof setTimeoutPromise; @@ -187,7 +187,7 @@ declare module "timers" { ...args: TArgs ): NodeJS.Timeout; // util.promisify no rest args compability - // tslint:disable-next-line void-return + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; namespace setInterval { const __promisify__: typeof setIntervalPromise; @@ -221,7 +221,7 @@ declare module "timers" { ...args: TArgs ): NodeJS.Immediate; // util.promisify no rest args compability - // tslint:disable-next-line void-return + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type function setImmediate(callback: (args: void) => void): NodeJS.Immediate; namespace setImmediate { const __promisify__: typeof setImmediatePromise; diff --git a/dist/node_modules/@types/node/timers/promises.d.ts b/dist/node_modules/@types/node/timers/promises.d.ts index 5a54dc7..50cee98 100644 --- a/dist/node_modules/@types/node/timers/promises.d.ts +++ b/dist/node_modules/@types/node/timers/promises.d.ts @@ -1,6 +1,6 @@ /** * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`. + * that return `Promise` objects. The API is accessible via `require('node:timers/promises')`. * * ```js * import { @@ -66,21 +66,25 @@ declare module "timers/promises" { function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; interface Scheduler { /** + * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification being developed as a standard Web Platform API. + * + * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent to calling `timersPromises.setTimeout(delay, undefined, options)` except that the `ref` + * option is not supported. + * * ```js * import { scheduler } from 'node:timers/promises'; * * await scheduler.wait(1000); // Wait one second before continuing * ``` - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. * @since v16.14.0 * @experimental * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. */ - wait: (delay?: number, options?: TimerOptions) => Promise; + wait: (delay?: number, options?: Pick) => Promise; /** - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. + * An experimental API defined by the [Scheduling APIs](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking) draft specification + * being developed as a standard Web Platform API. + * Calling `timersPromises.scheduler.yield()` is equivalent to calling `timersPromises.setImmediate()` with no arguments. * @since v16.14.0 * @experimental */ diff --git a/dist/node_modules/@types/node/tls.d.ts b/dist/node_modules/@types/node/tls.d.ts index 141af8e..707549b 100644 --- a/dist/node_modules/@types/node/tls.d.ts +++ b/dist/node_modules/@types/node/tls.d.ts @@ -6,7 +6,7 @@ * ```js * const tls = require('node:tls'); * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tls.js) */ declare module "tls" { import { X509Certificate } from "node:crypto"; @@ -125,7 +125,7 @@ declare module "tls" { */ asn1Curve?: string; /** - * The NIST name for the elliptic curve,if it has one + * The NIST name for the elliptic curve, if it has one * (not all well-known curves have been assigned names by NIST). */ nistCurve?: string; @@ -220,7 +220,7 @@ declare module "tls" { /** * Construct a new tls.TLSSocket object from an existing TCP socket. */ - constructor(socket: net.Socket, options?: TLSSocketOptions); + constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); /** * This property is `true` if the peer certificate was signed by one of the CAs * specified when creating the `tls.TLSSocket` instance, otherwise `false`. @@ -278,7 +278,7 @@ declare module "tls" { * an ephemeral key exchange in `perfect forward secrecy` on a client * connection. It returns an empty object when the key exchange is not * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. + * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`. * * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. * @since v5.0.0 @@ -382,7 +382,7 @@ declare module "tls" { * This method can be used to request a peer's certificate after the secure * connection has been established. * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. + * When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. * * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the * protocol. @@ -975,7 +975,7 @@ declare module "tls" { * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. * - * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The + * This function can be overwritten by providing an alternative function as the `options.checkServerIdentity` option that is passed to `tls.connect()`. The * overwriting function can call `tls.checkServerIdentity()` of course, to augment * the checks done with additional verification. * @@ -984,7 +984,7 @@ declare module "tls" { * * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom`options.checkServerIdentity` function that implements the desired behavior. + * a custom `options.checkServerIdentity` function that implements the desired behavior. * @since v0.8.4 * @param hostname The host name or IP address to verify the certificate against. * @param cert A `certificate object` representing the peer's certificate. @@ -1092,7 +1092,7 @@ declare module "tls" { * stream and the cleartext one is used as a replacement for the initial encrypted * stream. * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. + * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties. * * Using `cleartext` has the same API as {@link TLSSocket}. * @@ -1125,10 +1125,10 @@ declare module "tls" { rejectUnauthorized?: boolean, ): SecurePair; /** - * {@link createServer} sets the default value of the `honorCipherOrder` option + * `{@link createServer}` sets the default value of the `honorCipherOrder` option * to `true`, other APIs that create secure contexts leave it unset. * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated + * `{@link createServer}` uses a 128 bit truncated SHA1 hash value generated * from `process.argv` as the default value of the `sessionIdContext` option, other * APIs that create secure contexts have no default value. * @@ -1136,12 +1136,12 @@ declare module "tls" { * usable as an argument to several `tls` APIs, such as `server.addContext()`, * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. + * A key is _required_ for ciphers that use certificates. Either `key` or `pfx` can be used to provide it. * * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength + * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto' `option. When set to `'auto'`, well-known DHE parameters of sufficient strength * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can * be used to create custom parameters. The key length must be greater than or * equal to 1024 bits or else an error will be thrown. Although 1024 bits is @@ -1152,9 +1152,10 @@ declare module "tls" { /** * Returns an array with the names of the supported TLS ciphers. The names are * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. + * the `ciphers` option of `{@link createSecureContext}`. * - * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. + * Not all supported ciphers are enabled by default. See + * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v20.x/api/tls.html#modifying-the-default-tls-cipher-suite). * * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for * TLSv1.2 and below. @@ -1167,43 +1168,49 @@ declare module "tls" { function getCiphers(): string[]; /** * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further + * The default value is `'auto'`. See `{@link createSecureContext()}` for further * information. + * @since v0.11.13 */ let DEFAULT_ECDH_CURVE: string; /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. + * The default value of the `maxVersion` option of `{@link createSecureContext()}`. + * It can be assigned any of the supported TLS protocol versions, + * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.3'`, unless + * changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using + * `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options + * are provided, the highest maximum is used. + * @since v11.4.0 */ let DEFAULT_MAX_VERSION: SecureVersion; /** - * The default value of the minVersion option of tls.createSecureContext(). + * The default value of the `minVersion` option of `{@link createSecureContext()}`. * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options + * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.2'`, unless + * changed using CLI options. Using `--tls-min-v1.0` sets the default to + * `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using + * `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options * are provided, the lowest minimum is used. + * @since v11.4.0 */ let DEFAULT_MIN_VERSION: SecureVersion; /** - * The default value of the ciphers option of tls.createSecureContext(). + * The default value of the `ciphers` option of `{@link createSecureContext()}`. * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of crypto.constants.defaultCoreCipherList, unless - * changed using CLI options using --tls-default-ciphers. + * Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless + * changed using CLI options using `--tls-default-ciphers`. + * @since v19.8.0 */ let DEFAULT_CIPHERS: string; /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). + * An immutable array of strings representing the root certificates (in PEM format) + * from the bundled Mozilla CA store as supplied by the current Node.js version. + * + * The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store + * that is fixed at release time. It is identical on all supported platforms. + * @since v12.3.0 */ - const rootCertificates: ReadonlyArray; + const rootCertificates: readonly string[]; } declare module "node:tls" { export * from "tls"; diff --git a/dist/node_modules/@types/node/trace_events.d.ts b/dist/node_modules/@types/node/trace_events.d.ts index 3361359..b9d498e 100644 --- a/dist/node_modules/@types/node/trace_events.d.ts +++ b/dist/node_modules/@types/node/trace_events.d.ts @@ -1,40 +1,36 @@ /** - * The `node:trace_events` module provides a mechanism to centralize tracing - * information generated by V8, Node.js core, and userspace code. + * The `node:trace_events` module provides a mechanism to centralize tracing information + * generated by V8, Node.js core, and userspace code. * * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `node:trace_events` module. The `--trace-event-categories` flag + * or by using the `trace_events` module. The `--trace-event-categories` flag * accepts a list of comma-separated category names. * * The available categories are: * * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html) trace data. + * The [`async_hooks`](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool - * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool - * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.console`: Enables capture of `console.time()` and `console.count()` output. + * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. * * `node.dns.native`: Enables capture of trace data for DNS queries. * * `node.net.native`: Enables capture of trace data for network. * * `node.environment`: Enables capture of Node.js Environment milestones. * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.fs_dir.sync`: Enables capture of trace data for file system sync - * directory methods. + * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods. * * `node.fs.async`: Enables capture of trace data for file system async methods. - * * `node.fs_dir.async`: Enables capture of trace data for file system async - * directory methods. - * * `node.perf`: Enables capture of `Performance API` measurements. + * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods. + * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v20.x/api/perf_hooks.html) measurements. * * `node.perf.usertiming`: Enables capture of only Performance API User Timing * measures and marks. * * `node.perf.timerify`: Enables capture of only Performance API timerify * measurements. * * `node.promises.rejections`: Enables capture of trace data tracking the number * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. + * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. + * * `v8`: The [V8](https://nodejs.org/docs/latest-v20.x/api/v8.html) events are GC, compiling, and execution related. * * `node.http`: Enables capture of trace data for http request / response. * * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. @@ -43,8 +39,8 @@ * node --trace-event-categories v8,node,node.async_hooks server.js * ``` * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. + * Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be + * used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default. * * ```bash * node --trace-events-enabled @@ -69,7 +65,7 @@ * Running Node.js with tracing enabled will produce log files that can be opened * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can + * The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can * be specified with `--trace-event-file-pattern` that accepts a template * string that supports `${rotation}` and `${pid}`: * @@ -77,7 +73,7 @@ * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js * ``` * - * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers + * To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers * in your code, such as: * * ```js @@ -92,9 +88,9 @@ * However the trace-event timestamps are expressed in microseconds, * unlike `process.hrtime()` which returns nanoseconds. * - * The features from this module are not available in `Worker` threads. + * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html#class-worker) threads. * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js) + * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/trace_events.js) */ declare module "trace_events" { /** @@ -111,6 +107,7 @@ declare module "trace_events" { /** * A comma-separated list of the trace event categories covered by this * `Tracing` object. + * @since v10.0.0 */ readonly categories: string; /** @@ -119,15 +116,34 @@ declare module "trace_events" { * Only trace event categories _not_ covered by other enabled `Tracing` * objects and _not_ specified by the `--trace-event-categories` flag * will be disabled. + * + * ```js + * const trace_events = require('node:trace_events'); + * const t1 = trace_events.createTracing({ categories: ['node', 'v8'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] }); + * t1.enable(); + * t2.enable(); + * + * // Prints 'node,node.perf,v8' + * console.log(trace_events.getEnabledCategories()); + * + * t2.disable(); // Will only disable emission of the 'node.perf' category + * + * // Prints 'node,v8' + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 */ disable(): void; /** * Enables this `Tracing` object for the set of categories covered by * the `Tracing` object. + * @since v10.0.0 */ enable(): void; /** * `true` only if the `Tracing` object has been enabled. + * @since v10.0.0 */ readonly enabled: boolean; } @@ -151,7 +167,6 @@ declare module "trace_events" { * tracing.disable(); * ``` * @since v10.0.0 - * @return . */ function createTracing(options: CreateTracingOptions): Tracing; /** @@ -160,7 +175,7 @@ declare module "trace_events" { * by the _union_ of all currently-enabled `Tracing` objects and any categories * enabled using the `--trace-event-categories` flag. * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. + * Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console. * * ```js * const trace_events = require('node:trace_events'); diff --git a/dist/node_modules/@types/node/ts4.8/assert.d.ts b/dist/node_modules/@types/node/ts4.8/assert.d.ts deleted file mode 100644 index e237c56..0000000 --- a/dist/node_modules/@types/node/ts4.8/assert.d.ts +++ /dev/null @@ -1,996 +0,0 @@ -/** - * The `node:assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) - */ -declare module "assert" { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - /** - * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. - */ - actual: unknown; - /** - * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. - */ - expected: unknown; - /** - * Set to the passed in operator value. - */ - operator: string; - /** - * Indicates if the message was auto-generated (`true`) or not. - */ - generatedMessage: boolean; - /** - * Value is always `ERR_ASSERTION` to show that the error is an assertion error. - */ - code: "ERR_ASSERTION"; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // tslint:disable-next-line:ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn - * @return An Array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An Array of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. - * If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // tslint:disable-next-line:ban-types - stackStartFn?: Function, - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'node:assert'; - * - * const obj1 = { - * a: { - * b: 1, - * }, - * }; - * const obj2 = { - * a: { - * b: 2, - * }, - * }; - * const obj3 = { - * a: { - * b: 1, - * }, - * }; - * const obj4 = { __proto__: obj1 }; - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'node:assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text', - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text', - * }, - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * }, - * ); - * - * // Using regular expressions to validate error properties: - * assert.throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text', - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i, - * }, - * ); - * - * // Fails due to the different `message` and `name` properties: - * assert.throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err, - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error, - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/, - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error', - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'node:assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops', - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error, - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject( - block: (() => Promise) | Promise, - message?: string | Error, - ): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: - & Omit< - typeof assert, - | "equal" - | "notEqual" - | "deepEqual" - | "notDeepEqual" - | "ok" - | "strictEqual" - | "deepStrictEqual" - | "ifError" - | "strict" - > - & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module "node:assert" { - import assert = require("assert"); - export = assert; -} diff --git a/dist/node_modules/@types/node/ts4.8/assert/strict.d.ts b/dist/node_modules/@types/node/ts4.8/assert/strict.d.ts deleted file mode 100644 index f333913..0000000 --- a/dist/node_modules/@types/node/ts4.8/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "assert/strict" { - import { strict } from "node:assert"; - export = strict; -} -declare module "node:assert/strict" { - import { strict } from "node:assert"; - export = strict; -} diff --git a/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts b/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts deleted file mode 100644 index 0667a61..0000000 --- a/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * We strongly discourage the use of the `async_hooks` API. - * Other APIs that can cover most of its use cases include: - * - * * `AsyncLocalStorage` tracks async context - * * `process.getActiveResourcesInfo()` tracks active resources - * - * The `node:async_hooks` module provides an API to track asynchronous resources. - * It can be accessed using: - * - * ```js - * import async_hooks from 'node:async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js) - */ -declare module "async_hooks" { - /** - * ```js - * import { executionAsyncId } from 'node:async_hooks'; - * import fs from 'node:fs'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * const path = '.'; - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'node:fs'; - * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'node:http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook, - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * }, - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in before is completed. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'node:async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { }, - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg, - ): Func; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>(fn: Func): Func; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope( - fn: (this: This, ...args: any[]) => Result, - thisArg?: This, - ...args: any[] - ): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory - * safe implementation that involves significant optimizations that are non-obvious - * to implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'node:http'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Binds the given function to the current execution context. - * @since v19.8.0 - * @experimental - * @param fn The function to bind to the current execution context. - * @return A new function that calls `fn` within the captured execution context. - */ - static bind any>(fn: Func): Func; - /** - * Captures the current execution context and returns a function that accepts a - * function as an argument. Whenever the returned function is called, it - * calls the function passed to it within the captured context. - * - * ```js - * const asyncLocalStorage = new AsyncLocalStorage(); - * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); - * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); - * console.log(result); // returns 123 - * ``` - * - * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple - * async context tracking purposes, for example: - * - * ```js - * class Foo { - * #runInAsyncScope = AsyncLocalStorage.snapshot(); - * - * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } - * } - * - * const foo = asyncLocalStorage.run(123, () => new Foo()); - * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 - * ``` - * @since v19.8.0 - * @experimental - * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. - */ - static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: () => R): R; - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module "node:async_hooks" { - export * from "async_hooks"; -} diff --git a/dist/node_modules/@types/node/ts4.8/buffer.d.ts b/dist/node_modules/@types/node/ts4.8/buffer.d.ts deleted file mode 100644 index a2dbc71..0000000 --- a/dist/node_modules/@types/node/ts4.8/buffer.d.ts +++ /dev/null @@ -1,2362 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js) - */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * This function returns `true` if `input` contains only valid UTF-8-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.4.0, v18.14.0 - * @param input The input to validate. - */ - export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - /** - * This function returns `true` if `input` contains only valid ASCII-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.6.0, v18.15.0 - * @param input The input to validate. - */ - export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "latin1" - | "binary"; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'node:buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new(size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export interface FileOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be - * converted to the platform native line-ending as specified by `require('node:os').EOL`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - import { Blob as NodeBlob } from "buffer"; - // This conditional type will be the existing global Blob in a browser, or - // the copy below in a Node environment. - type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob; - global { - namespace NodeJS { - export { BufferEncoding }; - } - // Buffer class - type BufferEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex"; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: ReadonlyArray): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new(buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`\-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from( - arrayBuffer: WithImplicitCoercion, - byteOffset?: number, - length?: number, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | ReadonlyArray): Buffer; - from(data: WithImplicitCoercion | string>): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: "string"): string; - }, - encoding?: BufferEncoding, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength( - string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, - encoding?: BufferEncoding, - ): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: ReadonlyArray, totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=': 0'] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: "Buffer"; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare( - target: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number, - ): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * - * // Fill a buffer with empty string - * const c = Buffer.allocUnsafe(5).fill(''); - * - * console.log(c.fill('')); - * // Prints: - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends __Blob {} - /** - * `Blob` class is a global reference for `require('node:buffer').Blob` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { - onmessage: any; - Blob: infer T; - } ? T - : typeof NodeBlob; - } -} -declare module "node:buffer" { - export * from "buffer"; -} diff --git a/dist/node_modules/@types/node/ts4.8/child_process.d.ts b/dist/node_modules/@types/node/ts4.8/child_process.d.ts deleted file mode 100644 index 9f1a38a..0000000 --- a/dist/node_modules/@types/node/ts4.8/child_process.d.ts +++ /dev/null @@ -1,1540 +0,0 @@ -/** - * The `node:child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('node:child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `node:child_process` module provides a handful of - * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js) - */ -declare module "child_process" { - import { ObjectEncodingOptions } from "node:fs"; - import { Abortable, EventEmitter } from "node:events"; - import * as net from "node:net"; - import { Pipe, Readable, Stream, Writable } from "node:stream"; - import { URL } from "node:url"; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('node:assert'); - * const fs = require('node:fs'); - * const child_process = require('node:child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ], - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined, // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('node:child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('node:child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'], - * }, - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * Calls {@link ChildProcess.kill} with `'SIGTERM'`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('node:child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('node:child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('node:net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only - * supported on Unix platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('node:child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('node:net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send( - message: Serializable, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio - extends ChildProcess - { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; - type StdioOptions = IOType | Array; - type SerializationType = "json" | "advanced"; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default false - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = "inherit" | "ignore" | Stream; - type StdioPipeNamed = "pipe" | "overlapped"; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env, - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('node:child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('node:child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('node:child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve - * it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn( - command: string, - args?: ReadonlyArray, - options?: SpawnOptionsWithoutStdio, - ): ChildProcessWithoutNullStreams; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('node:child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('node:child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('node:util'); - * const exec = util.promisify(require('node:child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec( - command: string, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: "buffer" | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = - & Omit - & Omit - & { code?: string | number | undefined | null }; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('node:child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('node:util'); - * const execFile = util.promisify(require('node:child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile( - file: string, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile( - file: string, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile( - file: string, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: "buffer" | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; - function spawnSync( - command: string, - args: ReadonlyArray, - options: SpawnSyncOptionsWithStringEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args: ReadonlyArray, - options: SpawnSyncOptionsWithBufferEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args?: ReadonlyArray, - options?: SpawnSyncOptions, - ): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - /** - * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: "buffer" | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: "buffer" | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: ReadonlyArray): Buffer; - function execFileSync( - file: string, - args: ReadonlyArray, - options: ExecFileSyncOptionsWithStringEncoding, - ): string; - function execFileSync( - file: string, - args: ReadonlyArray, - options: ExecFileSyncOptionsWithBufferEncoding, - ): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; -} -declare module "node:child_process" { - export * from "child_process"; -} diff --git a/dist/node_modules/@types/node/ts4.8/cluster.d.ts b/dist/node_modules/@types/node/ts4.8/cluster.d.ts deleted file mode 100644 index 39cd56a..0000000 --- a/dist/node_modules/@types/node/ts4.8/cluster.d.ts +++ /dev/null @@ -1,432 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process - * isolation is not needed, use the `worker_threads` module instead, which - * allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js) - */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - serialization?: SerializationType | undefined; - cwd?: string | undefined; - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker, this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('node:net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener( - event: "message", - listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; -} diff --git a/dist/node_modules/@types/node/ts4.8/console.d.ts b/dist/node_modules/@types/node/ts4.8/console.d.ts deleted file mode 100644 index 8ea5e17..0000000 --- a/dist/node_modules/@types/node/ts4.8/console.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** - * The `node:console` module provides a simple debugging console that is similar to - * the JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js) - */ -declare module "console" { - import console = require("node:console"); - export = console; -} -declare module "node:console" { - import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: ReadonlyArray): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | "auto" | undefined; - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/dist/node_modules/@types/node/ts4.8/constants.d.ts b/dist/node_modules/@types/node/ts4.8/constants.d.ts deleted file mode 100644 index c3ac2b8..0000000 --- a/dist/node_modules/@types/node/ts4.8/constants.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module "constants" { - import { constants as osConstants, SignalConstants } from "node:os"; - import { constants as cryptoConstants } from "node:crypto"; - import { constants as fsConstants } from "node:fs"; - - const exp: - & typeof osConstants.errno - & typeof osConstants.priority - & SignalConstants - & typeof cryptoConstants - & typeof fsConstants; - export = exp; -} - -declare module "node:constants" { - import constants = require("constants"); - export = constants; -} diff --git a/dist/node_modules/@types/node/ts4.8/crypto.d.ts b/dist/node_modules/@types/node/ts4.8/crypto.d.ts deleted file mode 100644 index 91d68fe..0000000 --- a/dist/node_modules/@types/node/ts4.8/crypto.d.ts +++ /dev/null @@ -1,4455 +0,0 @@ -/** - * The `node:crypto` module provides cryptographic functionality that includes a - * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify - * functions. - * - * ```js - * const { createHmac } = await import('node:crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js) - */ -declare module "crypto" { - import * as stream from "node:stream"; - import { PeerCertificate } from "node:tls"; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of HTML5's `keygen` element. - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'node:buffer'; - * const { Certificate } = await import('node:crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - const SSL_OP_NO_SSLv2: number; - const SSL_OP_NO_SSLv3: number; - const SSL_OP_NO_TICKET: number; - const SSL_OP_NO_TLSv1: number; - const SSL_OP_NO_TLSv1_1: number; - const SSL_OP_NO_TLSv1_2: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHash, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was - * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not - * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; - type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; - type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { createHash } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: stream.TransformOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: "jwk"; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { KeyObject } = await import('node:crypto'); - * const { subtle } = globalThis.crypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256, - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<"pem">): string | Buffer; - export(options?: KeyExportOptions<"der">): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305"; - type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; - type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): CipherCCM; - function createCipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): CipherOCB; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): CipherGCM; - function createCipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * - * import { - * pipeline, - * } from 'node:stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): DecipherOCB; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * let chunk; - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; - passphrase?: string | Buffer | undefined; - encoding?: string | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; - encoding?: string | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey, - * } = await import('node:crypto'); - * - * generateKey('hmac', { length: 512 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: "hmac" | "aes", - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void, - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync, - * } = await import('node:crypto'); - * - * const key = generateKeySync('hmac', { length: 512 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: "hmac" | "aes", - options: { - length: number; - }, - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: "jwk"; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = "der" | "ieee-p1363"; - interface SigningOptions { - /** - * @see crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1', - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign( - privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - outputFormat: BinaryToTextEncoding, - ): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: string, - signature_format?: BinaryToTextEncoding, - ): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createDiffieHellman, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values unless they have been - * generated or computed already, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, - * once a private key has been generated or set, calling this function only updates - * the public key but does not generate a new private key. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding: null, - outputEncoding: BinaryToTextEncoding, - ): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * - * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be - * used to manually provide the public key or to automatically derive it. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `node:constants` module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are listed in the documentation for `DiffieHellmanGroup`. - * - * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman, - * } = await import('node:crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2, - * } = await import('node:crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync, - * } = await import('node:crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - ): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 248. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill( - buffer: T, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - size: number, - callback: (err: Error | null, buf: T) => void, - ): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt, - * } = await import('node:crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync, - * } = await import('node:crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers, - * } = await import('node:crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves, - * } = await import('node:crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. - * Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes, - * } = await import('node:crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createECDH, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH, - * } = await import('node:crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: "latin1" | "hex" | "base64" | "base64url", - format?: "uncompressed" | "compressed" | "hybrid", - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time - * algorithm. - * - * This function does not leak timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point** - * **numbers `x` and `y` are equal.** - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync, - * } = await import('node:crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair, - * } = await import('node:crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - ): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void, - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void, - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdf, - * } = await import('node:crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf( - digest: string, - irm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: ArrayBuffer) => void, - ): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdfSync, - * } = await import('node:crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync( - digest: string, - ikm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - ): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): string; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject?: "always" | "default" | "never"; - /** - * @default true - */ - wildcards?: boolean; - /** - * @default true - */ - partialWildcards?: boolean; - /** - * @default false - */ - multiLabelWildcards?: boolean; - /** - * @default false - */ - singleLabelSubdomains?: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('node:crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * - * Because computing the SHA-256 fingerprint is usually faster and because it is - * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be - * a better choice. While SHA-512 presumably provides a higher level of security in - * general, the security of SHA-256 matches that of most algorithms that are - * commonly used to sign certificates. - * @since v17.2.0, v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * - * This is a comma-separated list of subject alternative names. Each entry begins - * with a string identifying the kind of the subject alternative name followed by - * a colon and the value associated with the entry. - * - * Earlier versions of Node.js incorrectly assumed that it is safe to split this - * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, - * both malicious and legitimate certificates can contain subject alternative names - * that include this sequence when represented as a string. - * - * After the prefix denoting the type of the entry, the remainder of each entry - * might be enclosed in quotes to indicate that the value is a JSON string literal. - * For backward compatibility, Node.js only uses JSON string literals within this - * property when necessary to avoid ambiguity. Third-party code should be prepared - * to handle both possible entry formats. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * A textual representation of the certificate's authority information access - * extension. - * - * This is a line feed separated list of access descriptions. Each line begins with - * the access method and the kind of the access location, followed by a colon and - * the value associated with the access location. - * - * After the prefix denoting the access method and the kind of the access location, - * the remainder of each line might be enclosed in quotes to indicate that the - * value is a JSON string literal. For backward compatibility, Node.js only uses - * JSON string literals within this property when necessary to avoid ambiguity. - * Third-party code should be prepared to handle both possible entry formats. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsBigInt, - callback: (err: Error | null, prime: bigint) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsArrayBuffer, - callback: (err: Error | null, prime: ArrayBuffer) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptions, - callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, - ): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime( - value: LargeNumberLike, - options: CheckPrimeOptions, - callback: (err: Error | null, result: boolean) => void, - ): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`): - * - * * `crypto.constants.ENGINE_METHOD_RSA` - * * `crypto.constants.ENGINE_METHOD_DSA` - * * `crypto.constants.ENGINE_METHOD_DH` - * * `crypto.constants.ENGINE_METHOD_RAND` - * * `crypto.constants.ENGINE_METHOD_EC` - * * `crypto.constants.ENGINE_METHOD_CIPHERS` - * * `crypto.constants.ENGINE_METHOD_DIGESTS` - * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * * `crypto.constants.ENGINE_METHOD_ALL` - * * `crypto.constants.ENGINE_METHOD_NONE` - * @since v0.11.11 - * @param flags - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for {@link webcrypto.getRandomValues}. This - * implementation is not compliant with the Web Crypto spec, to write - * web-compatible code use {@link webcrypto.getRandomValues} instead. - * @since v17.4.0 - * @return Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; - type KeyType = "private" | "public" | "secret"; - type KeyUsage = - | "decrypt" - | "deriveBits" - | "deriveKey" - | "encrypt" - | "sign" - | "unwrapKey" - | "verify" - | "wrapKey"; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): string; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: "CryptoKey"; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits( - algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: - | AlgorithmIdentifier - | AesDerivedKeyParams - | HmacImportParams - | HkdfParams - | Pbkdf2Params, - extractable: boolean, - keyUsages: ReadonlyArray, - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: "jwk", key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey( - algorithm: RsaHashedKeyGenParams | EcKeyGenParams, - extractable: boolean, - keyUsages: ReadonlyArray, - ): Promise; - generateKey( - algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, - extractable: boolean, - keyUsages: ReadonlyArray, - ): Promise; - generateKey( - algorithm: AlgorithmIdentifier, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: "jwk", - keyData: JsonWebKey, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: ReadonlyArray, - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - signature: BufferSource, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey( - format: KeyFormat, - key: CryptoKey, - wrappingKey: CryptoKey, - wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - ): Promise; - } - } -} -declare module "node:crypto" { - export * from "crypto"; -} diff --git a/dist/node_modules/@types/node/ts4.8/dgram.d.ts b/dist/node_modules/@types/node/ts4.8/dgram.d.ts deleted file mode 100644 index 79cfcd4..0000000 --- a/dist/node_modules/@types/node/ts4.8/dgram.d.ts +++ /dev/null @@ -1,586 +0,0 @@ -/** - * The `node:dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js) - */ -declare module "dgram" { - import { AddressInfo } from "node:net"; - import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; - interface RemoteInfo { - address: string; - family: "IPv4" | "IPv6"; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = "udp4" | "udp6"; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: - | (( - hostname: string, - options: dns.LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ) => void) - | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'node:cluster'; - * import dgram from 'node:dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send( - msg: string | Uint8Array | ReadonlyArray, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | ReadonlyArray, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | ReadonlyArray, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no addition effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - /** - * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } -} -declare module "node:dgram" { - export * from "dgram"; -} diff --git a/dist/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/dist/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts deleted file mode 100644 index b02f591..0000000 --- a/dist/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -/** - * The `node:diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) - */ -declare module "diagnostics_channel" { - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string | symbol): boolean; - /** - * This is the primary entry-point for anyone wanting to publish to a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string | symbol): Channel; - type ChannelListener = (message: unknown, name: string | symbol) => void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * diagnostics_channel.subscribe('my-channel', (message, name) => { - * // Received data - * }); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The handler to receive channel messages - */ - function subscribe(name: string | symbol, onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with {@link subscribe}. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * function onMessage(message, name) { - * // Received data - * } - * - * diagnostics_channel.subscribe('my-channel', onMessage); - * - * diagnostics_channel.unsubscribe('my-channel', onMessage); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is used to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string | symbol; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string | symbol); - /** - * Publish a message to any subscribers to the channel. This will trigger - * message handlers synchronously so they will execute within the same context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message', - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - } -} -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; -} diff --git a/dist/node_modules/@types/node/ts4.8/dns.d.ts b/dist/node_modules/@types/node/ts4.8/dns.d.ts deleted file mode 100644 index bef32b1..0000000 --- a/dist/node_modules/@types/node/ts4.8/dns.d.ts +++ /dev/null @@ -1,809 +0,0 @@ -/** - * The `node:dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('node:dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `node:dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('node:dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) - */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - /** - * @default true - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then - * IPv4 and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('node:dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup( - hostname: string, - family: number, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, - ): void; - export function lookup( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('node:dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService( - address: string, - port: number, - callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, - ): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: "A"; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - export interface CaaRecord { - critical: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: "MX"; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - export interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - export interface AnyNsRecord { - type: "NS"; - value: string; - } - export interface AnyPtrRecord { - type: "PTR"; - value: string; - } - export interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - export type AnyRecord = - | AnyARecord - | AnyAaaaRecord - | AnyCnameRecord - | AnyMxRecord - | AnyNaptrRecord - | AnyNsRecord - | AnyPtrRecord - | AnySoaRecord - | AnySrvRecord - | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "A", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "AAAA", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "ANY", - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "CNAME", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "MX", - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NAPTR", - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NS", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "PTR", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SOA", - callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SRV", - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "TXT", - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: string, - callback: ( - err: NodeJS.ErrnoException | null, - addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[], - ) => void, - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__( - hostname: string, - rrtype: string, - ): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, - ): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, - ): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse( - ip: string, - callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, - ): void; - /** - * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - export function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: ReadonlyArray): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default - * dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('node:dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `node:dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module "node:dns" { - export * from "dns"; -} diff --git a/dist/node_modules/@types/node/ts4.8/dns/promises.d.ts b/dist/node_modules/@types/node/ts4.8/dns/promises.d.ts deleted file mode 100644 index 79d8b07..0000000 --- a/dist/node_modules/@types/node/ts4.8/dns/promises.d.ts +++ /dev/null @@ -1,417 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('node:dns').promises` or `require('node:dns/promises')`. - * @since v10.6.0 - */ -declare module "dns/promises" { - import { - AnyRecord, - CaaRecord, - LookupAddress, - LookupAllOptions, - LookupOneOptions, - LookupOptions, - MxRecord, - NaptrRecord, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - ResolveWithTtlOptions, - SoaRecord, - SrvRecord, - } from "node:dns"; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('node:dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('node:dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A"): Promise; - function resolve(hostname: string, rrtype: "AAAA"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CAA"): Promise; - function resolve(hostname: string, rrtype: "CNAME"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "NS"): Promise; - function resolve(hostname: string, rrtype: "PTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve( - hostname: string, - rrtype: string, - ): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: ReadonlyArray): void; - /** - * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have - * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the - * default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('node:dns').promises; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org').then((addresses) => { - * // ... - * }); - * - * // Alternatively, the same code can be written using async-await style. - * (async function() { - * const addresses = await resolver.resolve4('example.org'); - * })(); - * ``` - * - * The following methods from the `dnsPromises` API are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v10.6.0 - */ - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module "node:dns/promises" { - export * from "dns/promises"; -} diff --git a/dist/node_modules/@types/node/ts4.8/dom-events.d.ts b/dist/node_modules/@types/node/ts4.8/dom-events.d.ts deleted file mode 100644 index 147a7b6..0000000 --- a/dist/node_modules/@types/node/ts4.8/dom-events.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -export {}; // Don't export anything! - -//// DOM-like Events -// NB: The Event / EventTarget / EventListener implementations below were copied -// from lib.dom.d.ts, then edited to reflect Node's documentation at -// https://nodejs.org/api/events.html#class-eventtarget. -// Please read that link to understand important implementation differences. - -// This conditional type will be the existing global Event in a browser, or -// the copy below in a Node environment. -type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {} - : { - /** This is not used in Node.js and is provided purely for completeness. */ - readonly bubbles: boolean; - /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ - cancelBubble: () => void; - /** True if the event was created with the cancelable option */ - readonly cancelable: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly composed: boolean; - /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ - composedPath(): [EventTarget?]; - /** Alias for event.target. */ - readonly currentTarget: EventTarget | null; - /** Is true if cancelable is true and event.preventDefault() has been called. */ - readonly defaultPrevented: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly eventPhase: 0 | 2; - /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ - readonly isTrusted: boolean; - /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ - preventDefault(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - returnValue: boolean; - /** Alias for event.target. */ - readonly srcElement: EventTarget | null; - /** Stops the invocation of event listeners after the current one completes. */ - stopImmediatePropagation(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - stopPropagation(): void; - /** The `EventTarget` dispatching the event */ - readonly target: EventTarget | null; - /** The millisecond timestamp when the Event object was created. */ - readonly timeStamp: number; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; - }; - -// See comment above explaining conditional type -type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {} - : { - /** - * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. - * - * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. - * - * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. - * Specifically, the `capture` option is used as part of the key when registering a `listener`. - * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. - */ - addEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: AddEventListenerOptions | boolean, - ): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: EventListenerOptions | boolean, - ): void; - }; - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ - capture?: boolean; -} - -interface AddEventListenerOptions extends EventListenerOptions { - /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ - once?: boolean; - /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ - passive?: boolean; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -import {} from "events"; // Make this an ambient declaration -declare global { - /** An event which takes place in the DOM. */ - interface Event extends __Event {} - var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T - : { - prototype: __Event; - new(type: string, eventInitDict?: EventInit): __Event; - }; - - /** - * EventTarget is a DOM interface implemented by objects that can - * receive events and may have listeners for them. - */ - interface EventTarget extends __EventTarget {} - var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T - : { - prototype: __EventTarget; - new(): __EventTarget; - }; -} diff --git a/dist/node_modules/@types/node/ts4.8/domain.d.ts b/dist/node_modules/@types/node/ts4.8/domain.d.ts deleted file mode 100644 index 72f17bd..0000000 --- a/dist/node_modules/@types/node/ts4.8/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js) - */ -declare module "domain" { - import EventEmitter = require("node:events"); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and low-level requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('node:domain'); - * const fs = require('node:fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module "node:domain" { - export * from "domain"; -} diff --git a/dist/node_modules/@types/node/ts4.8/events.d.ts b/dist/node_modules/@types/node/ts4.8/events.d.ts deleted file mode 100644 index 4d33044..0000000 --- a/dist/node_modules/@types/node/ts4.8/events.d.ts +++ /dev/null @@ -1,796 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js) - */ -declare module "events" { - // NOTE: This class is in the docs but is **not actually exported** by Node. - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node - // actually starts exporting the class, uncomment below. - // import { EventListener, EventListenerObject } from '__dom-events'; - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ - // interface NodeEventTarget extends EventTarget { - // /** - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. - // */ - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ - // eventNames(): string[]; - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ - // listenerCount(type: string): number; - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ - // off(type: string, listener: EventListener | EventListenerObject): this; - // /** Node.js-specific alias for `eventTarget.addListener()`. */ - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ - // once(type: string, listener: EventListener | EventListenerObject): this; - // /** - // * Node.js-specific extension to the `EventTarget` class. - // * If `type` is specified, removes all registered listeners for `type`, - // * otherwise removes all registered listeners. - // */ - // removeAllListeners(type: string): this; - // /** - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. - // */ - // removeListener(type: string, listener: EventListener | EventListenerObject): this; - // } - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - // Any EventTarget with a Node-style `once` function - interface _NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - // Any EventTarget with a DOM-style `addEventListener` - interface _DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - }, - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `node:events` module: - * - * ```js - * import { EventEmitter } from 'node:events'; - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: _NodeEventTarget, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string, - options?: StaticEventEmitterOptions, - ): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @experimental - * @return that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_`EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - } - global { - namespace NodeJS { - interface EventEmitter { - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * import { EventEmitter } from 'node:events'; - * class MyEmitter extends EventEmitter {} - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: string | symbol, listener?: Function): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module "node:events" { - import events = require("events"); - export = events; -} diff --git a/dist/node_modules/@types/node/ts4.8/fs.d.ts b/dist/node_modules/@types/node/ts4.8/fs.d.ts deleted file mode 100644 index 3f5d9a1..0000000 --- a/dist/node_modules/@types/node/ts4.8/fs.d.ts +++ /dev/null @@ -1,4289 +0,0 @@ -/** - * The `node:fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'node:fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'node:fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js) - */ -declare module "fs" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | "buffer" - | { - encoding: "buffer"; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - export interface StatsFsBase { - /** Type of file system. */ - type: T; - /** Optimal transfer block size. */ - bsize: T; - /** Total data blocks in file system. */ - blocks: T; - /** Free blocks in file system. */ - bfree: T; - /** Available blocks for unprivileged users */ - bavail: T; - /** Total file nodes in file system. */ - files: T; - /** Free file nodes in file system. */ - ffree: T; - } - export interface StatsFs extends StatsFsBase {} - /** - * Provides information about a mounted file system. - * - * Objects returned from {@link statfs} and its synchronous counterpart are of - * this type. If `bigint` in the `options` passed to those methods is `true`, the - * numeric values will be `bigint` instead of `number`. - * - * ```console - * StatFs { - * type: 1397114950, - * bsize: 4096, - * blocks: 121938943, - * bfree: 61058895, - * bavail: 61058895, - * files: 999, - * ffree: 1000000 - * } - * ``` - * - * `bigint` version: - * - * ```console - * StatFs { - * type: 1397114950n, - * bsize: 4096n, - * blocks: 121938943n, - * bfree: 61058895n, - * bavail: 61058895n, - * files: 999n, - * ffree: 1000000n - * } - * ``` - * @since v19.6.0, v18.15.0 - */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { - bigint?: boolean | undefined; - } - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - /** - * The base path that this `fs.Dirent` object refers to. - * @since v20.1.0 - */ - path: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be resolved after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * events.EventEmitter - * 1. change - * 2. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "close", listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "close", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "close", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "close", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "ready", listener: () => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "ready", listener: () => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'node:fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'node:fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * {@link stat} follows symbolic links. Use {@link lstat} to look at the - * links themselves. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'node:fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - }, - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - }, - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - }, - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - }, - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - }, - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( - path: PathLike, - options: - | (StatFsOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, - ): void; - export namespace statfs { - /** - * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. - * @param path A path to an existing file or directory on the file system to be queried. - */ - function __promisify__( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatFsOptions): Promise; - } - /** - * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfsSync( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): StatsFs; - export function statfsSync( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. - * If the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction - * points on NTFS volumes can only point to directories. - * - * Relative targets are relative to the link's parent directory. - * - * ```js - * import { symlink } from 'node:fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - * @param [type='null'] - */ - export function symlink( - target: PathLike, - path: PathLike, - type: symlink.Type | undefined | null, - callback: NoParamCallback, - ): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = "dir" | "file" | "junction"; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - * @param [type='null'] - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..`, and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - function native( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - function native( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created (for instance, if it was previously created). - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. If `recursive` is false and the directory exists, - * an `EEXIST` error occurs. - * - * ```js - * import { mkdir } from 'node:fs'; - * - * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. - * mkdir('./tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'node:fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: Mode | MakeDirectoryOptions | null | undefined, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: Mode | MakeDirectoryOptions | null, - ): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('node:path').sep`). - * - * ```js - * import { tmpdir } from 'node:os'; - * import { mkdtemp } from 'node:fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'node:path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | "buffer" - | { - encoding: "buffer"; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp( - prefix: string, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | "buffer" - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - mode: Mode | undefined | null, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write( - fd: number, - string: string, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - * @return The number of bytes written. - */ - export function writeSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset?: number | null, - length?: number | null, - position?: number | null, - ): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void, - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - * @param [position='null'] - */ - export function readSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset: number, - length: number, - position: ReadPosition | null, - ): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile( - path: PathOrFileDescriptor, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): string | Buffer; - export type WriteFileOptions = - | ( - & ObjectEncodingOptions - & Abortable - & { - mode?: Mode | undefined; - flag?: string | undefined; - } - ) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'node:fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - callback: NoParamCallback, - ): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__( - file: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'node:fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: StatsListener, - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: BigIntStatsListener, - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | "buffer" | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options?: WatchOptions | BufferEncoding | null, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: WatchOptions | string, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'node:fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won't be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'node:fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'node:fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'node:fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - signal?: AbortSignal | null | undefined; - highWaterMark?: number | undefined; - } - interface FSImplementation { - open?: (...args: any[]) => any; - close?: (...args: any[]) => any; - } - interface CreateReadStreamFSImplementation extends FSImplementation { - read: (...args: any[]) => any; - } - interface CreateWriteStreamFSImplementation extends FSImplementation { - write: (...args: any[]) => any; - writev?: (...args: any[]) => any; - } - interface ReadStreamOptions extends StreamOptions { - fs?: CreateReadStreamFSImplementation | null | undefined; - end?: number | undefined; - } - interface WriteStreamOptions extends StreamOptions { - fs?: CreateWriteStreamFSImplementation | null | undefined; - } - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'node:fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'node:fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] - */ - export function writev( - fd: number, - buffers: ReadonlyArray, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function writev( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__( - fd: number, - buffers: ReadonlyArray, - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @param [position='null'] - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - */ - export function readv( - fd: number, - buffers: ReadonlyArray, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function readv( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__( - fd: number, - buffers: ReadonlyArray, - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; - - export interface OpenAsBlobOptions { - /** - * An optional mime type for the blob. - * - * @default 'undefined' - */ - type?: string | undefined; - } - - /** - * Returns a `Blob` whose data is backed by the given file. - * - * The file must not be modified after the `Blob` is created. Any modifications - * will cause reading the `Blob` data to fail with a `DOMException` error. - * Synchronous stat operations on the file when the `Blob` is created, and before - * each read in order to detect whether the file data has been modified on disk. - * - * ```js - * import { openAsBlob } from 'node:fs'; - * - * const blob = await openAsBlob('the.file.txt'); - * const ab = await blob.arrayBuffer(); - * blob.stream(); - * ``` - * @since v19.8.0 - * @experimental - */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - - export interface OpenDirOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - /** - * @default false - */ - recursive?: boolean; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( - path: PathLike, - options: OpenDirOptions, - cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, - ): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} - */ - mode?: number; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp( - source: string | URL, - destination: string | URL, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - export function cp( - source: string | URL, - destination: string | URL, - opts: CopyOptions, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; -} -declare module "node:fs" { - export * from "fs"; -} diff --git a/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts b/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts deleted file mode 100644 index 084ee6e..0000000 --- a/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts +++ /dev/null @@ -1,1232 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module "fs/promises" { - import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; - import { - BigIntStats, - BigIntStatsFs, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatFsOptions, - StatOptions, - Stats, - StatsFs, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T | null; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - } - interface ReadableWebStreamOptions { - /** - * Whether to open a normal or a `'bytes'` stream. - * @since v20.0.0 - */ - type?: "bytes" | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile( - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null, - ): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read( - buffer: T, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called - * after the `FileHandle` is closed or closing. - * - * ```js - * import { - * open, - * } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not - * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. - * @since v17.0.0 - * @experimental - */ - readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. - * See `filehandle.createReadStream()` for the options. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * @since v18.11.0 - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - }, - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is resolved with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile( - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null, - ): Promise; - /** - * Write `buffer` to the file. - * - * The promise is resolved with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param offset The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current - * position. See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is resolved with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be resolved (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: ReadonlyArray, position?: number): Promise; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: ReadonlyArray, position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - /** - * An alias for {@link FileHandle.close()}. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - const constants: typeof fsConstants; - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is resolved with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access, constants } from 'node:fs/promises'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { copyFile, constants } from 'node:fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * - * ```js - * import { mkdir } from 'node:fs/promises'; - * - * try { - * const projectFolder = new URL('./test/project/', import.meta.url); - * const createDir = await mkdir(projectFolder, { recursive: true }); - * - * console.log(`created ${createDir}`); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'node:fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * resolved with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will - * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not - * exist, `'file'` will be used. Windows junction points require the destination - * path to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. Junction points on NTFS volumes - * can only point to directories. - * @since v10.0.0 - * @param [type='null'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v19.6.0, v18.15.0 - * @return Fulfills with the {fs.StatFs} object for the given `path`. - */ - function statfs( - path: PathLike, - opts?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function statfs( - path: PathLike, - opts: StatFsOptions & { - bigint: true; - }, - ): Promise; - function statfs(path: PathLike, opts?: StatFsOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath( - path: PathLike, - options?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs/promises'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * try { - * await mkdtemp(join(tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('node:path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the file system path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs/promises'; - * import { Buffer } from 'node:buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: - | string - | NodeJS.ArrayBufferView - | Iterable - | AsyncIterable - | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile( - path: PathLike | FileHandle, - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * An example of reading a `package.json` file located in the same directory of the - * running code: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * try { - * const filePath = new URL('./package.json', import.meta.url); - * const contents = await readFile(filePath, { encoding: 'utf8' }); - * console.log(contents); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ( - & ObjectEncodingOptions - & Abortable - & { - flag?: OpenMode | undefined; - } - ) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('node:fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch( - filename: PathLike, - options: WatchOptions | string, - ): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; -} -declare module "node:fs/promises" { - export * from "fs/promises"; -} diff --git a/dist/node_modules/@types/node/ts4.8/globals.d.ts b/dist/node_modules/@types/node/ts4.8/globals.d.ts deleted file mode 100644 index 3a449e4..0000000 --- a/dist/node_modules/@types/node/ts4.8/globals.d.ts +++ /dev/null @@ -1,381 +0,0 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); - -// #region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; -} - -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; -} - -declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - -declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; -// #endregion borrowed - -// #region Disposable -interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; - - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; -} - -interface Disposable { - [Symbol.dispose](): void; -} - -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} -// #endregion Disposable - -// #region ArrayLike.at() -interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -// #endregion ArrayLike.at() end - -/** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ -declare function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, -): T; - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } - - namespace fetch { - type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; - type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; - type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; - type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; - type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; - type Request = globalThis.Request; - type Response = globalThis.Response; - type Headers = globalThis.Headers; - type FormData = globalThis.FormData; - type RequestInit = globalThis.RequestInit; - type RequestInfo = import("undici-types").RequestInfo; - type HeadersInit = import("undici-types").HeadersInit; - type BodyInit = import("undici-types").BodyInit; - type RequestRedirect = import("undici-types").RequestRedirect; - type RequestCredentials = import("undici-types").RequestCredentials; - type RequestMode = import("undici-types").RequestMode; - type ReferrerPolicy = import("undici-types").ReferrerPolicy; - type Dispatcher = import("undici-types").Dispatcher; - type RequestDuplex = import("undici-types").RequestDuplex; - } -} - -interface RequestInit extends NodeJS.fetch._RequestInit {} - -declare function fetch( - input: NodeJS.fetch.RequestInfo, - init?: RequestInit, -): Promise; - -interface Request extends NodeJS.fetch._Request {} -declare var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; -} ? T - : typeof import("undici-types").Request; - -interface Response extends NodeJS.fetch._Response {} -declare var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; -} ? T - : typeof import("undici-types").Response; - -interface FormData extends NodeJS.fetch._FormData {} -declare var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; -} ? T - : typeof import("undici-types").FormData; - -interface Headers extends NodeJS.fetch._Headers {} -declare var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; -} ? T - : typeof import("undici-types").Headers; diff --git a/dist/node_modules/@types/node/ts4.8/globals.global.d.ts b/dist/node_modules/@types/node/ts4.8/globals.global.d.ts deleted file mode 100644 index ef1198c..0000000 --- a/dist/node_modules/@types/node/ts4.8/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/dist/node_modules/@types/node/ts4.8/http.d.ts b/dist/node_modules/@types/node/ts4.8/http.d.ts deleted file mode 100644 index b06f541..0000000 --- a/dist/node_modules/@types/node/ts4.8/http.d.ts +++ /dev/null @@ -1,1888 +0,0 @@ -/** - * To use the HTTP server and client one must `require('node:http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'example.com', - * 'accept': '*' } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js) - */ -declare module "http" { - import * as stream from "node:stream"; - import { URL } from "node:url"; - import { LookupOptions } from "node:dns"; - import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - "accept-language"?: string | undefined; - "accept-patch"?: string | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - "alt-svc"?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - connection?: string | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-type"?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - "proxy-authenticate"?: string | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | undefined; - "sec-websocket-version"?: string | undefined; - "set-cookie"?: string[] | undefined; - "strict-transport-security"?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - upgrade?: string | undefined; - "user-agent"?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - "www-authenticate"?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict { - accept?: string | string[] | undefined; - "accept-charset"?: string | string[] | undefined; - "accept-encoding"?: string | string[] | undefined; - "accept-language"?: string | string[] | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - "cdn-cache-control"?: string | undefined; - connection?: string | string[] | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | number | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-security-policy"?: string | undefined; - "content-security-policy-report-only"?: string | undefined; - cookie?: string | string[] | undefined; - dav?: string | string[] | undefined; - dnt?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-range"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - link?: string | string[] | undefined; - location?: string | undefined; - "max-forwards"?: string | undefined; - origin?: string | undefined; - prgama?: string | string[] | undefined; - "proxy-authenticate"?: string | string[] | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - "public-key-pins-report-only"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "referrer-policy"?: string | undefined; - refresh?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | string[] | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | string[] | undefined; - "sec-websocket-version"?: string | undefined; - server?: string | undefined; - "set-cookie"?: string | string[] | undefined; - "strict-transport-security"?: string | undefined; - te?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - "user-agent"?: string | undefined; - upgrade?: string | undefined; - "upgrade-insecure-requests"?: string | undefined; - vary?: string | undefined; - via?: string | string[] | undefined; - warning?: string | undefined; - "www-authenticate"?: string | string[] | undefined; - "x-content-type-options"?: string | undefined; - "x-dns-prefetch-control"?: string | undefined; - "x-frame-options"?: string | undefined; - "x-xss-protection"?: string | undefined; - } - interface ClientRequestArgs { - _defaultAgent?: Agent | undefined; - agent?: Agent | boolean | undefined; - auth?: string | null | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: - | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) - | undefined; - defaultPort?: number | string | undefined; - family?: number | undefined; - headers?: OutgoingHttpHeaders | undefined; - hints?: LookupOptions["hints"]; - host?: string | null | undefined; - hostname?: string | null | undefined; - insecureHTTPParser?: boolean | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - lookup?: LookupFunction | undefined; - /** - * @default 16384 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - port?: number | string | null | undefined; - protocol?: string | null | undefined; - setHost?: boolean | undefined; - signal?: AbortSignal | undefined; - socketPath?: string | undefined; - timeout?: number | undefined; - uniqueHeaders?: Array | undefined; - joinDuplicateHeaders?: boolean; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > { - /** - * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. - */ - IncomingMessage?: Request | undefined; - /** - * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. - */ - ServerResponse?: Response | undefined; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @see Server.requestTimeout for more information. - * @default 300000 - * @since v18.0.0 - */ - requestTimeout?: number | undefined; - /** - * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. - * @default false - * @since v18.14.0 - */ - joinDuplicateHeaders?: boolean; - /** - * The number of milliseconds of inactivity a server needs to wait for additional incoming data, - * after it has finished writing the last response, before a socket will be destroyed. - * @see Server.keepAliveTimeout for more information. - * @default 5000 - * @since v18.0.0 - */ - keepAliveTimeout?: number | undefined; - /** - * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. - * @default 30000 - */ - connectionsCheckingInterval?: number | undefined; - /** - * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. - * Default: @see stream.getDefaultHighWaterMark(). - * @since v20.1.0 - */ - highWaterMark?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 16384 - * @since v13.3.0 - */ - maxHeaderSize?: number | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default true - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * A list of response headers that should be sent only once. - * If the header's value is an array, the items will be joined using `; `. - */ - uniqueHeaders?: Array | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request - * or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from - * the perspective of the participants of an HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Alias of `outgoingMessage.socket`. - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value. If the header already exists in the to-be-sent - * headers, its value will be replaced. Use an array of strings to send multiple - * headers with the same name. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | ReadonlyArray): this; - /** - * Append a single header value for the header object. - * - * If the value is an array, this is equivalent of calling this method multiple - * times. - * - * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`. - * - * Depending of the value of `options.uniqueHeaders` when the client request or the - * server were created, this will end up in the header being sent multiple times or - * a single time with values joined using `; `. - * @since v18.3.0, v16.17.0 - * @param name Header name - * @param value Header value - */ - appendHeader(name: string, value: string | ReadonlyArray): this; - /** - * Gets the value of the HTTP header with the given name. If that header is not - * set, the returned value will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript `Object`. This means that - * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers will **only** be emitted if the message is chunked encoded. If not, - * the trailers will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header field names in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Flushes the message headers. - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - /** - * If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal. - * Mismatching the `Content-Length` header value will result - * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * @since v18.10.0, v16.18.0 - */ - strictContentLength: boolean; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics', - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }, earlyHintsCallback); - * ``` - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain', - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * will check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a \[`Error`\]\[\] being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown, - * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * - * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * import http from 'node:http'; - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * import http from 'node:http'; - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "continue", listener: () => void): this; - on(event: "information", listener: (info: InformationEvent) => void): this; - on(event: "response", listener: (response: IncomingMessage) => void): this; - on(event: "socket", listener: (socket: Socket) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "continue", listener: () => void): this; - once(event: "information", listener: (info: InformationEvent) => void): this; - once(event: "response", listener: (response: IncomingMessage) => void): this; - once(event: "socket", listener: (socket: Socket) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers, and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST', - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * To allow duplicate values of the headers listed above to be joined, - * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more - * information. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with `; `. - * * For all other headers, the values are joined together with `, `. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * Similar to `message.headers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': ['curl/7.22.0'], - * // host: ['127.0.0.1:8000'], - * // accept: ['*'] } - * console.log(request.headersDistinct); - * ``` - * @since v18.3.0, v16.17.0 - */ - headersDistinct: NodeJS.Dict; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * Similar to `message.trailers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * Only populated at the `'end'` event. - * @since v18.3.0, v16.17.0 - */ - trailersDistinct: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.headers.host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.headers.host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: "fifo" | "lifo" | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false, // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent extends EventEmitter { - /** - * By default set to 256. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer(); - * - * // Listen to the request event - * server.on('request', (request, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import http from 'node:http'; - * import { Buffer } from 'node:buffer'; - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!', - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData), - * }, - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'` - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to - * consume the response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called. - * - * Passing illegal value as `name` will result in a `TypeError` being thrown, - * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * Examples: - * - * Example: - * - * ```js - * import { validateHeaderName } from 'node:http'; - * - * try { - * validateHeaderName(''); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' - * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' - * } - * ``` - * @since v14.3.0 - * @param [label='Header name'] Label for error message. - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called. - * - * Passing illegal value as `value` will result in a `TypeError` being thrown. - * - * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Examples: - * - * ```js - * import { validateHeaderValue } from 'node:http'; - * - * try { - * validateHeaderValue('x-my-header', undefined); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true - * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' - * } - * - * try { - * validateHeaderValue('x-my-header', 'oʊmɪɡə'); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true - * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' - * } - * ``` - * @since v14.3.0 - * @param name Header name - * @param value Header value - */ - function validateHeaderValue(name: string, value: string): void; - /** - * Set the maximum number of idle HTTP parsers. - * @since v18.8.0, v16.18.0 - * @param [max=1000] - */ - function setMaxIdleHTTPParsers(max: number): void; - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module "node:http" { - export * from "http"; -} diff --git a/dist/node_modules/@types/node/ts4.8/http2.d.ts b/dist/node_modules/@types/node/ts4.8/http2.d.ts deleted file mode 100644 index e223f39..0000000 --- a/dist/node_modules/@types/node/ts4.8/http2.d.ts +++ /dev/null @@ -1,2381 +0,0 @@ -/** - * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. - * It can be accessed using: - * - * ```js - * const http2 = require('node:http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http2.js) - */ -declare module "http2" { - import EventEmitter = require("node:events"); - import * as fs from "node:fs"; - import * as net from "node:net"; - import * as stream from "node:stream"; - import * as tls from "node:tls"; - import * as url from "node:url"; - import { - IncomingHttpHeaders as Http1IncomingHttpHeaders, - IncomingMessage, - OutgoingHttpHeaders, - ServerResponse, - } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { - ":status"?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string | undefined; - ":method"?: string | undefined; - ":authority"?: string | undefined; - ":scheme"?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session | undefined; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('node:http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream( - headers: OutgoingHttpHeaders, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - pushStream( - headers: OutgoingHttpHeaders, - options?: StreamPriorityOptions, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - /** - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * Initiates a response. When the `options.waitForTrailers` option is set, the`'wantTrailers'` event will be emitted immediately after queuing the last chunk - * of payload data to be sent. The `http2stream.sendTrailers()` method can then be - * used to sent trailing header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD( - fd: number | fs.promises.FileHandle, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptions, - ): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.error(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile( - path: string, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptionsWithError, - ): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping( - payload: NodeJS.ArrayBufferView, - callback: (err: Error | null, duration: number, payload: Buffer) => void, - ): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('node:http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings( - settings: Settings, - callback?: (err: Error | null, settings: Settings, duration: number) => void, - ): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('node:http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS, - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: ReadonlyArray): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('node:http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('node:http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('node:http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: "http:" | "https:" | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions extends ServerSessionOptions {} - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - options: stream.ReadableOptions, - rawHeaders: ReadonlyArray, - ); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 `request` object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ""; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | ReadonlyArray): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `node:http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }); - * ``` - * @since v18.11.0 - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse( - headers: OutgoingHttpHeaders, - callback: (err: Error | null, res: Http2ServerResponse) => void, - ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('node:http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('node:http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8000); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - export function createServer( - options: ServerOptions, - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8443); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - export function createSecureServer( - options: SecureServerOptions, - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('node:http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect( - authority: string | url.URL, - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; -} -declare module "node:http2" { - export * from "http2"; -} diff --git a/dist/node_modules/@types/node/ts4.8/https.d.ts b/dist/node_modules/@types/node/ts4.8/https.d.ts deleted file mode 100644 index 36ae5b2..0000000 --- a/dist/node_modules/@types/node/ts4.8/https.d.ts +++ /dev/null @@ -1,550 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js) - */ -declare module "https" { - import { Duplex } from "node:stream"; - import * as tls from "node:tls"; - import * as http from "node:http"; - import { URL } from "node:url"; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = - & http.RequestOptions - & tls.SecureContextOptions - & { - checkServerIdentity?: typeof tls.checkServerIdentity | undefined; - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: "request", listener: http.RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: "request", listener: http.RequestListener): this; - once(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('node:https'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('node:https'); - * const fs = require('node:fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample', - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('node:https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false, - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('node:tls'); - * const https = require('node:https'); - * const crypto = require('node:crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha256 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('node:https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module "node:https" { - export * from "https"; -} diff --git a/dist/node_modules/@types/node/ts4.8/index.d.ts b/dist/node_modules/@types/node/ts4.8/index.d.ts deleted file mode 100644 index 7c8b38c..0000000 --- a/dist/node_modules/@types/node/ts4.8/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 4.8 and earlier. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/dist/node_modules/@types/node/ts4.8/inspector.d.ts b/dist/node_modules/@types/node/ts4.8/inspector.d.ts deleted file mode 100644 index 3927b81..0000000 --- a/dist/node_modules/@types/node/ts4.8/inspector.d.ts +++ /dev/null @@ -1,2747 +0,0 @@ -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * - * It can be accessed using: - * - * ```js - * import * as inspector from 'node:inspector/promises'; - * ``` - * - * or - * - * ```js - * import * as inspector from 'node:inspector'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - * @since v8.0.0 - */ - connect(): void; - /** - * Immediately close the session. All pending message callbacks will be called - * with an error. `session.connect()` will need to be called to be able to send - * messages again. Reconnected session will lose all inspector state, such as - * enabled agents or configured breakpoints. - * @since v8.0.0 - */ - disconnect(): void; - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Collect type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - // Events - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -/** - * The inspector module provides an API for interacting with the V8 inspector. - */ -declare module 'node:inspector' { - import inspector = require('inspector'); - export = inspector; -} diff --git a/dist/node_modules/@types/node/ts4.8/module.d.ts b/dist/node_modules/@types/node/ts4.8/module.d.ts deleted file mode 100644 index d8d0593..0000000 --- a/dist/node_modules/@types/node/ts4.8/module.d.ts +++ /dev/null @@ -1,287 +0,0 @@ -/** - * @since v0.3.7 - * @experimental - */ -declare module "module" { - import { URL } from "node:url"; - import { MessagePort } from "node:worker_threads"; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('node:fs'); - * const assert = require('node:assert'); - * const { syncBuiltinESMExports } = require('node:module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('node:fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - interface SourceOrigin { - /** - * The name of the range in the source map, if one was provided - */ - name?: string; - /** - * The file name of the original source, as reported in the SourceMap - */ - fileName: string; - /** - * The 1-indexed lineNumber of the corresponding call site in the original source - */ - lineNumber: number; - /** - * The 1-indexed columnNumber of the corresponding call site in the original source - */ - columnNumber: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line offset and column offset in the generated source - * file, returns an object representing the SourceMap range in the - * original file if found, or an empty object if not. - * - * The object returned contains the following keys: - * - * The returned value represents the raw range as it appears in the - * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and - * column numbers as they appear in Error messages and CallSite - * objects. - * - * To get the corresponding 1-indexed line and column numbers from a - * lineNumber and columnNumber as they are reported by Error stacks - * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` - * @param lineOffset The zero-indexed line number offset in the generated source - * @param columnOffset The zero-indexed column number offset in the generated source - */ - findEntry(lineOffset: number, columnOffset: number): SourceMapping; - /** - * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, - * find the corresponding call site location in the original source. - * - * If the `lineNumber` and `columnNumber` provided are not found in any source map, - * then an empty object is returned. - * @param lineNumber The 1-indexed line number of the call site in the generated source - * @param columnNumber The 1-indexed column number of the call site in the generated source - */ - findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; - } - interface ImportAssertions extends NodeJS.Dict { - type?: string | undefined; - } - type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; - type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; - interface GlobalPreloadContext { - port: MessagePort; - } - /** - * @deprecated This hook will be removed in a future version. - * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. - * - * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. - * This hook allows the return of a string that is run as a sloppy-mode script on startup. - * - * @param context Information to assist the preload code - * @return Code to run before application startup - */ - type GlobalPreloadHook = (context: GlobalPreloadContext) => string; - /** - * The `initialize` hook provides a way to define a custom function that runs in the hooks thread - * when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`. - * - * This hook can receive data from a `register` invocation, including ports and other transferrable objects. - * The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes. - */ - type InitializeHook = (data: Data) => void | Promise; - interface ResolveHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAssertions: ImportAssertions; - /** - * The module importing this one, or undefined if this is the Node.js entry point - */ - parentURL: string | undefined; - } - interface ResolveFnOutput { - /** - * A hint to the load hook (it might be ignored) - */ - format?: ModuleFormat | null | undefined; - /** - * The import assertions to use when caching the module (optional; if excluded the input will be used) - */ - importAssertions?: ImportAssertions | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The absolute URL to which this input resolves - */ - url: string; - } - /** - * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. - * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); - * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. - * - * @param specifier The specified URL path of the module to be resolved - * @param context - * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook - */ - type ResolveHook = ( - specifier: string, - context: ResolveHookContext, - nextResolve: ( - specifier: string, - context?: ResolveHookContext, - ) => ResolveFnOutput | Promise, - ) => ResolveFnOutput | Promise; - interface LoadHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * The format optionally supplied by the `resolve` hook chain - */ - format: ModuleFormat; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAssertions: ImportAssertions; - } - interface LoadFnOutput { - format: ModuleFormat; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The source for Node.js to evaluate - */ - source?: ModuleSource; - } - /** - * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. - * It is also in charge of validating the import assertion. - * - * @param url The URL/path of the module to be loaded - * @param context Metadata about the module - * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook - */ - type LoadHook = ( - url: string, - context: LoadHookContext, - nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise, - ) => LoadFnOutput | Promise; - } - interface RegisterOptions { - parentURL: string | URL; - data?: Data | undefined; - transferList?: any[] | undefined; - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static isBuiltin(moduleName: string): boolean; - static Module: typeof Module; - static register( - specifier: string | URL, - parentURL?: string | URL, - options?: RegisterOptions, - ): void; - static register(specifier: string | URL, options?: RegisterOptions): void; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - url: string; - /** - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * Second `parent` parameter is only used when the `--experimental-import-meta-resolve` - * command flag enabled. - * - * @since v20.6.0 - * - * @param specifier The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. - * @returns The absolute (`file:`) URL string for the resolved module. - */ - resolve(specifier: string, parent?: string | URL | undefined): string; - } - } - export = Module; -} -declare module "node:module" { - import module = require("module"); - export = module; -} diff --git a/dist/node_modules/@types/node/ts4.8/net.d.ts b/dist/node_modules/@types/node/ts4.8/net.d.ts deleted file mode 100644 index 70789e1..0000000 --- a/dist/node_modules/@types/node/ts4.8/net.d.ts +++ /dev/null @@ -1,949 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `node:net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('node:net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js) - */ -declare module "net" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import * as dns from "node:dns"; - type LookupFunction = ( - hostname: string, - options: dns.LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void, - ) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamily?: boolean | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamilyAttemptTimeout?: number | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. - * If the socket is still writable it implicitly calls `socket.end()`. - * @since v0.3.4 - */ - destroySoon(): void; - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. - * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. - * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0, v16.17.0 - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` - * and it is an array of the addresses that have been attempted. - * - * Each address is a string in the form of `$IP:$PORT`. - * If the connection was successful, then the last address is the one that the socket is currently connected to. - * @since v19.4.0 - */ - readonly autoSelectFamilyAttemptedAddresses: string[]; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting - * (see `socket.connecting`). - * @since v11.2.0, v10.16.0 - */ - readonly pending: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0, v16.18.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * The socket timeout in milliseconds as set by `socket.setTimeout()`. - * It is `undefined` if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. ready - * 9. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "data", listener: (data: Buffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", hadError: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "data", data: Buffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (hadError: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "data", listener: (data: Buffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (hadError: boolean) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: Buffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "data", listener: (data: Buffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "data", listener: (data: Buffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.error('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; - /** - * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } - type IPVersion = "ipv4" | "ipv6"; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('node:net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```bash - * telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```bash - * nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. - * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. - * @since v19.4.0 - */ - function getDefaultAutoSelectFamily(): boolean; - /** - * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. - * @since v19.4.0 - */ - function setDefaultAutoSelectFamily(value: boolean): void; - /** - * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250`. - * @since v19.8.0 - */ - function getDefaultAutoSelectFamilyAttemptTimeout(): number; - /** - * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @since v19.8.0 - */ - function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module "node:net" { - export * from "net"; -} diff --git a/dist/node_modules/@types/node/ts4.8/os.d.ts b/dist/node_modules/@types/node/ts4.8/os.d.ts deleted file mode 100644 index 4fc733b..0000000 --- a/dist/node_modules/@types/node/ts4.8/os.d.ts +++ /dev/null @@ -1,477 +0,0 @@ -/** - * The `node:os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('node:os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js) - */ -declare module "os" { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T | null; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20, - * }, - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * - * `os.cpus().length` should not be used to calculate the amount of parallelism - * available to an application. Use {@link availableParallelism} for this purpose. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns an estimate of the default amount of parallelism a program should use. - * Always returns a value greater than zero. - * - * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). - * @since v19.4.0, v18.14.0 - */ - function availableParallelism(): number; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: "buffer" }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0, v16.18.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): "BE" | "LE"; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module "node:os" { - export * from "os"; -} diff --git a/dist/node_modules/@types/node/ts4.8/path.d.ts b/dist/node_modules/@types/node/ts4.8/path.d.ts deleted file mode 100644 index 6f07681..0000000 --- a/dist/node_modules/@types/node/ts4.8/path.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} -/** - * The `node:path` module provides utilities for working with file and directory - * paths. It can be accessed using: - * - * ```js - * const path = require('node:path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js) - */ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); - export = path; -} -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); - export = path; -} diff --git a/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts deleted file mode 100644 index 0e6b843..0000000 --- a/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts +++ /dev/null @@ -1,639 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) - * - * ```js - * const { PerformanceObserver, performance } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js) - */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; - type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http"; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - toJSON(): any; - } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: "mark"; - } - /** - * Exposes measures created via the `Performance.measure()` method. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: "measure"; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = ( - util1?: EventLoopUtilization, - util2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only the named measure. - * @param name - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - * @return The PerformanceMark entry that was created - */ - mark(name?: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0 - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0 - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: ReadonlyArray; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from `other` to this histogram. - * @since v17.4.0, v16.14.0 - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('node:perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { performance as _performance } from "perf_hooks"; - global { - /** - * `performance` is a global reference for `require('perf_hooks').performance` - * https://nodejs.org/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } -} -declare module "node:perf_hooks" { - export * from "perf_hooks"; -} diff --git a/dist/node_modules/@types/node/ts4.8/process.d.ts b/dist/node_modules/@types/node/ts4.8/process.d.ts deleted file mode 100644 index 1ec9e83..0000000 --- a/dist/node_modules/@types/node/ts4.8/process.d.ts +++ /dev/null @@ -1,1532 +0,0 @@ -declare module "process" { - import * as tty from "node:tty"; - import { Worker } from "node:worker_threads"; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = - | "aix" - | "android" - | "darwin" - | "freebsd" - | "haiku" - | "linux" - | "openbsd" - | "sunos" - | "win32" - | "cygwin" - | "netbsd"; - type Architecture = - | "arm" - | "arm64" - | "ia32" - | "mips" - | "mipsel" - | "ppc" - | "ppc64" - | "riscv64" - | "s390" - | "s390x" - | "x64"; - type Signals = - | "SIGABRT" - | "SIGALRM" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINT" - | "SIGIO" - | "SIGIOT" - | "SIGKILL" - | "SIGPIPE" - | "SIGPOLL" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGUNUSED" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ" - | "SIGBREAK" - | "SIGLOST" - | "SIGINFO"; - type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'node:process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'node:process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```bash - * node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```bash - * node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'node:process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'node:process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'node:process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information', - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'node:process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```bash - * node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'node:process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'node:process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread's `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner - * unlike the main thread. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'node:process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'node:process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'node:process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. - * @since v20.7.0 - * @experimental - */ - readonly sourceMapsEnabled: boolean; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'node:process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'node:process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '20.2.0', - * acorn: '8.8.2', - * ada: '2.4.0', - * ares: '1.19.0', - * base64: '0.5.0', - * brotli: '1.0.9', - * cjs_module_lexer: '1.2.2', - * cldr: '43.0', - * icu: '73.1', - * llhttp: '8.1.0', - * modules: '115', - * napi: '8', - * nghttp2: '1.52.0', - * nghttp3: '0.7.0', - * ngtcp2: '0.8.1', - * openssl: '3.0.8+quic', - * simdutf: '3.2.9', - * tz: '2023c', - * undici: '5.22.0', - * unicode: '15.0', - * uv: '1.44.2', - * uvwasi: '0.0.16', - * v8: '11.3.244.8-node.9', - * zlib: '1.2.13' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns a frozen `Object` containing the - * JavaScript representation of the configure options used to compile the current - * Node.js executable. This is the same as the `config.gypi` file that was produced - * when running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'node:process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'node:process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'node:process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'node:process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'node:process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * Gets the amount of memory available to the process (in bytes) based on - * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `undefined` is returned. - * - * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more - * information. - * @since v19.6.0, v18.15.0 - * @experimental - */ - constrainedMemory(): number | undefined; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'node:process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'node:process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Hydrogen', - * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void, - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'node:process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'node:process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; - } - } - } - export = process; -} -declare module "node:process" { - import process = require("process"); - export = process; -} diff --git a/dist/node_modules/@types/node/ts4.8/punycode.d.ts b/dist/node_modules/@types/node/ts4.8/punycode.d.ts deleted file mode 100644 index 64ddd3e..0000000 --- a/dist/node_modules/@types/node/ts4.8/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js) - */ -declare module "punycode" { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: ReadonlyArray): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module "node:punycode" { - export * from "punycode"; -} diff --git a/dist/node_modules/@types/node/ts4.8/querystring.d.ts b/dist/node_modules/@types/node/ts4.8/querystring.d.ts deleted file mode 100644 index 388ebc3..0000000 --- a/dist/node_modules/@types/node/ts4.8/querystring.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * The `node:querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('node:querystring'); - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical or - * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js) - */ -declare module "querystring" { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends - NodeJS.Dict< - | string - | number - | boolean - | ReadonlyArray - | ReadonlyArray - | ReadonlyArray - | null - > - {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```js - * { - * foo: 'bar', - * abc: ['xyz', '123'] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module "node:querystring" { - export * from "querystring"; -} diff --git a/dist/node_modules/@types/node/ts4.8/readline.d.ts b/dist/node_modules/@types/node/ts4.8/readline.d.ts deleted file mode 100644 index b06d58b..0000000 --- a/dist/node_modules/@types/node/ts4.8/readline.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * The `node:readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `node:readline`module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js) - */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' '), - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0, v14.17.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * An error will be thrown if calling `rl.question()` after `rl.close()`. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( - line: string, - callback: (err?: null | Error, result?: CompleterResult) => void, - ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('node:readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without - * waiting for user input, call `process.stdin.unref()`. - * @since v0.1.98 - */ - export function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('node:readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ', - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('node:fs'); - * const readline = require('node:readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity, - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('node:fs'); - * const readline = require('node:readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('node:events'); - * const { createReadStream } = require('node:fs'); - * const { createInterface } = require('node:readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module "node:readline" { - export * from "readline"; -} diff --git a/dist/node_modules/@types/node/ts4.8/readline/promises.d.ts b/dist/node_modules/@types/node/ts4.8/readline/promises.d.ts deleted file mode 100644 index 73fb111..0000000 --- a/dist/node_modules/@types/node/ts4.8/readline/promises.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @since v17.0.0 - * @experimental - */ -declare module "readline/promises" { - import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline"; - import { Abortable } from "node:events"; - /** - * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v17.0.0 - */ - class Interface extends _Interface { - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * If the question is called after `rl.close()`, it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an `AbortSignal` to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * @since v17.0.0 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @return A promise that is fulfilled with the user's input in response to the `query`. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - /** - * @since v17.0.0 - */ - class Readline { - /** - * @param stream A TTY stream. - */ - constructor( - stream: NodeJS.WritableStream, - options?: { - autoCommit?: boolean; - }, - ); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an - * action that clears current line of the associated `stream` in a specified - * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an - * action that clears the associated stream from the current position of the - * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated`stream` and clears the internal list of pending actions. - * @since v17.0.0 - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action - * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an - * action that moves the cursor _relative_ to its current position in the - * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback` methods clears the internal list of pending actions without - * sending it to the associated `stream`. - * @since v17.0.0 - * @return this - */ - rollback(): this; - } - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface`instance. - * - * ```js - * const readlinePromises = require('node:readline/promises'); - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case - * is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * @since v17.0.0 - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module "node:readline/promises" { - export * from "readline/promises"; -} diff --git a/dist/node_modules/@types/node/ts4.8/repl.d.ts b/dist/node_modules/@types/node/ts4.8/repl.d.ts deleted file mode 100644 index 6c5f81b..0000000 --- a/dist/node_modules/@types/node/ts4.8/repl.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -/** - * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation - * that is available both as a standalone program or includible in other - * applications. It can be accessed using: - * - * ```js - * const repl = require('node:repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js) - */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; - import { InspectOptions } from "node:util"; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = ( - this: REPLServer, - evalCmd: string, - context: Context, - file: string, - cb: (err: Error | null, result: any) => void, - ) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('node:repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('node:repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * }, - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('node:repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module "node:repl" { - export * from "repl"; -} diff --git a/dist/node_modules/@types/node/ts4.8/stream.d.ts b/dist/node_modules/@types/node/ts4.8/stream.d.ts deleted file mode 100644 index 15c633f..0000000 --- a/dist/node_modules/@types/node/ts4.8/stream.d.ts +++ /dev/null @@ -1,1701 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `node:stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `node:stream` module: - * - * ```js - * const stream = require('node:stream'); - * ``` - * - * The `node:stream` module is useful for creating new types of stream instances. - * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/stream.js) - */ -declare module "stream" { - import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamConsumers from "node:stream/consumers"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, - ): T; - } - import Stream = internal.Stream; - import Readable = internal.Readable; - import ReadableOptions = internal.ReadableOptions; - interface ArrayOptions { - /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */ - concurrency?: number; - /** allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal; - } - class ReadableBase extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('node:fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('node:string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array`, or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream`module API as it is currently defined. (See `Compatibility` for more - * information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('node:stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - /** - * The iterator created by this method gives users the option to cancel the destruction - * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, - * or if the iterator should destroy the stream if the stream emitted an error during iteration. - * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. - */ - iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator; - /** - * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. - * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. - * @since v17.4.0, v16.14.0 - * @param fn a function to map over every chunk in the stream. Async or not. - * @returns a stream mapped with the function *fn*. - */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called - * and if it returns a truthy value, the chunk will be passed to the result stream. - * If the *fn* function returns a promise - that promise will be `await`ed. - * @since v17.4.0, v16.14.0 - * @param fn a function to filter chunks from the stream. Async or not. - * @returns a stream filtered with the predicate *fn*. - */ - filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Readable; - /** - * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. - * If the *fn* function returns a promise - that promise will be `await`ed. - * - * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. - * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option - * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. - * In either case the stream will be destroyed. - * - * This method is different from listening to the `'data'` event in that it uses the `readable` event - * in the underlying machinary and can limit the number of concurrent *fn* calls. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise for when the stream has finished. - */ - forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method allows easily obtaining the contents of a stream. - * - * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended - * for interoperability and convenience, not as the primary way to consume streams. - * @since v17.5.0 - * @returns a promise containing an array with the contents of the stream. - */ - toArray(options?: Pick): Promise; - /** - * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream - * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk - * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. - * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. - */ - some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream - * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, - * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. - * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, - * or `undefined` if no element was found. - */ - find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, - ): Promise; - find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream - * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk - * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. - * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. - */ - every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method returns a new stream by applying the given callback to each chunk of the stream - * and then flattening the result. - * - * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams - * will be merged (flattened) into the returned stream. - * @since v17.5.0 - * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. - * @returns a stream flat-mapped with the function *fn*. - */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method returns a new stream with the first *limit* chunks dropped from the start. - * @since v17.5.0 - * @param limit the number of chunks to drop from the readable. - * @returns a stream with *limit* chunks dropped from the start. - */ - drop(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with the first *limit* chunks. - * @since v17.5.0 - * @param limit the number of chunks to take from the readable. - * @returns a stream with *limit* chunks taken. - */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; - /** - * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation - * on the previous element. It returns a promise for the final value of the reduction. - * - * If no *initial* value is supplied the first chunk of the stream is used as the initial value. - * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. - * - * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter - * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. - * @since v17.5.0 - * @param fn a reducer function to call over every chunk in the stream. Async or not. - * @param initial the initial value to use in the reduction. - * @returns a promise for the final value of the reduction. - */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, - initial: T, - options?: Pick, - ): Promise; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - import WritableOptions = internal.WritableOptions; - class WritableBase extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored, or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('node:fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends ReadableBase { - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - readableStream: streamWeb.ReadableStream, - options?: Pick, - ): Readable; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?( - this: Writable, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends WritableBase { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - writableStream: streamWeb.WritableStream, - options?: Pick, - ): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends ReadableBase implements WritableBase { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is - * emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from( - src: - | Stream - | NodeBlob - | ArrayBuffer - | string - | Iterable - | AsyncIterable - | AsyncGeneratorFunction - | Promise - | Object, - ): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _destroy(error: Error | null, callback: (error: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - /** - * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; - /** - * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, - options?: Pick< - DuplexOptions, - "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" - >, - ): Duplex; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?( - this: Transform, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * A stream to attach a signal to. - * - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new - * AbortError())` for webstreams. - * - * ```js - * const fs = require('node:fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * - * Or using an `AbortSignal` with a ReadableStream: - * - * ```js - * const controller = new AbortController(); - * const rs = new ReadableStream({ - * start(controller) { - * controller.enqueue('hello'); - * controller.enqueue('world'); - * controller.close(); - * }, - * }); - * - * addAbortSignal(controller.signal, rs); - * - * finished(rs, (err) => { - * if (err) { - * if (err.name === 'AbortError') { - * // The operation was cancelled - * } - * } - * }); - * - * const reader = rs.getReader(); - * - * reader.read().then(({ value, done }) => { - * console.log(value); // hello - * console.log(done); // false - * controller.abort(); - * }); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - /** - * Returns the default highWaterMark used by streams. - * Defaults to `16384` (16 KiB), or `16` for `objectMode`. - * @since v19.9.0 - * @param objectMode - */ - function getDefaultHighWaterMark(objectMode: boolean): number; - /** - * Sets the default highWaterMark used by streams. - * @since v19.9.0 - * @param objectMode - * @param value highWaterMark value - */ - function setDefaultHighWaterMark(objectMode: boolean, value: number): void; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A readable and/or writable stream/webstream. - * - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('node:stream'); - * const fs = require('node:fs'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides `promise version`. - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options: FinishedOptions, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? - | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('node:stream'); - * const fs = require('node:fs'); - * const zlib = require('node:zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * }, - * ); - * ``` - * - * The `pipeline` API provides a `promise version`. - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * const fs = require('node:fs'); - * const http = require('node:http'); - * const { pipeline } = require('node:stream'); - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void, - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0, v16.14.0 - * @experimental - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - /** - * Returns whether the stream is readable. - * @since v17.4.0, v16.14.0 - * @experimental - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module "node:stream" { - import stream = require("stream"); - export = stream; -} diff --git a/dist/node_modules/@types/node/ts4.8/stream/consumers.d.ts b/dist/node_modules/@types/node/ts4.8/stream/consumers.d.ts deleted file mode 100644 index 5ad9cba..0000000 --- a/dist/node_modules/@types/node/ts4.8/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module "stream/consumers" { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; -} -declare module "node:stream/consumers" { - export * from "stream/consumers"; -} diff --git a/dist/node_modules/@types/node/ts4.8/stream/promises.d.ts b/dist/node_modules/@types/node/ts4.8/stream/promises.d.ts deleted file mode 100644 index 6eac5b7..0000000 --- a/dist/node_modules/@types/node/ts4.8/stream/promises.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare module "stream/promises" { - import { - FinishedOptions, - PipelineDestination, - PipelineOptions, - PipelinePromise, - PipelineSource, - PipelineTransform, - } from "node:stream"; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module "node:stream/promises" { - export * from "stream/promises"; -} diff --git a/dist/node_modules/@types/node/ts4.8/stream/web.d.ts b/dist/node_modules/@types/node/ts4.8/stream/web.d.ts deleted file mode 100644 index 0d91613..0000000 --- a/dist/node_modules/@types/node/ts4.8/stream/web.d.ts +++ /dev/null @@ -1,350 +0,0 @@ -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; - } - interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; - } - type ReadableStreamController = ReadableStreamDefaultController; - type ReadableStreamDefaultReadResult = - | ReadableStreamDefaultReadValueResult - | ReadableStreamDefaultReadDoneResult; - interface ReadableStreamReadValueResult { - done: false; - value: T; - } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; - } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(): ReadableStreamDefaultReader; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): AsyncIterableIterator; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - const ReadableStream: { - prototype: ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - read(view: T): Promise>; - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: any; - const ReadableStreamBYOBRequest: any; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new( - transformer?: Transformer, - writableStrategy?: QueuingStrategy, - readableStrategy?: QueuingStrategy, - ): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(label?: string, options?: TextDecoderOptions): TextDecoderStream; - }; -} -declare module "node:stream/web" { - export * from "stream/web"; -} diff --git a/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts b/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts deleted file mode 100644 index b8691e1..0000000 --- a/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `node:string_decoder` module provides an API for decoding `Buffer` objects - * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); // Prints: ¢ - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); // Prints: € - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js) - */ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer The bytes to decode. - */ - write(buffer: Buffer): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer The bytes to decode. - */ - end(buffer?: Buffer): string; - } -} -declare module "node:string_decoder" { - export * from "string_decoder"; -} diff --git a/dist/node_modules/@types/node/ts4.8/test.d.ts b/dist/node_modules/@types/node/ts4.8/test.d.ts deleted file mode 100644 index 04504fd..0000000 --- a/dist/node_modules/@types/node/ts4.8/test.d.ts +++ /dev/null @@ -1,1382 +0,0 @@ -/** - * The `node:test` module facilitates the creation of JavaScript tests. - * To access it: - * - * ```js - * import test from 'node:test'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test'; - * ``` - * - * Tests created via the `test` module consist of a single function that is - * processed in one of three ways: - * - * 1. A synchronous function that is considered failing if it throws an exception, - * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` resolves. - * 3. A function that receives a callback function. If the callback receives any - * truthy value as its first argument, the test is considered failing. If a - * falsy value is passed as the first argument to the callback, the test is - * considered passing. If the test function receives a callback function and - * also returns a `Promise`, the test will fail. - * - * The following example illustrates how tests are written using the`test` module. - * - * ```js - * test('synchronous passing test', (t) => { - * // This test passes because it does not throw an exception. - * assert.strictEqual(1, 1); - * }); - * - * test('synchronous failing test', (t) => { - * // This test fails because it throws an exception. - * assert.strictEqual(1, 2); - * }); - * - * test('asynchronous passing test', async (t) => { - * // This test passes because the Promise returned by the async - * // function is not rejected. - * assert.strictEqual(1, 1); - * }); - * - * test('asynchronous failing test', async (t) => { - * // This test fails because the Promise returned by the async - * // function is rejected. - * assert.strictEqual(1, 2); - * }); - * - * test('failing test using Promises', (t) => { - * // Promises can be used directly as well. - * return new Promise((resolve, reject) => { - * setImmediate(() => { - * reject(new Error('this will cause the test to fail')); - * }); - * }); - * }); - * - * test('callback passing test', (t, done) => { - * // done() is the callback function. When the setImmediate() runs, it invokes - * // done() with no arguments. - * setImmediate(done); - * }); - * - * test('callback failing test', (t, done) => { - * // When the setImmediate() runs, done() is invoked with an Error object and - * // the test fails. - * setImmediate(() => { - * done(new Error('callback failure')); - * }); - * }); - * ``` - * - * If any tests fail, the process exit code is set to `1`. - * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.4.0/lib/test.js) - */ -declare module "node:test" { - import { Readable } from "node:stream"; - import { AsyncResource } from "node:async_hooks"; - /** - * ```js - * import { tap } from 'node:test/reporters'; - * import { run } from 'node:test'; - * import process from 'node:process'; - * import path from 'node:path'; - * - * run({ files: [path.resolve('./tests/test.js')] }) - * .compose(tap) - * .pipe(process.stdout); - * ``` - * @since v18.9.0, v16.19.0 - * @param options Configuration options for running tests. The following properties are supported: - */ - function run(options?: RunOptions): TestsStream; - /** - * The `test()` function is the value imported from the `test` module. Each - * invocation of this function results in reporting the test to the `TestsStream`. - * - * The `TestContext` object passed to the `fn` argument can be used to perform - * actions related to the current test. Examples include skipping the test, adding - * additional diagnostic information, or creating subtests. - * - * `test()` returns a `Promise` that resolves once the test completes. - * if `test()` is called within a `describe()` block, it resolve immediately. - * The return value can usually be discarded for top level tests. - * However, the return value from subtests should be used to prevent the parent - * test from finishing first and cancelling the subtest - * as shown in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * - * The `timeout` option can be used to fail the test if it takes longer than`timeout` milliseconds to complete. However, it is not a reliable mechanism for - * canceling tests because a running test might block the application thread and - * thus prevent the scheduled cancellation. - * @since v18.0.0, v16.17.0 - * @param [name='The name'] The name of the test, which is displayed when reporting test results. - * @param options Configuration options for the test. The following properties are supported: - * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the callback function is passed as the - * second argument. - * @return Resolved with `undefined` once the test completes, or immediately if the test runs within {@link describe}. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - namespace test { - export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo }; - } - /** - * The `describe()` function imported from the `node:test` module. Each - * invocation of this function results in the creation of a Subtest. - * After invocation of top level `describe` functions, - * all top level tests and suites will execute. - * @param [name='The name'] The name of the suite, which is displayed when reporting test results. - * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. - * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. - * @return Immediately fulfilled with `undefined`. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function describe(name?: string, fn?: SuiteFn): Promise; - function describe(options?: TestOptions, fn?: SuiteFn): Promise; - function describe(fn?: SuiteFn): Promise; - namespace describe { - /** - * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Shorthand for `test()`. - * - * The `it()` function is imported from the `node:test` module. - * @since v18.6.0, v16.17.0 - */ - function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function it(name?: string, fn?: TestFn): Promise; - function it(options?: TestOptions, fn?: TestFn): Promise; - function it(fn?: TestFn): Promise; - namespace it { - /** - * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - } - /** - * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. - * @since v20.2.0 - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. - * @since v20.2.0 - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. - * @since v20.2.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - /** - * The type of a function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is passed as - * the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; - /** - * The type of a function under Suite. - */ - type SuiteFn = (s: SuiteContext) => void | Promise; - interface TestShard { - /** - * A positive integer between 1 and `` that specifies the index of the shard to run. - */ - index: number; - /** - * A positive integer that specifies the total number of shards to split the test files to. - */ - total: number; - } - interface RunOptions { - /** - * If a number is provided, then that many files would run in parallel. - * If truthy, it would run (number of cpu cores - 1) files in parallel. - * If falsy, it would only run one file at a time. - * If unspecified, subtests inherit this value from their parent. - * @default true - */ - concurrency?: number | boolean | undefined; - /** - * An array containing the list of files to run. - * If unspecified, the test runner execution model will be used. - */ - files?: readonly string[] | undefined; - /** - * Allows aborting an in-progress test execution. - * @default undefined - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the test will fail after. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - /** - * Sets inspector port of test child process. - * If a nullish value is provided, each process gets its own port, - * incremented from the primary's `process.debugPort`. - */ - inspectPort?: number | (() => number) | undefined; - /** - * That can be used to only run tests whose name matches the provided pattern. - * Test name patterns are interpreted as JavaScript regular expressions. - * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. - */ - testNamePatterns?: string | RegExp | string[] | RegExp[]; - /** - * If truthy, the test context will only run tests that have the `only` option set - */ - only?: boolean; - /** - * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run. - */ - setup?: (root: Test) => void | Promise; - /** - * Whether to run in watch mode or not. - * @default false - */ - watch?: boolean | undefined; - /** - * Running tests in a specific shard. - * @default undefined - */ - shard?: TestShard | undefined; - } - class Test extends AsyncResource { - concurrency: number; - nesting: number; - only: boolean; - reporter: TestsStream; - runOnlySubtests: boolean; - testNumber: number; - timeout: number | null; - } - /** - * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.`TestsStream` will emit events, in the - * order of the tests definition - * @since v18.9.0, v16.19.0 - */ - class TestsStream extends Readable implements NodeJS.ReadableStream { - addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - addListener(event: "test:fail", listener: (data: TestFail) => void): this; - addListener(event: "test:pass", listener: (data: TestPass) => void): this; - addListener(event: "test:plan", listener: (data: TestPlan) => void): this; - addListener(event: "test:start", listener: (data: TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:diagnostic", data: DiagnosticData): boolean; - emit(event: "test:fail", data: TestFail): boolean; - emit(event: "test:pass", data: TestPass): boolean; - emit(event: "test:plan", data: TestPlan): boolean; - emit(event: "test:start", data: TestStart): boolean; - emit(event: "test:stderr", data: TestStderr): boolean; - emit(event: "test:stdout", data: TestStdout): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - on(event: "test:fail", listener: (data: TestFail) => void): this; - on(event: "test:pass", listener: (data: TestPass) => void): this; - on(event: "test:plan", listener: (data: TestPlan) => void): this; - on(event: "test:start", listener: (data: TestStart) => void): this; - on(event: "test:stderr", listener: (data: TestStderr) => void): this; - on(event: "test:stdout", listener: (data: TestStdout) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - once(event: "test:fail", listener: (data: TestFail) => void): this; - once(event: "test:pass", listener: (data: TestPass) => void): this; - once(event: "test:plan", listener: (data: TestPlan) => void): this; - once(event: "test:start", listener: (data: TestStart) => void): this; - once(event: "test:stderr", listener: (data: TestStderr) => void): this; - once(event: "test:stdout", listener: (data: TestStdout) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - /** - * An instance of `TestContext` is passed to each test function in order to - * interact with the test runner. However, the `TestContext` constructor is not - * exposed as part of the API. - * @since v18.0.0, v16.17.0 - */ - class TestContext { - /** - * This function is used to create a hook running before subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v20.1.0 - */ - before: typeof before; - /** - * This function is used to create a hook running before each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - beforeEach: typeof beforeEach; - /** - * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.13.0 - */ - after: typeof after; - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - afterEach: typeof afterEach; - /** - * This function is used to write diagnostics to the output. Any diagnostic - * information is included at the end of the test's results. This function does - * not return a value. - * - * ```js - * test('top level test', (t) => { - * t.diagnostic('A diagnostic message'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Message to be reported. - */ - diagnostic(message: string): void; - /** - * The name of the test. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that - * have the `only` option set. Otherwise, all tests are run. If Node.js was not - * started with the `--test-only` command-line option, this function is a - * no-op. - * - * ```js - * test('top level test', (t) => { - * // The test context can be set to run subtests with the 'only' option. - * t.runOnly(true); - * return Promise.all([ - * t.test('this subtest is now skipped'), - * t.test('this subtest is run', { only: true }), - * ]); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param shouldRunOnlyTests Whether or not to run `only` tests. - */ - runOnly(shouldRunOnlyTests: boolean): void; - /** - * ```js - * test('top level test', async (t) => { - * await fetch('some/uri', { signal: t.signal }); - * }); - * ``` - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - /** - * This function causes the test's output to indicate the test as skipped. If`message` is provided, it is included in the output. Calling `skip()` does - * not terminate execution of the test function. This function does not return a - * value. - * - * ```js - * test('top level test', (t) => { - * // Make sure to return here as well if the test contains additional logic. - * t.skip('this is skipped'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional skip message. - */ - skip(message?: string): void; - /** - * This function adds a `TODO` directive to the test's output. If `message` is - * provided, it is included in the output. Calling `todo()` does not terminate - * execution of the test function. This function does not return a value. - * - * ```js - * test('top level test', (t) => { - * // This test is marked as `TODO` - * t.todo('this is a todo'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional `TODO` message. - */ - todo(message?: string): void; - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. This first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - /** - * Each test provides its own MockTracker instance. - */ - readonly mock: MockTracker; - } - /** - * An instance of `SuiteContext` is passed to each suite function in order to - * interact with the test runner. However, the `SuiteContext` constructor is not - * exposed as part of the API. - * @since v18.7.0, v16.17.0 - */ - class SuiteContext { - /** - * The name of the suite. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Can be used to abort test subtasks when the test has been aborted. - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - } - interface TestOptions { - /** - * If a number is provided, then that many tests would run in parallel. - * If truthy, it would run (number of cpu cores - 1) tests in parallel. - * For subtests, it will be `Infinity` tests in parallel. - * If falsy, it would only run one test at a time. - * If unspecified, subtests inherit this value from their parent. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean | undefined; - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal | undefined; - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string | undefined; - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number | undefined; - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string | undefined; - } - /** - * This function is used to create a hook running before running a suite. - * - * ```js - * describe('tests', async () => { - * before(() => console.log('about to run some test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function before(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running after running a suite. - * - * ```js - * describe('tests', async () => { - * after(() => console.log('finished running tests')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function after(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running - * before each subtest of the current suite. - * - * ```js - * describe('tests', async () => { - * beforeEach(() => console.log('about to run a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running - * after each subtest of the current test. - * - * ```js - * describe('tests', async () => { - * afterEach(() => console.log('finished running a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - /** - * The hook function. If the hook uses callbacks, the callback function is passed as the - * second argument. - */ - type HookFn = (s: SuiteContext, done: (result?: any) => void) => any; - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - } - interface MockFunctionOptions { - /** - * The number of times that the mock will use the behavior of `implementation`. - * Once the mock function has been called `times` times, - * it will automatically restore the behavior of `original`. - * This value must be an integer greater than zero. - * @default Infinity - */ - times?: number | undefined; - } - interface MockMethodOptions extends MockFunctionOptions { - /** - * If `true`, `object[methodName]` is treated as a getter. - * This option cannot be used with the `setter` option. - */ - getter?: boolean | undefined; - /** - * If `true`, `object[methodName]` is treated as a setter. - * This option cannot be used with the `getter` option. - */ - setter?: boolean | undefined; - } - type Mock = F & { - mock: MockFunctionContext; - }; - type NoOpFunction = (...args: any[]) => undefined; - type FunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? K : never; - }[keyof T]; - /** - * The `MockTracker` class is used to manage mocking functionality. The test runner - * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's`mock` property. - * @since v19.1.0, v18.13.0 - */ - class MockTracker { - /** - * This function is used to create a mock function. - * - * The following example creates a mock function that increments a counter by one - * on each invocation. The `times` option is used to modify the mock behavior such - * that the first two invocations add two to the counter instead of one. - * - * ```js - * test('mocks a counting function', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); - * - * assert.strictEqual(fn(), 2); - * assert.strictEqual(fn(), 4); - * assert.strictEqual(fn(), 5); - * assert.strictEqual(fn(), 6); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param [original='A no-op function'] An optional function to create a mock on. - * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and - * then restore the behavior of `original`. - * @param options Optional configuration options for the mock function. The following properties are supported: - * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked function. - */ - fn(original?: F, options?: MockFunctionOptions): Mock; - fn( - original?: F, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock; - /** - * This function is used to create a mock on an existing object method. The - * following example demonstrates how a mock is created on an existing object - * method. - * - * ```js - * test('spies on an object method', (t) => { - * const number = { - * value: 5, - * subtract(a) { - * return this.value - a; - * }, - * }; - * - * t.mock.method(number, 'subtract'); - * assert.strictEqual(number.subtract.mock.calls.length, 0); - * assert.strictEqual(number.subtract(3), 2); - * assert.strictEqual(number.subtract.mock.calls.length, 1); - * - * const call = number.subtract.mock.calls[0]; - * - * assert.deepStrictEqual(call.arguments, [3]); - * assert.strictEqual(call.result, 2); - * assert.strictEqual(call.error, undefined); - * assert.strictEqual(call.target, undefined); - * assert.strictEqual(call.this, number); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param object The object whose method is being mocked. - * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. - * @param implementation An optional function used as the mock implementation for `object[methodName]`. - * @param options Optional configuration options for the mock method. The following properties are supported: - * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked method. - */ - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation: Implementation, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method( - object: MockedObject, - methodName: keyof MockedObject, - options: MockMethodOptions, - ): Mock; - method( - object: MockedObject, - methodName: keyof MockedObject, - implementation: Function, - options: MockMethodOptions, - ): Mock; - - /** - * This function is syntax sugar for `MockTracker.method` with `options.getter`set to `true`. - * @since v19.3.0, v18.13.0 - */ - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<() => MockedObject[MethodName]>; - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<(() => MockedObject[MethodName]) | Implementation>; - /** - * This function is syntax sugar for `MockTracker.method` with `options.setter`set to `true`. - * @since v19.3.0, v18.13.0 - */ - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<(value: MockedObject[MethodName]) => void>; - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the`MockTracker` instance. Once disassociated, the mocks can still be used, but the`MockTracker` instance can no longer be - * used to reset their behavior or - * otherwise interact with them. - * - * After each test completes, this function is called on the test context's`MockTracker`. If the global `MockTracker` is used extensively, calling this - * function manually is recommended. - * @since v19.1.0, v18.13.0 - */ - reset(): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does - * not disassociate the mocks from the `MockTracker` instance. - * @since v19.1.0, v18.13.0 - */ - restoreAll(): void; - timers: MockTimers; - } - const mock: MockTracker; - interface MockFunctionCall< - F extends Function, - ReturnType = F extends (...args: any) => infer T ? T - : F extends abstract new(...args: any) => infer T ? T - : unknown, - Args = F extends (...args: infer Y) => any ? Y - : F extends abstract new(...args: infer Y) => any ? Y - : unknown[], - > { - /** - * An array of the arguments passed to the mock function. - */ - arguments: Args; - /** - * If the mocked function threw then this property contains the thrown value. - */ - error: unknown | undefined; - /** - * The value returned by the mocked function. - * - * If the mocked function threw, it will be `undefined`. - */ - result: ReturnType | undefined; - /** - * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. - */ - stack: Error; - /** - * If the mocked function is a constructor, this field contains the class being constructed. - * Otherwise this will be `undefined`. - */ - target: F extends abstract new(...args: any) => any ? F : undefined; - /** - * The mocked function's `this` value. - */ - this: unknown; - } - /** - * The `MockFunctionContext` class is used to inspect or manipulate the behavior of - * mocks created via the `MockTracker` APIs. - * @since v19.1.0, v18.13.0 - */ - class MockFunctionContext { - /** - * A getter that returns a copy of the internal array used to track calls to the - * mock. Each entry in the array is an object with the following properties. - * @since v19.1.0, v18.13.0 - */ - readonly calls: Array>; - /** - * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls`is a getter that creates a copy of the internal call tracking array. - * @since v19.1.0, v18.13.0 - * @return The number of times that this mock has been invoked. - */ - callCount(): number; - /** - * This function is used to change the behavior of an existing mock. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, and then changes the mock implementation to a different function. - * - * ```js - * test('changes a mock behavior', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementation(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 5); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's new implementation. - */ - mockImplementation(implementation: Function): void; - /** - * This function is used to change the behavior of an existing mock for a single - * invocation. Once invocation `onCall` has occurred, the mock will revert to - * whatever behavior it would have used had `mockImplementationOnce()` not been - * called. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, changes the mock implementation to a different function for the - * next invocation, and then resumes its previous behavior. - * - * ```js - * test('changes a mock behavior once', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementationOnce(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 4); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. - * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. - */ - mockImplementationOnce(implementation: Function, onCall?: number): void; - /** - * Resets the call history of the mock function. - * @since v19.3.0, v18.13.0 - */ - resetCalls(): void; - /** - * Resets the implementation of the mock function to its original behavior. The - * mock can still be used after calling this function. - * @since v19.1.0, v18.13.0 - */ - restore(): void; - } - type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout"; - /** - * Mocking timers is a technique commonly used in software testing to simulate and - * control the behavior of timers, such as `setInterval` and `setTimeout`, - * without actually waiting for the specified time intervals. - * - * The `MockTracker` provides a top-level `timers` export - * which is a `MockTimers` instance. - * @since v20.4.0 - * @experimental - */ - class MockTimers { - /** - * Enables timer mocking for the specified timers. - * - * **Note:** When you enable mocking for a specific timer, its associated - * clear function will also be implicitly mocked. - * - * Example usage: - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable(['setInterval']); - * ``` - * - * The above example enables mocking for the `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. - * - * Alternatively, if you call `mock.timers.enable()` without any parameters: - * - * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, - * and `globalThis` will be mocked. - * @since v20.4.0 - */ - enable(timers?: Timer[]): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTimers` instance and disassociates the mocks - * from the `MockTracker` instance. - * - * **Note:** After each test completes, this function is called on - * the test context's `MockTracker`. - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.reset(); - * ``` - * @since v20.4.0 - */ - reset(): void; - /** - * Advances time for all mocked timers. - * - * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts - * only positive numbers. In Node.js, `setTimeout` with negative numbers is - * only supported for web compatibility reasons. - * - * The following example mocks a `setTimeout` function and - * by using `.tick` advances in - * time triggering all pending timers. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable(['setTimeout']); - * - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Alternativelly, the `.tick` function can be called many times - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * context.mock.timers.enable(['setTimeout']); - * const nineSecs = 9000; - * setTimeout(fn, nineSecs); - * - * const twoSeconds = 3000; - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * @since v20.4.0 - */ - tick(milliseconds: number): void; - /** - * Triggers all pending mocked timers immediately. - * - * The example below triggers all pending timers immediately, - * causing them to execute without any delay. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable(['setTimeout']); - * const results = []; - * setTimeout(() => results.push(1), 9999); - * - * // Notice that if both timers have the same timeout, - * // the order of execution is guaranteed - * setTimeout(() => results.push(3), 8888); - * setTimeout(() => results.push(2), 8888); - * - * assert.deepStrictEqual(results, []); - * - * context.mock.timers.runAll(); - * - * assert.deepStrictEqual(results, [3, 2, 1]); - * }); - * ``` - * - * **Note:** The `runAll()` function is specifically designed for - * triggering timers in the context of timer mocking. - * It does not have any effect on real-time system - * clocks or actual timers outside of the mocking environment. - * @since v20.4.0 - */ - runAll(): void; - /** - * Calls {@link MockTimers.reset()}. - */ - [Symbol.dispose](): void; - } - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - Mock, - mock, - only, - run, - skip, - test, - test as default, - todo, - }; -} - -interface TestLocationInfo { - /** - * The column number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - column?: number; - /** - * The path of the test file, `undefined` if test is not ran through a file. - */ - file?: string; - /** - * The line number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - line?: number; -} -interface DiagnosticData extends TestLocationInfo { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestFail extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The error thrown by the test. - */ - error: Error; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPass extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPlan extends TestLocationInfo { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; -} -interface TestStart extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestStderr extends TestLocationInfo { - /** - * The message written to `stderr` - */ - message: string; -} -interface TestStdout extends TestLocationInfo { - /** - * The message written to `stdout` - */ - message: string; -} -interface TestEnqueue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestDequeue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform } from "node:stream"; - - type TestEvent = - | { type: "test:diagnostic"; data: DiagnosticData } - | { type: "test:fail"; data: TestFail } - | { type: "test:pass"; data: TestPass } - | { type: "test:plan"; data: TestPlan } - | { type: "test:start"; data: TestStart } - | { type: "test:stderr"; data: TestStderr } - | { type: "test:stdout"; data: TestStdout } - | { type: "test:enqueue"; data: TestEnqueue } - | { type: "test:dequeue"; data: TestDequeue } - | { type: "test:watch:drained" }; - type TestEventGenerator = AsyncGenerator; - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - */ - function tap(source: TestEventGenerator): AsyncGenerator; - /** - * The `spec` reporter outputs the test results in a human-readable format. - */ - class Spec extends Transform { - constructor(); - } - /** - * The `junit` reporter outputs test results in a jUnit XML format - */ - function junit(source: TestEventGenerator): AsyncGenerator; - export { dot, junit, Spec as spec, tap, TestEvent }; -} diff --git a/dist/node_modules/@types/node/ts4.8/timers.d.ts b/dist/node_modules/@types/node/ts4.8/timers.d.ts deleted file mode 100644 index 1434e7d..0000000 --- a/dist/node_modules/@types/node/ts4.8/timers.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('node:timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/timers.js) - */ -declare module "timers" { - import { Abortable } from "node:events"; - import { - setImmediate as setImmediatePromise, - setInterval as setIntervalPromise, - setTimeout as setTimeoutPromise, - } from "node:timers/promises"; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - /** - * This object is created internally and is returned from `setImmediate()`. It - * can be passed to `clearImmediate()` in order to cancel the scheduled - * actions. - * - * By default, when an immediate is scheduled, the Node.js event loop will continue - * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`functions that can be used to - * control this default behavior. - */ - class Immediate implements RefCounted { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Immediate` is active. Calling `immediate.ref()` multiple times will have no - * effect. - * - * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary - * to call `immediate.ref()` unless `immediate.unref()` had been called previously. - * @since v9.7.0 - * @return a reference to `immediate` - */ - ref(): this; - /** - * When called, the active `Immediate` object will not require the Node.js event - * loop to remain active. If there is no other activity keeping the event loop - * running, the process may exit before the `Immediate` object's callback is - * invoked. Calling `immediate.unref()` multiple times will have no effect. - * @since v9.7.0 - * @return a reference to `immediate` - */ - unref(): this; - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - /** - * Cancels the immediate. This is similar to calling `clearImmediate()`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - /** - * This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the - * scheduled actions. - * - * By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the - * timer is active. Each of the `Timeout` objects returned by these functions - * export both `timeout.ref()` and `timeout.unref()` functions that can be used to - * control this default behavior. - */ - class Timeout implements Timer { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. - * - * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary - * to call `timeout.ref()` unless `timeout.unref()` had been called previously. - * @since v0.9.1 - * @return a reference to `timeout` - */ - ref(): this; - /** - * When called, the active `Timeout` object will not require the Node.js event loop - * to remain active. If there is no other activity keeping the event loop running, - * the process may exit before the `Timeout` object's callback is invoked. Calling`timeout.unref()` multiple times will have no effect. - * @since v0.9.1 - * @return a reference to `timeout` - */ - unref(): this; - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - /** - * Cancels the timeout. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - } - /** - * Schedules execution of a one-time `callback` after `delay` milliseconds. - * - * The `callback` will likely not be invoked in precisely `delay` milliseconds. - * Node.js makes no guarantees about the exact timing of when callbacks will fire, - * nor of their ordering. The callback will be called as close as possible to the - * time specified. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay`will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setTimeout()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearTimeout} - */ - function setTimeout( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - /** - * Cancels a `Timeout` object created by `setTimeout()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules repeated execution of `callback` every `delay` milliseconds. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be - * set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setInterval()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearInterval} - */ - function setInterval( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - /** - * Cancels a `Timeout` object created by `setInterval()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules the "immediate" execution of the `callback` after I/O events' - * callbacks. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setImmediate()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of the Node.js `Event Loop` - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearImmediate} - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by {@link setImmediate}. - */ - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module "node:timers" { - export * from "timers"; -} diff --git a/dist/node_modules/@types/node/ts4.8/timers/promises.d.ts b/dist/node_modules/@types/node/ts4.8/timers/promises.d.ts deleted file mode 100644 index 5a54dc7..0000000 --- a/dist/node_modules/@types/node/ts4.8/timers/promises.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module "timers/promises" { - import { TimerOptions } from "node:timers"; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * If `ref` is `true`, you need to call `next()` of async iterator explicitly - * or implicitly to keep the event loop alive. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; - interface Scheduler { - /** - * ```js - * import { scheduler } from 'node:timers/promises'; - * - * await scheduler.wait(1000); // Wait one second before continuing - * ``` - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. - * @since v16.14.0 - * @experimental - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - */ - wait: (delay?: number, options?: TimerOptions) => Promise; - /** - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. - * @since v16.14.0 - * @experimental - */ - yield: () => Promise; - } - const scheduler: Scheduler; -} -declare module "node:timers/promises" { - export * from "timers/promises"; -} diff --git a/dist/node_modules/@types/node/ts4.8/tls.d.ts b/dist/node_modules/@types/node/ts4.8/tls.d.ts deleted file mode 100644 index 141af8e..0000000 --- a/dist/node_modules/@types/node/ts4.8/tls.d.ts +++ /dev/null @@ -1,1210 +0,0 @@ -/** - * The `node:tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('node:tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js) - */ -declare module "tls" { - import { X509Certificate } from "node:crypto"; - import * as net from "node:net"; - import * as stream from "stream"; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - /** - * `true` if a Certificate Authority (CA), `false` otherwise. - * @since v18.13.0 - */ - ca: boolean; - /** - * The DER encoded X.509 certificate data. - */ - raw: Buffer; - /** - * The certificate subject. - */ - subject: Certificate; - /** - * The certificate issuer, described in the same terms as the `subject`. - */ - issuer: Certificate; - /** - * The date-time the certificate is valid from. - */ - valid_from: string; - /** - * The date-time the certificate is valid to. - */ - valid_to: string; - /** - * The certificate serial number, as a hex string. - */ - serialNumber: string; - /** - * The SHA-1 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint: string; - /** - * The SHA-256 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint256: string; - /** - * The SHA-512 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint512: string; - /** - * The extended key usage, a set of OIDs. - */ - ext_key_usage?: string[]; - /** - * A string containing concatenated names for the subject, - * an alternative to the `subject` names. - */ - subjectaltname?: string; - /** - * An array describing the AuthorityInfoAccess, used with OCSP. - */ - infoAccess?: NodeJS.Dict; - /** - * For RSA keys: The RSA bit size. - * - * For EC keys: The key size in bits. - */ - bits?: number; - /** - * The RSA exponent, as a string in hexadecimal number notation. - */ - exponent?: string; - /** - * The RSA modulus, as a hexadecimal string. - */ - modulus?: string; - /** - * The public key. - */ - pubkey?: Buffer; - /** - * The ASN.1 name of the OID of the elliptic curve. - * Well-known curves are identified by an OID. - * While it is unusual, it is possible that the curve - * is identified by its mathematical properties, - * in which case it will not have an OID. - */ - asn1Curve?: string; - /** - * The NIST name for the elliptic curve,if it has one - * (not all well-known curves have been assigned names by NIST). - */ - nistCurve?: string; - } - interface DetailedPeerCertificate extends PeerCertificate { - /** - * The issuer certificate object. - * For self-signed certificates, this may be a circular reference. - */ - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example, a TLSv1.2 protocol with AES256-SHA cipher: - * - * ```json - * { - * "name": "AES256-SHA", - * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", - * "version": "SSLv3" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void, - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: Buffer) => void): this; - addListener(event: "keylog", listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: Buffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: Buffer): boolean; - emit(event: "keylog", line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: Buffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: Buffer) => void): this; - on(event: "keylog", listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: Buffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: Buffer) => void): this; - once(event: "keylog", listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: Buffer) => void): this; - prependListener(event: "keylog", listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: Buffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created - * with {@link createSecureContext} itself. - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: Buffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; - interface SecureContextOptions { - /** - * If set, this will be called when a client opens a connection using the ALPN extension. - * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, - * respectively containing the server name from the SNI extension (if any) and an array of - * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, - * which will be returned to the client as the selected ALPN protocol, or `undefined`, - * to reject the connection with a fatal alert. If a string is returned that does not match one of - * the client's ALPN protocols, an error will be thrown. - * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. - */ - ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. - * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. - * ECDHE-based perfect forward secrecy will still be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom`options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `node:cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('node:tls'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ], - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('node:tls'); - * const fs = require('node:fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect( - port: number, - host?: string, - options?: ConnectionOptions, - secureConnectListener?: () => void, - ): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair( - context?: SecureContext, - isServer?: boolean, - requestCert?: boolean, - rejectUnauthorized?: boolean, - ): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as `server.addContext()`, - * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength - * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can - * be used to create custom parameters. The key length must be greater than or - * equal to 1024 bits or else an error will be thrown. Although 1024 bits is - * permissible, use 2048 bits or larger for stronger security. - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * The default value of the ciphers option of tls.createSecureContext(). - * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of crypto.constants.defaultCoreCipherList, unless - * changed using CLI options using --tls-default-ciphers. - */ - let DEFAULT_CIPHERS: string; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: ReadonlyArray; -} -declare module "node:tls" { - export * from "tls"; -} diff --git a/dist/node_modules/@types/node/ts4.8/trace_events.d.ts b/dist/node_modules/@types/node/ts4.8/trace_events.d.ts deleted file mode 100644 index 3361359..0000000 --- a/dist/node_modules/@types/node/ts4.8/trace_events.d.ts +++ /dev/null @@ -1,182 +0,0 @@ -/** - * The `node:trace_events` module provides a mechanism to centralize tracing - * information generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `node:trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool - * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool - * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.net.native`: Enables capture of trace data for network. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.fs_dir.sync`: Enables capture of trace data for file system sync - * directory methods. - * * `node.fs.async`: Enables capture of trace data for file system async methods. - * * `node.fs_dir.async`: Enables capture of trace data for file system async - * directory methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * * `node.http`: Enables capture of trace data for http request / response. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `node:trace_events` module: - * - * ```js - * const trace_events = require('node:trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js) - */ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * const trace_events = require('node:trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('node:trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module "node:trace_events" { - export * from "trace_events"; -} diff --git a/dist/node_modules/@types/node/ts4.8/tty.d.ts b/dist/node_modules/@types/node/ts4.8/tty.d.ts deleted file mode 100644 index 1c0dafd..0000000 --- a/dist/node_modules/@types/node/ts4.8/tty.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** - * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream`classes. In most cases, it will not be necessary or possible to use this module - * directly. However, it can be accessed using: - * - * ```js - * const tty = require('node:tty'); - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tty.js) - */ -declare module "tty" { - import * as net from "node:net"; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. - * - * This flag is always `false` when a process starts, even if the terminal is - * operating in raw mode. Its value will change with subsequent calls to`setRawMode`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input - * characters. Ctrl+C will no longer cause a `SIGINT` when - * in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module "node:tty" { - export * from "tty"; -} diff --git a/dist/node_modules/@types/node/ts4.8/url.d.ts b/dist/node_modules/@types/node/ts4.8/url.d.ts deleted file mode 100644 index f465a2b..0000000 --- a/dist/node_modules/@types/node/ts4.8/url.d.ts +++ /dev/null @@ -1,927 +0,0 @@ -/** - * The `node:url` module provides utilities for URL resolution and parsing. It can - * be accessed using: - * - * ```js - * import url from 'node:url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/url.js) - */ -declare module "url" { - import { Blob as NodeBlob } from "node:buffer"; - import { ClientRequestArgs } from "node:http"; - import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * `url.parse()` uses a lenient, non-standard algorithm for parsing URL - * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted - * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead. - * @since v0.1.25 - * @deprecated Use the WHATWG URL API instead. - * @param urlString The URL string to parse. - * @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 - * on the returned URL object will be an unparsed, undecoded string. - * @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 - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse( - urlString: string, - parseQueryString: false | undefined, - slashesDenoteHost?: boolean, - ): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('node:url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * 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 - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * 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 - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @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()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json' - * } - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * 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 - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * 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 - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @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()`. - */ - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a web browser resolving an anchor tag. - * - * ```js - * const url = require('node:url'); - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * To achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param from The base URL to use if `to` is a relative URL. - * @param to The target URL to resolve. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'node:url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'node:url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'node:url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * /* - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0, v14.18.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - auth?: boolean | undefined; - fragment?: boolean | undefined; - search?: boolean | undefined; - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject` s, - * 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 - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * const { - * Blob, - * resolveObjectURL, - * } = require('node:buffer'); - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: NodeBlob): string; - /** - * Removes the stored `Blob` identified by the given ID. Attempting to revoke a - * ID that isn't registered will silently fail. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(objectUrl: string): void; - /** - * Checks if an `input` relative to the `base` can be parsed to a `URL`. - * - * ```js - * const isValid = URL.canParse('/foo', 'https://example.org/'); // true - * - * const isNotValid = URL.canParse('/foo'); // false - * ``` - * @since v19.9.0 - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - */ - static canParse(input: string, base?: string): boolean; - constructor(input: string, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * 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 - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com/ - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * 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 - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myURL = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myURL.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myURL.searchParams.sort(); - * - * console.log(myURL.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - /** - * 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 - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor( - init?: - | URLSearchParams - | string - | Record> - | Iterable<[string, string]> - | ReadonlyArray<[string, string]>, - ); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * If `value` is provided, removes all name-value pairs - * where name is `name` and value is `value`.. - * - * If `value` is not provided, removes all name-value pairs whose name is `name`. - */ - delete(name: string, value?: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * 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`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach( - callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, - thisArg?: TThis, - ): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Checks if the `URLSearchParams` object contains key-value pair(s) based on`name` and an optional `value` argument. - * - * If `value` is provided, returns `true` when name-value pair with - * same `name` and `value` exists. - * - * If `value` is not provided, returns `true` if there is at least one name-value - * pair whose name is `name`. - */ - has(name: string, value?: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): IterableIterator; - /** - * 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`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * The total number of parameter entries. - * @since v19.8.0 - */ - readonly size: number; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } - import { URL as _URL, URLSearchParams as _URLSearchParams } from "url"; - global { - interface URLSearchParams extends _URLSearchParams {} - interface URL extends _URL {} - interface Global { - URL: typeof _URL; - URLSearchParams: typeof _URLSearchParams; - } - /** - * `URL` class is a global reference for `require('url').URL` - * https://nodejs.org/api/url.html#the-whatwg-url-api - * @since v10.0.0 - */ - var URL: typeof globalThis extends { - onmessage: any; - URL: infer T; - } ? T - : typeof _URL; - /** - * `URLSearchParams` class is a global reference for `require('url').URLSearchParams` - * https://nodejs.org/api/url.html#class-urlsearchparams - * @since v10.0.0 - */ - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } ? T - : typeof _URLSearchParams; - } -} -declare module "node:url" { - export * from "url"; -} diff --git a/dist/node_modules/@types/node/ts4.8/util.d.ts b/dist/node_modules/@types/node/ts4.8/util.d.ts deleted file mode 100644 index 7d55c35..0000000 --- a/dist/node_modules/@types/node/ts4.8/util.d.ts +++ /dev/null @@ -1,2186 +0,0 @@ -/** - * The `node:util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * const util = require('node:util'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/util.js) - */ -declare module "util" { - import * as types from "node:util/types"; - export interface InspectOptions { - /** - * If `true`, object's non-enumerable symbols and properties are included in the formatted result. - * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). - * @default false - */ - showHidden?: boolean | undefined; - /** - * Specifies the number of times to recurse while formatting object. - * This is useful for inspecting large objects. - * To recurse up to the maximum call stack size pass `Infinity` or `null`. - * @default 2 - */ - depth?: number | null | undefined; - /** - * If `true`, the output is styled with ANSI color codes. Colors are customizable. - */ - colors?: boolean | undefined; - /** - * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. - * @default true - */ - customInspect?: boolean | undefined; - /** - * If `true`, `Proxy` inspection includes the target and handler objects. - * @default false - */ - showProxy?: boolean | undefined; - /** - * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements - * to include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no elements. - * @default 100 - */ - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - /** - * The length at which input values are split across multiple lines. - * Set to `Infinity` to format the input as a single line - * (in combination with `compact` set to `true` or any number >= `1`). - * @default 80 - */ - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default true - */ - compact?: boolean | number | undefined; - /** - * If set to `true` or a function, all properties of an object, and `Set` and `Map` - * entries are sorted in the resulting string. - * If set to `true` the default sort is used. - * If set to a function, it is used as a compare function. - */ - sorted?: boolean | ((a: string, b: string) => number) | undefined; - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default false - */ - getters?: "get" | "set" | boolean | undefined; - /** - * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. - * @default false - */ - numericSeparator?: boolean | undefined; - } - export type Style = - | "special" - | "number" - | "bigint" - | "boolean" - | "undefined" - | "null" - | "string" - | "symbol" - | "date" - | "regexp" - | "module"; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`\-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns the string name for a numeric error code that comes from a Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const name = util.getSystemErrorName(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v9.7.0 - */ - export function getSystemErrorName(err: number): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0, v14.17.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * const util = require('node:util'); - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * @since v16.8.0, v14.18.0 - */ - export function toUSVString(string: string): string; - /** - * Creates and returns an `AbortController` instance whose `AbortSignal` is marked - * as transferable and can be used with `structuredClone()` or `postMessage()`. - * @since v18.11.0 - * @experimental - * @returns A transferable AbortController - */ - export function transferableAbortController(): AbortController; - /** - * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. - * - * ```js - * const signal = transferableAbortSignal(AbortSignal.timeout(100)); - * const channel = new MessageChannel(); - * channel.port2.postMessage(signal, [signal]); - * ``` - * @since v18.11.0 - * @experimental - * @param signal The AbortSignal - * @returns The same AbortSignal - */ - export function transferableAbortSignal(signal: AbortSignal): AbortSignal; - /** - * Listens to abort event on the provided `signal` and - * returns a promise that is fulfilled when the `signal` is - * aborted. If the passed `resource` is garbage collected before the `signal` is - * aborted, the returned promise shall remain pending indefinitely. - * - * ```js - * import { aborted } from 'node:util'; - * - * const dependent = obtainSomethingAbortable(); - * - * aborted(dependent.signal, dependent).then(() => { - * // Do something when dependent is aborted. - * }); - * - * dependent.on('event', () => { - * dependent.abort(); - * }); - * ``` - * @since v19.7.0 - * @experimental - * @param resource Any non-null entity, reference to which is held weakly. - */ - export function aborted(signal: AbortSignal, resource: any): Promise; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * const { inspect } = require('node:util'); - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * const util = require('node:util'); - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * const util = require('node:util'); - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]), - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * const { inspect } = require('node:util'); - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * const { inspect } = require('node:util'); - * const assert = require('node:assert'); - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]), - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1], - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }), - * ); - * ``` - * - * The `numericSeparator` option adds an underscore every three digits to all - * numbers. - * - * ```js - * const { inspect } = require('node:util'); - * - * const thousand = 1_000; - * const million = 1_000_000; - * const bigNumber = 123_456_789n; - * const bigDecimal = 1_234.123_45; - * - * console.log(inspect(thousand, { numericSeparator: true })); - * // 1_000 - * console.log(inspect(million, { numericSeparator: true })); - * // 1_000_000 - * console.log(inspect(bigNumber, { numericSeparator: true })); - * // 123_456_789n - * console.log(inspect(bigDecimal, { numericSeparator: true })); - * // 1_234.123_45 - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MiB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options?: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. - * - * ```js - * const util = require('node:util'); - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from`superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * const util = require('node:util'); - * const EventEmitter = require('node:events'); - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * const EventEmitter = require('node:events'); - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @legacy Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * const util = require('node:util'); - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * const util = require('node:util'); - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * const util = require('node:util'); - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - export const debug: typeof debuglog; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * const util = require('node:util'); - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * const util = require('node:util'); - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Returns `str` with any ANSI escape codes removed. - * - * ```js - * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); - * // Prints "value" - * ``` - * @since v16.11.0 - */ - export function stripVTControlCharacters(str: string): string; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. - * - * ```js - * const util = require('node:util'); - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named`reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && Object.hasOwn(err, 'reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param fn An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: () => Promise, - ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = - | CustomPromisifySymbol - | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * const util = require('node:util'); - * const fs = require('node:fs'); - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * const util = require('node:util'); - * const fs = require('node:fs'); - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * - * callStat(); - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * const util = require('node:util'); - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify( - fn: (callback: (err: any, result: TResult) => void) => void, - ): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify( - fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - /** - * That can be used to declare custom promisified variants of functions. - */ - const custom: unique symbol; - } - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - }, - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - }, - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util"; - global { - /** - * `TextDecoder` class is a global reference for `require('util').TextDecoder` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } ? TextDecoder - : typeof _TextDecoder; - /** - * `TextEncoder` class is a global reference for `require('util').TextEncoder` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } ? TextEncoder - : typeof _TextEncoder; - } - - //// parseArgs - /** - * Provides a higher level API for command-line argument parsing than interacting - * with `process.argv` directly. Takes a specification for the expected arguments - * and returns a structured object with the parsed options and positionals. - * - * ```js - * import { parseArgs } from 'node:util'; - * const args = ['-f', '--bar', 'b']; - * const options = { - * foo: { - * type: 'boolean', - * short: 'f', - * }, - * bar: { - * type: 'string', - * }, - * }; - * const { - * values, - * positionals, - * } = parseArgs({ args, options }); - * console.log(values, positionals); - * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] - * ``` - * @since v18.3.0, v16.17.0 - * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: - * @return The parsed command line arguments: - */ - export function parseArgs(config?: T): ParsedResults; - interface ParseArgsOptionConfig { - /** - * Type of argument. - */ - type: "string" | "boolean"; - /** - * Whether this option can be provided multiple times. - * If `true`, all values will be collected in an array. - * If `false`, values for the option are last-wins. - * @default false. - */ - multiple?: boolean | undefined; - /** - * A single character alias for the option. - */ - short?: string | undefined; - /** - * The default option value when it is not set by args. - * It must be of the same type as the the `type` property. - * When `multiple` is `true`, it must be an array. - * @since v18.11.0 - */ - default?: string | boolean | string[] | boolean[] | undefined; - } - interface ParseArgsOptionsConfig { - [longOption: string]: ParseArgsOptionConfig; - } - export interface ParseArgsConfig { - /** - * Array of argument strings. - */ - args?: string[] | undefined; - /** - * Used to describe arguments known to the parser. - */ - options?: ParseArgsOptionsConfig | undefined; - /** - * Should an error be thrown when unknown arguments are encountered, - * or when arguments are passed that do not match the `type` configured in `options`. - * @default true - */ - strict?: boolean | undefined; - /** - * Whether this command accepts positional arguments. - */ - allowPositionals?: boolean | undefined; - /** - * Return the parsed tokens. This is useful for extending the built-in behavior, - * from adding additional checks through to reprocessing the tokens in different ways. - * @default false - */ - tokens?: boolean | undefined; - } - /* - IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. - TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 - This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". - But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. - So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. - This is technically incorrect but is a much nicer UX for the common case. - The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. - */ - type IfDefaultsTrue = T extends true ? IfTrue - : T extends false ? IfFalse - : IfTrue; - - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` - type IfDefaultsFalse = T extends false ? IfFalse - : T extends true ? IfTrue - : IfFalse; - - type ExtractOptionValue = IfDefaultsTrue< - T["strict"], - O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, - string | boolean - >; - - type ParsedValues = - & IfDefaultsTrue - & (T["options"] extends ParseArgsOptionsConfig ? { - -readonly [LongOption in keyof T["options"]]: IfDefaultsFalse< - T["options"][LongOption]["multiple"], - undefined | Array>, - undefined | ExtractOptionValue - >; - } - : {}); - - type ParsedPositionals = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type PreciseTokenForOptions< - K extends string, - O extends ParseArgsOptionConfig, - > = O["type"] extends "string" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: string; - inlineValue: boolean; - } - : O["type"] extends "boolean" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: undefined; - inlineValue: undefined; - } - : OptionToken & { name: K }; - - type TokenForOptions< - T extends ParseArgsConfig, - K extends keyof T["options"] = keyof T["options"], - > = K extends unknown - ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions - : OptionToken - : never; - - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - - type ParsedPositionalToken = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type ParsedTokens = Array< - ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } - >; - - type PreciseParsedResults = IfDefaultsFalse< - T["tokens"], - { - values: ParsedValues; - positionals: ParsedPositionals; - tokens: ParsedTokens; - }, - { - values: ParsedValues; - positionals: ParsedPositionals; - } - >; - - type OptionToken = - | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } - | { - kind: "option"; - index: number; - name: string; - rawName: string; - value: undefined; - inlineValue: undefined; - }; - - type Token = - | OptionToken - | { kind: "positional"; index: number; value: string } - | { kind: "option-terminator"; index: number }; - - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. - // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. - type ParsedResults = ParseArgsConfig extends T ? { - values: { - [longOption: string]: undefined | string | boolean | Array; - }; - positionals: string[]; - tokens?: Token[]; - } - : PreciseParsedResults; - - /** - * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). - * - * In accordance with browser conventions, all properties of `MIMEType` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. - * - * A MIME string is a structured string containing multiple meaningful - * components. When parsed, a `MIMEType` object is returned containing - * properties for each of these components. - * @since v19.1.0, v18.13.0 - * @experimental - */ - export class MIMEType { - /** - * Creates a new MIMEType object by parsing the input. - * - * A `TypeError` will be thrown if the `input` is not a valid MIME. - * Note that an effort will be made to coerce the given values into strings. - * @param input The input MIME to parse. - */ - constructor(input: string | { toString: () => string }); - - /** - * Gets and sets the type portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript'); - * console.log(myMIME.type); - * // Prints: text - * myMIME.type = 'application'; - * console.log(myMIME.type); - * // Prints: application - * console.log(String(myMIME)); - * // Prints: application/javascript - * ``` - */ - type: string; - /** - * Gets and sets the subtype portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/ecmascript'); - * console.log(myMIME.subtype); - * // Prints: ecmascript - * myMIME.subtype = 'javascript'; - * console.log(myMIME.subtype); - * // Prints: javascript - * console.log(String(myMIME)); - * // Prints: text/javascript - * ``` - */ - subtype: string; - /** - * Gets the essence of the MIME. This property is read only. - * Use `mime.type` or `mime.subtype` to alter the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript;key=value'); - * console.log(myMIME.essence); - * // Prints: text/javascript - * myMIME.type = 'application'; - * console.log(myMIME.essence); - * // Prints: application/javascript - * console.log(String(myMIME)); - * // Prints: application/javascript;key=value - * ``` - */ - readonly essence: string; - /** - * Gets the `MIMEParams` object representing the - * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. - */ - readonly params: MIMEParams; - /** - * The `toString()` method on the `MIMEType` object returns the serialized MIME. - * - * Because of the need for standard compliance, this method does not allow users - * to customize the serialization process of the MIME. - */ - toString(): string; - } - /** - * The `MIMEParams` API provides read and write access to the parameters of a`MIMEType`. - * @since v19.1.0, v18.13.0 - */ - export class MIMEParams { - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - * 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`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an iterator over the names of each name-value pair. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // bar - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `MIMEParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value`. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * params.set('foo', 'def'); - * params.set('baz', 'xyz'); - * console.log(params.toString()); - * // Prints: foo=def;bar=1;baz=xyz - * ``` - */ - set(name: string, value: string): void; - /** - * Returns an iterator over the values of each name-value pair. - */ - values(): IterableIterator; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - */ - [Symbol.iterator]: typeof MIMEParams.prototype.entries; - } -} -declare module "util/types" { - export * from "util/types"; -} -declare module "util/types" { - import { KeyObject, webcrypto } from "node:crypto"; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap( - object: T | {}, - ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) - : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). - * - * ```js - * console.log(util.types.isNativeError(new Error())); // true - * console.log(util.types.isNativeError(new TypeError())); // true - * console.log(util.types.isNativeError(new RangeError())); // true - * ``` - * - * Subclasses of the native error types are also native errors: - * - * ```js - * class MyError extends Error {} - * console.log(util.types.isNativeError(new MyError())); // true - * ``` - * - * A value being `instanceof` a native error class is not equivalent to `isNativeError()`returning `true` for that value. `isNativeError()` returns `true` for errors - * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false`for these errors: - * - * ```js - * const vm = require('node:vm'); - * const context = vm.createContext({}); - * const myError = vm.runInContext('new Error()', context); - * console.log(util.types.isNativeError(myError)); // true - * console.log(myError instanceof Error); // false - * ``` - * - * Conversely, `isNativeError()` returns `false` for all objects which were not - * returned by the constructor of a native error. That includes values - * which are `instanceof` native errors: - * - * ```js - * const myError = { __proto__: Error.prototype }; - * console.log(util.types.isNativeError(myError)); // false - * console.log(myError instanceof Error); // true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet( - object: T | {}, - ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module "node:util" { - export * from "util"; -} -declare module "node:util/types" { - export * from "util/types"; -} diff --git a/dist/node_modules/@types/node/ts4.8/v8.d.ts b/dist/node_modules/@types/node/ts4.8/v8.d.ts deleted file mode 100644 index 6790e76..0000000 --- a/dist/node_modules/@types/node/ts4.8/v8.d.ts +++ /dev/null @@ -1,635 +0,0 @@ -/** - * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: - * - * ```js - * const v8 = require('node:v8'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/v8.js) - */ -declare module "v8" { - import { Readable } from "node:stream"; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - total_global_handles_size: number; - used_global_handles_size: number; - external_memory: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * `total_global_handles_size` The value of total\_global\_handles\_size is the - * total memory size of V8 global handles. - * - * `used_global_handles_size` The value of used\_global\_handles\_size is the - * used memory size of V8 global handles. - * - * `external_memory` The value of external\_memory is the memory size of array - * buffers and external strings. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0, - * total_global_handles_size: 8192, - * used_global_handles_size: 3296, - * external_memory: 318824 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * const v8 = require('node:v8'); - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * // Print heap snapshot to the console - * const v8 = require('node:v8'); - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable containing the V8 heap snapshot. - */ - function getHeapSnapshot(): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * const { writeHeapSnapshot } = require('node:v8'); - * const { - * Worker, - * isMainThread, - * parentPort, - * } = require('node:worker_threads'); - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string): string; - /** - * Get statistics about code and its metadata in the heap, see - * V8[`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the - * following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794, - * cpu_profiler_metadata_size: 0, - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer's internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before`.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer's internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * - * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to - * serialize a huge object which requires buffer - * larger than `buffer.constants.MAX_LENGTH`. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.TypedArray): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function stopCoverage(): void; - /** - * This API collects GC data in current thread. - * @since v19.6.0, v18.15.0 - */ - class GCProfiler { - /** - * Start collecting GC data. - * @since v19.6.0, v18.15.0 - */ - start(): void; - /** - * Stop collecting GC data and return an object.The content of object - * is as follows. - * - * ```json - * { - * "version": 1, - * "startTime": 1674059033862, - * "statistics": [ - * { - * "gcType": "Scavenge", - * "beforeGC": { - * "heapStatistics": { - * "totalHeapSize": 5005312, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5226496, - * "totalAvailableSize": 4341325216, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4883840, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * }, - * "cost": 1574.14, - * "afterGC": { - * "heapStatistics": { - * "totalHeapSize": 6053888, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5500928, - * "totalAvailableSize": 4341101384, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4059096, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * } - * } - * ], - * "endTime": 1674059036865 - * } - * ``` - * - * Here's an example. - * - * ```js - * const { GCProfiler } = require('v8'); - * const profiler = new GCProfiler(); - * profiler.start(); - * setTimeout(() => { - * console.log(profiler.stop()); - * }, 1000); - * ``` - * @since v19.6.0, v18.15.0 - */ - stop(): GCProfilerResult; - } - interface GCProfilerResult { - version: number; - startTime: number; - endTime: number; - statistics: Array<{ - gcType: string; - cost: number; - beforeGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - afterGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - }>; - } - interface HeapStatistics { - totalHeapSize: number; - totalHeapSizeExecutable: number; - totalPhysicalSize: number; - totalAvailableSize: number; - totalGlobalHandlesSize: number; - usedGlobalHandlesSize: number; - usedHeapSize: number; - heapSizeLimit: number; - mallocedMemory: number; - externalMemory: number; - peakMallocedMemory: number; - } - interface HeapSpaceStatistics { - spaceName: string; - spaceSize: number; - spaceUsedSize: number; - spaceAvailableSize: number; - physicalSpaceSize: number; - } - /** - * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will - * happen if a promise is created without ever getting a continuation. - * @since v17.1.0, v16.14.0 - * @param promise The promise being created. - * @param parent The promise continued from, if applicable. - */ - interface Init { - (promise: Promise, parent: Promise): void; - } - /** - * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. - * - * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. - * The before callback may be called many times in the case where many continuations have been made from the same promise. - * @since v17.1.0, v16.14.0 - */ - interface Before { - (promise: Promise): void; - } - /** - * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. - * @since v17.1.0, v16.14.0 - */ - interface After { - (promise: Promise): void; - } - /** - * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or - * {@link Promise.reject()}. - * @since v17.1.0, v16.14.0 - */ - interface Settled { - (promise: Promise): void; - } - /** - * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or - * around an await, and when the promise resolves or rejects. - * - * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and - * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. - * @since v17.1.0, v16.14.0 - */ - interface HookCallbacks { - init?: Init; - before?: Before; - after?: After; - settled?: Settled; - } - interface PromiseHooks { - /** - * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param init The {@link Init | `init` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onInit: (init: Init) => Function; - /** - * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param settled The {@link Settled | `settled` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onSettled: (settled: Settled) => Function; - /** - * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param before The {@link Before | `before` callback} to call before a promise continuation executes. - * @return Call to stop the hook. - */ - onBefore: (before: Before) => Function; - /** - * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param after The {@link After | `after` callback} to call after a promise continuation executes. - * @return Call to stop the hook. - */ - onAfter: (after: After) => Function; - /** - * Registers functions to be called for different lifetime events of each promise. - * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. - * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. - * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register - * @return Used for disabling hooks - */ - createHook: (callbacks: HookCallbacks) => Function; - } - /** - * The `promiseHooks` interface can be used to track promise lifecycle events. - * @since v17.1.0, v16.14.0 - */ - const promiseHooks: PromiseHooks; -} -declare module "node:v8" { - export * from "v8"; -} diff --git a/dist/node_modules/@types/node/ts4.8/vm.d.ts b/dist/node_modules/@types/node/ts4.8/vm.d.ts deleted file mode 100644 index e44faac..0000000 --- a/dist/node_modules/@types/node/ts4.8/vm.d.ts +++ /dev/null @@ -1,901 +0,0 @@ -/** - * The `node:vm` module enables compiling and running code within V8 Virtual - * Machine contexts. - * - * **The `node:vm` module is not a security** - * **mechanism. Do not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * const vm = require('node:vm'); - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/vm.js) - */ -declare module "vm" { - import { ImportAssertions } from "node:module"; - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * Default: `''`. - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * Default: `0`. - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - /** - * V8's code cache data for the supplied source. - */ - cachedData?: Buffer | NodeJS.ArrayBufferView | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - /** - * Called during evaluation of this module when `import()` is called. - * If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`. - */ - importModuleDynamically?: - | ((specifier: string, script: Script, importAssertions: ImportAssertions) => Module) - | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * Default: `true`. - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * Default: `false`. - */ - breakOnSigint?: boolean | undefined; - } - interface RunningScriptInNewContextOptions extends RunningScriptOptions { - /** - * Human-readable name of the newly created context. - */ - contextName?: CreateContextOptions["name"]; - /** - * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, - * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - */ - contextOrigin?: CreateContextOptions["origin"]; - contextCodeGeneration?: CreateContextOptions["codeGeneration"]; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: CreateContextOptions["microtaskMode"]; - } - interface RunningCodeOptions extends RunningScriptOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * Default: `false`, - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string | undefined; - /** - * Corresponds to the newly created context for display purposes. - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), - * like the value of the `url.origin` property of a URL object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - * @default '' - */ - origin?: string | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: "afterEvaluate" | undefined; - } - type MeasureMemoryMode = "summary" | "detailed"; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - /** - * @default 'default' - */ - execution?: "default" | "eager" | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions | string); - /** - * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * const vm = require('node:vm'); - * - * const context = { - * animal: 'cat', - * count: 2, - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; - /** - * First contextifies the given `contextObject`, runs the compiled code contained - * by the `vm.Script` object within the created context, and returns the result. - * Running code does not have access to local scope. - * - * The following example compiles code that sets a global variable, then executes - * the code multiple times in different contexts. The globals are set on and - * contained within each individual `context`. - * - * ```js - * const vm = require('node:vm'); - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any; - /** - * Runs the compiled code contained by the `vm.Script` within the context of the - * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * const vm = require('node:vm'); - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * The code cache of the `Script` doesn't contain any JavaScript observable - * states. The code cache is safe to be saved along side the script source and - * used to construct new `Script` instances multiple times. - * - * Functions in the `Script` source can be marked as lazily compiled and they are - * not compiled at construction of the `Script`. These functions are going to be - * compiled when they are invoked the first time. The code cache serializes the - * metadata that V8 currently knows about the `Script` that it can use to speed up - * future compilations. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutAdd = script.createCachedData(); - * // In `cacheWithoutAdd` the function `add()` is marked for full compilation - * // upon invocation. - * - * script.runInThisContext(); - * - * const cacheWithAdd = script.createCachedData(); - * // `cacheWithAdd` contains fully compiled function `add()`. - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - /** - * When `cachedData` is supplied to create the `vm.Script`, this value will be set - * to either `true` or `false` depending on acceptance of the data by V8\. - * Otherwise the value is `undefined`. - * @since v5.7.0 - */ - cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; - /** - * When the script is compiled from a source that contains a source map magic - * comment, this property will be set to the URL of the source map. - * - * ```js - * import vm from 'node:vm'; - * - * const script = new vm.Script(` - * function myFunc() {} - * //# sourceMappingURL=sourcemap.json - * `); - * - * console.log(script.sourceMapURL); - * // Prints: sourcemap.json - * ``` - * @since v19.1.0, v18.13.0 - */ - sourceMapURL?: string | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will `prepare - * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, - * the `contextObject` will be the global object, retaining all of its existing - * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables - * will remain unchanged. - * - * ```js - * const vm = require('node:vm'); - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * The `vm.createContext()` method is primarily useful for creating a single - * context that can be used to run multiple scripts. For instance, if emulating a - * web browser, the method can be used to create a single context representing a - * window's global object, then run all ` \ No newline at end of file diff --git a/dist/node_modules/tslib/tslib.es6.js b/dist/node_modules/tslib/tslib.es6.js deleted file mode 100644 index 66174fb..0000000 --- a/dist/node_modules/tslib/tslib.es6.js +++ /dev/null @@ -1,370 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -export function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -export function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -export function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -export function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -export function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); -} - -export default { - __extends: __extends, - __assign: __assign, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __createBinding: __createBinding, - __exportStar: __exportStar, - __values: __values, - __read: __read, - __spread: __spread, - __spreadArrays: __spreadArrays, - __spreadArray: __spreadArray, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault, - __classPrivateFieldGet: __classPrivateFieldGet, - __classPrivateFieldSet: __classPrivateFieldSet, - __classPrivateFieldIn: __classPrivateFieldIn, - __addDisposableResource: __addDisposableResource, - __disposeResources: __disposeResources, -}; diff --git a/dist/node_modules/tslib/tslib.es6.mjs b/dist/node_modules/tslib/tslib.es6.mjs deleted file mode 100644 index c8e2999..0000000 --- a/dist/node_modules/tslib/tslib.es6.mjs +++ /dev/null @@ -1,370 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -export function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -export function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -export function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -export function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -export function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); -} - -export default { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}; diff --git a/dist/node_modules/tslib/tslib.html b/dist/node_modules/tslib/tslib.html deleted file mode 100644 index 44c9ba5..0000000 --- a/dist/node_modules/tslib/tslib.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/dist/node_modules/tslib/tslib.js b/dist/node_modules/tslib/tslib.js deleted file mode 100644 index 7c53293..0000000 --- a/dist/node_modules/tslib/tslib.js +++ /dev/null @@ -1,421 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if (typeof module === "object" && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); diff --git a/dist/node_modules/util-deprecate/History.md b/dist/node_modules/util-deprecate/History.md deleted file mode 100644 index acc8675..0000000 --- a/dist/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/dist/node_modules/util-deprecate/browser.js b/dist/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f..0000000 --- a/dist/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/dist/node_modules/util-deprecate/node.js b/dist/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff..0000000 --- a/dist/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/dist/node_modules/util-deprecate/package.json b/dist/node_modules/util-deprecate/package.json deleted file mode 100644 index 2e79f89..0000000 --- a/dist/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.2", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": "Nathan Rajlich (http://n8.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate" -} diff --git a/dist/node_modules/wcwidth/.npmignore b/dist/node_modules/wcwidth/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/dist/node_modules/wcwidth/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/dist/node_modules/wcwidth/LICENSE b/dist/node_modules/wcwidth/LICENSE deleted file mode 100644 index 313ef1e..0000000 --- a/dist/node_modules/wcwidth/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -wcwidth.js: JavaScript Portng of Markus Kuhn's wcwidth() Implementation -======================================================================= - -Copyright (C) 2012 by Jun Woong. - -This package is a JavaScript porting of `wcwidth()` implementation -[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - diff --git a/dist/node_modules/wcwidth/Readme.md b/dist/node_modules/wcwidth/Readme.md deleted file mode 100644 index 0649a31..0000000 --- a/dist/node_modules/wcwidth/Readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# wcwidth - -Determine columns needed for a fixed-size wide-character string - ----- - -wcwidth is a simple JavaScript port of [wcwidth](http://man7.org/linux/man-pages/man3/wcswidth.3.html) implemented in C by Markus Kuhn. - -JavaScript port [originally](https://github.com/mycoboco/wcwidth.js) written by Woong Jun (http://code.woong.org/) - -## Example - -```js -'한'.length // => 1 -wcwidth('한'); // => 2 - -'한글'.length // => 2 -wcwidth('한글'); // => 4 -``` - -`wcwidth()` and its string version, `wcswidth()` are defined by IEEE Std -1002.1-2001, a.k.a. POSIX.1-2001, and return the number of columns used -to represent the given wide character and string. - -Markus's implementation assumes the wide character given to those -functions to be encoded in ISO 10646, which is almost true for -JavaScript's characters. - -[Further explaination here](docs) - -## License - -MIT diff --git a/dist/node_modules/wcwidth/combining.js b/dist/node_modules/wcwidth/combining.js deleted file mode 100644 index dac9789..0000000 --- a/dist/node_modules/wcwidth/combining.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = [ - [ 0x0300, 0x036F ], [ 0x0483, 0x0486 ], [ 0x0488, 0x0489 ], - [ 0x0591, 0x05BD ], [ 0x05BF, 0x05BF ], [ 0x05C1, 0x05C2 ], - [ 0x05C4, 0x05C5 ], [ 0x05C7, 0x05C7 ], [ 0x0600, 0x0603 ], - [ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ], - [ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ], - [ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ], - [ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ], - [ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ], - [ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ], - [ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ], - [ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ], - [ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ], - [ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ], - [ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ], - [ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ], - [ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ], - [ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ], - [ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ], - [ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ], - [ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ], - [ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ], - [ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ], - [ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ], - [ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ], - [ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ], - [ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ], - [ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ], - [ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ], - [ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ], - [ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ], - [ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ], - [ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ], - [ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ], - [ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ], - [ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ], - [ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ], - [ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ], - [ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ], - [ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ], - [ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ], - [ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ], - [ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ], - [ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ], - [ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ], - [ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ], - [ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ], - [ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ], - [ 0xE0100, 0xE01EF ] -] diff --git a/dist/node_modules/wcwidth/docs/index.md b/dist/node_modules/wcwidth/docs/index.md deleted file mode 100644 index 5c5126d..0000000 --- a/dist/node_modules/wcwidth/docs/index.md +++ /dev/null @@ -1,65 +0,0 @@ -### Javascript porting of Markus Kuhn's wcwidth() implementation - -The following explanation comes from the original C implementation: - -This is an implementation of wcwidth() and wcswidth() (defined in -IEEE Std 1002.1-2001) for Unicode. - -http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html -http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html - -In fixed-width output devices, Latin characters all occupy a single -"cell" position of equal width, whereas ideographic CJK characters -occupy two such cells. Interoperability between terminal-line -applications and (teletype-style) character terminals using the -UTF-8 encoding requires agreement on which character should advance -the cursor by how many cell positions. No established formal -standards exist at present on which Unicode character shall occupy -how many cell positions on character terminals. These routines are -a first attempt of defining such behavior based on simple rules -applied to data provided by the Unicode Consortium. - -For some graphical characters, the Unicode standard explicitly -defines a character-cell width via the definition of the East Asian -FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. -In all these cases, there is no ambiguity about which width a -terminal shall use. For characters in the East Asian Ambiguous (A) -class, the width choice depends purely on a preference of backward -compatibility with either historic CJK or Western practice. -Choosing single-width for these characters is easy to justify as -the appropriate long-term solution, as the CJK practice of -displaying these characters as double-width comes from historic -implementation simplicity (8-bit encoded characters were displayed -single-width and 16-bit ones double-width, even for Greek, -Cyrillic, etc.) and not any typographic considerations. - -Much less clear is the choice of width for the Not East Asian -(Neutral) class. Existing practice does not dictate a width for any -of these characters. It would nevertheless make sense -typographically to allocate two character cells to characters such -as for instance EM SPACE or VOLUME INTEGRAL, which cannot be -represented adequately with a single-width glyph. The following -routines at present merely assign a single-cell width to all -neutral characters, in the interest of simplicity. This is not -entirely satisfactory and should be reconsidered before -establishing a formal standard in this area. At the moment, the -decision which Not East Asian (Neutral) characters should be -represented by double-width glyphs cannot yet be answered by -applying a simple rule from the Unicode database content. Setting -up a proper standard for the behavior of UTF-8 character terminals -will require a careful analysis not only of each Unicode character, -but also of each presentation form, something the author of these -routines has avoided to do so far. - -http://www.unicode.org/unicode/reports/tr11/ - -Markus Kuhn -- 2007-05-26 (Unicode 5.0) - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted. The author -disclaims all warranties with regard to this software. - -Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c - - - diff --git a/dist/node_modules/wcwidth/index.js b/dist/node_modules/wcwidth/index.js deleted file mode 100644 index 48cbb60..0000000 --- a/dist/node_modules/wcwidth/index.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict" - -var defaults = require('defaults') -var combining = require('./combining') - -var DEFAULTS = { - nul: 0, - control: 0 -} - -module.exports = function wcwidth(str) { - return wcswidth(str, DEFAULTS) -} - -module.exports.config = function(opts) { - opts = defaults(opts || {}, DEFAULTS) - return function wcwidth(str) { - return wcswidth(str, opts) - } -} - -/* - * The following functions define the column width of an ISO 10646 - * character as follows: - * - The null character (U+0000) has a column width of 0. - * - Other C0/C1 control characters and DEL will lead to a return value - * of -1. - * - Non-spacing and enclosing combining characters (general category - * code Mn or Me in the - * Unicode database) have a column width of 0. - * - SOFT HYPHEN (U+00AD) has a column width of 1. - * - Other format characters (general category code Cf in the Unicode - * database) and ZERO WIDTH - * SPACE (U+200B) have a column width of 0. - * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) - * have a column width of 0. - * - Spacing characters in the East Asian Wide (W) or East Asian - * Full-width (F) category as - * defined in Unicode Technical Report #11 have a column width of 2. - * - All remaining characters (including all printable ISO 8859-1 and - * WGL4 characters, Unicode control characters, etc.) have a column - * width of 1. - * This implementation assumes that characters are encoded in ISO 10646. -*/ - -function wcswidth(str, opts) { - if (typeof str !== 'string') return wcwidth(str, opts) - - var s = 0 - for (var i = 0; i < str.length; i++) { - var n = wcwidth(str.charCodeAt(i), opts) - if (n < 0) return -1 - s += n - } - - return s -} - -function wcwidth(ucs, opts) { - // test for 8-bit control characters - if (ucs === 0) return opts.nul - if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return opts.control - - // binary search in table of non-spacing characters - if (bisearch(ucs)) return 0 - - // if we arrive here, ucs is not a combining or C0/C1 control character - return 1 + - (ucs >= 0x1100 && - (ucs <= 0x115f || // Hangul Jamo init. consonants - ucs == 0x2329 || ucs == 0x232a || - (ucs >= 0x2e80 && ucs <= 0xa4cf && - ucs != 0x303f) || // CJK ... Yi - (ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables - (ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs - (ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms - (ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms - (ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms - (ucs >= 0xffe0 && ucs <= 0xffe6) || - (ucs >= 0x20000 && ucs <= 0x2fffd) || - (ucs >= 0x30000 && ucs <= 0x3fffd))); -} - -function bisearch(ucs) { - var min = 0 - var max = combining.length - 1 - var mid - - if (ucs < combining[0][0] || ucs > combining[max][1]) return false - - while (max >= min) { - mid = Math.floor((min + max) / 2) - if (ucs > combining[mid][1]) min = mid + 1 - else if (ucs < combining[mid][0]) max = mid - 1 - else return true - } - - return false -} diff --git a/dist/node_modules/wcwidth/package.json b/dist/node_modules/wcwidth/package.json deleted file mode 100644 index eb2df9d..0000000 --- a/dist/node_modules/wcwidth/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "wcwidth", - "version": "1.0.1", - "description": "Port of C's wcwidth() and wcswidth()", - "author": "Tim Oxley", - "contributors": [ - "Woong Jun (http://code.woong.org/)" - ], - "main": "index.js", - "dependencies": { - "defaults": "^1.0.3" - }, - "devDependencies": { - "tape": "^4.5.1" - }, - "license": "MIT", - "keywords": [ - "wide character", - "wc", - "wide character string", - "wcs", - "terminal", - "width", - "wcwidth", - "wcswidth" - ], - "directories": { - "doc": "docs", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/timoxley/wcwidth.git" - }, - "bugs": { - "url": "https://github.com/timoxley/wcwidth/issues" - }, - "homepage": "https://github.com/timoxley/wcwidth#readme" -} diff --git a/dist/node_modules/wcwidth/test/index.js b/dist/node_modules/wcwidth/test/index.js deleted file mode 100644 index 5180599..0000000 --- a/dist/node_modules/wcwidth/test/index.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict" - -var wcwidth = require('../') -var test = require('tape') - -test('handles regular strings', function(t) { - t.strictEqual(wcwidth('abc'), 3) - t.end() -}) - -test('handles multibyte strings', function(t) { - t.strictEqual(wcwidth('字的模块'), 8) - t.end() -}) - -test('handles multibyte characters mixed with regular characters', function(t) { - t.strictEqual(wcwidth('abc 字的模块'), 12) - t.end() -}) - -test('ignores control characters e.g. \\n', function(t) { - t.strictEqual(wcwidth('abc\n字的模块\ndef'), 14) - t.end() -}) - -test('ignores bad input', function(t) { - t.strictEqual(wcwidth(''), 0) - t.strictEqual(wcwidth(3), 0) - t.strictEqual(wcwidth({}), 0) - t.strictEqual(wcwidth([]), 0) - t.strictEqual(wcwidth(), 0) - t.end() -}) - -test('ignores nul (charcode 0)', function(t) { - t.strictEqual(wcwidth(String.fromCharCode(0)), 0) - t.end() -}) - -test('ignores nul mixed with chars', function(t) { - t.strictEqual(wcwidth('a' + String.fromCharCode(0) + '\n字的'), 5) - t.end() -}) - -test('can have custom value for nul', function(t) { - t.strictEqual(wcwidth.config({ - nul: 10 - })(String.fromCharCode(0) + 'a字的'), 15) - t.end() -}) - -test('can have custom control char value', function(t) { - t.strictEqual(wcwidth.config({ - control: 1 - })('abc\n字的模块\ndef'), 16) - t.end() -}) - -test('negative custom control chars == -1', function(t) { - t.strictEqual(wcwidth.config({ - control: -1 - })('abc\n字的模块\ndef'), -1) - t.end() -}) diff --git a/dist/node_modules/yoctocolors-cjs/index.d.ts b/dist/node_modules/yoctocolors-cjs/index.d.ts new file mode 100644 index 0000000..e9c1877 --- /dev/null +++ b/dist/node_modules/yoctocolors-cjs/index.d.ts @@ -0,0 +1,94 @@ +type Format = (string: string) => string; + +declare const reset: Format; +declare const bold: Format; +declare const dim: Format; +declare const italic: Format; +declare const underline: Format; +declare const overline: Format; +declare const inverse: Format; +declare const hidden: Format; +declare const strikethrough: Format; + +declare const black: Format; +declare const red: Format; +declare const green: Format; +declare const yellow: Format; +declare const blue: Format; +declare const magenta: Format; +declare const cyan: Format; +declare const white: Format; +declare const gray: Format; + +declare const bgBlack: Format; +declare const bgRed: Format; +declare const bgGreen: Format; +declare const bgYellow: Format; +declare const bgBlue: Format; +declare const bgMagenta: Format; +declare const bgCyan: Format; +declare const bgWhite: Format; +declare const bgGray: Format; + +declare const redBright: Format; +declare const greenBright: Format; +declare const yellowBright: Format; +declare const blueBright: Format; +declare const magentaBright: Format; +declare const cyanBright: Format; +declare const whiteBright: Format; + +declare const bgRedBright: Format; +declare const bgGreenBright: Format; +declare const bgYellowBright: Format; +declare const bgBlueBright: Format; +declare const bgMagentaBright: Format; +declare const bgCyanBright: Format; +declare const bgWhiteBright: Format; + +declare const formats: { + reset: Format; + bold: Format; + dim: Format; + italic: Format; + underline: Format; + overline: Format; + inverse: Format; + hidden: Format; + strikethrough: Format; + black: Format; + red: Format; + green: Format; + yellow: Format; + blue: Format; + magenta: Format; + cyan: Format; + white: Format; + gray: Format; + bgBlack: Format; + bgRed: Format; + bgGreen: Format; + bgYellow: Format; + bgBlue: Format; + bgMagenta: Format; + bgCyan: Format; + bgWhite: Format; + bgGray: Format; + redBright: Format; + greenBright: Format; + yellowBright: Format; + blueBright: Format; + magentaBright: Format; + cyanBright: Format; + whiteBright: Format; + bgRedBright: Format; + bgGreenBright: Format; + bgYellowBright: Format; + bgBlueBright: Format; + bgMagentaBright: Format; + bgCyanBright: Format; + bgWhiteBright: Format; +}; + +export = formats; + diff --git a/dist/node_modules/yoctocolors-cjs/index.js b/dist/node_modules/yoctocolors-cjs/index.js new file mode 100644 index 0000000..6331714 --- /dev/null +++ b/dist/node_modules/yoctocolors-cjs/index.js @@ -0,0 +1,93 @@ +const tty = require('node:tty'); + +// eslint-disable-next-line no-warning-comments +// TODO: Use a better method when it's added to Node.js (https://github.com/nodejs/node/pull/40240) +// Lots of optionals here to support Deno. +const hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false; + +const format = (open, close) => { + if (!hasColors) { + return input => input; + } + + const openCode = `\u001B[${open}m`; + const closeCode = `\u001B[${close}m`; + + return input => { + const string = input + ''; // eslint-disable-line no-implicit-coercion -- This is faster. + let index = string.indexOf(closeCode); + + if (index === -1) { + // Note: Intentionally not using string interpolation for performance reasons. + return openCode + string + closeCode; + } + + // Handle nested colors. + + // We could have done this, but it's too slow (as of Node.js 22). + // return openCode + string.replaceAll(closeCode, openCode) + closeCode; + + let result = openCode; + let lastIndex = 0; + + while (index !== -1) { + result += string.slice(lastIndex, index) + openCode; + lastIndex = index + closeCode.length; + index = string.indexOf(closeCode, lastIndex); + } + + result += string.slice(lastIndex) + closeCode; + + return result; + }; +}; + +const colors = {}; + +colors.reset = format(0, 0); +colors.bold = format(1, 22); +colors.dim = format(2, 22); +colors.italic = format(3, 23); +colors.underline = format(4, 24); +colors.overline = format(53, 55); +colors.inverse = format(7, 27); +colors.hidden = format(8, 28); +colors.strikethrough = format(9, 29); + +colors.black = format(30, 39); +colors.red = format(31, 39); +colors.green = format(32, 39); +colors.yellow = format(33, 39); +colors.blue = format(34, 39); +colors.magenta = format(35, 39); +colors.cyan = format(36, 39); +colors.white = format(37, 39); +colors.gray = format(90, 39); + +colors.bgBlack = format(40, 49); +colors.bgRed = format(41, 49); +colors.bgGreen = format(42, 49); +colors.bgYellow = format(43, 49); +colors.bgBlue = format(44, 49); +colors.bgMagenta = format(45, 49); +colors.bgCyan = format(46, 49); +colors.bgWhite = format(47, 49); +colors.bgGray = format(100, 49); + +colors.redBright = format(91, 39); +colors.greenBright = format(92, 39); +colors.yellowBright = format(93, 39); +colors.blueBright = format(94, 39); +colors.magentaBright = format(95, 39); +colors.cyanBright = format(96, 39); +colors.whiteBright = format(97, 39); + +colors.bgRedBright = format(101, 49); +colors.bgGreenBright = format(102, 49); +colors.bgYellowBright = format(103, 49); +colors.bgBlueBright = format(104, 49); +colors.bgMagentaBright = format(105, 49); +colors.bgCyanBright = format(106, 49); +colors.bgWhiteBright = format(107, 49); + +module.exports = colors; diff --git a/dist/node_modules/figures/license b/dist/node_modules/yoctocolors-cjs/license similarity index 100% rename from dist/node_modules/figures/license rename to dist/node_modules/yoctocolors-cjs/license diff --git a/dist/node_modules/yoctocolors-cjs/package.json b/dist/node_modules/yoctocolors-cjs/package.json new file mode 100644 index 0000000..5c339a1 --- /dev/null +++ b/dist/node_modules/yoctocolors-cjs/package.json @@ -0,0 +1,67 @@ +{ + "name": "yoctocolors-cjs", + "version": "2.1.2", + "description": "CommonJS version - The smallest and fastest command-line coloring package on the internet", + "license": "MIT", + "repository": "sindresorhus/yoctocolors", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "commonjs", + "main": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "base.js", + "base.d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "ansi", + "style", + "styles", + "tty", + "formatting", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "@jonahsnider/benchmark": "^5.0.3", + "ansi-colors": "^4.1.3", + "ava": "^6.1.3", + "chalk": "^5.3.0", + "cli-color": "^2.0.4", + "colorette": "^2.0.20", + "kleur": "^4.1.5", + "nanocolors": "^0.2.13", + "picocolors": "^1.0.1", + "tsd": "^0.31.0", + "xo": "^0.58.0" + }, + "ava": { + "environmentVariables": { + "FORCE_COLOR": "1" + } + } +} diff --git a/dist/node_modules/yoctocolors-cjs/readme.md b/dist/node_modules/yoctocolors-cjs/readme.md new file mode 100644 index 0000000..fff07bc --- /dev/null +++ b/dist/node_modules/yoctocolors-cjs/readme.md @@ -0,0 +1,130 @@ +yoctocolors 🌈 + +> The smallest and fastest command-line coloring package on the internet + +*Check out [Chalk](https://github.com/chalk/chalk) if you want something more mature and comprehensive.* + +## Highlights + +- Tiny +- Fast +- Handles nested colors +- Tree-shakeable +- No dependencies +- Actively maintained + +## Install + +```sh +npm install yoctocolors +``` + +## Usage + +```js +import colors from 'yoctocolors'; + +console.log(colors.red('Yo!')); + +console.log(colors.blue(`Welcome to the ${colors.green('yoctocolors')} package!`)); +``` + +You can also import colors as named imports: + +```js +import {red, blue, green} from 'yoctocolors'; + +console.log(red('Yo!')); + +console.log(blue(`Welcome to the ${green('yoctocolors')} package!`)); +``` + +*This package supports [basic color detection](https://nodejs.org/api/tty.html#writestreamhascolorscount-env). Colors can be forcefully enabled by setting the `FORCE_COLOR` environment variable to `1` and can be forcefully disabled by setting `NO_COLOR` or `NODE_DISABLE_COLORS` to any value. [More info.](https://nodejs.org/api/tty.html#writestreamgetcolordepthenv)* + +## Styles + +### Modifiers + +- `reset` - Reset the current style. +- `bold` - Make the text bold. +- `dim` - Make the text have lower opacity. +- `italic` - Make the text italic. *(Not widely supported)* +- `underline` - Put a horizontal line above the text. *(Not widely supported)* +- `overline` - Put a horizontal line below the text. *(Not widely supported)* +- `inverse`- Invert background and foreground colors. +- `hidden` - Print the text but make it invisible. +- `strikethrough` - Put a horizontal line through the center of the text. *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgGray` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Prior art + +Yes + +## Benchmark + +```sh +$ ./benchmark.js +┌─────────┬────────────────┬─────────────┐ +│ (index) │ library │ ops/sec │ +├─────────┼────────────────┼─────────────┤ +│ 0 │ 'yoctocolors' │ '8,000,000' │ +│ 1 │ 'colorette' │ '8,000,000' │ +│ 2 │ 'picocolors' │ '8,000,000' │ +│ 3 │ 'nanocolors' │ '5,988,024' │ +│ 4 │ 'chalk' │ '4,807,692' │ +│ 5 │ 'kleur/colors' │ '4,807,692' │ +│ 6 │ 'kleur' │ '4,784,689' │ +│ 7 │ 'ansi-colors' │ '2,178,649' │ +│ 8 │ 'cli-color' │ '585,138' │ +└─────────┴────────────────┴─────────────┘ +``` + +*See [benchmark.js](benchmark.js).* + +## FAQ + +### What is yocto? + +[It was the smallest official unit prefix in the metric system until 2022.](https://en.wikipedia.org/wiki/Yocto-) Much smaller than nano. + +## Related + +- [yoctodelay](https://github.com/sindresorhus/yoctodelay) - Delay a promise a given amount of time +- [chalk](https://github.com/chalk/chalk) - Terminal string styling diff --git a/package-lock.json b/package-lock.json index ab620db..408faf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "trm-action-publish", - "version": "2.1.3", + "version": "2.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "trm-action-publish", - "version": "2.1.3", + "version": "2.1.4", "license": "MIT", "dependencies": { "@actions/core": "^1.10.1", "@actions/github": "^5.1.1", "@octokit/core": "^5.0.1", "@octokit/plugin-paginate-rest": "^9.1.4", - "trm-core": "^3.1.4", + "trm-core": "^4.0.5", "trm-registry-types": "^1.0.3" }, "devDependencies": { @@ -167,6 +167,185 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@inquirer/checkbox": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-2.3.10.tgz", + "integrity": "sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/confirm": { + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.14.tgz", + "integrity": "sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.0.2.tgz", + "integrity": "sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==", + "dependencies": { + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "@types/mute-stream": "^0.0.4", + "@types/node": "^20.14.9", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "cli-spinners": "^2.9.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/editor": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-2.1.14.tgz", + "integrity": "sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "external-editor": "^3.1.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/expand": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-2.1.14.tgz", + "integrity": "sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.3.tgz", + "integrity": "sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/input": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-2.2.1.tgz", + "integrity": "sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/number": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-1.0.2.tgz", + "integrity": "sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/password": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-2.1.14.tgz", + "integrity": "sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/prompts": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-5.1.2.tgz", + "integrity": "sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==", + "dependencies": { + "@inquirer/checkbox": "^2.3.10", + "@inquirer/confirm": "^3.1.14", + "@inquirer/editor": "^2.1.14", + "@inquirer/expand": "^2.1.14", + "@inquirer/input": "^2.2.1", + "@inquirer/number": "^1.0.2", + "@inquirer/password": "^2.1.14", + "@inquirer/rawlist": "^2.1.14", + "@inquirer/select": "^2.3.10" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/rawlist": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-2.1.14.tgz", + "integrity": "sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/type": "^1.4.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/select": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-2.3.10.tgz", + "integrity": "sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==", + "dependencies": { + "@inquirer/core": "^9.0.2", + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.4.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.4.0.tgz", + "integrity": "sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==", + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@octokit/auth-token": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", @@ -413,15 +592,27 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/@types/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { - "version": "20.9.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.2.tgz", - "integrity": "sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==", - "dev": true, + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==" + }, "node_modules/@xmldom/xmldom": { "version": "0.8.10", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", @@ -540,16 +731,6 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -587,29 +768,6 @@ "concat-map": "0.0.1" } }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -651,17 +809,6 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/cli-progress": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", @@ -674,9 +821,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.1.tgz", - "integrity": "sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "engines": { "node": ">=6" }, @@ -699,19 +846,11 @@ } }, "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", "engines": { - "node": ">=0.8" + "node": ">= 12" } }, "node_modules/color-convert": { @@ -799,17 +938,6 @@ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, - "node_modules/defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/define-data-property": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", @@ -909,14 +1037,6 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -979,20 +1099,6 @@ "node": ">=4" } }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -1207,55 +1313,11 @@ "node": ">=0.10.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^6.0.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -1286,14 +1348,6 @@ "node": ">=8" } }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -1302,17 +1356,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -1376,21 +1419,6 @@ "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1453,14 +1481,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1478,9 +1498,12 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/ncp": { "version": "2.0.0", @@ -1604,20 +1627,6 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -1626,28 +1635,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -1756,47 +1743,6 @@ "node": ">= 0.8" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dependencies": { - "tslib": "^2.1.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1946,9 +1892,15 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/spdx-license-ids": { "version": "3.0.16", @@ -1982,14 +1934,6 @@ "node": ">= 0.8" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2025,11 +1969,6 @@ "node": ">=8" } }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" - }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -2055,11 +1994,12 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/trm-core": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/trm-core/-/trm-core-3.1.4.tgz", - "integrity": "sha512-qES0ILtDeEFIDc5CZ3oCjm3QEBeIHiMmSW1tzL9Z9yDJhASMGy33E1HDWICqq11Vojn/KLmpptyNGO1CZ+it4Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/trm-core/-/trm-core-4.0.5.tgz", + "integrity": "sha512-K0NkG9pFJWdYyFkTehKsWCY+C6VaG0LVgRKrMQiLXExg0tv8I+BHXqFPgHm1wL08SYvykYOJZrHu96SOj6tXkQ==", "dependencies": { "@esm2cjs/normalize-url": "^8.0.0", + "@inquirer/prompts": "^5.1.1", "@simonegaffurini/sammarksworkflow": "^1.3.2-fork", "adm-zip": "^0.5.10", "axios": "^1.4.0", @@ -2069,7 +2009,6 @@ "email-validator": "^2.0.4", "express": "^4.18.2", "get-stack-trace": "^3.1.1", - "inquirer": "^8.0.0", "loading-cli": "^1.1.0", "lodash": "^4.17.21", "node-r3trans": "^1.0.10", @@ -2105,11 +2044,6 @@ "resolved": "https://registry.npmjs.org/trm-registry-types/-/trm-registry-types-1.0.3.tgz", "integrity": "sha512-KVWVLC9kAcvaayzNxGuK1H52EEeokA9MkwAcmdbu6QvnJUVTb7v1NWkL4vw0EWPT2iF4w4u2TPHwG8t+SF0FPA==" }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -2155,8 +2089,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/universal-user-agent": { "version": "6.0.1", @@ -2171,11 +2104,6 @@ "node": ">= 0.8" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2200,14 +2128,6 @@ "node": ">= 0.8" } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -2281,6 +2201,17 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 9ddfc37..05762c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trm-action-publish", - "version": "2.1.3", + "version": "2.1.4", "description": "Github Action - TRM Publish", "scripts": { "build": "tsc", @@ -26,7 +26,7 @@ "@actions/github": "^5.1.1", "@octokit/core": "^5.0.1", "@octokit/plugin-paginate-rest": "^9.1.4", - "trm-core": "^3.1.4", + "trm-core": "^4.0.5", "trm-registry-types": "^1.0.3" }, "devDependencies": {