mirror of
https://github.com/github/codeql-action.git
synced 2025-12-25 16:50:21 +08:00
Compare commits
45 Commits
v2.25.5
...
NlightNFot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72dc0335f8 | ||
|
|
b2a144d499 | ||
|
|
b1bd8da5e7 | ||
|
|
ebd27c09f6 | ||
|
|
b46ca8cee6 | ||
|
|
00daf24ffe | ||
|
|
3ee86e168e | ||
|
|
b2dad92724 | ||
|
|
9fdb3e4972 | ||
|
|
00792ab1e0 | ||
|
|
7c4668115d | ||
|
|
b0a1d92ae3 | ||
|
|
23c1981a3f | ||
|
|
46fc2c9526 | ||
|
|
445165beea | ||
|
|
63d519c0ae | ||
|
|
0d9161ca1c | ||
|
|
e9e27290e9 | ||
|
|
de1ac31508 | ||
|
|
a57c67b895 | ||
|
|
b7ef64ecb1 | ||
|
|
e54dea297a | ||
|
|
3b42294f03 | ||
|
|
9f32769e43 | ||
|
|
7fd4900b29 | ||
|
|
931fabe1ef | ||
|
|
24766fcf56 | ||
|
|
08487dbb93 | ||
|
|
5a14b059c3 | ||
|
|
df4819e3a1 | ||
|
|
bcc13653e8 | ||
|
|
1796f5474f | ||
|
|
4522b08a7e | ||
|
|
998a4c720d | ||
|
|
c92bbd4223 | ||
|
|
cff15d7117 | ||
|
|
cbe408dfc9 | ||
|
|
bf2faab135 | ||
|
|
32f554ea7c | ||
|
|
9f6ef11db1 | ||
|
|
90e315a7a8 | ||
|
|
bc3670a4f4 | ||
|
|
4f59156fc8 | ||
|
|
eb4969f5e2 | ||
|
|
6182f337aa |
@@ -29,7 +29,16 @@ inputs:
|
||||
tools:
|
||||
required: true
|
||||
description: |
|
||||
The url of codeql to use.
|
||||
The version of CodeQL passed to the `tools` input of the init action.
|
||||
This can be any of the following:
|
||||
|
||||
- A local path to a tarball containing the CodeQL tools, or
|
||||
- A URL to a GitHub release assets containing the CodeQL tools, or
|
||||
- A special value `linked` which is forcing the use of the CodeQL tools
|
||||
that the action has been bundled with.
|
||||
|
||||
If not specified, the Action will check in several places until it finds
|
||||
the CodeQL tools.
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
2
.github/actions/check-sarif/action.yml
vendored
2
.github/actions/check-sarif/action.yml
vendored
@@ -16,5 +16,5 @@ inputs:
|
||||
Comma separated list of query ids that should NOT be included in this SARIF file.
|
||||
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: index.js
|
||||
|
||||
11
.github/actions/query-filter-test/action.yml
vendored
11
.github/actions/query-filter-test/action.yml
vendored
@@ -23,7 +23,16 @@ inputs:
|
||||
tools:
|
||||
required: true
|
||||
description: |
|
||||
The url of codeql to use.
|
||||
The version of CodeQL passed to the `tools` input of the init action.
|
||||
This can be any of the following:
|
||||
|
||||
- A local path to a tarball containing the CodeQL tools, or
|
||||
- A URL to a GitHub release assets containing the CodeQL tools, or
|
||||
- A special value `linked` which is forcing the use of the CodeQL tools
|
||||
that the action has been bundled with.
|
||||
|
||||
If not specified, the Action will check in several places until it finds
|
||||
the CodeQL tools.
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
16
.github/workflows/__multi-language-autodetect.yml
generated
vendored
16
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -28,36 +28,20 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: macos-12
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: macos-12
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.15.5
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.16.6
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Multi-language repository
|
||||
|
||||
16
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
16
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
@@ -28,36 +28,20 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: macos-12
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: macos-12
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.15.5
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.16.6
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Scaling reserved RAM
|
||||
|
||||
6
.github/workflows/__swift-custom-build.yml
generated
vendored
6
.github/workflows/__swift-custom-build.yml
generated
vendored
@@ -28,16 +28,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Swift analysis using a custom build command
|
||||
|
||||
21
.github/workflows/__unset-environment.yml
generated
vendored
21
.github/workflows/__unset-environment.yml
generated
vendored
@@ -28,21 +28,17 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Test unsetting environment variables
|
||||
permissions:
|
||||
@@ -79,6 +75,9 @@ jobs:
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.21.0'
|
||||
- name: Build code
|
||||
shell: bash
|
||||
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
|
||||
|
||||
11
.github/workflows/debug-artifacts.yml
vendored
11
.github/workflows/debug-artifacts.yml
vendored
@@ -25,9 +25,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- stable-20230403
|
||||
- stable-v2.13.5
|
||||
- stable-v2.14.6
|
||||
# TODO: Once CLI v2.17.4 is available and the platform is switched back to ubuntu,
|
||||
# stable-20230403, stable-v2.13.5, and stable-v2.14.6 can be added back to this matrix,
|
||||
# and the VERSIONS variable in the bash script below.
|
||||
# Prior to CLI v2.15.1, ARM runners were not supported by the build tracer.
|
||||
- stable-v2.15.5
|
||||
- stable-v2.16.6
|
||||
- default
|
||||
@@ -37,7 +38,7 @@ jobs:
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
timeout-minutes: 45
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-latest # TODO: Switch back to ubuntu for `nightly-latest` and `latest` once CLI v2.17.4 is available.
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -75,7 +76,7 @@ jobs:
|
||||
- name: Check expected artifacts exist
|
||||
shell: bash
|
||||
run: |
|
||||
VERSIONS="stable-20230403 stable-v2.13.5 stable-v2.14.6 stable-v2.15.5 stable-v2.16.6 default latest nightly-latest"
|
||||
VERSIONS="stable-v2.15.5 stable-v2.16.6 default latest nightly-latest"
|
||||
LANGUAGES="cpp csharp go java javascript python"
|
||||
for version in $VERSIONS; do
|
||||
pushd "./my-debug-artifacts-${version//./}"
|
||||
|
||||
3
.github/workflows/pr-checks.yml
vendored
3
.github/workflows/pr-checks.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-types-version: [16.11, current] # we backport this matrix job in order to maintain the same check names
|
||||
node-types-version: [16.11, current] # run tests on 16.11 while CodeQL Action v2 is still supported
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -50,7 +50,6 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Check generated JS
|
||||
if: matrix.node-types-version != 'current' # we do not need to test the newer node on the v2 branch
|
||||
run: .github/workflows/script/check-js.sh
|
||||
|
||||
check-node-modules:
|
||||
|
||||
58
CHANGELOG.md
58
CHANGELOG.md
@@ -4,110 +4,122 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
||||
|
||||
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
||||
|
||||
## 2.25.5 - 13 May 2024
|
||||
## [UNRELEASED]
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 3.25.6 - 20 May 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.17.3. [#2295](https://github.com/github/codeql-action/pull/2295)
|
||||
|
||||
## 3.25.5 - 13 May 2024
|
||||
|
||||
- Add a compatibility matrix of supported CodeQL Action, CodeQL CLI, and GitHub Enterprise Server versions to the [README.md](README.md). [#2273](https://github.com/github/codeql-action/pull/2273)
|
||||
- Avoid printing out a warning for a missing `on.push` trigger when the CodeQL Action is triggered via a `workflow_call` event. [#2274](https://github.com/github/codeql-action/pull/2274)
|
||||
- The `tools: latest` input to the `init` Action has been renamed to `tools: linked`. This option specifies that the Action should use the tools shipped at the same time as the Action. The old name will continue to work for backwards compatibility, but we recommend that new workflows use the new name. [#2281](https://github.com/github/codeql-action/pull/2281)
|
||||
|
||||
## 2.25.4 - 08 May 2024
|
||||
## 3.25.4 - 08 May 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.17.2. [#2270](https://github.com/github/codeql-action/pull/2270)
|
||||
|
||||
## 2.25.3 - 25 Apr 2024
|
||||
## 3.25.3 - 25 Apr 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.17.1. [#2247](https://github.com/github/codeql-action/pull/2247)
|
||||
- Workflows running on `macos-latest` using CodeQL CLI versions before v2.15.1 will need to either upgrade their CLI version to v2.15.1 or newer, or change the platform to an Intel MacOS runner, such as `macos-12`. ARM machines with SIP disabled, including the newest `macos-latest` image, are unsupported for CLI versions before 2.15.1. [#2261](https://github.com/github/codeql-action/pull/2261)
|
||||
|
||||
## 2.25.2 - 22 Apr 2024
|
||||
## 3.25.2 - 22 Apr 2024
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 2.25.1 - 17 Apr 2024
|
||||
## 3.25.1 - 17 Apr 2024
|
||||
|
||||
- We are rolling out a feature in April/May 2024 that improves the reliability and performance of analyzing code when analyzing a compiled language with the `autobuild` [build mode](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes). [#2235](https://github.com/github/codeql-action/pull/2235)
|
||||
- Fix a bug where the `init` Action would fail if `--overwrite` was specified in `CODEQL_ACTION_EXTRA_OPTIONS`. [#2245](https://github.com/github/codeql-action/pull/2245)
|
||||
|
||||
## 2.25.0 - 15 Apr 2024
|
||||
## 3.25.0 - 15 Apr 2024
|
||||
|
||||
- The deprecated feature for extracting dependencies for a Python analysis has been removed. [#2224](https://github.com/github/codeql-action/pull/2224)
|
||||
|
||||
As a result, the following inputs and environment variables are now ignored:
|
||||
|
||||
- The `setup-python-dependencies` input to the `init` Action
|
||||
- The `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION` environment variable
|
||||
|
||||
We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0.
|
||||
- Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229)
|
||||
- Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232)
|
||||
- A more relevant log message and a diagnostic are now emitted when the `file` program is not installed on a Linux runner, but is required for Go tracing to succeed. [#2234](https://github.com/github/codeql-action/pull/2234)
|
||||
|
||||
## 2.24.10 - 05 Apr 2024
|
||||
## 3.24.10 - 05 Apr 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.17.0. [#2219](https://github.com/github/codeql-action/pull/2219)
|
||||
- Add a deprecation warning for customers using CodeQL version 2.12.5 and earlier. These versions of CodeQL were discontinued on 26 March 2024 alongside GitHub Enterprise Server 3.8, and will be unsupported by CodeQL Action versions 3.25.0 and later and versions 2.25.0 and later. [#2220](https://github.com/github/codeql-action/pull/2220)
|
||||
- If you are using one of these versions, please update to CodeQL CLI version 2.12.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version.
|
||||
- Alternatively, if you want to continue using a version of the CodeQL CLI between 2.11.6 and 2.12.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.24.10` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.24.10` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
||||
|
||||
## 2.24.9 - 22 Mar 2024
|
||||
## 3.24.9 - 22 Mar 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203)
|
||||
|
||||
## 2.24.8 - 18 Mar 2024
|
||||
## 3.24.8 - 18 Mar 2024
|
||||
|
||||
- Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. [#2195](https://github.com/github/codeql-action/pull/2195)
|
||||
|
||||
## 2.24.7 - 12 Mar 2024
|
||||
## 3.24.7 - 12 Mar 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185)
|
||||
|
||||
## 2.24.6 - 29 Feb 2024
|
||||
## 3.24.6 - 29 Feb 2024
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 2.24.5 - 23 Feb 2024
|
||||
## 3.24.5 - 23 Feb 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156)
|
||||
|
||||
## 2.24.4 - 21 Feb 2024
|
||||
## 3.24.4 - 21 Feb 2024
|
||||
|
||||
- Fix an issue where an existing, but empty, `/sys/fs/cgroup/cpuset.cpus` file always resulted in a single-threaded run. [#2151](https://github.com/github/codeql-action/pull/2151)
|
||||
|
||||
## 2.24.3 - 15 Feb 2024
|
||||
## 3.24.3 - 15 Feb 2024
|
||||
|
||||
- Fix an issue where the CodeQL Action would fail to load a configuration specified by the `config` input to the `init` Action. [#2147](https://github.com/github/codeql-action/pull/2147)
|
||||
|
||||
## 2.24.2 - 15 Feb 2024
|
||||
## 3.24.2 - 15 Feb 2024
|
||||
|
||||
- Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141)
|
||||
|
||||
## 2.24.1 - 13 Feb 2024
|
||||
## 3.24.1 - 13 Feb 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124)
|
||||
- The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121)
|
||||
|
||||
## 2.24.0 - 02 Feb 2024
|
||||
## 3.24.0 - 02 Feb 2024
|
||||
|
||||
- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106)
|
||||
|
||||
## 2.23.2 - 26 Jan 2024
|
||||
## 3.23.2 - 26 Jan 2024
|
||||
|
||||
- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083)
|
||||
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)
|
||||
|
||||
## 2.23.1 - 17 Jan 2024
|
||||
## 3.23.1 - 17 Jan 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073)
|
||||
- Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079)
|
||||
|
||||
## 2.23.0 - 08 Jan 2024
|
||||
## 3.23.0 - 08 Jan 2024
|
||||
|
||||
- We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false` in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. [#2031](https://github.com/github/codeql-action/pull/2031)
|
||||
- The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see [the corresponding changelog entry for CodeQL Action version 2.22.7](#2227---16-nov-2023). [#2009](https://github.com/github/codeql-action/pull/2009)
|
||||
|
||||
## 2.22.12 - 22 Dec 2023
|
||||
## 3.22.12 - 22 Dec 2023
|
||||
|
||||
- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047)
|
||||
|
||||
## 2.22.11 - 13 Dec 2023
|
||||
## 3.22.11 - 13 Dec 2023
|
||||
|
||||
No user facing changes.
|
||||
- [v3+ only] The CodeQL Action now runs on Node.js v20. [#2006](https://github.com/github/codeql-action/pull/2006)
|
||||
|
||||
## 2.22.10 - 12 Dec 2023
|
||||
|
||||
|
||||
@@ -86,6 +86,6 @@ outputs:
|
||||
sarif-id:
|
||||
description: The ID of the uploaded SARIF file.
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: "../lib/analyze-action.js"
|
||||
post: "../lib/analyze-action-post.js"
|
||||
|
||||
@@ -15,5 +15,5 @@ inputs:
|
||||
$GITHUB_WORKSPACE as its working directory.
|
||||
required: false
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: '../lib/autobuild-action.js'
|
||||
|
||||
@@ -3,9 +3,19 @@ description: 'Set up CodeQL'
|
||||
author: 'GitHub'
|
||||
inputs:
|
||||
tools:
|
||||
description: URL of CodeQL tools
|
||||
description: >-
|
||||
By default, the Action will use the recommended version of the CodeQL
|
||||
Bundle to analyze your project. You can override this choice using this
|
||||
input. One of:
|
||||
|
||||
- A local path to a CodeQL Bundle tarball, or
|
||||
- The URL of a CodeQL Bundle tarball GitHub release asset, or
|
||||
- A special value `linked` which uses the version of the CodeQL tools
|
||||
that the Action has been bundled with.
|
||||
|
||||
If not specified, the Action will check in several places until it finds
|
||||
the CodeQL tools.
|
||||
required: false
|
||||
# If not specified the Action will check in several places until it finds the CodeQL tools.
|
||||
languages:
|
||||
description: >-
|
||||
A comma-separated list of CodeQL languages to analyze.
|
||||
@@ -26,10 +36,7 @@ inputs:
|
||||
- `none`: The database will be created without building the source code.
|
||||
Available for all interpreted languages and some compiled languages.
|
||||
- `autobuild`: The database will be created by attempting to automatically build the source
|
||||
code.
|
||||
To use this build mode, ensure that your workflow calls the `autobuild` action
|
||||
between the `init` and `analyze` steps.
|
||||
Available for all compiled languages.
|
||||
code. Available for all compiled languages.
|
||||
- `manual`: The database will be created by building the source code using a manually
|
||||
specified build command. To use this build mode, specify manual build steps in
|
||||
your workflow between the `init` and `analyze` steps. Available for all
|
||||
@@ -133,6 +140,6 @@ outputs:
|
||||
codeql-path:
|
||||
description: The path of the CodeQL binary used for analysis
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: '../lib/init-action.js'
|
||||
post: '../lib/init-action-post.js'
|
||||
|
||||
20
lib/cli-errors.js
generated
20
lib/cli-errors.js
generated
@@ -117,10 +117,10 @@ function ensureEndsInPeriod(text) {
|
||||
var CliConfigErrorCategory;
|
||||
(function (CliConfigErrorCategory) {
|
||||
CliConfigErrorCategory["ExternalRepositoryCloneFailed"] = "ExternalRepositoryCloneFailed";
|
||||
CliConfigErrorCategory["GracefulOutOfMemory"] = "GracefulOutOfMemory";
|
||||
CliConfigErrorCategory["GradleBuildFailed"] = "GradleBuildFailed";
|
||||
CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion";
|
||||
CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice";
|
||||
CliConfigErrorCategory["InvalidConfigFile"] = "InvalidConfigFile";
|
||||
CliConfigErrorCategory["InvalidSourceRoot"] = "InvalidSourceRoot";
|
||||
CliConfigErrorCategory["MavenBuildFailed"] = "MavenBuildFailed";
|
||||
CliConfigErrorCategory["NoBuildCommandAutodetected"] = "NoBuildCommandAutodetected";
|
||||
@@ -128,6 +128,7 @@ var CliConfigErrorCategory;
|
||||
CliConfigErrorCategory["NoSourceCodeSeen"] = "NoSourceCodeSeen";
|
||||
CliConfigErrorCategory["NoSupportedBuildCommandSucceeded"] = "NoSupportedBuildCommandSucceeded";
|
||||
CliConfigErrorCategory["NoSupportedBuildSystemDetected"] = "NoSupportedBuildSystemDetected";
|
||||
CliConfigErrorCategory["OutOfMemoryOrDisk"] = "OutOfMemoryOrDisk";
|
||||
CliConfigErrorCategory["PackCannotBeFound"] = "PackCannotBeFound";
|
||||
CliConfigErrorCategory["SwiftBuildFailed"] = "SwiftBuildFailed";
|
||||
CliConfigErrorCategory["UnsupportedBuildMode"] = "UnsupportedBuildMode";
|
||||
@@ -142,9 +143,6 @@ exports.cliErrorsConfig = {
|
||||
new RegExp("Failed to clone external Git repository"),
|
||||
],
|
||||
},
|
||||
[CliConfigErrorCategory.GracefulOutOfMemory]: {
|
||||
cliErrorMessageCandidates: [new RegExp("CodeQL is out of memory.")],
|
||||
},
|
||||
[CliConfigErrorCategory.GradleBuildFailed]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("[autobuild] FAILURE: Build failed with an exception."),
|
||||
@@ -162,6 +160,12 @@ exports.cliErrorsConfig = {
|
||||
],
|
||||
additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?`,
|
||||
},
|
||||
[CliConfigErrorCategory.InvalidConfigFile]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("Config file .* is not valid"),
|
||||
new RegExp("The supplied config file is empty"),
|
||||
],
|
||||
},
|
||||
// Expected source location for database creation does not exist
|
||||
[CliConfigErrorCategory.InvalidSourceRoot]: {
|
||||
cliErrorMessageCandidates: [new RegExp("Invalid source root")],
|
||||
@@ -200,6 +204,14 @@ exports.cliErrorsConfig = {
|
||||
new RegExp("No supported build system detected"),
|
||||
],
|
||||
},
|
||||
[CliConfigErrorCategory.OutOfMemoryOrDisk]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("CodeQL is out of memory."),
|
||||
new RegExp("out of disk"),
|
||||
new RegExp("No space left on device"),
|
||||
],
|
||||
additionalErrorMessageToAppend: "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory",
|
||||
},
|
||||
[CliConfigErrorCategory.PackCannotBeFound]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("Query pack .* cannot be found\\. Check the spelling of the pack\\."),
|
||||
|
||||
File diff suppressed because one or more lines are too long
16
lib/database-upload.js
generated
16
lib/database-upload.js
generated
@@ -36,8 +36,9 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||
return;
|
||||
}
|
||||
// Do nothing when not running against github.com
|
||||
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
|
||||
logger.debug("Not running against github.com. Skipping upload.");
|
||||
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
|
||||
config.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM) {
|
||||
logger.debug("Not running against github.com or GHEC-DR. Skipping upload.");
|
||||
return;
|
||||
}
|
||||
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
|
||||
@@ -47,6 +48,14 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||
}
|
||||
const client = (0, api_client_1.getApiClient)();
|
||||
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||
const uploadsUrl = new URL((0, util_1.parseGitHubUrl)(apiDetails.url));
|
||||
uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`;
|
||||
// Octokit expects the baseUrl to not have a trailing slash,
|
||||
// but it is included by default in a URL.
|
||||
let uploadsBaseUrl = uploadsUrl.toString();
|
||||
if (uploadsBaseUrl.endsWith("/")) {
|
||||
uploadsBaseUrl = uploadsBaseUrl.slice(0, -1);
|
||||
}
|
||||
for (const language of config.languages) {
|
||||
try {
|
||||
// Upload the database bundle.
|
||||
@@ -58,7 +67,8 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||
const bundledDbReadStream = fs.createReadStream(bundledDb);
|
||||
const commitOid = await actionsUtil.getCommitOid(actionsUtil.getRequiredInput("checkout_path"));
|
||||
try {
|
||||
await client.request(`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, {
|
||||
await client.request(`POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, {
|
||||
baseUrl: uploadsBaseUrl,
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
language,
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"database-upload.js","sourceRoot":"","sources":["../src/database-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,4DAA8C;AAC9C,6CAA8D;AAC9D,qCAAqC;AAIrC,6CAA+B;AAC/B,iCAAkC;AAE3B,KAAK,UAAU,eAAe,CACnC,aAA4B,EAC5B,MAAc,EACd,UAA4B,EAC5B,MAAc;IAEd,IAAI,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/D,MAAM,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACvE,OAAO;IACT,CAAC;IAED,iDAAiD;IACjD,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QAC5D,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IAED,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC,EAAE,CAAC;QACpD,4EAA4E;QAC5E,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,yBAAY,GAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEjD,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACxC,IAAI,CAAC;YACH,8BAA8B;YAC9B,2EAA2E;YAC3E,8EAA8E;YAC9E,wEAAwE;YACxE,MAAM,SAAS,GAAG,MAAM,IAAA,eAAQ,EAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YACrE,MAAM,aAAa,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;YAClD,MAAM,mBAAmB,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAC3D,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,YAAY,CAC9C,WAAW,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAC9C,CAAC;YACF,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,OAAO,CAClB,+HAA+H,EAC/H;oBACE,KAAK,EAAE,aAAa,CAAC,KAAK;oBAC1B,IAAI,EAAE,aAAa,CAAC,IAAI;oBACxB,QAAQ;oBACR,IAAI,EAAE,GAAG,QAAQ,WAAW;oBAC5B,UAAU,EAAE,SAAS;oBACrB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE;wBACP,aAAa,EAAE,SAAS,UAAU,CAAC,IAAI,EAAE;wBACzC,cAAc,EAAE,iBAAiB;wBACjC,gBAAgB,EAAE,aAAa;qBAChC;iBACF,CACF,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;YACjE,CAAC;oBAAS,CAAC;gBACT,mBAAmB,CAAC,KAAK,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,4CAA4C;YAC5C,MAAM,CAAC,OAAO,CAAC,iCAAiC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;AACH,CAAC;AAjED,0CAiEC"}
|
||||
{"version":3,"file":"database-upload.js","sourceRoot":"","sources":["../src/database-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,4DAA8C;AAC9C,6CAA8D;AAC9D,qCAAqC;AAIrC,6CAA+B;AAC/B,iCAAkD;AAE3C,KAAK,UAAU,eAAe,CACnC,aAA4B,EAC5B,MAAc,EACd,UAA4B,EAC5B,MAAc;IAEd,IAAI,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/D,MAAM,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACvE,OAAO;IACT,CAAC;IAED,iDAAiD;IACjD,IACE,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,MAAM;QACvD,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,UAAU,EAC3D,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC,EAAE,CAAC;QACpD,4EAA4E;QAC5E,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,yBAAY,GAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,IAAA,qBAAc,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,UAAU,CAAC,QAAQ,GAAG,WAAW,UAAU,CAAC,QAAQ,EAAE,CAAC;IAEvD,4DAA4D;IAC5D,0CAA0C;IAC1C,IAAI,cAAc,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC3C,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACxC,IAAI,CAAC;YACH,8BAA8B;YAC9B,2EAA2E;YAC3E,8EAA8E;YAC9E,wEAAwE;YACxE,MAAM,SAAS,GAAG,MAAM,IAAA,eAAQ,EAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YACrE,MAAM,aAAa,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;YAClD,MAAM,mBAAmB,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAC3D,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,YAAY,CAC9C,WAAW,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAC9C,CAAC;YACF,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,OAAO,CAClB,qGAAqG,EACrG;oBACE,OAAO,EAAE,cAAc;oBACvB,KAAK,EAAE,aAAa,CAAC,KAAK;oBAC1B,IAAI,EAAE,aAAa,CAAC,IAAI;oBACxB,QAAQ;oBACR,IAAI,EAAE,GAAG,QAAQ,WAAW;oBAC5B,UAAU,EAAE,SAAS;oBACrB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE;wBACP,aAAa,EAAE,SAAS,UAAU,CAAC,IAAI,EAAE;wBACzC,cAAc,EAAE,iBAAiB;wBACjC,gBAAgB,EAAE,aAAa;qBAChC;iBACF,CACF,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;YACjE,CAAC;oBAAS,CAAC;gBACT,mBAAmB,CAAC,KAAK,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,4CAA4C;YAC5C,MAAM,CAAC,OAAO,CAAC,iCAAiC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;AACH,CAAC;AA/ED,0CA+EC"}
|
||||
19
lib/database-upload.test.js
generated
19
lib/database-upload.test.js
generated
@@ -57,7 +57,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
// Passing an auth token is required, so we just use a dummy value
|
||||
const client = github.getOctokit("123");
|
||||
const requestSpy = sinon.stub(client, "request");
|
||||
const url = "POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid";
|
||||
const url = "POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid";
|
||||
const databaseUploadSpy = requestSpy.withArgs(url);
|
||||
if (databaseUploadStatusCode < 300) {
|
||||
databaseUploadSpy.resolves(undefined);
|
||||
@@ -66,6 +66,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
databaseUploadSpy.throws(new util_1.HTTPError("some error message", databaseUploadStatusCode));
|
||||
}
|
||||
sinon.stub(apiClient, "getApiClient").value(() => client);
|
||||
return databaseUploadSpy;
|
||||
}
|
||||
(0, ava_1.default)("Abort database upload if 'upload-database' input set to false", async (t) => {
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
@@ -95,7 +96,8 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
const loggedMessages = [];
|
||||
await (0, database_upload_1.uploadDatabases)(testRepoName, config, testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||
v.message === "Not running against github.com. Skipping upload.") !== undefined);
|
||||
v.message ===
|
||||
"Not running against github.com or GHEC-DR. Skipping upload.") !== undefined);
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Abort database upload if not analyzing default branch", async (t) => {
|
||||
@@ -133,7 +135,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
"Failed to upload database for javascript: Error: some error message") !== undefined);
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Successfully uploading a database to api.github.com", async (t) => {
|
||||
(0, ava_1.default)("Successfully uploading a database to github.com", async (t) => {
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
sinon
|
||||
@@ -153,7 +155,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
v.message === "Successfully uploaded database for javascript") !== undefined);
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Successfully uploading a database to uploads.github.com", async (t) => {
|
||||
(0, ava_1.default)("Successfully uploading a database to GHEC-DR", async (t) => {
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
sinon
|
||||
@@ -161,16 +163,21 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
.withArgs("upload-database")
|
||||
.returns("true");
|
||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
||||
await mockHttpRequests(201);
|
||||
const databaseUploadSpy = await mockHttpRequests(201);
|
||||
(0, codeql_1.setCodeQL)({
|
||||
async databaseBundle(_, outputFilePath) {
|
||||
fs.writeFileSync(outputFilePath, "");
|
||||
},
|
||||
});
|
||||
const loggedMessages = [];
|
||||
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), {
|
||||
auth: "1234",
|
||||
url: "https://tenant.ghe.com",
|
||||
apiURL: undefined,
|
||||
}, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||
v.message === "Successfully uploaded database for javascript") !== undefined);
|
||||
t.assert(databaseUploadSpy.calledOnceWith(sinon.match.string, sinon.match.has("baseUrl", "https://uploads.tenant.ghe.com")));
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=database-upload.test.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"bundleVersion": "codeql-bundle-v2.17.2",
|
||||
"cliVersion": "2.17.2",
|
||||
"priorBundleVersion": "codeql-bundle-v2.17.1",
|
||||
"priorCliVersion": "2.17.1"
|
||||
"bundleVersion": "codeql-bundle-v2.17.3",
|
||||
"cliVersion": "2.17.3",
|
||||
"priorBundleVersion": "codeql-bundle-v2.17.2",
|
||||
"priorCliVersion": "2.17.2"
|
||||
}
|
||||
|
||||
8
lib/feature-flags.js
generated
8
lib/feature-flags.js
generated
@@ -50,7 +50,6 @@ exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM = "2.15.1";
|
||||
var Feature;
|
||||
(function (Feature) {
|
||||
Feature["AutobuildDirectTracing"] = "autobuild_direct_tracing";
|
||||
Feature["CombineSarifFilesDeprecationWarning"] = "combine_sarif_files_deprecation_warning_enabled";
|
||||
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
||||
Feature["CppTrapCachingEnabled"] = "cpp_trap_caching_enabled";
|
||||
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
||||
@@ -65,13 +64,6 @@ exports.featureConfig = {
|
||||
minimumVersion: undefined,
|
||||
toolsFeature: tools_features_1.ToolsFeature.TraceCommandUseBuildMode,
|
||||
},
|
||||
[Feature.CombineSarifFilesDeprecationWarning]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_COMBINE_SARIF_FILES_DEPRECATION_WARNING",
|
||||
legacyApi: true,
|
||||
// Independent of the CLI version.
|
||||
minimumVersion: undefined,
|
||||
},
|
||||
[Feature.CppDependencyInstallation]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||
|
||||
File diff suppressed because one or more lines are too long
41
lib/setup-codeql.js
generated
41
lib/setup-codeql.js
generated
@@ -52,6 +52,7 @@ var ToolsSource;
|
||||
ToolsSource["Download"] = "DOWNLOAD";
|
||||
})(ToolsSource || (exports.ToolsSource = ToolsSource = {}));
|
||||
exports.CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action";
|
||||
const CODEQL_BUNDLE_VERSION_ALIAS = ["linked", "latest"];
|
||||
function getCodeQLBundleName() {
|
||||
let platform;
|
||||
if (process.platform === "win32") {
|
||||
@@ -222,7 +223,10 @@ async function findOverridingToolsInCache(humanReadableVersion, logger) {
|
||||
return undefined;
|
||||
}
|
||||
async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, variant, logger) {
|
||||
if (toolsInput && toolsInput !== "latest" && !toolsInput.startsWith("http")) {
|
||||
if (toolsInput &&
|
||||
!CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput) &&
|
||||
!toolsInput.startsWith("http")) {
|
||||
logger.info(`Using CodeQL CLI from local path ${toolsInput}`);
|
||||
return {
|
||||
codeqlTarPath: toolsInput,
|
||||
sourceType: "local",
|
||||
@@ -232,14 +236,21 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian
|
||||
/**
|
||||
* Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced.
|
||||
*
|
||||
* We use the special value of 'latest' to prioritize the version in `defaults.json` over the
|
||||
* We use the special value of 'linked' to prioritize the version in `defaults.json` over the
|
||||
* version specified by the feature flags on Dotcom and over any pinned cached version on
|
||||
* Enterprise Server.
|
||||
*
|
||||
* Previously we have been using 'latest' to force the shipped tools, but this was not clear
|
||||
* enough for the users, so it has been changed to `linked`. We're keeping around `latest` for
|
||||
* backwards compatibility.
|
||||
*/
|
||||
const forceShippedTools = toolsInput === "latest";
|
||||
const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput);
|
||||
if (forceShippedTools) {
|
||||
logger.info("Overriding the version of the CodeQL tools by the version shipped with the Action since " +
|
||||
`"tools: latest" was requested.`);
|
||||
logger.info(`Overriding the version of the CodeQL tools by ${defaultCliVersion.cliVersion}, the version shipped with the Action since ` +
|
||||
`tools: ${toolsInput} was requested.`);
|
||||
if (toolsInput === "latest") {
|
||||
logger.warning("`tools: latest` has been renamed to `tools: linked`, but the old name is still supported for now. No action is required.");
|
||||
}
|
||||
}
|
||||
/** CLI version number, for example 2.12.6. */
|
||||
let cliVersion;
|
||||
@@ -329,6 +340,12 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian
|
||||
logger.info(`Did not find CodeQL tools version ${humanReadableVersion} in the toolcache.`);
|
||||
}
|
||||
if (codeqlFolder) {
|
||||
if (cliVersion) {
|
||||
logger.info(`Using CodeQL CLI version ${cliVersion} from toolcache at ${codeqlFolder}`);
|
||||
}
|
||||
else {
|
||||
logger.info(`Using CodeQL CLI from toolcache at ${codeqlFolder}`);
|
||||
}
|
||||
return {
|
||||
codeqlFolder,
|
||||
sourceType: "toolcache",
|
||||
@@ -349,6 +366,12 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian
|
||||
if (!url) {
|
||||
url = await getCodeQLBundleDownloadURL(tagName, apiDetails, logger);
|
||||
}
|
||||
if (cliVersion) {
|
||||
logger.info(`Using CodeQL CLI version ${cliVersion} sourced from ${url}.`);
|
||||
}
|
||||
else {
|
||||
logger.info(`Using CodeQL CLI sourced from ${url}.`);
|
||||
}
|
||||
return {
|
||||
bundleVersion: tagName && tryGetBundleVersionFromTagName(tagName, logger),
|
||||
cliVersion,
|
||||
@@ -373,7 +396,9 @@ async function tryGetFallbackToolcacheVersion(cliVersion, tagName, logger) {
|
||||
return fallbackVersion;
|
||||
}
|
||||
exports.tryGetFallbackToolcacheVersion = tryGetFallbackToolcacheVersion;
|
||||
async function downloadCodeQL(codeqlURL, maybeBundleVersion, maybeCliVersion, apiDetails, variant, tempDir, logger) {
|
||||
// Exported using `export const` for testing purposes. Specifically, we want to
|
||||
// be able to stub this function and have other functions in this file use that stub.
|
||||
const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVersion, apiDetails, variant, tempDir, logger) {
|
||||
const parsedCodeQLURL = new URL(codeqlURL);
|
||||
const searchParams = new URLSearchParams(parsedCodeQLURL.search);
|
||||
const headers = {
|
||||
@@ -436,7 +461,7 @@ async function downloadCodeQL(codeqlURL, maybeBundleVersion, maybeCliVersion, ap
|
||||
codeqlFolder: toolcachedBundlePath,
|
||||
toolsDownloadDurationMs,
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.downloadCodeQL = downloadCodeQL;
|
||||
function getCodeQLURLVersion(url) {
|
||||
const match = url.match(/\/codeql-bundle-(.*)\//);
|
||||
@@ -503,7 +528,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau
|
||||
toolsSource = ToolsSource.Toolcache;
|
||||
break;
|
||||
case "download": {
|
||||
const result = await downloadCodeQL(source.codeqlURL, source.bundleVersion, source.cliVersion, apiDetails, variant, tempDir, logger);
|
||||
const result = await (0, exports.downloadCodeQL)(source.codeqlURL, source.bundleVersion, source.cliVersion, apiDetails, variant, tempDir, logger);
|
||||
toolsVersion = result.toolsVersion;
|
||||
codeqlFolder = result.codeqlFolder;
|
||||
toolsDownloadDurationMs = result.toolsDownloadDurationMs;
|
||||
|
||||
File diff suppressed because one or more lines are too long
70
lib/setup-codeql.test.js
generated
70
lib/setup-codeql.test.js
generated
@@ -84,4 +84,74 @@ ava_1.default.beforeEach(() => {
|
||||
t.is(source["cliVersion"], "1.2.3");
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("getCodeQLSource correctly returns bundled CLI version when tools == linked", async (t) => {
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
const source = await setupCodeql.getCodeQLSource("linked", testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, util_1.GitHubVariant.DOTCOM, (0, logging_1.getRunnerLogger)(true));
|
||||
t.is(source.toolsVersion, testing_utils_1.LINKED_CLI_VERSION.cliVersion);
|
||||
t.is(source.sourceType, "download");
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("getCodeQLSource correctly returns bundled CLI version when tools == latest", async (t) => {
|
||||
const loggedMessages = [];
|
||||
const logger = (0, testing_utils_1.getRecordingLogger)(loggedMessages);
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
const source = await setupCodeql.getCodeQLSource("latest", testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, util_1.GitHubVariant.DOTCOM, logger);
|
||||
// First, ensure that the CLI version is the linked version, so that backwards
|
||||
// compatibility is maintained.
|
||||
t.is(source.toolsVersion, testing_utils_1.LINKED_CLI_VERSION.cliVersion);
|
||||
t.is(source.sourceType, "download");
|
||||
// Afterwards, ensure that we see the deprecation message in the log.
|
||||
const expected_message = "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported for now. No action is required.";
|
||||
t.assert(loggedMessages.some((msg) => typeof msg.message === "string" &&
|
||||
msg.message.includes(expected_message)));
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("setupCodeQLBundle logs the CodeQL CLI version being used when asked to use linked tools", async (t) => {
|
||||
const loggedMessages = [];
|
||||
const logger = (0, testing_utils_1.getRecordingLogger)(loggedMessages);
|
||||
// Stub the downloadCodeQL function to prevent downloading artefacts
|
||||
// during testing from being called.
|
||||
sinon.stub(setupCodeql, "downloadCodeQL").resolves({
|
||||
toolsVersion: testing_utils_1.LINKED_CLI_VERSION.cliVersion,
|
||||
codeqlFolder: "codeql",
|
||||
toolsDownloadDurationMs: 200,
|
||||
});
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
const result = await setupCodeql.setupCodeQLBundle("linked", testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, "tmp/codeql_action_test/", util_1.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, logger);
|
||||
// Basic sanity check that the version we got back is indeed
|
||||
// the linked (default) CLI version.
|
||||
t.is(result.toolsVersion, testing_utils_1.LINKED_CLI_VERSION.cliVersion);
|
||||
// Ensure message logging CodeQL CLI version was present in user logs.
|
||||
const expected_message = `Using CodeQL CLI version ${testing_utils_1.LINKED_CLI_VERSION.cliVersion}`;
|
||||
t.assert(loggedMessages.some((msg) => typeof msg.message === "string" &&
|
||||
msg.message.includes(expected_message)));
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("setupCodeQLBundle logs the CodeQL CLI version being used when asked to download a non-default bundle", async (t) => {
|
||||
const loggedMessages = [];
|
||||
const logger = (0, testing_utils_1.getRecordingLogger)(loggedMessages);
|
||||
const bundleUrl = "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.16.0/codeql-bundle-linux64.tar.gz";
|
||||
const expectedVersion = "2.16.0";
|
||||
// Stub the downloadCodeQL function to prevent downloading artefacts
|
||||
// during testing from being called.
|
||||
sinon.stub(setupCodeql, "downloadCodeQL").resolves({
|
||||
toolsVersion: expectedVersion,
|
||||
codeqlFolder: "codeql",
|
||||
toolsDownloadDurationMs: 200,
|
||||
});
|
||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
const result = await setupCodeql.setupCodeQLBundle(bundleUrl, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, "tmp/codeql_action_test/", util_1.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, logger);
|
||||
// Basic sanity check that the version we got back is indeed the version that the
|
||||
// bundle contains..
|
||||
t.is(result.toolsVersion, expectedVersion);
|
||||
// Ensure message logging CodeQL CLI version was present in user logs.
|
||||
const expected_message = `Using CodeQL CLI version 2.16.0 sourced from ${bundleUrl}.`;
|
||||
t.assert(loggedMessages.some((msg) => typeof msg.message === "string" &&
|
||||
msg.message.includes(expected_message)));
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=setup-codeql.test.js.map
|
||||
File diff suppressed because one or more lines are too long
7
lib/testing-utils.js
generated
7
lib/testing-utils.js
generated
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTestConfig = exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionInfo = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||
exports.createTestConfig = exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionInfo = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.LINKED_CLI_VERSION = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||
const node_util_1 = require("node:util");
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const github = __importStar(require("@actions/github"));
|
||||
@@ -34,6 +34,7 @@ const nock_1 = __importDefault(require("nock"));
|
||||
const sinon = __importStar(require("sinon"));
|
||||
const apiClient = __importStar(require("./api-client"));
|
||||
const codeql = __importStar(require("./codeql"));
|
||||
const defaults = __importStar(require("./defaults.json"));
|
||||
const util_1 = require("./util");
|
||||
exports.SAMPLE_DOTCOM_API_DETAILS = {
|
||||
auth: "token",
|
||||
@@ -44,6 +45,10 @@ exports.SAMPLE_DEFAULT_CLI_VERSION = {
|
||||
cliVersion: "2.20.0",
|
||||
tagName: "codeql-bundle-v2.20.0",
|
||||
};
|
||||
exports.LINKED_CLI_VERSION = {
|
||||
cliVersion: defaults.cliVersion,
|
||||
tagName: defaults.bundleVersion,
|
||||
};
|
||||
function wrapOutput(context) {
|
||||
// Function signature taken from Socket.write.
|
||||
// Note there are two overloads:
|
||||
|
||||
File diff suppressed because one or more lines are too long
9
lib/upload-lib.js
generated
9
lib/upload-lib.js
generated
@@ -111,10 +111,7 @@ function areAllRunsUnique(sarifObjects) {
|
||||
return true;
|
||||
}
|
||||
// Checks whether the deprecation warning for combining SARIF files should be shown.
|
||||
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, features, githubVersion) {
|
||||
if (!(await features.getValue(feature_flags_1.Feature.CombineSarifFilesDeprecationWarning))) {
|
||||
return false;
|
||||
}
|
||||
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) {
|
||||
// Do not show this warning on GHES versions before 3.14.0
|
||||
if (githubVersion.type === util_1.GitHubVariant.GHES &&
|
||||
semver.lt(githubVersion.version, "3.14.0")) {
|
||||
@@ -144,7 +141,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
|
||||
const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload";
|
||||
if (!areAllRunsProducedByCodeQL(sarifObjects)) {
|
||||
logger.debug("Not all SARIF files were produced by CodeQL. Merging files in the action.");
|
||||
if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, features, gitHubVersion)) {
|
||||
if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, gitHubVersion)) {
|
||||
logger.warning(`Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}`);
|
||||
core.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true");
|
||||
}
|
||||
@@ -175,7 +172,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
|
||||
}
|
||||
if (!(await codeQL.supportsFeature(tools_features_1.ToolsFeature.SarifMergeRunsFromEqualCategory))) {
|
||||
logger.warning("The CodeQL CLI does not support merging SARIF files. Merging files in the action.");
|
||||
if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, features, gitHubVersion)) {
|
||||
if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, gitHubVersion)) {
|
||||
logger.warning(`Uploading multiple CodeQL runs with the same category is deprecated ${deprecationWarningMessage} for CodeQL CLI 2.16.6 and earlier. Please update your CodeQL CLI version or update your workflow to set a distinct category for each CodeQL run. ${deprecationMoreInformationMessage}`);
|
||||
core.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true");
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
22
lib/upload-lib.test.js
generated
22
lib/upload-lib.test.js
generated
@@ -29,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const ava_1 = __importDefault(require("ava"));
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const logging_1 = require("./logging");
|
||||
const testing_utils_1 = require("./testing-utils");
|
||||
const uploadLib = __importStar(require("./upload-lib"));
|
||||
@@ -196,46 +195,41 @@ ava_1.default.beforeEach(() => {
|
||||
t.deepEqual(loggedMessages.length, 2);
|
||||
t.deepEqual(loggedMessages[1], "Warning: 'not a valid URI' is not a valid URI in 'instance.runs[0].results[0].locations[0].physicalLocation.artifactLocation.uri'.");
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning when on dotcom with feature flag", async (t) => {
|
||||
t.true(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning without feature flag", async (t) => {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([]), {
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning when on dotcom", async (t) => {
|
||||
t.true(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning when on GHES 3.13", async (t) => {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], {
|
||||
type: util_1.GitHubVariant.GHES,
|
||||
version: "3.13.2",
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning when on GHES 3.14", async (t) => {
|
||||
t.true(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
t.true(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], {
|
||||
type: util_1.GitHubVariant.GHES,
|
||||
version: "3.14.0",
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning with only 1 run", async (t) => {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def")], {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning with distinct categories", async (t) => {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("def", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("def", "def")], {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning with distinct tools", async (t) => {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "abc"), createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "abc"), createMockSarif("abc", "def")], {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
}));
|
||||
});
|
||||
(0, ava_1.default)("shouldShowCombineSarifFilesDeprecationWarning when environment variable is already set", async (t) => {
|
||||
process.env["CODEQL_MERGE_SARIF_DEPRECATION_WARNING"] = "true";
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CombineSarifFilesDeprecationWarning]), {
|
||||
t.false(await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([createMockSarif("abc", "def"), createMockSarif("abc", "def")], {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
}));
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
242
node_modules/.package-lock.json
generated
vendored
242
node_modules/.package-lock.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "2.25.5",
|
||||
"version": "3.25.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
@@ -762,17 +762,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/types": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz",
|
||||
"integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==",
|
||||
"version": "13.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
|
||||
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^22.1.0"
|
||||
"@octokit/openapi-types": "^22.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/types/node_modules/@octokit/openapi-types": {
|
||||
"version": "22.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz",
|
||||
"integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q=="
|
||||
"version": "22.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
|
||||
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg=="
|
||||
},
|
||||
"node_modules/@opentelemetry/api": {
|
||||
"version": "1.4.1",
|
||||
@@ -814,9 +814,9 @@
|
||||
"integrity": "sha512-D3LxMCnkgsb4LO5sDKf6E+yahM2SqpEHmkqMPDSJis5Cy/j2MgWo/g/iq0lECK0mrPWfx3hqKm2ZJlqxwbRJQA=="
|
||||
},
|
||||
"node_modules/@sinonjs/commons": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz",
|
||||
"integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==",
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
|
||||
"integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
@@ -883,12 +883,6 @@
|
||||
"integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/json5": {
|
||||
"version": "0.0.29",
|
||||
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
||||
@@ -896,9 +890,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.11.22",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.22.tgz",
|
||||
"integrity": "sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA=="
|
||||
"version": "20.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
|
||||
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==",
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node-fetch": {
|
||||
"version": "2.6.4",
|
||||
@@ -957,21 +954,19 @@
|
||||
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.8.0.tgz",
|
||||
"integrity": "sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.10.0.tgz",
|
||||
"integrity": "sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.10.0",
|
||||
"@typescript-eslint/scope-manager": "7.8.0",
|
||||
"@typescript-eslint/type-utils": "7.8.0",
|
||||
"@typescript-eslint/utils": "7.8.0",
|
||||
"@typescript-eslint/visitor-keys": "7.8.0",
|
||||
"debug": "^4.3.4",
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/type-utils": "7.10.0",
|
||||
"@typescript-eslint/utils": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.3.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
"semver": "^7.6.0",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -992,15 +987,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.8.0.tgz",
|
||||
"integrity": "sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.10.0.tgz",
|
||||
"integrity": "sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "7.8.0",
|
||||
"@typescript-eslint/types": "7.8.0",
|
||||
"@typescript-eslint/typescript-estree": "7.8.0",
|
||||
"@typescript-eslint/visitor-keys": "7.8.0",
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1020,13 +1015,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz",
|
||||
"integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz",
|
||||
"integrity": "sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.8.0",
|
||||
"@typescript-eslint/visitor-keys": "7.8.0"
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
@@ -1037,13 +1032,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.8.0.tgz",
|
||||
"integrity": "sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.10.0.tgz",
|
||||
"integrity": "sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "7.8.0",
|
||||
"@typescript-eslint/utils": "7.8.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"@typescript-eslint/utils": "7.10.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
@@ -1064,9 +1059,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz",
|
||||
"integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz",
|
||||
"integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
@@ -1077,13 +1072,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz",
|
||||
"integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz",
|
||||
"integrity": "sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.8.0",
|
||||
"@typescript-eslint/visitor-keys": "7.8.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -1129,18 +1124,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.8.0.tgz",
|
||||
"integrity": "sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.10.0.tgz",
|
||||
"integrity": "sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.15",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@typescript-eslint/scope-manager": "7.8.0",
|
||||
"@typescript-eslint/types": "7.8.0",
|
||||
"@typescript-eslint/typescript-estree": "7.8.0",
|
||||
"semver": "^7.6.0"
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
@@ -1154,12 +1146,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz",
|
||||
"integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz",
|
||||
"integrity": "sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.8.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"eslint-visitor-keys": "^3.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2309,9 +2301,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz",
|
||||
"integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
|
||||
"integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
@@ -4173,12 +4165,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
@@ -4255,9 +4241,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/just-extend": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz",
|
||||
"integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz",
|
||||
"integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/language-subtag-registry": {
|
||||
@@ -4356,17 +4342,6 @@
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
|
||||
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
|
||||
},
|
||||
"node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/map-age-cleaner": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
|
||||
@@ -4521,43 +4496,16 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/nise": {
|
||||
"version": "5.1.5",
|
||||
"resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz",
|
||||
"integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nise/-/nise-6.0.0.tgz",
|
||||
"integrity": "sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^2.0.0",
|
||||
"@sinonjs/fake-timers": "^10.0.2",
|
||||
"@sinonjs/text-encoding": "^0.7.1",
|
||||
"just-extend": "^4.0.2",
|
||||
"path-to-regexp": "^1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nise/node_modules/@sinonjs/commons": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz",
|
||||
"integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/nise/node_modules/@sinonjs/fake-timers": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz",
|
||||
"integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz",
|
||||
"integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
"@sinonjs/commons": "^3.0.0",
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"@sinonjs/text-encoding": "^0.7.2",
|
||||
"just-extend": "^6.2.0",
|
||||
"path-to-regexp": "^6.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/nock": {
|
||||
@@ -4958,13 +4906,10 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz",
|
||||
"integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
@@ -5436,12 +5381,9 @@
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
|
||||
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"version": "7.6.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
|
||||
"integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
@@ -5518,17 +5460,17 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/sinon": {
|
||||
"version": "17.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz",
|
||||
"integrity": "sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==",
|
||||
"version": "18.0.0",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.0.tgz",
|
||||
"integrity": "sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^3.0.0",
|
||||
"@sinonjs/commons": "^3.0.1",
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"@sinonjs/samsam": "^8.0.0",
|
||||
"diff": "^5.1.0",
|
||||
"nise": "^5.1.5",
|
||||
"supports-color": "^7.2.0"
|
||||
"diff": "^5.2.0",
|
||||
"nise": "^6.0.0",
|
||||
"supports-color": "^7"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -6086,6 +6028,11 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"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=="
|
||||
},
|
||||
"node_modules/universal-user-agent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
@@ -6332,11 +6279,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
|
||||
2
node_modules/@octokit/types/dist-types/VERSION.d.ts
generated
vendored
2
node_modules/@octokit/types/dist-types/VERSION.d.ts
generated
vendored
@@ -1 +1 @@
|
||||
export declare const VERSION = "13.4.1";
|
||||
export declare const VERSION = "13.5.0";
|
||||
|
||||
12
node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts
generated
vendored
12
node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts
generated
vendored
@@ -739,6 +739,10 @@ export interface Endpoints {
|
||||
* @see https://docs.github.com/rest/emojis/emojis#get-emojis
|
||||
*/
|
||||
"GET /emojis": Operation<"/emojis", "get">;
|
||||
/**
|
||||
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members
|
||||
*/
|
||||
"GET /enterprises/{enterprise}/copilot/usage": Operation<"/enterprises/{enterprise}/copilot/usage", "get">;
|
||||
/**
|
||||
* @see https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise
|
||||
*/
|
||||
@@ -992,6 +996,10 @@ export interface Endpoints {
|
||||
* @see https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization
|
||||
*/
|
||||
"GET /orgs/{org}/copilot/billing/seats": Operation<"/orgs/{org}/copilot/billing/seats", "get">;
|
||||
/**
|
||||
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members
|
||||
*/
|
||||
"GET /orgs/{org}/copilot/usage": Operation<"/orgs/{org}/copilot/usage", "get">;
|
||||
/**
|
||||
* @see https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization
|
||||
*/
|
||||
@@ -1228,6 +1236,10 @@ export interface Endpoints {
|
||||
* @see https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization
|
||||
*/
|
||||
"GET /orgs/{org}/settings/billing/shared-storage": Operation<"/orgs/{org}/settings/billing/shared-storage", "get">;
|
||||
/**
|
||||
* @see https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team
|
||||
*/
|
||||
"GET /orgs/{org}/team/{team_slug}/copilot/usage": Operation<"/orgs/{org}/team/{team_slug}/copilot/usage", "get">;
|
||||
/**
|
||||
* @see https://docs.github.com/rest/teams/teams#list-teams
|
||||
*/
|
||||
|
||||
4
node_modules/@octokit/types/node_modules/@octokit/openapi-types/package.json
generated
vendored
4
node_modules/@octokit/types/node_modules/@octokit/openapi-types/package.json
generated
vendored
@@ -10,12 +10,12 @@
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"version": "22.1.0",
|
||||
"version": "22.2.0",
|
||||
"main": "",
|
||||
"types": "types.d.ts",
|
||||
"author": "Gregor Martynus (https://twitter.com/gr2m)",
|
||||
"license": "MIT",
|
||||
"octokit": {
|
||||
"openapi-version": "16.2.0"
|
||||
"openapi-version": "16.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
15947
node_modules/@octokit/types/node_modules/@octokit/openapi-types/types.d.ts
generated
vendored
15947
node_modules/@octokit/types/node_modules/@octokit/openapi-types/types.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
8
node_modules/@octokit/types/package.json
generated
vendored
8
node_modules/@octokit/types/package.json
generated
vendored
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@octokit/types",
|
||||
"version": "13.4.1",
|
||||
"version": "13.5.0",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"description": "Shared TypeScript definitions for Octokit projects",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^22.1.0"
|
||||
"@octokit/openapi-types": "^22.2.0"
|
||||
},
|
||||
"repository": "github:octokit/types.ts",
|
||||
"keywords": [
|
||||
@@ -24,7 +24,7 @@
|
||||
"@types/node": ">= 8",
|
||||
"github-openapi-graphql-query": "^4.0.0",
|
||||
"handlebars": "^4.7.6",
|
||||
"json-schema-to-typescript": "^13.0.0",
|
||||
"json-schema-to-typescript": "^14.0.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"npm-run-all2": "^6.0.0",
|
||||
"pascal-case": "^4.0.0",
|
||||
@@ -37,7 +37,7 @@
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"octokit": {
|
||||
"openapi-version": "16.2.0"
|
||||
"openapi-version": "16.5.0"
|
||||
},
|
||||
"files": [
|
||||
"dist-types/**"
|
||||
|
||||
2
node_modules/@sinonjs/commons/lib/called-in-order.js
generated
vendored
2
node_modules/@sinonjs/commons/lib/called-in-order.js
generated
vendored
@@ -33,7 +33,6 @@ function checkAdjacentCalls(callMap, spy, index, spies) {
|
||||
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} calledBefore - A method that determines if this proxy was called before another one
|
||||
* @property {string} id - Some id
|
||||
@@ -42,7 +41,6 @@ function checkAdjacentCalls(callMap, spy, index, spies) {
|
||||
|
||||
/**
|
||||
* Returns true when the spies have been called in the order they were supplied in
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
|
||||
* @returns {boolean} true when spies are called in order, false otherwise
|
||||
*/
|
||||
|
||||
18
node_modules/@sinonjs/commons/lib/class-name.js
generated
vendored
18
node_modules/@sinonjs/commons/lib/class-name.js
generated
vendored
@@ -1,27 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
var functionName = require("./function-name");
|
||||
|
||||
/**
|
||||
* Returns a display name for a value from a constructor
|
||||
*
|
||||
* @param {object} value A value to examine
|
||||
* @returns {(string|null)} A string or null
|
||||
*/
|
||||
function className(value) {
|
||||
return (
|
||||
(value.constructor && value.constructor.name) ||
|
||||
// The next branch is for IE11 support only:
|
||||
// Because the name property is not set on the prototype
|
||||
// of the Function object, we finally try to grab the
|
||||
// name from its definition. This will never be reached
|
||||
// in node, so we are not able to test this properly.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
|
||||
(typeof value.constructor === "function" &&
|
||||
/* istanbul ignore next */
|
||||
functionName(value.constructor)) ||
|
||||
null
|
||||
);
|
||||
const name = value.constructor && value.constructor.name;
|
||||
return name || null;
|
||||
}
|
||||
|
||||
module.exports = className;
|
||||
|
||||
3
node_modules/@sinonjs/commons/lib/deprecated.js
generated
vendored
3
node_modules/@sinonjs/commons/lib/deprecated.js
generated
vendored
@@ -4,7 +4,6 @@
|
||||
/**
|
||||
* Returns a function that will invoke the supplied function and print a
|
||||
* deprecation warning to the console each time it is called.
|
||||
*
|
||||
* @param {Function} func
|
||||
* @param {string} msg
|
||||
* @returns {Function}
|
||||
@@ -23,7 +22,6 @@ exports.wrap = function (func, msg) {
|
||||
/**
|
||||
* Returns a string which can be supplied to `wrap()` to notify the user that a
|
||||
* particular part of the sinon API has been deprecated.
|
||||
*
|
||||
* @param {string} packageName
|
||||
* @param {string} funcName
|
||||
* @returns {string}
|
||||
@@ -34,7 +32,6 @@ exports.defaultMsg = function (packageName, funcName) {
|
||||
|
||||
/**
|
||||
* Prints a warning on the console, when it exists
|
||||
*
|
||||
* @param {string} msg
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
1
node_modules/@sinonjs/commons/lib/every.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/every.js
generated
vendored
@@ -3,7 +3,6 @@
|
||||
/**
|
||||
* Returns true when fn returns true for all members of obj.
|
||||
* This is an every implementation that works for all iterables
|
||||
*
|
||||
* @param {object} obj
|
||||
* @param {Function} fn
|
||||
* @returns {boolean}
|
||||
|
||||
1
node_modules/@sinonjs/commons/lib/function-name.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/function-name.js
generated
vendored
@@ -2,7 +2,6 @@
|
||||
|
||||
/**
|
||||
* Returns a display name for a function
|
||||
*
|
||||
* @param {Function} func
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
1
node_modules/@sinonjs/commons/lib/global.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/global.js
generated
vendored
@@ -2,7 +2,6 @@
|
||||
|
||||
/**
|
||||
* A reference to the global object
|
||||
*
|
||||
* @type {object} globalObject
|
||||
*/
|
||||
var globalObject;
|
||||
|
||||
2
node_modules/@sinonjs/commons/lib/order-by-first-call.js
generated
vendored
2
node_modules/@sinonjs/commons/lib/order-by-first-call.js
generated
vendored
@@ -18,14 +18,12 @@ function comparator(a, b) {
|
||||
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} getCall - A method that can return the first call
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies
|
||||
* @returns {SinonProxy[]}
|
||||
*/
|
||||
|
||||
2
node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
generated
vendored
2
node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
generated
vendored
@@ -3,11 +3,9 @@
|
||||
/**
|
||||
* Is true when the environment causes an error to be thrown for accessing the
|
||||
* __proto__ property.
|
||||
*
|
||||
* This is necessary in order to support `node --disable-proto=throw`.
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
let throwsOnProto;
|
||||
|
||||
1
node_modules/@sinonjs/commons/lib/type-of.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/type-of.js
generated
vendored
@@ -4,7 +4,6 @@ var type = require("type-detect");
|
||||
|
||||
/**
|
||||
* Returns the lower-case result of running type from type-detect on the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
1
node_modules/@sinonjs/commons/lib/value-to-string.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/value-to-string.js
generated
vendored
@@ -2,7 +2,6 @@
|
||||
|
||||
/**
|
||||
* Returns a string representation of the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
2
node_modules/@sinonjs/commons/package.json
generated
vendored
2
node_modules/@sinonjs/commons/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sinonjs/commons",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "Simple functions shared among the sinon end user libraries",
|
||||
"main": "lib/index.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
||||
2
node_modules/@sinonjs/commons/types/called-in-order.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/called-in-order.d.ts
generated
vendored
@@ -1,7 +1,6 @@
|
||||
export = calledInOrder;
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} calledBefore - A method that determines if this proxy was called before another one
|
||||
* @property {string} id - Some id
|
||||
@@ -9,7 +8,6 @@ export = calledInOrder;
|
||||
*/
|
||||
/**
|
||||
* Returns true when the spies have been called in the order they were supplied in
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
|
||||
* @returns {boolean} true when spies are called in order, false otherwise
|
||||
*/
|
||||
|
||||
1
node_modules/@sinonjs/commons/types/class-name.d.ts
generated
vendored
1
node_modules/@sinonjs/commons/types/class-name.d.ts
generated
vendored
@@ -1,7 +1,6 @@
|
||||
export = className;
|
||||
/**
|
||||
* Returns a display name for a value from a constructor
|
||||
*
|
||||
* @param {object} value A value to examine
|
||||
* @returns {(string|null)} A string or null
|
||||
*/
|
||||
|
||||
1
node_modules/@sinonjs/commons/types/global.d.ts
generated
vendored
1
node_modules/@sinonjs/commons/types/global.d.ts
generated
vendored
@@ -1,7 +1,6 @@
|
||||
export = globalObject;
|
||||
/**
|
||||
* A reference to the global object
|
||||
*
|
||||
* @type {object} globalObject
|
||||
*/
|
||||
declare var globalObject: object;
|
||||
|
||||
2
node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
generated
vendored
@@ -1,13 +1,11 @@
|
||||
export = orderByFirstCall;
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} getCall - A method that can return the first call
|
||||
*/
|
||||
/**
|
||||
* Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies
|
||||
* @returns {SinonProxy[]}
|
||||
*/
|
||||
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
generated
vendored
@@ -2,11 +2,9 @@ export = throwsOnProto;
|
||||
/**
|
||||
* Is true when the environment causes an error to be thrown for accessing the
|
||||
* __proto__ property.
|
||||
*
|
||||
* This is necessary in order to support `node --disable-proto=throw`.
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
declare let throwsOnProto: boolean;
|
||||
|
||||
1
node_modules/@sinonjs/commons/types/value-to-string.d.ts
generated
vendored
1
node_modules/@sinonjs/commons/types/value-to-string.d.ts
generated
vendored
@@ -1,7 +1,6 @@
|
||||
export = valueToString;
|
||||
/**
|
||||
* Returns a string representation of the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
21
node_modules/@types/json-schema/LICENSE
generated
vendored
21
node_modules/@types/json-schema/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
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
|
||||
15
node_modules/@types/json-schema/README.md
generated
vendored
15
node_modules/@types/json-schema/README.md
generated
vendored
@@ -1,15 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/json-schema`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for json-schema (https://github.com/kriszyp/json-schema).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 03:09:37 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Boris Cherny](https://github.com/bcherny), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK).
|
||||
749
node_modules/@types/json-schema/index.d.ts
generated
vendored
749
node_modules/@types/json-schema/index.d.ts
generated
vendored
@@ -1,749 +0,0 @@
|
||||
// ==================================================================================================
|
||||
// JSON Schema Draft 04
|
||||
// ==================================================================================================
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
|
||||
*/
|
||||
export type JSONSchema4TypeName =
|
||||
| "string" //
|
||||
| "number"
|
||||
| "integer"
|
||||
| "boolean"
|
||||
| "object"
|
||||
| "array"
|
||||
| "null"
|
||||
| "any";
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
|
||||
*/
|
||||
export type JSONSchema4Type =
|
||||
| string //
|
||||
| number
|
||||
| boolean
|
||||
| JSONSchema4Object
|
||||
| JSONSchema4Array
|
||||
| null;
|
||||
|
||||
// Workaround for infinite type recursion
|
||||
export interface JSONSchema4Object {
|
||||
[key: string]: JSONSchema4Type;
|
||||
}
|
||||
|
||||
// Workaround for infinite type recursion
|
||||
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
||||
export interface JSONSchema4Array extends Array<JSONSchema4Type> {}
|
||||
|
||||
/**
|
||||
* Meta schema
|
||||
*
|
||||
* Recommended values:
|
||||
* - 'http://json-schema.org/schema#'
|
||||
* - 'http://json-schema.org/hyper-schema#'
|
||||
* - 'http://json-schema.org/draft-04/schema#'
|
||||
* - 'http://json-schema.org/draft-04/hyper-schema#'
|
||||
* - 'http://json-schema.org/draft-03/schema#'
|
||||
* - 'http://json-schema.org/draft-03/hyper-schema#'
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
||||
*/
|
||||
export type JSONSchema4Version = string;
|
||||
|
||||
/**
|
||||
* JSON Schema V4
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
|
||||
*/
|
||||
export interface JSONSchema4 {
|
||||
id?: string | undefined;
|
||||
$ref?: string | undefined;
|
||||
$schema?: JSONSchema4Version | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a short description of the
|
||||
* instance property.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
|
||||
*/
|
||||
title?: string | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a full description of the of
|
||||
* purpose the instance property.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
|
||||
*/
|
||||
description?: string | undefined;
|
||||
|
||||
default?: JSONSchema4Type | undefined;
|
||||
multipleOf?: number | undefined;
|
||||
maximum?: number | undefined;
|
||||
exclusiveMaximum?: boolean | undefined;
|
||||
minimum?: number | undefined;
|
||||
exclusiveMinimum?: boolean | undefined;
|
||||
maxLength?: number | undefined;
|
||||
minLength?: number | undefined;
|
||||
pattern?: string | undefined;
|
||||
|
||||
/**
|
||||
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
|
||||
*
|
||||
* This provides a definition for additional items in an array instance
|
||||
* when tuple definitions of the items is provided. This can be false
|
||||
* to indicate additional items in the array are not allowed, or it can
|
||||
* be a schema that defines the schema of the additional items.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
|
||||
*/
|
||||
additionalItems?: boolean | JSONSchema4 | undefined;
|
||||
|
||||
/**
|
||||
* This attribute defines the allowed items in an instance array, and
|
||||
* MUST be a schema or an array of schemas. The default value is an
|
||||
* empty schema which allows any value for items in the instance array.
|
||||
*
|
||||
* When this attribute value is a schema and the instance value is an
|
||||
* array, then all the items in the array MUST be valid according to the
|
||||
* schema.
|
||||
*
|
||||
* When this attribute value is an array of schemas and the instance
|
||||
* value is an array, each position in the instance array MUST conform
|
||||
* to the schema in the corresponding position for this array. This
|
||||
* called tuple typing. When tuple typing is used, additional items are
|
||||
* allowed, disallowed, or constrained by the "additionalItems"
|
||||
* (Section 5.6) attribute using the same rules as
|
||||
* "additionalProperties" (Section 5.4) for objects.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
|
||||
*/
|
||||
items?: JSONSchema4 | JSONSchema4[] | undefined;
|
||||
|
||||
maxItems?: number | undefined;
|
||||
minItems?: number | undefined;
|
||||
uniqueItems?: boolean | undefined;
|
||||
maxProperties?: number | undefined;
|
||||
minProperties?: number | undefined;
|
||||
|
||||
/**
|
||||
* This attribute indicates if the instance must have a value, and not
|
||||
* be undefined. This is false by default, making the instance
|
||||
* optional.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
|
||||
*/
|
||||
required?: boolean | string[] | undefined;
|
||||
|
||||
/**
|
||||
* This attribute defines a schema for all properties that are not
|
||||
* explicitly defined in an object type definition. If specified, the
|
||||
* value MUST be a schema or a boolean. If false is provided, no
|
||||
* additional properties are allowed beyond the properties defined in
|
||||
* the schema. The default value is an empty schema which allows any
|
||||
* value for additional properties.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
|
||||
*/
|
||||
additionalProperties?: boolean | JSONSchema4 | undefined;
|
||||
|
||||
definitions?: {
|
||||
[k: string]: JSONSchema4;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is an object with property definitions that define the
|
||||
* valid values of instance object property values. When the instance
|
||||
* value is an object, the property values of the instance object MUST
|
||||
* conform to the property definitions in this object. In this object,
|
||||
* each property definition's value MUST be a schema, and the property's
|
||||
* name MUST be the name of the instance property that it defines. The
|
||||
* instance property value MUST be valid according to the schema from
|
||||
* the property definition. Properties are considered unordered, the
|
||||
* order of the instance properties MAY be in any order.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
|
||||
*/
|
||||
properties?: {
|
||||
[k: string]: JSONSchema4;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is an object that defines the schema for a set of
|
||||
* property names of an object instance. The name of each property of
|
||||
* this attribute's object is a regular expression pattern in the ECMA
|
||||
* 262/Perl 5 format, while the value is a schema. If the pattern
|
||||
* matches the name of a property on the instance object, the value of
|
||||
* the instance's property MUST be valid against the pattern name's
|
||||
* schema value.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
|
||||
*/
|
||||
patternProperties?: {
|
||||
[k: string]: JSONSchema4;
|
||||
} | undefined;
|
||||
dependencies?: {
|
||||
[k: string]: JSONSchema4 | string[];
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* This provides an enumeration of all possible values that are valid
|
||||
* for the instance property. This MUST be an array, and each item in
|
||||
* the array represents a possible value for the instance value. If
|
||||
* this attribute is defined, the instance value MUST be one of the
|
||||
* values in the array in order for the schema to be valid.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
||||
*/
|
||||
enum?: JSONSchema4Type[] | undefined;
|
||||
|
||||
/**
|
||||
* A single type, or a union of simple types
|
||||
*/
|
||||
type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
|
||||
|
||||
allOf?: JSONSchema4[] | undefined;
|
||||
anyOf?: JSONSchema4[] | undefined;
|
||||
oneOf?: JSONSchema4[] | undefined;
|
||||
not?: JSONSchema4 | undefined;
|
||||
|
||||
/**
|
||||
* The value of this property MUST be another schema which will provide
|
||||
* a base schema which the current schema will inherit from. The
|
||||
* inheritance rules are such that any instance that is valid according
|
||||
* to the current schema MUST be valid according to the referenced
|
||||
* schema. This MAY also be an array, in which case, the instance MUST
|
||||
* be valid for all the schemas in the array. A schema that extends
|
||||
* another schema MAY define additional attributes, constrain existing
|
||||
* attributes, or add other constraints.
|
||||
*
|
||||
* Conceptually, the behavior of extends can be seen as validating an
|
||||
* instance against all constraints in the extending schema as well as
|
||||
* the extended schema(s).
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
|
||||
*/
|
||||
extends?: string | string[] | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
|
||||
*/
|
||||
[k: string]: any;
|
||||
|
||||
format?: string | undefined;
|
||||
}
|
||||
|
||||
// ==================================================================================================
|
||||
// JSON Schema Draft 06
|
||||
// ==================================================================================================
|
||||
|
||||
export type JSONSchema6TypeName =
|
||||
| "string" //
|
||||
| "number"
|
||||
| "integer"
|
||||
| "boolean"
|
||||
| "object"
|
||||
| "array"
|
||||
| "null"
|
||||
| "any";
|
||||
|
||||
export type JSONSchema6Type =
|
||||
| string //
|
||||
| number
|
||||
| boolean
|
||||
| JSONSchema6Object
|
||||
| JSONSchema6Array
|
||||
| null;
|
||||
|
||||
// Workaround for infinite type recursion
|
||||
export interface JSONSchema6Object {
|
||||
[key: string]: JSONSchema6Type;
|
||||
}
|
||||
|
||||
// Workaround for infinite type recursion
|
||||
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
||||
export interface JSONSchema6Array extends Array<JSONSchema6Type> {}
|
||||
|
||||
/**
|
||||
* Meta schema
|
||||
*
|
||||
* Recommended values:
|
||||
* - 'http://json-schema.org/schema#'
|
||||
* - 'http://json-schema.org/hyper-schema#'
|
||||
* - 'http://json-schema.org/draft-06/schema#'
|
||||
* - 'http://json-schema.org/draft-06/hyper-schema#'
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
||||
*/
|
||||
export type JSONSchema6Version = string;
|
||||
|
||||
/**
|
||||
* JSON Schema V6
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01
|
||||
*/
|
||||
export type JSONSchema6Definition = JSONSchema6 | boolean;
|
||||
export interface JSONSchema6 {
|
||||
$id?: string | undefined;
|
||||
$ref?: string | undefined;
|
||||
$schema?: JSONSchema6Version | undefined;
|
||||
|
||||
/**
|
||||
* Must be strictly greater than 0.
|
||||
* A numeric instance is valid only if division by this keyword's value results in an integer.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
|
||||
*/
|
||||
multipleOf?: number | undefined;
|
||||
|
||||
/**
|
||||
* Representing an inclusive upper limit for a numeric instance.
|
||||
* This keyword validates only if the instance is less than or exactly equal to "maximum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
|
||||
*/
|
||||
maximum?: number | undefined;
|
||||
|
||||
/**
|
||||
* Representing an exclusive upper limit for a numeric instance.
|
||||
* This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
|
||||
*/
|
||||
exclusiveMaximum?: number | undefined;
|
||||
|
||||
/**
|
||||
* Representing an inclusive lower limit for a numeric instance.
|
||||
* This keyword validates only if the instance is greater than or exactly equal to "minimum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
|
||||
*/
|
||||
minimum?: number | undefined;
|
||||
|
||||
/**
|
||||
* Representing an exclusive lower limit for a numeric instance.
|
||||
* This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
|
||||
*/
|
||||
exclusiveMinimum?: number | undefined;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
|
||||
*/
|
||||
maxLength?: number | undefined;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
|
||||
* Omitting this keyword has the same behavior as a value of 0.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
|
||||
*/
|
||||
minLength?: number | undefined;
|
||||
|
||||
/**
|
||||
* Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
|
||||
*/
|
||||
pattern?: string | undefined;
|
||||
|
||||
/**
|
||||
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
|
||||
* Omitting this keyword has the same behavior as an empty schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
|
||||
*/
|
||||
items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined;
|
||||
|
||||
/**
|
||||
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
|
||||
* If "items" is an array of schemas, validation succeeds if every instance element
|
||||
* at a position greater than the size of "items" validates against "additionalItems".
|
||||
* Otherwise, "additionalItems" MUST be ignored, as the "items" schema
|
||||
* (possibly the default value of an empty schema) is applied to all elements.
|
||||
* Omitting this keyword has the same behavior as an empty schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
|
||||
*/
|
||||
additionalItems?: JSONSchema6Definition | undefined;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
|
||||
*/
|
||||
maxItems?: number | undefined;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword.
|
||||
* Omitting this keyword has the same behavior as a value of 0.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
|
||||
*/
|
||||
minItems?: number | undefined;
|
||||
|
||||
/**
|
||||
* If this keyword has boolean value false, the instance validates successfully.
|
||||
* If it has boolean value true, the instance validates successfully if all of its elements are unique.
|
||||
* Omitting this keyword has the same behavior as a value of false.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
|
||||
*/
|
||||
uniqueItems?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
|
||||
*/
|
||||
contains?: JSONSchema6Definition | undefined;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
|
||||
*/
|
||||
maxProperties?: number | undefined;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* An object instance is valid against "maxProperties" if its number of properties is greater than,
|
||||
* or equal to, the value of this keyword.
|
||||
* Omitting this keyword has the same behavior as a value of 0.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
|
||||
*/
|
||||
minProperties?: number | undefined;
|
||||
|
||||
/**
|
||||
* Elements of this array must be unique.
|
||||
* An object instance is valid against this keyword if every item in the array is the name of a property in the instance.
|
||||
* Omitting this keyword has the same behavior as an empty array.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
|
||||
*/
|
||||
required?: string[] | undefined;
|
||||
|
||||
/**
|
||||
* This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
|
||||
* Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value,
|
||||
* the child instance for that name successfully validates against the corresponding schema.
|
||||
* Omitting this keyword has the same behavior as an empty object.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18
|
||||
*/
|
||||
properties?: {
|
||||
[k: string]: JSONSchema6Definition;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is an object that defines the schema for a set of property names of an object instance.
|
||||
* The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema.
|
||||
* If the pattern matches the name of a property on the instance object, the value of the instance's property
|
||||
* MUST be valid against the pattern name's schema value.
|
||||
* Omitting this keyword has the same behavior as an empty object.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19
|
||||
*/
|
||||
patternProperties?: {
|
||||
[k: string]: JSONSchema6Definition;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
|
||||
* If specified, the value MUST be a schema or a boolean.
|
||||
* If false is provided, no additional properties are allowed beyond the properties defined in the schema.
|
||||
* The default value is an empty schema which allows any value for additional properties.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
|
||||
*/
|
||||
additionalProperties?: JSONSchema6Definition | undefined;
|
||||
|
||||
/**
|
||||
* This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
|
||||
* Each property specifies a dependency.
|
||||
* If the dependency value is an array, each element in the array must be unique.
|
||||
* Omitting this keyword has the same behavior as an empty object.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21
|
||||
*/
|
||||
dependencies?: {
|
||||
[k: string]: JSONSchema6Definition | string[];
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* Takes a schema which validates the names of all properties rather than their values.
|
||||
* Note the property name that the schema is testing will always be a string.
|
||||
* Omitting this keyword has the same behavior as an empty schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
|
||||
*/
|
||||
propertyNames?: JSONSchema6Definition | undefined;
|
||||
|
||||
/**
|
||||
* This provides an enumeration of all possible values that are valid
|
||||
* for the instance property. This MUST be an array, and each item in
|
||||
* the array represents a possible value for the instance value. If
|
||||
* this attribute is defined, the instance value MUST be one of the
|
||||
* values in the array in order for the schema to be valid.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
|
||||
*/
|
||||
enum?: JSONSchema6Type[] | undefined;
|
||||
|
||||
/**
|
||||
* More readable form of a one-element "enum"
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
|
||||
*/
|
||||
const?: JSONSchema6Type | undefined;
|
||||
|
||||
/**
|
||||
* A single type, or a union of simple types
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
|
||||
*/
|
||||
type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
|
||||
*/
|
||||
allOf?: JSONSchema6Definition[] | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
|
||||
*/
|
||||
anyOf?: JSONSchema6Definition[] | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
|
||||
*/
|
||||
oneOf?: JSONSchema6Definition[] | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
|
||||
*/
|
||||
not?: JSONSchema6Definition | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
|
||||
*/
|
||||
definitions?: {
|
||||
[k: string]: JSONSchema6Definition;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a short description of the instance property.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
|
||||
*/
|
||||
title?: string | undefined;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a full description of the of purpose the instance property.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
|
||||
*/
|
||||
description?: string | undefined;
|
||||
|
||||
/**
|
||||
* This keyword can be used to supply a default JSON value associated with a particular schema.
|
||||
* It is RECOMMENDED that a default value be valid against the associated schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
|
||||
*/
|
||||
default?: JSONSchema6Type | undefined;
|
||||
|
||||
/**
|
||||
* Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
|
||||
*/
|
||||
examples?: JSONSchema6Type[] | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
|
||||
*/
|
||||
format?: string | undefined;
|
||||
}
|
||||
|
||||
// ==================================================================================================
|
||||
// JSON Schema Draft 07
|
||||
// ==================================================================================================
|
||||
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Primitive type
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
||||
*/
|
||||
export type JSONSchema7TypeName =
|
||||
| "string" //
|
||||
| "number"
|
||||
| "integer"
|
||||
| "boolean"
|
||||
| "object"
|
||||
| "array"
|
||||
| "null";
|
||||
|
||||
/**
|
||||
* Primitive type
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
||||
*/
|
||||
export type JSONSchema7Type =
|
||||
| string //
|
||||
| number
|
||||
| boolean
|
||||
| JSONSchema7Object
|
||||
| JSONSchema7Array
|
||||
| null;
|
||||
|
||||
// Workaround for infinite type recursion
|
||||
export interface JSONSchema7Object {
|
||||
[key: string]: JSONSchema7Type;
|
||||
}
|
||||
|
||||
// Workaround for infinite type recursion
|
||||
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
||||
export interface JSONSchema7Array extends Array<JSONSchema7Type> {}
|
||||
|
||||
/**
|
||||
* Meta schema
|
||||
*
|
||||
* Recommended values:
|
||||
* - 'http://json-schema.org/schema#'
|
||||
* - 'http://json-schema.org/hyper-schema#'
|
||||
* - 'http://json-schema.org/draft-07/schema#'
|
||||
* - 'http://json-schema.org/draft-07/hyper-schema#'
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
||||
*/
|
||||
export type JSONSchema7Version = string;
|
||||
|
||||
/**
|
||||
* JSON Schema v7
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
||||
*/
|
||||
export type JSONSchema7Definition = JSONSchema7 | boolean;
|
||||
export interface JSONSchema7 {
|
||||
$id?: string | undefined;
|
||||
$ref?: string | undefined;
|
||||
$schema?: JSONSchema7Version | undefined;
|
||||
$comment?: string | undefined;
|
||||
|
||||
/**
|
||||
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
||||
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
||||
*/
|
||||
$defs?: {
|
||||
[key: string]: JSONSchema7Definition;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
||||
*/
|
||||
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
||||
enum?: JSONSchema7Type[] | undefined;
|
||||
const?: JSONSchema7Type | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
||||
*/
|
||||
multipleOf?: number | undefined;
|
||||
maximum?: number | undefined;
|
||||
exclusiveMaximum?: number | undefined;
|
||||
minimum?: number | undefined;
|
||||
exclusiveMinimum?: number | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
||||
*/
|
||||
maxLength?: number | undefined;
|
||||
minLength?: number | undefined;
|
||||
pattern?: string | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
||||
*/
|
||||
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
|
||||
additionalItems?: JSONSchema7Definition | undefined;
|
||||
maxItems?: number | undefined;
|
||||
minItems?: number | undefined;
|
||||
uniqueItems?: boolean | undefined;
|
||||
contains?: JSONSchema7Definition | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
||||
*/
|
||||
maxProperties?: number | undefined;
|
||||
minProperties?: number | undefined;
|
||||
required?: string[] | undefined;
|
||||
properties?: {
|
||||
[key: string]: JSONSchema7Definition;
|
||||
} | undefined;
|
||||
patternProperties?: {
|
||||
[key: string]: JSONSchema7Definition;
|
||||
} | undefined;
|
||||
additionalProperties?: JSONSchema7Definition | undefined;
|
||||
dependencies?: {
|
||||
[key: string]: JSONSchema7Definition | string[];
|
||||
} | undefined;
|
||||
propertyNames?: JSONSchema7Definition | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
||||
*/
|
||||
if?: JSONSchema7Definition | undefined;
|
||||
then?: JSONSchema7Definition | undefined;
|
||||
else?: JSONSchema7Definition | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
||||
*/
|
||||
allOf?: JSONSchema7Definition[] | undefined;
|
||||
anyOf?: JSONSchema7Definition[] | undefined;
|
||||
oneOf?: JSONSchema7Definition[] | undefined;
|
||||
not?: JSONSchema7Definition | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
||||
*/
|
||||
format?: string | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
||||
*/
|
||||
contentMediaType?: string | undefined;
|
||||
contentEncoding?: string | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
||||
*/
|
||||
definitions?: {
|
||||
[key: string]: JSONSchema7Definition;
|
||||
} | undefined;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
||||
*/
|
||||
title?: string | undefined;
|
||||
description?: string | undefined;
|
||||
default?: JSONSchema7Type | undefined;
|
||||
readOnly?: boolean | undefined;
|
||||
writeOnly?: boolean | undefined;
|
||||
examples?: JSONSchema7Type | undefined;
|
||||
}
|
||||
|
||||
export interface ValidationResult {
|
||||
valid: boolean;
|
||||
errors: ValidationError[];
|
||||
}
|
||||
|
||||
export interface ValidationError {
|
||||
property: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* To use the validator call JSONSchema.validate with an instance object and an optional schema object.
|
||||
* If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
|
||||
* that schema will be used to validate and the schema parameter is not necessary (if both exist,
|
||||
* both validations will occur).
|
||||
*/
|
||||
export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult;
|
||||
|
||||
/**
|
||||
* The checkPropertyChange method will check to see if an value can legally be in property with the given schema
|
||||
* This is slightly different than the validate method in that it will fail if the schema is readonly and it will
|
||||
* not check for self-validation, it is assumed that the passed in value is already internally valid.
|
||||
*/
|
||||
export function checkPropertyChange(
|
||||
value: any,
|
||||
schema: JSONSchema4 | JSONSchema6 | JSONSchema7,
|
||||
property: string,
|
||||
): ValidationResult;
|
||||
|
||||
/**
|
||||
* This checks to ensure that the result is valid and will throw an appropriate error message if it is not.
|
||||
*/
|
||||
export function mustBeValid(result: ValidationResult): void;
|
||||
40
node_modules/@types/json-schema/package.json
generated
vendored
40
node_modules/@types/json-schema/package.json
generated
vendored
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "@types/json-schema",
|
||||
"version": "7.0.15",
|
||||
"description": "TypeScript definitions for json-schema",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Boris Cherny",
|
||||
"githubUsername": "bcherny",
|
||||
"url": "https://github.com/bcherny"
|
||||
},
|
||||
{
|
||||
"name": "Lucian Buzzo",
|
||||
"githubUsername": "lucianbuzzo",
|
||||
"url": "https://github.com/lucianbuzzo"
|
||||
},
|
||||
{
|
||||
"name": "Roland Groza",
|
||||
"githubUsername": "rolandjitsu",
|
||||
"url": "https://github.com/rolandjitsu"
|
||||
},
|
||||
{
|
||||
"name": "Jason Kwok",
|
||||
"githubUsername": "JasonHK",
|
||||
"url": "https://github.com/JasonHK"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/json-schema"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "79984fd70cd25c3f7d72b84368778c763c89728ea0073832d745d4691b705257",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
0
node_modules/@types/node/LICENSE
generated
vendored
Executable file → Normal file
0
node_modules/@types/node/LICENSE
generated
vendored
Executable file → Normal file
11
node_modules/@types/node/README.md
generated
vendored
Executable file → Normal file
11
node_modules/@types/node/README.md
generated
vendored
Executable file → Normal file
@@ -2,15 +2,14 @@
|
||||
> `npm install --save @types/node`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Node.js (https://nodejs.org/).
|
||||
This package contains type definitions for node (https://nodejs.org/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 01 Feb 2022 08:31:30 GMT
|
||||
* Dependencies: none
|
||||
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
||||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [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), [Seth Westphal](https://github.com/westy92), [Simon Schick](https://github.com/SimonSchick), [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), and [wafuwafu13](https://github.com/wafuwafu13).
|
||||
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).
|
||||
|
||||
282
node_modules/@types/node/assert.d.ts
generated
vendored
Executable file → Normal file
282
node_modules/@types/node/assert.d.ts
generated
vendored
Executable file → Normal file
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* The `assert` module provides a set of assertion functions for verifying
|
||||
* The `node:assert` module provides a set of assertion functions for verifying
|
||||
* invariants.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js)
|
||||
*/
|
||||
declare module 'assert' {
|
||||
declare module "assert" {
|
||||
/**
|
||||
* An alias of {@link ok}.
|
||||
* @since v0.5.9
|
||||
@@ -12,15 +12,29 @@ 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 `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 {
|
||||
/**
|
||||
* 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;
|
||||
code: 'ERR_ASSERTION';
|
||||
/**
|
||||
* 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;
|
||||
@@ -36,9 +50,10 @@ declare module 'assert' {
|
||||
});
|
||||
}
|
||||
/**
|
||||
* This feature is currently experimental and behavior might still change.
|
||||
* 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
|
||||
* @experimental
|
||||
* @deprecated Deprecated
|
||||
*/
|
||||
class CallTracker {
|
||||
/**
|
||||
@@ -47,7 +62,7 @@ declare module 'assert' {
|
||||
* error.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* // Creates call tracker.
|
||||
* const tracker = new assert.CallTracker();
|
||||
@@ -65,26 +80,44 @@ declare module 'assert' {
|
||||
*/
|
||||
calls(exact?: number): () => void;
|
||||
calls<Func extends (...args: any[]) => 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 'assert';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* // Creates call tracker.
|
||||
* const tracker = new assert.CallTracker();
|
||||
*
|
||||
* function func() {}
|
||||
*
|
||||
* function foo() {}
|
||||
*
|
||||
* // 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()
|
||||
* tracker.report();
|
||||
* console.log(tracker.report());
|
||||
* // [
|
||||
* // {
|
||||
* // message: 'Expected the func function to be executed 2 time(s) but was
|
||||
@@ -97,15 +130,39 @@ declare module 'assert' {
|
||||
* // ]
|
||||
* ```
|
||||
* @since v14.2.0, v12.19.0
|
||||
* @return of objects containing information about the wrapper functions returned by `calls`.
|
||||
* @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 'assert';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* // Creates call tracker.
|
||||
* const tracker = new assert.CallTracker();
|
||||
@@ -125,6 +182,10 @@ declare module 'assert' {
|
||||
*/
|
||||
verify(): void;
|
||||
}
|
||||
interface CallTrackerCall {
|
||||
thisArg: object;
|
||||
arguments: unknown[];
|
||||
}
|
||||
interface CallTrackerReportInformation {
|
||||
message: string;
|
||||
/** The actual number of times the function was called. */
|
||||
@@ -136,14 +197,14 @@ declare module 'assert' {
|
||||
/** A stack trace of the function. */
|
||||
stack: object;
|
||||
}
|
||||
type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
|
||||
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 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.fail();
|
||||
* // AssertionError [ERR_ASSERTION]: Failed
|
||||
@@ -168,7 +229,7 @@ declare module 'assert' {
|
||||
message?: string | Error,
|
||||
operator?: string,
|
||||
// tslint:disable-next-line:ban-types
|
||||
stackStartFn?: Function
|
||||
stackStartFn?: Function,
|
||||
): never;
|
||||
/**
|
||||
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
|
||||
@@ -181,7 +242,7 @@ declare module 'assert' {
|
||||
* thrown in a file! See below for further details.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.ok(true);
|
||||
* // OK
|
||||
@@ -216,7 +277,7 @@ declare module 'assert' {
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* // Using `assert()` works the same:
|
||||
* assert(0);
|
||||
@@ -237,11 +298,11 @@ declare module 'assert' {
|
||||
* > Stability: 3 - Legacy: Use {@link strictEqual} instead.
|
||||
*
|
||||
* Tests shallow, coercive equality between the `actual` and `expected` parameters
|
||||
* using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled
|
||||
* and treated as being identical in case both sides are `NaN`.
|
||||
* 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 'assert';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* assert.equal(1, 1);
|
||||
* // OK, 1 == 1
|
||||
@@ -270,12 +331,11 @@ declare module 'assert' {
|
||||
*
|
||||
* > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
|
||||
*
|
||||
* Tests shallow, coercive inequality with the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison)(`!=` ). `NaN` is special handled and treated as
|
||||
* being identical in case both
|
||||
* sides are `NaN`.
|
||||
* 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 'assert';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* assert.notEqual(1, 2);
|
||||
* // OK
|
||||
@@ -322,24 +382,24 @@ declare module 'assert' {
|
||||
* Tests for any deep inequality. Opposite of {@link deepEqual}.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* const obj1 = {
|
||||
* a: {
|
||||
* b: 1
|
||||
* }
|
||||
* b: 1,
|
||||
* },
|
||||
* };
|
||||
* const obj2 = {
|
||||
* a: {
|
||||
* b: 2
|
||||
* }
|
||||
* b: 2,
|
||||
* },
|
||||
* };
|
||||
* const obj3 = {
|
||||
* a: {
|
||||
* b: 1
|
||||
* }
|
||||
* b: 1,
|
||||
* },
|
||||
* };
|
||||
* const obj4 = Object.create(obj1);
|
||||
* const obj4 = { __proto__: obj1 };
|
||||
*
|
||||
* assert.notDeepEqual(obj1, obj1);
|
||||
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
||||
@@ -362,10 +422,10 @@ declare module 'assert' {
|
||||
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
||||
/**
|
||||
* Tests strict equality between the `actual` and `expected` parameters as
|
||||
* determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
|
||||
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.strictEqual(1, 2);
|
||||
* // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
|
||||
@@ -400,10 +460,10 @@ declare module 'assert' {
|
||||
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
||||
/**
|
||||
* Tests strict inequality between the `actual` and `expected` parameters as
|
||||
* determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
|
||||
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.notStrictEqual(1, 2);
|
||||
* // OK
|
||||
@@ -434,7 +494,7 @@ declare module 'assert' {
|
||||
* Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
|
||||
* // OK
|
||||
@@ -465,14 +525,14 @@ declare module 'assert' {
|
||||
* Custom validation object/error instance:
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* const err = new TypeError('Wrong value');
|
||||
* err.code = 404;
|
||||
* err.foo = 'bar';
|
||||
* err.info = {
|
||||
* nested: true,
|
||||
* baz: 'text'
|
||||
* baz: 'text',
|
||||
* };
|
||||
* err.reg = /abc/i;
|
||||
*
|
||||
@@ -485,16 +545,16 @@ declare module 'assert' {
|
||||
* message: 'Wrong value',
|
||||
* info: {
|
||||
* nested: true,
|
||||
* baz: 'text'
|
||||
* }
|
||||
* 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:
|
||||
* throws(
|
||||
* assert.throws(
|
||||
* () => {
|
||||
* throw err;
|
||||
* },
|
||||
@@ -508,17 +568,17 @@ declare module 'assert' {
|
||||
* info: {
|
||||
* nested: true,
|
||||
* // It is not possible to use regular expressions for nested properties!
|
||||
* baz: 'text'
|
||||
* 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
|
||||
* }
|
||||
* reg: /abc/i,
|
||||
* },
|
||||
* );
|
||||
*
|
||||
* // Fails due to the different `message` and `name` properties:
|
||||
* throws(
|
||||
* assert.throws(
|
||||
* () => {
|
||||
* const otherErr = new Error('Not found');
|
||||
* // Copy all enumerable properties from `err` to `otherErr`.
|
||||
@@ -529,20 +589,20 @@ declare module 'assert' {
|
||||
* },
|
||||
* // The error's `message` and `name` properties will also be checked when using
|
||||
* // an error as validation object.
|
||||
* err
|
||||
* err,
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* Validate instanceof using constructor:
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.throws(
|
||||
* () => {
|
||||
* throw new Error('Wrong value');
|
||||
* },
|
||||
* Error
|
||||
* Error,
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
@@ -552,13 +612,13 @@ declare module 'assert' {
|
||||
* therefore also include the error name.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.throws(
|
||||
* () => {
|
||||
* throw new Error('Wrong value');
|
||||
* },
|
||||
* /^Error: Wrong value$/
|
||||
* /^Error: Wrong value$/,
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
@@ -568,7 +628,7 @@ declare module 'assert' {
|
||||
* It will otherwise fail with an `AssertionError`.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.throws(
|
||||
* () => {
|
||||
@@ -584,7 +644,7 @@ declare module 'assert' {
|
||||
* // possible.
|
||||
* return true;
|
||||
* },
|
||||
* 'unexpected error'
|
||||
* 'unexpected error',
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
@@ -594,7 +654,7 @@ declare module 'assert' {
|
||||
* a string as the second argument gets considered:
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* function throwingFirst() {
|
||||
* throw new Error('First');
|
||||
@@ -650,20 +710,20 @@ declare module 'assert' {
|
||||
* 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
|
||||
* [`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 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.doesNotThrow(
|
||||
* () => {
|
||||
* throw new TypeError('Wrong value');
|
||||
* },
|
||||
* SyntaxError
|
||||
* SyntaxError,
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
@@ -671,27 +731,27 @@ declare module 'assert' {
|
||||
* 'Got unwanted exception...':
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.doesNotThrow(
|
||||
* () => {
|
||||
* throw new TypeError('Wrong value');
|
||||
* },
|
||||
* TypeError
|
||||
* 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 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.doesNotThrow(
|
||||
* () => {
|
||||
* throw new TypeError('Wrong value');
|
||||
* },
|
||||
* /Wrong value/,
|
||||
* 'Whoops'
|
||||
* 'Whoops',
|
||||
* );
|
||||
* // Throws: AssertionError: Got unwanted exception: Whoops
|
||||
* ```
|
||||
@@ -705,7 +765,7 @@ declare module 'assert' {
|
||||
* from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.ifError(null);
|
||||
* // OK
|
||||
@@ -751,7 +811,7 @@ declare module 'assert' {
|
||||
* If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* await assert.rejects(
|
||||
* async () => {
|
||||
@@ -759,13 +819,13 @@ declare module 'assert' {
|
||||
* },
|
||||
* {
|
||||
* name: 'TypeError',
|
||||
* message: 'Wrong value'
|
||||
* }
|
||||
* message: 'Wrong value',
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* await assert.rejects(
|
||||
* async () => {
|
||||
@@ -775,16 +835,16 @@ declare module 'assert' {
|
||||
* assert.strictEqual(err.name, 'TypeError');
|
||||
* assert.strictEqual(err.message, 'Wrong value');
|
||||
* return true;
|
||||
* }
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.rejects(
|
||||
* Promise.reject(new Error('Wrong value')),
|
||||
* Error
|
||||
* Error,
|
||||
* ).then(() => {
|
||||
* // ...
|
||||
* });
|
||||
@@ -797,7 +857,11 @@ declare module 'assert' {
|
||||
* @since v10.0.0
|
||||
*/
|
||||
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
||||
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||
function rejects(
|
||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
||||
error: AssertPredicate,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
|
||||
* calls the function and awaits the returned promise to complete. It will then
|
||||
@@ -814,24 +878,24 @@ declare module 'assert' {
|
||||
* 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
|
||||
* [`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 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* await assert.doesNotReject(
|
||||
* async () => {
|
||||
* throw new TypeError('Wrong value');
|
||||
* },
|
||||
* SyntaxError
|
||||
* SyntaxError,
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
|
||||
* .then(() => {
|
||||
@@ -840,13 +904,20 @@ declare module 'assert' {
|
||||
* ```
|
||||
* @since v10.0.0
|
||||
*/
|
||||
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(
|
||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
function doesNotReject(
|
||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
||||
error: AssertPredicate,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Expects the `string` input to match the regular expression.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.match('I will fail', /pass/);
|
||||
* // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
|
||||
@@ -869,7 +940,7 @@ declare module 'assert' {
|
||||
* Expects the `string` input not to match the regular expression.
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'assert/strict';
|
||||
* import assert from 'node:assert/strict';
|
||||
*
|
||||
* assert.doesNotMatch('I will fail', /fail/);
|
||||
* // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
|
||||
@@ -888,25 +959,38 @@ declare module 'assert' {
|
||||
* @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;
|
||||
};
|
||||
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');
|
||||
declare module "node:assert" {
|
||||
import assert = require("assert");
|
||||
export = assert;
|
||||
}
|
||||
|
||||
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Executable file → Normal file
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Executable file → Normal file
@@ -1,8 +1,8 @@
|
||||
declare module 'assert/strict' {
|
||||
import { strict } from 'node:assert';
|
||||
declare module "assert/strict" {
|
||||
import { strict } from "node:assert";
|
||||
export = strict;
|
||||
}
|
||||
declare module 'node:assert/strict' {
|
||||
import { strict } from 'node:assert';
|
||||
declare module "node:assert/strict" {
|
||||
import { strict } from "node:assert";
|
||||
export = strict;
|
||||
}
|
||||
|
||||
128
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Executable file → Normal file
128
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Executable file → Normal file
@@ -1,19 +1,27 @@
|
||||
/**
|
||||
* The `async_hooks` module provides an API to track asynchronous resources. It
|
||||
* can be accessed using:
|
||||
* 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 'async_hooks';
|
||||
* import async_hooks from 'node:async_hooks';
|
||||
* ```
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/async_hooks.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
|
||||
*/
|
||||
declare module 'async_hooks' {
|
||||
declare module "async_hooks" {
|
||||
/**
|
||||
* ```js
|
||||
* import { executionAsyncId } from 'async_hooks';
|
||||
* 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()
|
||||
* });
|
||||
@@ -51,8 +59,8 @@ declare module 'async_hooks' {
|
||||
* but having an object representing the top-level can be helpful.
|
||||
*
|
||||
* ```js
|
||||
* import { open } from 'fs';
|
||||
* import { executionAsyncId, executionAsyncResource } from 'async_hooks';
|
||||
* 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) => {
|
||||
@@ -64,11 +72,11 @@ declare module 'async_hooks' {
|
||||
* use of a tracking `Map` to store the metadata:
|
||||
*
|
||||
* ```js
|
||||
* import { createServer } from 'http';
|
||||
* import { createServer } from 'node:http';
|
||||
* import {
|
||||
* executionAsyncId,
|
||||
* executionAsyncResource,
|
||||
* createHook
|
||||
* createHook,
|
||||
* } from 'async_hooks';
|
||||
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
||||
*
|
||||
@@ -78,7 +86,7 @@ declare module 'async_hooks' {
|
||||
* if (cr) {
|
||||
* resource[sym] = cr[sym];
|
||||
* }
|
||||
* }
|
||||
* },
|
||||
* }).enable();
|
||||
*
|
||||
* const server = createServer((req, res) => {
|
||||
@@ -167,11 +175,11 @@ declare module 'async_hooks' {
|
||||
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
||||
*
|
||||
* ```js
|
||||
* import { createHook } from 'async_hooks';
|
||||
* import { createHook } from 'node:async_hooks';
|
||||
*
|
||||
* const asyncHook = createHook({
|
||||
* init(asyncId, type, triggerAsyncId, resource) { },
|
||||
* destroy(asyncId) { }
|
||||
* destroy(asyncId) { },
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
@@ -223,13 +231,13 @@ declare module 'async_hooks' {
|
||||
* The following is an overview of the `AsyncResource` API.
|
||||
*
|
||||
* ```js
|
||||
* import { AsyncResource, executionAsyncId } from 'async_hooks';
|
||||
* 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 }
|
||||
* type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },
|
||||
* );
|
||||
*
|
||||
* // Run a function in the execution context of the resource. This will
|
||||
@@ -258,14 +266,11 @@ declare module 'async_hooks' {
|
||||
* @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 9.3)
|
||||
* AsyncResourceOptions object (since v9.3.0)
|
||||
*/
|
||||
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
||||
/**
|
||||
* Binds the given function to the current execution context.
|
||||
*
|
||||
* The returned function will have an `asyncResource` property referencing
|
||||
* the `AsyncResource` to which the function is bound.
|
||||
* @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`.
|
||||
@@ -273,23 +278,14 @@ declare module 'async_hooks' {
|
||||
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
||||
fn: Func,
|
||||
type?: string,
|
||||
thisArg?: ThisArg
|
||||
): Func & {
|
||||
asyncResource: AsyncResource;
|
||||
};
|
||||
thisArg?: ThisArg,
|
||||
): Func;
|
||||
/**
|
||||
* Binds the given function to execute to this `AsyncResource`'s scope.
|
||||
*
|
||||
* The returned function will have an `asyncResource` property referencing
|
||||
* the `AsyncResource` to which the function is bound.
|
||||
* @since v14.8.0, v12.19.0
|
||||
* @param fn The function to bind to the current `AsyncResource`.
|
||||
*/
|
||||
bind<Func extends (...args: any[]) => any>(
|
||||
fn: Func
|
||||
): Func & {
|
||||
asyncResource: AsyncResource;
|
||||
};
|
||||
bind<Func extends (...args: any[]) => 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
|
||||
@@ -300,7 +296,11 @@ declare module 'async_hooks' {
|
||||
* @param thisArg The receiver to be used for the function call.
|
||||
* @param args Optional arguments to pass to the function.
|
||||
*/
|
||||
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
||||
runInAsyncScope<This, Result>(
|
||||
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
|
||||
@@ -314,7 +314,6 @@ declare module 'async_hooks' {
|
||||
*/
|
||||
asyncId(): number;
|
||||
/**
|
||||
*
|
||||
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
||||
*/
|
||||
triggerAsyncId(): number;
|
||||
@@ -322,17 +321,17 @@ 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 `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.
|
||||
* 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 'http';
|
||||
* import { AsyncLocalStorage } from 'async_hooks';
|
||||
* import http from 'node:http';
|
||||
* import { AsyncLocalStorage } from 'node:async_hooks';
|
||||
*
|
||||
* const asyncLocalStorage = new AsyncLocalStorage();
|
||||
*
|
||||
@@ -364,10 +363,48 @@ declare module 'async_hooks' {
|
||||
*
|
||||
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
|
||||
* Multiple instances can safely exist simultaneously without risk of interfering
|
||||
* with each other data.
|
||||
* with each other's data.
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
class AsyncLocalStorage<T> {
|
||||
/**
|
||||
* 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<Func extends (...args: any[]) => 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(): <R, TArgs extends any[]>(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.
|
||||
@@ -395,8 +432,9 @@ declare module 'async_hooks' {
|
||||
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 or
|
||||
* the asynchronous operations created within the callback.
|
||||
* 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.
|
||||
*
|
||||
@@ -410,6 +448,9 @@ declare module 'async_hooks' {
|
||||
* try {
|
||||
* asyncLocalStorage.run(store, () => {
|
||||
* asyncLocalStorage.getStore(); // Returns the store object
|
||||
* setTimeout(() => {
|
||||
* asyncLocalStorage.getStore(); // Returns the store object
|
||||
* }, 200);
|
||||
* throw new Error();
|
||||
* });
|
||||
* } catch (e) {
|
||||
@@ -419,6 +460,7 @@ declare module 'async_hooks' {
|
||||
* ```
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
run<R>(store: T, callback: () => R): R;
|
||||
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
|
||||
/**
|
||||
* Runs a function synchronously outside of a context and returns its
|
||||
@@ -492,6 +534,6 @@ declare module 'async_hooks' {
|
||||
enterWith(store: T): void;
|
||||
}
|
||||
}
|
||||
declare module 'node:async_hooks' {
|
||||
export * from 'async_hooks';
|
||||
declare module "node:async_hooks" {
|
||||
export * from "async_hooks";
|
||||
}
|
||||
|
||||
486
node_modules/@types/node/buffer.d.ts
generated
vendored
Executable file → Normal file
486
node_modules/@types/node/buffer.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
530
node_modules/@types/node/child_process.d.ts
generated
vendored
Executable file → Normal file
530
node_modules/@types/node/child_process.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
252
node_modules/@types/node/cluster.d.ts
generated
vendored
Executable file → Normal file
252
node_modules/@types/node/cluster.d.ts
generated
vendored
Executable file → Normal file
@@ -1,18 +1,19 @@
|
||||
/**
|
||||
* A single instance of Node.js runs in a single thread. To take advantage of
|
||||
* multi-core systems, the user will sometimes want to launch a cluster of Node.js
|
||||
* processes to handle the load.
|
||||
* 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 'cluster';
|
||||
* import http from 'http';
|
||||
* import { cpus } from 'os';
|
||||
* import process from 'process';
|
||||
* import cluster from 'node:cluster';
|
||||
* import http from 'node:http';
|
||||
* import { availableParallelism } from 'node:os';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* const numCPUs = cpus().length;
|
||||
* const numCPUs = availableParallelism();
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log(`Primary ${process.pid} is running`);
|
||||
@@ -49,12 +50,13 @@
|
||||
* ```
|
||||
*
|
||||
* 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/v16.9.0/lib/cluster.js)
|
||||
* @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';
|
||||
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;
|
||||
@@ -64,11 +66,14 @@ declare module 'cluster' {
|
||||
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"
|
||||
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
||||
}
|
||||
/**
|
||||
* A `Worker` object contains all public information and method about a worker.
|
||||
@@ -99,9 +104,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()`.
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
@@ -120,22 +125,25 @@ declare module 'cluster' {
|
||||
* @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;
|
||||
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, it does this
|
||||
* by disconnecting the `worker.process`, and once disconnected, killing
|
||||
* with `signal`. In the worker, it does it by disconnecting the channel,
|
||||
* and then exiting with code `0`.
|
||||
* 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`.
|
||||
*
|
||||
* Because `kill()` attempts to gracefully disconnect the worker process, it is
|
||||
* susceptible to waiting indefinitely for the disconnect to complete. For example,
|
||||
* if the worker enters an infinite loop, a graceful disconnect will never occur.
|
||||
* If the graceful disconnect behavior is not needed, use `worker.process.kill()`.
|
||||
* The `kill()` function kills the worker process without waiting for a graceful
|
||||
* disconnect, it has the same behavior as `worker.process.kill()`.
|
||||
*
|
||||
* Causes `.exitedAfterDisconnect` to be set.
|
||||
*
|
||||
* This method is aliased as `worker.destroy()` for backward compatibility.
|
||||
* 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()`.
|
||||
@@ -188,7 +196,7 @@ declare module 'cluster' {
|
||||
* });
|
||||
*
|
||||
* } else if (cluster.isWorker) {
|
||||
* const net = require('net');
|
||||
* const net = require('node:net');
|
||||
* const server = net.createServer((socket) => {
|
||||
* // Connections never end
|
||||
* });
|
||||
@@ -218,12 +226,12 @@ declare module 'cluster' {
|
||||
* because of exiting or being signaled). Otherwise, it returns `false`.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'cluster';
|
||||
* import http from 'http';
|
||||
* import { cpus } from 'os';
|
||||
* import process from 'process';
|
||||
* import cluster from 'node:cluster';
|
||||
* import http from 'node:http';
|
||||
* import { availableParallelism } from 'node:os';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* const numCPUs = cpus().length;
|
||||
* const numCPUs = availableParallelism();
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log(`Primary ${process.pid} is running`);
|
||||
@@ -253,7 +261,8 @@ declare module 'cluster' {
|
||||
*/
|
||||
isDead(): boolean;
|
||||
/**
|
||||
* This property is `true` if the worker exited due to `.kill()` or`.disconnect()`. If the worker exited any other way, it is `false`. If the
|
||||
* 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
|
||||
@@ -283,47 +292,47 @@ declare module 'cluster' {
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -355,60 +364,69 @@ declare module 'cluster' {
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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';
|
||||
declare module "node:cluster" {
|
||||
export * from "cluster";
|
||||
export { default as default } from "cluster";
|
||||
}
|
||||
|
||||
41
node_modules/@types/node/console.d.ts
generated
vendored
Executable file → Normal file
41
node_modules/@types/node/console.d.ts
generated
vendored
Executable file → Normal file
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* The `console` module provides a simple debugging console that is similar to the
|
||||
* JavaScript console mechanism provided by web browsers.
|
||||
* 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('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` 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
|
||||
@@ -53,14 +53,14 @@
|
||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to err
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/console.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js)
|
||||
*/
|
||||
declare module 'console' {
|
||||
import console = require('node:console');
|
||||
declare module "console" {
|
||||
import console = require("node:console");
|
||||
export = console;
|
||||
}
|
||||
declare module 'node:console' {
|
||||
import { InspectOptions } from 'node:util';
|
||||
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 {
|
||||
@@ -123,7 +123,7 @@ declare module 'node:console' {
|
||||
* >
|
||||
* ```
|
||||
* @since v8.3.0
|
||||
* @param label The display label for the counter.
|
||||
* @param [label='default'] The display label for the counter.
|
||||
*/
|
||||
count(label?: string): void;
|
||||
/**
|
||||
@@ -141,7 +141,7 @@ declare module 'node:console' {
|
||||
* >
|
||||
* ```
|
||||
* @since v8.3.0
|
||||
* @param label The display label for the counter.
|
||||
* @param [label='default'] The display label for the counter.
|
||||
*/
|
||||
countReset(label?: string): void;
|
||||
/**
|
||||
@@ -221,7 +221,7 @@ declare module 'node:console' {
|
||||
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.
|
||||
* logging the argument if it can't be parsed as tabular.
|
||||
*
|
||||
* ```js
|
||||
* // These can't be parsed as tabular data
|
||||
@@ -257,6 +257,7 @@ declare module 'node:console' {
|
||||
* 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;
|
||||
/**
|
||||
@@ -264,12 +265,13 @@ declare module 'node:console' {
|
||||
* prints the result to `stdout`:
|
||||
*
|
||||
* ```js
|
||||
* console.time('100-elements');
|
||||
* for (let i = 0; i < 100; i++) {}
|
||||
* console.timeEnd('100-elements');
|
||||
* // prints 100-elements: 225.438ms
|
||||
* 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;
|
||||
/**
|
||||
@@ -285,6 +287,7 @@ declare module 'node:console' {
|
||||
* console.timeEnd('process');
|
||||
* ```
|
||||
* @since v10.7.0
|
||||
* @param [label='default']
|
||||
*/
|
||||
timeLog(label?: string, ...data: any[]): void;
|
||||
/**
|
||||
@@ -392,7 +395,7 @@ declare module 'node:console' {
|
||||
stdout: NodeJS.WritableStream;
|
||||
stderr?: NodeJS.WritableStream | undefined;
|
||||
ignoreErrors?: boolean | undefined;
|
||||
colorMode?: boolean | 'auto' | undefined;
|
||||
colorMode?: boolean | "auto" | undefined;
|
||||
inspectOptions?: InspectOptions | undefined;
|
||||
/**
|
||||
* Set group indentation
|
||||
@@ -402,8 +405,8 @@ declare module 'node:console' {
|
||||
}
|
||||
interface ConsoleConstructor {
|
||||
prototype: Console;
|
||||
new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
||||
new (options: ConsoleConstructorOptions): Console;
|
||||
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
||||
new(options: ConsoleConstructorOptions): Console;
|
||||
}
|
||||
}
|
||||
var console: Console;
|
||||
|
||||
23
node_modules/@types/node/constants.d.ts
generated
vendored
Executable file → Normal file
23
node_modules/@types/node/constants.d.ts
generated
vendored
Executable file → Normal file
@@ -1,18 +1,19 @@
|
||||
/** @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';
|
||||
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;
|
||||
const exp:
|
||||
& typeof osConstants.errno
|
||||
& typeof osConstants.priority
|
||||
& SignalConstants
|
||||
& typeof cryptoConstants
|
||||
& typeof fsConstants;
|
||||
export = exp;
|
||||
}
|
||||
|
||||
declare module 'node:constants' {
|
||||
import constants = require('constants');
|
||||
declare module "node:constants" {
|
||||
import constants = require("constants");
|
||||
export = constants;
|
||||
}
|
||||
|
||||
2119
node_modules/@types/node/crypto.d.ts
generated
vendored
Executable file → Normal file
2119
node_modules/@types/node/crypto.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
165
node_modules/@types/node/dgram.d.ts
generated
vendored
Executable file → Normal file
165
node_modules/@types/node/dgram.d.ts
generated
vendored
Executable file → Normal file
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* The `dgram` module provides an implementation of UDP datagram sockets.
|
||||
* The `node:dgram` module provides an implementation of UDP datagram sockets.
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'dgram';
|
||||
* import dgram from 'node:dgram';
|
||||
*
|
||||
* const server = dgram.createSocket('udp4');
|
||||
*
|
||||
* server.on('error', (err) => {
|
||||
* console.log(`server error:\n${err.stack}`);
|
||||
* console.error(`server error:\n${err.stack}`);
|
||||
* server.close();
|
||||
* });
|
||||
*
|
||||
@@ -23,15 +23,15 @@
|
||||
* server.bind(41234);
|
||||
* // Prints: server listening 0.0.0.0:41234
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dgram.js)
|
||||
* @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 { EventEmitter, Abortable } from 'node:events';
|
||||
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';
|
||||
family: "IPv4" | "IPv6";
|
||||
port: number;
|
||||
size: number;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ declare module 'dgram' {
|
||||
exclusive?: boolean | undefined;
|
||||
fd?: number | undefined;
|
||||
}
|
||||
type SocketType = 'udp4' | 'udp6';
|
||||
type SocketType = "udp4" | "udp6";
|
||||
interface SocketOptions extends Abortable {
|
||||
type: SocketType;
|
||||
reuseAddr?: boolean | undefined;
|
||||
@@ -51,7 +51,13 @@ declare module 'dgram' {
|
||||
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;
|
||||
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
|
||||
@@ -98,8 +104,8 @@ declare module 'dgram' {
|
||||
* 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 'cluster';
|
||||
* import dgram from 'dgram';
|
||||
* import cluster from 'node:cluster';
|
||||
* import dgram from 'node:dgram';
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* cluster.fork(); // Works ok.
|
||||
@@ -116,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
|
||||
@@ -142,12 +148,12 @@ declare module 'dgram' {
|
||||
* Example of a UDP server listening on port 41234:
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'dgram';
|
||||
* import dgram from 'node:dgram';
|
||||
*
|
||||
* const server = dgram.createSocket('udp4');
|
||||
*
|
||||
* server.on('error', (err) => {
|
||||
* console.log(`server error:\n${err.stack}`);
|
||||
* console.error(`server error:\n${err.stack}`);
|
||||
* server.close();
|
||||
* });
|
||||
*
|
||||
@@ -260,7 +266,7 @@ declare module 'dgram' {
|
||||
*
|
||||
* 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 falsy, `'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
|
||||
@@ -284,8 +290,8 @@ declare module 'dgram' {
|
||||
* Example of sending a UDP packet to a port on `localhost`;
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'dgram';
|
||||
* import { Buffer } from 'buffer';
|
||||
* import dgram from 'node:dgram';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const message = Buffer.from('Some bytes');
|
||||
* const client = dgram.createSocket('udp4');
|
||||
@@ -297,8 +303,8 @@ declare module 'dgram' {
|
||||
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'dgram';
|
||||
* import { Buffer } from 'buffer';
|
||||
* import dgram from 'node:dgram';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf1 = Buffer.from('Some ');
|
||||
* const buf2 = Buffer.from('bytes');
|
||||
@@ -316,8 +322,8 @@ declare module 'dgram' {
|
||||
* Example of sending a UDP packet using a socket connected to a port on`localhost`:
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'dgram';
|
||||
* import { Buffer } from 'buffer';
|
||||
* import dgram from 'node:dgram';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const message = Buffer.from('Some bytes');
|
||||
* const client = dgram.createSocket('udp4');
|
||||
@@ -335,12 +341,42 @@ declare module 'dgram' {
|
||||
* @param address Destination host name or IP address.
|
||||
* @param callback Called when the message has been sent.
|
||||
*/
|
||||
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | ReadonlyArray<any>, 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;
|
||||
send(
|
||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
||||
port?: number,
|
||||
address?: string,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
||||
port?: number,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
||||
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.
|
||||
@@ -451,7 +487,7 @@ declare module 'dgram' {
|
||||
* 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 between 1 and 255\. The default on most systems
|
||||
* 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.
|
||||
@@ -503,43 +539,48 @@ declare module 'dgram' {
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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<void>;
|
||||
}
|
||||
}
|
||||
declare module 'node:dgram' {
|
||||
export * from 'dgram';
|
||||
declare module "node:dgram" {
|
||||
export * from "dgram";
|
||||
}
|
||||
|
||||
95
node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
Executable file → Normal file
95
node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
Executable file → Normal file
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* The `diagnostics_channel` module provides an API to create named channels
|
||||
* 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 'diagnostics_channel';
|
||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
||||
* ```
|
||||
*
|
||||
* It is intended that a module writer wanting to report diagnostics messages
|
||||
@@ -19,10 +19,10 @@
|
||||
* 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.
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/diagnostics_channel.js)
|
||||
* @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' {
|
||||
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.
|
||||
@@ -31,7 +31,7 @@ declare module 'diagnostics_channel' {
|
||||
* performance-sensitive code.
|
||||
*
|
||||
* ```js
|
||||
* import diagnostics_channel from 'diagnostics_channel';
|
||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
||||
*
|
||||
* if (diagnostics_channel.hasSubscribers('my-channel')) {
|
||||
* // There are subscribers, prepare and publish message
|
||||
@@ -41,14 +41,14 @@ declare module 'diagnostics_channel' {
|
||||
* @param name The channel name
|
||||
* @return If there are active subscribers
|
||||
*/
|
||||
function hasSubscribers(name: string): boolean;
|
||||
function hasSubscribers(name: string | symbol): boolean;
|
||||
/**
|
||||
* This is the primary entry-point for anyone wanting to interact with a named
|
||||
* 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 'diagnostics_channel';
|
||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
||||
*
|
||||
* const channel = diagnostics_channel.channel('my-channel');
|
||||
* ```
|
||||
@@ -56,11 +56,48 @@ declare module 'diagnostics_channel' {
|
||||
* @param name The channel name
|
||||
* @return The named channel object
|
||||
*/
|
||||
function channel(name: string): Channel;
|
||||
type ChannelListener = (name: string, message: unknown) => void;
|
||||
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 use to track subscribers and to publish messages when there
|
||||
* 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
|
||||
@@ -68,7 +105,7 @@ declare module 'diagnostics_channel' {
|
||||
* @since v15.1.0, v14.17.0
|
||||
*/
|
||||
class Channel {
|
||||
readonly name: string;
|
||||
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.
|
||||
@@ -77,7 +114,7 @@ declare module 'diagnostics_channel' {
|
||||
* performance-sensitive code.
|
||||
*
|
||||
* ```js
|
||||
* import diagnostics_channel from 'diagnostics_channel';
|
||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
||||
*
|
||||
* const channel = diagnostics_channel.channel('my-channel');
|
||||
*
|
||||
@@ -88,14 +125,31 @@ declare module 'diagnostics_channel' {
|
||||
* @since v15.1.0, v14.17.0
|
||||
*/
|
||||
readonly hasSubscribers: boolean;
|
||||
private constructor(name: string);
|
||||
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 'diagnostics_channel';
|
||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
||||
*
|
||||
* const channel = diagnostics_channel.channel('my-channel');
|
||||
*
|
||||
@@ -104,6 +158,7 @@ declare module 'diagnostics_channel' {
|
||||
* });
|
||||
* ```
|
||||
* @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;
|
||||
@@ -111,7 +166,7 @@ declare module 'diagnostics_channel' {
|
||||
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
||||
*
|
||||
* ```js
|
||||
* import diagnostics_channel from 'diagnostics_channel';
|
||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
||||
*
|
||||
* const channel = diagnostics_channel.channel('my-channel');
|
||||
*
|
||||
@@ -124,11 +179,13 @@ declare module 'diagnostics_channel' {
|
||||
* 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';
|
||||
declare module "node:diagnostics_channel" {
|
||||
export * from "diagnostics_channel";
|
||||
}
|
||||
|
||||
327
node_modules/@types/node/dns.d.ts
generated
vendored
Executable file → Normal file
327
node_modules/@types/node/dns.d.ts
generated
vendored
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The `dns` module enables name resolution. For example, use it to look up IP
|
||||
* 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
|
||||
@@ -9,7 +9,7 @@
|
||||
* system do, use {@link lookup}.
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('dns');
|
||||
* const dns = require('node:dns');
|
||||
*
|
||||
* dns.lookup('example.org', (err, address, family) => {
|
||||
* console.log('address: %j family: IPv%s', address, family);
|
||||
@@ -17,13 +17,13 @@
|
||||
* // address: "93.184.216.34" family: IPv4
|
||||
* ```
|
||||
*
|
||||
* All other functions in the `dns` module connect to an actual DNS server to
|
||||
* 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('dns');
|
||||
* const dns = require('node:dns');
|
||||
*
|
||||
* dns.resolve4('archive.org', (err, addresses) => {
|
||||
* if (err) throw err;
|
||||
@@ -42,10 +42,10 @@
|
||||
* ```
|
||||
*
|
||||
* See the `Implementation considerations section` for more information.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dns.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js)
|
||||
*/
|
||||
declare module 'dns' {
|
||||
import * as dnsPromises from 'node:dns/promises';
|
||||
declare module "dns" {
|
||||
import * as dnsPromises from "node:dns/promises";
|
||||
// Supported getaddrinfo flags.
|
||||
export const ADDRCONFIG: number;
|
||||
export const V4MAPPED: number;
|
||||
@@ -58,6 +58,9 @@ declare module 'dns' {
|
||||
family?: number | undefined;
|
||||
hints?: number | undefined;
|
||||
all?: boolean | undefined;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
verbatim?: boolean | undefined;
|
||||
}
|
||||
export interface LookupOneOptions extends LookupOptions {
|
||||
@@ -73,8 +76,8 @@ declare module 'dns' {
|
||||
/**
|
||||
* 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.
|
||||
* 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`.
|
||||
@@ -86,14 +89,14 @@ declare module 'dns' {
|
||||
*
|
||||
* `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
|
||||
* 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('dns');
|
||||
* const dns = require('node:dns');
|
||||
* const options = {
|
||||
* family: 6,
|
||||
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
||||
@@ -112,11 +115,30 @@ declare module 'dns' {
|
||||
* 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 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<LookupAddress[]>;
|
||||
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
|
||||
@@ -132,7 +154,7 @@ declare module 'dns' {
|
||||
* On an error, `err` is an `Error` object, where `err.code` is the error code.
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('dns');
|
||||
* const dns = require('node:dns');
|
||||
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
||||
* console.log(hostname, service);
|
||||
* // Prints: localhost ssh
|
||||
@@ -142,11 +164,15 @@ 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.
|
||||
* @since v0.11.14
|
||||
*/
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
|
||||
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
|
||||
port: number,
|
||||
): Promise<{
|
||||
hostname: string;
|
||||
service: string;
|
||||
@@ -165,13 +191,13 @@ declare module 'dns' {
|
||||
/** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
|
||||
export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
|
||||
export interface AnyARecord extends RecordWithTtl {
|
||||
type: 'A';
|
||||
type: "A";
|
||||
}
|
||||
export interface AnyAaaaRecord extends RecordWithTtl {
|
||||
type: 'AAAA';
|
||||
type: "AAAA";
|
||||
}
|
||||
export interface CaaRecord {
|
||||
critial: number;
|
||||
critical: number;
|
||||
issue?: string | undefined;
|
||||
issuewild?: string | undefined;
|
||||
iodef?: string | undefined;
|
||||
@@ -183,7 +209,7 @@ declare module 'dns' {
|
||||
exchange: string;
|
||||
}
|
||||
export interface AnyMxRecord extends MxRecord {
|
||||
type: 'MX';
|
||||
type: "MX";
|
||||
}
|
||||
export interface NaptrRecord {
|
||||
flags: string;
|
||||
@@ -194,7 +220,7 @@ declare module 'dns' {
|
||||
preference: number;
|
||||
}
|
||||
export interface AnyNaptrRecord extends NaptrRecord {
|
||||
type: 'NAPTR';
|
||||
type: "NAPTR";
|
||||
}
|
||||
export interface SoaRecord {
|
||||
nsname: string;
|
||||
@@ -206,7 +232,7 @@ declare module 'dns' {
|
||||
minttl: number;
|
||||
}
|
||||
export interface AnySoaRecord extends SoaRecord {
|
||||
type: 'SOA';
|
||||
type: "SOA";
|
||||
}
|
||||
export interface SrvRecord {
|
||||
priority: number;
|
||||
@@ -215,25 +241,35 @@ declare module 'dns' {
|
||||
name: string;
|
||||
}
|
||||
export interface AnySrvRecord extends SrvRecord {
|
||||
type: 'SRV';
|
||||
type: "SRV";
|
||||
}
|
||||
export interface AnyTxtRecord {
|
||||
type: 'TXT';
|
||||
type: "TXT";
|
||||
entries: string[];
|
||||
}
|
||||
export interface AnyNsRecord {
|
||||
type: 'NS';
|
||||
type: "NS";
|
||||
value: string;
|
||||
}
|
||||
export interface AnyPtrRecord {
|
||||
type: 'PTR';
|
||||
type: "PTR";
|
||||
value: string;
|
||||
}
|
||||
export interface AnyCnameRecord {
|
||||
type: 'CNAME';
|
||||
type: "CNAME";
|
||||
value: string;
|
||||
}
|
||||
export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord;
|
||||
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
|
||||
@@ -246,32 +282,85 @@ declare module 'dns' {
|
||||
* @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,
|
||||
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
|
||||
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<string[]>;
|
||||
function __promisify__(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
|
||||
function __promisify__(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
||||
function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
||||
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
||||
function __promisify__(
|
||||
hostname: string,
|
||||
rrtype: string,
|
||||
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
}
|
||||
/**
|
||||
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
||||
@@ -279,23 +368,45 @@ declare module 'dns' {
|
||||
* @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 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<string[]>;
|
||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
}
|
||||
/**
|
||||
* Uses the DNS protocol to resolve a 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.
|
||||
*/
|
||||
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 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<string[]>;
|
||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||
@@ -306,7 +417,10 @@ declare module 'dns' {
|
||||
* 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 function resolveCname(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export namespace resolveCname {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
}
|
||||
@@ -314,9 +428,12 @@ declare module 'dns' {
|
||||
* 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
|
||||
* @since v15.0.0, v14.17.0
|
||||
*/
|
||||
export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
|
||||
export function resolveCaa(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
|
||||
): void;
|
||||
export namespace resolveCaa {
|
||||
function __promisify__(hostname: string): Promise<CaaRecord[]>;
|
||||
}
|
||||
@@ -325,12 +442,15 @@ declare module 'dns' {
|
||||
* 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 function resolveMx(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
|
||||
): void;
|
||||
export namespace resolveMx {
|
||||
function __promisify__(hostname: string): Promise<MxRecord[]>;
|
||||
}
|
||||
/**
|
||||
* 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`
|
||||
@@ -352,7 +472,10 @@ declare module 'dns' {
|
||||
* ```
|
||||
* @since v0.9.12
|
||||
*/
|
||||
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||
export function resolveNaptr(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
||||
): void;
|
||||
export namespace resolveNaptr {
|
||||
function __promisify__(hostname: string): Promise<NaptrRecord[]>;
|
||||
}
|
||||
@@ -361,7 +484,10 @@ declare module 'dns' {
|
||||
* 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 function resolveNs(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export namespace resolveNs {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
}
|
||||
@@ -370,7 +496,10 @@ declare module 'dns' {
|
||||
* 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 function resolvePtr(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export namespace resolvePtr {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
}
|
||||
@@ -400,7 +529,10 @@ declare module 'dns' {
|
||||
* ```
|
||||
* @since v0.11.10
|
||||
*/
|
||||
export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
|
||||
export function resolveSoa(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
|
||||
): void;
|
||||
export namespace resolveSoa {
|
||||
function __promisify__(hostname: string): Promise<SoaRecord>;
|
||||
}
|
||||
@@ -423,7 +555,10 @@ declare module 'dns' {
|
||||
* ```
|
||||
* @since v0.1.27
|
||||
*/
|
||||
export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||
export function resolveSrv(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
||||
): void;
|
||||
export namespace resolveSrv {
|
||||
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
||||
}
|
||||
@@ -434,7 +569,10 @@ declare module 'dns' {
|
||||
* treated separately.
|
||||
* @since v0.1.27
|
||||
*/
|
||||
export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||
export function resolveTxt(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
|
||||
): void;
|
||||
export namespace resolveTxt {
|
||||
function __promisify__(hostname: string): Promise<string[][]>;
|
||||
}
|
||||
@@ -468,7 +606,10 @@ declare module 'dns' {
|
||||
* 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 function resolveAny(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
|
||||
): void;
|
||||
export namespace resolveAny {
|
||||
function __promisify__(hostname: string): Promise<AnyRecord[]>;
|
||||
}
|
||||
@@ -480,7 +621,18 @@ declare module 'dns' {
|
||||
* one of the `DNS error codes`.
|
||||
* @since v0.1.16
|
||||
*/
|
||||
export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
|
||||
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
|
||||
@@ -527,16 +679,18 @@ declare module 'dns' {
|
||||
*/
|
||||
export function getServers(): string[];
|
||||
/**
|
||||
* Set the default value of `verbatim` in {@link lookup}. The value could be:
|
||||
* - `ipv4first`: sets default `verbatim` `false`.
|
||||
* - `verbatim`: sets default `verbatim` `true`.
|
||||
* Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
|
||||
*
|
||||
* The default is `ipv4first` 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 v14.18.0
|
||||
* @param order must be 'ipv4first' or 'verbatim'.
|
||||
* * `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;
|
||||
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
||||
// Error codes
|
||||
export const NODATA: string;
|
||||
export const FORMERR: string;
|
||||
@@ -577,7 +731,7 @@ declare module 'dns' {
|
||||
* other resolvers:
|
||||
*
|
||||
* ```js
|
||||
* const { Resolver } = require('dns');
|
||||
* const { Resolver } = require('node:dns');
|
||||
* const resolver = new Resolver();
|
||||
* resolver.setServers(['4.4.4.4']);
|
||||
*
|
||||
@@ -587,7 +741,7 @@ declare module 'dns' {
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* The following methods from the `dns` module are available:
|
||||
* The following methods from the `node:dns` module are available:
|
||||
*
|
||||
* * `resolver.getServers()`
|
||||
* * `resolver.resolve()`
|
||||
@@ -620,6 +774,7 @@ declare module 'dns' {
|
||||
resolve4: typeof resolve4;
|
||||
resolve6: typeof resolve6;
|
||||
resolveAny: typeof resolveAny;
|
||||
resolveCaa: typeof resolveCaa;
|
||||
resolveCname: typeof resolveCname;
|
||||
resolveMx: typeof resolveMx;
|
||||
resolveNaptr: typeof resolveNaptr;
|
||||
@@ -634,13 +789,13 @@ declare module 'dns' {
|
||||
* 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
|
||||
* 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
|
||||
* @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.
|
||||
*/
|
||||
@@ -649,6 +804,6 @@ declare module 'dns' {
|
||||
}
|
||||
export { dnsPromises as promises };
|
||||
}
|
||||
declare module 'node:dns' {
|
||||
export * from 'dns';
|
||||
declare module "node:dns" {
|
||||
export * from "dns";
|
||||
}
|
||||
|
||||
127
node_modules/@types/node/dns/promises.d.ts
generated
vendored
Executable file → Normal file
127
node_modules/@types/node/dns/promises.d.ts
generated
vendored
Executable file → Normal file
@@ -1,26 +1,26 @@
|
||||
/**
|
||||
* 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('dns').promises` or `require('dns/promises')`.
|
||||
* via `require('node:dns').promises` or `require('node:dns/promises')`.
|
||||
* @since v10.6.0
|
||||
*/
|
||||
declare module 'dns/promises' {
|
||||
declare module "dns/promises" {
|
||||
import {
|
||||
LookupAddress,
|
||||
LookupOneOptions,
|
||||
LookupAllOptions,
|
||||
LookupOptions,
|
||||
AnyRecord,
|
||||
CaaRecord,
|
||||
LookupAddress,
|
||||
LookupAllOptions,
|
||||
LookupOneOptions,
|
||||
LookupOptions,
|
||||
MxRecord,
|
||||
NaptrRecord,
|
||||
SoaRecord,
|
||||
SrvRecord,
|
||||
ResolveWithTtlOptions,
|
||||
RecordWithTtl,
|
||||
ResolveOptions,
|
||||
ResolverOptions,
|
||||
} from 'node:dns';
|
||||
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
|
||||
@@ -52,7 +52,7 @@ declare module 'dns/promises' {
|
||||
*
|
||||
* `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
|
||||
* 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()`.
|
||||
@@ -60,7 +60,7 @@ declare module 'dns/promises' {
|
||||
* Example usage:
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('dns');
|
||||
* const dns = require('node:dns');
|
||||
* const dnsPromises = dns.promises;
|
||||
* const options = {
|
||||
* family: 6,
|
||||
@@ -96,7 +96,7 @@ declare module 'dns/promises' {
|
||||
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
|
||||
*
|
||||
* ```js
|
||||
* const dnsPromises = require('dns').promises;
|
||||
* const dnsPromises = require('node:dns').promises;
|
||||
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
||||
* console.log(result.hostname, result.service);
|
||||
* // Prints: localhost ssh
|
||||
@@ -106,7 +106,7 @@ declare module 'dns/promises' {
|
||||
*/
|
||||
function lookupService(
|
||||
address: string,
|
||||
port: number
|
||||
port: number,
|
||||
): Promise<{
|
||||
hostname: string;
|
||||
service: string;
|
||||
@@ -125,19 +125,22 @@ declare module 'dns/promises' {
|
||||
* @param [rrtype='A'] Resource record type.
|
||||
*/
|
||||
function resolve(hostname: string): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: 'A'): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: 'AAAA'): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
|
||||
function resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
|
||||
function resolve(hostname: string, rrtype: 'CNAME'): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
||||
function resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
|
||||
function resolve(hostname: string, rrtype: 'NS'): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: 'PTR'): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
|
||||
function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
||||
function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
||||
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
||||
function resolve(
|
||||
hostname: string,
|
||||
rrtype: string,
|
||||
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
/**
|
||||
* 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']`).
|
||||
@@ -189,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'}]`).
|
||||
* @since v15.0.0
|
||||
* @since v15.0.0, v14.17.0
|
||||
*/
|
||||
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
||||
/**
|
||||
@@ -206,7 +209,7 @@ declare module 'dns/promises' {
|
||||
*/
|
||||
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
||||
/**
|
||||
* 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`
|
||||
@@ -332,16 +335,61 @@ declare module 'dns/promises' {
|
||||
*/
|
||||
function setServers(servers: ReadonlyArray<string>): void;
|
||||
/**
|
||||
* Set the default value of `verbatim` in {@link lookup}. The value could be:
|
||||
* - `ipv4first`: sets default `verbatim` `false`.
|
||||
* - `verbatim`: sets default `verbatim` `true`.
|
||||
* Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
|
||||
*
|
||||
* The default is `ipv4first` 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 v14.18.0
|
||||
* @param order must be 'ipv4first' or 'verbatim'.
|
||||
* * `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
|
||||
*/
|
||||
function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
|
||||
class Resolver {
|
||||
constructor(options?: ResolverOptions);
|
||||
cancel(): void;
|
||||
@@ -350,6 +398,7 @@ declare module 'dns/promises' {
|
||||
resolve4: typeof resolve4;
|
||||
resolve6: typeof resolve6;
|
||||
resolveAny: typeof resolveAny;
|
||||
resolveCaa: typeof resolveCaa;
|
||||
resolveCname: typeof resolveCname;
|
||||
resolveMx: typeof resolveMx;
|
||||
resolveNaptr: typeof resolveNaptr;
|
||||
@@ -363,6 +412,6 @@ declare module 'dns/promises' {
|
||||
setServers: typeof setServers;
|
||||
}
|
||||
}
|
||||
declare module 'node:dns/promises' {
|
||||
export * from 'dns/promises';
|
||||
declare module "node:dns/promises" {
|
||||
export * from "dns/promises";
|
||||
}
|
||||
|
||||
122
node_modules/@types/node/dom-events.d.ts
generated
vendored
Normal file
122
node_modules/@types/node/dom-events.d.ts
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
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;
|
||||
};
|
||||
}
|
||||
19
node_modules/@types/node/domain.d.ts
generated
vendored
Executable file → Normal file
19
node_modules/@types/node/domain.d.ts
generated
vendored
Executable file → Normal file
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* **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
|
||||
* 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.
|
||||
@@ -11,10 +12,10 @@
|
||||
* 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/v16.9.0/lib/domain.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js)
|
||||
*/
|
||||
declare module 'domain' {
|
||||
import EventEmitter = require('node:events');
|
||||
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.
|
||||
@@ -55,15 +56,15 @@ declare module 'domain' {
|
||||
exit(): void;
|
||||
/**
|
||||
* Run the supplied function in the context of the domain, implicitly
|
||||
* binding all event emitters, timers, and lowlevel requests that are
|
||||
* 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('domain');
|
||||
* const fs = require('fs');
|
||||
* const domain = require('node:domain');
|
||||
* const fs = require('node:fs');
|
||||
* const d = domain.create();
|
||||
* d.on('error', (er) => {
|
||||
* console.error('Caught error!', er);
|
||||
@@ -164,6 +165,6 @@ declare module 'domain' {
|
||||
}
|
||||
function create(): Domain;
|
||||
}
|
||||
declare module 'node:domain' {
|
||||
export * from 'domain';
|
||||
declare module "node:domain" {
|
||||
export * from "domain";
|
||||
}
|
||||
|
||||
367
node_modules/@types/node/events.d.ts
generated
vendored
Executable file → Normal file
367
node_modules/@types/node/events.d.ts
generated
vendored
Executable file → Normal file
@@ -22,7 +22,7 @@
|
||||
* the `eventEmitter.emit()` method is used to trigger the event.
|
||||
*
|
||||
* ```js
|
||||
* const EventEmitter = require('events');
|
||||
* import { EventEmitter } from 'node:events';
|
||||
*
|
||||
* class MyEmitter extends EventEmitter {}
|
||||
*
|
||||
@@ -32,25 +32,61 @@
|
||||
* });
|
||||
* myEmitter.emit('event');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/events.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js)
|
||||
*/
|
||||
declare module 'events' {
|
||||
declare module "events" {
|
||||
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
||||
// 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;
|
||||
}
|
||||
interface NodeEventTarget {
|
||||
// Any EventTarget with a Node-style `once` function
|
||||
interface _NodeEventTarget {
|
||||
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
interface DOMEventTarget {
|
||||
// Any EventTarget with a DOM-style `addEventListener`
|
||||
interface _DOMEventTarget {
|
||||
addEventListener(
|
||||
eventName: string,
|
||||
listener: (...args: any[]) => void,
|
||||
opts?: {
|
||||
once: boolean;
|
||||
}
|
||||
},
|
||||
): any;
|
||||
}
|
||||
interface StaticEventEmitterOptions {
|
||||
@@ -58,10 +94,10 @@ declare module 'events' {
|
||||
}
|
||||
interface EventEmitter extends NodeJS.EventEmitter {}
|
||||
/**
|
||||
* The `EventEmitter` class is defined and exposed by the `events` module:
|
||||
* The `EventEmitter` class is defined and exposed by the `node:events` module:
|
||||
*
|
||||
* ```js
|
||||
* const EventEmitter = require('events');
|
||||
* import { EventEmitter } from 'node:events';
|
||||
* ```
|
||||
*
|
||||
* All `EventEmitter`s emit the event `'newListener'` when new listeners are
|
||||
@@ -72,6 +108,9 @@ declare module 'events' {
|
||||
*/
|
||||
class EventEmitter {
|
||||
constructor(options?: EventEmitterOptions);
|
||||
|
||||
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
||||
|
||||
/**
|
||||
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
||||
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
||||
@@ -82,31 +121,28 @@ declare module 'events' {
|
||||
* semantics and does not listen to the `'error'` event.
|
||||
*
|
||||
* ```js
|
||||
* const { once, EventEmitter } = require('events');
|
||||
* import { once, EventEmitter } from 'node:events';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* async function run() {
|
||||
* const ee = new EventEmitter();
|
||||
* const ee = new EventEmitter();
|
||||
*
|
||||
* process.nextTick(() => {
|
||||
* ee.emit('myevent', 42);
|
||||
* });
|
||||
* process.nextTick(() => {
|
||||
* ee.emit('myevent', 42);
|
||||
* });
|
||||
*
|
||||
* const [value] = await once(ee, 'myevent');
|
||||
* console.log(value);
|
||||
* const [value] = await once(ee, 'myevent');
|
||||
* console.log(value);
|
||||
*
|
||||
* const err = new Error('kaboom');
|
||||
* process.nextTick(() => {
|
||||
* ee.emit('error', err);
|
||||
* });
|
||||
* const err = new Error('kaboom');
|
||||
* process.nextTick(() => {
|
||||
* ee.emit('error', err);
|
||||
* });
|
||||
*
|
||||
* try {
|
||||
* await once(ee, 'myevent');
|
||||
* } catch (err) {
|
||||
* console.log('error happened', err);
|
||||
* }
|
||||
* try {
|
||||
* await once(ee, 'myevent');
|
||||
* } catch (err) {
|
||||
* console.error('error happened', err);
|
||||
* }
|
||||
*
|
||||
* run();
|
||||
* ```
|
||||
*
|
||||
* 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
|
||||
@@ -114,13 +150,13 @@ declare module 'events' {
|
||||
* special handling:
|
||||
*
|
||||
* ```js
|
||||
* const { EventEmitter, once } = require('events');
|
||||
* import { EventEmitter, once } from 'node:events';
|
||||
*
|
||||
* const ee = new EventEmitter();
|
||||
*
|
||||
* once(ee, 'error')
|
||||
* .then(([err]) => console.log('ok', err.message))
|
||||
* .catch((err) => console.log('error', err.message));
|
||||
* .catch((err) => console.error('error', err.message));
|
||||
*
|
||||
* ee.emit('error', new Error('boom'));
|
||||
*
|
||||
@@ -130,7 +166,7 @@ declare module 'events' {
|
||||
* An `AbortSignal` can be used to cancel waiting for the event:
|
||||
*
|
||||
* ```js
|
||||
* const { EventEmitter, once } = require('events');
|
||||
* import { EventEmitter, once } from 'node:events';
|
||||
*
|
||||
* const ee = new EventEmitter();
|
||||
* const ac = new AbortController();
|
||||
@@ -154,29 +190,32 @@ declare module 'events' {
|
||||
* ```
|
||||
* @since v11.13.0, v10.16.0
|
||||
*/
|
||||
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||
static once(
|
||||
emitter: _NodeEventTarget,
|
||||
eventName: string | symbol,
|
||||
options?: StaticEventEmitterOptions,
|
||||
): Promise<any[]>;
|
||||
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||
/**
|
||||
* ```js
|
||||
* const { on, EventEmitter } = require('events');
|
||||
* import { on, EventEmitter } from 'node:events';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* (async () => {
|
||||
* const ee = new EventEmitter();
|
||||
* const ee = new EventEmitter();
|
||||
*
|
||||
* // Emit later on
|
||||
* process.nextTick(() => {
|
||||
* ee.emit('foo', 'bar');
|
||||
* ee.emit('foo', 42);
|
||||
* });
|
||||
* // 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
|
||||
* })();
|
||||
* 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
|
||||
@@ -187,7 +226,9 @@ declare module 'events' {
|
||||
* An `AbortSignal` can be used to cancel waiting on events:
|
||||
*
|
||||
* ```js
|
||||
* const { on, EventEmitter } = require('events');
|
||||
* import { on, EventEmitter } from 'node:events';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* const ac = new AbortController();
|
||||
*
|
||||
* (async () => {
|
||||
@@ -214,12 +255,17 @@ declare module 'events' {
|
||||
* @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<any>;
|
||||
static on(
|
||||
emitter: NodeJS.EventEmitter,
|
||||
eventName: string,
|
||||
options?: StaticEventEmitterOptions,
|
||||
): AsyncIterableIterator<any>;
|
||||
/**
|
||||
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
||||
*
|
||||
* ```js
|
||||
* const { EventEmitter, listenerCount } = require('events');
|
||||
* import { EventEmitter, listenerCount } from 'node:events';
|
||||
*
|
||||
* const myEmitter = new EventEmitter();
|
||||
* myEmitter.on('event', () => {});
|
||||
* myEmitter.on('event', () => {});
|
||||
@@ -242,43 +288,164 @@ declare module 'events' {
|
||||
* event target. This is useful for debugging and diagnostic purposes.
|
||||
*
|
||||
* ```js
|
||||
* const { getEventListeners, EventEmitter } = require('events');
|
||||
* import { getEventListeners, EventEmitter } from 'node:events';
|
||||
*
|
||||
* {
|
||||
* const ee = new EventEmitter();
|
||||
* const listener = () => console.log('Events are fun');
|
||||
* ee.on('foo', listener);
|
||||
* getEventListeners(ee, 'foo'); // [listener]
|
||||
* console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
|
||||
* }
|
||||
* {
|
||||
* const et = new EventTarget();
|
||||
* const listener = () => console.log('Events are fun');
|
||||
* et.addEventListener('foo', listener);
|
||||
* getEventListeners(et, 'foo'); // [listener]
|
||||
* console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
|
||||
* }
|
||||
* ```
|
||||
* @since v15.2.0
|
||||
* @since v15.2.0, v14.17.0
|
||||
*/
|
||||
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
||||
static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
||||
/**
|
||||
* 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.
|
||||
* Returns the currently set max amount of listeners.
|
||||
*
|
||||
* 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
|
||||
* 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 Disposable 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;
|
||||
/**
|
||||
* Sets or gets the default captureRejection value for all emitters.
|
||||
* 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
|
||||
*/
|
||||
// TODO: These should be described using static getter/setter pairs:
|
||||
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');
|
||||
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 };
|
||||
@@ -288,10 +455,54 @@ declare module 'events' {
|
||||
*/
|
||||
signal?: AbortSignal | undefined;
|
||||
}
|
||||
|
||||
export interface EventEmitterReferencingAsyncResource extends AsyncResource {
|
||||
readonly eventEmitter: EventEmitterAsyncResource;
|
||||
}
|
||||
|
||||
export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
|
||||
/**
|
||||
* The type of async event, this is required when instantiating `EventEmitterAsyncResource`
|
||||
* directly rather than as a child class.
|
||||
* @default new.target.name if instantiated as a child class.
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* @since v17.4.0, v16.14.0
|
||||
*/
|
||||
export class EventEmitterAsyncResource extends EventEmitter {
|
||||
/**
|
||||
* @param options Only optional in child class.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
emitDestroy(): void;
|
||||
/** The unique asyncId assigned to the resource. */
|
||||
readonly asyncId: number;
|
||||
/** The same triggerAsyncId that is passed to the AsyncResource constructor. */
|
||||
readonly triggerAsyncId: number;
|
||||
/** The underlying AsyncResource */
|
||||
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
||||
}
|
||||
}
|
||||
global {
|
||||
namespace NodeJS {
|
||||
interface EventEmitter {
|
||||
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
||||
/**
|
||||
* Alias for `emitter.on(eventName, listener)`.
|
||||
* @since v0.1.26
|
||||
@@ -315,6 +526,7 @@ declare module 'events' {
|
||||
* 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'));
|
||||
@@ -344,6 +556,7 @@ declare module 'events' {
|
||||
* 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'));
|
||||
@@ -375,10 +588,12 @@ 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 will
|
||||
* not remove them from`emit()` in progress. Subsequent events behave as expected.
|
||||
* 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 = () => {
|
||||
@@ -419,6 +634,7 @@ declare module 'events' {
|
||||
* recently added instance. In the example the `once('ping')`listener is removed:
|
||||
*
|
||||
* ```js
|
||||
* import { EventEmitter } from 'node:events';
|
||||
* const ee = new EventEmitter();
|
||||
*
|
||||
* function pong() {
|
||||
@@ -487,6 +703,7 @@ declare module 'events' {
|
||||
* 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'));
|
||||
*
|
||||
@@ -519,7 +736,7 @@ declare module 'events' {
|
||||
* Returns `true` if the event had listeners, `false` otherwise.
|
||||
*
|
||||
* ```js
|
||||
* const EventEmitter = require('events');
|
||||
* import { EventEmitter } from 'node:events';
|
||||
* const myEmitter = new EventEmitter();
|
||||
*
|
||||
* // First listener
|
||||
@@ -554,11 +771,14 @@ declare module 'events' {
|
||||
*/
|
||||
emit(eventName: string | symbol, ...args: any[]): boolean;
|
||||
/**
|
||||
* Returns the number of listeners listening to the event named `eventName`.
|
||||
* 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): number;
|
||||
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
|
||||
@@ -578,7 +798,7 @@ declare module 'events' {
|
||||
*/
|
||||
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
|
||||
* 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
|
||||
@@ -598,7 +818,8 @@ declare module 'events' {
|
||||
* listeners. The values in the array are strings or `Symbol`s.
|
||||
*
|
||||
* ```js
|
||||
* const EventEmitter = require('events');
|
||||
* import { EventEmitter } from 'node:events';
|
||||
*
|
||||
* const myEE = new EventEmitter();
|
||||
* myEE.on('foo', () => {});
|
||||
* myEE.on('bar', () => {});
|
||||
@@ -617,7 +838,7 @@ declare module 'events' {
|
||||
}
|
||||
export = EventEmitter;
|
||||
}
|
||||
declare module 'node:events' {
|
||||
import events = require('events');
|
||||
declare module "node:events" {
|
||||
import events = require("events");
|
||||
export = events;
|
||||
}
|
||||
|
||||
1365
node_modules/@types/node/fs.d.ts
generated
vendored
Executable file → Normal file
1365
node_modules/@types/node/fs.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
417
node_modules/@types/node/fs/promises.d.ts
generated
vendored
Executable file → Normal file
417
node_modules/@types/node/fs/promises.d.ts
generated
vendored
Executable file → Normal file
@@ -8,45 +8,52 @@
|
||||
* 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';
|
||||
declare module "fs/promises" {
|
||||
import { Abortable } from "node:events";
|
||||
import { Stream } from "node:stream";
|
||||
import { ReadableStream } from "node:stream/web";
|
||||
import {
|
||||
Stats,
|
||||
BigIntStats,
|
||||
StatOptions,
|
||||
WriteVResult,
|
||||
ReadVResult,
|
||||
BigIntStatsFs,
|
||||
BufferEncodingOption,
|
||||
constants as fsConstants,
|
||||
CopyOptions,
|
||||
Dir,
|
||||
Dirent,
|
||||
MakeDirectoryOptions,
|
||||
Mode,
|
||||
ObjectEncodingOptions,
|
||||
OpenDirOptions,
|
||||
OpenMode,
|
||||
PathLike,
|
||||
ReadStream,
|
||||
ReadVResult,
|
||||
RmDirOptions,
|
||||
RmOptions,
|
||||
MakeDirectoryOptions,
|
||||
Dirent,
|
||||
OpenDirOptions,
|
||||
Dir,
|
||||
ObjectEncodingOptions,
|
||||
BufferEncodingOption,
|
||||
OpenMode,
|
||||
Mode,
|
||||
WatchOptions,
|
||||
StatFsOptions,
|
||||
StatOptions,
|
||||
Stats,
|
||||
StatsFs,
|
||||
TimeLike,
|
||||
WatchEventType,
|
||||
CopyOptions,
|
||||
ReadStream,
|
||||
WatchOptions,
|
||||
WriteStream,
|
||||
} from 'node:fs';
|
||||
WriteVResult,
|
||||
} from "node:fs";
|
||||
import { Interface as ReadlineInterface } from "node:readline";
|
||||
interface FileChangeInfo<T extends string | Buffer> {
|
||||
eventType: WatchEventType;
|
||||
filename: T;
|
||||
filename: T | null;
|
||||
}
|
||||
interface FlagAndOpenMode {
|
||||
mode?: Mode | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
}
|
||||
interface FileReadResult<T extends ArrayBufferView> {
|
||||
interface FileReadResult<T extends NodeJS.ArrayBufferView> {
|
||||
bytesRead: number;
|
||||
buffer: T;
|
||||
}
|
||||
interface FileReadOptions<T extends ArrayBufferView = Buffer> {
|
||||
interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
|
||||
/**
|
||||
* @default `Buffer.alloc(0xffff)`
|
||||
*/
|
||||
@@ -74,6 +81,14 @@ declare module 'fs/promises' {
|
||||
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 {
|
||||
@@ -90,7 +105,10 @@ declare module 'fs/promises' {
|
||||
* @since v10.0.0
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
||||
appendFile(
|
||||
data: string | Uint8Array,
|
||||
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* 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
|
||||
@@ -107,8 +125,8 @@ declare module 'fs/promises' {
|
||||
*/
|
||||
chmod(mode: Mode): Promise<void>;
|
||||
/**
|
||||
* Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
|
||||
* returned by this method has a default `highWaterMark` of 64 kb.
|
||||
* 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
|
||||
@@ -126,7 +144,7 @@ declare module 'fs/promises' {
|
||||
* destroyed. Set the `emitClose` option to `false` to change this behavior.
|
||||
*
|
||||
* ```js
|
||||
* import { open } from 'fs/promises';
|
||||
* import { open } from 'node:fs/promises';
|
||||
*
|
||||
* const fd = await open('/dev/input/event0');
|
||||
* // Create a stream from some character device.
|
||||
@@ -152,7 +170,7 @@ declare module 'fs/promises' {
|
||||
* An example to read the last 10 bytes of a file which is 100 bytes long:
|
||||
*
|
||||
* ```js
|
||||
* import { open } from 'fs/promises';
|
||||
* import { open } from 'node:fs/promises';
|
||||
*
|
||||
* const fd = await open('sample.txt');
|
||||
* fd.createReadStream({ start: 90, end: 99 });
|
||||
@@ -163,9 +181,9 @@ declare module 'fs/promises' {
|
||||
/**
|
||||
* `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`.
|
||||
* \[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.
|
||||
@@ -191,7 +209,7 @@ declare module 'fs/promises' {
|
||||
* 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 Fufills with `undefined` upon success.
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
sync(): Promise<void>;
|
||||
/**
|
||||
@@ -207,8 +225,38 @@ declare module 'fs/promises' {
|
||||
* integer, the current file position will remain unchanged.
|
||||
* @return Fulfills upon success with an object with two properties:
|
||||
*/
|
||||
read<T extends ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
|
||||
read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
||||
read<T extends NodeJS.ArrayBufferView>(
|
||||
buffer: T,
|
||||
offset?: number | null,
|
||||
length?: number | null,
|
||||
position?: number | null,
|
||||
): Promise<FileReadResult<T>>;
|
||||
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -227,7 +275,7 @@ declare module 'fs/promises' {
|
||||
options?: {
|
||||
encoding?: null | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
} | null
|
||||
} | null,
|
||||
): Promise<Buffer>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||
@@ -238,10 +286,10 @@ declare module 'fs/promises' {
|
||||
readFile(
|
||||
options:
|
||||
| {
|
||||
encoding: BufferEncoding;
|
||||
flag?: OpenMode | undefined;
|
||||
}
|
||||
| BufferEncoding
|
||||
encoding: BufferEncoding;
|
||||
flag?: OpenMode | undefined;
|
||||
}
|
||||
| BufferEncoding,
|
||||
): Promise<string>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||
@@ -252,11 +300,27 @@ declare module 'fs/promises' {
|
||||
readFile(
|
||||
options?:
|
||||
| (ObjectEncodingOptions & {
|
||||
flag?: OpenMode | undefined;
|
||||
})
|
||||
flag?: OpenMode | undefined;
|
||||
})
|
||||
| BufferEncoding
|
||||
| null
|
||||
| null,
|
||||
): Promise<string | Buffer>;
|
||||
/**
|
||||
* 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.
|
||||
@@ -264,12 +328,12 @@ declare module 'fs/promises' {
|
||||
stat(
|
||||
opts?: StatOptions & {
|
||||
bigint?: false | undefined;
|
||||
}
|
||||
},
|
||||
): Promise<Stats>;
|
||||
stat(
|
||||
opts: StatOptions & {
|
||||
bigint: true;
|
||||
}
|
||||
},
|
||||
): Promise<BigIntStats>;
|
||||
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
/**
|
||||
@@ -281,7 +345,7 @@ declare module 'fs/promises' {
|
||||
* The following example retains only the first four bytes of the file:
|
||||
*
|
||||
* ```js
|
||||
* import { open } from 'fs/promises';
|
||||
* import { open } from 'node:fs/promises';
|
||||
*
|
||||
* let filehandle = null;
|
||||
* try {
|
||||
@@ -305,13 +369,12 @@ declare module 'fs/promises' {
|
||||
* 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: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||
utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
|
||||
/**
|
||||
* 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
|
||||
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
|
||||
* object with an own `toString` function
|
||||
* property. The promise is resolved with no arguments upon success.
|
||||
* [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`.
|
||||
*
|
||||
@@ -325,32 +388,33 @@ declare module 'fs/promises' {
|
||||
* beginning of the file.
|
||||
* @since v10.0.0
|
||||
*/
|
||||
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
|
||||
writeFile(
|
||||
data: string | Uint8Array,
|
||||
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Write `buffer` to the file.
|
||||
*
|
||||
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
||||
*
|
||||
* 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 `fs.createWriteStream()`.
|
||||
* 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=0] The start position from within `buffer` where the data to write begins.
|
||||
* @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
|
||||
* @param position 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.
|
||||
* @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<TBuffer extends Uint8Array>(
|
||||
buffer: TBuffer,
|
||||
offset?: number | null,
|
||||
length?: number | null,
|
||||
position?: number | null
|
||||
position?: number | null,
|
||||
): Promise<{
|
||||
bytesWritten: number;
|
||||
buffer: TBuffer;
|
||||
@@ -358,7 +422,7 @@ declare module 'fs/promises' {
|
||||
write(
|
||||
data: string,
|
||||
position?: number | null,
|
||||
encoding?: BufferEncoding | null
|
||||
encoding?: BufferEncoding | null,
|
||||
): Promise<{
|
||||
bytesWritten: number;
|
||||
buffer: string;
|
||||
@@ -375,14 +439,14 @@ declare module 'fs/promises' {
|
||||
* The kernel ignores the position argument and always appends the data to
|
||||
* the end of the file.
|
||||
* @since v12.9.0
|
||||
* @param position 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
|
||||
* @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<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
||||
/**
|
||||
* 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 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.
|
||||
* @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<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
||||
@@ -391,7 +455,7 @@ declare module 'fs/promises' {
|
||||
* complete.
|
||||
*
|
||||
* ```js
|
||||
* import { open } from 'fs/promises';
|
||||
* import { open } from 'node:fs/promises';
|
||||
*
|
||||
* let filehandle;
|
||||
* try {
|
||||
@@ -404,13 +468,19 @@ declare module 'fs/promises' {
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
* An alias for {@link FileHandle.close()}.
|
||||
* @since v20.4.0
|
||||
*/
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
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. Check `File access constants` for possible values
|
||||
* of `mode`. It is possible to create a mask consisting of the bitwise OR of
|
||||
* two or more values (e.g. `fs.constants.W_OK | fs.constants.R_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
|
||||
* value. If any of the accessibility checks fail, the promise is rejected
|
||||
@@ -418,8 +488,7 @@ declare module 'fs/promises' {
|
||||
* written by the current process.
|
||||
*
|
||||
* ```js
|
||||
* import { access } from 'fs/promises';
|
||||
* import { constants } from 'fs';
|
||||
* import { access, constants } from 'node:fs/promises';
|
||||
*
|
||||
* try {
|
||||
* await access('/etc/passwd', constants.R_OK | constants.W_OK);
|
||||
@@ -448,14 +517,13 @@ declare module 'fs/promises' {
|
||||
* will be made to remove the destination.
|
||||
*
|
||||
* ```js
|
||||
* import { constants } from 'fs';
|
||||
* import { copyFile } from 'fs/promises';
|
||||
* 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.log('The file could not be copied');
|
||||
* console.error('The file could not be copied');
|
||||
* }
|
||||
*
|
||||
* // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
|
||||
@@ -463,7 +531,7 @@ declare module 'fs/promises' {
|
||||
* await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
|
||||
* console.log('source.txt was copied to destination.txt');
|
||||
* } catch {
|
||||
* console.log('The file could not be copied');
|
||||
* console.error('The file could not be copied');
|
||||
* }
|
||||
* ```
|
||||
* @since v10.0.0
|
||||
@@ -487,7 +555,7 @@ declare module 'fs/promises' {
|
||||
* @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<FileHandle>;
|
||||
function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
|
||||
/**
|
||||
* Renames `oldPath` to `newPath`.
|
||||
* @since v10.0.0
|
||||
@@ -525,6 +593,19 @@ declare module 'fs/promises' {
|
||||
* 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`.
|
||||
*/
|
||||
@@ -532,7 +613,7 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
options: MakeDirectoryOptions & {
|
||||
recursive: true;
|
||||
}
|
||||
},
|
||||
): Promise<string | undefined>;
|
||||
/**
|
||||
* Asynchronous mkdir(2) - create a directory.
|
||||
@@ -545,9 +626,9 @@ declare module 'fs/promises' {
|
||||
options?:
|
||||
| Mode
|
||||
| (MakeDirectoryOptions & {
|
||||
recursive?: false | undefined;
|
||||
})
|
||||
| null
|
||||
recursive?: false | undefined;
|
||||
})
|
||||
| null,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Asynchronous mkdir(2) - create a directory.
|
||||
@@ -567,7 +648,7 @@ declare module 'fs/promises' {
|
||||
* If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
|
||||
*
|
||||
* ```js
|
||||
* import { readdir } from 'fs/promises';
|
||||
* import { readdir } from 'node:fs/promises';
|
||||
*
|
||||
* try {
|
||||
* const files = await readdir(path);
|
||||
@@ -584,10 +665,11 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
options?:
|
||||
| (ObjectEncodingOptions & {
|
||||
withFileTypes?: false | undefined;
|
||||
})
|
||||
withFileTypes?: false | undefined;
|
||||
recursive?: boolean | undefined;
|
||||
})
|
||||
| BufferEncoding
|
||||
| null
|
||||
| null,
|
||||
): Promise<string[]>;
|
||||
/**
|
||||
* Asynchronous readdir(3) - read a directory.
|
||||
@@ -598,10 +680,11 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
options:
|
||||
| {
|
||||
encoding: 'buffer';
|
||||
withFileTypes?: false | undefined;
|
||||
}
|
||||
| 'buffer'
|
||||
encoding: "buffer";
|
||||
withFileTypes?: false | undefined;
|
||||
recursive?: boolean | undefined;
|
||||
}
|
||||
| "buffer",
|
||||
): Promise<Buffer[]>;
|
||||
/**
|
||||
* Asynchronous readdir(3) - read a directory.
|
||||
@@ -612,10 +695,11 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
options?:
|
||||
| (ObjectEncodingOptions & {
|
||||
withFileTypes?: false | undefined;
|
||||
})
|
||||
withFileTypes?: false | undefined;
|
||||
recursive?: boolean | undefined;
|
||||
})
|
||||
| BufferEncoding
|
||||
| null
|
||||
| null,
|
||||
): Promise<string[] | Buffer[]>;
|
||||
/**
|
||||
* Asynchronous readdir(3) - read a directory.
|
||||
@@ -626,7 +710,8 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
options: ObjectEncodingOptions & {
|
||||
withFileTypes: true;
|
||||
}
|
||||
recursive?: boolean | undefined;
|
||||
},
|
||||
): Promise<Dirent[]>;
|
||||
/**
|
||||
* 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
|
||||
@@ -655,11 +740,14 @@ 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'`. Windows junction points require the destination path
|
||||
* to be absolute. When using `'junction'`, the `target` argument will
|
||||
* automatically be normalized to absolute path.
|
||||
* 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='file']
|
||||
* @param [type='null']
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
||||
@@ -674,13 +762,13 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
opts?: StatOptions & {
|
||||
bigint?: false | undefined;
|
||||
}
|
||||
},
|
||||
): Promise<Stats>;
|
||||
function lstat(
|
||||
path: PathLike,
|
||||
opts: StatOptions & {
|
||||
bigint: true;
|
||||
}
|
||||
},
|
||||
): Promise<BigIntStats>;
|
||||
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
/**
|
||||
@@ -691,15 +779,32 @@ declare module 'fs/promises' {
|
||||
path: PathLike,
|
||||
opts?: StatOptions & {
|
||||
bigint?: false | undefined;
|
||||
}
|
||||
},
|
||||
): Promise<Stats>;
|
||||
function stat(
|
||||
path: PathLike,
|
||||
opts: StatOptions & {
|
||||
bigint: true;
|
||||
}
|
||||
},
|
||||
): Promise<BigIntStats>;
|
||||
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
/**
|
||||
* @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<StatsFs>;
|
||||
function statfs(
|
||||
path: PathLike,
|
||||
opts: StatFsOptions & {
|
||||
bigint: true;
|
||||
},
|
||||
): Promise<BigIntStatsFs>;
|
||||
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
|
||||
/**
|
||||
* 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
|
||||
@@ -741,7 +846,7 @@ declare module 'fs/promises' {
|
||||
* @since v14.5.0, v12.19.0
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||
function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
||||
/**
|
||||
* Changes the ownership of a file.
|
||||
* @since v10.0.0
|
||||
@@ -755,11 +860,11 @@ 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: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||
function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
||||
/**
|
||||
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
||||
*
|
||||
@@ -788,7 +893,10 @@ declare module 'fs/promises' {
|
||||
* @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<string | Buffer>;
|
||||
function realpath(
|
||||
path: PathLike,
|
||||
options?: ObjectEncodingOptions | BufferEncoding | null,
|
||||
): Promise<string | Buffer>;
|
||||
/**
|
||||
* 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
|
||||
@@ -800,10 +908,12 @@ declare module 'fs/promises' {
|
||||
* object with an `encoding` property specifying the character encoding to use.
|
||||
*
|
||||
* ```js
|
||||
* import { mkdtemp } from 'fs/promises';
|
||||
* import { mkdtemp } from 'node:fs/promises';
|
||||
* import { join } from 'node:path';
|
||||
* import { tmpdir } from 'node:os';
|
||||
*
|
||||
* try {
|
||||
* await mkdtemp(path.join(os.tmpdir(), 'foo-'));
|
||||
* await mkdtemp(join(tmpdir(), 'foo-'));
|
||||
* } catch (err) {
|
||||
* console.error(err);
|
||||
* }
|
||||
@@ -812,9 +922,9 @@ 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
|
||||
* platform-specific path separator
|
||||
* (`require('path').sep`).
|
||||
* (`require('node:path').sep`).
|
||||
* @since v10.0.0
|
||||
* @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
|
||||
* @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<string>;
|
||||
/**
|
||||
@@ -830,7 +940,9 @@ declare module 'fs/promises' {
|
||||
*/
|
||||
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
||||
/**
|
||||
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property.
|
||||
* 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.
|
||||
*
|
||||
@@ -845,15 +957,15 @@ declare module 'fs/promises' {
|
||||
*
|
||||
* 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()`.
|
||||
* 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 'fs/promises';
|
||||
* import { Buffer } from 'buffer';
|
||||
* import { writeFile } from 'node:fs/promises';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* try {
|
||||
* const controller = new AbortController();
|
||||
@@ -879,14 +991,19 @@ declare module 'fs/promises' {
|
||||
*/
|
||||
function writeFile(
|
||||
file: PathLike | FileHandle,
|
||||
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
|
||||
data:
|
||||
| string
|
||||
| NodeJS.ArrayBufferView
|
||||
| Iterable<string | NodeJS.ArrayBufferView>
|
||||
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
||||
| Stream,
|
||||
options?:
|
||||
| (ObjectEncodingOptions & {
|
||||
mode?: Mode | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
mode?: Mode | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
| BufferEncoding
|
||||
| null
|
||||
| null,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Asynchronously append data to a file, creating the file if it does not yet
|
||||
@@ -902,7 +1019,11 @@ declare module 'fs/promises' {
|
||||
* @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<void>;
|
||||
function appendFile(
|
||||
path: PathLike | FileHandle,
|
||||
data: string | Uint8Array,
|
||||
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file.
|
||||
*
|
||||
@@ -916,11 +1037,25 @@ declare module 'fs/promises' {
|
||||
* 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 'fs/promises';
|
||||
* import { readFile } from 'node:fs/promises';
|
||||
*
|
||||
* try {
|
||||
* const controller = new AbortController();
|
||||
@@ -949,10 +1084,10 @@ declare module 'fs/promises' {
|
||||
path: PathLike | FileHandle,
|
||||
options?:
|
||||
| ({
|
||||
encoding?: null | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
| null
|
||||
encoding?: null | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
| null,
|
||||
): Promise<Buffer>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file.
|
||||
@@ -965,10 +1100,10 @@ declare module 'fs/promises' {
|
||||
path: PathLike | FileHandle,
|
||||
options:
|
||||
| ({
|
||||
encoding: BufferEncoding;
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
| BufferEncoding
|
||||
encoding: BufferEncoding;
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
| BufferEncoding,
|
||||
): Promise<string>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file.
|
||||
@@ -980,12 +1115,15 @@ declare module 'fs/promises' {
|
||||
function readFile(
|
||||
path: PathLike | FileHandle,
|
||||
options?:
|
||||
| (ObjectEncodingOptions &
|
||||
Abortable & {
|
||||
flag?: OpenMode | undefined;
|
||||
})
|
||||
| (
|
||||
& ObjectEncodingOptions
|
||||
& Abortable
|
||||
& {
|
||||
flag?: OpenMode | undefined;
|
||||
}
|
||||
)
|
||||
| BufferEncoding
|
||||
| null
|
||||
| null,
|
||||
): Promise<string | Buffer>;
|
||||
/**
|
||||
* 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.
|
||||
@@ -999,7 +1137,7 @@ declare module 'fs/promises' {
|
||||
* Example using async iteration:
|
||||
*
|
||||
* ```js
|
||||
* import { opendir } from 'fs/promises';
|
||||
* import { opendir } from 'node:fs/promises';
|
||||
*
|
||||
* try {
|
||||
* const dir = await opendir('./');
|
||||
@@ -1020,7 +1158,7 @@ declare module 'fs/promises' {
|
||||
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
||||
*
|
||||
* ```js
|
||||
* const { watch } = require('fs/promises');
|
||||
* const { watch } = require('node:fs/promises');
|
||||
*
|
||||
* const ac = new AbortController();
|
||||
* const { signal } = ac;
|
||||
@@ -1043,16 +1181,16 @@ declare module 'fs/promises' {
|
||||
* disappears in the directory.
|
||||
*
|
||||
* All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
|
||||
* @since v15.9.0
|
||||
* @since v15.9.0, v14.18.0
|
||||
* @return of objects with the properties:
|
||||
*/
|
||||
function watch(
|
||||
filename: PathLike,
|
||||
options:
|
||||
| (WatchOptions & {
|
||||
encoding: 'buffer';
|
||||
})
|
||||
| 'buffer'
|
||||
encoding: "buffer";
|
||||
})
|
||||
| "buffer",
|
||||
): AsyncIterable<FileChangeInfo<Buffer>>;
|
||||
/**
|
||||
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
||||
@@ -1071,7 +1209,10 @@ declare module 'fs/promises' {
|
||||
* 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<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
||||
function watch(
|
||||
filename: PathLike,
|
||||
options: WatchOptions | string,
|
||||
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
||||
/**
|
||||
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
||||
* including subdirectories and files.
|
||||
@@ -1084,8 +1225,8 @@ declare module 'fs/promises' {
|
||||
* @param dest destination path to copy to.
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
function cp(source: string, destination: string, opts?: CopyOptions): Promise<void>;
|
||||
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
||||
}
|
||||
declare module 'node:fs/promises' {
|
||||
export * from 'fs/promises';
|
||||
declare module "node:fs/promises" {
|
||||
export * from "fs/promises";
|
||||
}
|
||||
|
||||
157
node_modules/@types/node/globals.d.ts
generated
vendored
Executable file → Normal file
157
node_modules/@types/node/globals.d.ts
generated
vendored
Executable file → Normal file
@@ -20,9 +20,9 @@ interface ErrorConstructor {
|
||||
------------------------------------------------*/
|
||||
|
||||
// For backwards compability
|
||||
interface NodeRequire extends NodeJS.Require { }
|
||||
interface RequireResolve extends NodeJS.RequireResolve { }
|
||||
interface NodeModule extends NodeJS.Module { }
|
||||
interface NodeRequire extends NodeJS.Require {}
|
||||
interface RequireResolve extends NodeJS.RequireResolve {}
|
||||
interface NodeModule extends NodeJS.Module {}
|
||||
|
||||
declare var process: NodeJS.Process;
|
||||
declare var console: Console;
|
||||
@@ -41,7 +41,7 @@ declare var exports: any;
|
||||
*/
|
||||
declare var gc: undefined | (() => void);
|
||||
|
||||
//#region borrowed
|
||||
// #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 {
|
||||
@@ -53,30 +53,58 @@ interface AbortController {
|
||||
/**
|
||||
* 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(): void;
|
||||
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 {
|
||||
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: {
|
||||
prototype: AbortController;
|
||||
new(): AbortController;
|
||||
};
|
||||
declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
||||
: {
|
||||
prototype: AbortController;
|
||||
new(): AbortController;
|
||||
};
|
||||
|
||||
declare var AbortSignal: {
|
||||
prototype: AbortSignal;
|
||||
new(): AbortSignal;
|
||||
// TODO: Add abort() static
|
||||
};
|
||||
//#endregion borrowed
|
||||
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 ArrayLike.at()
|
||||
// #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<void>;
|
||||
}
|
||||
// #endregion Disposable
|
||||
|
||||
// #region ArrayLike.at()
|
||||
interface RelativeIndexable<T> {
|
||||
/**
|
||||
* Takes an integer value and returns the item at that index,
|
||||
@@ -87,6 +115,7 @@ interface RelativeIndexable<T> {
|
||||
}
|
||||
interface String extends RelativeIndexable<string> {}
|
||||
interface Array<T> extends RelativeIndexable<T> {}
|
||||
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
||||
interface Int8Array extends RelativeIndexable<number> {}
|
||||
interface Uint8Array extends RelativeIndexable<number> {}
|
||||
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
||||
@@ -98,7 +127,17 @@ interface Float32Array extends RelativeIndexable<number> {}
|
||||
interface Float64Array extends RelativeIndexable<number> {}
|
||||
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
||||
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
||||
//#endregion ArrayLike.at() end
|
||||
// #endregion ArrayLike.at() end
|
||||
|
||||
/**
|
||||
* @since v17.0.0
|
||||
*
|
||||
* Creates a deep clone of an object.
|
||||
*/
|
||||
declare function structuredClone<T>(
|
||||
value: T,
|
||||
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
||||
): T;
|
||||
|
||||
/*----------------------------------------------*
|
||||
* *
|
||||
@@ -141,7 +180,7 @@ declare namespace NodeJS {
|
||||
/**
|
||||
* Name of the script [if this function was defined in a script]
|
||||
*/
|
||||
getFileName(): string | null;
|
||||
getFileName(): string | undefined;
|
||||
|
||||
/**
|
||||
* Current line number [if this function was defined in a script]
|
||||
@@ -194,7 +233,7 @@ declare namespace NodeJS {
|
||||
pause(): this;
|
||||
resume(): this;
|
||||
isPaused(): boolean;
|
||||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
|
||||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
||||
unpipe(destination?: WritableStream): this;
|
||||
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
||||
wrap(oldStream: ReadableStream): this;
|
||||
@@ -205,12 +244,12 @@ declare namespace NodeJS {
|
||||
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): void;
|
||||
end(data: string | Uint8Array, cb?: () => void): void;
|
||||
end(str: string, encoding?: BufferEncoding, cb?: () => void): void;
|
||||
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 ReadWriteStream extends ReadableStream, WritableStream {}
|
||||
|
||||
interface RefCounted {
|
||||
ref(): this;
|
||||
@@ -243,14 +282,14 @@ declare namespace NodeJS {
|
||||
}
|
||||
|
||||
interface RequireResolve {
|
||||
(id: string, options?: { paths?: string[] | undefined; }): string;
|
||||
(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;
|
||||
".js": (m: Module, filename: string) => any;
|
||||
".json": (m: Module, filename: string) => any;
|
||||
".node": (m: Module, filename: string) => any;
|
||||
}
|
||||
interface Module {
|
||||
/**
|
||||
@@ -262,11 +301,11 @@ declare namespace NodeJS {
|
||||
id: string;
|
||||
filename: string;
|
||||
loaded: boolean;
|
||||
/** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */
|
||||
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
|
||||
parent: Module | null | undefined;
|
||||
children: Module[];
|
||||
/**
|
||||
* @since 11.14.0
|
||||
* @since v11.14.0
|
||||
*
|
||||
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
||||
*/
|
||||
@@ -281,4 +320,62 @@ declare namespace NodeJS {
|
||||
interface ReadOnlyDict<T> {
|
||||
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<Response>;
|
||||
|
||||
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;
|
||||
|
||||
0
node_modules/@types/node/globals.global.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@types/node/globals.global.d.ts
generated
vendored
Executable file → Normal file
1065
node_modules/@types/node/http.d.ts
generated
vendored
Executable file → Normal file
1065
node_modules/@types/node/http.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1133
node_modules/@types/node/http2.d.ts
generated
vendored
Executable file → Normal file
1133
node_modules/@types/node/http2.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
423
node_modules/@types/node/https.d.ts
generated
vendored
Executable file → Normal file
423
node_modules/@types/node/https.d.ts
generated
vendored
Executable file → Normal file
@@ -1,16 +1,22 @@
|
||||
/**
|
||||
* 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/v16.9.0/lib/https.js)
|
||||
* @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 = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
|
||||
type RequestOptions = http.RequestOptions &
|
||||
tls.SecureContextOptions & {
|
||||
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<Request, Response>;
|
||||
type RequestOptions =
|
||||
& http.RequestOptions
|
||||
& tls.SecureContextOptions
|
||||
& {
|
||||
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
|
||||
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
||||
servername?: string | undefined; // SNI TLS Extension
|
||||
};
|
||||
@@ -26,126 +32,256 @@ declare module 'https' {
|
||||
constructor(options?: AgentOptions);
|
||||
options: AgentOptions;
|
||||
}
|
||||
interface Server extends http.Server {}
|
||||
interface Server<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
> extends http.Server<Request, Response> {}
|
||||
/**
|
||||
* See `http.Server` for more information.
|
||||
* @since v0.3.4
|
||||
*/
|
||||
class Server extends tls.Server {
|
||||
constructor(requestListener?: http.RequestListener);
|
||||
constructor(options: ServerOptions, requestListener?: http.RequestListener);
|
||||
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<Request, Response>);
|
||||
constructor(
|
||||
options: ServerOptions<Request, Response>,
|
||||
requestListener?: http.RequestListener<Request, Response>,
|
||||
);
|
||||
/**
|
||||
* 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: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||
addListener(event: 'request', listener: http.RequestListener): this;
|
||||
addListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => 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<Request, Response>): this;
|
||||
addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
addListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
): this;
|
||||
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
addListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, 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: http.IncomingMessage, res: http.ServerResponse): boolean;
|
||||
emit(event: 'checkExpectation', req: http.IncomingMessage, res: http.ServerResponse): boolean;
|
||||
emit(event: 'clientError', err: Error, socket: Duplex): boolean;
|
||||
emit(event: 'connect', req: http.IncomingMessage, socket: Duplex, head: Buffer): boolean;
|
||||
emit(event: 'request', req: http.IncomingMessage, res: http.ServerResponse): boolean;
|
||||
emit(event: 'upgrade', req: http.IncomingMessage, socket: Duplex, head: Buffer): 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<Request>,
|
||||
res: InstanceType<Response> & {
|
||||
req: InstanceType<Request>;
|
||||
},
|
||||
): boolean;
|
||||
emit(
|
||||
event: "checkExpectation",
|
||||
req: InstanceType<Request>,
|
||||
res: InstanceType<Response> & {
|
||||
req: InstanceType<Request>;
|
||||
},
|
||||
): boolean;
|
||||
emit(event: "clientError", err: Error, socket: Duplex): boolean;
|
||||
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
||||
emit(
|
||||
event: "request",
|
||||
req: InstanceType<Request>,
|
||||
res: InstanceType<Response> & {
|
||||
req: InstanceType<Request>;
|
||||
},
|
||||
): boolean;
|
||||
emit(event: "upgrade", req: InstanceType<Request>, 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: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||
on(event: 'request', listener: http.RequestListener): this;
|
||||
on(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => 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<Request, Response>): this;
|
||||
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
||||
on(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
on(event: "upgrade", listener: (req: InstanceType<Request>, 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: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||
once(event: 'request', listener: http.RequestListener): this;
|
||||
once(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => 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<Request, Response>): this;
|
||||
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
||||
once(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
once(event: "upgrade", listener: (req: InstanceType<Request>, 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: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||
prependListener(event: 'request', listener: http.RequestListener): this;
|
||||
prependListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => 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<Request, Response>): this;
|
||||
prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
prependListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
): this;
|
||||
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
prependListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, 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: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||
prependOnceListener(event: 'request', listener: http.RequestListener): this;
|
||||
prependOnceListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => 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<Request, Response>): this;
|
||||
prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
prependOnceListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
prependOnceListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
): this;
|
||||
}
|
||||
/**
|
||||
* ```js
|
||||
* // curl -k https://localhost:8000/
|
||||
* const https = require('https');
|
||||
* const fs = require('fs');
|
||||
* 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')
|
||||
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
||||
* };
|
||||
*
|
||||
* https.createServer(options, (req, res) => {
|
||||
@@ -157,12 +293,12 @@ declare module 'https' {
|
||||
* Or
|
||||
*
|
||||
* ```js
|
||||
* const https = require('https');
|
||||
* const fs = require('fs');
|
||||
* const https = require('node:https');
|
||||
* const fs = require('node:fs');
|
||||
*
|
||||
* const options = {
|
||||
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
||||
* passphrase: 'sample'
|
||||
* passphrase: 'sample',
|
||||
* };
|
||||
*
|
||||
* https.createServer(options, (req, res) => {
|
||||
@@ -174,8 +310,17 @@ declare module 'https' {
|
||||
* @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
|
||||
* @param requestListener A listener to be added to the `'request'` event.
|
||||
*/
|
||||
function createServer(requestListener?: http.RequestListener): Server;
|
||||
function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
|
||||
function createServer<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
>(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
|
||||
function createServer<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
>(
|
||||
options: ServerOptions<Request, Response>,
|
||||
requestListener?: http.RequestListener<Request, Response>,
|
||||
): Server<Request, Response>;
|
||||
/**
|
||||
* Makes a request to a secure web server.
|
||||
*
|
||||
@@ -189,13 +334,13 @@ declare module 'https' {
|
||||
* upload a file with a POST request, then write to the `ClientRequest` object.
|
||||
*
|
||||
* ```js
|
||||
* const https = require('https');
|
||||
* const https = require('node:https');
|
||||
*
|
||||
* const options = {
|
||||
* hostname: 'encrypted.google.com',
|
||||
* port: 443,
|
||||
* path: '/',
|
||||
* method: 'GET'
|
||||
* method: 'GET',
|
||||
* };
|
||||
*
|
||||
* const req = https.request(options, (res) => {
|
||||
@@ -222,7 +367,7 @@ declare module 'https' {
|
||||
* path: '/',
|
||||
* method: 'GET',
|
||||
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
||||
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
|
||||
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
||||
* };
|
||||
* options.agent = new https.Agent(options);
|
||||
*
|
||||
@@ -241,7 +386,7 @@ declare module 'https' {
|
||||
* method: 'GET',
|
||||
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
||||
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
||||
* agent: false
|
||||
* agent: false,
|
||||
* };
|
||||
*
|
||||
* const req = https.request(options, (res) => {
|
||||
@@ -262,9 +407,9 @@ declare module 'https' {
|
||||
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
||||
*
|
||||
* ```js
|
||||
* const tls = require('tls');
|
||||
* const https = require('https');
|
||||
* const crypto = require('crypto');
|
||||
* 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');
|
||||
@@ -281,7 +426,7 @@ declare module 'https' {
|
||||
* return err;
|
||||
* }
|
||||
*
|
||||
* // Pin the public key, similar to HPKP pin-sha25 pinning
|
||||
* // 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: ' +
|
||||
@@ -356,8 +501,15 @@ declare module 'https' {
|
||||
* @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;
|
||||
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.
|
||||
*
|
||||
@@ -365,7 +517,7 @@ declare module 'https' {
|
||||
* 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('https');
|
||||
* const https = require('node:https');
|
||||
*
|
||||
* https.get('https://encrypted.google.com/', (res) => {
|
||||
* console.log('statusCode:', res.statusCode);
|
||||
@@ -382,10 +534,17 @@ declare module 'https' {
|
||||
* @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;
|
||||
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';
|
||||
declare module "node:https" {
|
||||
export * from "https";
|
||||
}
|
||||
|
||||
50
node_modules/@types/node/index.d.ts
generated
vendored
Executable file → Normal file
50
node_modules/@types/node/index.d.ts
generated
vendored
Executable file → Normal file
@@ -1,48 +1,3 @@
|
||||
// Type definitions for non-npm package Node.js 16.11
|
||||
// Project: https://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
||||
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
||||
// 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>
|
||||
// Seth Westphal <https://github.com/westy92>
|
||||
// Simon Schick <https://github.com/SimonSchick>
|
||||
// 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>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* License for programmatically and manually incorporated
|
||||
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
|
||||
@@ -67,7 +22,7 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.7+.
|
||||
// NOTE: These definitions support NodeJS and TypeScript 4.9+.
|
||||
|
||||
// Reference required types from the default lib:
|
||||
/// <reference lib="es2020" />
|
||||
@@ -92,6 +47,7 @@
|
||||
/// <reference path="dns/promises.d.ts" />
|
||||
/// <reference path="dns/promises.d.ts" />
|
||||
/// <reference path="domain.d.ts" />
|
||||
/// <reference path="dom-events.d.ts" />
|
||||
/// <reference path="events.d.ts" />
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="fs/promises.d.ts" />
|
||||
@@ -108,12 +64,14 @@
|
||||
/// <reference path="punycode.d.ts" />
|
||||
/// <reference path="querystring.d.ts" />
|
||||
/// <reference path="readline.d.ts" />
|
||||
/// <reference path="readline/promises.d.ts" />
|
||||
/// <reference path="repl.d.ts" />
|
||||
/// <reference path="stream.d.ts" />
|
||||
/// <reference path="stream/promises.d.ts" />
|
||||
/// <reference path="stream/consumers.d.ts" />
|
||||
/// <reference path="stream/web.d.ts" />
|
||||
/// <reference path="string_decoder.d.ts" />
|
||||
/// <reference path="test.d.ts" />
|
||||
/// <reference path="timers.d.ts" />
|
||||
/// <reference path="timers/promises.d.ts" />
|
||||
/// <reference path="tls.d.ts" />
|
||||
|
||||
40
node_modules/@types/node/inspector.d.ts
generated
vendored
Executable file → Normal file
40
node_modules/@types/node/inspector.d.ts
generated
vendored
Executable file → Normal file
@@ -1,21 +1,26 @@
|
||||
// tslint:disable-next-line:dt-header
|
||||
// Type definitions for inspector
|
||||
|
||||
// These definitions are auto-generated.
|
||||
// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
|
||||
// for more information.
|
||||
|
||||
// tslint:disable:max-line-length
|
||||
|
||||
/**
|
||||
* The `inspector` module provides an API for interacting with the V8 inspector.
|
||||
* The `node:inspector` module provides an API for interacting with the V8
|
||||
* inspector.
|
||||
*
|
||||
* It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const inspector = require('inspector');
|
||||
* import * as inspector from 'node:inspector/promises';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/inspector.js)
|
||||
*
|
||||
* 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');
|
||||
@@ -1688,7 +1693,7 @@ declare module 'inspector' {
|
||||
/**
|
||||
* Controls how the trace buffer stores data.
|
||||
*/
|
||||
recordMode?: string;
|
||||
recordMode?: string | undefined;
|
||||
/**
|
||||
* Included category filters.
|
||||
*/
|
||||
@@ -1778,13 +1783,6 @@ declare module 'inspector' {
|
||||
* @since v8.0.0
|
||||
*/
|
||||
connect(): void;
|
||||
/**
|
||||
* Connects a session to the main thread inspector back-end.
|
||||
* An exception will be thrown if this API was not called on a Worker
|
||||
* thread.
|
||||
* @since 12.11.0
|
||||
*/
|
||||
connectToMainThread(): 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
|
||||
@@ -2696,7 +2694,7 @@ 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
|
||||
@@ -2706,8 +2704,9 @@ declare module 'inspector' {
|
||||
* @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): void;
|
||||
function open(port?: number, host?: string, wait?: boolean): Disposable;
|
||||
/**
|
||||
* Deactivate the inspector. Blocks until there are no active connections.
|
||||
*/
|
||||
@@ -2718,12 +2717,12 @@ declare module 'inspector' {
|
||||
* ```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
|
||||
* 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
|
||||
* For help, see: https://nodejs.org/en/docs/inspector
|
||||
* ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
|
||||
*
|
||||
* $ node -p 'inspector.url()'
|
||||
@@ -2739,7 +2738,10 @@ declare module 'inspector' {
|
||||
*/
|
||||
function waitForDebugger(): void;
|
||||
}
|
||||
/**
|
||||
* The inspector module provides an API for interacting with the V8 inspector.
|
||||
*/
|
||||
declare module 'node:inspector' {
|
||||
import EventEmitter = require('inspector');
|
||||
export = EventEmitter;
|
||||
import inspector = require('inspector');
|
||||
export = inspector;
|
||||
}
|
||||
|
||||
219
node_modules/@types/node/module.d.ts
generated
vendored
Executable file → Normal file
219
node_modules/@types/node/module.d.ts
generated
vendored
Executable file → Normal file
@@ -1,8 +1,10 @@
|
||||
/**
|
||||
* @since v0.3.7
|
||||
* @experimental
|
||||
*/
|
||||
declare module 'module' {
|
||||
import { URL } from 'node:url';
|
||||
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
|
||||
@@ -10,9 +12,9 @@ declare module 'module' {
|
||||
* does not add or remove exported names from the `ES Modules`.
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const assert = require('assert');
|
||||
* const { syncBuiltinESMExports } = require('module');
|
||||
* const fs = require('node:fs');
|
||||
* const assert = require('node:assert');
|
||||
* const { syncBuiltinESMExports } = require('node:module');
|
||||
*
|
||||
* fs.readFile = newAPI;
|
||||
*
|
||||
@@ -26,7 +28,7 @@ declare module 'module' {
|
||||
*
|
||||
* syncBuiltinESMExports();
|
||||
*
|
||||
* import('fs').then((esmFS) => {
|
||||
* 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
|
||||
@@ -44,6 +46,7 @@ declare module 'module' {
|
||||
* `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 {
|
||||
@@ -62,6 +65,24 @@ declare module 'module' {
|
||||
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
|
||||
*/
|
||||
@@ -72,12 +93,156 @@ declare module 'module' {
|
||||
readonly payload: SourceMapPayload;
|
||||
constructor(payload: SourceMapPayload);
|
||||
/**
|
||||
* Given a line number and column number in the generated source file, returns
|
||||
* an object representing the position in the original file. The object returned
|
||||
* consists of the following keys:
|
||||
* 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(line: number, column: number): SourceMapping;
|
||||
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<string> {
|
||||
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 = any> = (data: Data) => void | Promise<void>;
|
||||
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>,
|
||||
) => ResolveFnOutput | Promise<ResolveFnOutput>;
|
||||
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>,
|
||||
) => LoadFnOutput | Promise<LoadFnOutput>;
|
||||
}
|
||||
interface RegisterOptions<Data> {
|
||||
parentURL: string | URL;
|
||||
data?: Data | undefined;
|
||||
transferList?: any[] | undefined;
|
||||
}
|
||||
interface Module extends NodeModule {}
|
||||
class Module {
|
||||
@@ -85,30 +250,48 @@ declare module 'module' {
|
||||
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<Data = any>(
|
||||
specifier: string | URL,
|
||||
parentURL?: string | URL,
|
||||
options?: RegisterOptions<Data>,
|
||||
): void;
|
||||
static register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
|
||||
constructor(id: string, parent?: Module);
|
||||
}
|
||||
global {
|
||||
interface ImportMeta {
|
||||
url: string;
|
||||
/**
|
||||
* @experimental
|
||||
* This feature is only available with the `--experimental-import-meta-resolve`
|
||||
* Provides a module-relative resolution function scoped to each module, returning
|
||||
* the URL string.
|
||||
*
|
||||
* @since v20.6.0
|
||||
*
|
||||
* @param specifier The module specifier to resolve relative to the current module.
|
||||
* @returns The absolute (`file:`) URL string for the resolved module.
|
||||
*/
|
||||
resolve(specifier: string): string;
|
||||
/**
|
||||
* This `parent` parameter is only used when the `--experimental-import-meta-resolve`
|
||||
* command flag enabled.
|
||||
*
|
||||
* Provides a module-relative resolution function scoped to each module, returning
|
||||
* the URL string.
|
||||
*
|
||||
* @param specified The module specifier to resolve relative to `parent`.
|
||||
* @param parent The absolute parent module URL to resolve from. If none
|
||||
* is specified, the value of `import.meta.url` is used as the default.
|
||||
* @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?(specified: string, parent?: string | URL): Promise<string>;
|
||||
resolve(specifier: string, parent: string | URL): string;
|
||||
}
|
||||
}
|
||||
export = Module;
|
||||
}
|
||||
declare module 'node:module' {
|
||||
import module = require('module');
|
||||
declare module "node:module" {
|
||||
import module = require("module");
|
||||
export = module;
|
||||
}
|
||||
|
||||
403
node_modules/@types/node/net.d.ts
generated
vendored
Executable file → Normal file
403
node_modules/@types/node/net.d.ts
generated
vendored
Executable file → Normal file
@@ -1,22 +1,26 @@
|
||||
/**
|
||||
* > Stability: 2 - Stable
|
||||
*
|
||||
* The `net` module provides an asynchronous network API for creating stream-based
|
||||
* 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('net');
|
||||
* const net = require('node:net');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/net.js)
|
||||
* @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.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
|
||||
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;
|
||||
@@ -54,11 +58,23 @@ declare module 'net' {
|
||||
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
|
||||
@@ -75,6 +91,12 @@ declare module 'net' {
|
||||
*/
|
||||
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.
|
||||
@@ -127,6 +149,14 @@ declare module 'net' {
|
||||
* @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.
|
||||
@@ -204,12 +234,21 @@ declare module 'net' {
|
||||
*/
|
||||
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).
|
||||
* 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
|
||||
@@ -246,6 +285,12 @@ declare module 'net' {
|
||||
* @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.
|
||||
*/
|
||||
@@ -262,6 +307,21 @@ declare module 'net' {
|
||||
* @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).
|
||||
@@ -269,15 +329,23 @@ declare module 'net' {
|
||||
*/
|
||||
readonly remoteAddress?: string | undefined;
|
||||
/**
|
||||
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`.
|
||||
* 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`.
|
||||
* 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.
|
||||
@@ -288,9 +356,9 @@ declare module 'net' {
|
||||
* @param callback Optional callback for when the socket is finished.
|
||||
* @return The socket itself.
|
||||
*/
|
||||
end(callback?: () => void): void;
|
||||
end(buffer: Uint8Array | string, callback?: () => void): void;
|
||||
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): void;
|
||||
end(callback?: () => void): this;
|
||||
end(buffer: Uint8Array | string, callback?: () => void): this;
|
||||
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close
|
||||
@@ -300,68 +368,84 @@ declare module 'net' {
|
||||
* 5. end
|
||||
* 6. error
|
||||
* 7. lookup
|
||||
* 8. timeout
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -387,6 +471,33 @@ declare module 'net' {
|
||||
* @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.
|
||||
@@ -427,7 +538,7 @@ declare module 'net' {
|
||||
* ```js
|
||||
* server.on('error', (e) => {
|
||||
* if (e.code === 'EADDRINUSE') {
|
||||
* console.log('Address in use, retrying...');
|
||||
* console.error('Address in use, retrying...');
|
||||
* setTimeout(() => {
|
||||
* server.close();
|
||||
* server.listen(PORT, HOST);
|
||||
@@ -492,7 +603,7 @@ declare module 'net' {
|
||||
*/
|
||||
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).
|
||||
* 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
|
||||
*/
|
||||
@@ -524,49 +635,61 @@ declare module 'net' {
|
||||
* 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: "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: "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: "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: "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: "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: "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<void>;
|
||||
}
|
||||
type IPVersion = 'ipv4' | 'ipv6';
|
||||
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
|
||||
* @since v15.0.0, v14.18.0
|
||||
*/
|
||||
class BlockList {
|
||||
/**
|
||||
* Adds a rule to block the given IP address.
|
||||
* @since v15.0.0
|
||||
* @since v15.0.0, v14.18.0
|
||||
* @param address An IPv4 or IPv6 address.
|
||||
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
||||
*/
|
||||
@@ -574,7 +697,7 @@ declare module 'net' {
|
||||
addAddress(address: SocketAddress): void;
|
||||
/**
|
||||
* Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
|
||||
* @since v15.0.0
|
||||
* @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'`.
|
||||
@@ -583,7 +706,7 @@ declare module 'net' {
|
||||
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
|
||||
* @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'`.
|
||||
@@ -607,7 +730,7 @@ declare module 'net' {
|
||||
* 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
|
||||
* @since v15.0.0, v14.18.0
|
||||
* @param address The IP address to check
|
||||
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
||||
*/
|
||||
@@ -638,11 +761,11 @@ declare module 'net' {
|
||||
*
|
||||
* The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
|
||||
*
|
||||
* Here is an example of an TCP echo server which listens for connections
|
||||
* Here is an example of a TCP echo server which listens for connections
|
||||
* on port 8124:
|
||||
*
|
||||
* ```js
|
||||
* const net = require('net');
|
||||
* const net = require('node:net');
|
||||
* const server = net.createServer((c) => {
|
||||
* // 'connection' listener.
|
||||
* console.log('client connected');
|
||||
@@ -662,8 +785,8 @@ declare module 'net' {
|
||||
*
|
||||
* Test this by using `telnet`:
|
||||
*
|
||||
* ```console
|
||||
* $ telnet localhost 8124
|
||||
* ```bash
|
||||
* telnet localhost 8124
|
||||
* ```
|
||||
*
|
||||
* To listen on the socket `/tmp/echo.sock`:
|
||||
@@ -676,8 +799,8 @@ declare module 'net' {
|
||||
*
|
||||
* Use `nc` to connect to a Unix domain socket server:
|
||||
*
|
||||
* ```console
|
||||
* $ nc -U /tmp/echo.sock
|
||||
* ```bash
|
||||
* nc -U /tmp/echo.sock
|
||||
* ```
|
||||
* @since v0.5.0
|
||||
* @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
|
||||
@@ -717,19 +840,61 @@ declare module 'net' {
|
||||
function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
|
||||
function createConnection(path: string, connectionListener?: () => void): Socket;
|
||||
/**
|
||||
* Tests if input is an IP address. Returns `0` for invalid strings,
|
||||
* returns `4` for IP version 4 addresses, and returns `6` for IP version 6
|
||||
* addresses.
|
||||
* 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 a version 4 IP address, otherwise returns `false`.
|
||||
* 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 a version 6 IP address, otherwise returns `false`.
|
||||
* 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;
|
||||
@@ -755,30 +920,30 @@ declare module 'net' {
|
||||
port?: number | undefined;
|
||||
}
|
||||
/**
|
||||
* @since v15.14.0
|
||||
* @since v15.14.0, v14.18.0
|
||||
*/
|
||||
class SocketAddress {
|
||||
constructor(options: SocketAddressInitOptions);
|
||||
/**
|
||||
* Either \`'ipv4'\` or \`'ipv6'\`.
|
||||
* @since v15.14.0
|
||||
* @since v15.14.0, v14.18.0
|
||||
*/
|
||||
readonly address: string;
|
||||
/**
|
||||
* Either \`'ipv4'\` or \`'ipv6'\`.
|
||||
* @since v15.14.0
|
||||
* @since v15.14.0, v14.18.0
|
||||
*/
|
||||
readonly family: IPVersion;
|
||||
/**
|
||||
* @since v15.14.0
|
||||
* @since v15.14.0, v14.18.0
|
||||
*/
|
||||
readonly port: number;
|
||||
/**
|
||||
* @since v15.14.0
|
||||
* @since v15.14.0, v14.18.0
|
||||
*/
|
||||
readonly flowlabel: number;
|
||||
}
|
||||
}
|
||||
declare module 'node:net' {
|
||||
export * from 'net';
|
||||
declare module "node:net" {
|
||||
export * from "net";
|
||||
}
|
||||
|
||||
66
node_modules/@types/node/os.d.ts
generated
vendored
Executable file → Normal file
66
node_modules/@types/node/os.d.ts
generated
vendored
Executable file → Normal file
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* The `os` module provides operating system-related utility methods and
|
||||
* The `node:os` module provides operating system-related utility methods and
|
||||
* properties. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const os = require('os');
|
||||
* const os = require('node:os');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/os.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js)
|
||||
*/
|
||||
declare module 'os' {
|
||||
declare module "os" {
|
||||
interface CpuInfo {
|
||||
model: string;
|
||||
speed: number;
|
||||
@@ -27,17 +27,18 @@ declare module 'os' {
|
||||
cidr: string | null;
|
||||
}
|
||||
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
||||
family: 'IPv4';
|
||||
family: "IPv4";
|
||||
scopeid?: undefined;
|
||||
}
|
||||
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
||||
family: 'IPv6';
|
||||
family: "IPv6";
|
||||
scopeid: number;
|
||||
}
|
||||
interface UserInfo<T> {
|
||||
username: T;
|
||||
uid: number;
|
||||
gid: number;
|
||||
shell: T;
|
||||
shell: T | null;
|
||||
homedir: T;
|
||||
}
|
||||
type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
|
||||
@@ -74,6 +75,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 properties included on each object include:
|
||||
*
|
||||
@@ -87,8 +89,8 @@ declare module 'os' {
|
||||
* nice: 0,
|
||||
* sys: 30340,
|
||||
* idle: 1070356870,
|
||||
* irq: 0
|
||||
* }
|
||||
* irq: 0,
|
||||
* },
|
||||
* },
|
||||
* {
|
||||
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
||||
@@ -98,8 +100,8 @@ declare module 'os' {
|
||||
* nice: 0,
|
||||
* sys: 26980,
|
||||
* idle: 1071569080,
|
||||
* irq: 0
|
||||
* }
|
||||
* irq: 0,
|
||||
* },
|
||||
* },
|
||||
* {
|
||||
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
||||
@@ -109,8 +111,8 @@ declare module 'os' {
|
||||
* nice: 0,
|
||||
* sys: 21750,
|
||||
* idle: 1070919370,
|
||||
* irq: 0
|
||||
* }
|
||||
* irq: 0,
|
||||
* },
|
||||
* },
|
||||
* {
|
||||
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
||||
@@ -120,17 +122,28 @@ declare module 'os' {
|
||||
* nice: 0,
|
||||
* sys: 19430,
|
||||
* idle: 1070905480,
|
||||
* irq: 20
|
||||
* }
|
||||
* 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.
|
||||
@@ -226,7 +239,7 @@ declare module 'os' {
|
||||
* Throws a `SystemError` if a user has no `username` or `homedir`.
|
||||
* @since v6.0.0
|
||||
*/
|
||||
function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
|
||||
function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
|
||||
function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
|
||||
type SignalConstants = {
|
||||
[key in NodeJS.Signals]: number;
|
||||
@@ -387,7 +400,7 @@ declare module 'os' {
|
||||
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'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`.
|
||||
* 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
|
||||
@@ -402,8 +415,9 @@ declare module 'os' {
|
||||
*/
|
||||
function version(): string;
|
||||
/**
|
||||
* Returns a string identifying the operating system platform. The value is set
|
||||
* at compile time. Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`.
|
||||
* 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`.
|
||||
*
|
||||
@@ -412,6 +426,14 @@ declare module '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.
|
||||
@@ -425,7 +447,7 @@ declare module 'os' {
|
||||
* Possible values are `'BE'` for big endian and `'LE'` for little endian.
|
||||
* @since v0.9.4
|
||||
*/
|
||||
function endianness(): 'BE' | 'LE';
|
||||
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.
|
||||
@@ -450,6 +472,6 @@ declare module 'os' {
|
||||
function setPriority(priority: number): void;
|
||||
function setPriority(pid: number, priority: number): void;
|
||||
}
|
||||
declare module 'node:os' {
|
||||
export * from 'os';
|
||||
declare module "node:os" {
|
||||
export * from "os";
|
||||
}
|
||||
|
||||
197
node_modules/@types/node/package.json
generated
vendored
Executable file → Normal file
197
node_modules/@types/node/package.json
generated
vendored
Executable file → Normal file
@@ -1,225 +1,230 @@
|
||||
{
|
||||
"name": "@types/node",
|
||||
"version": "16.11.22",
|
||||
"description": "TypeScript definitions for Node.js",
|
||||
"version": "20.9.0",
|
||||
"description": "TypeScript definitions for node",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Microsoft TypeScript",
|
||||
"url": "https://github.com/Microsoft",
|
||||
"githubUsername": "Microsoft"
|
||||
},
|
||||
{
|
||||
"name": "DefinitelyTyped",
|
||||
"url": "https://github.com/DefinitelyTyped",
|
||||
"githubUsername": "DefinitelyTyped"
|
||||
"githubUsername": "Microsoft",
|
||||
"url": "https://github.com/Microsoft"
|
||||
},
|
||||
{
|
||||
"name": "Alberto Schiabel",
|
||||
"url": "https://github.com/jkomyno",
|
||||
"githubUsername": "jkomyno"
|
||||
"githubUsername": "jkomyno",
|
||||
"url": "https://github.com/jkomyno"
|
||||
},
|
||||
{
|
||||
"name": "Alvis HT Tang",
|
||||
"url": "https://github.com/alvis",
|
||||
"githubUsername": "alvis"
|
||||
"githubUsername": "alvis",
|
||||
"url": "https://github.com/alvis"
|
||||
},
|
||||
{
|
||||
"name": "Andrew Makarov",
|
||||
"url": "https://github.com/r3nya",
|
||||
"githubUsername": "r3nya"
|
||||
"githubUsername": "r3nya",
|
||||
"url": "https://github.com/r3nya"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Toueg",
|
||||
"url": "https://github.com/btoueg",
|
||||
"githubUsername": "btoueg"
|
||||
"githubUsername": "btoueg",
|
||||
"url": "https://github.com/btoueg"
|
||||
},
|
||||
{
|
||||
"name": "Chigozirim C.",
|
||||
"url": "https://github.com/smac89",
|
||||
"githubUsername": "smac89"
|
||||
"githubUsername": "smac89",
|
||||
"url": "https://github.com/smac89"
|
||||
},
|
||||
{
|
||||
"name": "David Junger",
|
||||
"url": "https://github.com/touffy",
|
||||
"githubUsername": "touffy"
|
||||
"githubUsername": "touffy",
|
||||
"url": "https://github.com/touffy"
|
||||
},
|
||||
{
|
||||
"name": "Deividas Bakanas",
|
||||
"url": "https://github.com/DeividasBakanas",
|
||||
"githubUsername": "DeividasBakanas"
|
||||
"githubUsername": "DeividasBakanas",
|
||||
"url": "https://github.com/DeividasBakanas"
|
||||
},
|
||||
{
|
||||
"name": "Eugene Y. Q. Shen",
|
||||
"url": "https://github.com/eyqs",
|
||||
"githubUsername": "eyqs"
|
||||
"githubUsername": "eyqs",
|
||||
"url": "https://github.com/eyqs"
|
||||
},
|
||||
{
|
||||
"name": "Hannes Magnusson",
|
||||
"url": "https://github.com/Hannes-Magnusson-CK",
|
||||
"githubUsername": "Hannes-Magnusson-CK"
|
||||
"githubUsername": "Hannes-Magnusson-CK",
|
||||
"url": "https://github.com/Hannes-Magnusson-CK"
|
||||
},
|
||||
{
|
||||
"name": "Huw",
|
||||
"url": "https://github.com/hoo29",
|
||||
"githubUsername": "hoo29"
|
||||
"githubUsername": "hoo29",
|
||||
"url": "https://github.com/hoo29"
|
||||
},
|
||||
{
|
||||
"name": "Kelvin Jin",
|
||||
"url": "https://github.com/kjin",
|
||||
"githubUsername": "kjin"
|
||||
"githubUsername": "kjin",
|
||||
"url": "https://github.com/kjin"
|
||||
},
|
||||
{
|
||||
"name": "Klaus Meinhardt",
|
||||
"url": "https://github.com/ajafff",
|
||||
"githubUsername": "ajafff"
|
||||
"githubUsername": "ajafff",
|
||||
"url": "https://github.com/ajafff"
|
||||
},
|
||||
{
|
||||
"name": "Lishude",
|
||||
"url": "https://github.com/islishude",
|
||||
"githubUsername": "islishude"
|
||||
"githubUsername": "islishude",
|
||||
"url": "https://github.com/islishude"
|
||||
},
|
||||
{
|
||||
"name": "Mariusz Wiktorczyk",
|
||||
"url": "https://github.com/mwiktorczyk",
|
||||
"githubUsername": "mwiktorczyk"
|
||||
"githubUsername": "mwiktorczyk",
|
||||
"url": "https://github.com/mwiktorczyk"
|
||||
},
|
||||
{
|
||||
"name": "Mohsen Azimi",
|
||||
"url": "https://github.com/mohsen1",
|
||||
"githubUsername": "mohsen1"
|
||||
"githubUsername": "mohsen1",
|
||||
"url": "https://github.com/mohsen1"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Even",
|
||||
"url": "https://github.com/n-e",
|
||||
"githubUsername": "n-e"
|
||||
"githubUsername": "n-e",
|
||||
"url": "https://github.com/n-e"
|
||||
},
|
||||
{
|
||||
"name": "Nikita Galkin",
|
||||
"url": "https://github.com/galkin",
|
||||
"githubUsername": "galkin"
|
||||
"githubUsername": "galkin",
|
||||
"url": "https://github.com/galkin"
|
||||
},
|
||||
{
|
||||
"name": "Parambir Singh",
|
||||
"url": "https://github.com/parambirs",
|
||||
"githubUsername": "parambirs"
|
||||
"githubUsername": "parambirs",
|
||||
"url": "https://github.com/parambirs"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Silbermann",
|
||||
"url": "https://github.com/eps1lon",
|
||||
"githubUsername": "eps1lon"
|
||||
},
|
||||
{
|
||||
"name": "Seth Westphal",
|
||||
"url": "https://github.com/westy92",
|
||||
"githubUsername": "westy92"
|
||||
},
|
||||
{
|
||||
"name": "Simon Schick",
|
||||
"url": "https://github.com/SimonSchick",
|
||||
"githubUsername": "SimonSchick"
|
||||
"githubUsername": "eps1lon",
|
||||
"url": "https://github.com/eps1lon"
|
||||
},
|
||||
{
|
||||
"name": "Thomas den Hollander",
|
||||
"url": "https://github.com/ThomasdenH",
|
||||
"githubUsername": "ThomasdenH"
|
||||
"githubUsername": "ThomasdenH",
|
||||
"url": "https://github.com/ThomasdenH"
|
||||
},
|
||||
{
|
||||
"name": "Wilco Bakker",
|
||||
"url": "https://github.com/WilcoBakker",
|
||||
"githubUsername": "WilcoBakker"
|
||||
"githubUsername": "WilcoBakker",
|
||||
"url": "https://github.com/WilcoBakker"
|
||||
},
|
||||
{
|
||||
"name": "wwwy3y3",
|
||||
"url": "https://github.com/wwwy3y3",
|
||||
"githubUsername": "wwwy3y3"
|
||||
"githubUsername": "wwwy3y3",
|
||||
"url": "https://github.com/wwwy3y3"
|
||||
},
|
||||
{
|
||||
"name": "Samuel Ainsworth",
|
||||
"url": "https://github.com/samuela",
|
||||
"githubUsername": "samuela"
|
||||
"githubUsername": "samuela",
|
||||
"url": "https://github.com/samuela"
|
||||
},
|
||||
{
|
||||
"name": "Kyle Uehlein",
|
||||
"url": "https://github.com/kuehlein",
|
||||
"githubUsername": "kuehlein"
|
||||
"githubUsername": "kuehlein",
|
||||
"url": "https://github.com/kuehlein"
|
||||
},
|
||||
{
|
||||
"name": "Thanik Bhongbhibhat",
|
||||
"url": "https://github.com/bhongy",
|
||||
"githubUsername": "bhongy"
|
||||
"githubUsername": "bhongy",
|
||||
"url": "https://github.com/bhongy"
|
||||
},
|
||||
{
|
||||
"name": "Marcin Kopacz",
|
||||
"url": "https://github.com/chyzwar",
|
||||
"githubUsername": "chyzwar"
|
||||
"githubUsername": "chyzwar",
|
||||
"url": "https://github.com/chyzwar"
|
||||
},
|
||||
{
|
||||
"name": "Trivikram Kamat",
|
||||
"url": "https://github.com/trivikr",
|
||||
"githubUsername": "trivikr"
|
||||
"githubUsername": "trivikr",
|
||||
"url": "https://github.com/trivikr"
|
||||
},
|
||||
{
|
||||
"name": "Junxiao Shi",
|
||||
"url": "https://github.com/yoursunny",
|
||||
"githubUsername": "yoursunny"
|
||||
"githubUsername": "yoursunny",
|
||||
"url": "https://github.com/yoursunny"
|
||||
},
|
||||
{
|
||||
"name": "Ilia Baryshnikov",
|
||||
"url": "https://github.com/qwelias",
|
||||
"githubUsername": "qwelias"
|
||||
"githubUsername": "qwelias",
|
||||
"url": "https://github.com/qwelias"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"url": "https://github.com/ExE-Boss",
|
||||
"githubUsername": "ExE-Boss"
|
||||
"githubUsername": "ExE-Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"url": "https://github.com/peterblazejewicz",
|
||||
"githubUsername": "peterblazejewicz"
|
||||
"githubUsername": "peterblazejewicz",
|
||||
"url": "https://github.com/peterblazejewicz"
|
||||
},
|
||||
{
|
||||
"name": "Anna Henningsen",
|
||||
"url": "https://github.com/addaleax",
|
||||
"githubUsername": "addaleax"
|
||||
"githubUsername": "addaleax",
|
||||
"url": "https://github.com/addaleax"
|
||||
},
|
||||
{
|
||||
"name": "Victor Perin",
|
||||
"url": "https://github.com/victorperin",
|
||||
"githubUsername": "victorperin"
|
||||
"githubUsername": "victorperin",
|
||||
"url": "https://github.com/victorperin"
|
||||
},
|
||||
{
|
||||
"name": "Yongsheng Zhang",
|
||||
"url": "https://github.com/ZYSzys",
|
||||
"githubUsername": "ZYSzys"
|
||||
"githubUsername": "ZYSzys",
|
||||
"url": "https://github.com/ZYSzys"
|
||||
},
|
||||
{
|
||||
"name": "NodeJS Contributors",
|
||||
"url": "https://github.com/NodeJS",
|
||||
"githubUsername": "NodeJS"
|
||||
"githubUsername": "NodeJS",
|
||||
"url": "https://github.com/NodeJS"
|
||||
},
|
||||
{
|
||||
"name": "Linus Unnebäck",
|
||||
"url": "https://github.com/LinusU",
|
||||
"githubUsername": "LinusU"
|
||||
"githubUsername": "LinusU",
|
||||
"url": "https://github.com/LinusU"
|
||||
},
|
||||
{
|
||||
"name": "wafuwafu13",
|
||||
"url": "https://github.com/wafuwafu13",
|
||||
"githubUsername": "wafuwafu13"
|
||||
"githubUsername": "wafuwafu13",
|
||||
"url": "https://github.com/wafuwafu13"
|
||||
},
|
||||
{
|
||||
"name": "Matteo Collina",
|
||||
"githubUsername": "mcollina",
|
||||
"url": "https://github.com/mcollina"
|
||||
},
|
||||
{
|
||||
"name": "Dmitry Semigradsky",
|
||||
"githubUsername": "Semigradsky",
|
||||
"url": "https://github.com/Semigradsky"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"typesVersions": {
|
||||
"<=4.8": {
|
||||
"*": [
|
||||
"ts4.8/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/node"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "57a94e60cf640ea4d81b4fa914f3fb5929a63ae0b4d5141d7daf250c569e7d10",
|
||||
"typeScriptVersion": "3.8"
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
},
|
||||
"typesPublisherContentHash": "a1b366d7b3bf1afaa88e038010565763e234c0e5fa8044db8b0d7c44995bfbf8",
|
||||
"typeScriptVersion": "4.5",
|
||||
"nonNpm": true
|
||||
}
|
||||
85
node_modules/@types/node/path.d.ts
generated
vendored
Executable file → Normal file
85
node_modules/@types/node/path.d.ts
generated
vendored
Executable file → Normal file
@@ -1,21 +1,21 @@
|
||||
declare module 'path/posix' {
|
||||
import path = require('path');
|
||||
declare module "path/posix" {
|
||||
import path = require("path");
|
||||
export = path;
|
||||
}
|
||||
declare module 'path/win32' {
|
||||
import path = require('path');
|
||||
declare module "path/win32" {
|
||||
import path = require("path");
|
||||
export = path;
|
||||
}
|
||||
/**
|
||||
* The `path` module provides utilities for working with file and directory paths.
|
||||
* It can be accessed using:
|
||||
* The `node:path` module provides utilities for working with file and directory
|
||||
* paths. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const path = require('path');
|
||||
* const path = require('node:path');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/path.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js)
|
||||
*/
|
||||
declare module 'path' {
|
||||
declare module "path" {
|
||||
namespace path {
|
||||
/**
|
||||
* A parsed path object generated by path.parse() or consumed by path.format().
|
||||
@@ -69,18 +69,19 @@ declare module 'path' {
|
||||
* 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 p string path to normalize.
|
||||
* @param path string path to normalize.
|
||||
* @throws {TypeError} if `path` is not a string.
|
||||
*/
|
||||
normalize(p: string): string;
|
||||
normalize(path: string): string;
|
||||
/**
|
||||
* Join all arguments together and normalize the resulting path.
|
||||
* Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
|
||||
*
|
||||
* @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}.
|
||||
* 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.
|
||||
*
|
||||
@@ -89,61 +90,71 @@ declare module 'path' {
|
||||
* 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 pathSegments string paths to join. Non-string arguments are ignored.
|
||||
* @param paths A sequence of paths or path segments.
|
||||
* @throws {TypeError} if any of the arguments is not a string.
|
||||
*/
|
||||
resolve(...pathSegments: string[]): 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(p: string): boolean;
|
||||
isAbsolute(path: string): boolean;
|
||||
/**
|
||||
* Solve the relative path from {from} to {to}.
|
||||
* 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 p the path to evaluate.
|
||||
* @param path the path to evaluate.
|
||||
* @throws {TypeError} if `path` is not a string.
|
||||
*/
|
||||
dirname(p: string): 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 p the path to evaluate.
|
||||
* @param ext optionally, an extension to remove from the result.
|
||||
* @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(p: string, ext?: string): 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
|
||||
* 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 p the path to evaluate.
|
||||
* @param path the path to evaluate.
|
||||
* @throws {TypeError} if `path` is not a string.
|
||||
*/
|
||||
extname(p: string): string;
|
||||
extname(path: string): string;
|
||||
/**
|
||||
* The platform-specific file separator. '\\' or '/'.
|
||||
*/
|
||||
readonly sep: string;
|
||||
readonly sep: "\\" | "/";
|
||||
/**
|
||||
* The platform-specific file delimiter. ';' or ':'.
|
||||
*/
|
||||
readonly delimiter: string;
|
||||
readonly delimiter: ";" | ":";
|
||||
/**
|
||||
* Returns an object from a path string - the opposite of format().
|
||||
*
|
||||
* @param pathString path to evaluate.
|
||||
* @param path path to evaluate.
|
||||
* @throws {TypeError} if `path` is not a string.
|
||||
*/
|
||||
parse(p: string): ParsedPath;
|
||||
parse(path: string): ParsedPath;
|
||||
/**
|
||||
* Returns a path string from an object - the opposite of parse().
|
||||
*
|
||||
* @param pathString path to evaluate.
|
||||
* @param pathObject path to evaluate.
|
||||
*/
|
||||
format(pP: FormatInputPathObject): string;
|
||||
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.
|
||||
@@ -166,15 +177,15 @@ declare module 'path' {
|
||||
const path: path.PlatformPath;
|
||||
export = path;
|
||||
}
|
||||
declare module 'node:path' {
|
||||
import path = require('path');
|
||||
declare module "node:path" {
|
||||
import path = require("path");
|
||||
export = path;
|
||||
}
|
||||
declare module 'node:path/posix' {
|
||||
import path = require('path/posix');
|
||||
declare module "node:path/posix" {
|
||||
import path = require("path/posix");
|
||||
export = path;
|
||||
}
|
||||
declare module 'node:path/win32' {
|
||||
import path = require('path/win32');
|
||||
declare module "node:path/win32" {
|
||||
import path = require("path/win32");
|
||||
export = path;
|
||||
}
|
||||
|
||||
142
node_modules/@types/node/perf_hooks.d.ts
generated
vendored
Executable file → Normal file
142
node_modules/@types/node/perf_hooks.d.ts
generated
vendored
Executable file → Normal file
@@ -7,9 +7,10 @@
|
||||
* * [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('perf_hooks');
|
||||
* const { PerformanceObserver, performance } = require('node:perf_hooks');
|
||||
*
|
||||
* const obs = new PerformanceObserver((items) => {
|
||||
* console.log(items.getEntries()[0].duration);
|
||||
@@ -26,11 +27,11 @@
|
||||
* performance.measure('A to B', 'A', 'B');
|
||||
* });
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/perf_hooks.js)
|
||||
* @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';
|
||||
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
|
||||
@@ -46,6 +47,7 @@ declare module 'perf_hooks' {
|
||||
readonly flags?: number | undefined;
|
||||
}
|
||||
/**
|
||||
* The constructor of this class is not exposed to users directly.
|
||||
* @since v8.5.0
|
||||
*/
|
||||
class PerformanceEntry {
|
||||
@@ -85,6 +87,24 @@ declare module 'perf_hooks' {
|
||||
* @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._
|
||||
@@ -146,7 +166,10 @@ declare module 'perf_hooks' {
|
||||
* @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;
|
||||
type EventLoopUtilityFunction = (
|
||||
util1?: EventLoopUtilization,
|
||||
util2?: EventLoopUtilization,
|
||||
) => EventLoopUtilization;
|
||||
interface MarkOptions {
|
||||
/**
|
||||
* Additional optional detail to include with the mark.
|
||||
@@ -191,14 +214,44 @@ declare module 'perf_hooks' {
|
||||
* @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): void;
|
||||
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',
|
||||
@@ -213,9 +266,10 @@ declare module 'perf_hooks' {
|
||||
* @param name
|
||||
* @param startMark
|
||||
* @param endMark
|
||||
* @return The PerformanceMeasure entry that was created
|
||||
*/
|
||||
measure(name: string, startMark?: string, endMark?: string): void;
|
||||
measure(name: string, options: MeasureOptions): void;
|
||||
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.
|
||||
*/
|
||||
@@ -249,8 +303,8 @@ declare module 'perf_hooks' {
|
||||
* ```js
|
||||
* const {
|
||||
* performance,
|
||||
* PerformanceObserver
|
||||
* } = require('perf_hooks');
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
*
|
||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||
* console.log(perfObserverList.getEntries());
|
||||
@@ -270,6 +324,8 @@ declare module 'perf_hooks' {
|
||||
* * }
|
||||
* * ]
|
||||
*
|
||||
* performance.clearMarks();
|
||||
* performance.clearMeasures();
|
||||
* observer.disconnect();
|
||||
* });
|
||||
* obs.observe({ type: 'mark' });
|
||||
@@ -288,8 +344,8 @@ declare module 'perf_hooks' {
|
||||
* ```js
|
||||
* const {
|
||||
* performance,
|
||||
* PerformanceObserver
|
||||
* } = require('perf_hooks');
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
*
|
||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||
* console.log(perfObserverList.getEntriesByName('meow'));
|
||||
@@ -317,6 +373,9 @@ declare module 'perf_hooks' {
|
||||
* * ]
|
||||
*
|
||||
* console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
|
||||
*
|
||||
* performance.clearMarks();
|
||||
* performance.clearMeasures();
|
||||
* observer.disconnect();
|
||||
* });
|
||||
* obs.observe({ entryTypes: ['mark', 'measure'] });
|
||||
@@ -334,8 +393,8 @@ declare module 'perf_hooks' {
|
||||
* ```js
|
||||
* const {
|
||||
* performance,
|
||||
* PerformanceObserver
|
||||
* } = require('perf_hooks');
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
*
|
||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||
* console.log(perfObserverList.getEntriesByType('mark'));
|
||||
@@ -355,6 +414,8 @@ declare module 'perf_hooks' {
|
||||
* * }
|
||||
* * ]
|
||||
*
|
||||
* performance.clearMarks();
|
||||
* performance.clearMeasures();
|
||||
* observer.disconnect();
|
||||
* });
|
||||
* obs.observe({ type: 'mark' });
|
||||
@@ -367,6 +428,9 @@ declare module 'perf_hooks' {
|
||||
getEntriesByType(type: EntryType): PerformanceEntry[];
|
||||
}
|
||||
type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
|
||||
/**
|
||||
* @since v8.5.0
|
||||
*/
|
||||
class PerformanceObserver extends AsyncResource {
|
||||
constructor(callback: PerformanceObserverCallback);
|
||||
/**
|
||||
@@ -380,11 +444,11 @@ declare module 'perf_hooks' {
|
||||
* ```js
|
||||
* const {
|
||||
* performance,
|
||||
* PerformanceObserver
|
||||
* } = require('perf_hooks');
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
*
|
||||
* const obs = new PerformanceObserver((list, observer) => {
|
||||
* // Called three times synchronously. `list` contains one item.
|
||||
* // Called once asynchronously. `list` contains three items.
|
||||
* });
|
||||
* obs.observe({ type: 'mark' });
|
||||
*
|
||||
@@ -396,13 +460,13 @@ declare module 'perf_hooks' {
|
||||
observe(
|
||||
options:
|
||||
| {
|
||||
entryTypes: ReadonlyArray<EntryType>;
|
||||
buffered?: boolean | undefined;
|
||||
}
|
||||
entryTypes: ReadonlyArray<EntryType>;
|
||||
buffered?: boolean | undefined;
|
||||
}
|
||||
| {
|
||||
type: EntryType;
|
||||
buffered?: boolean | undefined;
|
||||
}
|
||||
type: EntryType;
|
||||
buffered?: boolean | undefined;
|
||||
},
|
||||
): void;
|
||||
}
|
||||
namespace constants {
|
||||
@@ -487,7 +551,7 @@ declare module 'perf_hooks' {
|
||||
}
|
||||
interface RecordableHistogram extends Histogram {
|
||||
/**
|
||||
* @since v15.9.0
|
||||
* @since v15.9.0, v14.18.0
|
||||
* @param val The amount to record in the histogram.
|
||||
*/
|
||||
record(val: number | bigint): void;
|
||||
@@ -496,9 +560,14 @@ declare module 'perf_hooks' {
|
||||
* previous call to `recordDelta()` and records that amount in the histogram.
|
||||
*
|
||||
* ## Examples
|
||||
* @since v15.9.0
|
||||
* @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._
|
||||
@@ -513,7 +582,7 @@ declare module 'perf_hooks' {
|
||||
* detect.
|
||||
*
|
||||
* ```js
|
||||
* const { monitorEventLoopDelay } = require('perf_hooks');
|
||||
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
||||
* const h = monitorEventLoopDelay({ resolution: 20 });
|
||||
* h.enable();
|
||||
* // Do something.
|
||||
@@ -548,10 +617,23 @@ declare module 'perf_hooks' {
|
||||
}
|
||||
/**
|
||||
* Returns a `RecordableHistogram`.
|
||||
* @since v15.9.0
|
||||
* @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';
|
||||
declare module "node:perf_hooks" {
|
||||
export * from "perf_hooks";
|
||||
}
|
||||
|
||||
469
node_modules/@types/node/process.d.ts
generated
vendored
Executable file → Normal file
469
node_modules/@types/node/process.d.ts
generated
vendored
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
declare module 'process' {
|
||||
import * as tty from 'node:tty';
|
||||
import { Worker } from 'node:worker_threads';
|
||||
declare module "process" {
|
||||
import * as tty from "node:tty";
|
||||
import { Worker } from "node:worker_threads";
|
||||
global {
|
||||
var process: NodeJS.Process;
|
||||
namespace NodeJS {
|
||||
@@ -48,47 +48,70 @@ declare module 'process' {
|
||||
modules: string;
|
||||
openssl: string;
|
||||
}
|
||||
type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
|
||||
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';
|
||||
| "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;
|
||||
@@ -96,13 +119,17 @@ declare module 'process' {
|
||||
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 the the value is an Error.
|
||||
* as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error.
|
||||
*/
|
||||
type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
|
||||
type WarningListener = (warning: Error) => void;
|
||||
type MessageListener = (message: unknown, sendHandle: unknown) => void;
|
||||
type SignalsListener = (signal: Signals) => void;
|
||||
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<unknown>, value: unknown) => void;
|
||||
type MultipleResolveListener = (
|
||||
type: MultipleResolveType,
|
||||
promise: Promise<unknown>,
|
||||
value: unknown,
|
||||
) => void;
|
||||
type WorkerListener = (worker: Worker) => void;
|
||||
interface Socket extends ReadWriteStream {
|
||||
isTTY?: true | undefined;
|
||||
@@ -249,7 +276,7 @@ declare module 'process' {
|
||||
* For example, to copy `process.stdin` to `process.stdout`:
|
||||
*
|
||||
* ```js
|
||||
* import { stdin, stdout } from 'process';
|
||||
* import { stdin, stdout } from 'node:process';
|
||||
*
|
||||
* stdin.pipe(stdout);
|
||||
* ```
|
||||
@@ -296,7 +323,7 @@ declare module 'process' {
|
||||
* For example, assuming the following script for `process-args.js`:
|
||||
*
|
||||
* ```js
|
||||
* import { argv } from 'process';
|
||||
* import { argv } from 'node:process';
|
||||
*
|
||||
* // print process.argv
|
||||
* argv.forEach((val, index) => {
|
||||
@@ -306,8 +333,8 @@ declare module 'process' {
|
||||
*
|
||||
* Launching the Node.js process as:
|
||||
*
|
||||
* ```console
|
||||
* $ node process-args.js one two=three four
|
||||
* ```bash
|
||||
* node process-args.js one two=three four
|
||||
* ```
|
||||
*
|
||||
* Would generate the output:
|
||||
@@ -343,8 +370,8 @@ declare module 'process' {
|
||||
* the script name. These options are useful in order to spawn child processes with
|
||||
* the same execution environment as the parent.
|
||||
*
|
||||
* ```console
|
||||
* $ node --harmony script.js --version
|
||||
* ```bash
|
||||
* node --harmony script.js --version
|
||||
* ```
|
||||
*
|
||||
* Results in `process.execArgv`:
|
||||
@@ -388,7 +415,7 @@ declare module 'process' {
|
||||
* the specified `directory` does not exist).
|
||||
*
|
||||
* ```js
|
||||
* import { chdir, cwd } from 'process';
|
||||
* import { chdir, cwd } from 'node:process';
|
||||
*
|
||||
* console.log(`Starting directory: ${cwd()}`);
|
||||
* try {
|
||||
@@ -408,7 +435,7 @@ declare module 'process' {
|
||||
* process.
|
||||
*
|
||||
* ```js
|
||||
* import { cwd } from 'process';
|
||||
* import { cwd } from 'node:process';
|
||||
*
|
||||
* console.log(`Current directory: ${cwd()}`);
|
||||
* ```
|
||||
@@ -419,7 +446,7 @@ declare module 'process' {
|
||||
* The port used by the Node.js debugger when enabled.
|
||||
*
|
||||
* ```js
|
||||
* import process from 'process';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* process.debugPort = 5858;
|
||||
* ```
|
||||
@@ -431,12 +458,12 @@ declare module 'process' {
|
||||
* specific process warnings. These can be listened for by adding a handler to the `'warning'` event.
|
||||
*
|
||||
* ```js
|
||||
* import { emitWarning } from 'process';
|
||||
* 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'
|
||||
* detail: 'This is some additional information',
|
||||
* });
|
||||
* // Emits:
|
||||
* // (node:56338) [MY_WARNING] Warning: Something happened!
|
||||
@@ -446,7 +473,7 @@ declare module 'process' {
|
||||
* In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler.
|
||||
*
|
||||
* ```js
|
||||
* import process from 'process';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* process.on('warning', (warning) => {
|
||||
* console.warn(warning.name); // 'Warning'
|
||||
@@ -491,14 +518,14 @@ declare module 'process' {
|
||||
* to other `Worker` threads.
|
||||
* In other words, the following example would not work:
|
||||
*
|
||||
* ```console
|
||||
* $ node -e 'process.env.foo = "bar"' && echo $foo
|
||||
* ```bash
|
||||
* node -e 'process.env.foo = "bar"' && echo $foo
|
||||
* ```
|
||||
*
|
||||
* While the following will:
|
||||
*
|
||||
* ```js
|
||||
* import { env } from 'process';
|
||||
* import { env } from 'node:process';
|
||||
*
|
||||
* env.foo = 'bar';
|
||||
* console.log(env.foo);
|
||||
@@ -509,7 +536,7 @@ declare module 'process' {
|
||||
* throw an error when the value is not a string, number, or boolean.
|
||||
*
|
||||
* ```js
|
||||
* import { env } from 'process';
|
||||
* import { env } from 'node:process';
|
||||
*
|
||||
* env.test = null;
|
||||
* console.log(env.test);
|
||||
@@ -522,7 +549,7 @@ declare module 'process' {
|
||||
* Use `delete` to delete a property from `process.env`.
|
||||
*
|
||||
* ```js
|
||||
* import { env } from 'process';
|
||||
* import { env } from 'node:process';
|
||||
*
|
||||
* env.TEST = 1;
|
||||
* delete env.TEST;
|
||||
@@ -533,7 +560,7 @@ declare module 'process' {
|
||||
* On Windows operating systems, environment variables are case-insensitive.
|
||||
*
|
||||
* ```js
|
||||
* import { env } from 'process';
|
||||
* import { env } from 'node:process';
|
||||
*
|
||||
* env.TEST = 1;
|
||||
* console.log(env.test);
|
||||
@@ -542,10 +569,11 @@ declare module 'process' {
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 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;
|
||||
@@ -559,7 +587,7 @@ declare module 'process' {
|
||||
* To exit with a 'failure' code:
|
||||
*
|
||||
* ```js
|
||||
* import { exit } from 'process';
|
||||
* import { exit } from 'node:process';
|
||||
*
|
||||
* exit(1);
|
||||
* ```
|
||||
@@ -578,7 +606,7 @@ declare module 'process' {
|
||||
* truncated and lost:
|
||||
*
|
||||
* ```js
|
||||
* import { exit } from 'process';
|
||||
* import { exit } from 'node:process';
|
||||
*
|
||||
* // This is an example of what *not* to do:
|
||||
* if (someConditionNotMet()) {
|
||||
@@ -589,13 +617,13 @@ declare module 'process' {
|
||||
*
|
||||
* 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.
|
||||
* 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 'process';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* // How to properly set the exit code while letting
|
||||
* // the process exit gracefully.
|
||||
@@ -612,7 +640,7 @@ declare module 'process' {
|
||||
* In `Worker` threads, this function stops the current thread rather
|
||||
* than the current process.
|
||||
* @since v0.1.13
|
||||
* @param [code=0] The exit code.
|
||||
* @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
|
||||
*/
|
||||
exit(code?: number): never;
|
||||
/**
|
||||
@@ -641,7 +669,7 @@ declare module 'process' {
|
||||
* Android).
|
||||
* @since v0.1.31
|
||||
*/
|
||||
getgid(): number;
|
||||
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
|
||||
@@ -668,7 +696,7 @@ declare module 'process' {
|
||||
* @since v0.1.31
|
||||
* @param id The group name or ID
|
||||
*/
|
||||
setgid(id: number | string): void;
|
||||
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).)
|
||||
@@ -685,7 +713,7 @@ declare module 'process' {
|
||||
* Android).
|
||||
* @since v0.1.28
|
||||
*/
|
||||
getuid(): number;
|
||||
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.
|
||||
@@ -711,7 +739,7 @@ declare module 'process' {
|
||||
* This feature is not available in `Worker` threads.
|
||||
* @since v0.1.28
|
||||
*/
|
||||
setuid(id: number | string): void;
|
||||
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).)
|
||||
@@ -728,7 +756,7 @@ declare module 'process' {
|
||||
* Android).
|
||||
* @since v2.0.0
|
||||
*/
|
||||
geteuid(): number;
|
||||
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
|
||||
@@ -755,7 +783,7 @@ declare module 'process' {
|
||||
* @since v2.0.0
|
||||
* @param id A user name or ID
|
||||
*/
|
||||
seteuid(id: number | string): void;
|
||||
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).)
|
||||
@@ -772,7 +800,7 @@ declare module 'process' {
|
||||
* Android).
|
||||
* @since v2.0.0
|
||||
*/
|
||||
getegid(): number;
|
||||
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
|
||||
@@ -799,7 +827,7 @@ declare module 'process' {
|
||||
* @since v2.0.0
|
||||
* @param id A group name or ID
|
||||
*/
|
||||
setegid(id: number | string): void;
|
||||
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
|
||||
@@ -817,7 +845,7 @@ declare module 'process' {
|
||||
* Android).
|
||||
* @since v0.9.4
|
||||
*/
|
||||
getgroups(): number[];
|
||||
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
|
||||
@@ -843,7 +871,7 @@ declare module 'process' {
|
||||
* This feature is not available in `Worker` threads.
|
||||
* @since v0.9.4
|
||||
*/
|
||||
setgroups(groups: ReadonlyArray<string | number>): void;
|
||||
setgroups?: (groups: ReadonlyArray<string | number>) => void;
|
||||
/**
|
||||
* The `process.setUncaughtExceptionCaptureCallback()` function sets a function
|
||||
* that will be invoked when an uncaught exception occurs, which will receive the
|
||||
@@ -868,11 +896,17 @@ declare module 'process' {
|
||||
* @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 'process';
|
||||
* import { version } from 'node:process';
|
||||
*
|
||||
* console.log(`Version: ${version}`);
|
||||
* // Version: v14.8.0
|
||||
@@ -889,7 +923,7 @@ declare module 'process' {
|
||||
* to load modules that were compiled against a different module ABI version.
|
||||
*
|
||||
* ```js
|
||||
* import { versions } from 'process';
|
||||
* import { versions } from 'node:process';
|
||||
*
|
||||
* console.log(versions);
|
||||
* ```
|
||||
@@ -897,30 +931,39 @@ declare module 'process' {
|
||||
* Will generate an object similar to:
|
||||
*
|
||||
* ```console
|
||||
* { node: '11.13.0',
|
||||
* v8: '7.0.276.38-node.18',
|
||||
* uv: '1.27.0',
|
||||
* zlib: '1.2.11',
|
||||
* brotli: '1.0.7',
|
||||
* ares: '1.15.0',
|
||||
* modules: '67',
|
||||
* nghttp2: '1.34.0',
|
||||
* napi: '4',
|
||||
* llhttp: '1.1.1',
|
||||
* openssl: '1.1.1b',
|
||||
* cldr: '34.0',
|
||||
* icu: '63.1',
|
||||
* tz: '2018e',
|
||||
* unicode: '11.0' }
|
||||
* { 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 an `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.
|
||||
* 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:
|
||||
*
|
||||
@@ -942,7 +985,6 @@ declare module 'process' {
|
||||
* node_shared_http_parser: 'false',
|
||||
* node_shared_libuv: 'false',
|
||||
* node_shared_zlib: 'false',
|
||||
* node_use_dtrace: 'false',
|
||||
* node_use_openssl: 'true',
|
||||
* node_shared_openssl: 'false',
|
||||
* strict_aliasing: 'true',
|
||||
@@ -951,13 +993,6 @@ declare module 'process' {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* The `process.config` property is **not** read-only and there are existing
|
||||
* modules in the ecosystem that are known to extend, modify, or entirely replace
|
||||
* the value of `process.config`.
|
||||
*
|
||||
* Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made
|
||||
* read-only in a future release.
|
||||
* @since v0.7.7
|
||||
*/
|
||||
readonly config: ProcessConfig;
|
||||
@@ -976,7 +1011,7 @@ declare module 'process' {
|
||||
* other than kill the target process.
|
||||
*
|
||||
* ```js
|
||||
* import process, { kill } from 'process';
|
||||
* import process, { kill } from 'node:process';
|
||||
*
|
||||
* process.on('SIGHUP', () => {
|
||||
* console.log('Got SIGHUP signal.');
|
||||
@@ -1001,7 +1036,7 @@ declare module 'process' {
|
||||
* The `process.pid` property returns the PID of the process.
|
||||
*
|
||||
* ```js
|
||||
* import { pid } from 'process';
|
||||
* import { pid } from 'node:process';
|
||||
*
|
||||
* console.log(`This process is pid ${pid}`);
|
||||
* ```
|
||||
@@ -1013,7 +1048,7 @@ declare module 'process' {
|
||||
* current process.
|
||||
*
|
||||
* ```js
|
||||
* import { ppid } from 'process';
|
||||
* import { ppid } from 'node:process';
|
||||
*
|
||||
* console.log(`The parent process is pid ${ppid}`);
|
||||
* ```
|
||||
@@ -1040,19 +1075,19 @@ 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'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`.
|
||||
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
|
||||
*
|
||||
* ```js
|
||||
* import { arch } from 'process';
|
||||
* import { arch } from 'node:process';
|
||||
*
|
||||
* console.log(`This processor architecture is ${arch}`);
|
||||
* ```
|
||||
* @since v0.5.0
|
||||
*/
|
||||
readonly arch: string;
|
||||
readonly arch: Architecture;
|
||||
/**
|
||||
* The `process.platform` property returns a string identifying the operating
|
||||
* system platform on which the Node.js process is running.
|
||||
* system platform for which the Node.js binary was compiled.
|
||||
*
|
||||
* Currently possible values are:
|
||||
*
|
||||
@@ -1065,7 +1100,7 @@ declare module 'process' {
|
||||
* * `'win32'`
|
||||
*
|
||||
* ```js
|
||||
* import { platform } from 'process';
|
||||
* import { platform } from 'node:process';
|
||||
*
|
||||
* console.log(`This platform is ${platform}`);
|
||||
* ```
|
||||
@@ -1088,6 +1123,17 @@ declare module 'process' {
|
||||
*/
|
||||
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
|
||||
@@ -1099,7 +1145,7 @@ declare module 'process' {
|
||||
* argument to the function, to get a diff reading.
|
||||
*
|
||||
* ```js
|
||||
* import { cpuUsage } from 'process';
|
||||
* import { cpuUsage } from 'node:process';
|
||||
*
|
||||
* const startUsage = cpuUsage();
|
||||
* // { user: 38579, system: 6986 }
|
||||
@@ -1123,7 +1169,7 @@ declare module 'process' {
|
||||
* 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 'process';
|
||||
* import { nextTick } from 'node:process';
|
||||
*
|
||||
* console.log('start');
|
||||
* nextTick(() => {
|
||||
@@ -1141,7 +1187,7 @@ declare module 'process' {
|
||||
* I/O has occurred:
|
||||
*
|
||||
* ```js
|
||||
* import { nextTick } from 'process';
|
||||
* import { nextTick } from 'node:process';
|
||||
*
|
||||
* function MyThing(options) {
|
||||
* this.setupOptions(options);
|
||||
@@ -1189,7 +1235,7 @@ declare module 'process' {
|
||||
* The following approach is much better:
|
||||
*
|
||||
* ```js
|
||||
* import { nextTick } from 'process';
|
||||
* import { nextTick } from 'node:process';
|
||||
*
|
||||
* function definitelyAsync(arg, cb) {
|
||||
* if (arg) {
|
||||
@@ -1214,10 +1260,10 @@ declare module 'process' {
|
||||
* ```js
|
||||
* {
|
||||
* name: 'node',
|
||||
* lts: 'Erbium',
|
||||
* sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz',
|
||||
* headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz',
|
||||
* libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib'
|
||||
* 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'
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
@@ -1262,7 +1308,7 @@ declare module 'process' {
|
||||
* 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`.
|
||||
* 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.
|
||||
@@ -1275,7 +1321,7 @@ declare module 'process' {
|
||||
options?: {
|
||||
swallowErrors?: boolean | undefined;
|
||||
},
|
||||
callback?: (error: Error | null) => void
|
||||
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
|
||||
@@ -1321,7 +1367,7 @@ declare module 'process' {
|
||||
* dashes:
|
||||
*
|
||||
* ```js
|
||||
* import { allowedNodeEnvironmentFlags } from 'process';
|
||||
* import { allowedNodeEnvironmentFlags } from 'node:process';
|
||||
*
|
||||
* allowedNodeEnvironmentFlags.forEach((flag) => {
|
||||
* // -r
|
||||
@@ -1347,7 +1393,7 @@ declare module 'process' {
|
||||
report?: ProcessReport | undefined;
|
||||
/**
|
||||
* ```js
|
||||
* import { resourceUsage } from 'process';
|
||||
* import { resourceUsage } from 'node:process';
|
||||
*
|
||||
* console.log(resourceUsage());
|
||||
* /*
|
||||
@@ -1384,98 +1430,103 @@ declare module 'process' {
|
||||
*/
|
||||
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: "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<unknown>): boolean;
|
||||
emit(event: 'uncaughtException', error: Error): boolean;
|
||||
emit(event: 'uncaughtExceptionMonitor', error: Error): boolean;
|
||||
emit(event: 'unhandledRejection', reason: unknown, promise: Promise<unknown>): 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<unknown>, 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;
|
||||
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<unknown>): boolean;
|
||||
emit(event: "uncaughtException", error: Error): boolean;
|
||||
emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
|
||||
emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): 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<unknown>,
|
||||
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: "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: "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: "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: "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;
|
||||
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[];
|
||||
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[];
|
||||
listeners(event: "multipleResolves"): MultipleResolveListener[];
|
||||
listeners(event: "worker"): WorkerListener[];
|
||||
}
|
||||
}
|
||||
}
|
||||
export = process;
|
||||
}
|
||||
declare module 'node:process' {
|
||||
import process = require('process');
|
||||
declare module "node:process" {
|
||||
import process = require("process");
|
||||
export = process;
|
||||
}
|
||||
|
||||
8
node_modules/@types/node/punycode.d.ts
generated
vendored
Executable file → Normal file
8
node_modules/@types/node/punycode.d.ts
generated
vendored
Executable file → Normal file
@@ -24,9 +24,9 @@
|
||||
* 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/v16.9.0/lib/punycode.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js)
|
||||
*/
|
||||
declare module 'punycode' {
|
||||
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.
|
||||
@@ -112,6 +112,6 @@ declare module 'punycode' {
|
||||
*/
|
||||
const version: string;
|
||||
}
|
||||
declare module 'node:punycode' {
|
||||
export * from 'punycode';
|
||||
declare module "node:punycode" {
|
||||
export * from "punycode";
|
||||
}
|
||||
|
||||
30
node_modules/@types/node/querystring.d.ts
generated
vendored
Executable file → Normal file
30
node_modules/@types/node/querystring.d.ts
generated
vendored
Executable file → Normal file
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* The `querystring` module provides utilities for parsing and formatting URL
|
||||
* The `node:querystring` module provides utilities for parsing and formatting URL
|
||||
* query strings. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const querystring = require('querystring');
|
||||
* const querystring = require('node:querystring');
|
||||
* ```
|
||||
*
|
||||
* The `querystring` API is considered Legacy. While it is still maintained,
|
||||
* new code should use the `URLSearchParams` API instead.
|
||||
* @deprecated Legacy
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/querystring.js)
|
||||
* `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' {
|
||||
declare module "querystring" {
|
||||
interface StringifyOptions {
|
||||
encodeURIComponent?: ((str: string) => string) | undefined;
|
||||
}
|
||||
@@ -20,7 +20,17 @@ declare module 'querystring' {
|
||||
decodeURIComponent?: ((str: string) => string) | undefined;
|
||||
}
|
||||
interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
|
||||
interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {}
|
||||
interface ParsedUrlQueryInput extends
|
||||
NodeJS.Dict<
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| ReadonlyArray<string>
|
||||
| ReadonlyArray<number>
|
||||
| ReadonlyArray<boolean>
|
||||
| null
|
||||
>
|
||||
{}
|
||||
/**
|
||||
* The `querystring.stringify()` method produces a URL query string from a
|
||||
* given `obj` by iterating through the object's "own properties".
|
||||
@@ -126,6 +136,6 @@ declare module 'querystring' {
|
||||
*/
|
||||
function unescape(str: string): string;
|
||||
}
|
||||
declare module 'node:querystring' {
|
||||
export * from 'querystring';
|
||||
declare module "node:querystring" {
|
||||
export * from "querystring";
|
||||
}
|
||||
|
||||
326
node_modules/@types/node/readline.d.ts
generated
vendored
Executable file → Normal file
326
node_modules/@types/node/readline.d.ts
generated
vendored
Executable file → Normal file
@@ -1,36 +1,42 @@
|
||||
/**
|
||||
* The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. It can be accessed
|
||||
* using:
|
||||
* 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
|
||||
* const readline = require('readline');
|
||||
* import * as readline from 'node:readline/promises';
|
||||
* ```
|
||||
*
|
||||
* The following simple example illustrates the basic use of the `readline` module.
|
||||
* To use the callback and sync APIs:
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('readline');
|
||||
* import * as readline from 'node:readline';
|
||||
* ```
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout
|
||||
* });
|
||||
* The following simple example illustrates the basic use of the `node:readline`module.
|
||||
*
|
||||
* rl.question('What do you think of Node.js? ', (answer) => {
|
||||
* // TODO: Log the answer in a database
|
||||
* console.log(`Thank you for your valuable feedback: ${answer}`);
|
||||
* ```js
|
||||
* import * as readline from 'node:readline/promises';
|
||||
* import { stdin as input, stdout as output } from 'node:process';
|
||||
*
|
||||
* rl.close();
|
||||
* });
|
||||
* 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/v16.9.0/lib/readline.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js)
|
||||
*/
|
||||
declare module 'readline' {
|
||||
import { Abortable, EventEmitter } from 'node:events';
|
||||
interface Key {
|
||||
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;
|
||||
@@ -44,7 +50,7 @@ declare module 'readline' {
|
||||
* and is read from, the `input` stream.
|
||||
* @since v0.1.104
|
||||
*/
|
||||
class Interface extends EventEmitter {
|
||||
export class Interface extends EventEmitter {
|
||||
readonly terminal: boolean;
|
||||
/**
|
||||
* The current input data being processed by node.
|
||||
@@ -67,7 +73,7 @@ declare module 'readline' {
|
||||
* const showResults = debounce(() => {
|
||||
* console.log(
|
||||
* '\n',
|
||||
* values.filter((val) => val.startsWith(rl.line)).join(' ')
|
||||
* values.filter((val) => val.startsWith(rl.line)).join(' '),
|
||||
* );
|
||||
* }, 300);
|
||||
* process.stdin.on('keypress', (c, k) => {
|
||||
@@ -93,21 +99,26 @@ declare module 'readline' {
|
||||
* > Instances of the `readline.Interface` class are constructed using the
|
||||
* > `readline.createInterface()` method.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
|
||||
* @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);
|
||||
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-v10.x/docs/api/readline.html#readline_class_interface
|
||||
* @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
|
||||
* @since v15.3.0, v14.17.0
|
||||
* @return the current prompt string
|
||||
*/
|
||||
getPrompt(): string;
|
||||
@@ -117,13 +128,13 @@ declare module 'readline' {
|
||||
*/
|
||||
setPrompt(prompt: string): void;
|
||||
/**
|
||||
* The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new
|
||||
* 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 `readline.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`.
|
||||
*/
|
||||
@@ -135,12 +146,14 @@ declare module 'readline' {
|
||||
* When called, `rl.question()` will resume the `input` stream if it has been
|
||||
* paused.
|
||||
*
|
||||
* If the `readline.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.
|
||||
* 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
|
||||
@@ -165,25 +178,6 @@ declare module 'readline' {
|
||||
*
|
||||
* setTimeout(() => ac.abort(), 10000);
|
||||
* ```
|
||||
*
|
||||
* If this method is invoked as it's util.promisify()ed version, it returns a
|
||||
* Promise that fulfills with the answer. If the question is canceled using
|
||||
* an `AbortController` it will reject with an `AbortError`.
|
||||
*
|
||||
* ```js
|
||||
* const util = require('util');
|
||||
* const question = util.promisify(rl.question).bind(rl);
|
||||
*
|
||||
* async function questionExample() {
|
||||
* try {
|
||||
* const answer = await question('What is you favorite food? ');
|
||||
* console.log(`Oh, so your favorite food is ${answer}`);
|
||||
* } catch (err) {
|
||||
* console.error('Question rejected', err);
|
||||
* }
|
||||
* }
|
||||
* questionExample();
|
||||
* ```
|
||||
* @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`.
|
||||
@@ -194,7 +188,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 `readline.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;
|
||||
@@ -204,12 +198,12 @@ declare module 'readline' {
|
||||
*/
|
||||
resume(): this;
|
||||
/**
|
||||
* The `rl.close()` method closes the `readline.Interface` instance and
|
||||
* 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 `readline.Interface` instance.
|
||||
* from being emitted by the `Interface` instance.
|
||||
* @since v0.1.98
|
||||
*/
|
||||
close(): void;
|
||||
@@ -224,7 +218,7 @@ declare module 'readline' {
|
||||
* When called, `rl.write()` will resume the `input` stream if it has been
|
||||
* paused.
|
||||
*
|
||||
* If the `readline.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!');
|
||||
@@ -256,66 +250,69 @@ declare module 'readline' {
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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<string>;
|
||||
}
|
||||
type ReadLine = Interface; // type forwarded for backwards compatibility
|
||||
type Completer = (line: string) => CompleterResult;
|
||||
type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
|
||||
type CompleterResult = [string[], string];
|
||||
interface ReadLineOptions {
|
||||
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;
|
||||
@@ -344,10 +341,10 @@ declare module 'readline' {
|
||||
* The `readline.createInterface()` method creates a new `readline.Interface`instance.
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('readline');
|
||||
* const readline = require('node:readline');
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout
|
||||
* output: process.stdout,
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
@@ -366,18 +363,17 @@ declare module 'readline' {
|
||||
* (`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 `EOF` (Ctrl+D on
|
||||
* Linux/macOS, Ctrl+Z followed by Return on
|
||||
* Windows).
|
||||
* If you want your application to exit without waiting for user input, you can `unref()` the standard input stream:
|
||||
*
|
||||
* ```js
|
||||
* process.stdin.unref();
|
||||
* ```
|
||||
* 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
|
||||
*/
|
||||
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
|
||||
function createInterface(options: ReadLineOptions): Interface;
|
||||
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.
|
||||
*
|
||||
@@ -394,41 +390,6 @@ declare module 'readline' {
|
||||
* if (process.stdin.isTTY)
|
||||
* process.stdin.setRawMode(true);
|
||||
* ```
|
||||
* @since v0.7.7
|
||||
*/
|
||||
function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
|
||||
type Direction = -1 | 0 | 1;
|
||||
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`.
|
||||
*/
|
||||
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`.
|
||||
*/
|
||||
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`.
|
||||
*/
|
||||
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`.
|
||||
*
|
||||
* ## Example: Tiny CLI
|
||||
*
|
||||
@@ -436,11 +397,11 @@ declare module 'readline' {
|
||||
* implement a small command-line interface:
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('readline');
|
||||
* const readline = require('node:readline');
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
* prompt: 'OHAI> '
|
||||
* prompt: 'OHAI> ',
|
||||
* });
|
||||
*
|
||||
* rl.prompt();
|
||||
@@ -468,15 +429,15 @@ declare module 'readline' {
|
||||
* well as a `for await...of` loop:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const readline = require('readline');
|
||||
* 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
|
||||
* 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.
|
||||
@@ -493,12 +454,12 @@ declare module 'readline' {
|
||||
* Alternatively, one could use the `'line'` event:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const readline = require('readline');
|
||||
* const fs = require('node:fs');
|
||||
* const readline = require('node:readline');
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: fs.createReadStream('sample.txt'),
|
||||
* crlfDelay: Infinity
|
||||
* crlfDelay: Infinity,
|
||||
* });
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
@@ -509,15 +470,15 @@ 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:
|
||||
*
|
||||
* ```js
|
||||
* const { once } = require('events');
|
||||
* const { createReadStream } = require('fs');
|
||||
* const { createInterface } = require('readline');
|
||||
* 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
|
||||
* crlfDelay: Infinity,
|
||||
* });
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
@@ -533,11 +494,46 @@ declare module 'readline' {
|
||||
* })();
|
||||
* ```
|
||||
* @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`.
|
||||
*/
|
||||
function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
|
||||
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';
|
||||
declare module "node:readline" {
|
||||
export * from "readline";
|
||||
}
|
||||
|
||||
150
node_modules/@types/node/readline/promises.d.ts
generated
vendored
Normal file
150
node_modules/@types/node/readline/promises.d.ts
generated
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
/**
|
||||
* @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<string>;
|
||||
question(query: string, options: Abortable): Promise<string>;
|
||||
}
|
||||
/**
|
||||
* @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<void>;
|
||||
/**
|
||||
* 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";
|
||||
}
|
||||
170
node_modules/@types/node/repl.d.ts
generated
vendored
Executable file → Normal file
170
node_modules/@types/node/repl.d.ts
generated
vendored
Executable file → Normal file
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* The `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:
|
||||
* 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('repl');
|
||||
* const repl = require('node:repl');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/repl.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js)
|
||||
*/
|
||||
declare module 'repl' {
|
||||
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|
||||
import { Context } from 'node:vm';
|
||||
import { InspectOptions } from 'node:util';
|
||||
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.
|
||||
@@ -41,8 +41,8 @@ declare module 'repl' {
|
||||
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
||||
* additional lines.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
|
||||
* @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;
|
||||
/**
|
||||
@@ -74,13 +74,13 @@ declare module 'repl' {
|
||||
* 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-v10.x/docs/api/repl.html#repl_customizing_repl_output
|
||||
* @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-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function
|
||||
*/
|
||||
completer?: Completer | AsyncCompleter | undefined;
|
||||
/**
|
||||
@@ -99,7 +99,13 @@ declare module 'repl' {
|
||||
*/
|
||||
breakEvalOnSigint?: boolean | undefined;
|
||||
}
|
||||
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
|
||||
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,
|
||||
@@ -124,7 +130,7 @@ declare module 'repl' {
|
||||
* or directly using the JavaScript `new` keyword.
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
* const repl = require('node:repl');
|
||||
*
|
||||
* const options = { useColors: true };
|
||||
*
|
||||
@@ -162,33 +168,33 @@ declare module 'repl' {
|
||||
/**
|
||||
* A value indicating whether the REPL is currently in "editor mode".
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
|
||||
* @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-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @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-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @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-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @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-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly lastError: any;
|
||||
/**
|
||||
@@ -240,7 +246,7 @@ declare module 'repl' {
|
||||
*
|
||||
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver
|
||||
*/
|
||||
private constructor();
|
||||
/**
|
||||
@@ -251,7 +257,7 @@ declare module 'repl' {
|
||||
* The following example shows two new commands added to the REPL instance:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
* const repl = require('node:repl');
|
||||
*
|
||||
* const replServer = repl.start({ prompt: '> ' });
|
||||
* replServer.defineCommand('sayhello', {
|
||||
@@ -260,7 +266,7 @@ declare module 'repl' {
|
||||
* this.clearBufferedCommand();
|
||||
* console.log(`Hello, ${name}!`);
|
||||
* this.displayPrompt();
|
||||
* }
|
||||
* },
|
||||
* });
|
||||
* replServer.defineCommand('saybye', function saybye() {
|
||||
* console.log('Goodbye!');
|
||||
@@ -277,7 +283,7 @@ declare module 'repl' {
|
||||
* Goodbye!
|
||||
* ```
|
||||
* @since v0.3.0
|
||||
* @param keyword The command keyword (*without* a leading `.` character).
|
||||
* @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;
|
||||
@@ -326,65 +332,65 @@ declare module 'repl' {
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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.
|
||||
@@ -401,7 +407,7 @@ declare module 'repl' {
|
||||
* If `options` is a string, then it specifies the input prompt:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
* const repl = require('node:repl');
|
||||
*
|
||||
* // a Unix style prompt
|
||||
* repl.start('$ ');
|
||||
@@ -412,13 +418,13 @@ declare module 'repl' {
|
||||
/**
|
||||
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
|
||||
* @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';
|
||||
declare module "node:repl" {
|
||||
export * from "repl";
|
||||
}
|
||||
|
||||
2168
node_modules/@types/node/stream.d.ts
generated
vendored
Executable file → Normal file
2168
node_modules/@types/node/stream.d.ts
generated
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
32
node_modules/@types/node/stream/consumers.d.ts
generated
vendored
Executable file → Normal file
32
node_modules/@types/node/stream/consumers.d.ts
generated
vendored
Executable file → Normal file
@@ -1,24 +1,12 @@
|
||||
// Duplicates of interface in lib.dom.ts.
|
||||
// Duplicated here rather than referencing lib.dom.ts because doing so causes lib.dom.ts to be loaded for "test-all"
|
||||
// Which in turn causes tests to pass that shouldn't pass.
|
||||
//
|
||||
// This interface is not, and should not be, exported.
|
||||
interface Blob {
|
||||
readonly size: number;
|
||||
readonly type: string;
|
||||
arrayBuffer(): Promise<ArrayBuffer>;
|
||||
slice(start?: number, end?: number, contentType?: string): Blob;
|
||||
stream(): NodeJS.ReadableStream;
|
||||
text(): Promise<string>;
|
||||
declare module "stream/consumers" {
|
||||
import { Blob as NodeBlob } from "node:buffer";
|
||||
import { Readable } from "node:stream";
|
||||
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
|
||||
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
|
||||
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
|
||||
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
|
||||
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
|
||||
}
|
||||
declare module 'stream/consumers' {
|
||||
import { Readable } from 'node:stream';
|
||||
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
|
||||
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
|
||||
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
|
||||
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Blob>;
|
||||
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
|
||||
}
|
||||
declare module 'node:stream/consumers' {
|
||||
export * from 'stream/consumers';
|
||||
declare module "node:stream/consumers" {
|
||||
export * from "stream/consumers";
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user