@wbce/projen-d9 0.0.28 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +184 -45
- package/API.md +153 -37
- package/CHANGELOG.md +13 -0
- package/README.md +10 -3
- package/docs/D9-plumbing.md +189 -0
- package/lib/cli/atlas.d.ts +10 -0
- package/lib/cli/atlas.js +65 -0
- package/lib/cli/commands/cedar/cedar-format.d.ts +7 -0
- package/lib/cli/commands/cedar/cedar-format.js +75 -0
- package/lib/cli/commands/cedar/cedar-to-d9-translations.d.ts +12 -0
- package/lib/cli/commands/cedar/cedar-to-d9-translations.js +130 -0
- package/lib/cli/commands/cedar/cedar-to-d9.d.ts +57 -0
- package/lib/cli/commands/cedar/cedar-to-d9.js +221 -0
- package/lib/cli/commands/cedar/cedar-translations.d.ts +9 -0
- package/lib/cli/commands/cedar/cedar-translations.js +213 -0
- package/lib/cli/commands/cedar/d9-permission.d.ts +27 -0
- package/lib/cli/commands/cedar/d9-permission.js +45 -0
- package/lib/cli/commands/cedar/d9-to-cedar.d.ts +33 -0
- package/lib/cli/commands/cedar/d9-to-cedar.js +157 -0
- package/lib/cli/commands/cedar/roles-table.d.ts +14 -0
- package/lib/cli/commands/cedar/roles-table.js +29 -0
- package/lib/cli/commands/save/apply-snapshot.js +39 -30
- package/lib/cli/commands/save/check-unsaved.d.ts +9 -0
- package/lib/cli/commands/save/check-unsaved.js +81 -0
- package/lib/cli/commands/save/env.d.ts +33 -0
- package/lib/cli/commands/save/env.js +109 -0
- package/lib/cli/commands/save/save-snapshot.d.ts +9 -0
- package/lib/cli/commands/save/save-snapshot.js +232 -0
- package/lib/cli/commands/save/sync-files.d.ts +5 -0
- package/lib/cli/commands/save/sync-files.js +46 -0
- package/lib/cli/commands/save/transfer.d.ts +18 -0
- package/lib/cli/commands/save/transfer.js +96 -0
- package/lib/cli/commands/save/utils.d.ts +5 -0
- package/lib/cli/commands/save/utils.js +33 -3
- package/lib/cli/commands/sync.js +4 -3
- package/lib/cli/index.js +65 -25
- package/lib/cli/logger.d.ts +2 -0
- package/lib/cli/logger.js +10 -0
- package/lib/cli/plumbing-config.d.ts +11 -0
- package/lib/cli/plumbing-config.js +13 -0
- package/lib/index.d.ts +44 -5
- package/lib/index.js +54 -41
- package/node_modules/@cedar-policy/cedar-wasm/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.d.ts +427 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.js +9 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.js +434 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/package.json +23 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.d.ts +427 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.js +463 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/package.json +18 -0
- package/node_modules/@cedar-policy/cedar-wasm/package.json +53 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.d.ts +486 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.js +534 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/package.json +21 -0
- package/node_modules/@types/node/README.md +5 -6
- package/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/node_modules/@types/node/assert.d.ts +1040 -79
- package/node_modules/@types/node/async_hooks.d.ts +476 -119
- package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/node_modules/@types/node/buffer.d.ts +1925 -13
- package/node_modules/@types/node/child_process.d.ts +1204 -235
- package/node_modules/@types/node/cluster.d.ts +455 -137
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +450 -1
- package/node_modules/@types/node/constants.d.ts +20 -447
- package/node_modules/@types/node/crypto.d.ts +3962 -600
- package/node_modules/@types/node/dgram.d.ts +515 -33
- package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/node_modules/@types/node/dns.d.ts +798 -247
- package/node_modules/@types/node/domain.d.ts +164 -10
- package/node_modules/@types/node/events.d.ts +954 -25
- package/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/node_modules/@types/node/fs.d.ts +3463 -1569
- package/node_modules/@types/node/globals.d.ts +98 -1277
- package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/node_modules/@types/node/http.d.ts +1933 -300
- package/node_modules/@types/node/http2.d.ts +1946 -254
- package/node_modules/@types/node/https.d.ts +557 -134
- package/node_modules/@types/node/index.d.ts +54 -48
- package/node_modules/@types/node/inspector.d.ts +227 -3014
- package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/node_modules/@types/node/module.d.ts +890 -2
- package/node_modules/@types/node/net.d.ts +872 -105
- package/node_modules/@types/node/os.d.ts +452 -209
- package/node_modules/@types/node/package.json +78 -128
- package/node_modules/@types/node/path.d.ts +196 -155
- package/node_modules/@types/node/perf_hooks.d.ts +829 -120
- package/node_modules/@types/node/process.d.ts +2072 -3
- package/node_modules/@types/node/punycode.d.ts +69 -27
- package/node_modules/@types/node/querystring.d.ts +132 -9
- package/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/node_modules/@types/node/readline.d.ts +485 -49
- package/node_modules/@types/node/repl.d.ts +121 -83
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/sqlite.d.ts +721 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +622 -0
- package/node_modules/@types/node/stream.d.ts +1470 -140
- package/node_modules/@types/node/string_decoder.d.ts +64 -4
- package/node_modules/@types/node/test.d.ts +2163 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +284 -13
- package/node_modules/@types/node/tls.d.ts +850 -244
- package/node_modules/@types/node/trace_events.d.ts +147 -11
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/node_modules/@types/node/tty.d.ts +160 -18
- package/node_modules/@types/node/url.d.ts +890 -53
- package/node_modules/@types/node/util.d.ts +2566 -160
- package/node_modules/@types/node/v8.d.ts +806 -83
- package/node_modules/@types/node/vm.d.ts +932 -44
- package/node_modules/@types/node/wasi.d.ts +148 -22
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +657 -80
- package/node_modules/@types/node/zlib.d.ts +510 -119
- package/node_modules/pino/.nojekyll +0 -0
- package/node_modules/pino/.prettierignore +1 -0
- package/node_modules/pino/CNAME +1 -0
- package/node_modules/pino/CONTRIBUTING.md +34 -0
- package/node_modules/pino/LICENSE +21 -0
- package/node_modules/pino/README.md +177 -0
- package/node_modules/pino/SECURITY.md +103 -0
- package/node_modules/pino/benchmarks/basic.bench.js +95 -0
- package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
- package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
- package/node_modules/pino/benchmarks/child.bench.js +62 -0
- package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
- package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
- package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
- package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
- package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
- package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
- package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
- package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
- package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
- package/node_modules/pino/benchmarks/multistream.js +98 -0
- package/node_modules/pino/benchmarks/object.bench.js +82 -0
- package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
- package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
- package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
- package/node_modules/pino/bin.js +6 -0
- package/node_modules/pino/browser.js +607 -0
- package/node_modules/pino/build/sync-version.js +25 -0
- package/node_modules/pino/docs/api.md +1664 -0
- package/node_modules/pino/docs/asynchronous.md +55 -0
- package/node_modules/pino/docs/benchmarks.md +55 -0
- package/node_modules/pino/docs/browser.md +341 -0
- package/node_modules/pino/docs/bundling.md +40 -0
- package/node_modules/pino/docs/child-loggers.md +116 -0
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +87 -0
- package/node_modules/pino/docs/help.md +353 -0
- package/node_modules/pino/docs/lts.md +93 -0
- package/node_modules/pino/docs/pretty.md +38 -0
- package/node_modules/pino/docs/redaction.md +130 -0
- package/node_modules/pino/docs/transports.md +1447 -0
- package/node_modules/pino/docs/web.md +306 -0
- package/node_modules/pino/eslint.config.js +36 -0
- package/node_modules/pino/examples/basic.js +43 -0
- package/node_modules/pino/examples/transport.js +68 -0
- package/node_modules/pino/favicon.ico +0 -0
- package/node_modules/pino/file.js +12 -0
- package/node_modules/pino/inc-version.sh +42 -0
- package/node_modules/pino/index.html +55 -0
- package/node_modules/pino/lib/caller.js +40 -0
- package/node_modules/pino/lib/constants.js +28 -0
- package/node_modules/pino/lib/deprecations.js +8 -0
- package/node_modules/pino/lib/levels.js +241 -0
- package/node_modules/pino/lib/meta.js +3 -0
- package/node_modules/pino/lib/multistream.js +211 -0
- package/node_modules/pino/lib/proto.js +256 -0
- package/node_modules/pino/lib/redaction.js +119 -0
- package/node_modules/pino/lib/symbols.js +76 -0
- package/node_modules/pino/lib/time.js +39 -0
- package/node_modules/pino/lib/tools.js +427 -0
- package/node_modules/pino/lib/transport-stream.js +56 -0
- package/node_modules/pino/lib/transport.js +302 -0
- package/node_modules/pino/lib/worker.js +197 -0
- package/node_modules/pino/package.json +112 -0
- package/node_modules/pino/pino.d.ts +881 -0
- package/node_modules/pino/pino.js +259 -0
- package/node_modules/pino/test/basic.test.js +952 -0
- package/node_modules/pino/test/broken-pipe.test.js +59 -0
- package/node_modules/pino/test/browser-bindings.test.js +114 -0
- package/node_modules/pino/test/browser-child.test.js +132 -0
- package/node_modules/pino/test/browser-disabled.test.js +87 -0
- package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser-levels.test.js +241 -0
- package/node_modules/pino/test/browser-redaction.test.js +264 -0
- package/node_modules/pino/test/browser-serializers.test.js +352 -0
- package/node_modules/pino/test/browser-set-bindings.test.js +99 -0
- package/node_modules/pino/test/browser-timestamp.test.js +88 -0
- package/node_modules/pino/test/browser-transmit.test.js +417 -0
- package/node_modules/pino/test/browser.test.js +698 -0
- package/node_modules/pino/test/caller.test.js +20 -0
- package/node_modules/pino/test/complex-objects.test.js +36 -0
- package/node_modules/pino/test/crlf.test.js +34 -0
- package/node_modules/pino/test/custom-levels.test.js +267 -0
- package/node_modules/pino/test/diagnostics.test.js +107 -0
- package/node_modules/pino/test/error-key.test.js +37 -0
- package/node_modules/pino/test/error.test.js +403 -0
- package/node_modules/pino/test/escaping.test.js +110 -0
- package/node_modules/pino/test/esm/esm.mjs +14 -0
- package/node_modules/pino/test/esm/index.test.js +21 -0
- package/node_modules/pino/test/esm/named-exports.mjs +29 -0
- package/node_modules/pino/test/exit.test.js +79 -0
- package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
- package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
- package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
- package/node_modules/pino/test/fixtures/caller-loop.js +6 -0
- package/node_modules/pino/test/fixtures/console-transport.js +13 -0
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/default-exit.js +8 -0
- package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
- package/node_modules/pino/test/fixtures/eval/index.js +13 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
- package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
- package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
- package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
- package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
- package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
- package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
- package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
- package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
- package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
- package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
- package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
- package/node_modules/pino/test/fixtures/transport/index.js +12 -0
- package/node_modules/pino/test/fixtures/transport/package.json +5 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
- package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
- package/node_modules/pino/test/fixtures/transport-main.js +9 -0
- package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
- package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
- package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
- package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
- package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
- package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
- package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
- package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
- package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
- package/node_modules/pino/test/formatters.test.js +364 -0
- package/node_modules/pino/test/helper.d.ts +4 -0
- package/node_modules/pino/test/helper.js +159 -0
- package/node_modules/pino/test/hooks.test.js +114 -0
- package/node_modules/pino/test/http.test.js +214 -0
- package/node_modules/pino/test/internals/version.test.js +17 -0
- package/node_modules/pino/test/is-level-enabled.test.js +179 -0
- package/node_modules/pino/test/jest/basic.spec.js +10 -0
- package/node_modules/pino/test/levels.test.js +810 -0
- package/node_modules/pino/test/metadata.test.js +120 -0
- package/node_modules/pino/test/mixin-merge-strategy.test.js +57 -0
- package/node_modules/pino/test/mixin.test.js +241 -0
- package/node_modules/pino/test/multistream.test.js +793 -0
- package/node_modules/pino/test/redact.test.js +923 -0
- package/node_modules/pino/test/serializers.test.js +257 -0
- package/node_modules/pino/test/smoke.js +59 -0
- package/node_modules/pino/test/stdout-protection.test.js +41 -0
- package/node_modules/pino/test/syncfalse.test.js +186 -0
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +124 -0
- package/node_modules/pino/test/transport/big.test.js +42 -0
- package/node_modules/pino/test/transport/bundlers-support.test.js +99 -0
- package/node_modules/pino/test/transport/caller.test.js +24 -0
- package/node_modules/pino/test/transport/core.test.js +818 -0
- package/node_modules/pino/test/transport/core.transpiled.test.ts +114 -0
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +241 -0
- package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
- package/node_modules/pino/test/transport/node-options.test.js +116 -0
- package/node_modules/pino/test/transport/pipeline.test.js +137 -0
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +15 -0
- package/node_modules/pino/test/transport/sync-false.test.js +79 -0
- package/node_modules/pino/test/transport/sync-true.test.js +57 -0
- package/node_modules/pino/test/transport/targets.test.js +48 -0
- package/node_modules/pino/test/transport/uses-pino-config.test.js +166 -0
- package/node_modules/pino/test/transport-stream.test.js +40 -0
- package/node_modules/pino/test/types/pino-import.tst.cts +30 -0
- package/node_modules/pino/test/types/pino-import.tst.js +73 -0
- package/node_modules/pino/test/types/pino-multistream.tst.ts +49 -0
- package/node_modules/pino/test/types/pino-top-export.tst.ts +32 -0
- package/node_modules/pino/test/types/pino-transport.tst.ts +171 -0
- package/node_modules/pino/test/types/pino-type-only.tst.ts +77 -0
- package/node_modules/pino/test/types/pino.ts +98 -0
- package/node_modules/pino/test/types/pino.tst.ts +681 -0
- package/node_modules/pino/test/types/tsconfig.json +10 -0
- package/node_modules/pino/tsconfig.json +14 -0
- package/node_modules/pino-pretty/.borp.yaml +6 -0
- package/node_modules/pino-pretty/.editorconfig +13 -0
- package/node_modules/pino-pretty/.github/dependabot.yml +13 -0
- package/node_modules/pino-pretty/.github/workflows/ci.yml +83 -0
- package/node_modules/pino-pretty/LICENSE +21 -0
- package/node_modules/pino-pretty/Readme.md +425 -0
- package/node_modules/pino-pretty/SECURITY.md +146 -0
- package/node_modules/pino-pretty/benchmark.js +105 -0
- package/node_modules/pino-pretty/bin.js +113 -0
- package/node_modules/pino-pretty/demo.png +0 -0
- package/node_modules/pino-pretty/docs/help.md +24 -0
- package/node_modules/pino-pretty/eslint.config.js +5 -0
- package/node_modules/pino-pretty/help/help.txt +68 -0
- package/node_modules/pino-pretty/index.d.ts +227 -0
- package/node_modules/pino-pretty/index.js +234 -0
- package/node_modules/pino-pretty/lib/colors.js +134 -0
- package/node_modules/pino-pretty/lib/colors.test.js +132 -0
- package/node_modules/pino-pretty/lib/constants.js +55 -0
- package/node_modules/pino-pretty/lib/pretty.js +171 -0
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js +69 -0
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.test.js +84 -0
- package/node_modules/pino-pretty/lib/utils/create-date.js +26 -0
- package/node_modules/pino-pretty/lib/utils/create-date.test.js +20 -0
- package/node_modules/pino-pretty/lib/utils/delete-log-property.js +28 -0
- package/node_modules/pino-pretty/lib/utils/delete-log-property.test.js +31 -0
- package/node_modules/pino-pretty/lib/utils/filter-log.js +99 -0
- package/node_modules/pino-pretty/lib/utils/filter-log.test.js +265 -0
- package/node_modules/pino-pretty/lib/utils/format-time.js +66 -0
- package/node_modules/pino-pretty/lib/utils/format-time.test.js +71 -0
- package/node_modules/pino-pretty/lib/utils/get-level-label-data.js +29 -0
- package/node_modules/pino-pretty/lib/utils/get-property-value.js +30 -0
- package/node_modules/pino-pretty/lib/utils/get-property-value.test.js +31 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js +38 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.test.js +45 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js +39 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.test.js +47 -0
- package/node_modules/pino-pretty/lib/utils/index.js +108 -0
- package/node_modules/pino-pretty/lib/utils/index.test.js +37 -0
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.js +41 -0
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.test.js +84 -0
- package/node_modules/pino-pretty/lib/utils/is-object.js +7 -0
- package/node_modules/pino-pretty/lib/utils/is-object.test.js +10 -0
- package/node_modules/pino-pretty/lib/utils/is-valid-date.js +14 -0
- package/node_modules/pino-pretty/lib/utils/is-valid-date.test.js +16 -0
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js +29 -0
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.test.js +16 -0
- package/node_modules/pino-pretty/lib/utils/noop.js +3 -0
- package/node_modules/pino-pretty/lib/utils/noop.test.js +12 -0
- package/node_modules/pino-pretty/lib/utils/parse-factory-options.js +171 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.js +76 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.test.js +143 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error.js +54 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error.test.js +25 -0
- package/node_modules/pino-pretty/lib/utils/prettify-level.js +41 -0
- package/node_modules/pino-pretty/lib/utils/prettify-level.test.js +70 -0
- package/node_modules/pino-pretty/lib/utils/prettify-message.js +65 -0
- package/node_modules/pino-pretty/lib/utils/prettify-message.test.js +287 -0
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.js +75 -0
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.test.js +170 -0
- package/node_modules/pino-pretty/lib/utils/prettify-object.js +115 -0
- package/node_modules/pino-pretty/lib/utils/prettify-object.test.js +217 -0
- package/node_modules/pino-pretty/lib/utils/prettify-time.js +43 -0
- package/node_modules/pino-pretty/lib/utils/prettify-time.test.js +264 -0
- package/node_modules/pino-pretty/lib/utils/split-property-key.js +49 -0
- package/node_modules/pino-pretty/lib/utils/split-property-key.test.js +29 -0
- package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.js +18 -0
- package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.test.js +9 -0
- package/node_modules/pino-pretty/package.json +64 -0
- package/node_modules/pino-pretty/test/basic.test.js +1305 -0
- package/node_modules/pino-pretty/test/boolean-options.test.js +228 -0
- package/node_modules/pino-pretty/test/cli-rc.test.js +275 -0
- package/node_modules/pino-pretty/test/cli.test.js +360 -0
- package/node_modules/pino-pretty/test/crlf.test.js +33 -0
- package/node_modules/pino-pretty/test/error-objects.test.js +494 -0
- package/node_modules/pino-pretty/test/example/example.js +33 -0
- package/node_modules/pino-pretty/test/helper.js +19 -0
- package/node_modules/pino-pretty/test/types/exports.tst.ts +15 -0
- package/node_modules/pino-pretty/test/types/pino-pretty.tst.ts +140 -0
- package/node_modules/pino-pretty/test/types/tsconfig.json +9 -0
- package/package.json +12 -5
- package/lib/cli/commands/init.d.ts +0 -1
- package/lib/cli/commands/init.js +0 -8
- package/node_modules/@types/node/globals.global.d.ts +0 -1
|
@@ -1,722 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
interface Console {
|
|
3
|
-
Console: NodeJS.ConsoleConstructor;
|
|
4
|
-
/**
|
|
5
|
-
* A simple assertion test that verifies whether `value` is truthy.
|
|
6
|
-
* If it is not, an `AssertionError` is thrown.
|
|
7
|
-
* If provided, the error `message` is formatted using `util.format()` and used as the error message.
|
|
8
|
-
*/
|
|
9
|
-
assert(value: any, message?: string, ...optionalParams: any[]): void;
|
|
10
|
-
/**
|
|
11
|
-
* When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
|
|
12
|
-
* When `stdout` is not a TTY, this method does nothing.
|
|
13
|
-
*/
|
|
14
|
-
clear(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
|
|
17
|
-
*/
|
|
18
|
-
count(label?: string): void;
|
|
19
|
-
/**
|
|
20
|
-
* Resets the internal counter specific to `label`.
|
|
21
|
-
*/
|
|
22
|
-
countReset(label?: string): void;
|
|
23
|
-
/**
|
|
24
|
-
* The `console.debug()` function is an alias for {@link console.log}.
|
|
25
|
-
*/
|
|
26
|
-
debug(message?: any, ...optionalParams: any[]): void;
|
|
27
|
-
/**
|
|
28
|
-
* Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
|
|
29
|
-
* This function bypasses any custom `inspect()` function defined on `obj`.
|
|
30
|
-
*/
|
|
31
|
-
dir(obj: any, options?: NodeJS.InspectOptions): void;
|
|
32
|
-
/**
|
|
33
|
-
* This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
|
|
34
|
-
*/
|
|
35
|
-
dirxml(...data: any[]): void;
|
|
36
|
-
/**
|
|
37
|
-
* Prints to `stderr` with newline.
|
|
38
|
-
*/
|
|
39
|
-
error(message?: any, ...optionalParams: any[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* Increases indentation of subsequent lines by two spaces.
|
|
42
|
-
* If one or more `label`s are provided, those are printed first without the additional indentation.
|
|
43
|
-
*/
|
|
44
|
-
group(...label: any[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* The `console.groupCollapsed()` function is an alias for {@link console.group}.
|
|
47
|
-
*/
|
|
48
|
-
groupCollapsed(...label: any[]): void;
|
|
49
|
-
/**
|
|
50
|
-
* Decreases indentation of subsequent lines by two spaces.
|
|
51
|
-
*/
|
|
52
|
-
groupEnd(): void;
|
|
53
|
-
/**
|
|
54
|
-
* The {@link console.info} function is an alias for {@link console.log}.
|
|
55
|
-
*/
|
|
56
|
-
info(message?: any, ...optionalParams: any[]): void;
|
|
57
|
-
/**
|
|
58
|
-
* Prints to `stdout` with newline.
|
|
59
|
-
*/
|
|
60
|
-
log(message?: any, ...optionalParams: any[]): void;
|
|
61
|
-
/**
|
|
62
|
-
* This method does not display anything unless used in the inspector.
|
|
63
|
-
* Prints to `stdout` the array `array` formatted as a table.
|
|
64
|
-
*/
|
|
65
|
-
table(tabularData: any, properties?: ReadonlyArray<string>): void;
|
|
66
|
-
/**
|
|
67
|
-
* Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
|
|
68
|
-
*/
|
|
69
|
-
time(label?: string): void;
|
|
70
|
-
/**
|
|
71
|
-
* Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
|
|
72
|
-
*/
|
|
73
|
-
timeEnd(label?: string): void;
|
|
74
|
-
/**
|
|
75
|
-
* For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
|
|
76
|
-
*/
|
|
77
|
-
timeLog(label?: string, ...data: any[]): void;
|
|
78
|
-
/**
|
|
79
|
-
* Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
|
|
80
|
-
*/
|
|
81
|
-
trace(message?: any, ...optionalParams: any[]): void;
|
|
82
|
-
/**
|
|
83
|
-
* The {@link console.warn} function is an alias for {@link console.error}.
|
|
84
|
-
*/
|
|
85
|
-
warn(message?: any, ...optionalParams: any[]): void;
|
|
1
|
+
declare var global: typeof globalThis;
|
|
86
2
|
|
|
87
|
-
// --- Inspector mode only ---
|
|
88
|
-
/**
|
|
89
|
-
* This method does not display anything unless used in the inspector.
|
|
90
|
-
* The console.markTimeline() method is the deprecated form of console.timeStamp().
|
|
91
|
-
*
|
|
92
|
-
* @deprecated Use console.timeStamp() instead.
|
|
93
|
-
*/
|
|
94
|
-
markTimeline(label?: string): void;
|
|
95
|
-
/**
|
|
96
|
-
* This method does not display anything unless used in the inspector.
|
|
97
|
-
* Starts a JavaScript CPU profile with an optional label.
|
|
98
|
-
*/
|
|
99
|
-
profile(label?: string): void;
|
|
100
|
-
/**
|
|
101
|
-
* This method does not display anything unless used in the inspector.
|
|
102
|
-
* Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
|
|
103
|
-
*/
|
|
104
|
-
profileEnd(label?: string): void;
|
|
105
|
-
/**
|
|
106
|
-
* This method does not display anything unless used in the inspector.
|
|
107
|
-
* Adds an event with the label `label` to the Timeline panel of the inspector.
|
|
108
|
-
*/
|
|
109
|
-
timeStamp(label?: string): void;
|
|
110
|
-
/**
|
|
111
|
-
* This method does not display anything unless used in the inspector.
|
|
112
|
-
* The console.timeline() method is the deprecated form of console.time().
|
|
113
|
-
*
|
|
114
|
-
* @deprecated Use console.time() instead.
|
|
115
|
-
*/
|
|
116
|
-
timeline(label?: string): void;
|
|
117
|
-
/**
|
|
118
|
-
* This method does not display anything unless used in the inspector.
|
|
119
|
-
* The console.timelineEnd() method is the deprecated form of console.timeEnd().
|
|
120
|
-
*
|
|
121
|
-
* @deprecated Use console.timeEnd() instead.
|
|
122
|
-
*/
|
|
123
|
-
timelineEnd(label?: string): void;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
interface Error {
|
|
127
|
-
stack?: string | undefined;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Declare "static" methods in Error
|
|
131
|
-
interface ErrorConstructor {
|
|
132
|
-
/** Create .stack property on a target object */
|
|
133
|
-
captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Optional override for formatting stack traces
|
|
137
|
-
*
|
|
138
|
-
* @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
|
|
139
|
-
*/
|
|
140
|
-
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
141
|
-
|
|
142
|
-
stackTraceLimit: number;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
interface SymbolConstructor {
|
|
146
|
-
readonly observable: symbol;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Node.js ESNEXT support
|
|
150
|
-
interface String {
|
|
151
|
-
/** Removes whitespace from the left end of a string. */
|
|
152
|
-
trimLeft(): string;
|
|
153
|
-
/** Removes whitespace from the right end of a string. */
|
|
154
|
-
trimRight(): string;
|
|
155
|
-
|
|
156
|
-
/** Returns a copy with leading whitespace removed. */
|
|
157
|
-
trimStart(): string;
|
|
158
|
-
/** Returns a copy with trailing whitespace removed. */
|
|
159
|
-
trimEnd(): string;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
interface ImportMeta {
|
|
163
|
-
url: string;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/*-----------------------------------------------*
|
|
167
|
-
* *
|
|
168
|
-
* GLOBAL *
|
|
169
|
-
* *
|
|
170
|
-
------------------------------------------------*/
|
|
171
3
|
declare var process: NodeJS.Process;
|
|
172
4
|
declare var console: Console;
|
|
173
5
|
|
|
174
|
-
|
|
175
|
-
declare var __dirname: string;
|
|
176
|
-
|
|
177
|
-
declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
|
|
178
|
-
declare namespace setTimeout {
|
|
179
|
-
function __promisify__(ms: number): Promise<void>;
|
|
180
|
-
function __promisify__<T>(ms: number, value: T): Promise<T>;
|
|
181
|
-
}
|
|
182
|
-
declare function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
|
|
183
|
-
declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
|
|
184
|
-
declare function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
|
|
185
|
-
declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
|
|
186
|
-
declare namespace setImmediate {
|
|
187
|
-
function __promisify__(): Promise<void>;
|
|
188
|
-
function __promisify__<T>(value: T): Promise<T>;
|
|
189
|
-
}
|
|
190
|
-
declare function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
|
|
191
|
-
|
|
192
|
-
declare function queueMicrotask(callback: () => void): void;
|
|
193
|
-
|
|
194
|
-
// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
|
|
195
|
-
interface NodeRequireFunction {
|
|
196
|
-
(id: string): any;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
interface NodeRequireCache {
|
|
200
|
-
[path: string]: NodeModule;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
interface NodeRequire extends NodeRequireFunction {
|
|
204
|
-
resolve: RequireResolve;
|
|
205
|
-
cache: NodeRequireCache;
|
|
206
|
-
/**
|
|
207
|
-
* @deprecated
|
|
208
|
-
*/
|
|
209
|
-
extensions: NodeExtensions;
|
|
210
|
-
main: NodeModule | undefined;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
interface RequireResolve {
|
|
214
|
-
(id: string, options?: { paths?: string[] | undefined; }): string;
|
|
215
|
-
paths(request: string): string[] | null;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
interface NodeExtensions {
|
|
219
|
-
'.js': (m: NodeModule, filename: string) => any;
|
|
220
|
-
'.json': (m: NodeModule, filename: string) => any;
|
|
221
|
-
'.node': (m: NodeModule, filename: string) => any;
|
|
222
|
-
[ext: string]: (m: NodeModule, filename: string) => any;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
declare var require: NodeRequire;
|
|
226
|
-
|
|
227
|
-
interface NodeModule {
|
|
228
|
-
exports: any;
|
|
229
|
-
require: NodeRequireFunction;
|
|
230
|
-
id: string;
|
|
231
|
-
filename: string;
|
|
232
|
-
loaded: boolean;
|
|
233
|
-
/** @deprecated since v12.19.0 Please use `require.main` and `module.children` instead. */
|
|
234
|
-
parent: NodeModule | null | undefined;
|
|
235
|
-
children: NodeModule[];
|
|
236
|
-
/**
|
|
237
|
-
* @since v11.14.0
|
|
238
|
-
*
|
|
239
|
-
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
|
240
|
-
*/
|
|
241
|
-
path: string;
|
|
242
|
-
paths: string[];
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
declare var module: NodeModule;
|
|
246
|
-
|
|
247
|
-
// Same as module.exports
|
|
248
|
-
declare var exports: any;
|
|
249
|
-
|
|
250
|
-
// Buffer class
|
|
251
|
-
type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
|
|
252
|
-
|
|
253
|
-
interface Buffer {
|
|
254
|
-
constructor: typeof Buffer;
|
|
255
|
-
readBigUInt64BE(offset?: number): bigint;
|
|
256
|
-
/**
|
|
257
|
-
* @alias Buffer.readBigUInt64BE
|
|
258
|
-
* @since v12.19.0
|
|
259
|
-
*/
|
|
260
|
-
readBigUint64BE(offset?: number): bigint;
|
|
261
|
-
readBigUInt64LE(offset?: number): bigint;
|
|
262
|
-
/**
|
|
263
|
-
* @alias Buffer.readBigUInt64LE
|
|
264
|
-
* @since v12.19.0
|
|
265
|
-
*/
|
|
266
|
-
readBigUint64LE(offset?: number): bigint;
|
|
267
|
-
readBigInt64BE(offset?: number): bigint;
|
|
268
|
-
readBigInt64LE(offset?: number): bigint;
|
|
269
|
-
writeBigInt64BE(value: bigint, offset?: number): number;
|
|
270
|
-
writeBigInt64LE(value: bigint, offset?: number): number;
|
|
271
|
-
writeBigUInt64BE(value: bigint, offset?: number): number;
|
|
272
|
-
/**
|
|
273
|
-
* @alias Buffer.writeBigUInt64BE
|
|
274
|
-
* @since v12.19.0
|
|
275
|
-
*/
|
|
276
|
-
writeBigUint64BE(value: bigint, offset?: number): number;
|
|
277
|
-
writeBigUInt64LE(value: bigint, offset?: number): number;
|
|
278
|
-
/**
|
|
279
|
-
* @alias Buffer.writeBigUInt64LE
|
|
280
|
-
* @since v12.19.0
|
|
281
|
-
*/
|
|
282
|
-
writeBigUint64LE(value: bigint, offset?: number): number;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Raw data is stored in instances of the Buffer class.
|
|
287
|
-
* 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.
|
|
288
|
-
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
|
|
289
|
-
*/
|
|
290
|
-
declare class Buffer extends Uint8Array {
|
|
6
|
+
interface ErrorConstructor {
|
|
291
7
|
/**
|
|
292
|
-
*
|
|
8
|
+
* Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
9
|
+
* a string representing the location in the code at which
|
|
10
|
+
* `Error.captureStackTrace()` was called.
|
|
293
11
|
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Allocates a new buffer of {size} octets.
|
|
12
|
+
* ```js
|
|
13
|
+
* const myObject = {};
|
|
14
|
+
* Error.captureStackTrace(myObject);
|
|
15
|
+
* myObject.stack; // Similar to `new Error().stack`
|
|
16
|
+
* ```
|
|
301
17
|
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*/
|
|
305
|
-
constructor(size: number);
|
|
306
|
-
/**
|
|
307
|
-
* Allocates a new buffer containing the given {array} of octets.
|
|
18
|
+
* The first line of the trace will be prefixed with
|
|
19
|
+
* `${myObject.name}: ${myObject.message}`.
|
|
308
20
|
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
|
|
312
|
-
constructor(array: Uint8Array);
|
|
313
|
-
/**
|
|
314
|
-
* Produces a Buffer backed by the same allocated memory as
|
|
315
|
-
* the given {ArrayBuffer}/{SharedArrayBuffer}.
|
|
21
|
+
* The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
22
|
+
* above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
23
|
+
* generated stack trace.
|
|
316
24
|
*
|
|
25
|
+
* The `constructorOpt` argument is useful for hiding implementation
|
|
26
|
+
* details of error generation from the user. For instance:
|
|
317
27
|
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Allocates a new buffer containing the given {array} of octets.
|
|
28
|
+
* ```js
|
|
29
|
+
* function a() {
|
|
30
|
+
* b();
|
|
31
|
+
* }
|
|
324
32
|
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
|
|
328
|
-
constructor(array: ReadonlyArray<any>);
|
|
329
|
-
/**
|
|
330
|
-
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
|
33
|
+
* function b() {
|
|
34
|
+
* c();
|
|
35
|
+
* }
|
|
331
36
|
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
*
|
|
338
|
-
* the newly created Buffer will share the same allocated memory as the TypedArray.
|
|
339
|
-
* The optional {byteOffset} and {length} arguments specify a memory range
|
|
340
|
-
* within the {arrayBuffer} that will be shared by the Buffer.
|
|
37
|
+
* function c() {
|
|
38
|
+
* // Create an error without stack trace to avoid calculating the stack trace twice.
|
|
39
|
+
* const { stackTraceLimit } = Error;
|
|
40
|
+
* Error.stackTraceLimit = 0;
|
|
41
|
+
* const error = new Error();
|
|
42
|
+
* Error.stackTraceLimit = stackTraceLimit;
|
|
341
43
|
*
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
* Creates a new Buffer using the passed {data}
|
|
347
|
-
* @param data data to create a new Buffer
|
|
348
|
-
*/
|
|
349
|
-
static from(data: ReadonlyArray<number>): Buffer;
|
|
350
|
-
static from(data: Uint8Array): Buffer;
|
|
351
|
-
/**
|
|
352
|
-
* Creates a new buffer containing the coerced value of an object
|
|
353
|
-
* A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
|
|
354
|
-
* @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
|
|
355
|
-
*/
|
|
356
|
-
static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
|
|
357
|
-
/**
|
|
358
|
-
* Creates a new Buffer containing the given JavaScript string {str}.
|
|
359
|
-
* If provided, the {encoding} parameter identifies the character encoding.
|
|
360
|
-
* If not provided, {encoding} defaults to 'utf8'.
|
|
361
|
-
*/
|
|
362
|
-
static from(str: string, encoding?: BufferEncoding): Buffer;
|
|
363
|
-
/**
|
|
364
|
-
* Creates a new Buffer using the passed {data}
|
|
365
|
-
* @param values to create a new Buffer
|
|
366
|
-
*/
|
|
367
|
-
static of(...items: number[]): Buffer;
|
|
368
|
-
/**
|
|
369
|
-
* Returns true if {obj} is a Buffer
|
|
370
|
-
*
|
|
371
|
-
* @param obj object to test.
|
|
372
|
-
*/
|
|
373
|
-
static isBuffer(obj: any): obj is Buffer;
|
|
374
|
-
/**
|
|
375
|
-
* Returns true if {encoding} is a valid encoding argument.
|
|
376
|
-
* Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
|
|
377
|
-
*
|
|
378
|
-
* @param encoding string to test.
|
|
379
|
-
*/
|
|
380
|
-
static isEncoding(encoding: string): encoding is BufferEncoding;
|
|
381
|
-
/**
|
|
382
|
-
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
|
|
383
|
-
* This is not the same as String.prototype.length since that returns the number of characters in a string.
|
|
384
|
-
*
|
|
385
|
-
* @param string string to test.
|
|
386
|
-
* @param encoding encoding used to evaluate (defaults to 'utf8')
|
|
387
|
-
*/
|
|
388
|
-
static byteLength(
|
|
389
|
-
string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
390
|
-
encoding?: BufferEncoding
|
|
391
|
-
): number;
|
|
392
|
-
/**
|
|
393
|
-
* Returns a buffer which is the result of concatenating all the buffers in the list together.
|
|
394
|
-
*
|
|
395
|
-
* If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
|
|
396
|
-
* If the list has exactly one item, then the first item of the list is returned.
|
|
397
|
-
* If the list has more than one item, then a new Buffer is created.
|
|
44
|
+
* // Capture the stack trace above function b
|
|
45
|
+
* Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
46
|
+
* throw error;
|
|
47
|
+
* }
|
|
398
48
|
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
|
|
49
|
+
* a();
|
|
50
|
+
* ```
|
|
402
51
|
*/
|
|
403
|
-
|
|
52
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
404
53
|
/**
|
|
405
|
-
*
|
|
54
|
+
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
406
55
|
*/
|
|
407
|
-
|
|
56
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
408
57
|
/**
|
|
409
|
-
*
|
|
58
|
+
* The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
59
|
+
* collected by a stack trace (whether generated by `new Error().stack` or
|
|
60
|
+
* `Error.captureStackTrace(obj)`).
|
|
410
61
|
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
* If parameter is omitted, buffer will be filled with zeros.
|
|
414
|
-
* @param encoding encoding used for call to buf.fill while initalizing
|
|
415
|
-
*/
|
|
416
|
-
static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
|
|
417
|
-
/**
|
|
418
|
-
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
|
|
419
|
-
* of the newly created Buffer are unknown and may contain sensitive data.
|
|
62
|
+
* The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
63
|
+
* will affect any stack trace captured _after_ the value has been changed.
|
|
420
64
|
*
|
|
421
|
-
*
|
|
65
|
+
* If set to a non-number value, or set to a negative number, stack traces will
|
|
66
|
+
* not capture any frames.
|
|
422
67
|
*/
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
|
|
426
|
-
* of the newly created Buffer are unknown and may contain sensitive data.
|
|
427
|
-
*
|
|
428
|
-
* @param size count of octets to allocate
|
|
429
|
-
*/
|
|
430
|
-
static allocUnsafeSlow(size: number): Buffer;
|
|
431
|
-
/**
|
|
432
|
-
* This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.
|
|
433
|
-
*/
|
|
434
|
-
static poolSize: number;
|
|
435
|
-
|
|
436
|
-
write(string: string, encoding?: BufferEncoding): number;
|
|
437
|
-
write(string: string, offset: number, encoding?: BufferEncoding): number;
|
|
438
|
-
write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
|
|
439
|
-
toString(encoding?: string, start?: number, end?: number): string;
|
|
440
|
-
toJSON(): { type: 'Buffer'; data: number[] };
|
|
441
|
-
equals(otherBuffer: Uint8Array): boolean;
|
|
442
|
-
compare(
|
|
443
|
-
otherBuffer: Uint8Array,
|
|
444
|
-
targetStart?: number,
|
|
445
|
-
targetEnd?: number,
|
|
446
|
-
sourceStart?: number,
|
|
447
|
-
sourceEnd?: number
|
|
448
|
-
): number;
|
|
449
|
-
copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
450
|
-
/**
|
|
451
|
-
* Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
|
|
452
|
-
*
|
|
453
|
-
* This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
|
|
454
|
-
*
|
|
455
|
-
* @param begin Where the new `Buffer` will start. Default: `0`.
|
|
456
|
-
* @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
|
|
457
|
-
*/
|
|
458
|
-
slice(begin?: number, end?: number): Buffer;
|
|
459
|
-
/**
|
|
460
|
-
* Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
|
|
461
|
-
*
|
|
462
|
-
* This method is compatible with `Uint8Array#subarray()`.
|
|
463
|
-
*
|
|
464
|
-
* @param begin Where the new `Buffer` will start. Default: `0`.
|
|
465
|
-
* @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
|
|
466
|
-
*/
|
|
467
|
-
subarray(begin?: number, end?: number): Buffer;
|
|
468
|
-
writeUIntLE(value: number, offset: number, byteLength: number): number;
|
|
469
|
-
/**
|
|
470
|
-
* @alias Buffer.writeUIntLE
|
|
471
|
-
* @since v12.19.0
|
|
472
|
-
*/
|
|
473
|
-
writeUintLE(value: number, offset: number, byteLength: number): number;
|
|
474
|
-
writeUIntBE(value: number, offset: number, byteLength: number): number;
|
|
475
|
-
/**
|
|
476
|
-
* @alias Buffer.writeUIntBE
|
|
477
|
-
* @since v12.19.0
|
|
478
|
-
*/
|
|
479
|
-
writeUintBE(value: number, offset: number, byteLength: number): number;
|
|
480
|
-
writeIntLE(value: number, offset: number, byteLength: number): number;
|
|
481
|
-
writeIntBE(value: number, offset: number, byteLength: number): number;
|
|
482
|
-
readUIntLE(offset: number, byteLength: number): number;
|
|
483
|
-
/**
|
|
484
|
-
* @alias Buffer.readUIntLE
|
|
485
|
-
* @since v12.19.0
|
|
486
|
-
*/
|
|
487
|
-
readUintLE(offset: number, byteLength: number): number;
|
|
488
|
-
readUIntBE(offset: number, byteLength: number): number;
|
|
489
|
-
/**
|
|
490
|
-
* @alias Buffer.readUIntBE
|
|
491
|
-
* @since v12.19.0
|
|
492
|
-
*/
|
|
493
|
-
readUintBE(offset: number, byteLength: number): number;
|
|
494
|
-
readIntLE(offset: number, byteLength: number): number;
|
|
495
|
-
readIntBE(offset: number, byteLength: number): number;
|
|
496
|
-
readUInt8(offset?: number): number;
|
|
497
|
-
/**
|
|
498
|
-
* @alias Buffer.readUInt8
|
|
499
|
-
* @since v12.19.0
|
|
500
|
-
*/
|
|
501
|
-
readUint8(offset?: number): number;
|
|
502
|
-
readUInt16LE(offset?: number): number;
|
|
503
|
-
/**
|
|
504
|
-
* @alias Buffer.readUInt16LE
|
|
505
|
-
* @since v12.19.0
|
|
506
|
-
*/
|
|
507
|
-
readUint16LE(offset?: number): number;
|
|
508
|
-
readUInt16BE(offset?: number): number;
|
|
509
|
-
/**
|
|
510
|
-
* @alias Buffer.readUInt16BE
|
|
511
|
-
* @since v12.19.0
|
|
512
|
-
*/
|
|
513
|
-
readUint16BE(offset?: number): number;
|
|
514
|
-
readUInt32LE(offset?: number): number;
|
|
515
|
-
/**
|
|
516
|
-
* @alias Buffer.readUInt32LE
|
|
517
|
-
* @since v12.19.0
|
|
518
|
-
*/
|
|
519
|
-
readUint32LE(offset?: number): number;
|
|
520
|
-
readUInt32BE(offset?: number): number;
|
|
521
|
-
/**
|
|
522
|
-
* @alias Buffer.readUInt32BE
|
|
523
|
-
* @since v12.19.0
|
|
524
|
-
*/
|
|
525
|
-
readUint32BE(offset?: number): number;
|
|
526
|
-
readInt8(offset?: number): number;
|
|
527
|
-
readInt16LE(offset?: number): number;
|
|
528
|
-
readInt16BE(offset?: number): number;
|
|
529
|
-
readInt32LE(offset?: number): number;
|
|
530
|
-
readInt32BE(offset?: number): number;
|
|
531
|
-
readFloatLE(offset?: number): number;
|
|
532
|
-
readFloatBE(offset?: number): number;
|
|
533
|
-
readDoubleLE(offset?: number): number;
|
|
534
|
-
readDoubleBE(offset?: number): number;
|
|
535
|
-
reverse(): this;
|
|
536
|
-
swap16(): Buffer;
|
|
537
|
-
swap32(): Buffer;
|
|
538
|
-
swap64(): Buffer;
|
|
539
|
-
writeUInt8(value: number, offset?: number): number;
|
|
540
|
-
/**
|
|
541
|
-
* @alias Buffer.writeUInt8
|
|
542
|
-
* @since v12.19.0
|
|
543
|
-
*/
|
|
544
|
-
writeUint8(value: number, offset?: number): number;
|
|
545
|
-
writeUInt16LE(value: number, offset?: number): number;
|
|
546
|
-
/**
|
|
547
|
-
* @alias Buffer.writeUInt16LE
|
|
548
|
-
* @since v12.19.0
|
|
549
|
-
*/
|
|
550
|
-
writeUint16LE(value: number, offset?: number): number;
|
|
551
|
-
writeUInt16BE(value: number, offset?: number): number;
|
|
552
|
-
/**
|
|
553
|
-
* @alias Buffer.writeUInt16BE
|
|
554
|
-
* @since v12.19.0
|
|
555
|
-
*/
|
|
556
|
-
writeUint16BE(value: number, offset?: number): number;
|
|
557
|
-
writeUInt32LE(value: number, offset?: number): number;
|
|
558
|
-
/**
|
|
559
|
-
* @alias Buffer.writeUInt32LE
|
|
560
|
-
* @since v12.19.0
|
|
561
|
-
*/
|
|
562
|
-
writeUint32LE(value: number, offset?: number): number;
|
|
563
|
-
writeUInt32BE(value: number, offset?: number): number;
|
|
564
|
-
/**
|
|
565
|
-
* @alias Buffer.writeUInt32BE
|
|
566
|
-
* @since v12.19.0
|
|
567
|
-
*/
|
|
568
|
-
writeUint32BE(value: number, offset?: number): number;
|
|
569
|
-
writeInt8(value: number, offset?: number): number;
|
|
570
|
-
writeInt16LE(value: number, offset?: number): number;
|
|
571
|
-
writeInt16BE(value: number, offset?: number): number;
|
|
572
|
-
writeInt32LE(value: number, offset?: number): number;
|
|
573
|
-
writeInt32BE(value: number, offset?: number): number;
|
|
574
|
-
writeFloatLE(value: number, offset?: number): number;
|
|
575
|
-
writeFloatBE(value: number, offset?: number): number;
|
|
576
|
-
writeDoubleLE(value: number, offset?: number): number;
|
|
577
|
-
writeDoubleBE(value: number, offset?: number): number;
|
|
578
|
-
|
|
579
|
-
fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
|
|
580
|
-
|
|
581
|
-
indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
|
582
|
-
lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
|
583
|
-
entries(): IterableIterator<[number, number]>;
|
|
584
|
-
includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
|
|
585
|
-
keys(): IterableIterator<number>;
|
|
586
|
-
values(): IterableIterator<number>;
|
|
68
|
+
stackTraceLimit: number;
|
|
587
69
|
}
|
|
588
70
|
|
|
589
|
-
|
|
590
|
-
*
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
*-----------------------------------------------*/
|
|
594
|
-
declare namespace NodeJS {
|
|
595
|
-
interface InspectOptions {
|
|
596
|
-
/**
|
|
597
|
-
* If set to `true`, getters are going to be
|
|
598
|
-
* inspected as well. If set to `'get'` only getters without setter are going
|
|
599
|
-
* to be inspected. If set to `'set'` only getters having a corresponding
|
|
600
|
-
* setter are going to be inspected. This might cause side effects depending on
|
|
601
|
-
* the getter function.
|
|
602
|
-
* @default `false`
|
|
603
|
-
*/
|
|
604
|
-
getters?: 'get' | 'set' | boolean | undefined;
|
|
605
|
-
showHidden?: boolean | undefined;
|
|
606
|
-
/**
|
|
607
|
-
* @default 2
|
|
608
|
-
*/
|
|
609
|
-
depth?: number | null | undefined;
|
|
610
|
-
colors?: boolean | undefined;
|
|
611
|
-
customInspect?: boolean | undefined;
|
|
612
|
-
showProxy?: boolean | undefined;
|
|
613
|
-
maxArrayLength?: number | null | undefined;
|
|
614
|
-
breakLength?: number | undefined;
|
|
615
|
-
/**
|
|
616
|
-
* Setting this to `false` causes each object key
|
|
617
|
-
* to be displayed on a new line. It will also add new lines to text that is
|
|
618
|
-
* longer than `breakLength`. If set to a number, the most `n` inner elements
|
|
619
|
-
* are united on a single line as long as all properties fit into
|
|
620
|
-
* `breakLength`. Short array elements are also grouped together. Note that no
|
|
621
|
-
* text will be reduced below 16 characters, no matter the `breakLength` size.
|
|
622
|
-
* For more information, see the example below.
|
|
623
|
-
* @default `true`
|
|
624
|
-
*/
|
|
625
|
-
compact?: boolean | number | undefined;
|
|
626
|
-
sorted?: boolean | ((a: string, b: string) => number) | undefined;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
interface ConsoleConstructorOptions {
|
|
630
|
-
stdout: WritableStream;
|
|
631
|
-
stderr?: WritableStream | undefined;
|
|
632
|
-
ignoreErrors?: boolean | undefined;
|
|
633
|
-
colorMode?: boolean | 'auto' | undefined;
|
|
634
|
-
inspectOptions?: InspectOptions | undefined;
|
|
635
|
-
/**
|
|
636
|
-
* Set group indentation
|
|
637
|
-
* @default 2
|
|
638
|
-
*/
|
|
639
|
-
groupIndentation?: number | undefined;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
interface ConsoleConstructor {
|
|
643
|
-
prototype: Console;
|
|
644
|
-
new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
|
|
645
|
-
new(options: ConsoleConstructorOptions): Console;
|
|
646
|
-
}
|
|
71
|
+
/**
|
|
72
|
+
* Enable this API with the `--expose-gc` CLI flag.
|
|
73
|
+
*/
|
|
74
|
+
declare var gc: NodeJS.GCFunction | undefined;
|
|
647
75
|
|
|
76
|
+
declare namespace NodeJS {
|
|
648
77
|
interface CallSite {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* Type of "this" as a string.
|
|
656
|
-
* This is the name of the function stored in the constructor field of
|
|
657
|
-
* "this", if available. Otherwise the object's [[Class]] internal
|
|
658
|
-
* property.
|
|
659
|
-
*/
|
|
660
|
-
getTypeName(): string | null;
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* Current function
|
|
664
|
-
*/
|
|
78
|
+
getColumnNumber(): number | null;
|
|
79
|
+
getEnclosingColumnNumber(): number | null;
|
|
80
|
+
getEnclosingLineNumber(): number | null;
|
|
81
|
+
getEvalOrigin(): string | undefined;
|
|
82
|
+
getFileName(): string | null;
|
|
665
83
|
getFunction(): Function | undefined;
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* Name of the current function, typically its name property.
|
|
669
|
-
* If a name property is not available an attempt will be made to try
|
|
670
|
-
* to infer a name from the function's context.
|
|
671
|
-
*/
|
|
672
84
|
getFunctionName(): string | null;
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Name of the property [of "this" or one of its prototypes] that holds
|
|
676
|
-
* the current function
|
|
677
|
-
*/
|
|
678
|
-
getMethodName(): string | null;
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Name of the script [if this function was defined in a script]
|
|
682
|
-
*/
|
|
683
|
-
getFileName(): string | null;
|
|
684
|
-
|
|
685
|
-
/**
|
|
686
|
-
* Current line number [if this function was defined in a script]
|
|
687
|
-
*/
|
|
688
85
|
getLineNumber(): number | null;
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
*/
|
|
699
|
-
getEvalOrigin(): string | undefined;
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Is this a toplevel invocation, that is, is "this" the global object?
|
|
703
|
-
*/
|
|
704
|
-
isToplevel(): boolean;
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
* Does this call take place in code defined by a call to eval?
|
|
708
|
-
*/
|
|
86
|
+
getMethodName(): string | null;
|
|
87
|
+
getPosition(): number;
|
|
88
|
+
getPromiseIndex(): number | null;
|
|
89
|
+
getScriptHash(): string;
|
|
90
|
+
getScriptNameOrSourceURL(): string | null;
|
|
91
|
+
getThis(): unknown;
|
|
92
|
+
getTypeName(): string | null;
|
|
93
|
+
isAsync(): boolean;
|
|
94
|
+
isConstructor(): boolean;
|
|
709
95
|
isEval(): boolean;
|
|
710
|
-
|
|
711
|
-
/**
|
|
712
|
-
* Is this call in native V8 code?
|
|
713
|
-
*/
|
|
714
96
|
isNative(): boolean;
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
* Is this a constructor call?
|
|
718
|
-
*/
|
|
719
|
-
isConstructor(): boolean;
|
|
97
|
+
isPromiseAll(): boolean;
|
|
98
|
+
isToplevel(): boolean;
|
|
720
99
|
}
|
|
721
100
|
|
|
722
101
|
interface ErrnoException extends Error {
|
|
@@ -726,33 +105,14 @@ declare namespace NodeJS {
|
|
|
726
105
|
syscall?: string | undefined;
|
|
727
106
|
}
|
|
728
107
|
|
|
729
|
-
class EventEmitter {
|
|
730
|
-
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
731
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
732
|
-
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
733
|
-
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
734
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
735
|
-
removeAllListeners(event?: string | symbol): this;
|
|
736
|
-
setMaxListeners(n: number): this;
|
|
737
|
-
getMaxListeners(): number;
|
|
738
|
-
listeners(event: string | symbol): Function[];
|
|
739
|
-
rawListeners(event: string | symbol): Function[];
|
|
740
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
741
|
-
listenerCount(type: string | symbol): number;
|
|
742
|
-
// Added in Node 6...
|
|
743
|
-
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
744
|
-
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
745
|
-
eventNames(): Array<string | symbol>;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
108
|
interface ReadableStream extends EventEmitter {
|
|
749
109
|
readable: boolean;
|
|
750
110
|
read(size?: number): string | Buffer;
|
|
751
|
-
setEncoding(encoding:
|
|
111
|
+
setEncoding(encoding: BufferEncoding): this;
|
|
752
112
|
pause(): this;
|
|
753
113
|
resume(): this;
|
|
754
114
|
isPaused(): boolean;
|
|
755
|
-
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined
|
|
115
|
+
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
|
756
116
|
unpipe(destination?: WritableStream): this;
|
|
757
117
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
758
118
|
wrap(oldStream: ReadableStream): this;
|
|
@@ -762,590 +122,51 @@ declare namespace NodeJS {
|
|
|
762
122
|
interface WritableStream extends EventEmitter {
|
|
763
123
|
writable: boolean;
|
|
764
124
|
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
|
765
|
-
write(str: string, encoding?:
|
|
125
|
+
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
|
766
126
|
end(cb?: () => void): this;
|
|
767
127
|
end(data: string | Uint8Array, cb?: () => void): this;
|
|
768
|
-
end(str: string, encoding?:
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
interface ReadWriteStream extends ReadableStream, WritableStream { }
|
|
772
|
-
|
|
773
|
-
interface Domain extends EventEmitter {
|
|
774
|
-
run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
|
|
775
|
-
add(emitter: EventEmitter | Timer): void;
|
|
776
|
-
remove(emitter: EventEmitter | Timer): void;
|
|
777
|
-
bind<T extends Function>(cb: T): T;
|
|
778
|
-
intercept<T extends Function>(cb: T): T;
|
|
779
|
-
|
|
780
|
-
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
781
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
782
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
783
|
-
removeListener(event: string, listener: (...args: any[]) => void): this;
|
|
784
|
-
removeAllListeners(event?: string): this;
|
|
128
|
+
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
|
785
129
|
}
|
|
786
130
|
|
|
787
|
-
interface
|
|
788
|
-
rss: number;
|
|
789
|
-
heapTotal: number;
|
|
790
|
-
heapUsed: number;
|
|
791
|
-
external: number;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
interface CpuUsage {
|
|
795
|
-
user: number;
|
|
796
|
-
system: number;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
interface ProcessRelease {
|
|
800
|
-
name: string;
|
|
801
|
-
sourceUrl?: string | undefined;
|
|
802
|
-
headersUrl?: string | undefined;
|
|
803
|
-
libUrl?: string | undefined;
|
|
804
|
-
lts?: string | undefined;
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
interface ProcessVersions {
|
|
808
|
-
http_parser: string;
|
|
809
|
-
node: string;
|
|
810
|
-
v8: string;
|
|
811
|
-
ares: string;
|
|
812
|
-
uv: string;
|
|
813
|
-
zlib: string;
|
|
814
|
-
modules: string;
|
|
815
|
-
openssl: string;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
type Platform = 'aix'
|
|
819
|
-
| 'android'
|
|
820
|
-
| 'darwin'
|
|
821
|
-
| 'freebsd'
|
|
822
|
-
| 'linux'
|
|
823
|
-
| 'openbsd'
|
|
824
|
-
| 'sunos'
|
|
825
|
-
| 'win32'
|
|
826
|
-
| 'cygwin'
|
|
827
|
-
| 'netbsd';
|
|
828
|
-
|
|
829
|
-
type Signals =
|
|
830
|
-
"SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
|
|
831
|
-
"SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" |
|
|
832
|
-
"SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
|
833
|
-
"SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
|
|
131
|
+
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
|
834
132
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
type BeforeExitListener = (code: number) => void;
|
|
838
|
-
type DisconnectListener = () => void;
|
|
839
|
-
type ExitListener = (code: number) => void;
|
|
840
|
-
type RejectionHandledListener = (promise: Promise<any>) => void;
|
|
841
|
-
type UncaughtExceptionListener = (error: Error) => void;
|
|
842
|
-
type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
|
|
843
|
-
type WarningListener = (warning: Error) => void;
|
|
844
|
-
type MessageListener = (message: any, sendHandle: any) => void;
|
|
845
|
-
type SignalsListener = (signal: Signals) => void;
|
|
846
|
-
type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
|
|
847
|
-
type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
|
|
848
|
-
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
|
|
849
|
-
|
|
850
|
-
interface Socket extends ReadWriteStream {
|
|
851
|
-
isTTY?: true | undefined;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
interface ProcessEnv {
|
|
855
|
-
[key: string]: string | undefined;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
interface HRTime {
|
|
859
|
-
(time?: [number, number]): [number, number];
|
|
860
|
-
bigint(): bigint;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
interface ProcessReport {
|
|
864
|
-
/**
|
|
865
|
-
* Directory where the report is written.
|
|
866
|
-
* working directory of the Node.js process.
|
|
867
|
-
* @default '' indicating that reports are written to the current
|
|
868
|
-
*/
|
|
869
|
-
directory: string;
|
|
870
|
-
|
|
871
|
-
/**
|
|
872
|
-
* Filename where the report is written.
|
|
873
|
-
* The default value is the empty string.
|
|
874
|
-
* @default '' the output filename will be comprised of a timestamp,
|
|
875
|
-
* PID, and sequence number.
|
|
876
|
-
*/
|
|
877
|
-
filename: string;
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* Returns a JSON-formatted diagnostic report for the running process.
|
|
881
|
-
* The report's JavaScript stack trace is taken from err, if present.
|
|
882
|
-
*/
|
|
883
|
-
getReport(err?: Error): string;
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* If true, a diagnostic report is generated on fatal errors,
|
|
887
|
-
* such as out of memory errors or failed C++ assertions.
|
|
888
|
-
* @default false
|
|
889
|
-
*/
|
|
890
|
-
reportOnFatalError: boolean;
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* If true, a diagnostic report is generated when the process
|
|
894
|
-
* receives the signal specified by process.report.signal.
|
|
895
|
-
* @default false
|
|
896
|
-
*/
|
|
897
|
-
reportOnSignal: boolean;
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
* If true, a diagnostic report is generated on uncaught exception.
|
|
901
|
-
* @default false
|
|
902
|
-
*/
|
|
903
|
-
reportOnUncaughtException: boolean;
|
|
904
|
-
|
|
905
|
-
/**
|
|
906
|
-
* The signal used to trigger the creation of a diagnostic report.
|
|
907
|
-
* @default 'SIGUSR2'
|
|
908
|
-
*/
|
|
909
|
-
signal: Signals;
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* Writes a diagnostic report to a file. If filename is not provided, the default filename
|
|
913
|
-
* includes the date, time, PID, and a sequence number.
|
|
914
|
-
* The report's JavaScript stack trace is taken from err, if present.
|
|
915
|
-
*
|
|
916
|
-
* @param fileName Name of the file where the report is written.
|
|
917
|
-
* This should be a relative path, that will be appended to the directory specified in
|
|
918
|
-
* `process.report.directory`, or the current working directory of the Node.js process,
|
|
919
|
-
* if unspecified.
|
|
920
|
-
* @param error A custom error used for reporting the JavaScript stack.
|
|
921
|
-
* @return Filename of the generated report.
|
|
922
|
-
*/
|
|
923
|
-
writeReport(fileName?: string): string;
|
|
924
|
-
writeReport(error?: Error): string;
|
|
925
|
-
writeReport(fileName?: string, err?: Error): string;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
interface ResourceUsage {
|
|
929
|
-
fsRead: number;
|
|
930
|
-
fsWrite: number;
|
|
931
|
-
involuntaryContextSwitches: number;
|
|
932
|
-
ipcReceived: number;
|
|
933
|
-
ipcSent: number;
|
|
934
|
-
majorPageFault: number;
|
|
935
|
-
maxRSS: number;
|
|
936
|
-
minorPageFault: number;
|
|
937
|
-
sharedMemorySize: number;
|
|
938
|
-
signalsCount: number;
|
|
939
|
-
swappedOut: number;
|
|
940
|
-
systemCPUTime: number;
|
|
941
|
-
unsharedDataSize: number;
|
|
942
|
-
unsharedStackSize: number;
|
|
943
|
-
userCPUTime: number;
|
|
944
|
-
voluntaryContextSwitches: number;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
interface EmitWarningOptions {
|
|
948
|
-
/**
|
|
949
|
-
* When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
|
|
950
|
-
*
|
|
951
|
-
* @default 'Warning'
|
|
952
|
-
*/
|
|
953
|
-
type?: string | undefined;
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* A unique identifier for the warning instance being emitted.
|
|
957
|
-
*/
|
|
958
|
-
code?: string | undefined;
|
|
959
|
-
|
|
960
|
-
/**
|
|
961
|
-
* When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
|
|
962
|
-
*
|
|
963
|
-
* @default process.emitWarning
|
|
964
|
-
*/
|
|
965
|
-
ctor?: Function | undefined;
|
|
966
|
-
|
|
967
|
-
/**
|
|
968
|
-
* Additional text to include with the error.
|
|
969
|
-
*/
|
|
970
|
-
detail?: string | undefined;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
interface Process extends EventEmitter {
|
|
974
|
-
/**
|
|
975
|
-
* Can also be a tty.WriteStream, not typed due to limitation.s
|
|
976
|
-
*/
|
|
977
|
-
stdout: WriteStream;
|
|
978
|
-
/**
|
|
979
|
-
* Can also be a tty.WriteStream, not typed due to limitation.s
|
|
980
|
-
*/
|
|
981
|
-
stderr: WriteStream;
|
|
982
|
-
stdin: ReadStream;
|
|
983
|
-
openStdin(): Socket;
|
|
984
|
-
argv: string[];
|
|
985
|
-
argv0: string;
|
|
986
|
-
execArgv: string[];
|
|
987
|
-
execPath: string;
|
|
988
|
-
abort(): never;
|
|
989
|
-
chdir(directory: string): void;
|
|
990
|
-
cwd(): string;
|
|
991
|
-
debugPort: number;
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
|
|
995
|
-
*
|
|
996
|
-
* These can be listened for by adding a handler to the `'warning'` event.
|
|
997
|
-
*
|
|
998
|
-
* @param warning The warning to emit.
|
|
999
|
-
* @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
|
|
1000
|
-
* @param code A unique identifier for the warning instance being emitted.
|
|
1001
|
-
* @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
|
|
1002
|
-
*/
|
|
1003
|
-
emitWarning(warning: string | Error, ctor?: Function): void;
|
|
1004
|
-
emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
|
|
1005
|
-
emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
|
|
1006
|
-
emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
|
|
1007
|
-
|
|
1008
|
-
env: ProcessEnv;
|
|
1009
|
-
exit(code?: number): never;
|
|
1010
|
-
exitCode?: number | undefined;
|
|
1011
|
-
getgid(): number;
|
|
1012
|
-
setgid(id: number | string): void;
|
|
1013
|
-
getuid(): number;
|
|
1014
|
-
setuid(id: number | string): void;
|
|
1015
|
-
geteuid(): number;
|
|
1016
|
-
seteuid(id: number | string): void;
|
|
1017
|
-
getegid(): number;
|
|
1018
|
-
setegid(id: number | string): void;
|
|
1019
|
-
getgroups(): number[];
|
|
1020
|
-
setgroups(groups: ReadonlyArray<string | number>): void;
|
|
1021
|
-
setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
|
|
1022
|
-
hasUncaughtExceptionCaptureCallback(): boolean;
|
|
1023
|
-
version: string;
|
|
1024
|
-
versions: ProcessVersions;
|
|
1025
|
-
config: {
|
|
1026
|
-
target_defaults: {
|
|
1027
|
-
cflags: any[];
|
|
1028
|
-
default_configuration: string;
|
|
1029
|
-
defines: string[];
|
|
1030
|
-
include_dirs: string[];
|
|
1031
|
-
libraries: string[];
|
|
1032
|
-
};
|
|
1033
|
-
variables: {
|
|
1034
|
-
clang: number;
|
|
1035
|
-
host_arch: string;
|
|
1036
|
-
node_install_npm: boolean;
|
|
1037
|
-
node_install_waf: boolean;
|
|
1038
|
-
node_prefix: string;
|
|
1039
|
-
node_shared_openssl: boolean;
|
|
1040
|
-
node_shared_v8: boolean;
|
|
1041
|
-
node_shared_zlib: boolean;
|
|
1042
|
-
node_use_dtrace: boolean;
|
|
1043
|
-
node_use_etw: boolean;
|
|
1044
|
-
node_use_openssl: boolean;
|
|
1045
|
-
target_arch: string;
|
|
1046
|
-
v8_no_strict_aliasing: number;
|
|
1047
|
-
v8_use_snapshot: boolean;
|
|
1048
|
-
visibility: string;
|
|
1049
|
-
};
|
|
1050
|
-
};
|
|
1051
|
-
kill(pid: number, signal?: string | number): true;
|
|
1052
|
-
pid: number;
|
|
1053
|
-
ppid: number;
|
|
1054
|
-
title: string;
|
|
1055
|
-
arch: string;
|
|
1056
|
-
platform: Platform;
|
|
1057
|
-
mainModule?: NodeModule | undefined;
|
|
1058
|
-
memoryUsage(): MemoryUsage;
|
|
1059
|
-
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
1060
|
-
nextTick(callback: Function, ...args: any[]): void;
|
|
1061
|
-
release: ProcessRelease;
|
|
1062
|
-
features: {
|
|
1063
|
-
inspector: boolean;
|
|
1064
|
-
debug: boolean;
|
|
1065
|
-
uv: boolean;
|
|
1066
|
-
ipv6: boolean;
|
|
1067
|
-
tls_alpn: boolean;
|
|
1068
|
-
tls_sni: boolean;
|
|
1069
|
-
tls_ocsp: boolean;
|
|
1070
|
-
tls: boolean;
|
|
1071
|
-
};
|
|
1072
|
-
/**
|
|
1073
|
-
* @deprecated since v12.19.0 - Calling process.umask() with no argument causes
|
|
1074
|
-
* the process-wide umask to be written twice. This introduces a race condition between threads,
|
|
1075
|
-
* and is a potential security vulnerability. There is no safe, cross-platform alternative API.
|
|
1076
|
-
*/
|
|
1077
|
-
umask(): number;
|
|
1078
|
-
/**
|
|
1079
|
-
* Can only be set if not in worker thread.
|
|
1080
|
-
*/
|
|
1081
|
-
umask(mask: string | number): number;
|
|
1082
|
-
uptime(): number;
|
|
1083
|
-
hrtime: HRTime;
|
|
1084
|
-
domain: Domain;
|
|
1085
|
-
|
|
1086
|
-
// Worker
|
|
1087
|
-
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean | undefined}, callback?: (error: Error | null) => void): boolean;
|
|
1088
|
-
disconnect(): void;
|
|
1089
|
-
connected: boolean;
|
|
1090
|
-
|
|
1091
|
-
/**
|
|
1092
|
-
* The `process.allowedNodeEnvironmentFlags` property is a special,
|
|
1093
|
-
* read-only `Set` of flags allowable within the [`NODE_OPTIONS`][]
|
|
1094
|
-
* environment variable.
|
|
1095
|
-
*/
|
|
1096
|
-
allowedNodeEnvironmentFlags: ReadonlySet<string>;
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* Only available with `--experimental-report`
|
|
1100
|
-
*/
|
|
1101
|
-
report?: ProcessReport | undefined;
|
|
1102
|
-
|
|
1103
|
-
resourceUsage(): ResourceUsage;
|
|
1104
|
-
|
|
1105
|
-
/**
|
|
1106
|
-
* EventEmitter
|
|
1107
|
-
* 1. beforeExit
|
|
1108
|
-
* 2. disconnect
|
|
1109
|
-
* 3. exit
|
|
1110
|
-
* 4. message
|
|
1111
|
-
* 5. rejectionHandled
|
|
1112
|
-
* 6. uncaughtException
|
|
1113
|
-
* 7. unhandledRejection
|
|
1114
|
-
* 8. warning
|
|
1115
|
-
* 9. message
|
|
1116
|
-
* 10. <All OS Signals>
|
|
1117
|
-
* 11. newListener/removeListener inherited from EventEmitter
|
|
1118
|
-
*/
|
|
1119
|
-
addListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1120
|
-
addListener(event: "disconnect", listener: DisconnectListener): this;
|
|
1121
|
-
addListener(event: "exit", listener: ExitListener): this;
|
|
1122
|
-
addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
|
1123
|
-
addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
|
1124
|
-
addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1125
|
-
addListener(event: "warning", listener: WarningListener): this;
|
|
1126
|
-
addListener(event: "message", listener: MessageListener): this;
|
|
1127
|
-
addListener(event: Signals, listener: SignalsListener): this;
|
|
1128
|
-
addListener(event: "newListener", listener: NewListenerListener): this;
|
|
1129
|
-
addListener(event: "removeListener", listener: RemoveListenerListener): this;
|
|
1130
|
-
addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1131
|
-
|
|
1132
|
-
emit(event: "beforeExit", code: number): boolean;
|
|
1133
|
-
emit(event: "disconnect"): boolean;
|
|
1134
|
-
emit(event: "exit", code: number): boolean;
|
|
1135
|
-
emit(event: "rejectionHandled", promise: Promise<any>): boolean;
|
|
1136
|
-
emit(event: "uncaughtException", error: Error): boolean;
|
|
1137
|
-
emit(event: "unhandledRejection", reason: any, promise: Promise<any>): boolean;
|
|
1138
|
-
emit(event: "warning", warning: Error): boolean;
|
|
1139
|
-
emit(event: "message", message: any, sendHandle: any): this;
|
|
1140
|
-
emit(event: Signals, signal: Signals): boolean;
|
|
1141
|
-
emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1142
|
-
emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
|
|
1143
|
-
emit(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1144
|
-
|
|
1145
|
-
on(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1146
|
-
on(event: "disconnect", listener: DisconnectListener): this;
|
|
1147
|
-
on(event: "exit", listener: ExitListener): this;
|
|
1148
|
-
on(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
|
1149
|
-
on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
|
1150
|
-
on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1151
|
-
on(event: "warning", listener: WarningListener): this;
|
|
1152
|
-
on(event: "message", listener: MessageListener): this;
|
|
1153
|
-
on(event: Signals, listener: SignalsListener): this;
|
|
1154
|
-
on(event: "newListener", listener: NewListenerListener): this;
|
|
1155
|
-
on(event: "removeListener", listener: RemoveListenerListener): this;
|
|
1156
|
-
on(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1157
|
-
|
|
1158
|
-
once(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1159
|
-
once(event: "disconnect", listener: DisconnectListener): this;
|
|
1160
|
-
once(event: "exit", listener: ExitListener): this;
|
|
1161
|
-
once(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
|
1162
|
-
once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
|
1163
|
-
once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1164
|
-
once(event: "warning", listener: WarningListener): this;
|
|
1165
|
-
once(event: "message", listener: MessageListener): this;
|
|
1166
|
-
once(event: Signals, listener: SignalsListener): this;
|
|
1167
|
-
once(event: "newListener", listener: NewListenerListener): this;
|
|
1168
|
-
once(event: "removeListener", listener: RemoveListenerListener): this;
|
|
1169
|
-
once(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1170
|
-
|
|
1171
|
-
prependListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1172
|
-
prependListener(event: "disconnect", listener: DisconnectListener): this;
|
|
1173
|
-
prependListener(event: "exit", listener: ExitListener): this;
|
|
1174
|
-
prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
|
1175
|
-
prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
|
1176
|
-
prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1177
|
-
prependListener(event: "warning", listener: WarningListener): this;
|
|
1178
|
-
prependListener(event: "message", listener: MessageListener): this;
|
|
1179
|
-
prependListener(event: Signals, listener: SignalsListener): this;
|
|
1180
|
-
prependListener(event: "newListener", listener: NewListenerListener): this;
|
|
1181
|
-
prependListener(event: "removeListener", listener: RemoveListenerListener): this;
|
|
1182
|
-
prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1183
|
-
|
|
1184
|
-
prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1185
|
-
prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
|
|
1186
|
-
prependOnceListener(event: "exit", listener: ExitListener): this;
|
|
1187
|
-
prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
|
1188
|
-
prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
|
1189
|
-
prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1190
|
-
prependOnceListener(event: "warning", listener: WarningListener): this;
|
|
1191
|
-
prependOnceListener(event: "message", listener: MessageListener): this;
|
|
1192
|
-
prependOnceListener(event: Signals, listener: SignalsListener): this;
|
|
1193
|
-
prependOnceListener(event: "newListener", listener: NewListenerListener): this;
|
|
1194
|
-
prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
|
|
1195
|
-
prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1196
|
-
|
|
1197
|
-
listeners(event: "beforeExit"): BeforeExitListener[];
|
|
1198
|
-
listeners(event: "disconnect"): DisconnectListener[];
|
|
1199
|
-
listeners(event: "exit"): ExitListener[];
|
|
1200
|
-
listeners(event: "rejectionHandled"): RejectionHandledListener[];
|
|
1201
|
-
listeners(event: "uncaughtException"): UncaughtExceptionListener[];
|
|
1202
|
-
listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
|
|
1203
|
-
listeners(event: "warning"): WarningListener[];
|
|
1204
|
-
listeners(event: "message"): MessageListener[];
|
|
1205
|
-
listeners(event: Signals): SignalsListener[];
|
|
1206
|
-
listeners(event: "newListener"): NewListenerListener[];
|
|
1207
|
-
listeners(event: "removeListener"): RemoveListenerListener[];
|
|
1208
|
-
listeners(event: "multipleResolves"): MultipleResolveListener[];
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
interface Global {
|
|
1212
|
-
Array: typeof Array;
|
|
1213
|
-
ArrayBuffer: typeof ArrayBuffer;
|
|
1214
|
-
Boolean: typeof Boolean;
|
|
1215
|
-
Buffer: typeof Buffer;
|
|
1216
|
-
DataView: typeof DataView;
|
|
1217
|
-
Date: typeof Date;
|
|
1218
|
-
Error: typeof Error;
|
|
1219
|
-
EvalError: typeof EvalError;
|
|
1220
|
-
Float32Array: typeof Float32Array;
|
|
1221
|
-
Float64Array: typeof Float64Array;
|
|
1222
|
-
Function: typeof Function;
|
|
1223
|
-
GLOBAL: Global;
|
|
1224
|
-
Infinity: typeof Infinity;
|
|
1225
|
-
Int16Array: typeof Int16Array;
|
|
1226
|
-
Int32Array: typeof Int32Array;
|
|
1227
|
-
Int8Array: typeof Int8Array;
|
|
1228
|
-
Intl: typeof Intl;
|
|
1229
|
-
JSON: typeof JSON;
|
|
1230
|
-
Map: MapConstructor;
|
|
1231
|
-
Math: typeof Math;
|
|
1232
|
-
NaN: typeof NaN;
|
|
1233
|
-
Number: typeof Number;
|
|
1234
|
-
Object: typeof Object;
|
|
1235
|
-
Promise: Function;
|
|
1236
|
-
RangeError: typeof RangeError;
|
|
1237
|
-
ReferenceError: typeof ReferenceError;
|
|
1238
|
-
RegExp: typeof RegExp;
|
|
1239
|
-
Set: SetConstructor;
|
|
1240
|
-
String: typeof String;
|
|
1241
|
-
Symbol: Function;
|
|
1242
|
-
SyntaxError: typeof SyntaxError;
|
|
1243
|
-
TypeError: typeof TypeError;
|
|
1244
|
-
URIError: typeof URIError;
|
|
1245
|
-
Uint16Array: typeof Uint16Array;
|
|
1246
|
-
Uint32Array: typeof Uint32Array;
|
|
1247
|
-
Uint8Array: typeof Uint8Array;
|
|
1248
|
-
Uint8ClampedArray: Function;
|
|
1249
|
-
WeakMap: WeakMapConstructor;
|
|
1250
|
-
WeakSet: WeakSetConstructor;
|
|
1251
|
-
clearImmediate: (immediateId: Immediate) => void;
|
|
1252
|
-
clearInterval: (intervalId: Timeout | string | number) => void;
|
|
1253
|
-
clearTimeout: (timeoutId: Timeout | string | number) => void;
|
|
1254
|
-
console: typeof console;
|
|
1255
|
-
decodeURI: typeof decodeURI;
|
|
1256
|
-
decodeURIComponent: typeof decodeURIComponent;
|
|
1257
|
-
encodeURI: typeof encodeURI;
|
|
1258
|
-
encodeURIComponent: typeof encodeURIComponent;
|
|
1259
|
-
escape: (str: string) => string;
|
|
1260
|
-
eval: typeof eval;
|
|
1261
|
-
global: Global;
|
|
1262
|
-
isFinite: typeof isFinite;
|
|
1263
|
-
isNaN: typeof isNaN;
|
|
1264
|
-
parseFloat: typeof parseFloat;
|
|
1265
|
-
parseInt: typeof parseInt;
|
|
1266
|
-
process: Process;
|
|
1267
|
-
root: Global;
|
|
1268
|
-
setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
|
|
1269
|
-
setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
|
|
1270
|
-
setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
|
|
1271
|
-
queueMicrotask: typeof queueMicrotask;
|
|
1272
|
-
undefined: typeof undefined;
|
|
1273
|
-
unescape: (str: string) => string;
|
|
1274
|
-
gc: () => void;
|
|
1275
|
-
v8debug?: any;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
// compatibility with older typings
|
|
1279
|
-
interface Timer {
|
|
1280
|
-
hasRef(): boolean;
|
|
133
|
+
interface RefCounted {
|
|
1281
134
|
ref(): this;
|
|
1282
|
-
refresh(): this;
|
|
1283
135
|
unref(): this;
|
|
1284
|
-
[Symbol.toPrimitive](): number;
|
|
1285
136
|
}
|
|
1286
137
|
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
ref(): this;
|
|
1290
|
-
unref(): this;
|
|
1291
|
-
_onImmediate: Function; // to distinguish it from the Timeout class
|
|
138
|
+
interface Dict<T> {
|
|
139
|
+
[key: string]: T | undefined;
|
|
1292
140
|
}
|
|
1293
141
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
ref(): this;
|
|
1297
|
-
refresh(): this;
|
|
1298
|
-
unref(): this;
|
|
1299
|
-
[Symbol.toPrimitive](): number;
|
|
142
|
+
interface ReadOnlyDict<T> {
|
|
143
|
+
readonly [key: string]: T | undefined;
|
|
1300
144
|
}
|
|
1301
145
|
|
|
1302
|
-
|
|
1303
|
-
static runMain(): void;
|
|
1304
|
-
static wrap(code: string): string;
|
|
1305
|
-
|
|
1306
|
-
/**
|
|
1307
|
-
* @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
|
|
1308
|
-
*/
|
|
1309
|
-
static createRequireFromPath(path: string): NodeRequire;
|
|
1310
|
-
static createRequire(path: string): NodeRequire;
|
|
1311
|
-
static builtinModules: string[];
|
|
1312
|
-
|
|
1313
|
-
static Module: typeof Module;
|
|
146
|
+
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
|
|
1314
147
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
/** @deprecated since v12.19.0 Please use `require.main` and `module.children` instead. */
|
|
1321
|
-
parent: Module | null | undefined;
|
|
1322
|
-
children: Module[];
|
|
1323
|
-
/**
|
|
1324
|
-
* @since v11.14.0
|
|
1325
|
-
*
|
|
1326
|
-
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
|
1327
|
-
*/
|
|
1328
|
-
path: string;
|
|
1329
|
-
paths: string[];
|
|
148
|
+
interface GCFunction {
|
|
149
|
+
(minor?: boolean): void;
|
|
150
|
+
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
|
|
151
|
+
(options: NodeJS.GCOptions): void;
|
|
152
|
+
}
|
|
1330
153
|
|
|
1331
|
-
|
|
154
|
+
interface GCOptions {
|
|
155
|
+
execution?: "sync" | "async" | undefined;
|
|
156
|
+
flavor?: "regular" | "last-resort" | undefined;
|
|
157
|
+
type?: "major-snapshot" | "major" | "minor" | undefined;
|
|
158
|
+
filename?: string | undefined;
|
|
1332
159
|
}
|
|
1333
160
|
|
|
1334
|
-
|
|
1335
|
-
|
|
161
|
+
/** An iterable iterator returned by the Node.js API. */
|
|
162
|
+
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator.
|
|
163
|
+
interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
|
164
|
+
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
|
1336
165
|
}
|
|
1337
166
|
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
| Int8Array
|
|
1344
|
-
| Int16Array
|
|
1345
|
-
| Int32Array
|
|
1346
|
-
| BigUint64Array
|
|
1347
|
-
| BigInt64Array
|
|
1348
|
-
| Float32Array
|
|
1349
|
-
| Float64Array;
|
|
1350
|
-
type ArrayBufferView = TypedArray | DataView;
|
|
167
|
+
/** An async iterable iterator returned by the Node.js API. */
|
|
168
|
+
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used AsyncIterableIterator.
|
|
169
|
+
interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
|
170
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
|
171
|
+
}
|
|
1351
172
|
}
|