mirror of
https://github.com/github/codeql-action.git
synced 2025-12-13 19:17:12 +08:00
Compare commits
321 Commits
codeql-bun
...
v2.27.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e96cea3a2e | ||
|
|
a11ff478f4 | ||
|
|
eed040e613 | ||
|
|
ee0d06c300 | ||
|
|
4b2de78b63 | ||
|
|
657bbc8346 | ||
|
|
4f3212b617 | ||
|
|
63b548d59e | ||
|
|
3ef4c08457 | ||
|
|
4e033f0e26 | ||
|
|
5ac2ddd6fc | ||
|
|
3b7b85fbe8 | ||
|
|
688ea5370d | ||
|
|
1e6d67b138 | ||
|
|
d5e73848c4 | ||
|
|
756aa649df | ||
|
|
28e7fca08f | ||
|
|
3fe305410e | ||
|
|
16e8ccc657 | ||
|
|
6a89f57882 | ||
|
|
d053e801ad | ||
|
|
722d7be831 | ||
|
|
02b20c03ad | ||
|
|
a666febdd9 | ||
|
|
2659fbeaef | ||
|
|
083cd45dc7 | ||
|
|
6a42f43c44 | ||
|
|
0b152e09b9 | ||
|
|
146668f870 | ||
|
|
afab321d87 | ||
|
|
e7e89aa4b2 | ||
|
|
4d85deb854 | ||
|
|
57e51c3a28 | ||
|
|
dc5e80c8cc | ||
|
|
2a8e35ea74 | ||
|
|
60fb28c4e7 | ||
|
|
81b5e0e1a2 | ||
|
|
430e27ef20 | ||
|
|
283b59dab3 | ||
|
|
17504f9da9 | ||
|
|
b6a92703ae | ||
|
|
c86416c911 | ||
|
|
f8723f322b | ||
|
|
85b07cf1e1 | ||
|
|
531ce50d39 | ||
|
|
a680341ce5 | ||
|
|
1991d31d08 | ||
|
|
d9d1e68857 | ||
|
|
9b1856ea9f | ||
|
|
d97ba04b39 | ||
|
|
a54d022c15 | ||
|
|
e0927014d2 | ||
|
|
0c7f114ae4 | ||
|
|
9f0e9cc2e5 | ||
|
|
6ea954642e | ||
|
|
422b177bb3 | ||
|
|
51826fb97a | ||
|
|
db0e7bc3d0 | ||
|
|
3f0edd48f8 | ||
|
|
7aaea3327f | ||
|
|
793bff44a5 | ||
|
|
2fe1a3da42 | ||
|
|
8c041afa1f | ||
|
|
81dc191d06 | ||
|
|
3452639dc8 | ||
|
|
9d8d30f5fe | ||
|
|
e8292c7849 | ||
|
|
be8b74c09c | ||
|
|
65b1807594 | ||
|
|
2bcad51735 | ||
|
|
bd8d52d614 | ||
|
|
4deb1ac80b | ||
|
|
2c3520bccc | ||
|
|
e8b34a2aaa | ||
|
|
3c0d130c56 | ||
|
|
df56d3936b | ||
|
|
751600b467 | ||
|
|
4ad2714825 | ||
|
|
025a9940e0 | ||
|
|
89036746af | ||
|
|
4799b0f4d9 | ||
|
|
1de304405b | ||
|
|
e9925c150b | ||
|
|
a5a1c19f3d | ||
|
|
a5b09996a2 | ||
|
|
d65d0c9607 | ||
|
|
0408560f78 | ||
|
|
9a0f1902d8 | ||
|
|
0c65e51f6d | ||
|
|
cd78b0c22d | ||
|
|
4d41234370 | ||
|
|
366883a76d | ||
|
|
b6f3dd5b69 | ||
|
|
ee7156af3a | ||
|
|
79105e57fc | ||
|
|
89893dd326 | ||
|
|
36a8987598 | ||
|
|
404b712ccd | ||
|
|
e36312243c | ||
|
|
24f9e43571 | ||
|
|
88634f4927 | ||
|
|
308547dc25 | ||
|
|
57391aa8d6 | ||
|
|
5973e2313a | ||
|
|
11a4b17771 | ||
|
|
684a773172 | ||
|
|
f1e8960cb4 | ||
|
|
138862ec00 | ||
|
|
0430e6625a | ||
|
|
3e0e84636c | ||
|
|
e24bc47be8 | ||
|
|
fc5bae6a19 | ||
|
|
a8428cd9ea | ||
|
|
87819cead8 | ||
|
|
9a5f54856d | ||
|
|
e549eca490 | ||
|
|
20f361b0e9 | ||
|
|
12c986850b | ||
|
|
befbb8b4a5 | ||
|
|
461cce50d3 | ||
|
|
7e72016db9 | ||
|
|
7c2a1b9bb7 | ||
|
|
563dcafdfe | ||
|
|
4bcff1af46 | ||
|
|
bc172e1162 | ||
|
|
6abdf6c312 | ||
|
|
57d4608536 | ||
|
|
700bccb48b | ||
|
|
e113c555ef | ||
|
|
ed554bd623 | ||
|
|
3fd960a2d2 | ||
|
|
5767038bb9 | ||
|
|
f9d5614349 | ||
|
|
9029d5d6a6 | ||
|
|
d958b976dc | ||
|
|
7482df244c | ||
|
|
2cefb791de | ||
|
|
703bc820da | ||
|
|
250eb55355 | ||
|
|
5f2fdb88c3 | ||
|
|
a073c66b2a | ||
|
|
691ac2e494 | ||
|
|
d6233df2fd | ||
|
|
a78cac18f0 | ||
|
|
46c2e16272 | ||
|
|
3998c927e6 | ||
|
|
b9bbe2d606 | ||
|
|
e4f82d6949 | ||
|
|
be63ca505c | ||
|
|
69a0a4689a | ||
|
|
f9848b399e | ||
|
|
d37d7829f6 | ||
|
|
6ac9fc7e8e | ||
|
|
4103cca585 | ||
|
|
52d291229a | ||
|
|
23e160363e | ||
|
|
8308092ba6 | ||
|
|
4a7314f4b5 | ||
|
|
366cd98114 | ||
|
|
8d9b4c6dc8 | ||
|
|
eee8c708a0 | ||
|
|
fd8b26e79b | ||
|
|
fd90298f66 | ||
|
|
28cc49a08b | ||
|
|
162eb1e32a | ||
|
|
a1a97f41b2 | ||
|
|
ab186bb61a | ||
|
|
ff8133afe9 | ||
|
|
ac7c76bfc7 | ||
|
|
d429afad01 | ||
|
|
d05fceb045 | ||
|
|
78d13343a2 | ||
|
|
a953717405 | ||
|
|
b5e604ae77 | ||
|
|
ceb635d11f | ||
|
|
34710081e2 | ||
|
|
4f0ceda83a | ||
|
|
654d389318 | ||
|
|
685e64b1e3 | ||
|
|
02619f4624 | ||
|
|
8e81fd40bf | ||
|
|
52e98c0622 | ||
|
|
ceaec5c11a | ||
|
|
39f10b5b8a | ||
|
|
64ccee938f | ||
|
|
e76c3643d1 | ||
|
|
caa31633f2 | ||
|
|
04aff1f5fa | ||
|
|
9ace329d8c | ||
|
|
b849f33370 | ||
|
|
42cbd34070 | ||
|
|
9762ef1fad | ||
|
|
5122fa879d | ||
|
|
c3aa7b8d0d | ||
|
|
e949a1676c | ||
|
|
948c1ebff4 | ||
|
|
e4b5f9d015 | ||
|
|
8aad228360 | ||
|
|
c992dad089 | ||
|
|
06c30cc68c | ||
|
|
f72882a05b | ||
|
|
b9d792527d | ||
|
|
12bc863d11 | ||
|
|
ba352fa8e7 | ||
|
|
d95215f691 | ||
|
|
553a89d488 | ||
|
|
ffd3158cb9 | ||
|
|
82478fb458 | ||
|
|
2a96432c79 | ||
|
|
93075ceec3 | ||
|
|
a023017ea9 | ||
|
|
794eacf375 | ||
|
|
a1559aa4a9 | ||
|
|
a82bad7182 | ||
|
|
61ddd48e03 | ||
|
|
abca38cf8c | ||
|
|
763babe7ac | ||
|
|
72d46cb780 | ||
|
|
0b21c947c0 | ||
|
|
c2dc67199a | ||
|
|
f018a9586e | ||
|
|
6007966519 | ||
|
|
efed72eb8f | ||
|
|
bcca54f232 | ||
|
|
76d48637f2 | ||
|
|
4821ae1424 | ||
|
|
e56cfd0877 | ||
|
|
6046c633c7 | ||
|
|
ed2b6b741f | ||
|
|
570dc010e8 | ||
|
|
1a8046c7f3 | ||
|
|
8c395e0c45 | ||
|
|
de22b302a6 | ||
|
|
928ff8c822 | ||
|
|
2f52385615 | ||
|
|
272cd56763 | ||
|
|
3839e215cc | ||
|
|
61f4d893e6 | ||
|
|
30ad6c3d9e | ||
|
|
78df51c1cc | ||
|
|
045d9f3939 | ||
|
|
a3c8eb3ab0 | ||
|
|
6078595fdf | ||
|
|
395cdfe20c | ||
|
|
a56a03b370 | ||
|
|
05053827ef | ||
|
|
fa5685c7f0 | ||
|
|
8c3591c19a | ||
|
|
557a8d2306 | ||
|
|
7351df07bb | ||
|
|
d15fdd879b | ||
|
|
80eb8d5395 | ||
|
|
0ddabac401 | ||
|
|
b882b63a68 | ||
|
|
8b0f3e6135 | ||
|
|
8601b9e70a | ||
|
|
bd94b4c175 | ||
|
|
755340a6bd | ||
|
|
4a8f20f6b9 | ||
|
|
460939e7d8 | ||
|
|
ceebdeb9fa | ||
|
|
47c8d615ed | ||
|
|
c232c5de9c | ||
|
|
2452b7d8af | ||
|
|
4ffed09d48 | ||
|
|
8b6a45a6ec | ||
|
|
2ccdcd5135 | ||
|
|
4f50fb3be5 | ||
|
|
02022337ac | ||
|
|
3dafabe4d9 | ||
|
|
40cd785140 | ||
|
|
10746dd61e | ||
|
|
1a077f8f6c | ||
|
|
05d809f630 | ||
|
|
d8c4c3a4eb | ||
|
|
b301568384 | ||
|
|
f5c8be0ac1 | ||
|
|
4504810aa1 | ||
|
|
dc021d495c | ||
|
|
f822fa3067 | ||
|
|
3ed798ed18 | ||
|
|
5b498ba405 | ||
|
|
7dde705407 | ||
|
|
c004a3e831 | ||
|
|
2f93e4319b | ||
|
|
c98f2c953c | ||
|
|
554c990fe8 | ||
|
|
abe5934e80 | ||
|
|
8879ae88d9 | ||
|
|
01e8d7f881 | ||
|
|
4759df8df7 | ||
|
|
554005d264 | ||
|
|
fb29452d38 | ||
|
|
13884cb7d7 | ||
|
|
ac64986f93 | ||
|
|
cdcacf8b4f | ||
|
|
8b7fcbfac2 | ||
|
|
e24bd8fed4 | ||
|
|
8f2682add5 | ||
|
|
8f5ae1a11a | ||
|
|
99d337aef5 | ||
|
|
997d889b5d | ||
|
|
1500a13138 | ||
|
|
0d318c9f1a | ||
|
|
d6286c6fdb | ||
|
|
9c74de20cb | ||
|
|
49a6ae4966 | ||
|
|
3366e3bbdd | ||
|
|
844fc3cd56 | ||
|
|
5a201efe22 | ||
|
|
c9f92aa25f | ||
|
|
03e7845b7b | ||
|
|
54f10077ea | ||
|
|
20d1a9b175 | ||
|
|
c28d79bb2e | ||
|
|
241e8b42b2 | ||
|
|
8bc67d15e2 | ||
|
|
e106171cbb | ||
|
|
231f9f1b59 | ||
|
|
47334bf4e9 | ||
|
|
e763762131 |
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.
|
Comma separated list of query ids that should NOT be included in this SARIF file.
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: index.js
|
main: index.js
|
||||||
|
|||||||
2
.github/workflows/__all-platform-bundle.yml
generated
vendored
2
.github/workflows/__all-platform-bundle.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__analyze-ref-input.yml
generated
vendored
2
.github/workflows/__analyze-ref-input.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__autobuild-action.yml
generated
vendored
2
.github/workflows/__autobuild-action.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__autobuild-direct-tracing-with-working-dir.yml
generated
vendored
2
.github/workflows/__autobuild-direct-tracing-with-working-dir.yml
generated
vendored
@@ -42,7 +42,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__autobuild-direct-tracing.yml
generated
vendored
2
.github/workflows/__autobuild-direct-tracing.yml
generated
vendored
@@ -42,7 +42,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__build-mode-autobuild.yml
generated
vendored
2
.github/workflows/__build-mode-autobuild.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__build-mode-manual.yml
generated
vendored
2
.github/workflows/__build-mode-manual.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__build-mode-none.yml
generated
vendored
2
.github/workflows/__build-mode-none.yml
generated
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__build-mode-rollback.yml
generated
vendored
2
.github/workflows/__build-mode-rollback.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__cleanup-db-cluster-dir.yml
generated
vendored
2
.github/workflows/__cleanup-db-cluster-dir.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__config-export.yml
generated
vendored
2
.github/workflows/__config-export.yml
generated
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__config-input.yml
generated
vendored
2
.github/workflows/__config-input.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__cpp-deptrace-disabled.yml
generated
vendored
2
.github/workflows/__cpp-deptrace-disabled.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__cpp-deptrace-enabled-on-macos.yml
generated
vendored
2
.github/workflows/__cpp-deptrace-enabled-on-macos.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__cpp-deptrace-enabled.yml
generated
vendored
2
.github/workflows/__cpp-deptrace-enabled.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__diagnostics-export.yml
generated
vendored
2
.github/workflows/__diagnostics-export.yml
generated
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__extractor-ram-threads.yml
generated
vendored
2
.github/workflows/__extractor-ram-threads.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-custom-queries.yml
generated
vendored
2
.github/workflows/__go-custom-queries.yml
generated
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
2
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
@@ -66,7 +66,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
2
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
@@ -66,7 +66,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
2
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
@@ -66,7 +66,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__init-with-registries.yml
generated
vendored
2
.github/workflows/__init-with-registries.yml
generated
vendored
@@ -53,7 +53,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__javascript-source-root.yml
generated
vendored
2
.github/workflows/__javascript-source-root.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__job-run-uuid-sarif.yml
generated
vendored
2
.github/workflows/__job-run-uuid-sarif.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__language-aliases.yml
generated
vendored
2
.github/workflows/__language-aliases.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
4
.github/workflows/__multi-language-autodetect.yml
generated
vendored
4
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -66,7 +66,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -146,7 +146,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check language autodetect for Swift on MacOS
|
- name: Check language autodetect for Swift on macOS
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
4
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
4
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
@@ -52,7 +52,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
uses: ./../action/.github/actions/check-sarif
|
uses: ./../action/.github/actions/check-sarif
|
||||||
with:
|
with:
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
||||||
queries-run:
|
queries-run:
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
||||||
queries-not-run: foo,bar
|
queries-not-run: foo,bar
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
4
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
@@ -52,7 +52,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
uses: ./../action/.github/actions/check-sarif
|
uses: ./../action/.github/actions/check-sarif
|
||||||
with:
|
with:
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
||||||
queries-run:
|
queries-run:
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
||||||
queries-not-run: foo,bar
|
queries-not-run: foo,bar
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/__packaging-config-js.yml
generated
vendored
4
.github/workflows/__packaging-config-js.yml
generated
vendored
@@ -52,7 +52,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
uses: ./../action/.github/actions/check-sarif
|
uses: ./../action/.github/actions/check-sarif
|
||||||
with:
|
with:
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
||||||
queries-run:
|
queries-run:
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
||||||
queries-not-run: foo,bar
|
queries-not-run: foo,bar
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/__packaging-inputs-js.yml
generated
vendored
4
.github/workflows/__packaging-inputs-js.yml
generated
vendored
@@ -52,7 +52,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
uses: ./../action/.github/actions/check-sarif
|
uses: ./../action/.github/actions/check-sarif
|
||||||
with:
|
with:
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
||||||
queries-run:
|
queries-run:
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
||||||
queries-not-run: foo,bar
|
queries-not-run: foo,bar
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__remote-config.yml
generated
vendored
2
.github/workflows/__remote-config.yml
generated
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
4
.github/workflows/__resolve-environment-action.yml
generated
vendored
4
.github/workflows/__resolve-environment-action.yml
generated
vendored
@@ -52,7 +52,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
language: javascript-typescript
|
language: javascript-typescript
|
||||||
|
|
||||||
- name: Fail if JavaScript/TypeScript configuration present
|
- name: Fail if JavaScript/TypeScript configuration present
|
||||||
if:
|
if:
|
||||||
fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript
|
fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript
|
||||||
run: exit 1
|
run: exit 1
|
||||||
env:
|
env:
|
||||||
|
|||||||
2
.github/workflows/__rubocop-multi-language.yml
generated
vendored
2
.github/workflows/__rubocop-multi-language.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__ruby.yml
generated
vendored
2
.github/workflows/__ruby.yml
generated
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__split-workflow.yml
generated
vendored
2
.github/workflows/__split-workflow.yml
generated
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__submit-sarif-failure.yml
generated
vendored
2
.github/workflows/__submit-sarif-failure.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__swift-autobuild.yml
generated
vendored
2
.github/workflows/__swift-autobuild.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__swift-custom-build.yml
generated
vendored
2
.github/workflows/__swift-custom-build.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
2
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__test-local-codeql.yml
generated
vendored
2
.github/workflows/__test-local-codeql.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__test-proxy.yml
generated
vendored
2
.github/workflows/__test-proxy.yml
generated
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__unset-environment.yml
generated
vendored
2
.github/workflows/__unset-environment.yml
generated
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
2
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__with-checkout-path.yml
generated
vendored
2
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
|
|||||||
6
.github/workflows/__zstd-bundle-streaming.yml
generated
vendored
6
.github/workflows/__zstd-bundle-streaming.yml
generated
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -59,7 +59,9 @@ jobs:
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
||||||
fs.rmdirSync(codeqlPath, { recursive: true });
|
if (codeqlPath !== undefined) {
|
||||||
|
fs.rmdirSync(codeqlPath, { recursive: true });
|
||||||
|
}
|
||||||
- id: init
|
- id: init
|
||||||
uses: ./../action/init
|
uses: ./../action/init
|
||||||
with:
|
with:
|
||||||
|
|||||||
6
.github/workflows/__zstd-bundle.yml
generated
vendored
6
.github/workflows/__zstd-bundle.yml
generated
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python on MacOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
with:
|
with:
|
||||||
@@ -61,7 +61,9 @@ jobs:
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
||||||
fs.rmdirSync(codeqlPath, { recursive: true });
|
if (codeqlPath !== undefined) {
|
||||||
|
fs.rmdirSync(codeqlPath, { recursive: true });
|
||||||
|
}
|
||||||
- id: init
|
- id: init
|
||||||
uses: ./../action/init
|
uses: ./../action/init
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
env:
|
env:
|
||||||
# Forces a failure in this step.
|
# Forces a failure in this step.
|
||||||
CODEQL_ACTION_EXTRA_OPTIONS: '{ "database": { "finalize": ["--invalid-option"] } }'
|
CODEQL_ACTION_EXTRA_OPTIONS: '{ "database": { "finalize": ["--invalid-option"] } }'
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/debug-artifacts-legacy.yml
vendored
2
.github/workflows/debug-artifacts-legacy.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
|||||||
debug-artifact-name: my-debug-artifacts
|
debug-artifact-name: my-debug-artifacts
|
||||||
debug-database-name: my-db
|
debug-database-name: my-db
|
||||||
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|||||||
2
.github/workflows/debug-artifacts.yml
vendored
2
.github/workflows/debug-artifacts.yml
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
debug-artifact-name: my-debug-artifacts
|
debug-artifact-name: my-debug-artifacts
|
||||||
debug-database-name: my-db
|
debug-database-name: my-db
|
||||||
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|||||||
3
.github/workflows/expected-queries-runs.yml
vendored
3
.github/workflows/expected-queries-runs.yml
vendored
@@ -22,6 +22,9 @@ jobs:
|
|||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
3
.github/workflows/pr-checks.yml
vendored
3
.github/workflows/pr-checks.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-types-version: [16.11, current] # run tests on 16.11 while CodeQL Action v2 is still supported
|
node-types-version: [16.11, current] # we backport this matrix job in order to maintain the same check names
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -61,6 +61,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check generated JS
|
- 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
|
run: .github/workflows/script/check-js.sh
|
||||||
|
|
||||||
check-node-modules:
|
check-node-modules:
|
||||||
|
|||||||
@@ -32,4 +32,4 @@ jobs:
|
|||||||
- name: Publish
|
- name: Publish
|
||||||
if: steps.check.outputs.is-action-release == 'true'
|
if: steps.check.outputs.is-action-release == 'true'
|
||||||
id: publish
|
id: publish
|
||||||
uses: actions/publish-immutable-action@0.0.3
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
|
|||||||
2
.github/workflows/script/check-js.sh
vendored
2
.github/workflows/script/check-js.sh
vendored
@@ -7,7 +7,7 @@ if [ ! -z "$(git status --porcelain)" ]; then
|
|||||||
>&2 echo "Failed: Repo should be clean before testing!"
|
>&2 echo "Failed: Repo should be clean before testing!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Wipe the lib directory incase there are extra unnecessary files in there
|
# Wipe the lib directory in case there are extra unnecessary files in there
|
||||||
rm -rf lib
|
rm -rf lib
|
||||||
# Generate the JavaScript files
|
# Generate the JavaScript files
|
||||||
npm run-script build
|
npm run-script build
|
||||||
|
|||||||
112
CHANGELOG.md
112
CHANGELOG.md
@@ -4,237 +4,231 @@ 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.
|
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.
|
||||||
|
|
||||||
## [UNRELEASED]
|
## 2.27.1 - 08 Nov 2024
|
||||||
|
|
||||||
- The CodeQL Action now downloads bundles compressed using Zstandard on GitHub Enterprise Server when using Linux or macOS runners. This speeds up the installation of the CodeQL tools. This feature is already available to GitHub.com users. [#2573](https://github.com/github/codeql-action/pull/2573)
|
- The CodeQL Action now downloads bundles compressed using Zstandard on GitHub Enterprise Server when using Linux or macOS runners. This speeds up the installation of the CodeQL tools. This feature is already available to GitHub.com users. [#2573](https://github.com/github/codeql-action/pull/2573)
|
||||||
|
- Update default CodeQL bundle version to 2.19.3. [#2576](https://github.com/github/codeql-action/pull/2576)
|
||||||
|
|
||||||
## 3.27.0 - 22 Oct 2024
|
## 2.27.0 - 22 Oct 2024
|
||||||
|
|
||||||
- Bump the minimum CodeQL bundle version to 2.14.6. [#2549](https://github.com/github/codeql-action/pull/2549)
|
- Bump the minimum CodeQL bundle version to 2.14.6. [#2549](https://github.com/github/codeql-action/pull/2549)
|
||||||
- Fix an issue where the `upload-sarif` Action would fail with "upload-sarif post-action step failed: Input required and not supplied: token" when called in a composite Action that had a different set of inputs to the ones expected by the `upload-sarif` Action. [#2557](https://github.com/github/codeql-action/pull/2557)
|
- Fix an issue where the `upload-sarif` Action would fail with "upload-sarif post-action step failed: Input required and not supplied: token" when called in a composite Action that had a different set of inputs to the ones expected by the `upload-sarif` Action. [#2557](https://github.com/github/codeql-action/pull/2557)
|
||||||
- Update default CodeQL bundle version to 2.19.2. [#2552](https://github.com/github/codeql-action/pull/2552)
|
- Update default CodeQL bundle version to 2.19.2. [#2552](https://github.com/github/codeql-action/pull/2552)
|
||||||
|
|
||||||
## 3.26.13 - 14 Oct 2024
|
## 2.26.13 - 14 Oct 2024
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
## 3.26.12 - 07 Oct 2024
|
## 2.26.12 - 07 Oct 2024
|
||||||
|
|
||||||
- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.14.5 and earlier. These versions of CodeQL were discontinued on 24 September 2024 alongside GitHub Enterprise Server 3.10, and will be unsupported by CodeQL Action versions 3.27.0 and later and versions 2.27.0 and later. [#2520](https://github.com/github/codeql-action/pull/2520)
|
- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.14.5 and earlier. These versions of CodeQL were discontinued on 24 September 2024 alongside GitHub Enterprise Server 3.10, and will be unsupported by CodeQL Action versions 3.27.0 and later and versions 2.27.0 and later. [#2520](https://github.com/github/codeql-action/pull/2520)
|
||||||
|
|
||||||
- If you are using one of these versions, please update to CodeQL CLI version 2.14.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.
|
- If you are using one of these versions, please update to CodeQL CLI version 2.14.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.13.5 and 2.14.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.26.11` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.26.11` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
- Alternatively, if you want to continue using a version of the CodeQL CLI between 2.13.5 and 2.14.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.26.11` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.26.11` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
||||||
|
|
||||||
## 3.26.11 - 03 Oct 2024
|
## 2.26.11 - 03 Oct 2024
|
||||||
|
|
||||||
- _Upcoming breaking change_: Add support for using `actions/download-artifact@v4` to programmatically consume CodeQL Action debug artifacts.
|
- _Upcoming breaking change_: Add support for using `actions/download-artifact@v4` to programmatically consume CodeQL Action debug artifacts.
|
||||||
|
|
||||||
Starting November 30, 2024, GitHub.com customers will [no longer be able to use `actions/download-artifact@v3`](https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/). Therefore, to avoid breakage, customers who programmatically download the CodeQL Action debug artifacts should set the `CODEQL_ACTION_ARTIFACT_V4_UPGRADE` environment variable to `true` and bump `actions/download-artifact@v3` to `actions/download-artifact@v4` in their workflows. The CodeQL Action will enable this behavior by default in early November and workflows that have not yet bumped to `actions/download-artifact@v3` to `actions/download-artifact@v4` will begin failing then.
|
Starting November 30, 2024, GitHub.com customers will [no longer be able to use `actions/download-artifact@v3`](https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/). Therefore, to avoid breakage, customers who programmatically download the CodeQL Action debug artifacts should set the `CODEQL_ACTION_ARTIFACT_V4_UPGRADE` environment variable to `true` and bump `actions/download-artifact@v3` to `actions/download-artifact@v4` in their workflows. The CodeQL Action will enable this behavior by default in early November and workflows that have not yet bumped to `actions/download-artifact@v3` to `actions/download-artifact@v4` will begin failing then.
|
||||||
|
|
||||||
This change is currently unavailable for GitHub Enterprise Server customers, as `actions/upload-artifact@v4` and `actions/download-artifact@v4` are not yet compatible with GHES.
|
This change is currently unavailable for GitHub Enterprise Server customers, as `actions/upload-artifact@v4` and `actions/download-artifact@v4` are not yet compatible with GHES.
|
||||||
- Update default CodeQL bundle version to 2.19.1. [#2519](https://github.com/github/codeql-action/pull/2519)
|
- Update default CodeQL bundle version to 2.19.1. [#2519](https://github.com/github/codeql-action/pull/2519)
|
||||||
|
|
||||||
## 3.26.10 - 30 Sep 2024
|
## 2.26.10 - 30 Sep 2024
|
||||||
|
|
||||||
- We are rolling out a feature in September/October 2024 that sets up CodeQL using a bundle compressed with [Zstandard](http://facebook.github.io/zstd/). Our aim is to improve the performance of setting up CodeQL. [#2502](https://github.com/github/codeql-action/pull/2502)
|
- We are rolling out a feature in September/October 2024 that sets up CodeQL using a bundle compressed with [Zstandard](http://facebook.github.io/zstd/). Our aim is to improve the performance of setting up CodeQL. [#2502](https://github.com/github/codeql-action/pull/2502)
|
||||||
|
|
||||||
## 3.26.9 - 24 Sep 2024
|
## 2.26.9 - 24 Sep 2024
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
## 3.26.8 - 19 Sep 2024
|
## 2.26.8 - 19 Sep 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.19.0. [#2483](https://github.com/github/codeql-action/pull/2483)
|
- Update default CodeQL bundle version to 2.19.0. [#2483](https://github.com/github/codeql-action/pull/2483)
|
||||||
|
|
||||||
## 3.26.7 - 13 Sep 2024
|
## 2.26.7 - 13 Sep 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.18.4. [#2471](https://github.com/github/codeql-action/pull/2471)
|
- Update default CodeQL bundle version to 2.18.4. [#2471](https://github.com/github/codeql-action/pull/2471)
|
||||||
|
|
||||||
## 3.26.6 - 29 Aug 2024
|
## 2.26.6 - 29 Aug 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.18.3. [#2449](https://github.com/github/codeql-action/pull/2449)
|
- Update default CodeQL bundle version to 2.18.3. [#2449](https://github.com/github/codeql-action/pull/2449)
|
||||||
|
|
||||||
## 3.26.5 - 23 Aug 2024
|
## 2.26.5 - 23 Aug 2024
|
||||||
|
|
||||||
- Fix an issue where the `csrutil` system call used for telemetry would fail on MacOS ARM machines with System Integrity Protection disabled. [#2441](https://github.com/github/codeql-action/pull/2441)
|
- Fix an issue where the `csrutil` system call used for telemetry would fail on macOS ARM machines with System Integrity Protection disabled. [#2441](https://github.com/github/codeql-action/pull/2441)
|
||||||
|
|
||||||
## 3.26.4 - 21 Aug 2024
|
## 2.26.4 - 21 Aug 2024
|
||||||
|
|
||||||
- _Deprecation:_ The `add-snippets` input on the `analyze` Action is deprecated and will be removed in the first release in August 2025. [#2436](https://github.com/github/codeql-action/pull/2436)
|
- _Deprecation:_ The `add-snippets` input on the `analyze` Action is deprecated and will be removed in the first release in August 2025. [#2436](https://github.com/github/codeql-action/pull/2436)
|
||||||
- Fix an issue where the disk usage system call used for telemetry would fail on MacOS ARM machines with System Integrity Protection disabled, and then surface a warning. The system call is now disabled for these machines. [#2434](https://github.com/github/codeql-action/pull/2434)
|
- Fix an issue where the disk usage system call used for telemetry would fail on macOS ARM machines with System Integrity Protection disabled, and then surface a warning. The system call is now disabled for these machines. [#2434](https://github.com/github/codeql-action/pull/2434)
|
||||||
|
|
||||||
## 3.26.3 - 19 Aug 2024
|
## 2.26.3 - 19 Aug 2024
|
||||||
|
|
||||||
- Fix an issue where the CodeQL Action could not write diagnostic messages on Windows. This issue did not impact analysis quality. [#2430](https://github.com/github/codeql-action/pull/2430)
|
- Fix an issue where the CodeQL Action could not write diagnostic messages on Windows. This issue did not impact analysis quality. [#2430](https://github.com/github/codeql-action/pull/2430)
|
||||||
|
|
||||||
## 3.26.2 - 14 Aug 2024
|
## 2.26.2 - 14 Aug 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.18.2. [#2417](https://github.com/github/codeql-action/pull/2417)
|
- Update default CodeQL bundle version to 2.18.2. [#2417](https://github.com/github/codeql-action/pull/2417)
|
||||||
|
|
||||||
## 3.26.1 - 13 Aug 2024
|
## 2.26.1 - 13 Aug 2024
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
## 3.26.0 - 06 Aug 2024
|
## 2.26.0 - 06 Aug 2024
|
||||||
|
|
||||||
- _Deprecation:_ Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you. [#2403](https://github.com/github/codeql-action/pull/2403)
|
- _Deprecation:_ Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you. [#2403](https://github.com/github/codeql-action/pull/2403)
|
||||||
- Bump the minimum CodeQL bundle version to 2.13.5. [#2408](https://github.com/github/codeql-action/pull/2408)
|
- Bump the minimum CodeQL bundle version to 2.13.5. [#2408](https://github.com/github/codeql-action/pull/2408)
|
||||||
|
|
||||||
## 3.25.15 - 26 Jul 2024
|
## 2.25.15 - 26 Jul 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.18.1. [#2385](https://github.com/github/codeql-action/pull/2385)
|
- Update default CodeQL bundle version to 2.18.1. [#2385](https://github.com/github/codeql-action/pull/2385)
|
||||||
|
|
||||||
## 3.25.14 - 25 Jul 2024
|
## 2.25.14 - 25 Jul 2024
|
||||||
|
|
||||||
- Experimental: add a new `start-proxy` action which starts the same HTTP proxy as used by [`github/dependabot-action`](https://github.com/github/dependabot-action). Do not use this in production as it is part of an internal experiment and subject to change at any time. [#2376](https://github.com/github/codeql-action/pull/2376)
|
- Experimental: add a new `start-proxy` action which starts the same HTTP proxy as used by [`github/dependabot-action`](https://github.com/github/dependabot-action). Do not use this in production as it is part of an internal experiment and subject to change at any time. [#2376](https://github.com/github/codeql-action/pull/2376)
|
||||||
|
|
||||||
## 3.25.13 - 19 Jul 2024
|
## 2.25.13 - 19 Jul 2024
|
||||||
|
|
||||||
- Add `codeql-version` to outputs. [#2368](https://github.com/github/codeql-action/pull/2368)
|
- Add `codeql-version` to outputs. [#2368](https://github.com/github/codeql-action/pull/2368)
|
||||||
- Add a deprecation warning for customers using CodeQL version 2.13.4 and earlier. These versions of CodeQL were discontinued on 9 July 2024 alongside GitHub Enterprise Server 3.9, and will be unsupported by CodeQL Action versions 3.26.0 and later and versions 2.26.0 and later. [#2375](https://github.com/github/codeql-action/pull/2375)
|
- Add a deprecation warning for customers using CodeQL version 2.13.4 and earlier. These versions of CodeQL were discontinued on 9 July 2024 alongside GitHub Enterprise Server 3.9, and will be unsupported by CodeQL Action versions 3.26.0 and later and versions 2.26.0 and later. [#2375](https://github.com/github/codeql-action/pull/2375)
|
||||||
- If you are using one of these versions, please update to CodeQL CLI version 2.13.5 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.
|
- If you are using one of these versions, please update to CodeQL CLI version 2.13.5 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.12.6 and 2.13.4, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.25.13` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.25.13` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
- Alternatively, if you want to continue using a version of the CodeQL CLI between 2.12.6 and 2.13.4, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.25.13` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.25.13` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
||||||
|
|
||||||
## 3.25.12 - 12 Jul 2024
|
## 2.25.12 - 12 Jul 2024
|
||||||
|
|
||||||
- Improve 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) on GitHub Enterprise Server. This feature is already available to GitHub.com users. [#2353](https://github.com/github/codeql-action/pull/2353)
|
- Improve 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) on GitHub Enterprise Server. This feature is already available to GitHub.com users. [#2353](https://github.com/github/codeql-action/pull/2353)
|
||||||
- Update default CodeQL bundle version to 2.18.0. [#2364](https://github.com/github/codeql-action/pull/2364)
|
- Update default CodeQL bundle version to 2.18.0. [#2364](https://github.com/github/codeql-action/pull/2364)
|
||||||
|
|
||||||
## 3.25.11 - 28 Jun 2024
|
## 2.25.11 - 28 Jun 2024
|
||||||
|
|
||||||
- Avoid failing the workflow run if there is an error while uploading debug artifacts. [#2349](https://github.com/github/codeql-action/pull/2349)
|
- Avoid failing the workflow run if there is an error while uploading debug artifacts. [#2349](https://github.com/github/codeql-action/pull/2349)
|
||||||
- Update default CodeQL bundle version to 2.17.6. [#2352](https://github.com/github/codeql-action/pull/2352)
|
- Update default CodeQL bundle version to 2.17.6. [#2352](https://github.com/github/codeql-action/pull/2352)
|
||||||
|
|
||||||
## 3.25.10 - 13 Jun 2024
|
## 2.25.10 - 13 Jun 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.5. [#2327](https://github.com/github/codeql-action/pull/2327)
|
- Update default CodeQL bundle version to 2.17.5. [#2327](https://github.com/github/codeql-action/pull/2327)
|
||||||
|
|
||||||
## 3.25.9 - 12 Jun 2024
|
## 2.25.9 - 12 Jun 2024
|
||||||
|
|
||||||
- Avoid failing database creation if the database folder already exists and contains some unexpected files. Requires CodeQL 2.18.0 or higher. [#2330](https://github.com/github/codeql-action/pull/2330)
|
- Avoid failing database creation if the database folder already exists and contains some unexpected files. Requires CodeQL 2.18.0 or higher. [#2330](https://github.com/github/codeql-action/pull/2330)
|
||||||
- The init Action will attempt to clean up the database cluster directory before creating a new database and at the end of the job. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332)
|
- The init Action will attempt to clean up the database cluster directory before creating a new database and at the end of the job. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332)
|
||||||
|
|
||||||
## 3.25.8 - 04 Jun 2024
|
## 2.25.8 - 04 Jun 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.4. [#2321](https://github.com/github/codeql-action/pull/2321)
|
- Update default CodeQL bundle version to 2.17.4. [#2321](https://github.com/github/codeql-action/pull/2321)
|
||||||
|
|
||||||
## 3.25.7 - 31 May 2024
|
## 2.25.7 - 31 May 2024
|
||||||
|
|
||||||
- We are rolling out a feature in May/June 2024 that will reduce the Actions cache usage of the Action by keeping only the newest TRAP cache for each language. [#2306](https://github.com/github/codeql-action/pull/2306)
|
- We are rolling out a feature in May/June 2024 that will reduce the Actions cache usage of the Action by keeping only the newest TRAP cache for each language. [#2306](https://github.com/github/codeql-action/pull/2306)
|
||||||
|
|
||||||
## 3.25.6 - 20 May 2024
|
## 2.25.6 - 20 May 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.3. [#2295](https://github.com/github/codeql-action/pull/2295)
|
- Update default CodeQL bundle version to 2.17.3. [#2295](https://github.com/github/codeql-action/pull/2295)
|
||||||
|
|
||||||
## 3.25.5 - 13 May 2024
|
## 2.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)
|
- 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)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.25.4 - 08 May 2024
|
## 2.25.4 - 08 May 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.2. [#2270](https://github.com/github/codeql-action/pull/2270)
|
- Update default CodeQL bundle version to 2.17.2. [#2270](https://github.com/github/codeql-action/pull/2270)
|
||||||
|
|
||||||
## 3.25.3 - 25 Apr 2024
|
## 2.25.3 - 25 Apr 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.1. [#2247](https://github.com/github/codeql-action/pull/2247)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.25.2 - 22 Apr 2024
|
## 2.25.2 - 22 Apr 2024
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
## 3.25.1 - 17 Apr 2024
|
## 2.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)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.25.0 - 15 Apr 2024
|
## 2.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)
|
- 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:
|
As a result, the following inputs and environment variables are now ignored:
|
||||||
|
|
||||||
- The `setup-python-dependencies` input to the `init` Action
|
- The `setup-python-dependencies` input to the `init` Action
|
||||||
- The `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION` environment variable
|
- 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.
|
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)
|
- 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)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.24.10 - 05 Apr 2024
|
## 2.24.10 - 05 Apr 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.0. [#2219](https://github.com/github/codeql-action/pull/2219)
|
- 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)
|
- 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.
|
- 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.
|
- 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.
|
||||||
|
|
||||||
## 3.24.9 - 22 Mar 2024
|
## 2.24.9 - 22 Mar 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203)
|
- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203)
|
||||||
|
|
||||||
## 3.24.8 - 18 Mar 2024
|
## 2.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)
|
- 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)
|
||||||
|
|
||||||
## 3.24.7 - 12 Mar 2024
|
## 2.24.7 - 12 Mar 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185)
|
- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185)
|
||||||
|
|
||||||
## 3.24.6 - 29 Feb 2024
|
## 2.24.6 - 29 Feb 2024
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
## 3.24.5 - 23 Feb 2024
|
## 2.24.5 - 23 Feb 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156)
|
- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156)
|
||||||
|
|
||||||
## 3.24.4 - 21 Feb 2024
|
## 2.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)
|
- 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)
|
||||||
|
|
||||||
## 3.24.3 - 15 Feb 2024
|
## 2.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)
|
- 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)
|
||||||
|
|
||||||
## 3.24.2 - 15 Feb 2024
|
## 2.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)
|
- 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)
|
||||||
|
|
||||||
## 3.24.1 - 13 Feb 2024
|
## 2.24.1 - 13 Feb 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.24.0 - 02 Feb 2024
|
## 2.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)
|
- 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)
|
||||||
|
|
||||||
## 3.23.2 - 26 Jan 2024
|
## 2.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)
|
- 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)
|
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)
|
||||||
|
|
||||||
## 3.23.1 - 17 Jan 2024
|
## 2.23.1 - 17 Jan 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.23.0 - 08 Jan 2024
|
## 2.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)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
## 3.22.12 - 22 Dec 2023
|
## 2.22.12 - 22 Dec 2023
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047)
|
- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047)
|
||||||
|
|
||||||
## 3.22.11 - 13 Dec 2023
|
## 2.22.11 - 13 Dec 2023
|
||||||
|
|
||||||
- [v3+ only] The CodeQL Action now runs on Node.js v20. [#2006](https://github.com/github/codeql-action/pull/2006)
|
No user facing changes.
|
||||||
|
|
||||||
## 2.22.10 - 12 Dec 2023
|
## 2.22.10 - 12 Dec 2023
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,6 @@ outputs:
|
|||||||
sarif-id:
|
sarif-id:
|
||||||
description: The ID of the uploaded SARIF file.
|
description: The ID of the uploaded SARIF file.
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: "../lib/analyze-action.js"
|
main: "../lib/analyze-action.js"
|
||||||
post: "../lib/analyze-action-post.js"
|
post: "../lib/analyze-action-post.js"
|
||||||
|
|||||||
@@ -15,5 +15,5 @@ inputs:
|
|||||||
$GITHUB_WORKSPACE as its working directory.
|
$GITHUB_WORKSPACE as its working directory.
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: '../lib/autobuild-action.js'
|
main: '../lib/autobuild-action.js'
|
||||||
|
|||||||
@@ -146,6 +146,6 @@ outputs:
|
|||||||
codeql-version:
|
codeql-version:
|
||||||
description: The version of the CodeQL binary used for analysis
|
description: The version of the CodeQL binary used for analysis
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: '../lib/init-action.js'
|
main: '../lib/init-action.js'
|
||||||
post: '../lib/init-action-post.js'
|
post: '../lib/init-action-post.js'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bundleVersion": "codeql-bundle-v2.19.2",
|
"bundleVersion": "codeql-bundle-v2.19.3",
|
||||||
"cliVersion": "2.19.2",
|
"cliVersion": "2.19.3",
|
||||||
"priorBundleVersion": "codeql-bundle-v2.19.1",
|
"priorBundleVersion": "codeql-bundle-v2.19.2",
|
||||||
"priorCliVersion": "2.19.1"
|
"priorCliVersion": "2.19.2"
|
||||||
}
|
}
|
||||||
|
|||||||
2
lib/environment.js
generated
2
lib/environment.js
generated
@@ -44,7 +44,7 @@ var EnvVar;
|
|||||||
/** Whether the init action has been run. */
|
/** Whether the init action has been run. */
|
||||||
EnvVar["INIT_ACTION_HAS_RUN"] = "CODEQL_ACTION_INIT_HAS_RUN";
|
EnvVar["INIT_ACTION_HAS_RUN"] = "CODEQL_ACTION_INIT_HAS_RUN";
|
||||||
/**
|
/**
|
||||||
* For MacOS. Result of `csrutil status` to determine whether System Integrity
|
* For macOS. Result of `csrutil status` to determine whether System Integrity
|
||||||
* Protection is enabled.
|
* Protection is enabled.
|
||||||
*/
|
*/
|
||||||
EnvVar["IS_SIP_ENABLED"] = "CODEQL_ACTION_IS_SIP_ENABLED";
|
EnvVar["IS_SIP_ENABLED"] = "CODEQL_ACTION_IS_SIP_ENABLED";
|
||||||
|
|||||||
4
lib/init-action.js
generated
4
lib/init-action.js
generated
@@ -330,13 +330,13 @@ async function run() {
|
|||||||
if ((0, caching_utils_1.shouldRestoreCache)(config.dependencyCachingEnabled)) {
|
if ((0, caching_utils_1.shouldRestoreCache)(config.dependencyCachingEnabled)) {
|
||||||
await (0, dependency_caching_1.downloadDependencyCaches)(config.languages, logger);
|
await (0, dependency_caching_1.downloadDependencyCaches)(config.languages, logger);
|
||||||
}
|
}
|
||||||
// For CLI versions <2.15.1, build tracing caused errors in MacOS ARM machines with
|
// For CLI versions <2.15.1, build tracing caused errors in macOS ARM machines with
|
||||||
// System Integrity Protection (SIP) disabled.
|
// System Integrity Protection (SIP) disabled.
|
||||||
if (!(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.15.1")) &&
|
if (!(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.15.1")) &&
|
||||||
process.platform === "darwin" &&
|
process.platform === "darwin" &&
|
||||||
(process.arch === "arm" || process.arch === "arm64") &&
|
(process.arch === "arm" || process.arch === "arm64") &&
|
||||||
!(await (0, util_1.checkSipEnablement)(logger))) {
|
!(await (0, util_1.checkSipEnablement)(logger))) {
|
||||||
logger.warning("CodeQL versions 2.15.0 and lower are not supported on MacOS ARM machines with System Integrity Protection (SIP) disabled.");
|
logger.warning("CodeQL versions 2.15.0 and lower are not supported on macOS ARM machines with System Integrity Protection (SIP) disabled.");
|
||||||
}
|
}
|
||||||
// From 2.16.0 the default for the python extractor is to not perform any
|
// From 2.16.0 the default for the python extractor is to not perform any
|
||||||
// dependency extraction. For versions before that, you needed to set this flag to
|
// dependency extraction. For versions before that, you needed to set this flag to
|
||||||
|
|||||||
2
lib/tracer-config.js
generated
2
lib/tracer-config.js
generated
@@ -92,7 +92,7 @@ async function getCombinedTracerConfig(codeql, config) {
|
|||||||
// If the CLI doesn't yet support setting the CODEQL_RUNNER environment variable to
|
// If the CLI doesn't yet support setting the CODEQL_RUNNER environment variable to
|
||||||
// the runner executable path, we set it here in the Action.
|
// the runner executable path, we set it here in the Action.
|
||||||
if (!(await codeql.supportsFeature(tools_features_1.ToolsFeature.SetsCodeqlRunnerEnvVar))) {
|
if (!(await codeql.supportsFeature(tools_features_1.ToolsFeature.SetsCodeqlRunnerEnvVar))) {
|
||||||
// On MacOS when System Integrity Protection is enabled, it's necessary to prefix
|
// On macOS when System Integrity Protection is enabled, it's necessary to prefix
|
||||||
// the build command with the runner executable for indirect tracing, so we expose
|
// the build command with the runner executable for indirect tracing, so we expose
|
||||||
// it here via the CODEQL_RUNNER environment variable.
|
// it here via the CODEQL_RUNNER environment variable.
|
||||||
// The executable also exists and works for other platforms so we unconditionally
|
// The executable also exists and works for other platforms so we unconditionally
|
||||||
|
|||||||
14
node_modules/.package-lock.json
generated
vendored
14
node_modules/.package-lock.json
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codeql",
|
"name": "codeql",
|
||||||
"version": "3.27.1",
|
"version": "2.27.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
@@ -1272,11 +1272,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.9.0",
|
"version": "16.11.22",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.22.tgz",
|
||||||
"dependencies": {
|
"integrity": "sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA=="
|
||||||
"undici-types": "~5.26.4"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/@types/node-forge": {
|
"node_modules/@types/node-forge": {
|
||||||
"version": "1.3.11",
|
"version": "1.3.11",
|
||||||
@@ -7195,10 +7193,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
|
||||||
"version": "5.26.5",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/universal-user-agent": {
|
"node_modules/universal-user-agent": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
|
|||||||
0
node_modules/@types/node/LICENSE
generated
vendored
Normal file → Executable file
0
node_modules/@types/node/LICENSE
generated
vendored
Normal file → Executable file
11
node_modules/@types/node/README.md
generated
vendored
Normal file → Executable file
11
node_modules/@types/node/README.md
generated
vendored
Normal file → Executable file
@@ -2,14 +2,15 @@
|
|||||||
> `npm install --save @types/node`
|
> `npm install --save @types/node`
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
This package contains type definitions for node (https://nodejs.org/).
|
This package contains type definitions for Node.js (https://nodejs.org/).
|
||||||
|
|
||||||
# Details
|
# Details
|
||||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
|
||||||
|
|
||||||
### Additional Details
|
### Additional Details
|
||||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
* Last updated: Tue, 01 Feb 2022 08:31:30 GMT
|
||||||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
* Dependencies: none
|
||||||
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
|
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [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).
|
||||||
|
|||||||
282
node_modules/@types/node/assert.d.ts
generated
vendored
Normal file → Executable file
282
node_modules/@types/node/assert.d.ts
generated
vendored
Normal file → Executable file
@@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:assert` module provides a set of assertion functions for verifying
|
* The `assert` module provides a set of assertion functions for verifying
|
||||||
* invariants.
|
* invariants.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
|
||||||
*/
|
*/
|
||||||
declare module "assert" {
|
declare module 'assert' {
|
||||||
/**
|
/**
|
||||||
* An alias of {@link ok}.
|
* An alias of {@link ok}.
|
||||||
* @since v0.5.9
|
* @since v0.5.9
|
||||||
@@ -12,29 +12,15 @@ declare module "assert" {
|
|||||||
function assert(value: unknown, message?: string | Error): asserts value;
|
function assert(value: unknown, message?: string | Error): asserts value;
|
||||||
namespace assert {
|
namespace assert {
|
||||||
/**
|
/**
|
||||||
* Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class.
|
* Indicates the failure of an assertion. All errors thrown by the `assert` module
|
||||||
|
* will be instances of the `AssertionError` class.
|
||||||
*/
|
*/
|
||||||
class AssertionError extends Error {
|
class AssertionError extends Error {
|
||||||
/**
|
|
||||||
* Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
|
|
||||||
*/
|
|
||||||
actual: unknown;
|
actual: unknown;
|
||||||
/**
|
|
||||||
* Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
|
|
||||||
*/
|
|
||||||
expected: unknown;
|
expected: unknown;
|
||||||
/**
|
|
||||||
* Set to the passed in operator value.
|
|
||||||
*/
|
|
||||||
operator: string;
|
operator: string;
|
||||||
/**
|
|
||||||
* Indicates if the message was auto-generated (`true`) or not.
|
|
||||||
*/
|
|
||||||
generatedMessage: boolean;
|
generatedMessage: boolean;
|
||||||
/**
|
code: 'ERR_ASSERTION';
|
||||||
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
|
|
||||||
*/
|
|
||||||
code: "ERR_ASSERTION";
|
|
||||||
constructor(options?: {
|
constructor(options?: {
|
||||||
/** If provided, the error message is set to this value. */
|
/** If provided, the error message is set to this value. */
|
||||||
message?: string | undefined;
|
message?: string | undefined;
|
||||||
@@ -50,10 +36,9 @@ declare module "assert" {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This feature is deprecated and will be removed in a future version.
|
* This feature is currently experimental and behavior might still change.
|
||||||
* Please consider using alternatives such as the `mock` helper function.
|
|
||||||
* @since v14.2.0, v12.19.0
|
* @since v14.2.0, v12.19.0
|
||||||
* @deprecated Deprecated
|
* @experimental
|
||||||
*/
|
*/
|
||||||
class CallTracker {
|
class CallTracker {
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +47,7 @@ declare module "assert" {
|
|||||||
* error.
|
* error.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* // Creates call tracker.
|
* // Creates call tracker.
|
||||||
* const tracker = new assert.CallTracker();
|
* const tracker = new assert.CallTracker();
|
||||||
@@ -80,44 +65,26 @@ declare module "assert" {
|
|||||||
*/
|
*/
|
||||||
calls(exact?: number): () => void;
|
calls(exact?: number): () => void;
|
||||||
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
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 arrays contains information about the expected and actual number of calls of
|
||||||
* the functions that have not been called the expected number of times.
|
* the functions that have not been called the expected number of times.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* // Creates call tracker.
|
* // Creates call tracker.
|
||||||
* const tracker = new assert.CallTracker();
|
* const tracker = new assert.CallTracker();
|
||||||
*
|
*
|
||||||
* function func() {}
|
* function func() {}
|
||||||
*
|
*
|
||||||
|
* function foo() {}
|
||||||
|
*
|
||||||
* // Returns a function that wraps func() that must be called exact times
|
* // Returns a function that wraps func() that must be called exact times
|
||||||
* // before tracker.verify().
|
* // before tracker.verify().
|
||||||
* const callsfunc = tracker.calls(func, 2);
|
* const callsfunc = tracker.calls(func, 2);
|
||||||
*
|
*
|
||||||
* // Returns an array containing information on callsfunc()
|
* // Returns an array containing information on callsfunc()
|
||||||
* console.log(tracker.report());
|
* tracker.report();
|
||||||
* // [
|
* // [
|
||||||
* // {
|
* // {
|
||||||
* // message: 'Expected the func function to be executed 2 time(s) but was
|
* // message: 'Expected the func function to be executed 2 time(s) but was
|
||||||
@@ -130,39 +97,15 @@ declare module "assert" {
|
|||||||
* // ]
|
* // ]
|
||||||
* ```
|
* ```
|
||||||
* @since v14.2.0, v12.19.0
|
* @since v14.2.0, v12.19.0
|
||||||
* @return An Array of objects containing information about the wrapper functions returned by `calls`.
|
* @return of objects containing information about the wrapper functions returned by `calls`.
|
||||||
*/
|
*/
|
||||||
report(): CallTrackerReportInformation[];
|
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
|
* 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.
|
* have not been called the expected number of times.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* // Creates call tracker.
|
* // Creates call tracker.
|
||||||
* const tracker = new assert.CallTracker();
|
* const tracker = new assert.CallTracker();
|
||||||
@@ -182,10 +125,6 @@ declare module "assert" {
|
|||||||
*/
|
*/
|
||||||
verify(): void;
|
verify(): void;
|
||||||
}
|
}
|
||||||
interface CallTrackerCall {
|
|
||||||
thisArg: object;
|
|
||||||
arguments: unknown[];
|
|
||||||
}
|
|
||||||
interface CallTrackerReportInformation {
|
interface CallTrackerReportInformation {
|
||||||
message: string;
|
message: string;
|
||||||
/** The actual number of times the function was called. */
|
/** The actual number of times the function was called. */
|
||||||
@@ -197,14 +136,14 @@ declare module "assert" {
|
|||||||
/** A stack trace of the function. */
|
/** A stack trace of the function. */
|
||||||
stack: object;
|
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
|
* Throws an `AssertionError` with the provided error message or a default
|
||||||
* error message. If the `message` parameter is an instance of an `Error` then
|
* error message. If the `message` parameter is an instance of an `Error` then
|
||||||
* it will be thrown instead of the `AssertionError`.
|
* it will be thrown instead of the `AssertionError`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.fail();
|
* assert.fail();
|
||||||
* // AssertionError [ERR_ASSERTION]: Failed
|
* // AssertionError [ERR_ASSERTION]: Failed
|
||||||
@@ -229,7 +168,7 @@ declare module "assert" {
|
|||||||
message?: string | Error,
|
message?: string | Error,
|
||||||
operator?: string,
|
operator?: string,
|
||||||
// tslint:disable-next-line:ban-types
|
// tslint:disable-next-line:ban-types
|
||||||
stackStartFn?: Function,
|
stackStartFn?: Function
|
||||||
): never;
|
): never;
|
||||||
/**
|
/**
|
||||||
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
|
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
|
||||||
@@ -242,7 +181,7 @@ declare module "assert" {
|
|||||||
* thrown in a file! See below for further details.
|
* thrown in a file! See below for further details.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.ok(true);
|
* assert.ok(true);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -277,7 +216,7 @@ declare module "assert" {
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* // Using `assert()` works the same:
|
* // Using `assert()` works the same:
|
||||||
* assert(0);
|
* assert(0);
|
||||||
@@ -298,11 +237,11 @@ declare module "assert" {
|
|||||||
* > Stability: 3 - Legacy: Use {@link strictEqual} instead.
|
* > Stability: 3 - Legacy: Use {@link strictEqual} instead.
|
||||||
*
|
*
|
||||||
* Tests shallow, coercive equality between the `actual` and `expected` parameters
|
* Tests shallow, coercive equality between the `actual` and `expected` parameters
|
||||||
* using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled
|
* using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled
|
||||||
* and treated as being identical if both sides are `NaN`.
|
* and treated as being identical in case both sides are `NaN`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* assert.equal(1, 1);
|
* assert.equal(1, 1);
|
||||||
* // OK, 1 == 1
|
* // OK, 1 == 1
|
||||||
@@ -331,11 +270,12 @@ declare module "assert" {
|
|||||||
*
|
*
|
||||||
* > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
|
* > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
|
||||||
*
|
*
|
||||||
* Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is
|
* 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
|
||||||
* specially handled and treated as being identical if both sides are `NaN`.
|
* being identical in case both
|
||||||
|
* sides are `NaN`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* assert.notEqual(1, 2);
|
* assert.notEqual(1, 2);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -382,24 +322,24 @@ declare module "assert" {
|
|||||||
* Tests for any deep inequality. Opposite of {@link deepEqual}.
|
* Tests for any deep inequality. Opposite of {@link deepEqual}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* const obj1 = {
|
* const obj1 = {
|
||||||
* a: {
|
* a: {
|
||||||
* b: 1,
|
* b: 1
|
||||||
* },
|
* }
|
||||||
* };
|
* };
|
||||||
* const obj2 = {
|
* const obj2 = {
|
||||||
* a: {
|
* a: {
|
||||||
* b: 2,
|
* b: 2
|
||||||
* },
|
* }
|
||||||
* };
|
* };
|
||||||
* const obj3 = {
|
* const obj3 = {
|
||||||
* a: {
|
* a: {
|
||||||
* b: 1,
|
* b: 1
|
||||||
* },
|
* }
|
||||||
* };
|
* };
|
||||||
* const obj4 = { __proto__: obj1 };
|
* const obj4 = Object.create(obj1);
|
||||||
*
|
*
|
||||||
* assert.notDeepEqual(obj1, obj1);
|
* assert.notDeepEqual(obj1, obj1);
|
||||||
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
||||||
@@ -422,10 +362,10 @@ declare module "assert" {
|
|||||||
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
||||||
/**
|
/**
|
||||||
* Tests strict equality between the `actual` and `expected` parameters as
|
* Tests strict equality between the `actual` and `expected` parameters as
|
||||||
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
|
* determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.strictEqual(1, 2);
|
* assert.strictEqual(1, 2);
|
||||||
* // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
|
* // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
|
||||||
@@ -460,10 +400,10 @@ declare module "assert" {
|
|||||||
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
||||||
/**
|
/**
|
||||||
* Tests strict inequality between the `actual` and `expected` parameters as
|
* Tests strict inequality between the `actual` and `expected` parameters as
|
||||||
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
|
* determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.notStrictEqual(1, 2);
|
* assert.notStrictEqual(1, 2);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -494,7 +434,7 @@ declare module "assert" {
|
|||||||
* Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
|
* Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
|
* assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
|
||||||
* // OK
|
* // OK
|
||||||
@@ -525,14 +465,14 @@ declare module "assert" {
|
|||||||
* Custom validation object/error instance:
|
* Custom validation object/error instance:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* const err = new TypeError('Wrong value');
|
* const err = new TypeError('Wrong value');
|
||||||
* err.code = 404;
|
* err.code = 404;
|
||||||
* err.foo = 'bar';
|
* err.foo = 'bar';
|
||||||
* err.info = {
|
* err.info = {
|
||||||
* nested: true,
|
* nested: true,
|
||||||
* baz: 'text',
|
* baz: 'text'
|
||||||
* };
|
* };
|
||||||
* err.reg = /abc/i;
|
* err.reg = /abc/i;
|
||||||
*
|
*
|
||||||
@@ -545,16 +485,16 @@ declare module "assert" {
|
|||||||
* message: 'Wrong value',
|
* message: 'Wrong value',
|
||||||
* info: {
|
* info: {
|
||||||
* nested: true,
|
* nested: true,
|
||||||
* baz: 'text',
|
* baz: 'text'
|
||||||
* },
|
* }
|
||||||
* // Only properties on the validation object will be tested for.
|
* // Only properties on the validation object will be tested for.
|
||||||
* // Using nested objects requires all properties to be present. Otherwise
|
* // Using nested objects requires all properties to be present. Otherwise
|
||||||
* // the validation is going to fail.
|
* // the validation is going to fail.
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Using regular expressions to validate error properties:
|
* // Using regular expressions to validate error properties:
|
||||||
* assert.throws(
|
* throws(
|
||||||
* () => {
|
* () => {
|
||||||
* throw err;
|
* throw err;
|
||||||
* },
|
* },
|
||||||
@@ -568,17 +508,17 @@ declare module "assert" {
|
|||||||
* info: {
|
* info: {
|
||||||
* nested: true,
|
* nested: true,
|
||||||
* // It is not possible to use regular expressions for nested properties!
|
* // 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
|
* // The `reg` property contains a regular expression and only if the
|
||||||
* // validation object contains an identical regular expression, it is going
|
* // validation object contains an identical regular expression, it is going
|
||||||
* // to pass.
|
* // to pass.
|
||||||
* reg: /abc/i,
|
* reg: /abc/i
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Fails due to the different `message` and `name` properties:
|
* // Fails due to the different `message` and `name` properties:
|
||||||
* assert.throws(
|
* throws(
|
||||||
* () => {
|
* () => {
|
||||||
* const otherErr = new Error('Not found');
|
* const otherErr = new Error('Not found');
|
||||||
* // Copy all enumerable properties from `err` to `otherErr`.
|
* // Copy all enumerable properties from `err` to `otherErr`.
|
||||||
@@ -589,20 +529,20 @@ declare module "assert" {
|
|||||||
* },
|
* },
|
||||||
* // The error's `message` and `name` properties will also be checked when using
|
* // The error's `message` and `name` properties will also be checked when using
|
||||||
* // an error as validation object.
|
* // an error as validation object.
|
||||||
* err,
|
* err
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Validate instanceof using constructor:
|
* Validate instanceof using constructor:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.throws(
|
* assert.throws(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new Error('Wrong value');
|
* throw new Error('Wrong value');
|
||||||
* },
|
* },
|
||||||
* Error,
|
* Error
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -612,13 +552,13 @@ declare module "assert" {
|
|||||||
* therefore also include the error name.
|
* therefore also include the error name.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.throws(
|
* assert.throws(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new Error('Wrong value');
|
* throw new Error('Wrong value');
|
||||||
* },
|
* },
|
||||||
* /^Error: Wrong value$/,
|
* /^Error: Wrong value$/
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -628,7 +568,7 @@ declare module "assert" {
|
|||||||
* It will otherwise fail with an `AssertionError`.
|
* It will otherwise fail with an `AssertionError`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.throws(
|
* assert.throws(
|
||||||
* () => {
|
* () => {
|
||||||
@@ -644,7 +584,7 @@ declare module "assert" {
|
|||||||
* // possible.
|
* // possible.
|
||||||
* return true;
|
* return true;
|
||||||
* },
|
* },
|
||||||
* 'unexpected error',
|
* 'unexpected error'
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -654,7 +594,7 @@ declare module "assert" {
|
|||||||
* a string as the second argument gets considered:
|
* a string as the second argument gets considered:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* function throwingFirst() {
|
* function throwingFirst() {
|
||||||
* throw new Error('First');
|
* throw new Error('First');
|
||||||
@@ -710,20 +650,20 @@ declare module "assert" {
|
|||||||
* propagated back to the caller.
|
* propagated back to the caller.
|
||||||
*
|
*
|
||||||
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
|
* 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.
|
* function. See {@link throws} for more details.
|
||||||
*
|
*
|
||||||
* The following, for instance, will throw the `TypeError` because there is no
|
* The following, for instance, will throw the `TypeError` because there is no
|
||||||
* matching error type in the assertion:
|
* matching error type in the assertion:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotThrow(
|
* assert.doesNotThrow(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* SyntaxError,
|
* SyntaxError
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -731,27 +671,27 @@ declare module "assert" {
|
|||||||
* 'Got unwanted exception...':
|
* 'Got unwanted exception...':
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotThrow(
|
* assert.doesNotThrow(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new TypeError('Wrong value');
|
* 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:
|
* 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
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotThrow(
|
* assert.doesNotThrow(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* /Wrong value/,
|
* /Wrong value/,
|
||||||
* 'Whoops',
|
* 'Whoops'
|
||||||
* );
|
* );
|
||||||
* // Throws: AssertionError: Got unwanted exception: Whoops
|
* // Throws: AssertionError: Got unwanted exception: Whoops
|
||||||
* ```
|
* ```
|
||||||
@@ -765,7 +705,7 @@ declare module "assert" {
|
|||||||
* from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
|
* from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.ifError(null);
|
* assert.ifError(null);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -811,7 +751,7 @@ declare module "assert" {
|
|||||||
* If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
|
* If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* await assert.rejects(
|
* await assert.rejects(
|
||||||
* async () => {
|
* async () => {
|
||||||
@@ -819,13 +759,13 @@ declare module "assert" {
|
|||||||
* },
|
* },
|
||||||
* {
|
* {
|
||||||
* name: 'TypeError',
|
* name: 'TypeError',
|
||||||
* message: 'Wrong value',
|
* message: 'Wrong value'
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* await assert.rejects(
|
* await assert.rejects(
|
||||||
* async () => {
|
* async () => {
|
||||||
@@ -835,16 +775,16 @@ declare module "assert" {
|
|||||||
* assert.strictEqual(err.name, 'TypeError');
|
* assert.strictEqual(err.name, 'TypeError');
|
||||||
* assert.strictEqual(err.message, 'Wrong value');
|
* assert.strictEqual(err.message, 'Wrong value');
|
||||||
* return true;
|
* return true;
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.rejects(
|
* assert.rejects(
|
||||||
* Promise.reject(new Error('Wrong value')),
|
* Promise.reject(new Error('Wrong value')),
|
||||||
* Error,
|
* Error
|
||||||
* ).then(() => {
|
* ).then(() => {
|
||||||
* // ...
|
* // ...
|
||||||
* });
|
* });
|
||||||
@@ -857,11 +797,7 @@ declare module "assert" {
|
|||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
||||||
function rejects(
|
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
||||||
error: AssertPredicate,
|
|
||||||
message?: string | Error,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
|
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
|
||||||
* calls the function and awaits the returned promise to complete. It will then
|
* calls the function and awaits the returned promise to complete. It will then
|
||||||
@@ -878,24 +814,24 @@ declare module "assert" {
|
|||||||
* error messages as expressive as possible.
|
* error messages as expressive as possible.
|
||||||
*
|
*
|
||||||
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
|
* 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.
|
* function. See {@link throws} for more details.
|
||||||
*
|
*
|
||||||
* Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
|
* Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* await assert.doesNotReject(
|
* await assert.doesNotReject(
|
||||||
* async () => {
|
* async () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* SyntaxError,
|
* SyntaxError
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
|
* assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
|
||||||
* .then(() => {
|
* .then(() => {
|
||||||
@@ -904,20 +840,13 @@ declare module "assert" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
function doesNotReject(
|
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
||||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||||
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.
|
* Expects the `string` input to match the regular expression.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.match('I will fail', /pass/);
|
* assert.match('I will fail', /pass/);
|
||||||
* // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
|
* // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
|
||||||
@@ -940,7 +869,7 @@ declare module "assert" {
|
|||||||
* Expects the `string` input not to match the regular expression.
|
* Expects the `string` input not to match the regular expression.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotMatch('I will fail', /fail/);
|
* assert.doesNotMatch('I will fail', /fail/);
|
||||||
* // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
|
* // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
|
||||||
@@ -959,38 +888,25 @@ declare module "assert" {
|
|||||||
* @since v13.6.0, v12.16.0
|
* @since v13.6.0, v12.16.0
|
||||||
*/
|
*/
|
||||||
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
||||||
const strict:
|
const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
|
||||||
& Omit<
|
(value: unknown, message?: string | Error): asserts value;
|
||||||
typeof assert,
|
equal: typeof strictEqual;
|
||||||
| "equal"
|
notEqual: typeof notStrictEqual;
|
||||||
| "notEqual"
|
deepEqual: typeof deepStrictEqual;
|
||||||
| "deepEqual"
|
notDeepEqual: typeof notDeepStrictEqual;
|
||||||
| "notDeepEqual"
|
// Mapped types and assertion functions are incompatible?
|
||||||
| "ok"
|
// TS2775: Assertions require every name in the call target
|
||||||
| "strictEqual"
|
// to be declared with an explicit type annotation.
|
||||||
| "deepStrictEqual"
|
ok: typeof ok;
|
||||||
| "ifError"
|
strictEqual: typeof strictEqual;
|
||||||
| "strict"
|
deepStrictEqual: typeof deepStrictEqual;
|
||||||
>
|
ifError: typeof ifError;
|
||||||
& {
|
strict: typeof 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;
|
export = assert;
|
||||||
}
|
}
|
||||||
declare module "node:assert" {
|
declare module 'node:assert' {
|
||||||
import assert = require("assert");
|
import assert = require('assert');
|
||||||
export = assert;
|
export = assert;
|
||||||
}
|
}
|
||||||
|
|||||||
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Normal file → Executable file
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Normal file → Executable file
@@ -1,8 +1,8 @@
|
|||||||
declare module "assert/strict" {
|
declare module 'assert/strict' {
|
||||||
import { strict } from "node:assert";
|
import { strict } from 'node:assert';
|
||||||
export = strict;
|
export = strict;
|
||||||
}
|
}
|
||||||
declare module "node:assert/strict" {
|
declare module 'node:assert/strict' {
|
||||||
import { strict } from "node:assert";
|
import { strict } from 'node:assert';
|
||||||
export = strict;
|
export = strict;
|
||||||
}
|
}
|
||||||
|
|||||||
128
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Normal file → Executable file
128
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Normal file → Executable file
@@ -1,27 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
* We strongly discourage the use of the `async_hooks` API.
|
* The `async_hooks` module provides an API to track asynchronous resources. It
|
||||||
* Other APIs that can cover most of its use cases include:
|
* can be accessed using:
|
||||||
*
|
|
||||||
* * `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
|
* ```js
|
||||||
* import async_hooks from 'node:async_hooks';
|
* import async_hooks from 'async_hooks';
|
||||||
* ```
|
* ```
|
||||||
* @experimental
|
* @experimental
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/async_hooks.js)
|
||||||
*/
|
*/
|
||||||
declare module "async_hooks" {
|
declare module 'async_hooks' {
|
||||||
/**
|
/**
|
||||||
* ```js
|
* ```js
|
||||||
* import { executionAsyncId } from 'node:async_hooks';
|
* import { executionAsyncId } from 'async_hooks';
|
||||||
* import fs from 'node:fs';
|
|
||||||
*
|
*
|
||||||
* console.log(executionAsyncId()); // 1 - bootstrap
|
* console.log(executionAsyncId()); // 1 - bootstrap
|
||||||
* const path = '.';
|
|
||||||
* fs.open(path, 'r', (err, fd) => {
|
* fs.open(path, 'r', (err, fd) => {
|
||||||
* console.log(executionAsyncId()); // 6 - open()
|
* console.log(executionAsyncId()); // 6 - open()
|
||||||
* });
|
* });
|
||||||
@@ -59,8 +51,8 @@ declare module "async_hooks" {
|
|||||||
* but having an object representing the top-level can be helpful.
|
* but having an object representing the top-level can be helpful.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs';
|
* import { open } from 'fs';
|
||||||
* import { executionAsyncId, executionAsyncResource } from 'node:async_hooks';
|
* import { executionAsyncId, executionAsyncResource } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
|
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
|
||||||
* open(new URL(import.meta.url), 'r', (err, fd) => {
|
* open(new URL(import.meta.url), 'r', (err, fd) => {
|
||||||
@@ -72,11 +64,11 @@ declare module "async_hooks" {
|
|||||||
* use of a tracking `Map` to store the metadata:
|
* use of a tracking `Map` to store the metadata:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { createServer } from 'node:http';
|
* import { createServer } from 'http';
|
||||||
* import {
|
* import {
|
||||||
* executionAsyncId,
|
* executionAsyncId,
|
||||||
* executionAsyncResource,
|
* executionAsyncResource,
|
||||||
* createHook,
|
* createHook
|
||||||
* } from 'async_hooks';
|
* } from 'async_hooks';
|
||||||
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
||||||
*
|
*
|
||||||
@@ -86,7 +78,7 @@ declare module "async_hooks" {
|
|||||||
* if (cr) {
|
* if (cr) {
|
||||||
* resource[sym] = cr[sym];
|
* resource[sym] = cr[sym];
|
||||||
* }
|
* }
|
||||||
* },
|
* }
|
||||||
* }).enable();
|
* }).enable();
|
||||||
*
|
*
|
||||||
* const server = createServer((req, res) => {
|
* const server = createServer((req, res) => {
|
||||||
@@ -175,11 +167,11 @@ declare module "async_hooks" {
|
|||||||
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { createHook } from 'node:async_hooks';
|
* import { createHook } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* const asyncHook = createHook({
|
* const asyncHook = createHook({
|
||||||
* init(asyncId, type, triggerAsyncId, resource) { },
|
* init(asyncId, type, triggerAsyncId, resource) { },
|
||||||
* destroy(asyncId) { },
|
* destroy(asyncId) { }
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -231,13 +223,13 @@ declare module "async_hooks" {
|
|||||||
* The following is an overview of the `AsyncResource` API.
|
* The following is an overview of the `AsyncResource` API.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { AsyncResource, executionAsyncId } from 'node:async_hooks';
|
* import { AsyncResource, executionAsyncId } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* // AsyncResource() is meant to be extended. Instantiating a
|
* // AsyncResource() is meant to be extended. Instantiating a
|
||||||
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
||||||
* // async_hook.executionAsyncId() is used.
|
* // async_hook.executionAsyncId() is used.
|
||||||
* const asyncResource = new AsyncResource(
|
* 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
|
* // Run a function in the execution context of the resource. This will
|
||||||
@@ -266,11 +258,14 @@ declare module "async_hooks" {
|
|||||||
* @param type The type of async event.
|
* @param type The type of async event.
|
||||||
* @param triggerAsyncId The ID of the execution context that created
|
* @param triggerAsyncId The ID of the execution context that created
|
||||||
* this async event (default: `executionAsyncId()`), or an
|
* this async event (default: `executionAsyncId()`), or an
|
||||||
* AsyncResourceOptions object (since v9.3.0)
|
* AsyncResourceOptions object (since 9.3)
|
||||||
*/
|
*/
|
||||||
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
||||||
/**
|
/**
|
||||||
* Binds the given function to the current execution context.
|
* 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
|
* @since v14.8.0, v12.19.0
|
||||||
* @param fn The function to bind to the current execution context.
|
* @param fn The function to bind to the current execution context.
|
||||||
* @param type An optional name to associate with the underlying `AsyncResource`.
|
* @param type An optional name to associate with the underlying `AsyncResource`.
|
||||||
@@ -278,14 +273,23 @@ declare module "async_hooks" {
|
|||||||
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
||||||
fn: Func,
|
fn: Func,
|
||||||
type?: string,
|
type?: string,
|
||||||
thisArg?: ThisArg,
|
thisArg?: ThisArg
|
||||||
): Func;
|
): Func & {
|
||||||
|
asyncResource: AsyncResource;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Binds the given function to execute to this `AsyncResource`'s scope.
|
* 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
|
* @since v14.8.0, v12.19.0
|
||||||
* @param fn The function to bind to the current `AsyncResource`.
|
* @param fn The function to bind to the current `AsyncResource`.
|
||||||
*/
|
*/
|
||||||
bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
bind<Func extends (...args: any[]) => any>(
|
||||||
|
fn: Func
|
||||||
|
): Func & {
|
||||||
|
asyncResource: AsyncResource;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Call the provided function with the provided arguments in the execution context
|
* Call the provided function with the provided arguments in the execution context
|
||||||
* of the async resource. This will establish the context, trigger the AsyncHooks
|
* of the async resource. This will establish the context, trigger the AsyncHooks
|
||||||
@@ -296,11 +300,7 @@ declare module "async_hooks" {
|
|||||||
* @param thisArg The receiver to be used for the function call.
|
* @param thisArg The receiver to be used for the function call.
|
||||||
* @param args Optional arguments to pass to the function.
|
* @param args Optional arguments to pass to the function.
|
||||||
*/
|
*/
|
||||||
runInAsyncScope<This, Result>(
|
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): 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
|
* 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
|
* be thrown if it is called more than once. This **must** be manually called. If
|
||||||
@@ -314,6 +314,7 @@ declare module "async_hooks" {
|
|||||||
*/
|
*/
|
||||||
asyncId(): number;
|
asyncId(): number;
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
||||||
*/
|
*/
|
||||||
triggerAsyncId(): number;
|
triggerAsyncId(): number;
|
||||||
@@ -321,17 +322,17 @@ declare module "async_hooks" {
|
|||||||
/**
|
/**
|
||||||
* This class creates stores that stay coherent through asynchronous operations.
|
* This class creates stores that stay coherent through asynchronous operations.
|
||||||
*
|
*
|
||||||
* While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory
|
* While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe
|
||||||
* safe implementation that involves significant optimizations that are non-obvious
|
* implementation that involves significant optimizations that are non-obvious to
|
||||||
* to implement.
|
* implement.
|
||||||
*
|
*
|
||||||
* The following example uses `AsyncLocalStorage` to build a simple logger
|
* The following example uses `AsyncLocalStorage` to build a simple logger
|
||||||
* that assigns IDs to incoming HTTP requests and includes them in messages
|
* that assigns IDs to incoming HTTP requests and includes them in messages
|
||||||
* logged within each request.
|
* logged within each request.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import http from 'node:http';
|
* import http from 'http';
|
||||||
* import { AsyncLocalStorage } from 'node:async_hooks';
|
* import { AsyncLocalStorage } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* const asyncLocalStorage = new AsyncLocalStorage();
|
* const asyncLocalStorage = new AsyncLocalStorage();
|
||||||
*
|
*
|
||||||
@@ -363,48 +364,10 @@ declare module "async_hooks" {
|
|||||||
*
|
*
|
||||||
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
|
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
|
||||||
* Multiple instances can safely exist simultaneously without risk of interfering
|
* Multiple instances can safely exist simultaneously without risk of interfering
|
||||||
* with each other's data.
|
* with each other data.
|
||||||
* @since v13.10.0, v12.17.0
|
* @since v13.10.0, v12.17.0
|
||||||
*/
|
*/
|
||||||
class AsyncLocalStorage<T> {
|
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
|
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
|
||||||
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
|
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
|
||||||
@@ -432,9 +395,8 @@ declare module "async_hooks" {
|
|||||||
getStore(): T | undefined;
|
getStore(): T | undefined;
|
||||||
/**
|
/**
|
||||||
* Runs a function synchronously within a context and returns its
|
* Runs a function synchronously within a context and returns its
|
||||||
* return value. The store is not accessible outside of the callback function.
|
* return value. The store is not accessible outside of the callback function or
|
||||||
* The store is accessible to any asynchronous operations created within the
|
* the asynchronous operations created within the callback.
|
||||||
* callback.
|
|
||||||
*
|
*
|
||||||
* The optional `args` are passed to the callback function.
|
* The optional `args` are passed to the callback function.
|
||||||
*
|
*
|
||||||
@@ -448,9 +410,6 @@ declare module "async_hooks" {
|
|||||||
* try {
|
* try {
|
||||||
* asyncLocalStorage.run(store, () => {
|
* asyncLocalStorage.run(store, () => {
|
||||||
* asyncLocalStorage.getStore(); // Returns the store object
|
* asyncLocalStorage.getStore(); // Returns the store object
|
||||||
* setTimeout(() => {
|
|
||||||
* asyncLocalStorage.getStore(); // Returns the store object
|
|
||||||
* }, 200);
|
|
||||||
* throw new Error();
|
* throw new Error();
|
||||||
* });
|
* });
|
||||||
* } catch (e) {
|
* } catch (e) {
|
||||||
@@ -460,7 +419,6 @@ declare module "async_hooks" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v13.10.0, v12.17.0
|
* @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;
|
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
|
* Runs a function synchronously outside of a context and returns its
|
||||||
@@ -534,6 +492,6 @@ declare module "async_hooks" {
|
|||||||
enterWith(store: T): void;
|
enterWith(store: T): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:async_hooks" {
|
declare module 'node:async_hooks' {
|
||||||
export * from "async_hooks";
|
export * from 'async_hooks';
|
||||||
}
|
}
|
||||||
|
|||||||
486
node_modules/@types/node/buffer.d.ts
generated
vendored
Normal file → Executable file
486
node_modules/@types/node/buffer.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
530
node_modules/@types/node/child_process.d.ts
generated
vendored
Normal file → Executable file
530
node_modules/@types/node/child_process.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
252
node_modules/@types/node/cluster.d.ts
generated
vendored
Normal file → Executable file
252
node_modules/@types/node/cluster.d.ts
generated
vendored
Normal file → Executable file
@@ -1,19 +1,18 @@
|
|||||||
/**
|
/**
|
||||||
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
* A single instance of Node.js runs in a single thread. To take advantage of
|
||||||
* that can distribute workloads among their application threads. When process
|
* multi-core systems, the user will sometimes want to launch a cluster of Node.js
|
||||||
* isolation is not needed, use the `worker_threads` module instead, which
|
* processes to handle the load.
|
||||||
* allows running multiple application threads within a single Node.js instance.
|
|
||||||
*
|
*
|
||||||
* The cluster module allows easy creation of child processes that all share
|
* The cluster module allows easy creation of child processes that all share
|
||||||
* server ports.
|
* server ports.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import cluster from 'node:cluster';
|
* import cluster from 'cluster';
|
||||||
* import http from 'node:http';
|
* import http from 'http';
|
||||||
* import { availableParallelism } from 'node:os';
|
* import { cpus } from 'os';
|
||||||
* import process from 'node:process';
|
* import process from 'process';
|
||||||
*
|
*
|
||||||
* const numCPUs = availableParallelism();
|
* const numCPUs = cpus().length;
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* console.log(`Primary ${process.pid} is running`);
|
* console.log(`Primary ${process.pid} is running`);
|
||||||
@@ -50,13 +49,12 @@
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/cluster.js)
|
||||||
*/
|
*/
|
||||||
declare module "cluster" {
|
declare module 'cluster' {
|
||||||
import * as child from "node:child_process";
|
import * as child from 'node:child_process';
|
||||||
import EventEmitter = require("node:events");
|
import EventEmitter = require('node:events');
|
||||||
import * as net from "node:net";
|
import * as net from 'node:net';
|
||||||
type SerializationType = "json" | "advanced";
|
|
||||||
export interface ClusterSettings {
|
export interface ClusterSettings {
|
||||||
execArgv?: string[] | undefined; // default: process.execArgv
|
execArgv?: string[] | undefined; // default: process.execArgv
|
||||||
exec?: string | undefined;
|
exec?: string | undefined;
|
||||||
@@ -66,14 +64,11 @@ declare module "cluster" {
|
|||||||
uid?: number | undefined;
|
uid?: number | undefined;
|
||||||
gid?: number | undefined;
|
gid?: number | undefined;
|
||||||
inspectPort?: number | (() => number) | undefined;
|
inspectPort?: number | (() => number) | undefined;
|
||||||
serialization?: SerializationType | undefined;
|
|
||||||
cwd?: string | undefined;
|
|
||||||
windowsHide?: boolean | undefined;
|
|
||||||
}
|
}
|
||||||
export interface Address {
|
export interface Address {
|
||||||
address: string;
|
address: string;
|
||||||
port: number;
|
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.
|
* A `Worker` object contains all public information and method about a worker.
|
||||||
@@ -104,9 +99,9 @@ declare module "cluster" {
|
|||||||
/**
|
/**
|
||||||
* Send a message to a worker or primary, optionally with a handle.
|
* 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:
|
* This example will echo back all messages from the primary:
|
||||||
*
|
*
|
||||||
@@ -125,25 +120,22 @@ 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:
|
* @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, callback?: (error: Error | null) => void): boolean;
|
||||||
send(
|
send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean;
|
||||||
message: child.Serializable,
|
send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean;
|
||||||
sendHandle: child.SendHandle,
|
|
||||||
callback?: (error: Error | null) => void,
|
|
||||||
): boolean;
|
|
||||||
send(
|
|
||||||
message: child.Serializable,
|
|
||||||
sendHandle: child.SendHandle,
|
|
||||||
options?: child.MessageOptions,
|
|
||||||
callback?: (error: Error | null) => void,
|
|
||||||
): boolean;
|
|
||||||
/**
|
/**
|
||||||
* This function will kill the worker. In the primary worker, it does this by
|
* This function will kill the worker. In the primary, it does this
|
||||||
* disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
|
* 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`.
|
||||||
*
|
*
|
||||||
* The `kill()` function kills the worker process without waiting for a graceful
|
* Because `kill()` attempts to gracefully disconnect the worker process, it is
|
||||||
* disconnect, it has the same behavior as `worker.process.kill()`.
|
* 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()`.
|
||||||
*
|
*
|
||||||
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
* Causes `.exitedAfterDisconnect` to be set.
|
||||||
|
*
|
||||||
|
* This method is aliased as `worker.destroy()` for backward compatibility.
|
||||||
*
|
*
|
||||||
* In a worker, `process.kill()` exists, but it is not this function;
|
* In a worker, `process.kill()` exists, but it is not this function;
|
||||||
* it is `kill()`.
|
* it is `kill()`.
|
||||||
@@ -196,7 +188,7 @@ declare module "cluster" {
|
|||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* } else if (cluster.isWorker) {
|
* } else if (cluster.isWorker) {
|
||||||
* const net = require('node:net');
|
* const net = require('net');
|
||||||
* const server = net.createServer((socket) => {
|
* const server = net.createServer((socket) => {
|
||||||
* // Connections never end
|
* // Connections never end
|
||||||
* });
|
* });
|
||||||
@@ -226,12 +218,12 @@ declare module "cluster" {
|
|||||||
* because of exiting or being signaled). Otherwise, it returns `false`.
|
* because of exiting or being signaled). Otherwise, it returns `false`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import cluster from 'node:cluster';
|
* import cluster from 'cluster';
|
||||||
* import http from 'node:http';
|
* import http from 'http';
|
||||||
* import { availableParallelism } from 'node:os';
|
* import { cpus } from 'os';
|
||||||
* import process from 'node:process';
|
* import process from 'process';
|
||||||
*
|
*
|
||||||
* const numCPUs = availableParallelism();
|
* const numCPUs = cpus().length;
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* console.log(`Primary ${process.pid} is running`);
|
* console.log(`Primary ${process.pid} is running`);
|
||||||
@@ -261,8 +253,7 @@ declare module "cluster" {
|
|||||||
*/
|
*/
|
||||||
isDead(): boolean;
|
isDead(): boolean;
|
||||||
/**
|
/**
|
||||||
* This property is `true` if the worker exited due to `.disconnect()`.
|
* 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
|
||||||
* If the worker exited any other way, it is `false`. If the
|
|
||||||
* worker has not exited, it is `undefined`.
|
* worker has not exited, it is `undefined`.
|
||||||
*
|
*
|
||||||
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
|
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
|
||||||
@@ -292,47 +283,47 @@ declare module "cluster" {
|
|||||||
* 6. online
|
* 6. online
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "disconnect", listener: () => void): this;
|
addListener(event: 'disconnect', listener: () => void): this;
|
||||||
addListener(event: "error", listener: (error: Error) => void): this;
|
addListener(event: 'error', listener: (error: Error) => void): this;
|
||||||
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
addListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
addListener(event: "listening", listener: (address: Address) => 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: '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: 'online', listener: () => void): this;
|
||||||
emit(event: string | symbol, ...args: any[]): boolean;
|
emit(event: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "disconnect"): boolean;
|
emit(event: 'disconnect'): boolean;
|
||||||
emit(event: "error", error: Error): boolean;
|
emit(event: 'error', error: Error): boolean;
|
||||||
emit(event: "exit", code: number, signal: string): boolean;
|
emit(event: 'exit', code: number, signal: string): boolean;
|
||||||
emit(event: "listening", address: Address): boolean;
|
emit(event: 'listening', address: Address): boolean;
|
||||||
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
|
emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean;
|
||||||
emit(event: "online"): boolean;
|
emit(event: 'online'): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "disconnect", listener: () => void): this;
|
on(event: 'disconnect', listener: () => void): this;
|
||||||
on(event: "error", listener: (error: Error) => void): this;
|
on(event: 'error', listener: (error: Error) => void): this;
|
||||||
on(event: "exit", listener: (code: number, signal: string) => void): this;
|
on(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
on(event: "listening", listener: (address: Address) => 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: '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: 'online', listener: () => void): this;
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "disconnect", listener: () => void): this;
|
once(event: 'disconnect', listener: () => void): this;
|
||||||
once(event: "error", listener: (error: Error) => void): this;
|
once(event: 'error', listener: (error: Error) => void): this;
|
||||||
once(event: "exit", listener: (code: number, signal: string) => void): this;
|
once(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
once(event: "listening", listener: (address: Address) => 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: '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: 'online', listener: () => void): this;
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "disconnect", listener: () => void): this;
|
prependListener(event: 'disconnect', listener: () => void): this;
|
||||||
prependListener(event: "error", listener: (error: Error) => void): this;
|
prependListener(event: 'error', listener: (error: Error) => void): this;
|
||||||
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
prependListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
prependListener(event: "listening", listener: (address: Address) => 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: '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: 'online', listener: () => void): this;
|
||||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
prependOnceListener(event: 'disconnect', listener: () => void): this;
|
||||||
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
prependOnceListener(event: 'error', listener: (error: Error) => void): this;
|
||||||
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: (address: Address) => 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: '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: 'online', listener: () => void): this;
|
||||||
}
|
}
|
||||||
export interface Cluster extends EventEmitter {
|
export interface Cluster extends EventEmitter {
|
||||||
disconnect(callback?: () => void): void;
|
disconnect(callback?: () => void): void;
|
||||||
@@ -364,69 +355,60 @@ declare module "cluster" {
|
|||||||
* 7. setup
|
* 7. setup
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
addListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
addListener(event: "fork", listener: (worker: Worker) => void): this;
|
addListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
addListener(
|
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.
|
||||||
event: "message",
|
addListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
): 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: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "disconnect", worker: Worker): boolean;
|
emit(event: 'disconnect', worker: Worker): boolean;
|
||||||
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
emit(event: 'exit', worker: Worker, code: number, signal: string): boolean;
|
||||||
emit(event: "fork", worker: Worker): boolean;
|
emit(event: 'fork', worker: Worker): boolean;
|
||||||
emit(event: "listening", worker: Worker, address: Address): boolean;
|
emit(event: 'listening', worker: Worker, address: Address): boolean;
|
||||||
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
||||||
emit(event: "online", worker: Worker): boolean;
|
emit(event: 'online', worker: Worker): boolean;
|
||||||
emit(event: "setup", settings: ClusterSettings): boolean;
|
emit(event: 'setup', settings: ClusterSettings): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "disconnect", listener: (worker: Worker) => void): this;
|
on(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
on(event: "fork", listener: (worker: Worker) => void): this;
|
on(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
on(event: "listening", listener: (worker: Worker, address: Address) => 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: '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: 'online', listener: (worker: Worker) => void): this;
|
||||||
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
on(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "disconnect", listener: (worker: Worker) => void): this;
|
once(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
once(event: "fork", listener: (worker: Worker) => void): this;
|
once(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
once(event: "listening", listener: (worker: Worker, address: Address) => 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: '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: 'online', listener: (worker: Worker) => void): this;
|
||||||
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
once(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
prependListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
prependListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
// the handle is a net.Socket or net.Server object, or undefined.
|
// the handle is a net.Socket or net.Server object, or undefined.
|
||||||
prependListener(
|
prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this;
|
||||||
event: "message",
|
prependListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
|
prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
): 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: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
|
prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
// the handle is a net.Socket or net.Server object, or undefined.
|
// the handle is a net.Socket or net.Server object, or undefined.
|
||||||
prependOnceListener(
|
prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
||||||
event: "message",
|
prependOnceListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
): this;
|
|
||||||
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
|
|
||||||
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
||||||
}
|
}
|
||||||
const cluster: Cluster;
|
const cluster: Cluster;
|
||||||
export default cluster;
|
export default cluster;
|
||||||
}
|
}
|
||||||
declare module "node:cluster" {
|
declare module 'node:cluster' {
|
||||||
export * from "cluster";
|
export * from 'cluster';
|
||||||
export { default as default } from "cluster";
|
export { default as default } from 'cluster';
|
||||||
}
|
}
|
||||||
|
|||||||
41
node_modules/@types/node/console.d.ts
generated
vendored
Normal file → Executable file
41
node_modules/@types/node/console.d.ts
generated
vendored
Normal file → Executable file
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:console` module provides a simple debugging console that is similar to
|
* The `console` module provides a simple debugging console that is similar to the
|
||||||
* the JavaScript console mechanism provided by web browsers.
|
* JavaScript console mechanism provided by web browsers.
|
||||||
*
|
*
|
||||||
* The module exports two specific components:
|
* 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 `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream.
|
||||||
* * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`.
|
* * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`.
|
||||||
*
|
*
|
||||||
* _**Warning**_: The global console object's methods are neither consistently
|
* _**Warning**_: The global console object's methods are neither consistently
|
||||||
* synchronous like the browser APIs they resemble, nor are they consistently
|
* synchronous like the browser APIs they resemble, nor are they consistently
|
||||||
@@ -53,14 +53,14 @@
|
|||||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||||
* // Prints: Danger Will Robinson! Danger!, to err
|
* // Prints: Danger Will Robinson! Danger!, to err
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/console.js)
|
||||||
*/
|
*/
|
||||||
declare module "console" {
|
declare module 'console' {
|
||||||
import console = require("node:console");
|
import console = require('node:console');
|
||||||
export = console;
|
export = console;
|
||||||
}
|
}
|
||||||
declare module "node:console" {
|
declare module 'node:console' {
|
||||||
import { InspectOptions } from "node:util";
|
import { InspectOptions } from 'node:util';
|
||||||
global {
|
global {
|
||||||
// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
|
// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
|
||||||
interface Console {
|
interface Console {
|
||||||
@@ -123,7 +123,7 @@ declare module "node:console" {
|
|||||||
* >
|
* >
|
||||||
* ```
|
* ```
|
||||||
* @since v8.3.0
|
* @since v8.3.0
|
||||||
* @param [label='default'] The display label for the counter.
|
* @param label The display label for the counter.
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -141,7 +141,7 @@ declare module "node:console" {
|
|||||||
* >
|
* >
|
||||||
* ```
|
* ```
|
||||||
* @since v8.3.0
|
* @since v8.3.0
|
||||||
* @param [label='default'] The display label for the counter.
|
* @param label The display label for the counter.
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -221,7 +221,7 @@ declare module "node:console" {
|
|||||||
log(message?: any, ...optionalParams: any[]): void;
|
log(message?: any, ...optionalParams: any[]): void;
|
||||||
/**
|
/**
|
||||||
* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
||||||
* logging the argument if it can't be parsed as tabular.
|
* logging the argument if it can’t be parsed as tabular.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* // These can't be parsed as tabular data
|
* // These can't be parsed as tabular data
|
||||||
@@ -257,7 +257,6 @@ declare module "node:console" {
|
|||||||
* suitable time units to `stdout`. For example, if the elapsed
|
* suitable time units to `stdout`. For example, if the elapsed
|
||||||
* time is 3869ms, `console.timeEnd()` displays "3.869s".
|
* time is 3869ms, `console.timeEnd()` displays "3.869s".
|
||||||
* @since v0.1.104
|
* @since v0.1.104
|
||||||
* @param [label='default']
|
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -265,13 +264,12 @@ declare module "node:console" {
|
|||||||
* prints the result to `stdout`:
|
* prints the result to `stdout`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* console.time('bunch-of-stuff');
|
* console.time('100-elements');
|
||||||
* // Do a bunch of stuff.
|
* for (let i = 0; i < 100; i++) {}
|
||||||
* console.timeEnd('bunch-of-stuff');
|
* console.timeEnd('100-elements');
|
||||||
* // Prints: bunch-of-stuff: 225.438ms
|
* // prints 100-elements: 225.438ms
|
||||||
* ```
|
* ```
|
||||||
* @since v0.1.104
|
* @since v0.1.104
|
||||||
* @param [label='default']
|
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -287,7 +285,6 @@ declare module "node:console" {
|
|||||||
* console.timeEnd('process');
|
* console.timeEnd('process');
|
||||||
* ```
|
* ```
|
||||||
* @since v10.7.0
|
* @since v10.7.0
|
||||||
* @param [label='default']
|
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
@@ -395,7 +392,7 @@ declare module "node:console" {
|
|||||||
stdout: NodeJS.WritableStream;
|
stdout: NodeJS.WritableStream;
|
||||||
stderr?: NodeJS.WritableStream | undefined;
|
stderr?: NodeJS.WritableStream | undefined;
|
||||||
ignoreErrors?: boolean | undefined;
|
ignoreErrors?: boolean | undefined;
|
||||||
colorMode?: boolean | "auto" | undefined;
|
colorMode?: boolean | 'auto' | undefined;
|
||||||
inspectOptions?: InspectOptions | undefined;
|
inspectOptions?: InspectOptions | undefined;
|
||||||
/**
|
/**
|
||||||
* Set group indentation
|
* Set group indentation
|
||||||
@@ -405,8 +402,8 @@ declare module "node:console" {
|
|||||||
}
|
}
|
||||||
interface ConsoleConstructor {
|
interface ConsoleConstructor {
|
||||||
prototype: Console;
|
prototype: Console;
|
||||||
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
||||||
new(options: ConsoleConstructorOptions): Console;
|
new (options: ConsoleConstructorOptions): Console;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var console: Console;
|
var console: Console;
|
||||||
|
|||||||
23
node_modules/@types/node/constants.d.ts
generated
vendored
Normal file → Executable file
23
node_modules/@types/node/constants.d.ts
generated
vendored
Normal file → Executable file
@@ -1,19 +1,18 @@
|
|||||||
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
||||||
declare module "constants" {
|
declare module 'constants' {
|
||||||
import { constants as osConstants, SignalConstants } from "node:os";
|
import { constants as osConstants, SignalConstants } from 'node:os';
|
||||||
import { constants as cryptoConstants } from "node:crypto";
|
import { constants as cryptoConstants } from 'node:crypto';
|
||||||
import { constants as fsConstants } from "node:fs";
|
import { constants as fsConstants } from 'node:fs';
|
||||||
|
|
||||||
const exp:
|
const exp: typeof osConstants.errno &
|
||||||
& typeof osConstants.errno
|
typeof osConstants.priority &
|
||||||
& typeof osConstants.priority
|
SignalConstants &
|
||||||
& SignalConstants
|
typeof cryptoConstants &
|
||||||
& typeof cryptoConstants
|
typeof fsConstants;
|
||||||
& typeof fsConstants;
|
|
||||||
export = exp;
|
export = exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "node:constants" {
|
declare module 'node:constants' {
|
||||||
import constants = require("constants");
|
import constants = require('constants');
|
||||||
export = constants;
|
export = constants;
|
||||||
}
|
}
|
||||||
|
|||||||
2119
node_modules/@types/node/crypto.d.ts
generated
vendored
Normal file → Executable file
2119
node_modules/@types/node/crypto.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
165
node_modules/@types/node/dgram.d.ts
generated
vendored
Normal file → Executable file
165
node_modules/@types/node/dgram.d.ts
generated
vendored
Normal file → Executable file
@@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:dgram` module provides an implementation of UDP datagram sockets.
|
* The `dgram` module provides an implementation of UDP datagram sockets.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
*
|
*
|
||||||
* const server = dgram.createSocket('udp4');
|
* const server = dgram.createSocket('udp4');
|
||||||
*
|
*
|
||||||
* server.on('error', (err) => {
|
* server.on('error', (err) => {
|
||||||
* console.error(`server error:\n${err.stack}`);
|
* console.log(`server error:\n${err.stack}`);
|
||||||
* server.close();
|
* server.close();
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
@@ -23,15 +23,15 @@
|
|||||||
* server.bind(41234);
|
* server.bind(41234);
|
||||||
* // Prints: server listening 0.0.0.0:41234
|
* // Prints: server listening 0.0.0.0:41234
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dgram.js)
|
||||||
*/
|
*/
|
||||||
declare module "dgram" {
|
declare module 'dgram' {
|
||||||
import { AddressInfo } from "node:net";
|
import { AddressInfo } from 'node:net';
|
||||||
import * as dns from "node:dns";
|
import * as dns from 'node:dns';
|
||||||
import { Abortable, EventEmitter } from "node:events";
|
import { EventEmitter, Abortable } from 'node:events';
|
||||||
interface RemoteInfo {
|
interface RemoteInfo {
|
||||||
address: string;
|
address: string;
|
||||||
family: "IPv4" | "IPv6";
|
family: 'IPv4' | 'IPv6';
|
||||||
port: number;
|
port: number;
|
||||||
size: number;
|
size: number;
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ declare module "dgram" {
|
|||||||
exclusive?: boolean | undefined;
|
exclusive?: boolean | undefined;
|
||||||
fd?: number | undefined;
|
fd?: number | undefined;
|
||||||
}
|
}
|
||||||
type SocketType = "udp4" | "udp6";
|
type SocketType = 'udp4' | 'udp6';
|
||||||
interface SocketOptions extends Abortable {
|
interface SocketOptions extends Abortable {
|
||||||
type: SocketType;
|
type: SocketType;
|
||||||
reuseAddr?: boolean | undefined;
|
reuseAddr?: boolean | undefined;
|
||||||
@@ -51,13 +51,7 @@ declare module "dgram" {
|
|||||||
ipv6Only?: boolean | undefined;
|
ipv6Only?: boolean | undefined;
|
||||||
recvBufferSize?: number | undefined;
|
recvBufferSize?: number | undefined;
|
||||||
sendBufferSize?: number | undefined;
|
sendBufferSize?: number | undefined;
|
||||||
lookup?:
|
lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined;
|
||||||
| ((
|
|
||||||
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
|
* Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
|
||||||
@@ -104,8 +98,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:
|
* 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
|
* ```js
|
||||||
* import cluster from 'node:cluster';
|
* import cluster from 'cluster';
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* cluster.fork(); // Works ok.
|
* cluster.fork(); // Works ok.
|
||||||
@@ -122,7 +116,7 @@ declare module "dgram" {
|
|||||||
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||||
/**
|
/**
|
||||||
* Returns an object containing the address information for a socket.
|
* 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.
|
* This method throws `EBADF` if called on an unbound socket.
|
||||||
* @since v0.1.99
|
* @since v0.1.99
|
||||||
@@ -148,12 +142,12 @@ declare module "dgram" {
|
|||||||
* Example of a UDP server listening on port 41234:
|
* Example of a UDP server listening on port 41234:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
*
|
*
|
||||||
* const server = dgram.createSocket('udp4');
|
* const server = dgram.createSocket('udp4');
|
||||||
*
|
*
|
||||||
* server.on('error', (err) => {
|
* server.on('error', (err) => {
|
||||||
* console.error(`server error:\n${err.stack}`);
|
* console.log(`server error:\n${err.stack}`);
|
||||||
* server.close();
|
* server.close();
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
@@ -266,7 +260,7 @@ declare module "dgram" {
|
|||||||
*
|
*
|
||||||
* The `address` argument is a string. If the value of `address` is a host name,
|
* 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
|
* DNS will be used to resolve the address of the host. If `address` is not
|
||||||
* provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default.
|
* provided or otherwise falsy, `'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
|
* 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
|
* is assigned a random port number and is bound to the "all interfaces" address
|
||||||
@@ -290,8 +284,8 @@ declare module "dgram" {
|
|||||||
* Example of sending a UDP packet to a port on `localhost`;
|
* Example of sending a UDP packet to a port on `localhost`;
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* const message = Buffer.from('Some bytes');
|
* const message = Buffer.from('Some bytes');
|
||||||
* const client = dgram.createSocket('udp4');
|
* const client = dgram.createSocket('udp4');
|
||||||
@@ -303,8 +297,8 @@ declare module "dgram" {
|
|||||||
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from('Some ');
|
* const buf1 = Buffer.from('Some ');
|
||||||
* const buf2 = Buffer.from('bytes');
|
* const buf2 = Buffer.from('bytes');
|
||||||
@@ -322,8 +316,8 @@ declare module "dgram" {
|
|||||||
* Example of sending a UDP packet using a socket connected to a port on`localhost`:
|
* Example of sending a UDP packet using a socket connected to a port on`localhost`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* const message = Buffer.from('Some bytes');
|
* const message = Buffer.from('Some bytes');
|
||||||
* const client = dgram.createSocket('udp4');
|
* const client = dgram.createSocket('udp4');
|
||||||
@@ -341,42 +335,12 @@ declare module "dgram" {
|
|||||||
* @param address Destination host name or IP address.
|
* @param address Destination host name or IP address.
|
||||||
* @param callback Called when the message has been sent.
|
* @param callback Called when the message has been sent.
|
||||||
*/
|
*/
|
||||||
send(
|
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
port?: number,
|
send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
address?: string,
|
send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): 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,
|
|
||||||
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
|
* Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
|
||||||
* packets may be sent to a local interface's broadcast address.
|
* packets may be sent to a local interface's broadcast address.
|
||||||
@@ -487,7 +451,7 @@ declare module "dgram" {
|
|||||||
* TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
|
* 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.
|
* Changing TTL values is typically done for network probes or when multicasting.
|
||||||
*
|
*
|
||||||
* The `ttl` argument may be between 1 and 255\. The default on most systems
|
* The `ttl` argument may be between between 1 and 255\. The default on most systems
|
||||||
* is 64.
|
* is 64.
|
||||||
*
|
*
|
||||||
* This method throws `EBADF` if called on an unbound socket.
|
* This method throws `EBADF` if called on an unbound socket.
|
||||||
@@ -539,48 +503,43 @@ declare module "dgram" {
|
|||||||
* 5. message
|
* 5. message
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "close", listener: () => void): this;
|
addListener(event: 'close', listener: () => void): this;
|
||||||
addListener(event: "connect", listener: () => void): this;
|
addListener(event: 'connect', listener: () => void): this;
|
||||||
addListener(event: "error", listener: (err: Error) => void): this;
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
addListener(event: "listening", listener: () => void): this;
|
addListener(event: 'listening', listener: () => void): this;
|
||||||
addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
emit(event: string | symbol, ...args: any[]): boolean;
|
emit(event: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "close"): boolean;
|
emit(event: 'close'): boolean;
|
||||||
emit(event: "connect"): boolean;
|
emit(event: 'connect'): boolean;
|
||||||
emit(event: "error", err: Error): boolean;
|
emit(event: 'error', err: Error): boolean;
|
||||||
emit(event: "listening"): boolean;
|
emit(event: 'listening'): boolean;
|
||||||
emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
|
emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "close", listener: () => void): this;
|
on(event: 'close', listener: () => void): this;
|
||||||
on(event: "connect", listener: () => void): this;
|
on(event: 'connect', listener: () => void): this;
|
||||||
on(event: "error", listener: (err: Error) => void): this;
|
on(event: 'error', listener: (err: Error) => void): this;
|
||||||
on(event: "listening", listener: () => void): this;
|
on(event: 'listening', listener: () => void): this;
|
||||||
on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "close", listener: () => void): this;
|
once(event: 'close', listener: () => void): this;
|
||||||
once(event: "connect", listener: () => void): this;
|
once(event: 'connect', listener: () => void): this;
|
||||||
once(event: "error", listener: (err: Error) => void): this;
|
once(event: 'error', listener: (err: Error) => void): this;
|
||||||
once(event: "listening", listener: () => void): this;
|
once(event: 'listening', listener: () => void): this;
|
||||||
once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "close", listener: () => void): this;
|
prependListener(event: 'close', listener: () => void): this;
|
||||||
prependListener(event: "connect", listener: () => void): this;
|
prependListener(event: 'connect', listener: () => void): this;
|
||||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependListener(event: "listening", listener: () => void): this;
|
prependListener(event: 'listening', listener: () => void): this;
|
||||||
prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "close", listener: () => void): this;
|
prependOnceListener(event: 'close', listener: () => void): this;
|
||||||
prependOnceListener(event: "connect", listener: () => void): this;
|
prependOnceListener(event: 'connect', listener: () => void): this;
|
||||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: () => void): this;
|
prependOnceListener(event: 'listening', listener: () => void): this;
|
||||||
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => 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" {
|
declare module 'node:dgram' {
|
||||||
export * from "dgram";
|
export * from 'dgram';
|
||||||
}
|
}
|
||||||
|
|||||||
95
node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
Normal file → Executable file
95
node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
Normal file → Executable file
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:diagnostics_channel` module provides an API to create named channels
|
* The `diagnostics_channel` module provides an API to create named channels
|
||||||
* to report arbitrary message data for diagnostics purposes.
|
* to report arbitrary message data for diagnostics purposes.
|
||||||
*
|
*
|
||||||
* It can be accessed using:
|
* It can be accessed using:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* It is intended that a module writer wanting to report diagnostics messages
|
* 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
|
* 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
|
* should generally include the module name to avoid collisions with data from
|
||||||
* other modules.
|
* other modules.
|
||||||
* @since v15.1.0, v14.17.0
|
* @experimental
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.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
|
* 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.
|
* the message you want to send might be expensive to prepare.
|
||||||
@@ -31,7 +31,7 @@ declare module "diagnostics_channel" {
|
|||||||
* performance-sensitive code.
|
* performance-sensitive code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* if (diagnostics_channel.hasSubscribers('my-channel')) {
|
* if (diagnostics_channel.hasSubscribers('my-channel')) {
|
||||||
* // There are subscribers, prepare and publish message
|
* // There are subscribers, prepare and publish message
|
||||||
@@ -41,14 +41,14 @@ declare module "diagnostics_channel" {
|
|||||||
* @param name The channel name
|
* @param name The channel name
|
||||||
* @return If there are active subscribers
|
* @return If there are active subscribers
|
||||||
*/
|
*/
|
||||||
function hasSubscribers(name: string | symbol): boolean;
|
function hasSubscribers(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* This is the primary entry-point for anyone wanting to publish to a named
|
* This is the primary entry-point for anyone wanting to interact with a named
|
||||||
* channel. It produces a channel object which is optimized to reduce overhead at
|
* channel. It produces a channel object which is optimized to reduce overhead at
|
||||||
* publish time as much as possible.
|
* publish time as much as possible.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
* ```
|
* ```
|
||||||
@@ -56,48 +56,11 @@ declare module "diagnostics_channel" {
|
|||||||
* @param name The channel name
|
* @param name The channel name
|
||||||
* @return The named channel object
|
* @return The named channel object
|
||||||
*/
|
*/
|
||||||
function channel(name: string | symbol): Channel;
|
function channel(name: string): Channel;
|
||||||
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
type ChannelListener = (name: string, message: unknown) => void;
|
||||||
/**
|
|
||||||
* Register a message handler to subscribe to this channel. This message handler
|
|
||||||
* will be run synchronously whenever a message is published to the channel. Any
|
|
||||||
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
|
||||||
*
|
|
||||||
* 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
|
* The class `Channel` represents an individual named channel within the data
|
||||||
* pipeline. It is used to track subscribers and to publish messages when there
|
* pipeline. It is use to track subscribers and to publish messages when there
|
||||||
* are subscribers present. It exists as a separate object to avoid channel
|
* are subscribers present. It exists as a separate object to avoid channel
|
||||||
* lookups at publish time, enabling very fast publish speeds and allowing
|
* 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
|
* for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
|
||||||
@@ -105,7 +68,7 @@ declare module "diagnostics_channel" {
|
|||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0, v14.17.0
|
||||||
*/
|
*/
|
||||||
class Channel {
|
class Channel {
|
||||||
readonly name: string | symbol;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* Check if there are active subscribers to this channel. This is helpful if
|
* Check if there are active subscribers to this channel. This is helpful if
|
||||||
* the message you want to send might be expensive to prepare.
|
* the message you want to send might be expensive to prepare.
|
||||||
@@ -114,7 +77,7 @@ declare module "diagnostics_channel" {
|
|||||||
* performance-sensitive code.
|
* performance-sensitive code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
*
|
*
|
||||||
@@ -125,31 +88,14 @@ declare module "diagnostics_channel" {
|
|||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0, v14.17.0
|
||||||
*/
|
*/
|
||||||
readonly hasSubscribers: boolean;
|
readonly hasSubscribers: boolean;
|
||||||
private constructor(name: string | symbol);
|
private constructor(name: string);
|
||||||
/**
|
|
||||||
* 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
|
* 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
|
* will be run synchronously whenever a message is published to the channel. Any
|
||||||
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
*
|
*
|
||||||
@@ -158,7 +104,6 @@ declare module "diagnostics_channel" {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
* @since v15.1.0, v14.17.0
|
* @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
|
* @param onMessage The handler to receive channel messages
|
||||||
*/
|
*/
|
||||||
subscribe(onMessage: ChannelListener): void;
|
subscribe(onMessage: ChannelListener): void;
|
||||||
@@ -166,7 +111,7 @@ declare module "diagnostics_channel" {
|
|||||||
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
*
|
*
|
||||||
@@ -179,13 +124,11 @@ declare module "diagnostics_channel" {
|
|||||||
* channel.unsubscribe(onMessage);
|
* channel.unsubscribe(onMessage);
|
||||||
* ```
|
* ```
|
||||||
* @since v15.1.0, v14.17.0
|
* @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
|
* @param onMessage The previous subscribed handler to remove
|
||||||
* @return `true` if the handler was found, `false` otherwise.
|
|
||||||
*/
|
*/
|
||||||
unsubscribe(onMessage: ChannelListener): void;
|
unsubscribe(onMessage: ChannelListener): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:diagnostics_channel" {
|
declare module 'node:diagnostics_channel' {
|
||||||
export * from "diagnostics_channel";
|
export * from 'diagnostics_channel';
|
||||||
}
|
}
|
||||||
|
|||||||
327
node_modules/@types/node/dns.d.ts
generated
vendored
Normal file → Executable file
327
node_modules/@types/node/dns.d.ts
generated
vendored
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:dns` module enables name resolution. For example, use it to look up IP
|
* The `dns` module enables name resolution. For example, use it to look up IP
|
||||||
* addresses of host names.
|
* 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
|
* 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}.
|
* system do, use {@link lookup}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
*
|
*
|
||||||
* dns.lookup('example.org', (err, address, family) => {
|
* dns.lookup('example.org', (err, address, family) => {
|
||||||
* console.log('address: %j family: IPv%s', address, family);
|
* console.log('address: %j family: IPv%s', address, family);
|
||||||
@@ -17,13 +17,13 @@
|
|||||||
* // address: "93.184.216.34" family: IPv4
|
* // address: "93.184.216.34" family: IPv4
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* All other functions in the `node:dns` module connect to an actual DNS server to
|
* All other functions in the `dns` module connect to an actual DNS server to
|
||||||
* perform name resolution. They will always use the network to perform DNS
|
* 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
|
* 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.
|
* DNS queries, bypassing other name-resolution facilities.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
*
|
*
|
||||||
* dns.resolve4('archive.org', (err, addresses) => {
|
* dns.resolve4('archive.org', (err, addresses) => {
|
||||||
* if (err) throw err;
|
* if (err) throw err;
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* See the `Implementation considerations section` for more information.
|
* See the `Implementation considerations section` for more information.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dns.js)
|
||||||
*/
|
*/
|
||||||
declare module "dns" {
|
declare module 'dns' {
|
||||||
import * as dnsPromises from "node:dns/promises";
|
import * as dnsPromises from 'node:dns/promises';
|
||||||
// Supported getaddrinfo flags.
|
// Supported getaddrinfo flags.
|
||||||
export const ADDRCONFIG: number;
|
export const ADDRCONFIG: number;
|
||||||
export const V4MAPPED: number;
|
export const V4MAPPED: number;
|
||||||
@@ -58,9 +58,6 @@ declare module "dns" {
|
|||||||
family?: number | undefined;
|
family?: number | undefined;
|
||||||
hints?: number | undefined;
|
hints?: number | undefined;
|
||||||
all?: boolean | undefined;
|
all?: boolean | undefined;
|
||||||
/**
|
|
||||||
* @default true
|
|
||||||
*/
|
|
||||||
verbatim?: boolean | undefined;
|
verbatim?: boolean | undefined;
|
||||||
}
|
}
|
||||||
export interface LookupOneOptions extends LookupOptions {
|
export interface LookupOneOptions extends LookupOptions {
|
||||||
@@ -76,8 +73,8 @@ declare module "dns" {
|
|||||||
/**
|
/**
|
||||||
* Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
|
* 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
|
* AAAA (IPv6) record. All `option` properties are optional. If `options` is an
|
||||||
* integer, then it must be `4` or `6` – if `options` is `0` or not provided, then
|
* integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
|
||||||
* IPv4 and IPv6 addresses are both returned if found.
|
* and IPv6 addresses are both returned if found.
|
||||||
*
|
*
|
||||||
* With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the
|
* With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the
|
||||||
* properties `address` and `family`.
|
* properties `address` and `family`.
|
||||||
@@ -89,14 +86,14 @@ declare module "dns" {
|
|||||||
*
|
*
|
||||||
* `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
|
* `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
|
||||||
* The implementation uses an operating system facility that can associate names
|
* 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
|
* important consequences on the behavior of any Node.js program. Please take some
|
||||||
* time to consult the `Implementation considerations section` before using`dns.lookup()`.
|
* time to consult the `Implementation considerations section` before using`dns.lookup()`.
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
* const options = {
|
* const options = {
|
||||||
* family: 6,
|
* family: 6,
|
||||||
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
||||||
@@ -115,30 +112,11 @@ 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.
|
* 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
|
* @since v0.1.90
|
||||||
*/
|
*/
|
||||||
export function lookup(
|
export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||||
hostname: string,
|
export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||||
family: number,
|
export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
|
||||||
): void;
|
export function lookup(hostname: string, 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 {
|
export namespace lookup {
|
||||||
function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
||||||
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
|
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
|
||||||
@@ -154,7 +132,7 @@ declare module "dns" {
|
|||||||
* On an error, `err` is an `Error` object, where `err.code` is the error code.
|
* On an error, `err` is an `Error` object, where `err.code` is the error code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
||||||
* console.log(hostname, service);
|
* console.log(hostname, service);
|
||||||
* // Prints: localhost ssh
|
* // Prints: localhost ssh
|
||||||
@@ -164,15 +142,11 @@ declare module "dns" {
|
|||||||
* If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties.
|
* If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties.
|
||||||
* @since v0.11.14
|
* @since v0.11.14
|
||||||
*/
|
*/
|
||||||
export function lookupService(
|
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
|
||||||
address: string,
|
|
||||||
port: number,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
|
|
||||||
): void;
|
|
||||||
export namespace lookupService {
|
export namespace lookupService {
|
||||||
function __promisify__(
|
function __promisify__(
|
||||||
address: string,
|
address: string,
|
||||||
port: number,
|
port: number
|
||||||
): Promise<{
|
): Promise<{
|
||||||
hostname: string;
|
hostname: string;
|
||||||
service: string;
|
service: string;
|
||||||
@@ -191,13 +165,13 @@ declare module "dns" {
|
|||||||
/** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
|
/** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
|
||||||
export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
|
export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
|
||||||
export interface AnyARecord extends RecordWithTtl {
|
export interface AnyARecord extends RecordWithTtl {
|
||||||
type: "A";
|
type: 'A';
|
||||||
}
|
}
|
||||||
export interface AnyAaaaRecord extends RecordWithTtl {
|
export interface AnyAaaaRecord extends RecordWithTtl {
|
||||||
type: "AAAA";
|
type: 'AAAA';
|
||||||
}
|
}
|
||||||
export interface CaaRecord {
|
export interface CaaRecord {
|
||||||
critical: number;
|
critial: number;
|
||||||
issue?: string | undefined;
|
issue?: string | undefined;
|
||||||
issuewild?: string | undefined;
|
issuewild?: string | undefined;
|
||||||
iodef?: string | undefined;
|
iodef?: string | undefined;
|
||||||
@@ -209,7 +183,7 @@ declare module "dns" {
|
|||||||
exchange: string;
|
exchange: string;
|
||||||
}
|
}
|
||||||
export interface AnyMxRecord extends MxRecord {
|
export interface AnyMxRecord extends MxRecord {
|
||||||
type: "MX";
|
type: 'MX';
|
||||||
}
|
}
|
||||||
export interface NaptrRecord {
|
export interface NaptrRecord {
|
||||||
flags: string;
|
flags: string;
|
||||||
@@ -220,7 +194,7 @@ declare module "dns" {
|
|||||||
preference: number;
|
preference: number;
|
||||||
}
|
}
|
||||||
export interface AnyNaptrRecord extends NaptrRecord {
|
export interface AnyNaptrRecord extends NaptrRecord {
|
||||||
type: "NAPTR";
|
type: 'NAPTR';
|
||||||
}
|
}
|
||||||
export interface SoaRecord {
|
export interface SoaRecord {
|
||||||
nsname: string;
|
nsname: string;
|
||||||
@@ -232,7 +206,7 @@ declare module "dns" {
|
|||||||
minttl: number;
|
minttl: number;
|
||||||
}
|
}
|
||||||
export interface AnySoaRecord extends SoaRecord {
|
export interface AnySoaRecord extends SoaRecord {
|
||||||
type: "SOA";
|
type: 'SOA';
|
||||||
}
|
}
|
||||||
export interface SrvRecord {
|
export interface SrvRecord {
|
||||||
priority: number;
|
priority: number;
|
||||||
@@ -241,35 +215,25 @@ declare module "dns" {
|
|||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
export interface AnySrvRecord extends SrvRecord {
|
export interface AnySrvRecord extends SrvRecord {
|
||||||
type: "SRV";
|
type: 'SRV';
|
||||||
}
|
}
|
||||||
export interface AnyTxtRecord {
|
export interface AnyTxtRecord {
|
||||||
type: "TXT";
|
type: 'TXT';
|
||||||
entries: string[];
|
entries: string[];
|
||||||
}
|
}
|
||||||
export interface AnyNsRecord {
|
export interface AnyNsRecord {
|
||||||
type: "NS";
|
type: 'NS';
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
export interface AnyPtrRecord {
|
export interface AnyPtrRecord {
|
||||||
type: "PTR";
|
type: 'PTR';
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
export interface AnyCnameRecord {
|
export interface AnyCnameRecord {
|
||||||
type: "CNAME";
|
type: 'CNAME';
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
export type AnyRecord =
|
export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord;
|
||||||
| 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
|
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
|
||||||
* of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
|
* of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
|
||||||
@@ -282,85 +246,32 @@ declare module "dns" {
|
|||||||
* @param hostname Host name to resolve.
|
* @param hostname Host name to resolve.
|
||||||
* @param [rrtype='A'] Resource record type.
|
* @param [rrtype='A'] Resource record type.
|
||||||
*/
|
*/
|
||||||
export function resolve(
|
export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
): void;
|
export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
|
||||||
export function resolve(
|
export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
||||||
rrtype: "A",
|
export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
): void;
|
export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
export function resolve(
|
export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
|
||||||
hostname: string,
|
export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||||
rrtype: "AAAA",
|
export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||||
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(
|
export function resolve(
|
||||||
hostname: string,
|
hostname: string,
|
||||||
rrtype: string,
|
rrtype: string,
|
||||||
callback: (
|
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void
|
||||||
err: NodeJS.ErrnoException | null,
|
|
||||||
addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
|
|
||||||
) => void,
|
|
||||||
): void;
|
): void;
|
||||||
export namespace resolve {
|
export namespace resolve {
|
||||||
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
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: 'ANY'): Promise<AnyRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
function __promisify__(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
|
||||||
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
function __promisify__(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
||||||
function __promisify__(
|
function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||||
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
|
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
||||||
@@ -368,45 +279,23 @@ declare module "dns" {
|
|||||||
* @since v0.1.16
|
* @since v0.1.16
|
||||||
* @param hostname Host name to resolve.
|
* @param hostname Host name to resolve.
|
||||||
*/
|
*/
|
||||||
export function resolve4(
|
export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): 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 {
|
export namespace resolve4 {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||||
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
* Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
||||||
* will contain an array of IPv6 addresses.
|
* will contain an array of IPv6 addresses.
|
||||||
* @since v0.1.16
|
* @since v0.1.16
|
||||||
* @param hostname Host name to resolve.
|
* @param hostname Host name to resolve.
|
||||||
*/
|
*/
|
||||||
export function resolve6(
|
export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): 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 {
|
export namespace resolve6 {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||||
@@ -417,10 +306,7 @@ declare module "dns" {
|
|||||||
* will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
|
* will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
|
||||||
* @since v0.3.2
|
* @since v0.3.2
|
||||||
*/
|
*/
|
||||||
export function resolveCname(
|
export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveCname {
|
export namespace resolveCname {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
}
|
}
|
||||||
@@ -428,12 +314,9 @@ declare module "dns" {
|
|||||||
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
|
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
|
||||||
* will contain an array of certification authority authorization records
|
* 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'}]`).
|
* available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
|
||||||
* @since v15.0.0, v14.17.0
|
* @since v15.0.0
|
||||||
*/
|
*/
|
||||||
export function resolveCaa(
|
export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveCaa {
|
export namespace resolveCaa {
|
||||||
function __promisify__(hostname: string): Promise<CaaRecord[]>;
|
function __promisify__(hostname: string): Promise<CaaRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -442,15 +325,12 @@ declare module "dns" {
|
|||||||
* contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
|
* contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
|
||||||
* @since v0.1.27
|
* @since v0.1.27
|
||||||
*/
|
*/
|
||||||
export function resolveMx(
|
export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveMx {
|
export namespace resolveMx {
|
||||||
function __promisify__(hostname: string): Promise<MxRecord[]>;
|
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:
|
* objects with the following properties:
|
||||||
*
|
*
|
||||||
* * `flags`
|
* * `flags`
|
||||||
@@ -472,10 +352,7 @@ declare module "dns" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v0.9.12
|
* @since v0.9.12
|
||||||
*/
|
*/
|
||||||
export function resolveNaptr(
|
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveNaptr {
|
export namespace resolveNaptr {
|
||||||
function __promisify__(hostname: string): Promise<NaptrRecord[]>;
|
function __promisify__(hostname: string): Promise<NaptrRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -484,10 +361,7 @@ declare module "dns" {
|
|||||||
* contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
|
* contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
|
||||||
* @since v0.1.90
|
* @since v0.1.90
|
||||||
*/
|
*/
|
||||||
export function resolveNs(
|
export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveNs {
|
export namespace resolveNs {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
}
|
}
|
||||||
@@ -496,10 +370,7 @@ declare module "dns" {
|
|||||||
* be an array of strings containing the reply records.
|
* be an array of strings containing the reply records.
|
||||||
* @since v6.0.0
|
* @since v6.0.0
|
||||||
*/
|
*/
|
||||||
export function resolvePtr(
|
export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolvePtr {
|
export namespace resolvePtr {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
}
|
}
|
||||||
@@ -529,10 +400,7 @@ declare module "dns" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v0.11.10
|
* @since v0.11.10
|
||||||
*/
|
*/
|
||||||
export function resolveSoa(
|
export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveSoa {
|
export namespace resolveSoa {
|
||||||
function __promisify__(hostname: string): Promise<SoaRecord>;
|
function __promisify__(hostname: string): Promise<SoaRecord>;
|
||||||
}
|
}
|
||||||
@@ -555,10 +423,7 @@ declare module "dns" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v0.1.27
|
* @since v0.1.27
|
||||||
*/
|
*/
|
||||||
export function resolveSrv(
|
export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveSrv {
|
export namespace resolveSrv {
|
||||||
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -569,10 +434,7 @@ declare module "dns" {
|
|||||||
* treated separately.
|
* treated separately.
|
||||||
* @since v0.1.27
|
* @since v0.1.27
|
||||||
*/
|
*/
|
||||||
export function resolveTxt(
|
export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveTxt {
|
export namespace resolveTxt {
|
||||||
function __promisify__(hostname: string): Promise<string[][]>;
|
function __promisify__(hostname: string): Promise<string[][]>;
|
||||||
}
|
}
|
||||||
@@ -606,10 +468,7 @@ 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
|
* 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).
|
* 8482](https://tools.ietf.org/html/rfc8482).
|
||||||
*/
|
*/
|
||||||
export function resolveAny(
|
export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveAny {
|
export namespace resolveAny {
|
||||||
function __promisify__(hostname: string): Promise<AnyRecord[]>;
|
function __promisify__(hostname: string): Promise<AnyRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -621,18 +480,7 @@ declare module "dns" {
|
|||||||
* one of the `DNS error codes`.
|
* one of the `DNS error codes`.
|
||||||
* @since v0.1.16
|
* @since v0.1.16
|
||||||
*/
|
*/
|
||||||
export function reverse(
|
export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
|
||||||
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
|
* 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
|
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
|
||||||
@@ -679,18 +527,16 @@ declare module "dns" {
|
|||||||
*/
|
*/
|
||||||
export function getServers(): string[];
|
export function getServers(): string[];
|
||||||
/**
|
/**
|
||||||
* Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
|
* Set the default value of `verbatim` in {@link lookup}. The value could be:
|
||||||
|
* - `ipv4first`: sets default `verbatim` `false`.
|
||||||
|
* - `verbatim`: sets default `verbatim` `true`.
|
||||||
*
|
*
|
||||||
* * `ipv4first`: sets default `verbatim` `false`.
|
* The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
|
||||||
* * `verbatim`: sets default `verbatim` `true`.
|
* When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
|
||||||
*
|
* @since v14.18.0
|
||||||
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
* @param order must be 'ipv4first' or 'verbatim'.
|
||||||
* 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
|
// Error codes
|
||||||
export const NODATA: string;
|
export const NODATA: string;
|
||||||
export const FORMERR: string;
|
export const FORMERR: string;
|
||||||
@@ -731,7 +577,7 @@ declare module "dns" {
|
|||||||
* other resolvers:
|
* other resolvers:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const { Resolver } = require('node:dns');
|
* const { Resolver } = require('dns');
|
||||||
* const resolver = new Resolver();
|
* const resolver = new Resolver();
|
||||||
* resolver.setServers(['4.4.4.4']);
|
* resolver.setServers(['4.4.4.4']);
|
||||||
*
|
*
|
||||||
@@ -741,7 +587,7 @@ declare module "dns" {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The following methods from the `node:dns` module are available:
|
* The following methods from the `dns` module are available:
|
||||||
*
|
*
|
||||||
* * `resolver.getServers()`
|
* * `resolver.getServers()`
|
||||||
* * `resolver.resolve()`
|
* * `resolver.resolve()`
|
||||||
@@ -774,7 +620,6 @@ declare module "dns" {
|
|||||||
resolve4: typeof resolve4;
|
resolve4: typeof resolve4;
|
||||||
resolve6: typeof resolve6;
|
resolve6: typeof resolve6;
|
||||||
resolveAny: typeof resolveAny;
|
resolveAny: typeof resolveAny;
|
||||||
resolveCaa: typeof resolveCaa;
|
|
||||||
resolveCname: typeof resolveCname;
|
resolveCname: typeof resolveCname;
|
||||||
resolveMx: typeof resolveMx;
|
resolveMx: typeof resolveMx;
|
||||||
resolveNaptr: typeof resolveNaptr;
|
resolveNaptr: typeof resolveNaptr;
|
||||||
@@ -789,13 +634,13 @@ declare module "dns" {
|
|||||||
* This allows programs to specify outbound interfaces when used on multi-homed
|
* This allows programs to specify outbound interfaces when used on multi-homed
|
||||||
* systems.
|
* 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.
|
* operating system will choose a local address automatically.
|
||||||
*
|
*
|
||||||
* The resolver will use the v4 local address when making requests to IPv4 DNS
|
* 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.
|
* 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.
|
* The `rrtype` of resolution requests has no impact on the local address used.
|
||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0
|
||||||
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
|
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
|
||||||
* @param [ipv6='::0'] A string representation of an IPv6 address.
|
* @param [ipv6='::0'] A string representation of an IPv6 address.
|
||||||
*/
|
*/
|
||||||
@@ -804,6 +649,6 @@ declare module "dns" {
|
|||||||
}
|
}
|
||||||
export { dnsPromises as promises };
|
export { dnsPromises as promises };
|
||||||
}
|
}
|
||||||
declare module "node:dns" {
|
declare module 'node:dns' {
|
||||||
export * from "dns";
|
export * from 'dns';
|
||||||
}
|
}
|
||||||
|
|||||||
127
node_modules/@types/node/dns/promises.d.ts
generated
vendored
Normal file → Executable file
127
node_modules/@types/node/dns/promises.d.ts
generated
vendored
Normal file → Executable file
@@ -1,26 +1,26 @@
|
|||||||
/**
|
/**
|
||||||
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
|
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
|
||||||
* that return `Promise` objects rather than using callbacks. The API is accessible
|
* that return `Promise` objects rather than using callbacks. The API is accessible
|
||||||
* via `require('node:dns').promises` or `require('node:dns/promises')`.
|
* via `require('dns').promises` or `require('dns/promises')`.
|
||||||
* @since v10.6.0
|
* @since v10.6.0
|
||||||
*/
|
*/
|
||||||
declare module "dns/promises" {
|
declare module 'dns/promises' {
|
||||||
import {
|
import {
|
||||||
|
LookupAddress,
|
||||||
|
LookupOneOptions,
|
||||||
|
LookupAllOptions,
|
||||||
|
LookupOptions,
|
||||||
AnyRecord,
|
AnyRecord,
|
||||||
CaaRecord,
|
CaaRecord,
|
||||||
LookupAddress,
|
|
||||||
LookupAllOptions,
|
|
||||||
LookupOneOptions,
|
|
||||||
LookupOptions,
|
|
||||||
MxRecord,
|
MxRecord,
|
||||||
NaptrRecord,
|
NaptrRecord,
|
||||||
|
SoaRecord,
|
||||||
|
SrvRecord,
|
||||||
|
ResolveWithTtlOptions,
|
||||||
RecordWithTtl,
|
RecordWithTtl,
|
||||||
ResolveOptions,
|
ResolveOptions,
|
||||||
ResolverOptions,
|
ResolverOptions,
|
||||||
ResolveWithTtlOptions,
|
} from 'node:dns';
|
||||||
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),
|
* 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
|
* 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
|
* `dnsPromises.lookup()` does not necessarily have anything to do with the DNS
|
||||||
* protocol. The implementation uses an operating system facility that can
|
* 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
|
* subtle but important consequences on the behavior of any Node.js program. Please
|
||||||
* take some time to consult the `Implementation considerations section` before
|
* take some time to consult the `Implementation considerations section` before
|
||||||
* using `dnsPromises.lookup()`.
|
* using `dnsPromises.lookup()`.
|
||||||
@@ -60,7 +60,7 @@ declare module "dns/promises" {
|
|||||||
* Example usage:
|
* Example usage:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
* const dnsPromises = dns.promises;
|
* const dnsPromises = dns.promises;
|
||||||
* const options = {
|
* const options = {
|
||||||
* family: 6,
|
* 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.
|
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dnsPromises = require('node:dns').promises;
|
* const dnsPromises = require('dns').promises;
|
||||||
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
||||||
* console.log(result.hostname, result.service);
|
* console.log(result.hostname, result.service);
|
||||||
* // Prints: localhost ssh
|
* // Prints: localhost ssh
|
||||||
@@ -106,7 +106,7 @@ declare module "dns/promises" {
|
|||||||
*/
|
*/
|
||||||
function lookupService(
|
function lookupService(
|
||||||
address: string,
|
address: string,
|
||||||
port: number,
|
port: number
|
||||||
): Promise<{
|
): Promise<{
|
||||||
hostname: string;
|
hostname: string;
|
||||||
service: string;
|
service: string;
|
||||||
@@ -125,22 +125,19 @@ declare module "dns/promises" {
|
|||||||
* @param [rrtype='A'] Resource record type.
|
* @param [rrtype='A'] Resource record type.
|
||||||
*/
|
*/
|
||||||
function resolve(hostname: string): Promise<string[]>;
|
function resolve(hostname: string): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'A'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'AAAA'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
function resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
function resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'CNAME'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
function resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'NS'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'PTR'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
function resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
|
||||||
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
||||||
function resolve(
|
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||||
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
|
* 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']`).
|
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
||||||
@@ -192,7 +189,7 @@ declare module "dns/promises" {
|
|||||||
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
|
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
|
||||||
* the `Promise` is resolved with an array of objects containing available
|
* the `Promise` is resolved with an array of objects containing available
|
||||||
* certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
|
* certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
|
||||||
* @since v15.0.0, v14.17.0
|
* @since v15.0.0
|
||||||
*/
|
*/
|
||||||
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
||||||
/**
|
/**
|
||||||
@@ -209,7 +206,7 @@ declare module "dns/promises" {
|
|||||||
*/
|
*/
|
||||||
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
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:
|
* of objects with the following properties:
|
||||||
*
|
*
|
||||||
* * `flags`
|
* * `flags`
|
||||||
@@ -335,61 +332,16 @@ declare module "dns/promises" {
|
|||||||
*/
|
*/
|
||||||
function setServers(servers: ReadonlyArray<string>): void;
|
function setServers(servers: ReadonlyArray<string>): void;
|
||||||
/**
|
/**
|
||||||
* Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
|
* Set the default value of `verbatim` in {@link lookup}. The value could be:
|
||||||
|
* - `ipv4first`: sets default `verbatim` `false`.
|
||||||
|
* - `verbatim`: sets default `verbatim` `true`.
|
||||||
*
|
*
|
||||||
* * `ipv4first`: sets default `verbatim` `false`.
|
* The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
|
||||||
* * `verbatim`: sets default `verbatim` `true`.
|
* When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
|
||||||
*
|
* @since v14.18.0
|
||||||
* The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have
|
* @param order must be 'ipv4first' or 'verbatim'.
|
||||||
* 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 {
|
class Resolver {
|
||||||
constructor(options?: ResolverOptions);
|
constructor(options?: ResolverOptions);
|
||||||
cancel(): void;
|
cancel(): void;
|
||||||
@@ -398,7 +350,6 @@ declare module "dns/promises" {
|
|||||||
resolve4: typeof resolve4;
|
resolve4: typeof resolve4;
|
||||||
resolve6: typeof resolve6;
|
resolve6: typeof resolve6;
|
||||||
resolveAny: typeof resolveAny;
|
resolveAny: typeof resolveAny;
|
||||||
resolveCaa: typeof resolveCaa;
|
|
||||||
resolveCname: typeof resolveCname;
|
resolveCname: typeof resolveCname;
|
||||||
resolveMx: typeof resolveMx;
|
resolveMx: typeof resolveMx;
|
||||||
resolveNaptr: typeof resolveNaptr;
|
resolveNaptr: typeof resolveNaptr;
|
||||||
@@ -412,6 +363,6 @@ declare module "dns/promises" {
|
|||||||
setServers: typeof setServers;
|
setServers: typeof setServers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:dns/promises" {
|
declare module 'node:dns/promises' {
|
||||||
export * from "dns/promises";
|
export * from 'dns/promises';
|
||||||
}
|
}
|
||||||
|
|||||||
122
node_modules/@types/node/dom-events.d.ts
generated
vendored
122
node_modules/@types/node/dom-events.d.ts
generated
vendored
@@ -1,122 +0,0 @@
|
|||||||
export {}; // Don't export anything!
|
|
||||||
|
|
||||||
//// DOM-like Events
|
|
||||||
// NB: The Event / EventTarget / EventListener implementations below were copied
|
|
||||||
// from lib.dom.d.ts, then edited to reflect Node's documentation at
|
|
||||||
// https://nodejs.org/api/events.html#class-eventtarget.
|
|
||||||
// Please read that link to understand important implementation differences.
|
|
||||||
|
|
||||||
// This conditional type will be the existing global Event in a browser, or
|
|
||||||
// the copy below in a Node environment.
|
|
||||||
type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {}
|
|
||||||
: {
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
readonly bubbles: boolean;
|
|
||||||
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
cancelBubble: () => void;
|
|
||||||
/** True if the event was created with the cancelable option */
|
|
||||||
readonly cancelable: boolean;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
readonly composed: boolean;
|
|
||||||
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
composedPath(): [EventTarget?];
|
|
||||||
/** Alias for event.target. */
|
|
||||||
readonly currentTarget: EventTarget | null;
|
|
||||||
/** Is true if cancelable is true and event.preventDefault() has been called. */
|
|
||||||
readonly defaultPrevented: boolean;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
readonly eventPhase: 0 | 2;
|
|
||||||
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
|
|
||||||
readonly isTrusted: boolean;
|
|
||||||
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
|
|
||||||
preventDefault(): void;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
returnValue: boolean;
|
|
||||||
/** Alias for event.target. */
|
|
||||||
readonly srcElement: EventTarget | null;
|
|
||||||
/** Stops the invocation of event listeners after the current one completes. */
|
|
||||||
stopImmediatePropagation(): void;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
stopPropagation(): void;
|
|
||||||
/** The `EventTarget` dispatching the event */
|
|
||||||
readonly target: EventTarget | null;
|
|
||||||
/** The millisecond timestamp when the Event object was created. */
|
|
||||||
readonly timeStamp: number;
|
|
||||||
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
|
|
||||||
readonly type: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
// See comment above explaining conditional type
|
|
||||||
type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {}
|
|
||||||
: {
|
|
||||||
/**
|
|
||||||
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
|
|
||||||
*
|
|
||||||
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
|
|
||||||
*
|
|
||||||
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
|
|
||||||
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
|
|
||||||
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
|
|
||||||
*/
|
|
||||||
addEventListener(
|
|
||||||
type: string,
|
|
||||||
listener: EventListener | EventListenerObject,
|
|
||||||
options?: AddEventListenerOptions | boolean,
|
|
||||||
): void;
|
|
||||||
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
|
|
||||||
dispatchEvent(event: Event): boolean;
|
|
||||||
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
|
|
||||||
removeEventListener(
|
|
||||||
type: string,
|
|
||||||
listener: EventListener | EventListenerObject,
|
|
||||||
options?: EventListenerOptions | boolean,
|
|
||||||
): void;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface EventInit {
|
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EventListenerOptions {
|
|
||||||
/** Not directly used by Node.js. Added for API completeness. Default: `false`. */
|
|
||||||
capture?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AddEventListenerOptions extends EventListenerOptions {
|
|
||||||
/** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */
|
|
||||||
once?: boolean;
|
|
||||||
/** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */
|
|
||||||
passive?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EventListener {
|
|
||||||
(evt: Event): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EventListenerObject {
|
|
||||||
handleEvent(object: Event): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
import {} from "events"; // Make this an ambient declaration
|
|
||||||
declare global {
|
|
||||||
/** An event which takes place in the DOM. */
|
|
||||||
interface Event extends __Event {}
|
|
||||||
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
|
|
||||||
: {
|
|
||||||
prototype: __Event;
|
|
||||||
new(type: string, eventInitDict?: EventInit): __Event;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EventTarget is a DOM interface implemented by objects that can
|
|
||||||
* receive events and may have listeners for them.
|
|
||||||
*/
|
|
||||||
interface EventTarget extends __EventTarget {}
|
|
||||||
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
|
|
||||||
: {
|
|
||||||
prototype: __EventTarget;
|
|
||||||
new(): __EventTarget;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
19
node_modules/@types/node/domain.d.ts
generated
vendored
Normal file → Executable file
19
node_modules/@types/node/domain.d.ts
generated
vendored
Normal file → Executable file
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* **This module is pending deprecation.** Once a replacement API has been
|
* **This module is pending deprecation.** Once a replacement API has been
|
||||||
* finalized, this module will be fully deprecated. Most developers should
|
* finalized, this module will be fully deprecated. Most developers should**not** have cause to use this module. Users who absolutely must have
|
||||||
* **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
|
* the functionality that domains provide may rely on it for the time being
|
||||||
* but should expect to have to migrate to a different solution
|
* but should expect to have to migrate to a different solution
|
||||||
* in the future.
|
* in the future.
|
||||||
@@ -12,10 +11,10 @@
|
|||||||
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
||||||
* exit immediately with an error code.
|
* exit immediately with an error code.
|
||||||
* @deprecated Since v1.4.2 - Deprecated
|
* @deprecated Since v1.4.2 - Deprecated
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/domain.js)
|
||||||
*/
|
*/
|
||||||
declare module "domain" {
|
declare module 'domain' {
|
||||||
import EventEmitter = require("node:events");
|
import EventEmitter = require('node:events');
|
||||||
/**
|
/**
|
||||||
* The `Domain` class encapsulates the functionality of routing errors and
|
* The `Domain` class encapsulates the functionality of routing errors and
|
||||||
* uncaught exceptions to the active `Domain` object.
|
* uncaught exceptions to the active `Domain` object.
|
||||||
@@ -56,15 +55,15 @@ declare module "domain" {
|
|||||||
exit(): void;
|
exit(): void;
|
||||||
/**
|
/**
|
||||||
* Run the supplied function in the context of the domain, implicitly
|
* Run the supplied function in the context of the domain, implicitly
|
||||||
* binding all event emitters, timers, and low-level requests that are
|
* binding all event emitters, timers, and lowlevel requests that are
|
||||||
* created in that context. Optionally, arguments can be passed to
|
* created in that context. Optionally, arguments can be passed to
|
||||||
* the function.
|
* the function.
|
||||||
*
|
*
|
||||||
* This is the most basic way to use a domain.
|
* This is the most basic way to use a domain.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const domain = require('node:domain');
|
* const domain = require('domain');
|
||||||
* const fs = require('node:fs');
|
* const fs = require('fs');
|
||||||
* const d = domain.create();
|
* const d = domain.create();
|
||||||
* d.on('error', (er) => {
|
* d.on('error', (er) => {
|
||||||
* console.error('Caught error!', er);
|
* console.error('Caught error!', er);
|
||||||
@@ -165,6 +164,6 @@ declare module "domain" {
|
|||||||
}
|
}
|
||||||
function create(): Domain;
|
function create(): Domain;
|
||||||
}
|
}
|
||||||
declare module "node:domain" {
|
declare module 'node:domain' {
|
||||||
export * from "domain";
|
export * from 'domain';
|
||||||
}
|
}
|
||||||
|
|||||||
367
node_modules/@types/node/events.d.ts
generated
vendored
Normal file → Executable file
367
node_modules/@types/node/events.d.ts
generated
vendored
Normal file → Executable file
@@ -22,7 +22,7 @@
|
|||||||
* the `eventEmitter.emit()` method is used to trigger the event.
|
* the `eventEmitter.emit()` method is used to trigger the event.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
*
|
*
|
||||||
* class MyEmitter extends EventEmitter {}
|
* class MyEmitter extends EventEmitter {}
|
||||||
*
|
*
|
||||||
@@ -32,61 +32,25 @@
|
|||||||
* });
|
* });
|
||||||
* myEmitter.emit('event');
|
* myEmitter.emit('event');
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.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 {
|
interface EventEmitterOptions {
|
||||||
/**
|
/**
|
||||||
* Enables automatic capturing of promise rejection.
|
* Enables automatic capturing of promise rejection.
|
||||||
*/
|
*/
|
||||||
captureRejections?: boolean | undefined;
|
captureRejections?: boolean | undefined;
|
||||||
}
|
}
|
||||||
// Any EventTarget with a Node-style `once` function
|
interface NodeEventTarget {
|
||||||
interface _NodeEventTarget {
|
|
||||||
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||||
}
|
}
|
||||||
// Any EventTarget with a DOM-style `addEventListener`
|
interface DOMEventTarget {
|
||||||
interface _DOMEventTarget {
|
|
||||||
addEventListener(
|
addEventListener(
|
||||||
eventName: string,
|
eventName: string,
|
||||||
listener: (...args: any[]) => void,
|
listener: (...args: any[]) => void,
|
||||||
opts?: {
|
opts?: {
|
||||||
once: boolean;
|
once: boolean;
|
||||||
},
|
}
|
||||||
): any;
|
): any;
|
||||||
}
|
}
|
||||||
interface StaticEventEmitterOptions {
|
interface StaticEventEmitterOptions {
|
||||||
@@ -94,10 +58,10 @@ declare module "events" {
|
|||||||
}
|
}
|
||||||
interface EventEmitter extends NodeJS.EventEmitter {}
|
interface EventEmitter extends NodeJS.EventEmitter {}
|
||||||
/**
|
/**
|
||||||
* The `EventEmitter` class is defined and exposed by the `node:events` module:
|
* The `EventEmitter` class is defined and exposed by the `events` module:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* All `EventEmitter`s emit the event `'newListener'` when new listeners are
|
* All `EventEmitter`s emit the event `'newListener'` when new listeners are
|
||||||
@@ -108,9 +72,6 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
class EventEmitter {
|
class EventEmitter {
|
||||||
constructor(options?: EventEmitterOptions);
|
constructor(options?: EventEmitterOptions);
|
||||||
|
|
||||||
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
||||||
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
||||||
@@ -121,28 +82,31 @@ declare module "events" {
|
|||||||
* semantics and does not listen to the `'error'` event.
|
* semantics and does not listen to the `'error'` event.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { once, EventEmitter } from 'node:events';
|
* const { once, EventEmitter } = require('events');
|
||||||
* import process from 'node:process';
|
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* async function run() {
|
||||||
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* process.nextTick(() => {
|
* process.nextTick(() => {
|
||||||
* ee.emit('myevent', 42);
|
* ee.emit('myevent', 42);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* const [value] = await once(ee, 'myevent');
|
* const [value] = await once(ee, 'myevent');
|
||||||
* console.log(value);
|
* console.log(value);
|
||||||
*
|
*
|
||||||
* const err = new Error('kaboom');
|
* const err = new Error('kaboom');
|
||||||
* process.nextTick(() => {
|
* process.nextTick(() => {
|
||||||
* ee.emit('error', err);
|
* ee.emit('error', err);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await once(ee, 'myevent');
|
* await once(ee, 'myevent');
|
||||||
* } catch (err) {
|
* } catch (err) {
|
||||||
* console.error('error happened', err);
|
* console.log('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
|
* 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
|
||||||
@@ -150,13 +114,13 @@ declare module "events" {
|
|||||||
* special handling:
|
* special handling:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter, once } from 'node:events';
|
* const { EventEmitter, once } = require('events');
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* once(ee, 'error')
|
* once(ee, 'error')
|
||||||
* .then(([err]) => console.log('ok', err.message))
|
* .then(([err]) => console.log('ok', err.message))
|
||||||
* .catch((err) => console.error('error', err.message));
|
* .catch((err) => console.log('error', err.message));
|
||||||
*
|
*
|
||||||
* ee.emit('error', new Error('boom'));
|
* ee.emit('error', new Error('boom'));
|
||||||
*
|
*
|
||||||
@@ -166,7 +130,7 @@ declare module "events" {
|
|||||||
* An `AbortSignal` can be used to cancel waiting for the event:
|
* An `AbortSignal` can be used to cancel waiting for the event:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter, once } from 'node:events';
|
* const { EventEmitter, once } = require('events');
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
* const ac = new AbortController();
|
* const ac = new AbortController();
|
||||||
@@ -190,32 +154,29 @@ declare module "events" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v11.13.0, v10.16.0
|
* @since v11.13.0, v10.16.0
|
||||||
*/
|
*/
|
||||||
static once(
|
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||||
emitter: _NodeEventTarget,
|
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||||
eventName: string | symbol,
|
|
||||||
options?: StaticEventEmitterOptions,
|
|
||||||
): Promise<any[]>;
|
|
||||||
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
||||||
/**
|
/**
|
||||||
* ```js
|
* ```js
|
||||||
* import { on, EventEmitter } from 'node:events';
|
* const { on, EventEmitter } = require('events');
|
||||||
* import process from 'node:process';
|
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* (async () => {
|
||||||
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* // Emit later on
|
* // Emit later on
|
||||||
* process.nextTick(() => {
|
* process.nextTick(() => {
|
||||||
* ee.emit('foo', 'bar');
|
* ee.emit('foo', 'bar');
|
||||||
* ee.emit('foo', 42);
|
* ee.emit('foo', 42);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* for await (const event of on(ee, 'foo')) {
|
* for await (const event of on(ee, 'foo')) {
|
||||||
* // The execution of this inner block is synchronous and it
|
* // The execution of this inner block is synchronous and it
|
||||||
* // processes one event at a time (even with await). Do not use
|
* // processes one event at a time (even with await). Do not use
|
||||||
* // if concurrent execution is required.
|
* // if concurrent execution is required.
|
||||||
* console.log(event); // prints ['bar'] [42]
|
* console.log(event); // prints ['bar'] [42]
|
||||||
* }
|
* }
|
||||||
* // Unreachable here
|
* // Unreachable here
|
||||||
|
* })();
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Returns an `AsyncIterator` that iterates `eventName` events. It will throw
|
* Returns an `AsyncIterator` that iterates `eventName` events. It will throw
|
||||||
@@ -226,9 +187,7 @@ declare module "events" {
|
|||||||
* An `AbortSignal` can be used to cancel waiting on events:
|
* An `AbortSignal` can be used to cancel waiting on events:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { on, EventEmitter } from 'node:events';
|
* const { on, EventEmitter } = require('events');
|
||||||
* import process from 'node:process';
|
|
||||||
*
|
|
||||||
* const ac = new AbortController();
|
* const ac = new AbortController();
|
||||||
*
|
*
|
||||||
* (async () => {
|
* (async () => {
|
||||||
@@ -255,17 +214,12 @@ declare module "events" {
|
|||||||
* @param eventName The name of the event being listened for
|
* @param eventName The name of the event being listened for
|
||||||
* @return that iterates `eventName` events emitted by the `emitter`
|
* @return that iterates `eventName` events emitted by the `emitter`
|
||||||
*/
|
*/
|
||||||
static on(
|
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
|
||||||
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`.
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter, listenerCount } from 'node:events';
|
* const { EventEmitter, listenerCount } = require('events');
|
||||||
*
|
|
||||||
* const myEmitter = new EventEmitter();
|
* const myEmitter = new EventEmitter();
|
||||||
* myEmitter.on('event', () => {});
|
* myEmitter.on('event', () => {});
|
||||||
* myEmitter.on('event', () => {});
|
* myEmitter.on('event', () => {});
|
||||||
@@ -288,164 +242,43 @@ declare module "events" {
|
|||||||
* event target. This is useful for debugging and diagnostic purposes.
|
* event target. This is useful for debugging and diagnostic purposes.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { getEventListeners, EventEmitter } from 'node:events';
|
* const { getEventListeners, EventEmitter } = require('events');
|
||||||
*
|
*
|
||||||
* {
|
* {
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
* const listener = () => console.log('Events are fun');
|
* const listener = () => console.log('Events are fun');
|
||||||
* ee.on('foo', listener);
|
* ee.on('foo', listener);
|
||||||
* console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
|
* getEventListeners(ee, 'foo'); // [listener]
|
||||||
* }
|
* }
|
||||||
* {
|
* {
|
||||||
* const et = new EventTarget();
|
* const et = new EventTarget();
|
||||||
* const listener = () => console.log('Events are fun');
|
* const listener = () => console.log('Events are fun');
|
||||||
* et.addEventListener('foo', listener);
|
* et.addEventListener('foo', listener);
|
||||||
* console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
|
* getEventListeners(et, 'foo'); // [listener]
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @since v15.2.0, v14.17.0
|
* @since v15.2.0
|
||||||
*/
|
*/
|
||||||
static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
||||||
/**
|
/**
|
||||||
* Returns the currently set max amount of listeners.
|
* 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.
|
||||||
*
|
*
|
||||||
* For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
|
* Installing a listener using this symbol does not change the behavior once an
|
||||||
* the emitter.
|
* `'error'` event is emitted, therefore the process will still crash if no
|
||||||
*
|
|
||||||
* 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.
|
* regular `'error'` listener is installed.
|
||||||
* @since v13.6.0, v12.17.0
|
|
||||||
*/
|
*/
|
||||||
static readonly errorMonitor: unique symbol;
|
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;
|
static readonly captureRejectionSymbol: unique symbol;
|
||||||
/**
|
/**
|
||||||
* Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
|
* Sets or gets the default captureRejection value for all emitters.
|
||||||
*
|
|
||||||
* 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;
|
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;
|
static defaultMaxListeners: number;
|
||||||
}
|
}
|
||||||
import internal = require("node:events");
|
import internal = require('node:events');
|
||||||
namespace EventEmitter {
|
namespace EventEmitter {
|
||||||
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
||||||
export { internal as EventEmitter };
|
export { internal as EventEmitter };
|
||||||
@@ -455,54 +288,10 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
signal?: AbortSignal | undefined;
|
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 {
|
global {
|
||||||
namespace NodeJS {
|
namespace NodeJS {
|
||||||
interface EventEmitter {
|
interface EventEmitter {
|
||||||
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
||||||
/**
|
/**
|
||||||
* Alias for `emitter.on(eventName, listener)`.
|
* Alias for `emitter.on(eventName, listener)`.
|
||||||
* @since v0.1.26
|
* @since v0.1.26
|
||||||
@@ -526,7 +315,6 @@ declare module "events" {
|
|||||||
* event listener to the beginning of the listeners array.
|
* event listener to the beginning of the listeners array.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const myEE = new EventEmitter();
|
* const myEE = new EventEmitter();
|
||||||
* myEE.on('foo', () => console.log('a'));
|
* myEE.on('foo', () => console.log('a'));
|
||||||
* myEE.prependListener('foo', () => console.log('b'));
|
* myEE.prependListener('foo', () => console.log('b'));
|
||||||
@@ -556,7 +344,6 @@ declare module "events" {
|
|||||||
* event listener to the beginning of the listeners array.
|
* event listener to the beginning of the listeners array.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const myEE = new EventEmitter();
|
* const myEE = new EventEmitter();
|
||||||
* myEE.once('foo', () => console.log('a'));
|
* myEE.once('foo', () => console.log('a'));
|
||||||
* myEE.prependOnceListener('foo', () => console.log('b'));
|
* myEE.prependOnceListener('foo', () => console.log('b'));
|
||||||
@@ -588,12 +375,10 @@ declare module "events" {
|
|||||||
* called multiple times to remove each instance.
|
* called multiple times to remove each instance.
|
||||||
*
|
*
|
||||||
* Once an event is emitted, all listeners attached to it at the
|
* Once an event is emitted, all listeners attached to it at the
|
||||||
* time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
|
* time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
|
||||||
* will not remove them from`emit()` in progress. Subsequent events behave as expected.
|
* not remove them from`emit()` in progress. Subsequent events behave as expected.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* class MyEmitter extends EventEmitter {}
|
|
||||||
* const myEmitter = new MyEmitter();
|
* const myEmitter = new MyEmitter();
|
||||||
*
|
*
|
||||||
* const callbackA = () => {
|
* const callbackA = () => {
|
||||||
@@ -634,7 +419,6 @@ declare module "events" {
|
|||||||
* recently added instance. In the example the `once('ping')`listener is removed:
|
* recently added instance. In the example the `once('ping')`listener is removed:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* function pong() {
|
* function pong() {
|
||||||
@@ -703,7 +487,6 @@ declare module "events" {
|
|||||||
* including any wrappers (such as those created by `.once()`).
|
* including any wrappers (such as those created by `.once()`).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const emitter = new EventEmitter();
|
* const emitter = new EventEmitter();
|
||||||
* emitter.once('log', () => console.log('log once'));
|
* emitter.once('log', () => console.log('log once'));
|
||||||
*
|
*
|
||||||
@@ -736,7 +519,7 @@ declare module "events" {
|
|||||||
* Returns `true` if the event had listeners, `false` otherwise.
|
* Returns `true` if the event had listeners, `false` otherwise.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
* const myEmitter = new EventEmitter();
|
* const myEmitter = new EventEmitter();
|
||||||
*
|
*
|
||||||
* // First listener
|
* // First listener
|
||||||
@@ -771,14 +554,11 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
emit(eventName: string | symbol, ...args: any[]): boolean;
|
emit(eventName: string | symbol, ...args: any[]): boolean;
|
||||||
/**
|
/**
|
||||||
* Returns the number of listeners listening for the event named `eventName`.
|
* Returns the number of listeners listening to 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
|
* @since v3.2.0
|
||||||
* @param eventName The name of the event being listened for
|
* @param eventName The name of the event being listened for
|
||||||
* @param listener The event handler function
|
|
||||||
*/
|
*/
|
||||||
listenerCount(eventName: string | symbol, listener?: Function): number;
|
listenerCount(eventName: string | symbol): number;
|
||||||
/**
|
/**
|
||||||
* Adds the `listener` function to the _beginning_ of the listeners array for the
|
* 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
|
* event named `eventName`. No checks are made to see if the `listener` has
|
||||||
@@ -798,7 +578,7 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
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.
|
* listener is removed, and then invoked.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
@@ -818,8 +598,7 @@ declare module "events" {
|
|||||||
* listeners. The values in the array are strings or `Symbol`s.
|
* listeners. The values in the array are strings or `Symbol`s.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
*
|
|
||||||
* const myEE = new EventEmitter();
|
* const myEE = new EventEmitter();
|
||||||
* myEE.on('foo', () => {});
|
* myEE.on('foo', () => {});
|
||||||
* myEE.on('bar', () => {});
|
* myEE.on('bar', () => {});
|
||||||
@@ -838,7 +617,7 @@ declare module "events" {
|
|||||||
}
|
}
|
||||||
export = EventEmitter;
|
export = EventEmitter;
|
||||||
}
|
}
|
||||||
declare module "node:events" {
|
declare module 'node:events' {
|
||||||
import events = require("events");
|
import events = require('events');
|
||||||
export = events;
|
export = events;
|
||||||
}
|
}
|
||||||
|
|||||||
1365
node_modules/@types/node/fs.d.ts
generated
vendored
Normal file → Executable file
1365
node_modules/@types/node/fs.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
417
node_modules/@types/node/fs/promises.d.ts
generated
vendored
Normal file → Executable file
417
node_modules/@types/node/fs/promises.d.ts
generated
vendored
Normal file → Executable file
@@ -8,52 +8,45 @@
|
|||||||
* concurrent modifications on the same file or data corruption may occur.
|
* concurrent modifications on the same file or data corruption may occur.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
declare module "fs/promises" {
|
declare module 'fs/promises' {
|
||||||
import { Abortable } from "node:events";
|
import { Abortable } from 'node:events';
|
||||||
import { Stream } from "node:stream";
|
import { Stream } from 'node:stream';
|
||||||
import { ReadableStream } from "node:stream/web";
|
|
||||||
import {
|
import {
|
||||||
|
Stats,
|
||||||
BigIntStats,
|
BigIntStats,
|
||||||
BigIntStatsFs,
|
StatOptions,
|
||||||
BufferEncodingOption,
|
WriteVResult,
|
||||||
constants as fsConstants,
|
|
||||||
CopyOptions,
|
|
||||||
Dir,
|
|
||||||
Dirent,
|
|
||||||
MakeDirectoryOptions,
|
|
||||||
Mode,
|
|
||||||
ObjectEncodingOptions,
|
|
||||||
OpenDirOptions,
|
|
||||||
OpenMode,
|
|
||||||
PathLike,
|
|
||||||
ReadStream,
|
|
||||||
ReadVResult,
|
ReadVResult,
|
||||||
|
PathLike,
|
||||||
RmDirOptions,
|
RmDirOptions,
|
||||||
RmOptions,
|
RmOptions,
|
||||||
StatFsOptions,
|
MakeDirectoryOptions,
|
||||||
StatOptions,
|
Dirent,
|
||||||
Stats,
|
OpenDirOptions,
|
||||||
StatsFs,
|
Dir,
|
||||||
TimeLike,
|
ObjectEncodingOptions,
|
||||||
WatchEventType,
|
BufferEncodingOption,
|
||||||
|
OpenMode,
|
||||||
|
Mode,
|
||||||
WatchOptions,
|
WatchOptions,
|
||||||
|
WatchEventType,
|
||||||
|
CopyOptions,
|
||||||
|
ReadStream,
|
||||||
WriteStream,
|
WriteStream,
|
||||||
WriteVResult,
|
} from 'node:fs';
|
||||||
} from "node:fs";
|
|
||||||
import { Interface as ReadlineInterface } from "node:readline";
|
|
||||||
interface FileChangeInfo<T extends string | Buffer> {
|
interface FileChangeInfo<T extends string | Buffer> {
|
||||||
eventType: WatchEventType;
|
eventType: WatchEventType;
|
||||||
filename: T | null;
|
filename: T;
|
||||||
}
|
}
|
||||||
interface FlagAndOpenMode {
|
interface FlagAndOpenMode {
|
||||||
mode?: Mode | undefined;
|
mode?: Mode | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
}
|
}
|
||||||
interface FileReadResult<T extends NodeJS.ArrayBufferView> {
|
interface FileReadResult<T extends ArrayBufferView> {
|
||||||
bytesRead: number;
|
bytesRead: number;
|
||||||
buffer: T;
|
buffer: T;
|
||||||
}
|
}
|
||||||
interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
|
interface FileReadOptions<T extends ArrayBufferView = Buffer> {
|
||||||
/**
|
/**
|
||||||
* @default `Buffer.alloc(0xffff)`
|
* @default `Buffer.alloc(0xffff)`
|
||||||
*/
|
*/
|
||||||
@@ -81,14 +74,6 @@ declare module "fs/promises" {
|
|||||||
autoClose?: boolean | undefined;
|
autoClose?: boolean | undefined;
|
||||||
emitClose?: boolean | undefined;
|
emitClose?: boolean | undefined;
|
||||||
start?: number | 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
|
// TODO: Add `EventEmitter` close
|
||||||
interface FileHandle {
|
interface FileHandle {
|
||||||
@@ -105,10 +90,7 @@ declare module "fs/promises" {
|
|||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
appendFile(
|
appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
||||||
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).
|
* 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
|
* @since v10.0.0
|
||||||
@@ -125,8 +107,8 @@ declare module "fs/promises" {
|
|||||||
*/
|
*/
|
||||||
chmod(mode: Mode): Promise<void>;
|
chmod(mode: Mode): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream
|
* Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
|
||||||
* returned by this method has a default `highWaterMark` of 64 KiB.
|
* returned by this method has a default `highWaterMark` of 64 kb.
|
||||||
*
|
*
|
||||||
* `options` can include `start` and `end` values to read a range of bytes from
|
* `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
|
* the file instead of the entire file. Both `start` and `end` are inclusive and
|
||||||
@@ -144,7 +126,7 @@ declare module "fs/promises" {
|
|||||||
* destroyed. Set the `emitClose` option to `false` to change this behavior.
|
* destroyed. Set the `emitClose` option to `false` to change this behavior.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* const fd = await open('/dev/input/event0');
|
* const fd = await open('/dev/input/event0');
|
||||||
* // Create a stream from some character device.
|
* // Create a stream from some character device.
|
||||||
@@ -170,7 +152,7 @@ declare module "fs/promises" {
|
|||||||
* An example to read the last 10 bytes of a file which is 100 bytes long:
|
* An example to read the last 10 bytes of a file which is 100 bytes long:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* const fd = await open('sample.txt');
|
* const fd = await open('sample.txt');
|
||||||
* fd.createReadStream({ start: 90, end: 99 });
|
* fd.createReadStream({ start: 90, end: 99 });
|
||||||
@@ -181,9 +163,9 @@ declare module "fs/promises" {
|
|||||||
/**
|
/**
|
||||||
* `options` may also include a `start` option to allow writing data at some
|
* `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
|
* 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
|
* \[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
|
||||||
* replacing it may require the `flags` `open` option to be set to `r+` rather than
|
* it may require the `flags` `open` option to be set to `r+` rather than the
|
||||||
* the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
* default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
||||||
*
|
*
|
||||||
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
||||||
* then the file descriptor won't be closed, even if there's an error.
|
* then the file descriptor won't be closed, even if there's an error.
|
||||||
@@ -209,7 +191,7 @@ declare module "fs/promises" {
|
|||||||
* device. The specific implementation is operating system and device specific.
|
* 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.
|
* Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fufills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
sync(): Promise<void>;
|
sync(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
@@ -225,38 +207,8 @@ declare module "fs/promises" {
|
|||||||
* integer, the current file position will remain unchanged.
|
* integer, the current file position will remain unchanged.
|
||||||
* @return Fulfills upon success with an object with two properties:
|
* @return Fulfills upon success with an object with two properties:
|
||||||
*/
|
*/
|
||||||
read<T extends NodeJS.ArrayBufferView>(
|
read<T extends ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
|
||||||
buffer: T,
|
read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<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.
|
* Asynchronously reads the entire contents of a file.
|
||||||
*
|
*
|
||||||
@@ -275,7 +227,7 @@ declare module "fs/promises" {
|
|||||||
options?: {
|
options?: {
|
||||||
encoding?: null | undefined;
|
encoding?: null | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} | null,
|
} | null
|
||||||
): Promise<Buffer>;
|
): Promise<Buffer>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||||
@@ -286,10 +238,10 @@ declare module "fs/promises" {
|
|||||||
readFile(
|
readFile(
|
||||||
options:
|
options:
|
||||||
| {
|
| {
|
||||||
encoding: BufferEncoding;
|
encoding: BufferEncoding;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
}
|
}
|
||||||
| BufferEncoding,
|
| BufferEncoding
|
||||||
): Promise<string>;
|
): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||||
@@ -300,27 +252,11 @@ declare module "fs/promises" {
|
|||||||
readFile(
|
readFile(
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
})
|
})
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string | Buffer>;
|
): 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
|
* @since v10.0.0
|
||||||
* @return Fulfills with an {fs.Stats} for the file.
|
* @return Fulfills with an {fs.Stats} for the file.
|
||||||
@@ -328,12 +264,12 @@ declare module "fs/promises" {
|
|||||||
stat(
|
stat(
|
||||||
opts?: StatOptions & {
|
opts?: StatOptions & {
|
||||||
bigint?: false | undefined;
|
bigint?: false | undefined;
|
||||||
},
|
}
|
||||||
): Promise<Stats>;
|
): Promise<Stats>;
|
||||||
stat(
|
stat(
|
||||||
opts: StatOptions & {
|
opts: StatOptions & {
|
||||||
bigint: true;
|
bigint: true;
|
||||||
},
|
}
|
||||||
): Promise<BigIntStats>;
|
): Promise<BigIntStats>;
|
||||||
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||||
/**
|
/**
|
||||||
@@ -345,7 +281,7 @@ declare module "fs/promises" {
|
|||||||
* The following example retains only the first four bytes of the file:
|
* The following example retains only the first four bytes of the file:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* let filehandle = null;
|
* let filehandle = null;
|
||||||
* try {
|
* try {
|
||||||
@@ -369,12 +305,13 @@ 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.
|
* 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
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
|
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
||||||
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
* [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.
|
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
|
||||||
* The promise is resolved with no arguments upon success.
|
* object with an own `toString` function
|
||||||
|
* property. The promise is resolved with no arguments upon success.
|
||||||
*
|
*
|
||||||
* If `options` is a string, then it specifies the `encoding`.
|
* If `options` is a string, then it specifies the `encoding`.
|
||||||
*
|
*
|
||||||
@@ -388,33 +325,32 @@ declare module "fs/promises" {
|
|||||||
* beginning of the file.
|
* beginning of the file.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
writeFile(
|
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
|
||||||
data: string | Uint8Array,
|
|
||||||
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Write `buffer` to the file.
|
* 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:
|
* The promise is resolved with an object containing two properties:
|
||||||
*
|
*
|
||||||
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
||||||
* without waiting for the promise to be resolved (or rejected). For this
|
* without waiting for the promise to be resolved (or rejected). For this
|
||||||
* scenario, use `filehandle.createWriteStream()`.
|
* scenario, use `fs.createWriteStream()`.
|
||||||
*
|
*
|
||||||
* On Linux, positional writes do not work when the file is opened in append mode.
|
* 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 kernel ignores the position argument and always appends the data to
|
||||||
* the end of the file.
|
* the end of the file.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @param offset The start position from within `buffer` where the data to write begins.
|
* @param [offset=0] 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 [length=buffer.byteLength] 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
|
* @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.
|
||||||
* position. See the POSIX pwrite(2) documentation for more detail.
|
* See the POSIX pwrite(2) documentation for more detail.
|
||||||
*/
|
*/
|
||||||
write<TBuffer extends Uint8Array>(
|
write<TBuffer extends Uint8Array>(
|
||||||
buffer: TBuffer,
|
buffer: TBuffer,
|
||||||
offset?: number | null,
|
offset?: number | null,
|
||||||
length?: number | null,
|
length?: number | null,
|
||||||
position?: number | null,
|
position?: number | null
|
||||||
): Promise<{
|
): Promise<{
|
||||||
bytesWritten: number;
|
bytesWritten: number;
|
||||||
buffer: TBuffer;
|
buffer: TBuffer;
|
||||||
@@ -422,7 +358,7 @@ declare module "fs/promises" {
|
|||||||
write(
|
write(
|
||||||
data: string,
|
data: string,
|
||||||
position?: number | null,
|
position?: number | null,
|
||||||
encoding?: BufferEncoding | null,
|
encoding?: BufferEncoding | null
|
||||||
): Promise<{
|
): Promise<{
|
||||||
bytesWritten: number;
|
bytesWritten: number;
|
||||||
buffer: string;
|
buffer: string;
|
||||||
@@ -439,14 +375,14 @@ declare module "fs/promises" {
|
|||||||
* The kernel ignores the position argument and always appends the data to
|
* The kernel ignores the position argument and always appends the data to
|
||||||
* the end of the file.
|
* the end of the file.
|
||||||
* @since v12.9.0
|
* @since v12.9.0
|
||||||
* @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
* @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
|
||||||
* position.
|
* position.
|
||||||
*/
|
*/
|
||||||
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
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
|
* 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
|
* @since v13.13.0, v12.17.0
|
||||||
* @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
* @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.
|
||||||
* @return Fulfills upon success an object containing two properties:
|
* @return Fulfills upon success an object containing two properties:
|
||||||
*/
|
*/
|
||||||
readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
||||||
@@ -455,7 +391,7 @@ declare module "fs/promises" {
|
|||||||
* complete.
|
* complete.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* let filehandle;
|
* let filehandle;
|
||||||
* try {
|
* try {
|
||||||
@@ -468,19 +404,13 @@ declare module "fs/promises" {
|
|||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
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`.
|
* Tests a user's permissions for the file or directory specified by `path`.
|
||||||
* The `mode` argument is an optional integer that specifies the accessibility
|
* The `mode` argument is an optional integer that specifies the accessibility
|
||||||
* checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
|
* checks to be performed. Check `File access constants` for possible values
|
||||||
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
* of `mode`. It is possible to create a mask consisting of the bitwise OR of
|
||||||
* possible values of `mode`.
|
* two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
|
||||||
*
|
*
|
||||||
* If the accessibility check is successful, the promise is resolved with no
|
* If the accessibility check is successful, the promise is resolved with no
|
||||||
* value. If any of the accessibility checks fail, the promise is rejected
|
* value. If any of the accessibility checks fail, the promise is rejected
|
||||||
@@ -488,7 +418,8 @@ declare module "fs/promises" {
|
|||||||
* written by the current process.
|
* written by the current process.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { access, constants } from 'node:fs/promises';
|
* import { access } from 'fs/promises';
|
||||||
|
* import { constants } from 'fs';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await access('/etc/passwd', constants.R_OK | constants.W_OK);
|
* await access('/etc/passwd', constants.R_OK | constants.W_OK);
|
||||||
@@ -517,13 +448,14 @@ declare module "fs/promises" {
|
|||||||
* will be made to remove the destination.
|
* will be made to remove the destination.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { copyFile, constants } from 'node:fs/promises';
|
* import { constants } from 'fs';
|
||||||
|
* import { copyFile } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await copyFile('source.txt', 'destination.txt');
|
* await copyFile('source.txt', 'destination.txt');
|
||||||
* console.log('source.txt was copied to destination.txt');
|
* console.log('source.txt was copied to destination.txt');
|
||||||
* } catch {
|
* } catch {
|
||||||
* console.error('The file could not be copied');
|
* console.log('The file could not be copied');
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
|
* // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
|
||||||
@@ -531,7 +463,7 @@ declare module "fs/promises" {
|
|||||||
* await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
|
* await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
|
||||||
* console.log('source.txt was copied to destination.txt');
|
* console.log('source.txt was copied to destination.txt');
|
||||||
* } catch {
|
* } catch {
|
||||||
* console.error('The file could not be copied');
|
* console.log('The file could not be copied');
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -555,7 +487,7 @@ declare module "fs/promises" {
|
|||||||
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
||||||
* @return Fulfills with a {FileHandle} object.
|
* @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`.
|
* Renames `oldPath` to `newPath`.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -593,19 +525,6 @@ 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
|
* 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
|
* that exists results in a
|
||||||
* rejection only when `recursive` is false.
|
* 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
|
* @since v10.0.0
|
||||||
* @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
|
* @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
|
||||||
*/
|
*/
|
||||||
@@ -613,7 +532,7 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options: MakeDirectoryOptions & {
|
options: MakeDirectoryOptions & {
|
||||||
recursive: true;
|
recursive: true;
|
||||||
},
|
}
|
||||||
): Promise<string | undefined>;
|
): Promise<string | undefined>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous mkdir(2) - create a directory.
|
* Asynchronous mkdir(2) - create a directory.
|
||||||
@@ -626,9 +545,9 @@ declare module "fs/promises" {
|
|||||||
options?:
|
options?:
|
||||||
| Mode
|
| Mode
|
||||||
| (MakeDirectoryOptions & {
|
| (MakeDirectoryOptions & {
|
||||||
recursive?: false | undefined;
|
recursive?: false | undefined;
|
||||||
})
|
})
|
||||||
| null,
|
| null
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous mkdir(2) - create a directory.
|
* Asynchronous mkdir(2) - create a directory.
|
||||||
@@ -648,7 +567,7 @@ declare module "fs/promises" {
|
|||||||
* If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
|
* If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { readdir } from 'node:fs/promises';
|
* import { readdir } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const files = await readdir(path);
|
* const files = await readdir(path);
|
||||||
@@ -665,11 +584,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
withFileTypes?: false | undefined;
|
withFileTypes?: false | undefined;
|
||||||
recursive?: boolean | undefined;
|
})
|
||||||
})
|
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string[]>;
|
): Promise<string[]>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous readdir(3) - read a directory.
|
* Asynchronous readdir(3) - read a directory.
|
||||||
@@ -680,11 +598,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options:
|
options:
|
||||||
| {
|
| {
|
||||||
encoding: "buffer";
|
encoding: 'buffer';
|
||||||
withFileTypes?: false | undefined;
|
withFileTypes?: false | undefined;
|
||||||
recursive?: boolean | undefined;
|
}
|
||||||
}
|
| 'buffer'
|
||||||
| "buffer",
|
|
||||||
): Promise<Buffer[]>;
|
): Promise<Buffer[]>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous readdir(3) - read a directory.
|
* Asynchronous readdir(3) - read a directory.
|
||||||
@@ -695,11 +612,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
withFileTypes?: false | undefined;
|
withFileTypes?: false | undefined;
|
||||||
recursive?: boolean | undefined;
|
})
|
||||||
})
|
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string[] | Buffer[]>;
|
): Promise<string[] | Buffer[]>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous readdir(3) - read a directory.
|
* Asynchronous readdir(3) - read a directory.
|
||||||
@@ -710,8 +626,7 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options: ObjectEncodingOptions & {
|
options: ObjectEncodingOptions & {
|
||||||
withFileTypes: true;
|
withFileTypes: true;
|
||||||
recursive?: boolean | undefined;
|
}
|
||||||
},
|
|
||||||
): Promise<Dirent[]>;
|
): 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
|
* 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
|
||||||
@@ -740,14 +655,11 @@ declare module "fs/promises" {
|
|||||||
/**
|
/**
|
||||||
* Creates a symbolic link.
|
* Creates a symbolic link.
|
||||||
*
|
*
|
||||||
* The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will
|
* The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path
|
||||||
* autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not
|
* to be absolute. When using `'junction'`, the `target` argument will
|
||||||
* exist, `'file'` will be used. Windows junction points require the destination
|
* automatically be normalized to absolute path.
|
||||||
* 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
|
* @since v10.0.0
|
||||||
* @param [type='null']
|
* @param [type='file']
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
||||||
@@ -762,13 +674,13 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts?: StatOptions & {
|
opts?: StatOptions & {
|
||||||
bigint?: false | undefined;
|
bigint?: false | undefined;
|
||||||
},
|
}
|
||||||
): Promise<Stats>;
|
): Promise<Stats>;
|
||||||
function lstat(
|
function lstat(
|
||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts: StatOptions & {
|
opts: StatOptions & {
|
||||||
bigint: true;
|
bigint: true;
|
||||||
},
|
}
|
||||||
): Promise<BigIntStats>;
|
): Promise<BigIntStats>;
|
||||||
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||||
/**
|
/**
|
||||||
@@ -779,32 +691,15 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts?: StatOptions & {
|
opts?: StatOptions & {
|
||||||
bigint?: false | undefined;
|
bigint?: false | undefined;
|
||||||
},
|
}
|
||||||
): Promise<Stats>;
|
): Promise<Stats>;
|
||||||
function stat(
|
function stat(
|
||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts: StatOptions & {
|
opts: StatOptions & {
|
||||||
bigint: true;
|
bigint: true;
|
||||||
},
|
}
|
||||||
): Promise<BigIntStats>;
|
): Promise<BigIntStats>;
|
||||||
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | 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.
|
* 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
|
* @since v10.0.0
|
||||||
@@ -846,7 +741,7 @@ declare module "fs/promises" {
|
|||||||
* @since v14.5.0, v12.19.0
|
* @since v14.5.0, v12.19.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Changes the ownership of a file.
|
* Changes the ownership of a file.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -860,11 +755,11 @@ declare module "fs/promises" {
|
|||||||
*
|
*
|
||||||
* * Values can be either numbers representing Unix epoch time, `Date`s, or a
|
* * Values can be either numbers representing Unix epoch time, `Date`s, or a
|
||||||
* numeric string like `'123456789.0'`.
|
* 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
|
* @since v10.0.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
||||||
*
|
*
|
||||||
@@ -893,10 +788,7 @@ declare module "fs/promises" {
|
|||||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
* @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.
|
* @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(
|
function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
||||||
path: PathLike,
|
|
||||||
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
||||||
): Promise<string | Buffer>;
|
|
||||||
/**
|
/**
|
||||||
* Creates a unique temporary directory. A unique directory name is generated by
|
* 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
|
* appending six random characters to the end of the provided `prefix`. Due to
|
||||||
@@ -908,12 +800,10 @@ declare module "fs/promises" {
|
|||||||
* object with an `encoding` property specifying the character encoding to use.
|
* object with an `encoding` property specifying the character encoding to use.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { mkdtemp } from 'node:fs/promises';
|
* import { mkdtemp } from 'fs/promises';
|
||||||
* import { join } from 'node:path';
|
|
||||||
* import { tmpdir } from 'node:os';
|
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await mkdtemp(join(tmpdir(), 'foo-'));
|
* await mkdtemp(path.join(os.tmpdir(), 'foo-'));
|
||||||
* } catch (err) {
|
* } catch (err) {
|
||||||
* console.error(err);
|
* console.error(err);
|
||||||
* }
|
* }
|
||||||
@@ -922,9 +812,9 @@ declare module "fs/promises" {
|
|||||||
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
||||||
* characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
|
* characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
|
||||||
* platform-specific path separator
|
* platform-specific path separator
|
||||||
* (`require('node:path').sep`).
|
* (`require('path').sep`).
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with a string containing the file system path of the newly created temporary directory.
|
* @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
|
||||||
*/
|
*/
|
||||||
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
||||||
/**
|
/**
|
||||||
@@ -940,9 +830,7 @@ declare module "fs/promises" {
|
|||||||
*/
|
*/
|
||||||
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
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, an
|
* 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.
|
||||||
* [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.
|
* The `encoding` option is ignored if `data` is a buffer.
|
||||||
*
|
*
|
||||||
@@ -957,15 +845,15 @@ declare module "fs/promises" {
|
|||||||
*
|
*
|
||||||
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
||||||
* method that performs multiple `write` calls internally to write the buffer
|
* method that performs multiple `write` calls internally to write the buffer
|
||||||
* passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`.
|
* passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
|
||||||
*
|
*
|
||||||
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
||||||
* Cancelation is "best effort", and some amount of data is likely still
|
* Cancelation is "best effort", and some amount of data is likely still
|
||||||
* to be written.
|
* to be written.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { writeFile } from 'node:fs/promises';
|
* import { writeFile } from 'fs/promises';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const controller = new AbortController();
|
* const controller = new AbortController();
|
||||||
@@ -991,19 +879,14 @@ declare module "fs/promises" {
|
|||||||
*/
|
*/
|
||||||
function writeFile(
|
function writeFile(
|
||||||
file: PathLike | FileHandle,
|
file: PathLike | FileHandle,
|
||||||
data:
|
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
|
||||||
| string
|
|
||||||
| NodeJS.ArrayBufferView
|
|
||||||
| Iterable<string | NodeJS.ArrayBufferView>
|
|
||||||
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
|
||||||
| Stream,
|
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
mode?: Mode | undefined;
|
mode?: Mode | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} & Abortable)
|
} & Abortable)
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously append data to a file, creating the file if it does not yet
|
* Asynchronously append data to a file, creating the file if it does not yet
|
||||||
@@ -1019,11 +902,7 @@ declare module "fs/promises" {
|
|||||||
* @param path filename or {FileHandle}
|
* @param path filename or {FileHandle}
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function appendFile(
|
function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
||||||
path: PathLike | FileHandle,
|
|
||||||
data: string | Uint8Array,
|
|
||||||
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
*
|
*
|
||||||
@@ -1037,25 +916,11 @@ declare module "fs/promises" {
|
|||||||
* with an error. On FreeBSD, a representation of the directory's contents will be
|
* with an error. On FreeBSD, a representation of the directory's contents will be
|
||||||
* returned.
|
* 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
|
* It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
|
||||||
* request is aborted the promise returned is rejected with an `AbortError`:
|
* request is aborted the promise returned is rejected with an `AbortError`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { readFile } from 'node:fs/promises';
|
* import { readFile } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const controller = new AbortController();
|
* const controller = new AbortController();
|
||||||
@@ -1084,10 +949,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike | FileHandle,
|
path: PathLike | FileHandle,
|
||||||
options?:
|
options?:
|
||||||
| ({
|
| ({
|
||||||
encoding?: null | undefined;
|
encoding?: null | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} & Abortable)
|
} & Abortable)
|
||||||
| null,
|
| null
|
||||||
): Promise<Buffer>;
|
): Promise<Buffer>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
@@ -1100,10 +965,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike | FileHandle,
|
path: PathLike | FileHandle,
|
||||||
options:
|
options:
|
||||||
| ({
|
| ({
|
||||||
encoding: BufferEncoding;
|
encoding: BufferEncoding;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} & Abortable)
|
} & Abortable)
|
||||||
| BufferEncoding,
|
| BufferEncoding
|
||||||
): Promise<string>;
|
): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
@@ -1115,15 +980,12 @@ declare module "fs/promises" {
|
|||||||
function readFile(
|
function readFile(
|
||||||
path: PathLike | FileHandle,
|
path: PathLike | FileHandle,
|
||||||
options?:
|
options?:
|
||||||
| (
|
| (ObjectEncodingOptions &
|
||||||
& ObjectEncodingOptions
|
Abortable & {
|
||||||
& Abortable
|
flag?: OpenMode | undefined;
|
||||||
& {
|
})
|
||||||
flag?: OpenMode | undefined;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string | Buffer>;
|
): 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.
|
* 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.
|
||||||
@@ -1137,7 +999,7 @@ declare module "fs/promises" {
|
|||||||
* Example using async iteration:
|
* Example using async iteration:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { opendir } from 'node:fs/promises';
|
* import { opendir } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const dir = await opendir('./');
|
* const dir = await opendir('./');
|
||||||
@@ -1158,7 +1020,7 @@ declare module "fs/promises" {
|
|||||||
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const { watch } = require('node:fs/promises');
|
* const { watch } = require('fs/promises');
|
||||||
*
|
*
|
||||||
* const ac = new AbortController();
|
* const ac = new AbortController();
|
||||||
* const { signal } = ac;
|
* const { signal } = ac;
|
||||||
@@ -1181,16 +1043,16 @@ declare module "fs/promises" {
|
|||||||
* disappears in the directory.
|
* disappears in the directory.
|
||||||
*
|
*
|
||||||
* All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
|
* All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
|
||||||
* @since v15.9.0, v14.18.0
|
* @since v15.9.0
|
||||||
* @return of objects with the properties:
|
* @return of objects with the properties:
|
||||||
*/
|
*/
|
||||||
function watch(
|
function watch(
|
||||||
filename: PathLike,
|
filename: PathLike,
|
||||||
options:
|
options:
|
||||||
| (WatchOptions & {
|
| (WatchOptions & {
|
||||||
encoding: "buffer";
|
encoding: 'buffer';
|
||||||
})
|
})
|
||||||
| "buffer",
|
| 'buffer'
|
||||||
): AsyncIterable<FileChangeInfo<Buffer>>;
|
): AsyncIterable<FileChangeInfo<Buffer>>;
|
||||||
/**
|
/**
|
||||||
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
||||||
@@ -1209,10 +1071,7 @@ declare module "fs/promises" {
|
|||||||
* If `persistent` is not supplied, the default of `true` is used.
|
* If `persistent` is not supplied, the default of `true` is used.
|
||||||
* If `recursive` is not supplied, the default of `false` is used.
|
* If `recursive` is not supplied, the default of `false` is used.
|
||||||
*/
|
*/
|
||||||
function watch(
|
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
||||||
filename: PathLike,
|
|
||||||
options: WatchOptions | string,
|
|
||||||
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
||||||
* including subdirectories and files.
|
* including subdirectories and files.
|
||||||
@@ -1225,8 +1084,8 @@ declare module "fs/promises" {
|
|||||||
* @param dest destination path to copy to.
|
* @param dest destination path to copy to.
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
function cp(source: string, destination: string, opts?: CopyOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
declare module "node:fs/promises" {
|
declare module 'node:fs/promises' {
|
||||||
export * from "fs/promises";
|
export * from 'fs/promises';
|
||||||
}
|
}
|
||||||
|
|||||||
157
node_modules/@types/node/globals.d.ts
generated
vendored
Normal file → Executable file
157
node_modules/@types/node/globals.d.ts
generated
vendored
Normal file → Executable file
@@ -20,9 +20,9 @@ interface ErrorConstructor {
|
|||||||
------------------------------------------------*/
|
------------------------------------------------*/
|
||||||
|
|
||||||
// For backwards compability
|
// For backwards compability
|
||||||
interface NodeRequire extends NodeJS.Require {}
|
interface NodeRequire extends NodeJS.Require { }
|
||||||
interface RequireResolve extends NodeJS.RequireResolve {}
|
interface RequireResolve extends NodeJS.RequireResolve { }
|
||||||
interface NodeModule extends NodeJS.Module {}
|
interface NodeModule extends NodeJS.Module { }
|
||||||
|
|
||||||
declare var process: NodeJS.Process;
|
declare var process: NodeJS.Process;
|
||||||
declare var console: Console;
|
declare var console: Console;
|
||||||
@@ -41,7 +41,7 @@ declare var exports: any;
|
|||||||
*/
|
*/
|
||||||
declare var gc: undefined | (() => void);
|
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
|
// 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. */
|
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
||||||
interface AbortController {
|
interface AbortController {
|
||||||
@@ -53,58 +53,30 @@ 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.
|
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): void;
|
abort(): 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. */
|
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
||||||
interface AbortSignal extends EventTarget {
|
interface AbortSignal {
|
||||||
/**
|
/**
|
||||||
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
||||||
*/
|
*/
|
||||||
readonly aborted: boolean;
|
readonly aborted: boolean;
|
||||||
readonly reason: any;
|
|
||||||
onabort: null | ((this: AbortSignal, event: Event) => any);
|
|
||||||
throwIfAborted(): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
declare var AbortController: {
|
||||||
: {
|
prototype: AbortController;
|
||||||
prototype: AbortController;
|
new(): AbortController;
|
||||||
new(): AbortController;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
declare var AbortSignal: {
|
||||||
: {
|
prototype: AbortSignal;
|
||||||
prototype: AbortSignal;
|
new(): AbortSignal;
|
||||||
new(): AbortSignal;
|
// TODO: Add abort() static
|
||||||
abort(reason?: any): AbortSignal;
|
};
|
||||||
timeout(milliseconds: number): AbortSignal;
|
//#endregion borrowed
|
||||||
};
|
|
||||||
// #endregion borrowed
|
|
||||||
|
|
||||||
// #region Disposable
|
//#region ArrayLike.at()
|
||||||
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> {
|
interface RelativeIndexable<T> {
|
||||||
/**
|
/**
|
||||||
* Takes an integer value and returns the item at that index,
|
* Takes an integer value and returns the item at that index,
|
||||||
@@ -115,7 +87,6 @@ interface RelativeIndexable<T> {
|
|||||||
}
|
}
|
||||||
interface String extends RelativeIndexable<string> {}
|
interface String extends RelativeIndexable<string> {}
|
||||||
interface Array<T> extends RelativeIndexable<T> {}
|
interface Array<T> extends RelativeIndexable<T> {}
|
||||||
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
||||||
interface Int8Array extends RelativeIndexable<number> {}
|
interface Int8Array extends RelativeIndexable<number> {}
|
||||||
interface Uint8Array extends RelativeIndexable<number> {}
|
interface Uint8Array extends RelativeIndexable<number> {}
|
||||||
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
||||||
@@ -127,17 +98,7 @@ interface Float32Array extends RelativeIndexable<number> {}
|
|||||||
interface Float64Array extends RelativeIndexable<number> {}
|
interface Float64Array extends RelativeIndexable<number> {}
|
||||||
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
||||||
interface BigUint64Array 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;
|
|
||||||
|
|
||||||
/*----------------------------------------------*
|
/*----------------------------------------------*
|
||||||
* *
|
* *
|
||||||
@@ -180,7 +141,7 @@ declare namespace NodeJS {
|
|||||||
/**
|
/**
|
||||||
* Name of the script [if this function was defined in a script]
|
* Name of the script [if this function was defined in a script]
|
||||||
*/
|
*/
|
||||||
getFileName(): string | undefined;
|
getFileName(): string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current line number [if this function was defined in a script]
|
* Current line number [if this function was defined in a script]
|
||||||
@@ -233,7 +194,7 @@ declare namespace NodeJS {
|
|||||||
pause(): this;
|
pause(): this;
|
||||||
resume(): this;
|
resume(): this;
|
||||||
isPaused(): boolean;
|
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;
|
unpipe(destination?: WritableStream): this;
|
||||||
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
||||||
wrap(oldStream: ReadableStream): this;
|
wrap(oldStream: ReadableStream): this;
|
||||||
@@ -244,12 +205,12 @@ declare namespace NodeJS {
|
|||||||
writable: boolean;
|
writable: boolean;
|
||||||
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
||||||
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
||||||
end(cb?: () => void): this;
|
end(cb?: () => void): void;
|
||||||
end(data: string | Uint8Array, cb?: () => void): this;
|
end(data: string | Uint8Array, cb?: () => void): void;
|
||||||
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
end(str: string, encoding?: BufferEncoding, cb?: () => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
interface ReadWriteStream extends ReadableStream, WritableStream { }
|
||||||
|
|
||||||
interface RefCounted {
|
interface RefCounted {
|
||||||
ref(): this;
|
ref(): this;
|
||||||
@@ -282,14 +243,14 @@ declare namespace NodeJS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RequireResolve {
|
interface RequireResolve {
|
||||||
(id: string, options?: { paths?: string[] | undefined }): string;
|
(id: string, options?: { paths?: string[] | undefined; }): string;
|
||||||
paths(request: string): string[] | null;
|
paths(request: string): string[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
|
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
|
||||||
".js": (m: Module, filename: string) => any;
|
'.js': (m: Module, filename: string) => any;
|
||||||
".json": (m: Module, filename: string) => any;
|
'.json': (m: Module, filename: string) => any;
|
||||||
".node": (m: Module, filename: string) => any;
|
'.node': (m: Module, filename: string) => any;
|
||||||
}
|
}
|
||||||
interface Module {
|
interface Module {
|
||||||
/**
|
/**
|
||||||
@@ -301,11 +262,11 @@ declare namespace NodeJS {
|
|||||||
id: string;
|
id: string;
|
||||||
filename: string;
|
filename: string;
|
||||||
loaded: boolean;
|
loaded: boolean;
|
||||||
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
|
/** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */
|
||||||
parent: Module | null | undefined;
|
parent: Module | null | undefined;
|
||||||
children: Module[];
|
children: Module[];
|
||||||
/**
|
/**
|
||||||
* @since v11.14.0
|
* @since 11.14.0
|
||||||
*
|
*
|
||||||
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
||||||
*/
|
*/
|
||||||
@@ -320,62 +281,4 @@ declare namespace NodeJS {
|
|||||||
interface ReadOnlyDict<T> {
|
interface ReadOnlyDict<T> {
|
||||||
readonly [key: string]: T | undefined;
|
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
Normal file → Executable file
0
node_modules/@types/node/globals.global.d.ts
generated
vendored
Normal file → Executable file
1065
node_modules/@types/node/http.d.ts
generated
vendored
Normal file → Executable file
1065
node_modules/@types/node/http.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1133
node_modules/@types/node/http2.d.ts
generated
vendored
Normal file → Executable file
1133
node_modules/@types/node/http2.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
423
node_modules/@types/node/https.d.ts
generated
vendored
Normal file → Executable file
423
node_modules/@types/node/https.d.ts
generated
vendored
Normal file → Executable file
@@ -1,22 +1,16 @@
|
|||||||
/**
|
/**
|
||||||
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
||||||
* separate module.
|
* separate module.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/https.js)
|
||||||
*/
|
*/
|
||||||
declare module "https" {
|
declare module 'https' {
|
||||||
import { Duplex } from "node:stream";
|
import { Duplex } from 'node:stream';
|
||||||
import * as tls from "node:tls";
|
import * as tls from 'node:tls';
|
||||||
import * as http from "node:http";
|
import * as http from 'node:http';
|
||||||
import { URL } from "node:url";
|
import { URL } from 'node:url';
|
||||||
type ServerOptions<
|
type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
|
||||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
type RequestOptions = http.RequestOptions &
|
||||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
tls.SecureContextOptions & {
|
||||||
> = 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
|
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
||||||
servername?: string | undefined; // SNI TLS Extension
|
servername?: string | undefined; // SNI TLS Extension
|
||||||
};
|
};
|
||||||
@@ -32,256 +26,126 @@ declare module "https" {
|
|||||||
constructor(options?: AgentOptions);
|
constructor(options?: AgentOptions);
|
||||||
options: AgentOptions;
|
options: AgentOptions;
|
||||||
}
|
}
|
||||||
interface Server<
|
interface Server extends http.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.
|
* See `http.Server` for more information.
|
||||||
* @since v0.3.4
|
* @since v0.3.4
|
||||||
*/
|
*/
|
||||||
class Server<
|
class Server extends tls.Server {
|
||||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
constructor(requestListener?: http.RequestListener);
|
||||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
constructor(options: ServerOptions, requestListener?: http.RequestListener);
|
||||||
> 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: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
addListener(
|
addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
||||||
event: "newSession",
|
addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
||||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
||||||
): this;
|
addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||||
addListener(
|
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
event: "OCSPRequest",
|
addListener(event: 'close', listener: () => void): this;
|
||||||
listener: (
|
addListener(event: 'connection', listener: (socket: Duplex) => void): this;
|
||||||
certificate: Buffer,
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
issuer: Buffer,
|
addListener(event: 'listening', listener: () => void): this;
|
||||||
callback: (err: Error | null, resp: Buffer) => void,
|
addListener(event: 'checkContinue', listener: http.RequestListener): this;
|
||||||
) => void,
|
addListener(event: 'checkExpectation', listener: http.RequestListener): this;
|
||||||
): this;
|
addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
||||||
addListener(
|
addListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
event: "resumeSession",
|
addListener(event: 'request', listener: http.RequestListener): this;
|
||||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
addListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
): 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: string, ...args: any[]): boolean;
|
||||||
emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
|
emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean;
|
||||||
emit(
|
emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
|
||||||
event: "newSession",
|
emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
|
||||||
sessionId: Buffer,
|
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
||||||
sessionData: Buffer,
|
emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean;
|
||||||
callback: (err: Error, resp: Buffer) => void,
|
emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean;
|
||||||
): boolean;
|
emit(event: 'close'): boolean;
|
||||||
emit(
|
emit(event: 'connection', socket: Duplex): boolean;
|
||||||
event: "OCSPRequest",
|
emit(event: 'error', err: Error): boolean;
|
||||||
certificate: Buffer,
|
emit(event: 'listening'): boolean;
|
||||||
issuer: Buffer,
|
emit(event: 'checkContinue', req: http.IncomingMessage, res: http.ServerResponse): boolean;
|
||||||
callback: (err: Error | null, resp: Buffer) => void,
|
emit(event: 'checkExpectation', req: http.IncomingMessage, res: http.ServerResponse): boolean;
|
||||||
): boolean;
|
emit(event: 'clientError', err: Error, socket: Duplex): boolean;
|
||||||
emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
emit(event: 'connect', req: http.IncomingMessage, socket: Duplex, head: Buffer): boolean;
|
||||||
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
|
emit(event: 'request', req: http.IncomingMessage, res: http.ServerResponse): boolean;
|
||||||
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
|
emit(event: 'upgrade', req: http.IncomingMessage, socket: Duplex, head: Buffer): 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: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
on(
|
on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
||||||
event: "newSession",
|
on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
||||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
||||||
): this;
|
on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||||
on(
|
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
event: "OCSPRequest",
|
on(event: 'close', listener: () => void): this;
|
||||||
listener: (
|
on(event: 'connection', listener: (socket: Duplex) => void): this;
|
||||||
certificate: Buffer,
|
on(event: 'error', listener: (err: Error) => void): this;
|
||||||
issuer: Buffer,
|
on(event: 'listening', listener: () => void): this;
|
||||||
callback: (err: Error | null, resp: Buffer) => void,
|
on(event: 'checkContinue', listener: http.RequestListener): this;
|
||||||
) => void,
|
on(event: 'checkExpectation', listener: http.RequestListener): this;
|
||||||
): this;
|
on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
||||||
on(
|
on(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
event: "resumeSession",
|
on(event: 'request', listener: http.RequestListener): this;
|
||||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
on(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
): 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: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
once(
|
once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
||||||
event: "newSession",
|
once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
||||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
||||||
): this;
|
once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||||
once(
|
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
event: "OCSPRequest",
|
once(event: 'close', listener: () => void): this;
|
||||||
listener: (
|
once(event: 'connection', listener: (socket: Duplex) => void): this;
|
||||||
certificate: Buffer,
|
once(event: 'error', listener: (err: Error) => void): this;
|
||||||
issuer: Buffer,
|
once(event: 'listening', listener: () => void): this;
|
||||||
callback: (err: Error | null, resp: Buffer) => void,
|
once(event: 'checkContinue', listener: http.RequestListener): this;
|
||||||
) => void,
|
once(event: 'checkExpectation', listener: http.RequestListener): this;
|
||||||
): this;
|
once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
||||||
once(
|
once(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
event: "resumeSession",
|
once(event: 'request', listener: http.RequestListener): this;
|
||||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
once(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
): 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: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
prependListener(
|
prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
||||||
event: "newSession",
|
prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
||||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
||||||
): this;
|
prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||||
prependListener(
|
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
event: "OCSPRequest",
|
prependListener(event: 'close', listener: () => void): this;
|
||||||
listener: (
|
prependListener(event: 'connection', listener: (socket: Duplex) => void): this;
|
||||||
certificate: Buffer,
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
issuer: Buffer,
|
prependListener(event: 'listening', listener: () => void): this;
|
||||||
callback: (err: Error | null, resp: Buffer) => void,
|
prependListener(event: 'checkContinue', listener: http.RequestListener): this;
|
||||||
) => void,
|
prependListener(event: 'checkExpectation', listener: http.RequestListener): this;
|
||||||
): this;
|
prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
||||||
prependListener(
|
prependListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
event: "resumeSession",
|
prependListener(event: 'request', listener: http.RequestListener): this;
|
||||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
prependListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
): 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: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
prependOnceListener(
|
prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
||||||
event: "newSession",
|
prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
||||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
||||||
): this;
|
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||||
prependOnceListener(
|
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||||
event: "OCSPRequest",
|
prependOnceListener(event: 'close', listener: () => void): this;
|
||||||
listener: (
|
prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this;
|
||||||
certificate: Buffer,
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
issuer: Buffer,
|
prependOnceListener(event: 'listening', listener: () => void): this;
|
||||||
callback: (err: Error | null, resp: Buffer) => void,
|
prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this;
|
||||||
) => void,
|
prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this;
|
||||||
): this;
|
prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
||||||
prependOnceListener(
|
prependOnceListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
event: "resumeSession",
|
prependOnceListener(event: 'request', listener: http.RequestListener): this;
|
||||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
prependOnceListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this;
|
||||||
): 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
|
* ```js
|
||||||
* // curl -k https://localhost:8000/
|
* // curl -k https://localhost:8000/
|
||||||
* const https = require('node:https');
|
* const https = require('https');
|
||||||
* const fs = require('node:fs');
|
* const fs = require('fs');
|
||||||
*
|
*
|
||||||
* const options = {
|
* const options = {
|
||||||
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
* 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) => {
|
* https.createServer(options, (req, res) => {
|
||||||
@@ -293,12 +157,12 @@ declare module "https" {
|
|||||||
* Or
|
* Or
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const https = require('node:https');
|
* const https = require('https');
|
||||||
* const fs = require('node:fs');
|
* const fs = require('fs');
|
||||||
*
|
*
|
||||||
* const options = {
|
* const options = {
|
||||||
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
||||||
* passphrase: 'sample',
|
* passphrase: 'sample'
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* https.createServer(options, (req, res) => {
|
* https.createServer(options, (req, res) => {
|
||||||
@@ -310,17 +174,8 @@ declare module "https" {
|
|||||||
* @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
|
* @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
|
||||||
* @param requestListener A listener to be added to the `'request'` event.
|
* @param requestListener A listener to be added to the `'request'` event.
|
||||||
*/
|
*/
|
||||||
function createServer<
|
function createServer(requestListener?: http.RequestListener): Server;
|
||||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
|
||||||
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.
|
* Makes a request to a secure web server.
|
||||||
*
|
*
|
||||||
@@ -334,13 +189,13 @@ declare module "https" {
|
|||||||
* upload a file with a POST request, then write to the `ClientRequest` object.
|
* upload a file with a POST request, then write to the `ClientRequest` object.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const https = require('node:https');
|
* const https = require('https');
|
||||||
*
|
*
|
||||||
* const options = {
|
* const options = {
|
||||||
* hostname: 'encrypted.google.com',
|
* hostname: 'encrypted.google.com',
|
||||||
* port: 443,
|
* port: 443,
|
||||||
* path: '/',
|
* path: '/',
|
||||||
* method: 'GET',
|
* method: 'GET'
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* const req = https.request(options, (res) => {
|
* const req = https.request(options, (res) => {
|
||||||
@@ -367,7 +222,7 @@ declare module "https" {
|
|||||||
* path: '/',
|
* path: '/',
|
||||||
* method: 'GET',
|
* method: 'GET',
|
||||||
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
* 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);
|
* options.agent = new https.Agent(options);
|
||||||
*
|
*
|
||||||
@@ -386,7 +241,7 @@ declare module "https" {
|
|||||||
* method: 'GET',
|
* method: 'GET',
|
||||||
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
* 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'),
|
||||||
* agent: false,
|
* agent: false
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* const req = https.request(options, (res) => {
|
* const req = https.request(options, (res) => {
|
||||||
@@ -407,9 +262,9 @@ declare module "https" {
|
|||||||
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const tls = require('node:tls');
|
* const tls = require('tls');
|
||||||
* const https = require('node:https');
|
* const https = require('https');
|
||||||
* const crypto = require('node:crypto');
|
* const crypto = require('crypto');
|
||||||
*
|
*
|
||||||
* function sha256(s) {
|
* function sha256(s) {
|
||||||
* return crypto.createHash('sha256').update(s).digest('base64');
|
* return crypto.createHash('sha256').update(s).digest('base64');
|
||||||
@@ -426,7 +281,7 @@ declare module "https" {
|
|||||||
* return err;
|
* return err;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // Pin the public key, similar to HPKP pin-sha256 pinning
|
* // Pin the public key, similar to HPKP pin-sha25 pinning
|
||||||
* const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
|
* const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
|
||||||
* if (sha256(cert.pubkey) !== pubkey256) {
|
* if (sha256(cert.pubkey) !== pubkey256) {
|
||||||
* const msg = 'Certificate verification error: ' +
|
* const msg = 'Certificate verification error: ' +
|
||||||
@@ -501,15 +356,8 @@ declare module "https" {
|
|||||||
* @since v0.3.6
|
* @since v0.3.6
|
||||||
* @param options Accepts all `options` from `request`, with some differences in default values:
|
* @param options Accepts all `options` from `request`, with some differences in default values:
|
||||||
*/
|
*/
|
||||||
function request(
|
function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||||
options: RequestOptions | string | URL,
|
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||||
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.
|
* Like `http.get()` but for HTTPS.
|
||||||
*
|
*
|
||||||
@@ -517,7 +365,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.
|
* 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
|
* ```js
|
||||||
* const https = require('node:https');
|
* const https = require('https');
|
||||||
*
|
*
|
||||||
* https.get('https://encrypted.google.com/', (res) => {
|
* https.get('https://encrypted.google.com/', (res) => {
|
||||||
* console.log('statusCode:', res.statusCode);
|
* console.log('statusCode:', res.statusCode);
|
||||||
@@ -534,17 +382,10 @@ declare module "https" {
|
|||||||
* @since v0.3.6
|
* @since v0.3.6
|
||||||
* @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
|
* @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
|
||||||
*/
|
*/
|
||||||
function get(
|
function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||||
options: RequestOptions | string | URL,
|
function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||||
callback?: (res: http.IncomingMessage) => void,
|
|
||||||
): http.ClientRequest;
|
|
||||||
function get(
|
|
||||||
url: string | URL,
|
|
||||||
options: RequestOptions,
|
|
||||||
callback?: (res: http.IncomingMessage) => void,
|
|
||||||
): http.ClientRequest;
|
|
||||||
let globalAgent: Agent;
|
let globalAgent: Agent;
|
||||||
}
|
}
|
||||||
declare module "node:https" {
|
declare module 'node:https' {
|
||||||
export * from "https";
|
export * from 'https';
|
||||||
}
|
}
|
||||||
|
|||||||
50
node_modules/@types/node/index.d.ts
generated
vendored
Normal file → Executable file
50
node_modules/@types/node/index.d.ts
generated
vendored
Normal file → Executable file
@@ -1,3 +1,48 @@
|
|||||||
|
// 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
|
* License for programmatically and manually incorporated
|
||||||
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
|
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
|
||||||
@@ -22,7 +67,7 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// NOTE: These definitions support NodeJS and TypeScript 4.9+.
|
// NOTE: These definitions support NodeJS and TypeScript 3.7+.
|
||||||
|
|
||||||
// Reference required types from the default lib:
|
// Reference required types from the default lib:
|
||||||
/// <reference lib="es2020" />
|
/// <reference lib="es2020" />
|
||||||
@@ -47,7 +92,6 @@
|
|||||||
/// <reference path="dns/promises.d.ts" />
|
/// <reference path="dns/promises.d.ts" />
|
||||||
/// <reference path="dns/promises.d.ts" />
|
/// <reference path="dns/promises.d.ts" />
|
||||||
/// <reference path="domain.d.ts" />
|
/// <reference path="domain.d.ts" />
|
||||||
/// <reference path="dom-events.d.ts" />
|
|
||||||
/// <reference path="events.d.ts" />
|
/// <reference path="events.d.ts" />
|
||||||
/// <reference path="fs.d.ts" />
|
/// <reference path="fs.d.ts" />
|
||||||
/// <reference path="fs/promises.d.ts" />
|
/// <reference path="fs/promises.d.ts" />
|
||||||
@@ -64,14 +108,12 @@
|
|||||||
/// <reference path="punycode.d.ts" />
|
/// <reference path="punycode.d.ts" />
|
||||||
/// <reference path="querystring.d.ts" />
|
/// <reference path="querystring.d.ts" />
|
||||||
/// <reference path="readline.d.ts" />
|
/// <reference path="readline.d.ts" />
|
||||||
/// <reference path="readline/promises.d.ts" />
|
|
||||||
/// <reference path="repl.d.ts" />
|
/// <reference path="repl.d.ts" />
|
||||||
/// <reference path="stream.d.ts" />
|
/// <reference path="stream.d.ts" />
|
||||||
/// <reference path="stream/promises.d.ts" />
|
/// <reference path="stream/promises.d.ts" />
|
||||||
/// <reference path="stream/consumers.d.ts" />
|
/// <reference path="stream/consumers.d.ts" />
|
||||||
/// <reference path="stream/web.d.ts" />
|
/// <reference path="stream/web.d.ts" />
|
||||||
/// <reference path="string_decoder.d.ts" />
|
/// <reference path="string_decoder.d.ts" />
|
||||||
/// <reference path="test.d.ts" />
|
|
||||||
/// <reference path="timers.d.ts" />
|
/// <reference path="timers.d.ts" />
|
||||||
/// <reference path="timers/promises.d.ts" />
|
/// <reference path="timers/promises.d.ts" />
|
||||||
/// <reference path="tls.d.ts" />
|
/// <reference path="tls.d.ts" />
|
||||||
|
|||||||
40
node_modules/@types/node/inspector.d.ts
generated
vendored
Normal file → Executable file
40
node_modules/@types/node/inspector.d.ts
generated
vendored
Normal file → Executable file
@@ -1,26 +1,21 @@
|
|||||||
|
// tslint:disable-next-line:dt-header
|
||||||
// Type definitions for inspector
|
// Type definitions for inspector
|
||||||
|
|
||||||
// These definitions are auto-generated.
|
// These definitions are auto-generated.
|
||||||
// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
|
// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
|
||||||
// for more information.
|
// for more information.
|
||||||
|
|
||||||
|
// tslint:disable:max-line-length
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `node:inspector` module provides an API for interacting with the V8
|
* The `inspector` module provides an API for interacting with the V8 inspector.
|
||||||
* inspector.
|
|
||||||
*
|
*
|
||||||
* It can be accessed using:
|
* It can be accessed using:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import * as inspector from 'node:inspector/promises';
|
* const inspector = require('inspector');
|
||||||
* ```
|
* ```
|
||||||
*
|
* @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' {
|
declare module 'inspector' {
|
||||||
import EventEmitter = require('node:events');
|
import EventEmitter = require('node:events');
|
||||||
@@ -1693,7 +1688,7 @@ declare module 'inspector' {
|
|||||||
/**
|
/**
|
||||||
* Controls how the trace buffer stores data.
|
* Controls how the trace buffer stores data.
|
||||||
*/
|
*/
|
||||||
recordMode?: string | undefined;
|
recordMode?: string;
|
||||||
/**
|
/**
|
||||||
* Included category filters.
|
* Included category filters.
|
||||||
*/
|
*/
|
||||||
@@ -1783,6 +1778,13 @@ declare module 'inspector' {
|
|||||||
* @since v8.0.0
|
* @since v8.0.0
|
||||||
*/
|
*/
|
||||||
connect(): void;
|
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
|
* 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
|
* with an error. `session.connect()` will need to be called to be able to send
|
||||||
@@ -2694,7 +2696,7 @@ declare module 'inspector' {
|
|||||||
prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
|
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.
|
* started.
|
||||||
*
|
*
|
||||||
* If wait is `true`, will block until a client has connected to the inspect port
|
* If wait is `true`, will block until a client has connected to the inspect port
|
||||||
@@ -2704,9 +2706,8 @@ declare module 'inspector' {
|
|||||||
* @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional.
|
* @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 [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.
|
* @param [wait=false] Block until a client has connected. Optional.
|
||||||
* @returns Disposable that calls `inspector.close()`.
|
|
||||||
*/
|
*/
|
||||||
function open(port?: number, host?: string, wait?: boolean): Disposable;
|
function open(port?: number, host?: string, wait?: boolean): void;
|
||||||
/**
|
/**
|
||||||
* Deactivate the inspector. Blocks until there are no active connections.
|
* Deactivate the inspector. Blocks until there are no active connections.
|
||||||
*/
|
*/
|
||||||
@@ -2717,12 +2718,12 @@ declare module 'inspector' {
|
|||||||
* ```console
|
* ```console
|
||||||
* $ node --inspect -p 'inspector.url()'
|
* $ node --inspect -p 'inspector.url()'
|
||||||
* Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
|
* 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
|
* ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
|
||||||
*
|
*
|
||||||
* $ node --inspect=localhost:3000 -p 'inspector.url()'
|
* $ node --inspect=localhost:3000 -p 'inspector.url()'
|
||||||
* Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
|
* 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
|
* ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
|
||||||
*
|
*
|
||||||
* $ node -p 'inspector.url()'
|
* $ node -p 'inspector.url()'
|
||||||
@@ -2738,10 +2739,7 @@ declare module 'inspector' {
|
|||||||
*/
|
*/
|
||||||
function waitForDebugger(): void;
|
function waitForDebugger(): void;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The inspector module provides an API for interacting with the V8 inspector.
|
|
||||||
*/
|
|
||||||
declare module 'node:inspector' {
|
declare module 'node:inspector' {
|
||||||
import inspector = require('inspector');
|
import EventEmitter = require('inspector');
|
||||||
export = inspector;
|
export = EventEmitter;
|
||||||
}
|
}
|
||||||
|
|||||||
219
node_modules/@types/node/module.d.ts
generated
vendored
Normal file → Executable file
219
node_modules/@types/node/module.d.ts
generated
vendored
Normal file → Executable file
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @since v0.3.7
|
* @since v0.3.7
|
||||||
* @experimental
|
|
||||||
*/
|
*/
|
||||||
declare module "module" {
|
declare module 'module' {
|
||||||
import { URL } from "node:url";
|
import { URL } from 'node:url';
|
||||||
import { MessagePort } from "node:worker_threads";
|
|
||||||
namespace Module {
|
namespace Module {
|
||||||
/**
|
/**
|
||||||
* The `module.syncBuiltinESMExports()` method updates all the live bindings for
|
* The `module.syncBuiltinESMExports()` method updates all the live bindings for
|
||||||
@@ -12,9 +10,9 @@ declare module "module" {
|
|||||||
* does not add or remove exported names from the `ES Modules`.
|
* does not add or remove exported names from the `ES Modules`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const fs = require('node:fs');
|
* const fs = require('fs');
|
||||||
* const assert = require('node:assert');
|
* const assert = require('assert');
|
||||||
* const { syncBuiltinESMExports } = require('node:module');
|
* const { syncBuiltinESMExports } = require('module');
|
||||||
*
|
*
|
||||||
* fs.readFile = newAPI;
|
* fs.readFile = newAPI;
|
||||||
*
|
*
|
||||||
@@ -28,7 +26,7 @@ declare module "module" {
|
|||||||
*
|
*
|
||||||
* syncBuiltinESMExports();
|
* syncBuiltinESMExports();
|
||||||
*
|
*
|
||||||
* import('node:fs').then((esmFS) => {
|
* import('fs').then((esmFS) => {
|
||||||
* // It syncs the existing readFile property with the new value
|
* // It syncs the existing readFile property with the new value
|
||||||
* assert.strictEqual(esmFS.readFile, newAPI);
|
* assert.strictEqual(esmFS.readFile, newAPI);
|
||||||
* // readFileSync has been deleted from the required fs
|
* // readFileSync has been deleted from the required fs
|
||||||
@@ -46,7 +44,6 @@ declare module "module" {
|
|||||||
* `path` is the resolved path for the file for which a corresponding source map
|
* `path` is the resolved path for the file for which a corresponding source map
|
||||||
* should be fetched.
|
* should be fetched.
|
||||||
* @since v13.7.0, v12.17.0
|
* @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;
|
function findSourceMap(path: string, error?: Error): SourceMap;
|
||||||
interface SourceMapPayload {
|
interface SourceMapPayload {
|
||||||
@@ -65,24 +62,6 @@ declare module "module" {
|
|||||||
originalLine: number;
|
originalLine: number;
|
||||||
originalColumn: 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
|
* @since v13.7.0, v12.17.0
|
||||||
*/
|
*/
|
||||||
@@ -93,156 +72,12 @@ declare module "module" {
|
|||||||
readonly payload: SourceMapPayload;
|
readonly payload: SourceMapPayload;
|
||||||
constructor(payload: SourceMapPayload);
|
constructor(payload: SourceMapPayload);
|
||||||
/**
|
/**
|
||||||
* Given a line offset and column offset in the generated source
|
* Given a line number and column number in the generated source file, returns
|
||||||
* file, returns an object representing the SourceMap range in the
|
* an object representing the position in the original file. The object returned
|
||||||
* original file if found, or an empty object if not.
|
* consists of the following keys:
|
||||||
*
|
|
||||||
* The object returned contains the following keys:
|
|
||||||
*
|
|
||||||
* The returned value represents the raw range as it appears in the
|
|
||||||
* SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
|
|
||||||
* column numbers as they appear in Error messages and CallSite
|
|
||||||
* objects.
|
|
||||||
*
|
|
||||||
* To get the corresponding 1-indexed line and column numbers from a
|
|
||||||
* lineNumber and columnNumber as they are reported by Error stacks
|
|
||||||
* and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
|
|
||||||
* @param lineOffset The zero-indexed line number offset in the generated source
|
|
||||||
* @param columnOffset The zero-indexed column number offset in the generated source
|
|
||||||
*/
|
*/
|
||||||
findEntry(lineOffset: number, columnOffset: number): SourceMapping;
|
findEntry(line: number, column: 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 {}
|
interface Module extends NodeModule {}
|
||||||
class Module {
|
class Module {
|
||||||
@@ -250,48 +85,30 @@ declare module "module" {
|
|||||||
static wrap(code: string): string;
|
static wrap(code: string): string;
|
||||||
static createRequire(path: string | URL): NodeRequire;
|
static createRequire(path: string | URL): NodeRequire;
|
||||||
static builtinModules: string[];
|
static builtinModules: string[];
|
||||||
static isBuiltin(moduleName: string): boolean;
|
|
||||||
static Module: typeof Module;
|
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);
|
constructor(id: string, parent?: Module);
|
||||||
}
|
}
|
||||||
global {
|
global {
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
url: string;
|
url: string;
|
||||||
/**
|
/**
|
||||||
* Provides a module-relative resolution function scoped to each module, returning
|
* @experimental
|
||||||
* the URL string.
|
* This feature is only available with the `--experimental-import-meta-resolve`
|
||||||
*
|
|
||||||
* @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.
|
* command flag enabled.
|
||||||
*
|
*
|
||||||
* Provides a module-relative resolution function scoped to each module, returning
|
* Provides a module-relative resolution function scoped to each module, returning
|
||||||
* the URL string.
|
* the URL string.
|
||||||
*
|
*
|
||||||
* @since v20.6.0
|
* @param specified The module specifier to resolve relative to `parent`.
|
||||||
*
|
* @param parent The absolute parent module URL to resolve from. If none
|
||||||
* @param specifier The module specifier to resolve relative to `parent`.
|
* is specified, the value of `import.meta.url` is used as the default.
|
||||||
* @param parent The absolute parent module URL to resolve from.
|
|
||||||
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
||||||
*/
|
*/
|
||||||
resolve(specifier: string, parent: string | URL): string;
|
resolve?(specified: string, parent?: string | URL): Promise<string>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export = Module;
|
export = Module;
|
||||||
}
|
}
|
||||||
declare module "node:module" {
|
declare module 'node:module' {
|
||||||
import module = require("module");
|
import module = require('module');
|
||||||
export = module;
|
export = module;
|
||||||
}
|
}
|
||||||
|
|||||||
403
node_modules/@types/node/net.d.ts
generated
vendored
Normal file → Executable file
403
node_modules/@types/node/net.d.ts
generated
vendored
Normal file → Executable file
@@ -1,26 +1,22 @@
|
|||||||
/**
|
/**
|
||||||
* > Stability: 2 - Stable
|
* > Stability: 2 - Stable
|
||||||
*
|
*
|
||||||
* The `node:net` module provides an asynchronous network API for creating stream-based
|
* The `net` module provides an asynchronous network API for creating stream-based
|
||||||
* TCP or `IPC` servers ({@link createServer}) and clients
|
* TCP or `IPC` servers ({@link createServer}) and clients
|
||||||
* ({@link createConnection}).
|
* ({@link createConnection}).
|
||||||
*
|
*
|
||||||
* It can be accessed using:
|
* It can be accessed using:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const net = require('node:net');
|
* const net = require('net');
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/net.js)
|
||||||
*/
|
*/
|
||||||
declare module "net" {
|
declare module 'net' {
|
||||||
import * as stream from "node:stream";
|
import * as stream from 'node:stream';
|
||||||
import { Abortable, EventEmitter } from "node:events";
|
import { Abortable, EventEmitter } from 'node:events';
|
||||||
import * as dns from "node:dns";
|
import * as dns from 'node:dns';
|
||||||
type LookupFunction = (
|
type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
|
||||||
hostname: string,
|
|
||||||
options: dns.LookupAllOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void,
|
|
||||||
) => void;
|
|
||||||
interface AddressInfo {
|
interface AddressInfo {
|
||||||
address: string;
|
address: string;
|
||||||
family: string;
|
family: string;
|
||||||
@@ -58,23 +54,11 @@ declare module "net" {
|
|||||||
hints?: number | undefined;
|
hints?: number | undefined;
|
||||||
family?: number | undefined;
|
family?: number | undefined;
|
||||||
lookup?: LookupFunction | 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 {
|
interface IpcSocketConnectOpts extends ConnectOpts {
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
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
|
* 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
|
* (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
|
||||||
@@ -91,12 +75,6 @@ declare module "net" {
|
|||||||
*/
|
*/
|
||||||
class Socket extends stream.Duplex {
|
class Socket extends stream.Duplex {
|
||||||
constructor(options?: SocketConstructorOpts);
|
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
|
* Sends data on the socket. The second parameter specifies the encoding in the
|
||||||
* case of a string. It defaults to UTF8 encoding.
|
* case of a string. It defaults to UTF8 encoding.
|
||||||
@@ -149,14 +127,6 @@ declare module "net" {
|
|||||||
* @return The socket itself.
|
* @return The socket itself.
|
||||||
*/
|
*/
|
||||||
pause(): this;
|
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()`.
|
* Resumes reading after a call to `socket.pause()`.
|
||||||
* @return The socket itself.
|
* @return The socket itself.
|
||||||
@@ -234,21 +204,12 @@ declare module "net" {
|
|||||||
*/
|
*/
|
||||||
unref(): this;
|
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.
|
* If the socket is `ref`ed calling `ref` again will have no effect.
|
||||||
* @since v0.9.1
|
* @since v0.9.1
|
||||||
* @return The socket itself.
|
* @return The socket itself.
|
||||||
*/
|
*/
|
||||||
ref(): this;
|
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
|
* 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
|
* may contain strings whose length after encoding is not yet known. So this number
|
||||||
@@ -285,12 +246,6 @@ declare module "net" {
|
|||||||
* @since v6.1.0
|
* @since v6.1.0
|
||||||
*/
|
*/
|
||||||
readonly connecting: boolean;
|
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.
|
* See `writable.destroyed` for further details.
|
||||||
*/
|
*/
|
||||||
@@ -307,21 +262,6 @@ declare module "net" {
|
|||||||
* @since v0.9.6
|
* @since v0.9.6
|
||||||
*/
|
*/
|
||||||
readonly localPort?: number;
|
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 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).
|
* the socket is destroyed (for example, if the client disconnected).
|
||||||
@@ -329,23 +269,15 @@ declare module "net" {
|
|||||||
*/
|
*/
|
||||||
readonly remoteAddress?: string | undefined;
|
readonly remoteAddress?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
|
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`.
|
||||||
* the socket is destroyed (for example, if the client disconnected).
|
|
||||||
* @since v0.11.14
|
* @since v0.11.14
|
||||||
*/
|
*/
|
||||||
readonly remoteFamily?: string | undefined;
|
readonly remoteFamily?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
|
* The numeric representation of the remote port. For example, `80` or `21`.
|
||||||
* the socket is destroyed (for example, if the client disconnected).
|
|
||||||
* @since v0.5.10
|
* @since v0.5.10
|
||||||
*/
|
*/
|
||||||
readonly remotePort?: number | undefined;
|
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
|
* Half-closes the socket. i.e., it sends a FIN packet. It is possible the
|
||||||
* server will still send some data.
|
* server will still send some data.
|
||||||
@@ -356,9 +288,9 @@ declare module "net" {
|
|||||||
* @param callback Optional callback for when the socket is finished.
|
* @param callback Optional callback for when the socket is finished.
|
||||||
* @return The socket itself.
|
* @return The socket itself.
|
||||||
*/
|
*/
|
||||||
end(callback?: () => void): this;
|
end(callback?: () => void): void;
|
||||||
end(buffer: Uint8Array | string, callback?: () => void): this;
|
end(buffer: Uint8Array | string, callback?: () => void): void;
|
||||||
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
|
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): void;
|
||||||
/**
|
/**
|
||||||
* events.EventEmitter
|
* events.EventEmitter
|
||||||
* 1. close
|
* 1. close
|
||||||
@@ -368,84 +300,68 @@ declare module "net" {
|
|||||||
* 5. end
|
* 5. end
|
||||||
* 6. error
|
* 6. error
|
||||||
* 7. lookup
|
* 7. lookup
|
||||||
* 8. ready
|
* 8. timeout
|
||||||
* 9. timeout
|
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "close", listener: (hadError: boolean) => void): this;
|
addListener(event: 'close', listener: (hadError: boolean) => void): this;
|
||||||
addListener(event: "connect", listener: () => void): this;
|
addListener(event: 'connect', listener: () => void): this;
|
||||||
addListener(event: "data", listener: (data: Buffer) => void): this;
|
addListener(event: 'data', listener: (data: Buffer) => void): this;
|
||||||
addListener(event: "drain", listener: () => void): this;
|
addListener(event: 'drain', listener: () => void): this;
|
||||||
addListener(event: "end", listener: () => void): this;
|
addListener(event: 'end', listener: () => void): this;
|
||||||
addListener(event: "error", listener: (err: Error) => void): this;
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
addListener(
|
addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
||||||
event: "lookup",
|
addListener(event: 'ready', listener: () => void): this;
|
||||||
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
addListener(event: 'timeout', listener: () => void): this;
|
||||||
): this;
|
|
||||||
addListener(event: "ready", listener: () => void): this;
|
|
||||||
addListener(event: "timeout", listener: () => void): this;
|
|
||||||
emit(event: string | symbol, ...args: any[]): boolean;
|
emit(event: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "close", hadError: boolean): boolean;
|
emit(event: 'close', hadError: boolean): boolean;
|
||||||
emit(event: "connect"): boolean;
|
emit(event: 'connect'): boolean;
|
||||||
emit(event: "data", data: Buffer): boolean;
|
emit(event: 'data', data: Buffer): boolean;
|
||||||
emit(event: "drain"): boolean;
|
emit(event: 'drain'): boolean;
|
||||||
emit(event: "end"): boolean;
|
emit(event: 'end'): boolean;
|
||||||
emit(event: "error", err: Error): boolean;
|
emit(event: 'error', err: Error): boolean;
|
||||||
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
|
emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean;
|
||||||
emit(event: "ready"): boolean;
|
emit(event: 'ready'): boolean;
|
||||||
emit(event: "timeout"): boolean;
|
emit(event: 'timeout'): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "close", listener: (hadError: boolean) => void): this;
|
on(event: 'close', listener: (hadError: boolean) => void): this;
|
||||||
on(event: "connect", listener: () => void): this;
|
on(event: 'connect', listener: () => void): this;
|
||||||
on(event: "data", listener: (data: Buffer) => void): this;
|
on(event: 'data', listener: (data: Buffer) => void): this;
|
||||||
on(event: "drain", listener: () => void): this;
|
on(event: 'drain', listener: () => void): this;
|
||||||
on(event: "end", listener: () => void): this;
|
on(event: 'end', listener: () => void): this;
|
||||||
on(event: "error", listener: (err: Error) => void): this;
|
on(event: 'error', listener: (err: Error) => void): this;
|
||||||
on(
|
on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
||||||
event: "lookup",
|
on(event: 'ready', listener: () => void): this;
|
||||||
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
on(event: 'timeout', listener: () => void): this;
|
||||||
): this;
|
|
||||||
on(event: "ready", listener: () => void): this;
|
|
||||||
on(event: "timeout", listener: () => void): this;
|
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "close", listener: (hadError: boolean) => void): this;
|
once(event: 'close', listener: (hadError: boolean) => void): this;
|
||||||
once(event: "connect", listener: () => void): this;
|
once(event: 'connect', listener: () => void): this;
|
||||||
once(event: "data", listener: (data: Buffer) => void): this;
|
once(event: 'data', listener: (data: Buffer) => void): this;
|
||||||
once(event: "drain", listener: () => void): this;
|
once(event: 'drain', listener: () => void): this;
|
||||||
once(event: "end", listener: () => void): this;
|
once(event: 'end', listener: () => void): this;
|
||||||
once(event: "error", listener: (err: Error) => void): this;
|
once(event: 'error', listener: (err: Error) => void): this;
|
||||||
once(
|
once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
||||||
event: "lookup",
|
once(event: 'ready', listener: () => void): this;
|
||||||
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
once(event: 'timeout', listener: () => void): this;
|
||||||
): this;
|
|
||||||
once(event: "ready", listener: () => void): this;
|
|
||||||
once(event: "timeout", listener: () => void): this;
|
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "close", listener: (hadError: boolean) => void): this;
|
prependListener(event: 'close', listener: (hadError: boolean) => void): this;
|
||||||
prependListener(event: "connect", listener: () => void): this;
|
prependListener(event: 'connect', listener: () => void): this;
|
||||||
prependListener(event: "data", listener: (data: Buffer) => void): this;
|
prependListener(event: 'data', listener: (data: Buffer) => void): this;
|
||||||
prependListener(event: "drain", listener: () => void): this;
|
prependListener(event: 'drain', listener: () => void): this;
|
||||||
prependListener(event: "end", listener: () => void): this;
|
prependListener(event: 'end', listener: () => void): this;
|
||||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependListener(
|
prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
||||||
event: "lookup",
|
prependListener(event: 'ready', listener: () => void): this;
|
||||||
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
prependListener(event: 'timeout', listener: () => void): this;
|
||||||
): this;
|
|
||||||
prependListener(event: "ready", listener: () => void): this;
|
|
||||||
prependListener(event: "timeout", listener: () => void): this;
|
|
||||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
|
prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this;
|
||||||
prependOnceListener(event: "connect", listener: () => void): this;
|
prependOnceListener(event: 'connect', listener: () => void): this;
|
||||||
prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
|
prependOnceListener(event: 'data', listener: (data: Buffer) => void): this;
|
||||||
prependOnceListener(event: "drain", listener: () => void): this;
|
prependOnceListener(event: 'drain', listener: () => void): this;
|
||||||
prependOnceListener(event: "end", listener: () => void): this;
|
prependOnceListener(event: 'end', listener: () => void): this;
|
||||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependOnceListener(
|
prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
||||||
event: "lookup",
|
prependOnceListener(event: 'ready', listener: () => void): this;
|
||||||
listener: (err: Error, address: string, family: string | number, host: string) => void,
|
prependOnceListener(event: 'timeout', listener: () => void): this;
|
||||||
): this;
|
|
||||||
prependOnceListener(event: "ready", listener: () => void): this;
|
|
||||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
||||||
}
|
}
|
||||||
interface ListenOptions extends Abortable {
|
interface ListenOptions extends Abortable {
|
||||||
port?: number | undefined;
|
port?: number | undefined;
|
||||||
@@ -471,33 +387,6 @@ declare module "net" {
|
|||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
pauseOnConnect?: boolean | undefined;
|
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.
|
* This class is used to create a TCP or `IPC` server.
|
||||||
@@ -538,7 +427,7 @@ declare module "net" {
|
|||||||
* ```js
|
* ```js
|
||||||
* server.on('error', (e) => {
|
* server.on('error', (e) => {
|
||||||
* if (e.code === 'EADDRINUSE') {
|
* if (e.code === 'EADDRINUSE') {
|
||||||
* console.error('Address in use, retrying...');
|
* console.log('Address in use, retrying...');
|
||||||
* setTimeout(() => {
|
* setTimeout(() => {
|
||||||
* server.close();
|
* server.close();
|
||||||
* server.listen(PORT, HOST);
|
* server.listen(PORT, HOST);
|
||||||
@@ -603,7 +492,7 @@ declare module "net" {
|
|||||||
*/
|
*/
|
||||||
getConnections(cb: (error: Error | null, count: number) => void): void;
|
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.
|
* If the server is `ref`ed calling `ref()` again will have no effect.
|
||||||
* @since v0.9.1
|
* @since v0.9.1
|
||||||
*/
|
*/
|
||||||
@@ -635,61 +524,49 @@ declare module "net" {
|
|||||||
* 2. connection
|
* 2. connection
|
||||||
* 3. error
|
* 3. error
|
||||||
* 4. listening
|
* 4. listening
|
||||||
* 5. drop
|
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "close", listener: () => void): this;
|
addListener(event: 'close', listener: () => void): this;
|
||||||
addListener(event: "connection", listener: (socket: Socket) => void): this;
|
addListener(event: 'connection', listener: (socket: Socket) => void): this;
|
||||||
addListener(event: "error", listener: (err: Error) => void): this;
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
addListener(event: "listening", listener: () => 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: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "close"): boolean;
|
emit(event: 'close'): boolean;
|
||||||
emit(event: "connection", socket: Socket): boolean;
|
emit(event: 'connection', socket: Socket): boolean;
|
||||||
emit(event: "error", err: Error): boolean;
|
emit(event: 'error', err: Error): boolean;
|
||||||
emit(event: "listening"): boolean;
|
emit(event: 'listening'): boolean;
|
||||||
emit(event: "drop", data?: DropArgument): boolean;
|
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "close", listener: () => void): this;
|
on(event: 'close', listener: () => void): this;
|
||||||
on(event: "connection", listener: (socket: Socket) => void): this;
|
on(event: 'connection', listener: (socket: Socket) => void): this;
|
||||||
on(event: "error", listener: (err: Error) => void): this;
|
on(event: 'error', listener: (err: Error) => void): this;
|
||||||
on(event: "listening", listener: () => 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: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "close", listener: () => void): this;
|
once(event: 'close', listener: () => void): this;
|
||||||
once(event: "connection", listener: (socket: Socket) => void): this;
|
once(event: 'connection', listener: (socket: Socket) => void): this;
|
||||||
once(event: "error", listener: (err: Error) => void): this;
|
once(event: 'error', listener: (err: Error) => void): this;
|
||||||
once(event: "listening", listener: () => 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: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "close", listener: () => void): this;
|
prependListener(event: 'close', listener: () => void): this;
|
||||||
prependListener(event: "connection", listener: (socket: Socket) => void): this;
|
prependListener(event: 'connection', listener: (socket: Socket) => void): this;
|
||||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependListener(event: "listening", listener: () => 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: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "close", listener: () => void): this;
|
prependOnceListener(event: 'close', listener: () => void): this;
|
||||||
prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
|
prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
|
||||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: () => 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
|
* 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
|
* disabling inbound or outbound access to specific IP addresses, IP ranges, or
|
||||||
* IP subnets.
|
* IP subnets.
|
||||||
* @since v15.0.0, v14.18.0
|
* @since v15.0.0
|
||||||
*/
|
*/
|
||||||
class BlockList {
|
class BlockList {
|
||||||
/**
|
/**
|
||||||
* Adds a rule to block the given IP address.
|
* Adds a rule to block the given IP address.
|
||||||
* @since v15.0.0, v14.18.0
|
* @since v15.0.0
|
||||||
* @param address An IPv4 or IPv6 address.
|
* @param address An IPv4 or IPv6 address.
|
||||||
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
||||||
*/
|
*/
|
||||||
@@ -697,7 +574,7 @@ declare module "net" {
|
|||||||
addAddress(address: SocketAddress): void;
|
addAddress(address: SocketAddress): void;
|
||||||
/**
|
/**
|
||||||
* Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
|
* Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
|
||||||
* @since v15.0.0, v14.18.0
|
* @since v15.0.0
|
||||||
* @param start The starting IPv4 or IPv6 address in the range.
|
* @param start The starting IPv4 or IPv6 address in the range.
|
||||||
* @param end The ending 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'`.
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
||||||
@@ -706,7 +583,7 @@ declare module "net" {
|
|||||||
addRange(start: SocketAddress, end: SocketAddress): void;
|
addRange(start: SocketAddress, end: SocketAddress): void;
|
||||||
/**
|
/**
|
||||||
* Adds a rule to block a range of IP addresses specified as a subnet mask.
|
* Adds a rule to block a range of IP addresses specified as a subnet mask.
|
||||||
* @since v15.0.0, v14.18.0
|
* @since v15.0.0
|
||||||
* @param net The network IPv4 or IPv6 address.
|
* @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 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'`.
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
||||||
@@ -730,7 +607,7 @@ declare module "net" {
|
|||||||
* console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true
|
* console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true
|
||||||
* console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true
|
* console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true
|
||||||
* ```
|
* ```
|
||||||
* @since v15.0.0, v14.18.0
|
* @since v15.0.0
|
||||||
* @param address The IP address to check
|
* @param address The IP address to check
|
||||||
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
||||||
*/
|
*/
|
||||||
@@ -761,11 +638,11 @@ declare module "net" {
|
|||||||
*
|
*
|
||||||
* The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
|
* The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
|
||||||
*
|
*
|
||||||
* Here is an example of a TCP echo server which listens for connections
|
* Here is an example of an TCP echo server which listens for connections
|
||||||
* on port 8124:
|
* on port 8124:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const net = require('node:net');
|
* const net = require('net');
|
||||||
* const server = net.createServer((c) => {
|
* const server = net.createServer((c) => {
|
||||||
* // 'connection' listener.
|
* // 'connection' listener.
|
||||||
* console.log('client connected');
|
* console.log('client connected');
|
||||||
@@ -785,8 +662,8 @@ declare module "net" {
|
|||||||
*
|
*
|
||||||
* Test this by using `telnet`:
|
* Test this by using `telnet`:
|
||||||
*
|
*
|
||||||
* ```bash
|
* ```console
|
||||||
* telnet localhost 8124
|
* $ telnet localhost 8124
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* To listen on the socket `/tmp/echo.sock`:
|
* To listen on the socket `/tmp/echo.sock`:
|
||||||
@@ -799,8 +676,8 @@ declare module "net" {
|
|||||||
*
|
*
|
||||||
* Use `nc` to connect to a Unix domain socket server:
|
* Use `nc` to connect to a Unix domain socket server:
|
||||||
*
|
*
|
||||||
* ```bash
|
* ```console
|
||||||
* nc -U /tmp/echo.sock
|
* $ nc -U /tmp/echo.sock
|
||||||
* ```
|
* ```
|
||||||
* @since v0.5.0
|
* @since v0.5.0
|
||||||
* @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
|
* @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
|
||||||
@@ -840,61 +717,19 @@ declare module "net" {
|
|||||||
function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
|
function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
|
||||||
function createConnection(path: string, connectionListener?: () => void): Socket;
|
function createConnection(path: string, connectionListener?: () => void): Socket;
|
||||||
/**
|
/**
|
||||||
* Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`.
|
* Tests if input is an IP address. Returns `0` for invalid strings,
|
||||||
* The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided.
|
* returns `4` for IP version 4 addresses, and returns `6` for IP version 6
|
||||||
* @since v19.4.0
|
* addresses.
|
||||||
*/
|
|
||||||
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
|
* @since v0.3.0
|
||||||
*/
|
*/
|
||||||
function isIP(input: string): number;
|
function isIP(input: string): number;
|
||||||
/**
|
/**
|
||||||
* Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no
|
* Returns `true` if input is a version 4 IP address, otherwise returns `false`.
|
||||||
* 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
|
* @since v0.3.0
|
||||||
*/
|
*/
|
||||||
function isIPv4(input: string): boolean;
|
function isIPv4(input: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`.
|
* Returns `true` if input is a version 6 IP address, otherwise returns `false`.
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* net.isIPv6('::1'); // returns true
|
|
||||||
* net.isIPv6('fhqwhgads'); // returns false
|
|
||||||
* ```
|
|
||||||
* @since v0.3.0
|
* @since v0.3.0
|
||||||
*/
|
*/
|
||||||
function isIPv6(input: string): boolean;
|
function isIPv6(input: string): boolean;
|
||||||
@@ -920,30 +755,30 @@ declare module "net" {
|
|||||||
port?: number | undefined;
|
port?: number | undefined;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @since v15.14.0, v14.18.0
|
* @since v15.14.0
|
||||||
*/
|
*/
|
||||||
class SocketAddress {
|
class SocketAddress {
|
||||||
constructor(options: SocketAddressInitOptions);
|
constructor(options: SocketAddressInitOptions);
|
||||||
/**
|
/**
|
||||||
* Either \`'ipv4'\` or \`'ipv6'\`.
|
* Either \`'ipv4'\` or \`'ipv6'\`.
|
||||||
* @since v15.14.0, v14.18.0
|
* @since v15.14.0
|
||||||
*/
|
*/
|
||||||
readonly address: string;
|
readonly address: string;
|
||||||
/**
|
/**
|
||||||
* Either \`'ipv4'\` or \`'ipv6'\`.
|
* Either \`'ipv4'\` or \`'ipv6'\`.
|
||||||
* @since v15.14.0, v14.18.0
|
* @since v15.14.0
|
||||||
*/
|
*/
|
||||||
readonly family: IPVersion;
|
readonly family: IPVersion;
|
||||||
/**
|
/**
|
||||||
* @since v15.14.0, v14.18.0
|
* @since v15.14.0
|
||||||
*/
|
*/
|
||||||
readonly port: number;
|
readonly port: number;
|
||||||
/**
|
/**
|
||||||
* @since v15.14.0, v14.18.0
|
* @since v15.14.0
|
||||||
*/
|
*/
|
||||||
readonly flowlabel: number;
|
readonly flowlabel: number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:net" {
|
declare module 'node:net' {
|
||||||
export * from "net";
|
export * from 'net';
|
||||||
}
|
}
|
||||||
|
|||||||
66
node_modules/@types/node/os.d.ts
generated
vendored
Normal file → Executable file
66
node_modules/@types/node/os.d.ts
generated
vendored
Normal file → Executable file
@@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:os` module provides operating system-related utility methods and
|
* The `os` module provides operating system-related utility methods and
|
||||||
* properties. It can be accessed using:
|
* properties. It can be accessed using:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const os = require('node:os');
|
* const os = require('os');
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/os.js)
|
||||||
*/
|
*/
|
||||||
declare module "os" {
|
declare module 'os' {
|
||||||
interface CpuInfo {
|
interface CpuInfo {
|
||||||
model: string;
|
model: string;
|
||||||
speed: number;
|
speed: number;
|
||||||
@@ -27,18 +27,17 @@ declare module "os" {
|
|||||||
cidr: string | null;
|
cidr: string | null;
|
||||||
}
|
}
|
||||||
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
||||||
family: "IPv4";
|
family: 'IPv4';
|
||||||
scopeid?: undefined;
|
|
||||||
}
|
}
|
||||||
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
||||||
family: "IPv6";
|
family: 'IPv6';
|
||||||
scopeid: number;
|
scopeid: number;
|
||||||
}
|
}
|
||||||
interface UserInfo<T> {
|
interface UserInfo<T> {
|
||||||
username: T;
|
username: T;
|
||||||
uid: number;
|
uid: number;
|
||||||
gid: number;
|
gid: number;
|
||||||
shell: T | null;
|
shell: T;
|
||||||
homedir: T;
|
homedir: T;
|
||||||
}
|
}
|
||||||
type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
|
type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
|
||||||
@@ -75,7 +74,6 @@ declare module "os" {
|
|||||||
function totalmem(): number;
|
function totalmem(): number;
|
||||||
/**
|
/**
|
||||||
* Returns an array of objects containing information about each logical CPU core.
|
* 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:
|
* The properties included on each object include:
|
||||||
*
|
*
|
||||||
@@ -89,8 +87,8 @@ declare module "os" {
|
|||||||
* nice: 0,
|
* nice: 0,
|
||||||
* sys: 30340,
|
* sys: 30340,
|
||||||
* idle: 1070356870,
|
* idle: 1070356870,
|
||||||
* irq: 0,
|
* irq: 0
|
||||||
* },
|
* }
|
||||||
* },
|
* },
|
||||||
* {
|
* {
|
||||||
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
||||||
@@ -100,8 +98,8 @@ declare module "os" {
|
|||||||
* nice: 0,
|
* nice: 0,
|
||||||
* sys: 26980,
|
* sys: 26980,
|
||||||
* idle: 1071569080,
|
* idle: 1071569080,
|
||||||
* irq: 0,
|
* irq: 0
|
||||||
* },
|
* }
|
||||||
* },
|
* },
|
||||||
* {
|
* {
|
||||||
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
||||||
@@ -111,8 +109,8 @@ declare module "os" {
|
|||||||
* nice: 0,
|
* nice: 0,
|
||||||
* sys: 21750,
|
* sys: 21750,
|
||||||
* idle: 1070919370,
|
* idle: 1070919370,
|
||||||
* irq: 0,
|
* irq: 0
|
||||||
* },
|
* }
|
||||||
* },
|
* },
|
||||||
* {
|
* {
|
||||||
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
||||||
@@ -122,28 +120,17 @@ declare module "os" {
|
|||||||
* nice: 0,
|
* nice: 0,
|
||||||
* sys: 19430,
|
* sys: 19430,
|
||||||
* idle: 1070905480,
|
* idle: 1070905480,
|
||||||
* irq: 20,
|
* irq: 20
|
||||||
* },
|
* }
|
||||||
* },
|
* },
|
||||||
* ]
|
* ]
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* `nice` values are POSIX-only. On Windows, the `nice` values of all processors
|
* `nice` values are POSIX-only. On Windows, the `nice` values of all processors
|
||||||
* are always 0.
|
* 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
|
* @since v0.3.3
|
||||||
*/
|
*/
|
||||||
function cpus(): CpuInfo[];
|
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 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.
|
* returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
|
||||||
@@ -239,7 +226,7 @@ declare module "os" {
|
|||||||
* Throws a `SystemError` if a user has no `username` or `homedir`.
|
* Throws a `SystemError` if a user has no `username` or `homedir`.
|
||||||
* @since v6.0.0
|
* @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>;
|
function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
|
||||||
type SignalConstants = {
|
type SignalConstants = {
|
||||||
[key in NodeJS.Signals]: number;
|
[key in NodeJS.Signals]: number;
|
||||||
@@ -400,7 +387,7 @@ declare module "os" {
|
|||||||
const EOL: string;
|
const EOL: string;
|
||||||
/**
|
/**
|
||||||
* Returns the operating system CPU architecture for which the Node.js binary was
|
* Returns the operating system CPU architecture for which the Node.js binary was
|
||||||
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
|
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`.
|
||||||
*
|
*
|
||||||
* The return value is equivalent to `process.arch`.
|
* The return value is equivalent to `process.arch`.
|
||||||
* @since v0.5.0
|
* @since v0.5.0
|
||||||
@@ -415,9 +402,8 @@ declare module "os" {
|
|||||||
*/
|
*/
|
||||||
function version(): string;
|
function version(): string;
|
||||||
/**
|
/**
|
||||||
* Returns a string identifying the operating system platform for which
|
* Returns a string identifying the operating system platform. The value is set
|
||||||
* the Node.js binary was compiled. The value is set at compile time.
|
* at compile time. Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`.
|
||||||
* Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
|
|
||||||
*
|
*
|
||||||
* The return value is equivalent to `process.platform`.
|
* The return value is equivalent to `process.platform`.
|
||||||
*
|
*
|
||||||
@@ -426,14 +412,6 @@ declare module "os" {
|
|||||||
* @since v0.5.0
|
* @since v0.5.0
|
||||||
*/
|
*/
|
||||||
function platform(): NodeJS.Platform;
|
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
|
* Returns the operating system's default directory for temporary files as a
|
||||||
* string.
|
* string.
|
||||||
@@ -447,7 +425,7 @@ declare module "os" {
|
|||||||
* Possible values are `'BE'` for big endian and `'LE'` for little endian.
|
* Possible values are `'BE'` for big endian and `'LE'` for little endian.
|
||||||
* @since v0.9.4
|
* @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
|
* 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.
|
* not provided or is `0`, the priority of the current process is returned.
|
||||||
@@ -472,6 +450,6 @@ declare module "os" {
|
|||||||
function setPriority(priority: number): void;
|
function setPriority(priority: number): void;
|
||||||
function setPriority(pid: number, priority: number): void;
|
function setPriority(pid: number, priority: number): void;
|
||||||
}
|
}
|
||||||
declare module "node:os" {
|
declare module 'node:os' {
|
||||||
export * from "os";
|
export * from 'os';
|
||||||
}
|
}
|
||||||
|
|||||||
197
node_modules/@types/node/package.json
generated
vendored
Normal file → Executable file
197
node_modules/@types/node/package.json
generated
vendored
Normal file → Executable file
@@ -1,230 +1,225 @@
|
|||||||
{
|
{
|
||||||
"name": "@types/node",
|
"name": "@types/node",
|
||||||
"version": "20.9.0",
|
"version": "16.11.22",
|
||||||
"description": "TypeScript definitions for node",
|
"description": "TypeScript definitions for Node.js",
|
||||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "Microsoft TypeScript",
|
"name": "Microsoft TypeScript",
|
||||||
"githubUsername": "Microsoft",
|
"url": "https://github.com/Microsoft",
|
||||||
"url": "https://github.com/Microsoft"
|
"githubUsername": "Microsoft"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DefinitelyTyped",
|
||||||
|
"url": "https://github.com/DefinitelyTyped",
|
||||||
|
"githubUsername": "DefinitelyTyped"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Alberto Schiabel",
|
"name": "Alberto Schiabel",
|
||||||
"githubUsername": "jkomyno",
|
"url": "https://github.com/jkomyno",
|
||||||
"url": "https://github.com/jkomyno"
|
"githubUsername": "jkomyno"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Alvis HT Tang",
|
"name": "Alvis HT Tang",
|
||||||
"githubUsername": "alvis",
|
"url": "https://github.com/alvis",
|
||||||
"url": "https://github.com/alvis"
|
"githubUsername": "alvis"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Andrew Makarov",
|
"name": "Andrew Makarov",
|
||||||
"githubUsername": "r3nya",
|
"url": "https://github.com/r3nya",
|
||||||
"url": "https://github.com/r3nya"
|
"githubUsername": "r3nya"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Benjamin Toueg",
|
"name": "Benjamin Toueg",
|
||||||
"githubUsername": "btoueg",
|
"url": "https://github.com/btoueg",
|
||||||
"url": "https://github.com/btoueg"
|
"githubUsername": "btoueg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Chigozirim C.",
|
"name": "Chigozirim C.",
|
||||||
"githubUsername": "smac89",
|
"url": "https://github.com/smac89",
|
||||||
"url": "https://github.com/smac89"
|
"githubUsername": "smac89"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "David Junger",
|
"name": "David Junger",
|
||||||
"githubUsername": "touffy",
|
"url": "https://github.com/touffy",
|
||||||
"url": "https://github.com/touffy"
|
"githubUsername": "touffy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Deividas Bakanas",
|
"name": "Deividas Bakanas",
|
||||||
"githubUsername": "DeividasBakanas",
|
"url": "https://github.com/DeividasBakanas",
|
||||||
"url": "https://github.com/DeividasBakanas"
|
"githubUsername": "DeividasBakanas"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Eugene Y. Q. Shen",
|
"name": "Eugene Y. Q. Shen",
|
||||||
"githubUsername": "eyqs",
|
"url": "https://github.com/eyqs",
|
||||||
"url": "https://github.com/eyqs"
|
"githubUsername": "eyqs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Hannes Magnusson",
|
"name": "Hannes Magnusson",
|
||||||
"githubUsername": "Hannes-Magnusson-CK",
|
"url": "https://github.com/Hannes-Magnusson-CK",
|
||||||
"url": "https://github.com/Hannes-Magnusson-CK"
|
"githubUsername": "Hannes-Magnusson-CK"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Huw",
|
"name": "Huw",
|
||||||
"githubUsername": "hoo29",
|
"url": "https://github.com/hoo29",
|
||||||
"url": "https://github.com/hoo29"
|
"githubUsername": "hoo29"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Kelvin Jin",
|
"name": "Kelvin Jin",
|
||||||
"githubUsername": "kjin",
|
"url": "https://github.com/kjin",
|
||||||
"url": "https://github.com/kjin"
|
"githubUsername": "kjin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Klaus Meinhardt",
|
"name": "Klaus Meinhardt",
|
||||||
"githubUsername": "ajafff",
|
"url": "https://github.com/ajafff",
|
||||||
"url": "https://github.com/ajafff"
|
"githubUsername": "ajafff"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Lishude",
|
"name": "Lishude",
|
||||||
"githubUsername": "islishude",
|
"url": "https://github.com/islishude",
|
||||||
"url": "https://github.com/islishude"
|
"githubUsername": "islishude"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Mariusz Wiktorczyk",
|
"name": "Mariusz Wiktorczyk",
|
||||||
"githubUsername": "mwiktorczyk",
|
"url": "https://github.com/mwiktorczyk",
|
||||||
"url": "https://github.com/mwiktorczyk"
|
"githubUsername": "mwiktorczyk"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Mohsen Azimi",
|
"name": "Mohsen Azimi",
|
||||||
"githubUsername": "mohsen1",
|
"url": "https://github.com/mohsen1",
|
||||||
"url": "https://github.com/mohsen1"
|
"githubUsername": "mohsen1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Nicolas Even",
|
"name": "Nicolas Even",
|
||||||
"githubUsername": "n-e",
|
"url": "https://github.com/n-e",
|
||||||
"url": "https://github.com/n-e"
|
"githubUsername": "n-e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Nikita Galkin",
|
"name": "Nikita Galkin",
|
||||||
"githubUsername": "galkin",
|
"url": "https://github.com/galkin",
|
||||||
"url": "https://github.com/galkin"
|
"githubUsername": "galkin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Parambir Singh",
|
"name": "Parambir Singh",
|
||||||
"githubUsername": "parambirs",
|
"url": "https://github.com/parambirs",
|
||||||
"url": "https://github.com/parambirs"
|
"githubUsername": "parambirs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Sebastian Silbermann",
|
"name": "Sebastian Silbermann",
|
||||||
"githubUsername": "eps1lon",
|
"url": "https://github.com/eps1lon",
|
||||||
"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"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Thomas den Hollander",
|
"name": "Thomas den Hollander",
|
||||||
"githubUsername": "ThomasdenH",
|
"url": "https://github.com/ThomasdenH",
|
||||||
"url": "https://github.com/ThomasdenH"
|
"githubUsername": "ThomasdenH"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Wilco Bakker",
|
"name": "Wilco Bakker",
|
||||||
"githubUsername": "WilcoBakker",
|
"url": "https://github.com/WilcoBakker",
|
||||||
"url": "https://github.com/WilcoBakker"
|
"githubUsername": "WilcoBakker"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "wwwy3y3",
|
"name": "wwwy3y3",
|
||||||
"githubUsername": "wwwy3y3",
|
"url": "https://github.com/wwwy3y3",
|
||||||
"url": "https://github.com/wwwy3y3"
|
"githubUsername": "wwwy3y3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Samuel Ainsworth",
|
"name": "Samuel Ainsworth",
|
||||||
"githubUsername": "samuela",
|
"url": "https://github.com/samuela",
|
||||||
"url": "https://github.com/samuela"
|
"githubUsername": "samuela"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Kyle Uehlein",
|
"name": "Kyle Uehlein",
|
||||||
"githubUsername": "kuehlein",
|
"url": "https://github.com/kuehlein",
|
||||||
"url": "https://github.com/kuehlein"
|
"githubUsername": "kuehlein"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Thanik Bhongbhibhat",
|
"name": "Thanik Bhongbhibhat",
|
||||||
"githubUsername": "bhongy",
|
"url": "https://github.com/bhongy",
|
||||||
"url": "https://github.com/bhongy"
|
"githubUsername": "bhongy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Marcin Kopacz",
|
"name": "Marcin Kopacz",
|
||||||
"githubUsername": "chyzwar",
|
"url": "https://github.com/chyzwar",
|
||||||
"url": "https://github.com/chyzwar"
|
"githubUsername": "chyzwar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Trivikram Kamat",
|
"name": "Trivikram Kamat",
|
||||||
"githubUsername": "trivikr",
|
"url": "https://github.com/trivikr",
|
||||||
"url": "https://github.com/trivikr"
|
"githubUsername": "trivikr"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Junxiao Shi",
|
"name": "Junxiao Shi",
|
||||||
"githubUsername": "yoursunny",
|
"url": "https://github.com/yoursunny",
|
||||||
"url": "https://github.com/yoursunny"
|
"githubUsername": "yoursunny"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Ilia Baryshnikov",
|
"name": "Ilia Baryshnikov",
|
||||||
"githubUsername": "qwelias",
|
"url": "https://github.com/qwelias",
|
||||||
"url": "https://github.com/qwelias"
|
"githubUsername": "qwelias"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ExE Boss",
|
"name": "ExE Boss",
|
||||||
"githubUsername": "ExE-Boss",
|
"url": "https://github.com/ExE-Boss",
|
||||||
"url": "https://github.com/ExE-Boss"
|
"githubUsername": "ExE-Boss"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Piotr Błażejewicz",
|
"name": "Piotr Błażejewicz",
|
||||||
"githubUsername": "peterblazejewicz",
|
"url": "https://github.com/peterblazejewicz",
|
||||||
"url": "https://github.com/peterblazejewicz"
|
"githubUsername": "peterblazejewicz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Anna Henningsen",
|
"name": "Anna Henningsen",
|
||||||
"githubUsername": "addaleax",
|
"url": "https://github.com/addaleax",
|
||||||
"url": "https://github.com/addaleax"
|
"githubUsername": "addaleax"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Victor Perin",
|
"name": "Victor Perin",
|
||||||
"githubUsername": "victorperin",
|
"url": "https://github.com/victorperin",
|
||||||
"url": "https://github.com/victorperin"
|
"githubUsername": "victorperin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Yongsheng Zhang",
|
"name": "Yongsheng Zhang",
|
||||||
"githubUsername": "ZYSzys",
|
"url": "https://github.com/ZYSzys",
|
||||||
"url": "https://github.com/ZYSzys"
|
"githubUsername": "ZYSzys"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "NodeJS Contributors",
|
"name": "NodeJS Contributors",
|
||||||
"githubUsername": "NodeJS",
|
"url": "https://github.com/NodeJS",
|
||||||
"url": "https://github.com/NodeJS"
|
"githubUsername": "NodeJS"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Linus Unnebäck",
|
"name": "Linus Unnebäck",
|
||||||
"githubUsername": "LinusU",
|
"url": "https://github.com/LinusU",
|
||||||
"url": "https://github.com/LinusU"
|
"githubUsername": "LinusU"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "wafuwafu13",
|
"name": "wafuwafu13",
|
||||||
"githubUsername": "wafuwafu13",
|
"url": "https://github.com/wafuwafu13",
|
||||||
"url": "https://github.com/wafuwafu13"
|
"githubUsername": "wafuwafu13"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Matteo Collina",
|
|
||||||
"githubUsername": "mcollina",
|
|
||||||
"url": "https://github.com/mcollina"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Dmitry Semigradsky",
|
|
||||||
"githubUsername": "Semigradsky",
|
|
||||||
"url": "https://github.com/Semigradsky"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"main": "",
|
"main": "",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"typesVersions": {
|
|
||||||
"<=4.8": {
|
|
||||||
"*": [
|
|
||||||
"ts4.8/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||||
"directory": "types/node"
|
"directory": "types/node"
|
||||||
},
|
},
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
"undici-types": "~5.26.4"
|
"typesPublisherContentHash": "57a94e60cf640ea4d81b4fa914f3fb5929a63ae0b4d5141d7daf250c569e7d10",
|
||||||
},
|
"typeScriptVersion": "3.8"
|
||||||
"typesPublisherContentHash": "a1b366d7b3bf1afaa88e038010565763e234c0e5fa8044db8b0d7c44995bfbf8",
|
|
||||||
"typeScriptVersion": "4.5",
|
|
||||||
"nonNpm": true
|
|
||||||
}
|
}
|
||||||
85
node_modules/@types/node/path.d.ts
generated
vendored
Normal file → Executable file
85
node_modules/@types/node/path.d.ts
generated
vendored
Normal file → Executable file
@@ -1,21 +1,21 @@
|
|||||||
declare module "path/posix" {
|
declare module 'path/posix' {
|
||||||
import path = require("path");
|
import path = require('path');
|
||||||
export = path;
|
export = path;
|
||||||
}
|
}
|
||||||
declare module "path/win32" {
|
declare module 'path/win32' {
|
||||||
import path = require("path");
|
import path = require('path');
|
||||||
export = path;
|
export = path;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The `node:path` module provides utilities for working with file and directory
|
* The `path` module provides utilities for working with file and directory paths.
|
||||||
* paths. It can be accessed using:
|
* It can be accessed using:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const path = require('node:path');
|
* const path = require('path');
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/path.js)
|
||||||
*/
|
*/
|
||||||
declare module "path" {
|
declare module 'path' {
|
||||||
namespace path {
|
namespace path {
|
||||||
/**
|
/**
|
||||||
* A parsed path object generated by path.parse() or consumed by path.format().
|
* A parsed path object generated by path.parse() or consumed by path.format().
|
||||||
@@ -69,19 +69,18 @@ declare module "path" {
|
|||||||
* Normalize a string path, reducing '..' and '.' parts.
|
* 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.
|
* When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
|
||||||
*
|
*
|
||||||
* @param path string path to normalize.
|
* @param p string path to normalize.
|
||||||
* @throws {TypeError} if `path` is not a string.
|
|
||||||
*/
|
*/
|
||||||
normalize(path: string): string;
|
normalize(p: string): string;
|
||||||
/**
|
/**
|
||||||
* Join all arguments together and normalize the resulting path.
|
* 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.
|
* @param paths paths to join.
|
||||||
* @throws {TypeError} if any of the path segments is not a string.
|
|
||||||
*/
|
*/
|
||||||
join(...paths: string[]): 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.
|
* Starting from leftmost {from} parameter, resolves {to} to an absolute path.
|
||||||
*
|
*
|
||||||
@@ -90,71 +89,61 @@ declare module "path" {
|
|||||||
* the current working directory is used as well. The resulting path is normalized,
|
* 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.
|
* and trailing slashes are removed unless the path gets resolved to the root directory.
|
||||||
*
|
*
|
||||||
* @param paths A sequence of paths or path segments.
|
* @param pathSegments string paths to join. Non-string arguments are ignored.
|
||||||
* @throws {TypeError} if any of the arguments is not a string.
|
|
||||||
*/
|
*/
|
||||||
resolve(...paths: string[]): string;
|
resolve(...pathSegments: string[]): string;
|
||||||
/**
|
/**
|
||||||
* Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
|
* 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.
|
* @param path path to test.
|
||||||
* @throws {TypeError} if `path` is not a string.
|
|
||||||
*/
|
*/
|
||||||
isAbsolute(path: string): boolean;
|
isAbsolute(p: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Solve the relative path from {from} to {to} based on the current working directory.
|
* Solve the relative path from {from} to {to}.
|
||||||
* 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.
|
* 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;
|
relative(from: string, to: string): string;
|
||||||
/**
|
/**
|
||||||
* Return the directory name of a path. Similar to the Unix dirname command.
|
* Return the directory name of a path. Similar to the Unix dirname command.
|
||||||
*
|
*
|
||||||
* @param path the path to evaluate.
|
* @param p the path to evaluate.
|
||||||
* @throws {TypeError} if `path` is not a string.
|
|
||||||
*/
|
*/
|
||||||
dirname(path: string): string;
|
dirname(p: string): string;
|
||||||
/**
|
/**
|
||||||
* Return the last portion of a path. Similar to the Unix basename command.
|
* 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.
|
* Often used to extract the file name from a fully qualified path.
|
||||||
*
|
*
|
||||||
* @param path the path to evaluate.
|
* @param p the path to evaluate.
|
||||||
* @param suffix optionally, an extension to remove from the result.
|
* @param ext optionally, an extension to remove from the result.
|
||||||
* @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
|
|
||||||
*/
|
*/
|
||||||
basename(path: string, suffix?: string): string;
|
basename(p: string, ext?: string): string;
|
||||||
/**
|
/**
|
||||||
* Return the extension of the path, from the last '.' to end of string in the last portion of the path.
|
* 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 path the path to evaluate.
|
* @param p the path to evaluate.
|
||||||
* @throws {TypeError} if `path` is not a string.
|
|
||||||
*/
|
*/
|
||||||
extname(path: string): string;
|
extname(p: string): string;
|
||||||
/**
|
/**
|
||||||
* The platform-specific file separator. '\\' or '/'.
|
* The platform-specific file separator. '\\' or '/'.
|
||||||
*/
|
*/
|
||||||
readonly sep: "\\" | "/";
|
readonly sep: string;
|
||||||
/**
|
/**
|
||||||
* The platform-specific file delimiter. ';' or ':'.
|
* The platform-specific file delimiter. ';' or ':'.
|
||||||
*/
|
*/
|
||||||
readonly delimiter: ";" | ":";
|
readonly delimiter: string;
|
||||||
/**
|
/**
|
||||||
* Returns an object from a path string - the opposite of format().
|
* Returns an object from a path string - the opposite of format().
|
||||||
*
|
*
|
||||||
* @param path path to evaluate.
|
* @param pathString path to evaluate.
|
||||||
* @throws {TypeError} if `path` is not a string.
|
|
||||||
*/
|
*/
|
||||||
parse(path: string): ParsedPath;
|
parse(p: string): ParsedPath;
|
||||||
/**
|
/**
|
||||||
* Returns a path string from an object - the opposite of parse().
|
* Returns a path string from an object - the opposite of parse().
|
||||||
*
|
*
|
||||||
* @param pathObject path to evaluate.
|
* @param pathString path to evaluate.
|
||||||
*/
|
*/
|
||||||
format(pathObject: FormatInputPathObject): string;
|
format(pP: FormatInputPathObject): string;
|
||||||
/**
|
/**
|
||||||
* On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
|
* 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.
|
* If path is not a string, path will be returned without modifications.
|
||||||
@@ -177,15 +166,15 @@ declare module "path" {
|
|||||||
const path: path.PlatformPath;
|
const path: path.PlatformPath;
|
||||||
export = path;
|
export = path;
|
||||||
}
|
}
|
||||||
declare module "node:path" {
|
declare module 'node:path' {
|
||||||
import path = require("path");
|
import path = require('path');
|
||||||
export = path;
|
export = path;
|
||||||
}
|
}
|
||||||
declare module "node:path/posix" {
|
declare module 'node:path/posix' {
|
||||||
import path = require("path/posix");
|
import path = require('path/posix');
|
||||||
export = path;
|
export = path;
|
||||||
}
|
}
|
||||||
declare module "node:path/win32" {
|
declare module 'node:path/win32' {
|
||||||
import path = require("path/win32");
|
import path = require('path/win32');
|
||||||
export = path;
|
export = path;
|
||||||
}
|
}
|
||||||
|
|||||||
142
node_modules/@types/node/perf_hooks.d.ts
generated
vendored
Normal file → Executable file
142
node_modules/@types/node/perf_hooks.d.ts
generated
vendored
Normal file → Executable file
@@ -7,10 +7,9 @@
|
|||||||
* * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
|
* * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
|
||||||
* * [Performance Timeline](https://w3c.github.io/performance-timeline/)
|
* * [Performance Timeline](https://w3c.github.io/performance-timeline/)
|
||||||
* * [User Timing](https://www.w3.org/TR/user-timing/)
|
* * [User Timing](https://www.w3.org/TR/user-timing/)
|
||||||
* * [Resource Timing](https://www.w3.org/TR/resource-timing-2/)
|
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const { PerformanceObserver, performance } = require('node:perf_hooks');
|
* const { PerformanceObserver, performance } = require('perf_hooks');
|
||||||
*
|
*
|
||||||
* const obs = new PerformanceObserver((items) => {
|
* const obs = new PerformanceObserver((items) => {
|
||||||
* console.log(items.getEntries()[0].duration);
|
* console.log(items.getEntries()[0].duration);
|
||||||
@@ -27,11 +26,11 @@
|
|||||||
* performance.measure('A to B', 'A', 'B');
|
* performance.measure('A to B', 'A', 'B');
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/perf_hooks.js)
|
||||||
*/
|
*/
|
||||||
declare module "perf_hooks" {
|
declare module 'perf_hooks' {
|
||||||
import { AsyncResource } from "node:async_hooks";
|
import { AsyncResource } from 'node:async_hooks';
|
||||||
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net";
|
type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
|
||||||
interface NodeGCPerformanceDetail {
|
interface NodeGCPerformanceDetail {
|
||||||
/**
|
/**
|
||||||
* When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
|
* When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
|
||||||
@@ -47,7 +46,6 @@ declare module "perf_hooks" {
|
|||||||
readonly flags?: number | undefined;
|
readonly flags?: number | undefined;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The constructor of this class is not exposed to users directly.
|
|
||||||
* @since v8.5.0
|
* @since v8.5.0
|
||||||
*/
|
*/
|
||||||
class PerformanceEntry {
|
class PerformanceEntry {
|
||||||
@@ -87,24 +85,6 @@ declare module "perf_hooks" {
|
|||||||
* @since v16.0.0
|
* @since v16.0.0
|
||||||
*/
|
*/
|
||||||
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
|
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._
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
||||||
@@ -166,10 +146,7 @@ declare module "perf_hooks" {
|
|||||||
* @param util1 The result of a previous call to eventLoopUtilization()
|
* @param util1 The result of a previous call to eventLoopUtilization()
|
||||||
* @param util2 The result of a previous call to eventLoopUtilization() prior to util1
|
* @param util2 The result of a previous call to eventLoopUtilization() prior to util1
|
||||||
*/
|
*/
|
||||||
type EventLoopUtilityFunction = (
|
type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization;
|
||||||
util1?: EventLoopUtilization,
|
|
||||||
util2?: EventLoopUtilization,
|
|
||||||
) => EventLoopUtilization;
|
|
||||||
interface MarkOptions {
|
interface MarkOptions {
|
||||||
/**
|
/**
|
||||||
* Additional optional detail to include with the mark.
|
* Additional optional detail to include with the mark.
|
||||||
@@ -214,44 +191,14 @@ declare module "perf_hooks" {
|
|||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
clearMarks(name?: string): void;
|
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.
|
* Creates a new PerformanceMark entry in the Performance Timeline.
|
||||||
* A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
|
* A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
|
||||||
* and whose performanceEntry.duration is always 0.
|
* and whose performanceEntry.duration is always 0.
|
||||||
* Performance marks are used to mark specific significant moments in the Performance Timeline.
|
* Performance marks are used to mark specific significant moments in the Performance Timeline.
|
||||||
* @param name
|
* @param name
|
||||||
* @return The PerformanceMark entry that was created
|
|
||||||
*/
|
*/
|
||||||
mark(name?: string, options?: MarkOptions): PerformanceMark;
|
mark(name?: string, options?: MarkOptions): void;
|
||||||
/**
|
/**
|
||||||
* Creates a new PerformanceMeasure entry in the Performance Timeline.
|
* Creates a new PerformanceMeasure entry in the Performance Timeline.
|
||||||
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
|
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
|
||||||
@@ -266,10 +213,9 @@ declare module "perf_hooks" {
|
|||||||
* @param name
|
* @param name
|
||||||
* @param startMark
|
* @param startMark
|
||||||
* @param endMark
|
* @param endMark
|
||||||
* @return The PerformanceMeasure entry that was created
|
|
||||||
*/
|
*/
|
||||||
measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
|
measure(name: string, startMark?: string, endMark?: string): void;
|
||||||
measure(name: string, options: MeasureOptions): PerformanceMeasure;
|
measure(name: string, options: MeasureOptions): void;
|
||||||
/**
|
/**
|
||||||
* An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
|
* An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
|
||||||
*/
|
*/
|
||||||
@@ -303,8 +249,8 @@ declare module "perf_hooks" {
|
|||||||
* ```js
|
* ```js
|
||||||
* const {
|
* const {
|
||||||
* performance,
|
* performance,
|
||||||
* PerformanceObserver,
|
* PerformanceObserver
|
||||||
* } = require('node:perf_hooks');
|
* } = require('perf_hooks');
|
||||||
*
|
*
|
||||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||||
* console.log(perfObserverList.getEntries());
|
* console.log(perfObserverList.getEntries());
|
||||||
@@ -324,8 +270,6 @@ declare module "perf_hooks" {
|
|||||||
* * }
|
* * }
|
||||||
* * ]
|
* * ]
|
||||||
*
|
*
|
||||||
* performance.clearMarks();
|
|
||||||
* performance.clearMeasures();
|
|
||||||
* observer.disconnect();
|
* observer.disconnect();
|
||||||
* });
|
* });
|
||||||
* obs.observe({ type: 'mark' });
|
* obs.observe({ type: 'mark' });
|
||||||
@@ -344,8 +288,8 @@ declare module "perf_hooks" {
|
|||||||
* ```js
|
* ```js
|
||||||
* const {
|
* const {
|
||||||
* performance,
|
* performance,
|
||||||
* PerformanceObserver,
|
* PerformanceObserver
|
||||||
* } = require('node:perf_hooks');
|
* } = require('perf_hooks');
|
||||||
*
|
*
|
||||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||||
* console.log(perfObserverList.getEntriesByName('meow'));
|
* console.log(perfObserverList.getEntriesByName('meow'));
|
||||||
@@ -373,9 +317,6 @@ declare module "perf_hooks" {
|
|||||||
* * ]
|
* * ]
|
||||||
*
|
*
|
||||||
* console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
|
* console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
|
||||||
*
|
|
||||||
* performance.clearMarks();
|
|
||||||
* performance.clearMeasures();
|
|
||||||
* observer.disconnect();
|
* observer.disconnect();
|
||||||
* });
|
* });
|
||||||
* obs.observe({ entryTypes: ['mark', 'measure'] });
|
* obs.observe({ entryTypes: ['mark', 'measure'] });
|
||||||
@@ -393,8 +334,8 @@ declare module "perf_hooks" {
|
|||||||
* ```js
|
* ```js
|
||||||
* const {
|
* const {
|
||||||
* performance,
|
* performance,
|
||||||
* PerformanceObserver,
|
* PerformanceObserver
|
||||||
* } = require('node:perf_hooks');
|
* } = require('perf_hooks');
|
||||||
*
|
*
|
||||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||||
* console.log(perfObserverList.getEntriesByType('mark'));
|
* console.log(perfObserverList.getEntriesByType('mark'));
|
||||||
@@ -414,8 +355,6 @@ declare module "perf_hooks" {
|
|||||||
* * }
|
* * }
|
||||||
* * ]
|
* * ]
|
||||||
*
|
*
|
||||||
* performance.clearMarks();
|
|
||||||
* performance.clearMeasures();
|
|
||||||
* observer.disconnect();
|
* observer.disconnect();
|
||||||
* });
|
* });
|
||||||
* obs.observe({ type: 'mark' });
|
* obs.observe({ type: 'mark' });
|
||||||
@@ -428,9 +367,6 @@ declare module "perf_hooks" {
|
|||||||
getEntriesByType(type: EntryType): PerformanceEntry[];
|
getEntriesByType(type: EntryType): PerformanceEntry[];
|
||||||
}
|
}
|
||||||
type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
|
type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
|
||||||
/**
|
|
||||||
* @since v8.5.0
|
|
||||||
*/
|
|
||||||
class PerformanceObserver extends AsyncResource {
|
class PerformanceObserver extends AsyncResource {
|
||||||
constructor(callback: PerformanceObserverCallback);
|
constructor(callback: PerformanceObserverCallback);
|
||||||
/**
|
/**
|
||||||
@@ -444,11 +380,11 @@ declare module "perf_hooks" {
|
|||||||
* ```js
|
* ```js
|
||||||
* const {
|
* const {
|
||||||
* performance,
|
* performance,
|
||||||
* PerformanceObserver,
|
* PerformanceObserver
|
||||||
* } = require('node:perf_hooks');
|
* } = require('perf_hooks');
|
||||||
*
|
*
|
||||||
* const obs = new PerformanceObserver((list, observer) => {
|
* const obs = new PerformanceObserver((list, observer) => {
|
||||||
* // Called once asynchronously. `list` contains three items.
|
* // Called three times synchronously. `list` contains one item.
|
||||||
* });
|
* });
|
||||||
* obs.observe({ type: 'mark' });
|
* obs.observe({ type: 'mark' });
|
||||||
*
|
*
|
||||||
@@ -460,13 +396,13 @@ declare module "perf_hooks" {
|
|||||||
observe(
|
observe(
|
||||||
options:
|
options:
|
||||||
| {
|
| {
|
||||||
entryTypes: ReadonlyArray<EntryType>;
|
entryTypes: ReadonlyArray<EntryType>;
|
||||||
buffered?: boolean | undefined;
|
buffered?: boolean | undefined;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: EntryType;
|
type: EntryType;
|
||||||
buffered?: boolean | undefined;
|
buffered?: boolean | undefined;
|
||||||
},
|
}
|
||||||
): void;
|
): void;
|
||||||
}
|
}
|
||||||
namespace constants {
|
namespace constants {
|
||||||
@@ -551,7 +487,7 @@ declare module "perf_hooks" {
|
|||||||
}
|
}
|
||||||
interface RecordableHistogram extends Histogram {
|
interface RecordableHistogram extends Histogram {
|
||||||
/**
|
/**
|
||||||
* @since v15.9.0, v14.18.0
|
* @since v15.9.0
|
||||||
* @param val The amount to record in the histogram.
|
* @param val The amount to record in the histogram.
|
||||||
*/
|
*/
|
||||||
record(val: number | bigint): void;
|
record(val: number | bigint): void;
|
||||||
@@ -560,14 +496,9 @@ declare module "perf_hooks" {
|
|||||||
* previous call to `recordDelta()` and records that amount in the histogram.
|
* previous call to `recordDelta()` and records that amount in the histogram.
|
||||||
*
|
*
|
||||||
* ## Examples
|
* ## Examples
|
||||||
* @since v15.9.0, v14.18.0
|
* @since v15.9.0
|
||||||
*/
|
*/
|
||||||
recordDelta(): void;
|
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._
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
||||||
@@ -582,7 +513,7 @@ declare module "perf_hooks" {
|
|||||||
* detect.
|
* detect.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
* const { monitorEventLoopDelay } = require('perf_hooks');
|
||||||
* const h = monitorEventLoopDelay({ resolution: 20 });
|
* const h = monitorEventLoopDelay({ resolution: 20 });
|
||||||
* h.enable();
|
* h.enable();
|
||||||
* // Do something.
|
* // Do something.
|
||||||
@@ -617,23 +548,10 @@ declare module "perf_hooks" {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns a `RecordableHistogram`.
|
* Returns a `RecordableHistogram`.
|
||||||
* @since v15.9.0, v14.18.0
|
* @since v15.9.0
|
||||||
*/
|
*/
|
||||||
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
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" {
|
declare module 'node:perf_hooks' {
|
||||||
export * from "perf_hooks";
|
export * from 'perf_hooks';
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user